query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d11f21b93da0b3b963da5e314eb274e3
COURSES / Check for role middleware
[ { "docid": "932d5e3ae6eb49cc9433a1d90ef86175", "score": "0.67108375", "text": "function checkRole(role1, role2) {\n return (req,res,next) => {\n if(req.user && req.user.role === role1\n || req.user && req.user.role === role2) {\n next()\n }\n else {\n res.redirect('/')\n }\n }\n}", "title": "" } ]
[ { "docid": "241b6525d8c2147ca3dc52080e8bf8f7", "score": "0.7919686", "text": "function checkRole(req, res, next){\n\t\tnext()\n\t}", "title": "" }, { "docid": "9c512f1a5f5a04dd09b2bd8d1371e1f8", "score": "0.7399598", "text": "function checkRoles(req, res, next) {\n console.log(req.isAuthenticated())\n if (req.isAuthenticated() && req.user.role === \"BOSS\") {\n return next();\n } else {\n res.redirect('/login')\n }\n}", "title": "" }, { "docid": "d5a9de81863a2f8c4f13ddef7b4c15e3", "score": "0.7362655", "text": "function checkRole(role) {\n return function(request, response, next) {\n const assignedRoles = request.user[`${process.env.VUE_APP_API_URL}/roles`]; //auth0 rule shared with react implementation\n if (Array.isArray(assignedRoles) && assignedRoles.includes(role)) {\n return next(); // DEVNOTE: calling next allows the next process in the chain to continue\n } else {\n return response.status(401).send(\"Insufficient role\"); // Throw unauthorised\n }\n };\n}", "title": "" }, { "docid": "a62372eda77bb06ee788e356c377508e", "score": "0.71692866", "text": "function checkRole(req, res, next){\n const {userRole} = req.token\n if(userRole !== \"owner\"){\n res.status(400).json({\n message: \"Role doesn't have permission\"\n })\n } else {\n next();\n }\n}", "title": "" }, { "docid": "bdcc18fb12e1b8d78708697ea9fd9424", "score": "0.70528674", "text": "function authorizeRole(req, res, next) {\n const user = req.user;\n // check for permissions\n const method;\n const url;\n\n // Check for permission\n\n // If not authorized, send error status\n\n // else, call next()\n\n}", "title": "" }, { "docid": "b8097d3ee6b38f61209b5a964992e031", "score": "0.70158416", "text": "function checkRole(role){\n return function(req,res,next){\n //next()\n if(req.jwt.role === role){\n next()\n }else{\n res.status(403).json({message: 'you are not an admin'})\n }\n}\n}", "title": "" }, { "docid": "9b359260f2eee5219bc8bc04e014892f", "score": "0.69562733", "text": "function authRole(role){\r\n return (req,res,next)=>{\r\n const userRole = req.header('role')\r\n if(userRole !== role){\r\n res.status(401)\r\n return res.send('Not allowed')\r\n }\r\n next()\r\n }\r\n \r\n\r\n}", "title": "" }, { "docid": "eba80e57ce6f27916ce656a39cde2b67", "score": "0.6866434", "text": "function role(roleName) {\n return function (req, res, next) {\n let role = req.headers.role\n\n if (role === roleName) {\n next();\n } else {\n res.status(403).json({ you: 'have no power here' })\n\n }\n }\n}", "title": "" }, { "docid": "7425dc2d07f4a7534f255b6542ecaf73", "score": "0.6844692", "text": "function checkRoles(role) {\n return function (req, res, next) {\n if (req.isAuthenticated() && req.user.role === \"ADMIN\") {\n return next();\n } else {\n res.status(400).json({ message: \"Seul l'administrateur peut acceder à ce contenu\"});\n }\n };\n}", "title": "" }, { "docid": "53a32ac10a16a6858de3fb817aa31879", "score": "0.6802608", "text": "function hasRole(role) {\n var Response = require('./httpResponse');\n var jwt = require('jsonwebtoken');\n\n return function (req, res, next) {\n if (!req.header('Authorization')) {\n Response.Unauthorized(res, 'No Authorization header');\n return;\n }\n\n var header = req.header('Authorization').split(' ');\n if (header.length !== 2 || header[0] !== 'JWT') {\n Response.Unauthorized(res, 'Bad Authorization type');\n return;\n }\n\n var token = header[1];\n var roles = {user: 0, admin: 1};\n jwt.verify(token, jwtSecret, function(err, decoded) {\n if (decoded && (roles[decoded.role] >= roles[role])) {\n req.decodedToken = decoded;\n return next();\n }\n else if (err) {\n if (err.name === 'TokenExpiredError')\n Response.Unauthorized(res, 'Expired token');\n else (err )\n Response.Unauthorized(res, 'Invalid token');\n return;\n }\n else {\n Response.Forbidden(res, 'Insufiscient privileges');\n return;\n }\n });\n };\n}", "title": "" }, { "docid": "92cc77c286c90169624c592cb3ab21d2", "score": "0.6711212", "text": "function isAuthorizedForRole(req, role) {\n if (req.isAuthenticated()) {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "5a340ae87ff13cc12b5ef7a7690afb7a", "score": "0.6704265", "text": "async function checkRole (req, res, next) {\n const { user_id, team_id } = req.params;\n const teamId = req.body.team_id;\n\n if(!teamId){\n next();\n } else if (!team_id){\n const member = await teamMembersDB.getTeamMember(user_id, teamId);\n\n if(!member){\n res.status(401).json({ error: 'You are not a Member of this Team'});\n } else {\n next();\n }\n } else {\n const member = await teamMembersDB.getTeamMember(user_id, team_id);\n\n if(!member){\n res.status(401).json({ error: 'You are not a Member of this Team'});\n } else {\n\n if(member.role !== 'team_owner'){\n res.status(401).json({ error: 'Only Team Owners can do this'});\n } else {\n next();\n }\n }\n }\n}", "title": "" }, { "docid": "50e3ddf5fb0db97328eef5d2c6d5f746", "score": "0.6685527", "text": "_roleAccepted(endpointContext, endpoint) {\n if (endpoint.roleRequired) {\n if (_.isEmpty(_.intersection(endpoint.roleRequired, endpointContext.user.roles))) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "c1be46148d0b75eacf25617ed3c74348", "score": "0.6679567", "text": "function checkPermission(roles) {\n return function(req, res, next) {\n if (!roles.includes(req.role))\n return ReE(res, 'Access denied');\n else next();\n }\n}", "title": "" }, { "docid": "2d47bc2a20da345c34b29e1f9ca1202a", "score": "0.667955", "text": "function hasRole(roleRequired) {\n if (!roleRequired) {throw new Error('Required role needs to be set');}\n\n return compose()\n .use(function meetsRequirements(req, res, next) {\n if (!config.secureApi) { return next(); }\n if (!req.user) {return res.status(404);}\n\n if (config.userRoles.indexOf(req.user.role) >= config.userRoles.indexOf(roleRequired)) {\n next();\n }\n else {\n res.status(403).json({message: 'You don\\'t have the authority for that'});\n }\n });\n}", "title": "" }, { "docid": "d903bb063cbc9e3a0c6bffbda09f5611", "score": "0.6678888", "text": "function checkRoles(role) {\n return function (req, res, next) {\n if (req.isAuthenticated() && req.user.role === role) {\n return next();\n }\n res.redirect('/login');\n };\n}", "title": "" }, { "docid": "033253c5206577a77f548455b543afc6", "score": "0.66718924", "text": "static Authorize(req, res, role) {\n return __awaiter(this, void 0, void 0, function* () {\n // Checks if a token is provided\n const token = req.header('x-access-token');\n if (!token) {\n return false;\n }\n const verify = this.verify(token, process.env.TOKEN_SECRET, role);\n if (!verify) {\n return false;\n }\n else if (verify) {\n return true;\n }\n });\n }", "title": "" }, { "docid": "8901b1e7b211f49f6a581cbc8b061e21", "score": "0.6666722", "text": "function role(name) {\n return function (req, res, next) {\n if (req.session.user.role === name) {\n next();\n } else {\n res.send(403);\n }\n };\n}", "title": "" }, { "docid": "cfecfe0aa2fcc01a6862063f963c7a12", "score": "0.66351557", "text": "isInRole (role) {\n let user = this.get('currentUser');\n\n if (user) {\n return user.role === role;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "58c7fa2698304ec3d320bd5da9ff6cf4", "score": "0.6608242", "text": "function authRole(req, res, next){\r\n\t\tUser.findById(req._passport.session.user,function(err,u){\r\n\t\t\tif(err){\r\n\t\t\t\tres.status(404).send(\"Error\");\r\n\t\t\t}\r\n\t\t\tif(u.role !== \"cont\"){\r\n\t\t\t\treturn res.redirect('/switchUser');\r\n\t\t\t}\r\n\t\t\tnext();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "2f3a43764ebe7a82056ebb390aabf26a", "score": "0.66000843", "text": "function hasRole(roleRequired) {\n if (!roleRequired) {\n throw new Error('Required role needs to be set');\n }\n const [ignoreObjectIdValidation, structuredValidation] = getValidationType(Array.prototype.slice.call(arguments, 1));\n const valFn = ignoreObjectIdValidation ? skipObjectIdValidation : validateObjectIds;\n\n return compose()\n .use(isAuthenticated())\n .use(function meetsRequirements(req, res, next) {\n if (config.userRoles.indexOf(req.user.role) >= config.userRoles.indexOf(roleRequired)) {\n next();\n } else {\n res.status(403).send('Forbidden');\n }\n })\n // Make sure that corporate admins and employees only modify the companies or stores they're related to\n .use((req, res, next) => {\n // If a corporate admin is requested, and the company is in the request, check to make sure it's the right company\n if (roleRequired === 'corporate-admin' && req.user.role === 'corporate-admin' && req.params.companyId) {\n // Compare requested company with user company\n if (req.user.company.toString() === req.params.companyId) {\n return next();\n } else {\n return res.status(403).send('Incorrect company');\n }\n }\n // Check to make sure the employee is requesting the store they work for\n if (roleRequired === 'employee' && req.user.role === 'employee' && req.params.storeId) {\n if (req.user.store.toString() === req.params.storeId) {\n return next();\n } else {\n return res.status(403).send('Invalid store');\n }\n }\n next();\n })\n .use(valFn)\n .use(checkStructuredValidation(structuredValidation));\n}", "title": "" }, { "docid": "5c8766c7f53e4fa6aba1e45a3b9fca2b", "score": "0.6592148", "text": "function authRole(role){\n return function (req, res, next){\n const bearerHeader = req.headers['authorization'];\n if(bearerHeader){\n const bearerToken = bearerHeader.split(' ')[1];\n const decoded = jwt.verify(bearerToken, 'secretkey')\n getUserByRoleAndId(decoded.id, role)\n .then(user => {\n if(user) {\n next();\n } else {\n res.status(403).json({error: \"Unauthorized\"});\n }\n })\n .catch(err => {\n res.status(500).json({error: VError.info(err).message});\n });\n } else{\n res.status(401).json({error: \"Unauthenticated\"})\n }\n }\n}", "title": "" }, { "docid": "83f5f9ee45dfe6d70bf30dd1d1f81fb0", "score": "0.6588348", "text": "function authRole(role1, role2) {\n return (req, res, next) => {\n if (req.user.local.role !== role1 && req.user.local.role !== role2) {\n res.status(401)\n return false\n }\n \n next()\n }\n }", "title": "" }, { "docid": "3ce97132f5c6740db2f267757ad6ff81", "score": "0.6503125", "text": "static authRole(opt) {\n opt = Object.assign({\n roleRequired: 0\n }, opt);\n\n const authNormal = Session.auth(opt);\n return async (ctx, next) => {\n // console.log('User Role: ' + ctx.session.role + ' | Role Required: ' + opt.roleRequired);\n if (ctx.session.role < opt.roleRequired) {\n ctx.throw(401, 'Unauthorized');\n }\n\n await authNormal(ctx, next);\n };\n }", "title": "" }, { "docid": "afb35cf7cc45db1c41670696692c1b9d", "score": "0.64810467", "text": "function hasPermission(role, route) {\n // console.log(route.meta)\n if (route.meta && route.meta.roles) {\n return route.meta.roles.includes(role)\n } else {\n return true\n }\n}", "title": "" }, { "docid": "0fa56401d256a9c0abcfdbd1abf0a0f1", "score": "0.6481022", "text": "function checkIfAllowedByRole() {\n\t\tif(!$scope.isAdmin()) {\n\t\t\t$state.go('welcome', {});\n\t\t}\n\t}", "title": "" }, { "docid": "87b17c37b278baca80ff717f6fe5cce7", "score": "0.64778733", "text": "async function verifyRole(role, req, res, next) {\n // accedemos a la prop del req que seteamos en verifyToken\n const user = await User.findById(req.userId);\n\n // verificamos los roles del user por id de rol\n const roles = await Role.find({ _id: { $in: user.roles } });\n\n for (let i = 0; i < roles.length; i++) {\n if (roles[i].name === role) {\n next();\n return;\n }\n }\n\n res.status(403).json({ message: `Require ${role} role.` });\n}", "title": "" }, { "docid": "2e74133129dd80dec9fc64d8c14f0886", "score": "0.6462838", "text": "function isMeOrHasRole(roleRequired) {\n return compose()\n .use(function checkIsMe(req, res, next) {\n if (!config.secureApi) { return next(); }\n var userId = req.params.id;\n if (req.user.id) {\n if (req.user.id === userId) {\n next();\n } else {\n if (compareRole(roleRequired, req.user.role)) {\n next();\n } else {\n res.status(403).json({message: 'You don\\'t have the authority for that'});\n }\n }\n } else {\n res.sendStatus(401);\n }\n });\n}", "title": "" }, { "docid": "f8212bdc36ec5a54a8965deab3385099", "score": "0.64302266", "text": "isUserRole(role){\n let user = this.getAuthUser();\n\n return (\n Utility.isObject(user)\n && Utility.isObject(user.userRole)\n && user.userRole.name === role\n );\n }", "title": "" }, { "docid": "53965c870538014fdcc8d187c9dca370", "score": "0.6399996", "text": "function hasRole(roleRequired) {\n if (!roleRequired) throw new Error('Required role needs to be set');\n\n return compose()\n .use(isAuthenticated())\n .use(function meetsRequirements(req, res, next) {\n if (req.hasAccess) {\n return next();\n }\n if (config.userRoles.indexOf(req.user.role) >= config.userRoles.indexOf(roleRequired)) {\n return next();\n }\n else {\n res.send(403);\n }\n });\n}", "title": "" }, { "docid": "a28f588ddc8fef630788ecf3b1aca41b", "score": "0.6384833", "text": "function checkRolePermission(...allowed) {\n const isAllowed = role => allowed.indexOf(role) > -1;\n\n // return a middleware\n return (req, res, next) => {\n if (req.claims && isAllowed(req.claims.role))\n next(); // role is allowed, continue to the next middleware\n else {\n res.status(403).send(\"Forbidden\");\n }\n }\n}", "title": "" }, { "docid": "0084ac258af8ac0bd8faca556883eb8c", "score": "0.63838625", "text": "function checkAccessRights(req, res, next) {\n next();\n}", "title": "" }, { "docid": "c6c829d3570bc7754410b928b48b657d", "score": "0.63613874", "text": "function secureRoute(role){\n return function(req, res, next) {\n if(req.session.role !== role){\n res.status(401).json({msg: \"Access denied. Please login with the correct access privileges\"})\n return\n }\n next()\n }\n}", "title": "" }, { "docid": "7e30aabf4a40022838cac3172de6a340", "score": "0.63559926", "text": "function restrictedToRole(role) {\n return function(req, res, next) {\n if (req.user.role <= role) {\n next();\n } else {\n console.log('User role is ' + req.user.role + ' and requirement is ' + role);\n next(new Error('Insufficient permissions'));\n }\n };\n}", "title": "" }, { "docid": "ce5eb3270313427a525d58be5435bc35", "score": "0.63383245", "text": "static agentCheck(req, res, next) {\n !req.user.isagent ? errHandle(403, 'Only agent can access this service', res) : next();\n }", "title": "" }, { "docid": "0bf87d36113d65da545bd82ccfe81dd7", "score": "0.63147587", "text": "function hasRole(roleRequired) {\n if (!roleRequired) throw new Error('Required role needs to be set');\n\n return compose()\n .use(isAuthenticated())\n .use(function meetsRequirements(req, res, next) {\n if (ROLES.indexOf(req.user.role) >= ROLES.indexOf(roleRequired)) {\n next();\n }\n else {\n res.status(403).json({err: 'Forbidden. You do not have required permissions', response: null});\n }\n });\n}", "title": "" }, { "docid": "0b2f6ec0ebf7c8f1a902ee9ad69c102f", "score": "0.6303248", "text": "function authorizeRole(roles = []){\n // Decide whether the parameter passed is an array or single value\n if(typeof roles == 'string'){\n roles = [roles];\n }\n\n // Return the midddleware function to authorize the user\n return function(req, res, next){\n\n // Verify that the user is authorized based on allowed roles\n if(roles.length && !roles.includes(res.locals.userRole)){\n // Throw Unauthorized error\n const error = new Error();\n error.name = \"InvalidRoleError\";\n throw error;\n }\n\n next();\n }\n}", "title": "" }, { "docid": "016bc2ee5f7707e5f51f09e4c96d76a2", "score": "0.62886596", "text": "function isTutor(req, res, next) {\n var user = req.user;\n if (user.roles.indexOf('tutor') > -1) {\n next();\n } else {\n res.status(403).end();\n }\n}", "title": "" }, { "docid": "8979992c53f2dfefdc9a8d62272eaba1", "score": "0.62681973", "text": "function hasRole(roleRequired) {\n if (!roleRequired) throw new Error('Required role needs to be set');\n\n return compose()\n .use(isAuthenticated())\n .use(function meetsRequirements(req, res, next) {\n if (config.userRoles.indexOf(req.user.role) >= config.userRoles.indexOf(roleRequired)) {\n next();\n }\n else {\n next(new errors.PermissionDeniedError())\n }\n });\n}", "title": "" }, { "docid": "bd9a9e284442c2ff77ca0179de286196", "score": "0.62601787", "text": "function JwtRoleVerify (req, res, next) {\n // error to throw when no token is present\n const err = new APIError('No token is present', httpStatus.UNAUTHORIZED, true)\n // check that token is present in the request\n const token = req.body.token || req.params.token || req.headers['x-access-token']\n if (token) {\n // verify the token against the secret\n jwt.verify(token, config.jwtSecret, function (e) {\n // handle error, or otherwise continue to the next middleware\n if (e) {\n return next(err)\n } else {\n var decoded = jwt.decode(token)\n var name = decoded.username\n const staffErr = new APIError('Staff is not allowed to change user data', httpStatus.UNAUTHORIZED, true)\n const userErr = new APIError('Username is not find', httpStatus.UNAUTHORIZED, true)\n User.findOne({username: name}, function(errr, user) {\n if(errr){\n console.log('not find user')\n return next(userErr)\n }\n else{\n if(user.role === 'admin'){\n return next()\n }\n else {\n return next(staffErr)\n }\n }\n });\n }\n })\n } else {\n // return error if no token is provided\n return next(err)\n }\n}", "title": "" }, { "docid": "ca22dc5f1c66f48e858512a0a34022b5", "score": "0.6240114", "text": "function isAuthenticated(req, res, next) {\n if (req.user) {\n next(); // go on to next middleware in the pipeline\n } else {\n if (req.url === \"/role\") {\n res.redirect(\"/auth/google\");\n } else {\n res.redirect(\"/\");\n }\n }\n}", "title": "" }, { "docid": "73a4ee7592c58dfb2b503edb245dc6d8", "score": "0.62216365", "text": "async _middlewareAuthorize(ctx, next)\n\t{\n\t\tconst permittedAddresses = [\n\t\t\t'127.0.0.1',\n\t\t\t'::1'\n\t\t];\n\n\t\tif(permittedAddresses.includes(ctx.request.ip)) {\n\t\t\tthis.logger.info(`AuthenticationRelay relay authorize request from ${ctx.request.ip} passed`);\n\t\t\tawait next();\n\t\t}\n\t\telse {\n\t\t\tthis.logger.info(`AuthenticationRelay relay authorize request from ${ctx.request.ip} failed`);\n\t\t\treturn ctx.status = 401;\n\t\t}\n\t}", "title": "" }, { "docid": "a959cc158ee4c88a05852d7f59cc065e", "score": "0.62035656", "text": "hasRole(roleName) {\n let userToken = JSON.parse(\n localStorage.getItem(STORAGE_USER) || \"{}\"\n );\n return (\n userToken?.roles?.find((role) => role.authority === roleName) != null\n );\n }", "title": "" }, { "docid": "b65963c4d512c63bea3a085925c0ed72", "score": "0.62001455", "text": "function isAdmin(req,res,next) {\n if(req.isAuthenticated()) {\n if(req.user.role === 1){\n return next();\n } \n }\n // redirect to login page with a warning \"youve been logged out\"\n res.send(\"yikes\");\n}", "title": "" }, { "docid": "1a8015cc1efc71e79d1130f918a78a95", "score": "0.6199529", "text": "static isRouteAccessable(routename) {\n let user = Authorization.getAuthUser();\n let allow = (routename === \"configuration\" || routename === \"monitoring\" || routename === \"inventory\" || routename === \"user\" || routename === \"notifications\") ? true : false;\n if (user.role !== null && ROLES.indexOf(user.role) === -1) {\n Authorization.logout();\n toastr.error(\"Not able to login please contact admin\");\n }\n if ((user.role === null && allow) || (routes && user.role && routes[user.role] && routes[user.role].indexOf(routename) !== -1)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "2d5c82c2afe9c53ae54df110f5c4fbf8", "score": "0.61661094", "text": "function verifTokenInHeaders(req , res , next ) {\n console.log(`secureMode=${secureMode} standaloneMode=${standaloneMode} verifTokenInHeaders ...`)\n jwtUtil.extractSubjectWithRolesClaimFromJwtInAuthorizationHeader(req.headers.authorization)\n .then((claim)=>{\n if(checkAuthorizedPathFromRolesInJwtClaim(req.path, claim))\n next(); //ok valid jwt and role(s) in claim sufficient for authorize path\n else\n res.status(403).send({ error:\"Forbidden (valid jwt but no required role)\"});\n })\n .catch((err)=>{res.status(401).send({ error: \"Unauthorized \"+err?err:\"\" });});//401=Unauthorized or 403=Forbidden\n}", "title": "" }, { "docid": "b866134a3914f56a3fb7d0a09da81f42", "score": "0.6161206", "text": "function authRole(role) {\n return (req, res, next) => {\n if (req.user.role !== role) {\n res.status(401);\n return res.send(\"Not allowed\");\n }\n\n next();\n };\n}", "title": "" }, { "docid": "65941c34d87e113838c28ff3f037b332", "score": "0.6154658", "text": "function isAdmin (req, res, next) {\n user = req.user\n if (user.roles.indexOf(\"admin\") < 1) {\n res.send(403);\n } else if (!req.isAuthenticated()) {\n res.send(403); \n }\n }", "title": "" }, { "docid": "ea02a312f8571031c978014c2b2dec0f", "score": "0.6153852", "text": "isAuthorised() {\n var isAllowed = false;\n var roles = Roles.find({\n $or: [\n { name: 'Manager' },\n { name: 'Coach' }\n ]\n }).fetch();\n const LoggedUserRoleId = Meteor.user().roleId;\n if (roles && roles.length) {\n for (var i = 0; i < roles.length; i++) {\n if (LoggedUserRoleId === roles[i]._id) {\n isAllowed = true;\n }\n }\n }\n if (Meteor.user().isAdmin || isAllowed) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "005ee33abfe755343b507532f141b36e", "score": "0.61515677", "text": "hasRole(role) {\n const roles = this.getRoles()\n if (roles.includes(role)) {\n return true\n }\n return false\n }", "title": "" }, { "docid": "106da715a42e677d68281aa48128fa54", "score": "0.6140206", "text": "function isPlanillero(req, res, next) {\n\n // if user is authenticated in the session, carry on \n if ((req.isAuthenticated()) && ( (req.user.role == \"PLANILLERO\") || (req.user.role == \"ADMIN\") ||(req.user.role == \"SUPER_ADMIN\")))\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n}", "title": "" }, { "docid": "7d417f9efd36aff0fe740039d87c39cf", "score": "0.6111364", "text": "async requireRole(req, doc, options) {\n if (![ 'guest', 'editor', 'contributor', 'admin' ].includes(doc.role)) {\n throw self.apos.error('invalid', 'The role property of a user must be guest, editor, contributor or admin');\n }\n }", "title": "" }, { "docid": "3d8cab8da15a5c9a697cf9700d75b30a", "score": "0.6100191", "text": "function checkRoleValues(req, res, next) {\n const user = req.body.user;\n if (\n Array.isArray(user.roles) &&\n req.payload.roles.indexOf('admin') === -1 &&\n user.roles.indexOf('admin') >= 0\n ) {\n return res.status(403).json({\n errors: [\n {\n code: 403,\n location: 'body',\n message:\n 'Not permitted to create or update users with the provided roles'\n }\n ]\n });\n }\n\n next();\n}", "title": "" }, { "docid": "8f0ef742f40c38874c5f9f63191778dc", "score": "0.609685", "text": "function memberOnly(req, res, next) {\n // console.log(`\\nSession info: ${JSON.stringify(req.session)} \\n`);\n if (req.session.user.role === \"guest\") {\n res.status(401).json({ error: \"Forbidden\" });\n } else {\n next();\n }\n}", "title": "" }, { "docid": "cad72e9422bfaebef538d522289907e8", "score": "0.60788184", "text": "isInAnyRole (roles) {\n let result = false;\n // check that we have an array\n if (Ember.isArray(roles)) {\n for (var i = 0; i < roles.length; i++) {\n if (this.isInRole(roles[i])) {\n result = true;\n }\n }\n } else {\n Ember.warn('Session.isInAnyRole was not passed an array. Please use .isInRole instead.');\n }\n return result;\n }", "title": "" }, { "docid": "af1d5bf928ead5a0a3c531a1c29878b1", "score": "0.60780275", "text": "function isAdmin(req, res, next) {\n\tif(req.user.role === 'Admin') {\n\t\treturn next();\n\t} else {\n\t\tres.status(401).send({ success: false, message: 'Unauthorized' });\n\t}\n}", "title": "" }, { "docid": "c4681230d6be7ea61d38e2fb042a50bd", "score": "0.60731864", "text": "function adminOnly(req, res, next) {\n if (req.session.user.role !== \"admin\") {\n // console.log(`role is: ${req.session.user.role}`);\n res.status(401).json({ error: \"Forbidden\" });\n } else {\n next();\n }\n}", "title": "" }, { "docid": "fbf5dd2872cf7b615a35740b18d70f4c", "score": "0.60632944", "text": "function isAdmin(req, res, next){\n // check if logged in and admin\n var user = req.isAuthenticated() ? req.user : '0';\n if (user && user.roles.indexOf('admin') >= 0){\n next();\n } else {\n res.send(403);\n }\n }", "title": "" }, { "docid": "b75871d22e586623f4c468a05c41402d", "score": "0.60621536", "text": "function isAdminRole() {\n const role = _get(socket, 'handshake.role');\n const status = _get(socket, 'handshake.status');\n return (role === 'admin' || role === 'sales') && status === 'active';\n }", "title": "" }, { "docid": "21d8083cbf98c0b218930e8630957565", "score": "0.6057926", "text": "function isAdmin(req, res, next) {\n const acsToken = req.get('Authorization');\n\n console.log(`acsToken ${acsToken}`);\n return jwtHandler.verifyUsrToken(acsToken)\n .then(function (tokenPayload) {\n req.user = tokenPayload;\n var role = tokenPayload.role\n if (role = constants.ROLES.ADMIN) {\n next();\n } else {\n throw exceptions.unAuthenticatedAccess(\"User Is not Admin.\");\n }\n }).catch(function (err) {\n var error = {};\n error.errorCode = 1;\n error.msg = \"Invalid Authorization\"\n next(error);\n });\n}", "title": "" }, { "docid": "48deec710a15cd8d04a9e3c075a81023", "score": "0.605387", "text": "function isAuthenticate(req, res, next){\n if(req.session.user && true){\n return next();\n }\n return res\n .status(403)\n .json({\"error\":\"No tiene autorizacion de usar este endpoint\"})\n ;\n }", "title": "" }, { "docid": "7a29ac21d0fc20013aadb0b8d19e0f86", "score": "0.6048397", "text": "function checkAdmin(req, res, next) {\n var actorId = req.headers.authorization;\n console.log(`CheckAdmin: ${actorId}`);\n if(!actorId) return res.status(400).send({ message: 'Authorization header not founded' });\n \n Actor.findById({ _id: actorId }, function (err, actor) {\n if (err) return res.status(500).send(err);\n if (!actor) return res.status(400).send({ message: `Administrator with ID ${actorId} not found` });\n if (actor.role[0] != 'ADMINISTRATOR') return res.status(500).send({ errors: `Actor with ID ${actorId} it's not a administrator` });\n \n next();\n \n });\n}", "title": "" }, { "docid": "aab681ebb60c14e2f040aca0d696d181", "score": "0.60440606", "text": "function extractRole(req, res, next) {\n\tif (!req.headers.authorization) {\n\t\tconst error = new ServerError('Cerere fara header de autorizare', 403);\n\t\treturn next(error);\n\t}\n\t// se separa dupa \" \" deoarece este de forma: Bearer 1wqeiquqwe0871238712qwe\n\tconst token = req.headers.authorization.split(\" \")[1];\n\n\tfields = [{value: token, type: 'jwt'}];\n\ttry {\n\t\tvalidateFields(fields);\n\t\tconst data = jwt.verify(token, process.env.JWT_SECRET_KEY, options);\n\t\treq.state = {data};\n\t\tnext();\n\t} catch(error) {\n\t\tconsole.trace(error);\n\t\tnext(error);\n\t}\n}", "title": "" }, { "docid": "50f756f546e0b957a0b0e348dca52ab9", "score": "0.60389346", "text": "function ensureAdmin(req, res, next) {\n if (req.isAuthenticated() && req.user.Role == 'Admin') {\n return next(); \n } else {\n res.redirect('/users/login'); \n }\n}", "title": "" }, { "docid": "6c3165b8ef295d0ef4c6238fb9520129", "score": "0.60371333", "text": "function isLoggedInADMINorMGR(req, res, next) {\n if (req.isAuthenticated())\n\t{\n\t\tif(req.user['local']['role'] == 'admin' || req.user['local']['role'] == 'manager')\n\t\t\treturn next();\n\t\telse\n\t\t\tres.redirect('/_only_admins_managers');\n\t\t\t\n\t}\n\n res.redirect('/login');\n}", "title": "" }, { "docid": "e7fd17fb51538b953753c9917a4b67c8", "score": "0.6034135", "text": "function isAdministrador(req, res, next) {\r\n console.log(req.user.cat_roles_idRol);\r\n // 1 = coordinador\r\n if (req.user.cat_roles_idRol == 1)\r\n return next();\r\n res.render('privileges');\r\n }", "title": "" }, { "docid": "77f3c8b0fddbb0bffe1320b261ad693d", "score": "0.5992751", "text": "function checkSponsor(req, res, next) {\n var actorId = req.headers.authorization;\n console.log(`CheckSponsor: ${actorId}`);\n if(!actorId) return res.status(400).send({ message: 'Authorization header not founded' });\n\n Actor.findById({ _id: actorId }, function (err, actor) {\n if (err) return res.status(500).send(err);\n if (!actor) return res.status(400).send({ message: `Sponsor wit ID ${actorId} not found` });\n if (actor.role[0] != 'SPONSOR') return res.status(400).send({ errors: `Actor with ID ${actorId} it's not a sponsor` });\n \n next();\n\n });\n}", "title": "" }, { "docid": "d852d2b9290bb816f24f4dba720a31de", "score": "0.59887654", "text": "function hasPermission (roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "d852d2b9290bb816f24f4dba720a31de", "score": "0.59887654", "text": "function hasPermission (roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "96d8316b73c8afd798e2c8d51baa4b69", "score": "0.5978837", "text": "function authorization(to, from, next) {\n let user = store.state.user;\n\n // a donde va de donde viene y lo que ejecuta \n if (user) {\n if (to.name === 'users' && !user.roles.includes('Admin')) {\n // si el rol del usuario no es admin\n return next('/');\n }\n }\n\n return next(); // continuar flujo\n}", "title": "" }, { "docid": "93979d6047d4669beabfb9fd6a4898c2", "score": "0.5963117", "text": "function checkAuthorisation(req,res,next){\n if(req.isAuthenticated()){\n Users.findOne({handlename:req.params.handlename},function(err,User){\n if(!User){\n req.flash(\"error\",\"User does not exist\");\n res.redirect(\"/\"); \n }else{\n if(err){\n console.log(err);\n res.redirect(\"back\");\n }else{\n if(req.user && User._id.equals(req.user._id)){\n next();\n }else{\n req.flash(\"error\",\"You are not allowed to do that\");\n res.redirect(\"/\");\n // res.send(\"You are not allowed to do it\")\n }\n }\n }\n })\n } \n }", "title": "" }, { "docid": "d520f4041fe28b39b41e074e4a760a1f", "score": "0.5962244", "text": "function hasPermission( roles, route ) {\n if ( route.meta && route.meta.roles ) {\n return roles.some( role => route.meta.roles.includes( role ) )\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c2a5df57058525f924d5caf15b240127", "score": "0.5931864", "text": "function checkHoistRole(cmd){\n\treturn cmd.message.member.hoistRole;\n}", "title": "" }, { "docid": "c877082b593532141f406d397897d0e2", "score": "0.59293586", "text": "function hasPermission(roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c877082b593532141f406d397897d0e2", "score": "0.59293586", "text": "function hasPermission(roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c877082b593532141f406d397897d0e2", "score": "0.59293586", "text": "function hasPermission(roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c877082b593532141f406d397897d0e2", "score": "0.59293586", "text": "function hasPermission(roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c877082b593532141f406d397897d0e2", "score": "0.59293586", "text": "function hasPermission(roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c877082b593532141f406d397897d0e2", "score": "0.59293586", "text": "function hasPermission(roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c877082b593532141f406d397897d0e2", "score": "0.59293586", "text": "function hasPermission(roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c877082b593532141f406d397897d0e2", "score": "0.59293586", "text": "function hasPermission(roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c877082b593532141f406d397897d0e2", "score": "0.59293586", "text": "function hasPermission(roles, route) {\n if (route.meta && route.meta.roles) {\n return roles.some(role => route.meta.roles.includes(role))\n } else {\n return true\n }\n}", "title": "" }, { "docid": "c253bbf83a43c4bfb06407afd25ac7fd", "score": "0.5921992", "text": "function getRole(req, res, next) {\n var sql = \"SELECT * FROM roles\";\n\n db.any(sql)\n .then(function (role) {\n res.status(200)\n .json({\n roles: role\n });\n });\n}", "title": "" }, { "docid": "c79e9611a2777dfe4fe9d9cf80f25e3b", "score": "0.590792", "text": "function hasRole(roleRequired) {\n if (!roleRequired) {\n throw new Error('Required role needs to be set');\n }\n\n if (!_.isArray(roleRequired)) {\n roleRequired = [roleRequired];\n }\n\n return compose()\n .use(isAuthenticated)\n .use(function meetsRequirements(req, res, next) {\n if (!req.user) {\n return res.status(403).send('Forbidden');\n }\n\n if (_.intersection(config.userRoles, roleRequired, [req.user.role]).length <= 0) {\n return res.status(403).send('Forbidden');\n }\n else {\n next();\n }\n });\n}", "title": "" }, { "docid": "e3e5a2741a045ee5310f8b474ba54612", "score": "0.5893059", "text": "function hasRole(mem, role){\r\n if(pluck(mem.roles).includes(role)){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "30ac7acf6f9a608e35a247c064d668f2", "score": "0.58880836", "text": "function tokenValidation(req, res, next) {\n if (req.headers.authorization != undefined){\n jwt.verify(req.headers.authorization, process.env.JWT_SECRET_KEY, (err, decode) => {\n if (decode){\n req.body.id = decode.data;\n req.role = decode.role;\n next();\n }else{\n res.send(\"invalid token\")\n }\n })\n }else{\n res.send(\"no token\")\n }\n}", "title": "" }, { "docid": "43fdef5cd8069798291016ebc19daa41", "score": "0.5884119", "text": "function isCheckedIn(req, res, next) {\n // Check that authorization header was sent\n if (req.headers.authorization) {\n // Get token from \"Bearer: Token\" string\n let token = req.headers.authorization.split(\" \")[1];\n // Try decoding the client's JWT using the server secret\n try {\n req._guest = jwt.decode(token, secret);\n } catch {\n res.status(403).json({ error: 'Token is not valid.' });\n }\n // If the decoded object has a name protected route can be used\n if (req._guest.name) return next();\n }\n // If no authorization header or guest has no name return a 403 error\n res.status(403).json({ error: 'Please check-in to recieve a token.' });\n}", "title": "" }, { "docid": "d3473b192bac32c196e4880a7ac003c7", "score": "0.58801955", "text": "function middleware_verify_admin (req,res,next) {\n const user_token = req.cookies.token\n console.log(user_token,\"????\")\n jwt.verify(user_token, \"secret_key\", (err, authData) => {\n if (err){\n console.log(err)\n res.send(err)\n }else {\n if (authData[\"user\"][0][\"role\"] == \"admin\"){\n next();\n }else{\n console.log(\"the role is not an admin to view details of usermodel..! \")\n res.send(\"the role is not an admin to view details of usermodel..! \")\n }\n }\n })\n}", "title": "" }, { "docid": "91de09754e434190a84ce6456c73a2ae", "score": "0.587024", "text": "function isLoggedInAsAuthor(req, res, next) {\n // if user is authenticated in the session, carry on \n // if (req.isAuthenticated())\n // return next();\n\n console.log(\"In isLoggedInAsAuthor \", req.user, req.user.local.role);\n\n if (req.user.local.role == \"Author\")\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n}", "title": "" }, { "docid": "8a4c8ed6f7f6097b4f7dbd11083ffb9e", "score": "0.5857471", "text": "function isAdmin(req, res, next) {\n var user = req.user;\n var isAdmin = user && user.role === 'admin';\n\n if (isAdmin)\n next();\n else\n return next({\n status: 403,\n message: 'Forbidden access',\n name: 'forbiddenaccess'\n });\n }", "title": "" }, { "docid": "46241f2b40ebc206ad6158c1db1387d4", "score": "0.58357686", "text": "canActivate(route) {\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function* () {\n const token = this.cookieService.get('token');\n if (!token) {\n return true;\n }\n try {\n const currentUser = yield this.userService.getCurrentUser().toPromise();\n if (currentUser && currentUser.id) {\n this.redirectToMainApp();\n return false;\n }\n }\n catch (error) {\n return true;\n }\n return true;\n });\n }", "title": "" }, { "docid": "41f24aa4927d3bcc768ca128fd6788fd", "score": "0.5811999", "text": "function checkManager(req, res, next) {\n var actorId = req.headers.authorization;\n console.log(`CheckManager: ${actorId}`);\n if(!actorId) return res.status(400).send({ message: 'Authorization header not founded' });\n\n Actor.findById({ _id: actorId }, function (err, actor) {\n if (err) return res.status(500).send(err);\n if (!actor) return res.status(400).send({ message: `Manager with ID ${actorId} not found` });\n if (actor.role[0] != 'MANAGER') return res.status(500).send({ errors: `Actor with ID ${actorId} it's not a manager` });\n\n next();\n \n });\n}", "title": "" }, { "docid": "484199cdaa5f44b5f7644ef7a0d04325", "score": "0.5801746", "text": "function hasRole(rolename) {\r\n return rxjs_1.from([UserRole.Admin, UserRole.Basic, UserRole.SuperUser])\r\n .pipe(operators_1.map(val => val === rolename), operators_1.reduce((a, b) => a || b));\r\n}", "title": "" }, { "docid": "2a0f625a19547c83182a93dbbf4f67df", "score": "0.5800743", "text": "function ensureAdmin(req, res, next) {\n if (!req.headers.authorization) {\n return res.status(401).send({\n message: 'Please make sure your request has an Authorization header'\n });\n }\n var token = req.headers.authorization.split(' ')[1];\n var payload = jwt.decode(token, config.secrets.session);\n if (payload.exp <= moment().unix()) {\n return res.status(401).send({\n message: 'Token has expired'\n });\n }\n req.user = payload.sub;\n req.isAdmin = payload.role;\n\n if (!req.isAdmin) {\n return res.status(401).send({\n message: 'Not authorized'\n });\n }\n next();\n}", "title": "" }, { "docid": "c3ed81299a65c341e5e81ad8d4281dbe", "score": "0.57939357", "text": "function isHasRole(role) {\n\n // Convert the role into an array if it's not so we\n // can loop over it\n var roleArray = [].concat(role);\n for ( var i = 0 ; i < roleArray.length ; i++ ) {\n\n var roleToCheck = roleArray[i];\n\n // If there the user is not authenticated and\n // the required role is visitor then user is authorized\n if ( currentUser ) {\n\n var userRole = currentUser.role;\n\n // Ignore links for visitors...\n if ( roleToCheck === 'visitor' ) {\n continue;\n }\n\n if ( userRole === 'admin' ) {\n return true;\n }\n\n if ( userRole === roleToCheck ) {\n return true;\n }\n }\n // Otherwise there is no user - check if role is \"visitor\"\n else {\n\n if ( roleToCheck === \"visitor\" ) {\n return true;\n }\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "1543174e8182719ecae772e92ba3565c", "score": "0.5792856", "text": "function isAdmin(req, res, next) {\n console.log(req.user);\n if (req.isAuthenticated() && req.user.rol === 'Admin') {\n next();\n } else {\n return res.status(401).send('No tienes permitido acceder o debes iniciar session');\n }\n}", "title": "" }, { "docid": "15ee15dab0f47c28be22e962272a81a3", "score": "0.57795435", "text": "function ensureAdmin(req, res, next) {\n console.log('Admin check', req.cookies.user_id);\n if (req.isAuthenticated && req.cookies.user_id === process.env.ADMIN_ID) {\n return next();\n }\n console.log('[Admin] Not admin: ', req.cookies.user_id);\n res.redirect('/user/login');\n }", "title": "" }, { "docid": "fc4bc47c51cdc82bb5633521c9826337", "score": "0.57785445", "text": "function ensureAdmin(req, res, next) {\n try {\n const tokenFromBody = req.body._token;\n const token = jwt.verify(tokenFromBody, SECRET);\n if (token.is_admin === true) {\n return next();\n } else {\n throw new Error();\n }\n } catch (err) {\n return next({ status: 401, message: 'Unauthorized' });\n }\n}", "title": "" }, { "docid": "2f959b2c54221ae2aa8c7635ab953a75", "score": "0.57757634", "text": "async hasAsyncRole(roleName) {\n const response = await axios\n .get(`${USER_API_URL}/roles/checking`, {\n params: { roleName: roleName },\n headers: authHeader(),\n })\n .then((response) => {\n // If user not found then sign out and redirect to sign in page\n if( response.data.signOutRequired ) {\n this.signout();\n window.location.href = \"/signin\";\n }\n // Return response\n return response.data;\n })\n .catch((err) => {\n throw new Error(err);\n });\n return response.hasRole;\n }", "title": "" }, { "docid": "9931586c6ca5c767ad79c2d4e46b8714", "score": "0.5775659", "text": "function accessControl(req, res, next) {\n debug('accessControl');\n const action = req.body.action;\n if (action === 'ring') {\n // LEVEL 2: BASIC AUTHORIZATION - Resources are accessible on a User/Verb/Resource basis\n // LEVEL 3: ADVANCED AUTHORIZATION - Resources are accessible on XACML Rules\n return AUTHZFORCE_ENABLED\n ? Security.authorizeAdvancedXACML(req, res, next, '/bell/ring')\n : Security.authorizeBasicPDP(req, res, next, '/bell/ring');\n } else if (action === 'unlock') {\n // LEVEL 2: BASIC AUTHORIZATION - Resources are accessible on a User/Verb/Resource basis\n // LEVEL 3: ADVANCED AUTHORIZATION - Resources are accessible on XACML Rules\n return AUTHZFORCE_ENABLED\n ? Security.authorizeAdvancedXACML(req, res, next, '/door/unlock')\n : Security.authorizeBasicPDP(req, res, next, '/door/unlock');\n }\n // LEVEL 1: AUTHENTICATION ONLY - Every user is authorized, just ensure the user exists.\n return Security.authenticate(req, res, next);\n}", "title": "" } ]
2a2fa20a16264b2a2d198a08dff3a3a6
world's simplest (and least correct) tokenizer
[ { "docid": "0004c6677d9304b8a0a8c513d66c3cee", "score": "0.0", "text": "function find_first_nws(line) {\n for (let i = 0, c; c = line[i]; i++) {\n if (c !== ' ' && c !== '\\t')\n return i;\n }\n return -1;\n }", "title": "" } ]
[ { "docid": "4110ea7030c14e766af30cdc1339e669", "score": "0.7616671", "text": "function Tokenizer() {\n}", "title": "" }, { "docid": "51127fca7e8ee36267399aa47652c6b7", "score": "0.7611703", "text": "function Tokenizer() {\n\n}", "title": "" }, { "docid": "51127fca7e8ee36267399aa47652c6b7", "score": "0.7611703", "text": "function Tokenizer() {\n\n}", "title": "" }, { "docid": "801fc2df1853e0018dc436cfa9bf822d", "score": "0.70015997", "text": "function tokenizer(input, options) {\n\t\t return Parser.tokenizer(input, options)\n\t\t }", "title": "" }, { "docid": "ca1625f44ffe487d3a33a1fdbc61d44f", "score": "0.69318223", "text": "function tokenizer(input, options) {\r\n\t return Parser.tokenizer(input, options)\r\n\t}", "title": "" }, { "docid": "1dc3b2b6985e0b8b83ba8aa313324007", "score": "0.6817295", "text": "function customTokenizer (s) {\n s = s.toString(s).toLowerCase();\n return s ? s.split(/\\s+/) : [];\n }", "title": "" }, { "docid": "8d895bc02ad2e33249964cdf1a32e722", "score": "0.67106384", "text": "nextToken() {\n if (this.pushedBack) {\n this.pushedBack = false;\n return this.ttype;\n }\n\n let start = this.pos;\n let ch = this.read();\n\n // try to skip characters\n while (ch != null && this.specials[ch] == TT_SKIP) {\n ch = this.read();\n start += 1;\n }\n\n // start position of the token\n\n // try to tokenize a keyword \n let node = this.keywordTree;\n let foundNode = null;\n let end = start;\n while (ch != null && node.children[ch] != null) {\n node = node.children[ch];\n if (node.keyword != null) {\n foundNode = node;\n end = this.pos;\n }\n ch = this.read();\n }\n if (foundNode != null) {\n this.setPosition(end);\n this.ttype = TT_KEYWORD;\n this.tstart = start;\n this.tend = end;\n this.sval = foundNode.keyword;\n this.tsymbol = foundNode.symbol;\n return this.ttype;\n }\n this.setPosition(start);\n ch = this.read();\n\n // try to tokenize a number\n if (ch != null && this.digits[ch] == TT_DIGIT) {\n while (ch != null && this.digits[ch] == TT_DIGIT) {\n ch = this.read();\n }\n if (ch!=null) {\n this.unread();\n }\n this.ttype = TT_NUMBER;\n this.tstart = start;\n this.tend = this.pos;\n this.sval = this.input.substring(start, this.pos);\n this.nval = parseInt(this.sval);\n this.tsymbol = null;\n return this.ttype;\n }\n\n // try to tokenize a word\n if (ch != null && this.specials[ch] == null) {\n while (ch != null && this.specials[ch] == null) {\n ch = this.read();\n }\n if (ch!=null) {\n this.unread();\n }\n this.ttype = TT_WORD;\n this.tstart = start;\n this.tend = this.pos;\n this.sval = this.input.substring(start, this.pos);\n this.tsymbol=null;\n return this.ttype;\n }\n \n // try to tokenize a special character\n if (ch != null && this.specials[ch] != null) {\n this.ttype = TT_SPECIAL;\n this.tsymbol = this.specials[ch];\n this.tstart = start;\n this.tend = end;\n this.sval = ch;\n return this.ttype;\n }\n // FIXME implement me\n this.ttype = TT_EOF;\n return this.ttype;\n }", "title": "" }, { "docid": "5ab4b3502973c3090e2528ab15c88cee", "score": "0.67042243", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "title": "" }, { "docid": "5ab4b3502973c3090e2528ab15c88cee", "score": "0.67042243", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "title": "" }, { "docid": "f01b4082a8582a0194b2cf83ce41ac13", "score": "0.6667896", "text": "function tokenizer(input, options) {\n\t\t\t return new Parser(options, input)\n\t\t\t }", "title": "" }, { "docid": "c1df3830efbfcfa6ddffc1aa05264125", "score": "0.6658103", "text": "function lex(input) {\n var tokens = [];\n // tokenize\n return tokens;\n}", "title": "" }, { "docid": "10eb50dcd684f83b0c1574ee1c93db73", "score": "0.66344", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options);\n }", "title": "" }, { "docid": "fc555f3acfe2d3ef109d8a7b2e16b922", "score": "0.66236836", "text": "function Murmur3Tokenizer() {\n\n}", "title": "" }, { "docid": "fc555f3acfe2d3ef109d8a7b2e16b922", "score": "0.66236836", "text": "function Murmur3Tokenizer() {\n\n}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.66064286", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.66064286", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.66064286", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.66064286", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.66064286", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "95bd14b67f01b167d7770733514a301c", "score": "0.6602725", "text": "function tokenizer(input, options) {\n\t return new Parser(options, input)\n\t }", "title": "" }, { "docid": "91556d3ab0245420b63dfeb5342e7331", "score": "0.65579057", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options);\n}", "title": "" }, { "docid": "04ece4a6d721c258550ad00b75411294", "score": "0.65439874", "text": "function tokenizer(input, options) {\n\t return new Parser(options, input)\n\t}", "title": "" }, { "docid": "b4ca1c2e24bf57bb1b58aca7715087f5", "score": "0.650435", "text": "tokenize(value) {\n var parser = this\n var tokens = []\n var index = 0\n var offset = 0\n var line = 1\n var column = 1\n var character\n var queue\n var previous\n var left\n var right\n var eater\n\n if (value === null || value === undefined) {\n value = ''\n } else if (value instanceof String) {\n value = value.toString()\n }\n\n if (typeof value !== 'string') {\n // Return the given nodes if this is either an empty array, or an array with\n // a node as a first child.\n if ('length' in value && (!value[0] || value[0].type)) {\n return value\n }\n\n throw new Error(\n \"Illegal invocation: '\" +\n value +\n \"' is not a valid argument for 'ParseLatin'\"\n )\n }\n\n if (!value) {\n return tokens\n }\n\n // Eat mechanism to use.\n eater = this.position ? eat : noPositionEat\n\n previous = ''\n queue = ''\n\n while (index < value.length) {\n character = value.charAt(index)\n\n if (whiteSpace.test(character)) {\n right = 'WhiteSpace'\n } else if (punctuation.test(character)) {\n right = 'Punctuation'\n } else if (word.test(character)) {\n right = 'Word'\n } else {\n right = 'Symbol'\n }\n\n tick()\n\n previous = character\n character = ''\n left = right\n right = null\n\n index++\n }\n\n tick()\n\n return tokens\n\n // Check one character.\n function tick() {\n if (\n left === right &&\n (left === 'Word' ||\n left === 'WhiteSpace' ||\n character === previous ||\n surrogates.test(character))\n ) {\n queue += character\n } else {\n // Flush the previous queue.\n if (queue) {\n parser['tokenize' + left](queue, eater)\n }\n\n queue = character\n }\n }\n\n // Remove `subvalue` from `value`.\n // Expects `subvalue` to be at the start from `value`, and applies no\n // validation.\n function eat(subvalue) {\n var pos = position()\n\n update(subvalue)\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and return\n // the node.\n function apply(...input) {\n return pos(add(...input))\n }\n }\n\n // Remove `subvalue` from `value`.\n // Does not patch positional information.\n function noPositionEat() {\n return add\n }\n\n // Add mechanism.\n function add(node, parent) {\n if (parent) {\n parent.children.push(node)\n } else {\n tokens.push(node)\n }\n\n return node\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n // Add the position to a node.\n function patch(node) {\n node.position = new Position(before)\n\n return node\n }\n\n return patch\n }\n\n // Update line and column based on `value`.\n function update(subvalue) {\n var character = -1\n var lastIndex = -1\n\n offset += subvalue.length\n\n while (++character < subvalue.length) {\n if (subvalue.charAt(character) === '\\n') {\n lastIndex = character\n line++\n }\n }\n\n if (lastIndex < 0) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Get the current position.\n function now() {\n return {line, column, offset}\n }\n }", "title": "" }, { "docid": "c42d4d8f0adc7dd020e6ea34624438b3", "score": "0.6493307", "text": "function tokenizer(input, options) {\n\t return new _state.Parser(options, input);\n\t}", "title": "" }, { "docid": "cdf234019b095342de94a87e07af767e", "score": "0.64058506", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n }", "title": "" }, { "docid": "cdf234019b095342de94a87e07af767e", "score": "0.64058506", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n }", "title": "" }, { "docid": "cdf234019b095342de94a87e07af767e", "score": "0.64058506", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n }", "title": "" }, { "docid": "738b8eb0eed55aedd8cdb814bc448ee3", "score": "0.63977456", "text": "function Tokenizer(o) {\n if (!(this instanceof Tokenizer)) return new Tokenizer(o);\n Freelib.call(this, mode.TOK, o);\n}", "title": "" }, { "docid": "ada53c828f14fcb1b317010d23f1bd02", "score": "0.63708806", "text": "function tokenize(sentence) {\n tokenizer = new natural.WordPunctTokenizer();\n return toAdd = tokenizer.tokenize(sentence);\n}", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.63524586", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "744efa188b5c132d786a203dfdd7a7fc", "score": "0.6337615", "text": "tokenize(str) {\r\n const original = new Lexer.Source(str)\r\n if (this.stateful) {\r\n // Sort transitions to prioritize group transitions\r\n this.STATE_TRANSITIONS = this.STATE_TRANSITIONS.sort((a, b) => {\r\n let x = (a instanceof Lexer.GroupStateTransition) ? 0 : 1\r\n let y = (b instanceof Lexer.GroupStateTransition) ? 0 : 1\r\n\r\n return x < y ? -1 : x > y ? 1 : 0\r\n })\r\n }\r\n\r\n const skipWhitespace = () => {\r\n const whitespaceRegExp = new RegExp('^[ \\f\\t\\v\\u00a0\\u1680\\u180e\\u2000-'\r\n + '\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff\\r\\n]+')\r\n\r\n let originalLength = str.length\r\n if (this.skipWhitespace) str = str.replace(whitespaceRegExp, '')\r\n return originalLength - str.length\r\n }\r\n\r\n let tokens = []\r\n while (str !== undefined && str.length > 0) {\r\n let tl = tokens.length\r\n let skipped = skipWhitespace()\r\n\r\n this.CLASSES.some(c => {\r\n if ((!this.STATE.strict && c.state === Lexer.AnyState)\r\n || this.STATE === c.state) {\r\n let m = c.match(str)\r\n if (m.consumed !== false) {\r\n tokens.push(new Lexer.Token(original, skipped, m.consumed, c))\r\n str = m.rest\r\n\r\n // if we are in stateful mode, check transitions\r\n if (this.stateful) {\r\n this.STATE_TRANSITIONS.some(st => {\r\n let r = st.apply(c, this.STATE)\r\n if (r.result) {\r\n this.STATE = this._findState(r.to)\r\n return true\r\n }\r\n })\r\n }\r\n\r\n return true\r\n }\r\n }\r\n })\r\n\r\n // no tokens were added because none matched, tokenization failed\r\n if (tokens.length === tl && str.length > 0) {\r\n const processed = this._processTokens(tokens)\r\n const position = processed[processed.length - 1].position\r\n\r\n const delta = position.length + skipped\r\n position.char += delta\r\n position.absolute += delta\r\n position.length = str.length\r\n\r\n return {\r\n success: false,\r\n tokens: processed,\r\n rest: {\r\n skipped,\r\n value: str,\r\n position\r\n }\r\n }\r\n }\r\n }\r\n\r\n skipWhitespace()\r\n // we ran out of characters, everything is tokenized\r\n return {\r\n success: true,\r\n tokens: this._processTokens(tokens)\r\n }\r\n }", "title": "" }, { "docid": "66f6a3e32eb738a27b8390f88dd1e506", "score": "0.6334887", "text": "function tokenize(sentence) { \r\n\tsentence = sentence.toLowerCase();\r\n\tsentence = sentence.replace(/[^a-z ]/g, \"\");\r\n\tsentence = sentence.replace(/\\s+/g,\" \").trim();\r\n\tvar word_arr = sentence.split(\" \");\r\n\t/*--------------don't remove stop words-------------*/\r\n\t//word_arr = remove_stopwords(word_arr);\r\n\tword_arr = stem_arr(word_arr);\r\n\treturn word_arr;\r\n}", "title": "" }, { "docid": "0d2038605495a33803b26efa8efca1ae", "score": "0.6334024", "text": "function tokenizeText() {\n registerContextChecker.call(this, 'latinWord');\n registerContextChecker.call(this, 'arabicWord');\n registerContextChecker.call(this, 'arabicSentence');\n return this.tokenizer.tokenize(this.text);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.63065547", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.63065547", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.63065547", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.62950844", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.62950844", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.62950844", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.62950844", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.62950844", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.62950844", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.62950844", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.62950844", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.62950844", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "7d94f5b0df9f48bef5a34b46a50c7ab0", "score": "0.62823796", "text": "function wikiStringTokenizer(data){\n if($(data).has(\" \")){\n var splitData = data.split(' ');\n var joinData = splitData.join('_');\n data = joinData;\n return data;\n }\n else{\n return data;\n }\n }", "title": "" }, { "docid": "cbf0c2fbc33747b6a5b07893e8850cdf", "score": "0.6269959", "text": "function tokenizeFlow() {\n var fn = _.flow.apply(_, arguments);\n return tokenize(fn);\n}", "title": "" }, { "docid": "4da1acc6821e19ba9ace395582c1641a", "score": "0.6244202", "text": "function Tokenizer(str) {\n this._str = str;\n this._pos = 0;\n this._queue = new BoundedQueue(3); // Bounded queue of last emitted tokens.\n this._token = undefined; // Current token.\n}", "title": "" }, { "docid": "ef4c509304081c6e57f937bd71442975", "score": "0.62440234", "text": "function factory(type) {\n\t return tokenize;\n\t\n\t /* Tokenizer for a bound `type`. */\n\t function tokenize(value, location) {\n\t var self = this;\n\t var offset = self.offset;\n\t var tokens = [];\n\t var methods = self[type + 'Methods'];\n\t var tokenizers = self[type + 'Tokenizers'];\n\t var line = location.line;\n\t var column = location.column;\n\t var index;\n\t var length;\n\t var method;\n\t var name;\n\t var matched;\n\t var valueLength;\n\t\n\t /* Trim white space only lines. */\n\t if (!value) {\n\t return tokens;\n\t }\n\t\n\t /* Expose on `eat`. */\n\t eat.now = now;\n\t eat.file = self.file;\n\t\n\t /* Sync initial offset. */\n\t updatePosition('');\n\t\n\t /* Iterate over `value`, and iterate over all\n\t * tokenizers. When one eats something, re-iterate\n\t * with the remaining value. If no tokenizer eats,\n\t * something failed (should not happen) and an\n\t * exception is thrown. */\n\t while (value) {\n\t index = -1;\n\t length = methods.length;\n\t matched = false;\n\t\n\t while (++index < length) {\n\t name = methods[index];\n\t method = tokenizers[name];\n\t\n\t if (\n\t method &&\n\t /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n\t (!method.notInList || !self.inList) &&\n\t (!method.notInBlock || !self.inBlock) &&\n\t (!method.notInLink || !self.inLink)\n\t ) {\n\t valueLength = value.length;\n\t\n\t method.apply(self, [eat, value]);\n\t\n\t matched = valueLength !== value.length;\n\t\n\t if (matched) {\n\t break;\n\t }\n\t }\n\t }\n\t\n\t /* istanbul ignore if */\n\t if (!matched) {\n\t self.file.fail(new Error('Infinite loop'), eat.now());\n\t }\n\t }\n\t\n\t self.eof = now();\n\t\n\t return tokens;\n\t\n\t /* Update line, column, and offset based on\n\t * `value`. */\n\t function updatePosition(subvalue) {\n\t var lastIndex = -1;\n\t var index = subvalue.indexOf('\\n');\n\t\n\t while (index !== -1) {\n\t line++;\n\t lastIndex = index;\n\t index = subvalue.indexOf('\\n', index + 1);\n\t }\n\t\n\t if (lastIndex === -1) {\n\t column += subvalue.length;\n\t } else {\n\t column = subvalue.length - lastIndex;\n\t }\n\t\n\t if (line in offset) {\n\t if (lastIndex !== -1) {\n\t column += offset[line];\n\t } else if (column <= offset[line]) {\n\t column = offset[line] + 1;\n\t }\n\t }\n\t }\n\t\n\t /* Get offset. Called before the first character is\n\t * eaten to retrieve the range's offsets. */\n\t function getOffset() {\n\t var indentation = [];\n\t var pos = line + 1;\n\t\n\t /* Done. Called when the last character is\n\t * eaten to retrieve the range’s offsets. */\n\t return function () {\n\t var last = line + 1;\n\t\n\t while (pos < last) {\n\t indentation.push((offset[pos] || 0) + 1);\n\t\n\t pos++;\n\t }\n\t\n\t return indentation;\n\t };\n\t }\n\t\n\t /* Get the current position. */\n\t function now() {\n\t var pos = {line: line, column: column};\n\t\n\t pos.offset = self.toOffset(pos);\n\t\n\t return pos;\n\t }\n\t\n\t /* Store position information for a node. */\n\t function Position(start) {\n\t this.start = start;\n\t this.end = now();\n\t }\n\t\n\t /* Throw when a value is incorrectly eaten.\n\t * This shouldn’t happen but will throw on new,\n\t * incorrect rules. */\n\t function validateEat(subvalue) {\n\t /* istanbul ignore if */\n\t if (value.substring(0, subvalue.length) !== subvalue) {\n\t /* Capture stack-trace. */\n\t self.file.fail(\n\t new Error(\n\t 'Incorrectly eaten value: please report this ' +\n\t 'warning on http://git.io/vg5Ft'\n\t ),\n\t now()\n\t );\n\t }\n\t }\n\t\n\t /* Mark position and patch `node.position`. */\n\t function position() {\n\t var before = now();\n\t\n\t return update;\n\t\n\t /* Add the position to a node. */\n\t function update(node, indent) {\n\t var prev = node.position;\n\t var start = prev ? prev.start : before;\n\t var combined = [];\n\t var n = prev && prev.end.line;\n\t var l = before.line;\n\t\n\t node.position = new Position(start);\n\t\n\t /* If there was already a `position`, this\n\t * node was merged. Fixing `start` wasn’t\n\t * hard, but the indent is different.\n\t * Especially because some information, the\n\t * indent between `n` and `l` wasn’t\n\t * tracked. Luckily, that space is\n\t * (should be?) empty, so we can safely\n\t * check for it now. */\n\t if (prev && indent && prev.indent) {\n\t combined = prev.indent;\n\t\n\t if (n < l) {\n\t while (++n < l) {\n\t combined.push((offset[n] || 0) + 1);\n\t }\n\t\n\t combined.push(before.column);\n\t }\n\t\n\t indent = combined.concat(indent);\n\t }\n\t\n\t node.position.indent = indent || [];\n\t\n\t return node;\n\t }\n\t }\n\t\n\t /* Add `node` to `parent`s children or to `tokens`.\n\t * Performs merges where possible. */\n\t function add(node, parent) {\n\t var children = parent ? parent.children : tokens;\n\t var prev = children[children.length - 1];\n\t\n\t if (\n\t prev &&\n\t node.type === prev.type &&\n\t node.type in MERGEABLE_NODES &&\n\t mergeable(prev) &&\n\t mergeable(node)\n\t ) {\n\t node = MERGEABLE_NODES[node.type].call(self, prev, node);\n\t }\n\t\n\t if (node !== prev) {\n\t children.push(node);\n\t }\n\t\n\t if (self.atStart && tokens.length !== 0) {\n\t self.exitStart();\n\t }\n\t\n\t return node;\n\t }\n\t\n\t /* Remove `subvalue` from `value`.\n\t * `subvalue` must be at the start of `value`. */\n\t function eat(subvalue) {\n\t var indent = getOffset();\n\t var pos = position();\n\t var current = now();\n\t\n\t validateEat(subvalue);\n\t\n\t apply.reset = reset;\n\t reset.test = test;\n\t apply.test = test;\n\t\n\t value = value.substring(subvalue.length);\n\t\n\t updatePosition(subvalue);\n\t\n\t indent = indent();\n\t\n\t return apply;\n\t\n\t /* Add the given arguments, add `position` to\n\t * the returned node, and return the node. */\n\t function apply(node, parent) {\n\t return pos(add(pos(node), parent), indent);\n\t }\n\t\n\t /* Functions just like apply, but resets the\n\t * content: the line and column are reversed,\n\t * and the eaten value is re-added.\n\t * This is useful for nodes with a single\n\t * type of content, such as lists and tables.\n\t * See `apply` above for what parameters are\n\t * expected. */\n\t function reset() {\n\t var node = apply.apply(null, arguments);\n\t\n\t line = current.line;\n\t column = current.column;\n\t value = subvalue + value;\n\t\n\t return node;\n\t }\n\t\n\t /* Test the position, after eating, and reverse\n\t * to a not-eaten state. */\n\t function test() {\n\t var result = pos({});\n\t\n\t line = current.line;\n\t column = current.column;\n\t value = subvalue + value;\n\t\n\t return result.position;\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "2164190c3e788166c49ab2a8bc9e4150", "score": "0.62375873", "text": "generateBuiltInTokenizer() {\n this.writeData('TOKENIZER', CSHARP_TOKENIZER_TEMPLATE);\n }", "title": "" }, { "docid": "9e5fd6cfa9dcdfa184b2f7018e389f11", "score": "0.6211588", "text": "function Tokenizer(str) {\n this._str = str;\n this._pos = 0;\n this._queue = new BoundedQueue(3); // Bounded queue of last emitted tokens.\n this._token = undefined; // Current token.\n this._doc = undefined; // Javadoc.\n}", "title": "" }, { "docid": "91c6d3b4336e78f2db684d733dfe7326", "score": "0.62046087", "text": "function createTokenizer(o) {\n\treturn new Tokenizer(o);\n}", "title": "" }, { "docid": "0ecb9d906c803de9f4240c9523c9dc5e", "score": "0.61601275", "text": "function wordtoken(word, start_index) {\r\n var token = {};\r\n token.raw = word;\r\n token.index = start_index;\r\n token.word = strip_punctuation(token.raw);\r\n token.alphastart = word.indexOf(token.word);\r\n token.alphalength = token.word.length;\r\n token.wordwithapos = strip_punctuation_except_apos(token.raw);\r\n token.wordstemmed = strip_prefixes(strip_suffixes(token.word));\r\n token.firstletter = token.wordstemmed.substr(0,1);\r\n return token;\r\n}", "title": "" }, { "docid": "a1728bed956947e3a83757f46965dbf1", "score": "0.61595964", "text": "_getTokenizer() {\n return this.constructor.tokenizer;\n }", "title": "" }, { "docid": "6ddb7a9b3f7c97917968f4822d25e3d4", "score": "0.611333", "text": "function tokenize(text) {\n return text.split(/\\s+/);\n}", "title": "" }, { "docid": "b75d6bc7dde7038dcb5b4f69f6cb59df", "score": "0.61028117", "text": "function stringTokenizer(data){\n if($(data).has(\" \")){\n var splitData = data.split(' ');\n var joinData = splitData.join('+');\n data = joinData;\n return data;\n }\n else{\n return data;\n }\n }", "title": "" }, { "docid": "d1b040d488500bc446ab853f841ef034", "score": "0.60907453", "text": "function tokenize(parser, value) {\n\t\tvar tokens;\n\t\tvar offset;\n\t\tvar line;\n\t\tvar column;\n\t\tvar index;\n\t\tvar length;\n\t\tvar character;\n\t\tvar queue;\n\t\tvar prev;\n\t\tvar left;\n\t\tvar right;\n\t\tvar eater;\n\n\t\tif (value === null || value === undefined) {\n\t\t\tvalue = '';\n\t\t} else if (value instanceof String) {\n\t\t\tvalue = value.toString();\n\t\t}\n\n\t\tif (typeof value !== 'string') {\n\t\t\t// Return the given nodes if this is either an empty array, or an array with\n\t\t\t// a node as a first child.\n\t\t\tif ('length' in value && (!value[0] || value[0].type)) {\n\t\t\t\treturn value\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t\"Illegal invocation: '\" +\n\t\t\t\t\tvalue +\n\t\t\t\t\t\"' is not a valid argument for 'ParseLatin'\"\n\t\t\t)\n\t\t}\n\n\t\ttokens = [];\n\n\t\tif (!value) {\n\t\t\treturn tokens\n\t\t}\n\n\t\tindex = 0;\n\t\toffset = 0;\n\t\tline = 1;\n\t\tcolumn = 1;\n\n\t\t// Eat mechanism to use.\n\t\teater = parser.position ? eat : noPositionEat;\n\n\t\tlength = value.length;\n\t\tprev = '';\n\t\tqueue = '';\n\n\t\twhile (index < length) {\n\t\t\tcharacter = value.charAt(index);\n\n\t\t\tif (whiteSpaceRe.test(character)) {\n\t\t\t\tright = 'WhiteSpace';\n\t\t\t} else if (punctuationRe.test(character)) {\n\t\t\t\tright = 'Punctuation';\n\t\t\t} else if (wordRe.test(character)) {\n\t\t\t\tright = 'Word';\n\t\t\t} else {\n\t\t\t\tright = 'Symbol';\n\t\t\t}\n\n\t\t\ttick();\n\n\t\t\tprev = character;\n\t\t\tcharacter = '';\n\t\t\tleft = right;\n\t\t\tright = null;\n\n\t\t\tindex++;\n\t\t}\n\n\t\ttick();\n\n\t\treturn tokens\n\n\t\t// Check one character.\n\t\tfunction tick() {\n\t\t\tif (\n\t\t\t\tleft === right &&\n\t\t\t\t(left === 'Word' ||\n\t\t\t\t\tleft === 'WhiteSpace' ||\n\t\t\t\t\tcharacter === prev ||\n\t\t\t\t\tsurrogatesRe.test(character))\n\t\t\t) {\n\t\t\t\tqueue += character;\n\t\t\t} else {\n\t\t\t\t// Flush the previous queue.\n\t\t\t\tif (queue) {\n\t\t\t\t\tparser['tokenize' + left](queue, eater);\n\t\t\t\t}\n\n\t\t\t\tqueue = character;\n\t\t\t}\n\t\t}\n\n\t\t// Remove `subvalue` from `value`.\n\t\t// Expects `subvalue` to be at the start from `value`, and applies no\n\t\t// validation.\n\t\tfunction eat(subvalue) {\n\t\t\tvar pos = position();\n\n\t\t\tupdate(subvalue);\n\n\t\t\treturn apply\n\n\t\t\t// Add the given arguments, add `position` to the returned node, and return\n\t\t\t// the node.\n\t\t\tfunction apply() {\n\t\t\t\treturn pos(add.apply(null, arguments))\n\t\t\t}\n\t\t}\n\n\t\t// Remove `subvalue` from `value`.\n\t\t// Does not patch positional information.\n\t\tfunction noPositionEat() {\n\t\t\treturn apply\n\n\t\t\t// Add the given arguments and return the node.\n\t\t\tfunction apply() {\n\t\t\t\treturn add.apply(null, arguments)\n\t\t\t}\n\t\t}\n\n\t\t// Add mechanism.\n\t\tfunction add(node, parent) {\n\t\t\tif (parent) {\n\t\t\t\tparent.children.push(node);\n\t\t\t} else {\n\t\t\t\ttokens.push(node);\n\t\t\t}\n\n\t\t\treturn node\n\t\t}\n\n\t\t// Mark position and patch `node.position`.\n\t\tfunction position() {\n\t\t\tvar before = now();\n\n\t\t\t// Add the position to a node.\n\t\t\tfunction patch(node) {\n\t\t\t\tnode.position = new Position(before);\n\n\t\t\t\treturn node\n\t\t\t}\n\n\t\t\treturn patch\n\t\t}\n\n\t\t// Update line and column based on `value`.\n\t\tfunction update(subvalue) {\n\t\t\tvar subvalueLength = subvalue.length;\n\t\t\tvar character = -1;\n\t\t\tvar lastIndex = -1;\n\n\t\t\toffset += subvalueLength;\n\n\t\t\twhile (++character < subvalueLength) {\n\t\t\t\tif (subvalue.charAt(character) === '\\n') {\n\t\t\t\t\tlastIndex = character;\n\t\t\t\t\tline++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (lastIndex === -1) {\n\t\t\t\tcolumn += subvalueLength;\n\t\t\t} else {\n\t\t\t\tcolumn = subvalueLength - lastIndex;\n\t\t\t}\n\t\t}\n\n\t\t// Store position information for a node.\n\t\tfunction Position(start) {\n\t\t\tthis.start = start;\n\t\t\tthis.end = now();\n\t\t}\n\n\t\t// Get the current position.\n\t\tfunction now() {\n\t\t\treturn {\n\t\t\t\tline: line,\n\t\t\t\tcolumn: column,\n\t\t\t\toffset: offset\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ce9167929470f168ffb6cdb311d953c4", "score": "0.6087406", "text": "function tokenizer (f, u, p) {\r\n\r\n\tfunction create () {\r\n\t//--- Creates the elements required for a tokenizer\r\n\r\n\t\tnewUL = document.createElement ('UL');\r\n\t\tnewUL.id = this.holderList;\r\n\t\tnewUL.className = 'tokenHolder';\r\n\r\n\t\t//--- Overwrite default 500px width\r\n\t\tif (this.formField.style.width) {\r\n\t\t\tnewUL.style.width = parseInt (this.formField.style.width) + 'px';\r\n\t\t}\r\n\r\n\t\t//--- For each existing option, create a new list element\r\n\t\tfor (i = 0; i < this.formField.options.length; i++) {\r\n\t\t\tnewLI = document.createElement ('LI');\r\n\t\t\tnewLI.className = 'box';\r\n\t\t\tnewLI.innerHTML = \"<span>\" + this.formField.options[i].text + \"</span><a class=\\\"closebutton\\\" onclick=\\\"top.lastTokenizer.removeEntry (this.parentNode); return false\\\">&nbsp;</a>\";\r\n\t\t\tnewUL.appendChild (newLI);\r\n\t\t\tthis.currentSelection += this.formField.options[i].value + (i < this.formField.options.length - 1 ? ',' : '');\r\n\t\t}\r\n\r\n\t\tnewLI = document.createElement ('LI');\r\n\t\tnewLI.id = this.cloneEntry;\r\n\t\tnewLI.className = 'box';\r\n\t\tnewLI.style.display = 'none';\r\n\t\tnewLI.innerHTML = \"<span></span><a class=\\\"closebutton\\\" onclick=\\\"top.lastTokenizer.removeEntry (this.parentNode); return false\\\">&nbsp;</a>\";\r\n\t\tnewUL.appendChild (newLI);\r\n\r\n\t\tnewLI = document.createElement ('LI');\r\n\t\tnewLI.className = \"box-input\";\r\n\t\tnewLI.innerHTML = \"<input size=\\\"1\\\" name=\\\"\" + this.inputField + \"\\\" id=\\\"\" + this.inputField + \"\\\" value=\\\"\\\" autocomplete=\\\"off\\\" onkeydown=\\\"top.lastTokenizer.suggestionLayer.keyDown (event); return top.lastTokenizer.keyDown (event)\\\" onkeyup=\\\"top.lastTokenizer.suggestionLayer.lookupWord (event)\\\" onfocus=\\\"if (top.suggestionsTimeout != null) { clearTimeout (top.suggestionsTimeout); } top.tokenizerInstances[\" + this.tokenInstance + \"].setActive (); top.lastTokenizer.suggestionLayer.setActive (); top.lastTokenizer.suggestionLayer.showSuggestionMessage ('\" + this.holderList + \"', 'Start typing...')\\\" onblur=\\\"top.suggestionsTimeout = setTimeout ('top.lastTokenizer.suggestionLayer.hideSuggestions ()', 500)\\\" />\";\r\n\t\tnewUL.appendChild (newLI);\r\n\r\n\t\tthis.formField.style.display = 'none';\r\n\r\n\t\tnewUL = this.formField.parentNode.insertBefore (newUL, this.formField);\r\n\t\tnewUL.onclick = function () { _$ (this.id.replace ('_tokens', '_tokens_input')).focus (); }\r\n\r\n\t\t//--- Create suggestion list object (using isuggest.js)\r\n\t\tthis.suggestionLayer = new suggestionList (_$ (this.inputField), this.callBack.replace (/{field}/g, this.holderList).replace (/{selection}/g, 2), 1, {'topTip': false, 'shadow': false, 'customStyle': 'border: 1px solid #999; border-top: 0px; background-color: #ffffff;' + (this.parameters ? ' ' + this.parameters : '')});\r\n\r\n\t}\r\n\r\n\tfunction keyDown (e) {\r\n\t//--- Handles key presses (this must be called after the suggestionLayer's keyDown event)\r\n\r\n\t\tvar key = (e.which ? e.which : e.keyCode);\r\n\r\n\t\tif ((key != 13) && (key != 9)) {\r\n\t\t\t_$ (this.inputField).size = (_$ (this.inputField).value.length ? _$ (this.inputField).value.length + 2 : 1);\r\n\t\t}\r\n\r\n\t\tif ((key == 13)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tprevious = _findPrevSibling (_findPrevSibling (_$ (this.inputField).parentNode));\r\n\t\tif (previous == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ((key == 8) && (_$ (this.inputField).value == '')) {\r\n\t\t\tif (previous.className.indexOf ('box-focus') == -1) {\r\n\t\t\t\tprevious.className = 'box box-focus'; this.suggestionLayer.hideSuggestions (); return false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.removeEntry (previous); return false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (previous.className.indexOf ('box-focus') != -1) {\r\n\t\t\t\tprevious.className = 'box';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction click (element, text, value) {\r\n\t//--- handles the selection (called by isuggest.js after an ajax request)\r\n\r\n\t\thiddenNode = _findPrevSibling (_$ (element).parentNode);\r\n\r\n\t\tnewLI = _cloneChild (hiddenNode, 'above');\r\n\t\tnewLI.firstChild.innerHTML = text;\r\n\t\t_$ (element).value = '';\r\n\r\n\t\tvar found = false;\r\n\t\tvar selectField = this.formField;\r\n\r\n\t\t//--- Replace in original select field\r\n\t\tfor (i = 0; i < selectField.options.length; i++) {\r\n\t\t\tif (selectField.options[i].value == value) {\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!found) {\r\n\t\t\tselectField.options[selectField.options.length] = new Option (text, value);\r\n\t\t}\r\n\r\n\t\t//--- Remove this item from the ajax callback\r\n\t\tthis.replaceCallBack ();\r\n\r\n\t}\r\n\r\n\tfunction removeEntry (whichObject) {\r\n\t//--- Removes a node from the unordered list and select list\r\n\r\n\t\tvar selectField = this.formField;\r\n\t\tvar selectValue = whichObject.firstChild.innerHTML;\r\n\r\n\t\t//--- Replace in original select field\r\n\t\tfor (i = 0; i < selectField.options.length; i++) {\r\n\t\t\tif (selectField.options[i].text == selectValue) {\r\n\t\t\t\tselectField.options[i] = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//--- Remove the list item\r\n\t\twhichObject.parentNode.removeChild (whichObject);\r\n\r\n\t\t//--- Remove this item from the ajax callback\r\n\t\tthis.replaceCallBack ();\r\n\r\n\t\t_$ (this.inputField).value = '';\r\n\t\t_$ (this.inputField).focus ();\r\n\r\n\t}\r\n\r\n\tfunction replaceCallBack () {\r\n\t//--- Replaces the callback with an updated list\r\n\r\n\t\tthis.currentSelection = '';\r\n\r\n\t\t//--- For each existing option, create a new list element\r\n\t\tfor (i = 0; i < this.formField.options.length; i++) {\r\n\t\t\tthis.currentSelection += this.formField.options[i].value + (i < this.formField.options.length - 1 ? ',' : '');\r\n\t\t}\r\n\r\n\t\tthis.suggestionLayer.callBack = this.callBack.replace (/{field}/g, this.holderList).replace (/{selection}/g, this.currentSelection);\r\n\r\n\t}\r\n\r\n\tfunction setActive () {\r\n\t//--- Sets the selected object to active\r\n\r\n\t\ttop.lastTokenizer = this;\r\n\r\n\t}\r\n\r\n\tfunction prepareSubmit () {\r\n\t//--- Prepares the selection field for a form submit\r\n\r\n\t\tfor (var i = 0; i < this.formField.options.length; i++) {\r\n\t\t\tthis.formField.options[i].selected = true;\r\n\t\t}\r\n\r\n\t\t//--- Prevent submit of temp field\r\n\t\tdocument.getElementById (this.inputField).disabled = true;\r\n\r\n\t}\r\n\r\n\t//--- Methods\r\n\tthis.create = create;\r\n\tthis.keyDown = keyDown;\r\n\tthis.click = click;\r\n\tthis.removeEntry = removeEntry;\r\n\tthis.replaceCallBack = replaceCallBack;\r\n\tthis.setActive = setActive;\r\n\tthis.prepareSubmit = prepareSubmit;\r\n\r\n\t//--- Properties\r\n\tthis.formField = f;\r\n\tthis.callBack = u;\r\n\tthis.parameters = p;\r\n\tthis.suggestionLayer = null;\r\n\tthis.holderList = f.id + '_tokens';\r\n\tthis.cloneEntry = f.id + '_tokens_clone';\r\n\tthis.inputField = f.id + '_tokens_input';\r\n\tthis.currentSelection = '';\r\n\tthis.tokenInstance = top.tokenizerInstances.length;\r\n\r\n\t//--- Initialise\r\n\tthis.create ();\r\n\r\n\t//--- Globals\r\n\ttop.lastTokenizer = this;\r\n\ttop.suggestionsTimeout = null;\r\n\ttop.tokenizerInstances[this.tokenInstance] = this;\r\n\r\n}", "title": "" }, { "docid": "43c670c477d64faefc9c3c29ee13dfbf", "score": "0.6085443", "text": "function tokenize(str) {\n str = str.toLowerCase();\n var flattened = flatten(str),\n cleaned = clean(flattened),\n separated = separate(flattened);\n\n if (str != flattened) { str += ' ' + flattened; }\n if (str != cleaned) { str += ' ' + cleaned; }\n if (str != separated) { str += ' ' + separated; }\n\n var tokens = [],\n unique = {},\n result = allTokens.exec(str);\n while (result) {\n result = result[0];\n if (!unique[result]) {\n tokens.push(result);\n unique[result] = true;\n }\n result = allTokens.exec(str);\n }\n\n return tokens;\n}", "title": "" }, { "docid": "afebc5b17221aa42556828191f63605b", "score": "0.6074714", "text": "function searchTokenizer(text) {\n var words = text.toLowerCase().split(/\\W+/);\n var wordDict = {};\n // Prefixing words with _ to also index Javascript keywords and special fiels like 'constructor'\n for(var i = 0; i < words.length; i++) {\n var normalizedWord = normalizeWord(words[i]);\n if(normalizedWord) {\n var word = '_' + normalizedWord;\n // Some extremely basic stemming\n if(word in wordDict) {\n wordDict[word]++;\n } else {\n wordDict[word] = 1;\n }\n }\n }\n return wordDict;\n }", "title": "" }, { "docid": "c82ff0dabd169a81a054f226148d66cc", "score": "0.6055682", "text": "_nextToken() {\n\t\t\tlet c;\n\t\t\tdo {\n\t\t\t\tc = this._nextChar();\n\t\t\t} while (/\\s/.test(c));\n\n\t\t\tswitch (c) {\n\t\t\tcase ',':\n\t\t\t\tthis._token = new Token(Token.COMMA);\n\t\t\t\tbreak;\n\n\t\t\tcase '.':\n\t\t\t\tthis._token = new Token(Token.DOT);\n\t\t\t\tbreak;\n\n\t\t\tcase ';':\n\t\t\t\tthis._token = new Token(Token.SEMIC);\n\t\t\t\tbreak;\n\n\t\t\tcase '(':\n\t\t\t\tthis._token = new Token(Token.LPAREN);\n\t\t\t\tbreak;\n\n\t\t\tcase ')':\n\t\t\t\tthis._token = new Token(Token.RPAREN);\n\t\t\t\tbreak;\n\n\t\t\tcase '\\0':\n\t\t\t\tthis._token = new Token(Token.EOF);\n\t\t\t\tbreak;\n\n\t\t\tcase '=':\n\t\t\t\tthis._token = new Token(Token.DEF);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// text for string\n\t\t\t\tif (/[a-zA-Z]|'/.test(c)) {\n\t\t\t\t\tlet str = '';\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstr += c;\n\t\t\t\t\t\tc = this._nextChar();\n\n\t\t\t\t\t} while (/[a-zA-Z]|'|_/.test(c));\n\n\t\t\t\t\tif (c == \".\") str += c;\n\t\t\t\t\t// put back the last char which is not part of the identifier\n\t\t\t\t\tthis._index--;\n\n\t\t\t\t\tif (str == \"bind\")\n\t\t\t\t\t\tthis._token = new Token(Token.BIND);\n\t\t\t\t\telse if (str == \"in\")\n\t\t\t\t\t\tthis._token = new Token(Token.IN);\n\t\t\t\t\telse if (str == \"new\")\n\t\t\t\t\t\tthis._token = new Token(Token.NEW);\n\t\t\t\t\telse if (str == \"PAIR\")\n\t\t\t\t\t\tthis._token = new Token(Token.PAIR)\n\t\t\t\t\telse if (str == \"FST\")\n\t\t\t\t\t\tthis._token = new Token(Token.FST)\n\t\t\t\t\telse if (str == \"SND\")\n\t\t\t\t\t\tthis._token = new Token(Token.SND)\n\t\t\t\t\telse if (str == \"SUCC\")\n\t\t\t\t\t\tthis._token = new Token(Token.SUCC)\n\t\t\t\t\telse if (str == \"PLUS\")\n\t\t\t\t\t\tthis._token = new Token(Token.PLUS);\n\t\t\t\t\telse if (str == \"MINUS\")\n\t\t\t\t\t\tthis._token = new Token(Token.MINUS);\n\t\t\t\t\telse if (str == \"TIMES\")\n\t\t\t\t\t\tthis._token = new Token(Token.TIMES);\n\t\t\t\t\telse if (str == \"MOD\")\n\t\t\t\t\t\tthis._token = new Token(Token.MOD);\n\t\t\t\t\telse if (str == \"LEQ\")\n\t\t\t\t\t\tthis._token = new Token(Token.LEQ);\n\t\t\t\t\telse if (str == \"AND\")\n\t\t\t\t\t\tthis._token = new Token(Token.AND);\n\t\t\t\t\telse if (str == \"OR\")\n\t\t\t\t\t\tthis._token = new Token(Token.OR);\n\t\t\t\t\telse if (str == \"NOT\")\n\t\t\t\t\t\tthis._token = new Token(Token.NOT);\n\t\t\t\t\telse if (str == \"EQUALS\")\n\t\t\t\t\t\tthis._token = new Token(Token.EQUALS);\n\t\t\t\t\telse if (str == \"IF\")\n\t\t\t\t\t\tthis._token = new Token(Token.IF);\n\t\t\t\t\telse if (str == \"LAMBDA\")\n\t\t\t\t\t\tthis._token = new Token(Token.LAMBDA);\n\t\t\t\t\telse if (str == \"APP\")\n\t\t\t\t\t\tthis._token = new Token(Token.APP);\n\t\t\t\t\telse if (str == \"REF\")\n\t\t\t\t\t\tthis._token = new Token(Token.REF);\n\t\t\t\t\telse if (str == \"DEREF\")\n\t\t\t\t\t\tthis._token = new Token(Token.DEREF);\n\t\t\t\t\telse if (str == \"ASSIGN\")\n\t\t\t\t\t\tthis._token = new Token(Token.ASSIGN);\n\t\t\t\t\telse if (str == \"UNIT\")\n\t\t\t\t\t\tthis._token = new Token(Token.UNIT);\n\t\t\t\t\telse if (str == \"SEC\")\n\t\t\t\t\t\tthis._token = new Token(Token.SEC);\n\t\t\t\t\telse if (str == \"REC\")\n\t\t\t\t\t\tthis._token = new Token(Token.REC);\n\t\t\t\t\telse if (str == \"ABORT\")\n\t\t\t\t\t\tthis._token = new Token(Token.ABORT);\n\t\t\t\t\telse if (str == \"CALLCC\")\n\t\t\t\t\t\tthis._token = new Token(Token.CALLCC);\n\t\t\t\t\telse if (str == \"BLOCK\")\n\t\t\t\t\t\tthis._token = new Token(Token.BLOCK);\n\t\t\t\t\telse if (str == \"BREAK\")\n\t\t\t\t\t\tthis._token = new Token(Token.BREAK);\n\t\t\t\t\telse if (str == \"CONTINUE\")\n\t\t\t\t\t\tthis._token = new Token(Token.CONTINUE);\n\t\t\t\t\telse if (str == \"RETURN\")\n\t\t\t\t\t\tthis._token = new Token(Token.RETURN);\n\t\t\t\t\telse if (str == \"TRUE\")\n\t\t\t\t\t\tthis._token = new Token(Token.TRUE, true);\n\t\t\t\t\telse if (str == \"FALSE\")\n\t\t\t\t\t\tthis._token = new Token(Token.FALSE, false);\n\t\t\t\t\telse if (str == \"COIN\")\n\t\t\t\t\t\tthis._token = new Token(Token.COIN);\n\t\t\t\t\telse if (str.endsWith(\".\"))\n\t\t\t\t\t\tthis._token = new Token(Token.BOUND, str.substring(0,str.length-1))\n\t\t\t\t\telse\n\t\t\t\t\t\tthis._token = new Token(Token.LCID, str);\n\t\t\t\t}\n\n\t\t\t\t// text for numbers\n\t\t\t\telse if (/[0-9]/.test(c)) {\n\t\t\t\t\tlet str = '';\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstr += c;\n\t\t\t\t\t\tc = this._nextChar();\n\t\t\t\t\t} while (/[0-9]/.test(c));\n\n\t\t\t\t\t// put back the last char which is not part of the identifier\n\t\t\t\t\tthis._index--;\n\t\t\t\t\tthis._token = new Token(Token.INT, parseInt(str));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.fail();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "bc0b665dcea954c2d5109164ee9f708c", "score": "0.6035786", "text": "constructor() {\n this.tokenizer = new Tokenizer();\n }", "title": "" }, { "docid": "0d200bfa59a9458791e4310e00f56a2d", "score": "0.60232157", "text": "function tokenizeText(text) {\n return text.toLowerCase().match(/\\b[^\\s]+\\b/g).sort();\n}", "title": "" }, { "docid": "26095fabb24437c9d9d92029c7d6b8a4", "score": "0.60201603", "text": "function token() {\n\t\t if (I >= N) return EOF; // special case: end of file\n\t\t if (eol) return eol = false, EOL; // special case: end of line\n\n\t\t // special case: quotes\n\t\t var j = I, c;\n\t\t if (text.charCodeAt(j) === 34) {\n\t\t var i = j;\n\t\t while (i++ < N) {\n\t\t if (text.charCodeAt(i) === 34) {\n\t\t if (text.charCodeAt(i + 1) !== 34) break;\n\t\t ++i;\n\t\t }\n\t\t }\n\t\t I = i + 2;\n\t\t c = text.charCodeAt(i + 1);\n\t\t if (c === 13) {\n\t\t eol = true;\n\t\t if (text.charCodeAt(i + 2) === 10) ++I;\n\t\t } else if (c === 10) {\n\t\t eol = true;\n\t\t }\n\t\t return text.slice(j + 1, i).replace(/\"\"/g, \"\\\"\");\n\t\t }\n\n\t\t // common case: find next delimiter or newline\n\t\t while (I < N) {\n\t\t var k = 1;\n\t\t c = text.charCodeAt(I++);\n\t\t if (c === 10) eol = true; // \\n\n\t\t else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \\r|\\r\\n\n\t\t else if (c !== delimiterCode) continue;\n\t\t return text.slice(j, I - k);\n\t\t }\n\n\t\t // special case: last token before EOF\n\t\t return text.slice(j);\n\t\t }", "title": "" }, { "docid": "d5a6e3331513ad996dbac25ade0e0162", "score": "0.6014349", "text": "function tokenize(r, s) {\n return parse(r.ast.zeroOrMore, s).children;\n }", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5989537", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5989537", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5989537", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5989537", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5989537", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5989537", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "00c6403a61159182af55a8b2bea06a35", "score": "0.5988329", "text": "function tokenize(text) {\n\treturn text.toLowerCase().split(/[ ,!.\":;-]+/).filter(Boolean).sort();\n}", "title": "" }, { "docid": "bb0395b8123aef006e40c4b0202b5d57", "score": "0.5977379", "text": "function _tokenize (value,isObject) {\n\treturn value.replace(new RegExp(`[^A-Za-z0-9\\\\s${isObject ? \"\\:\" : \"\"}]`,\"g\"),\"\").replace(/ +/g,\" \").toLowerCase().split(\" \")\n}", "title": "" }, { "docid": "163f7c44580e5353cb5008430942c407", "score": "0.59639955", "text": "function makeLexer() {\n // A stack of (\n // start delimiter,\n // position of start in concatenation of chunks,\n // position of start in current chunk)\n // delimiter length in chunk\n // for each start delimiter for which we have not yet seen\n // an end delimiter.\n const delimiterStack = [Object.freeze(['', 0, 0, 0])];\n let position = 0;\n\n return (wholeChunk) => {\n if (wholeChunk === null) {\n // Test can end.\n if (delimiterStack.length !== 1) {\n throw err`Cannot end in contexts ${delimiterStack.join(' ')}`;\n }\n } else {\n let origChunk = String(wholeChunk);\n // A suffix of origChunk that we consume as we tokenize.\n let chunk = origChunk;\n while (chunk) {\n const top = delimiterStack[delimiterStack.length - 1];\n const topStartDelim = top[0];\n let v = DELIMS[topStartDelim], bodyRegExp;\n if (v) {\n bodyRegExp = v.bodyRegExp;\n } else if (topStartDelim[0] === '<'\n && topStartDelim[1] === '<') {\n bodyRegExp = heredocBodyRegExp(heredocLabel(topStartDelim));\n v = DELIMS['<<'];\n }\n let m = bodyRegExp.exec(chunk);\n if (!m) {\n // Can occur if a chunk ends in '\\\\' and bodyPattern\n // allows escapes.\n throw err`Unprocessable content ${chunk} in context ${top}`;\n }\n\n// console.log('chunk=' + JSON.stringify(chunk) + ', top=' + JSON.stringify(top) + ', consumed body chunk ' + JSON.stringify(m));\n\n chunk = chunk.substring(m[0].length);\n position += m[0].length;\n\n m = v.endRegExp.exec(chunk);\n if (chunk.length !== 0) {\n if (m) {\n if (delimiterStack.length === 1) {\n // Should never occur since DELIMS[''] does not have\n // any end delimiters.\n throw err`Popped past end of stack`;\n }\n --delimiterStack.length;\n chunk = chunk.substring(m[0].length);\n position += m[0].length;\n continue;\n } else if (v.nests.length) {\n m = v.startRegExp.exec(chunk);\n if (m) {\n let start = m[0];\n let delimLength = start.length;\n if (start === '#') {\n const chunkStartInWhole =\n origChunk.length - chunk.length;\n if (chunkStartInWhole === 0) {\n // If we have a chunk that starts with a\n // '#' then we don't know whether two\n // ShFragments can be concatenated to\n // produce an unambiguous ShFragment.\n // Consider\n // sh`foo ${x}#bar`\n // If x is a normal string, it will be\n // quoted, so # will be treated literally.\n // If x is a ShFragment that ends in a space\n // '#bar' would be treated as a comment.\n throw err`'#' at start of ${chunk} is a concatenation hazard. Maybe use \\#`;\n } else if (!HASH_COMMENT_PRECEDER.test(origChunk.substring(0, chunkStartInWhole))) {\n // A '#' is not after whitespace, so does\n // not start a comment.\n chunk = chunk.substring(1);\n position += 1;\n continue;\n }\n } else if (start === '<<' || start === '<<-') {\n // If the \\w+ part below changes, also change the \\w+ in fixupHeredoc.\n let fullDelim = /^<<-?[ \\t]*(\\w+)[ \\t]*[\\n\\r]/\n .exec(chunk);\n // http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_03 defines word more broadly.\n // We can't handle that level of complexity here\n // so fail for all heredoc that do not match word.\n if (!fullDelim) {\n throw err`Failed to find heredoc word at ${word}. Use a nonce generator instead of .`\n }\n start += fullDelim[1];\n delimLength = fullDelim[0].length;\n }\n delimiterStack.push(\n Object.freeze([start, position,\n origChunk.length - chunk.length,\n delimLength]));\n chunk = chunk.substring(delimLength);\n position += m[0].length;\n continue;\n }\n }\n throw err`Non-body content remaining ${chunk} that has no delimiter in context ${top}`;\n }\n }\n }\n return delimiterStack[delimiterStack.length - 1];\n };\n}", "title": "" }, { "docid": "b836c8a927dec90ce2369c3c0b4ef3a6", "score": "0.5947234", "text": "function token() {\n\t if (I >= N) return EOF; // special case: end of file\n\t if (eol) return eol = false, EOL; // special case: end of line\n\t\n\t // special case: quotes\n\t var j = I, c;\n\t if (text.charCodeAt(j) === 34) {\n\t var i = j;\n\t while (i++ < N) {\n\t if (text.charCodeAt(i) === 34) {\n\t if (text.charCodeAt(i + 1) !== 34) break;\n\t ++i;\n\t }\n\t }\n\t I = i + 2;\n\t c = text.charCodeAt(i + 1);\n\t if (c === 13) {\n\t eol = true;\n\t if (text.charCodeAt(i + 2) === 10) ++I;\n\t } else if (c === 10) {\n\t eol = true;\n\t }\n\t return text.slice(j + 1, i).replace(/\"\"/g, \"\\\"\");\n\t }\n\t\n\t // common case: find next delimiter or newline\n\t while (I < N) {\n\t var k = 1;\n\t c = text.charCodeAt(I++);\n\t if (c === 10) eol = true; // \\n\n\t else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \\r|\\r\\n\n\t else if (c !== delimiterCode) continue;\n\t return text.slice(j, I - k);\n\t }\n\t\n\t // special case: last token before EOF\n\t return text.slice(j);\n\t }", "title": "" }, { "docid": "b836c8a927dec90ce2369c3c0b4ef3a6", "score": "0.5947234", "text": "function token() {\n\t if (I >= N) return EOF; // special case: end of file\n\t if (eol) return eol = false, EOL; // special case: end of line\n\t\n\t // special case: quotes\n\t var j = I, c;\n\t if (text.charCodeAt(j) === 34) {\n\t var i = j;\n\t while (i++ < N) {\n\t if (text.charCodeAt(i) === 34) {\n\t if (text.charCodeAt(i + 1) !== 34) break;\n\t ++i;\n\t }\n\t }\n\t I = i + 2;\n\t c = text.charCodeAt(i + 1);\n\t if (c === 13) {\n\t eol = true;\n\t if (text.charCodeAt(i + 2) === 10) ++I;\n\t } else if (c === 10) {\n\t eol = true;\n\t }\n\t return text.slice(j + 1, i).replace(/\"\"/g, \"\\\"\");\n\t }\n\t\n\t // common case: find next delimiter or newline\n\t while (I < N) {\n\t var k = 1;\n\t c = text.charCodeAt(I++);\n\t if (c === 10) eol = true; // \\n\n\t else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \\r|\\r\\n\n\t else if (c !== delimiterCode) continue;\n\t return text.slice(j, I - k);\n\t }\n\t\n\t // special case: last token before EOF\n\t return text.slice(j);\n\t }", "title": "" }, { "docid": "93a1c697368347a64d8b8e32a95efc6b", "score": "0.5932313", "text": "function token() {\n\t if (I >= N) return EOF; // special case: end of file\n\t if (eol) return eol = false, EOL; // special case: end of line\n\n\t // special case: quotes\n\t var j = I, c;\n\t if (text.charCodeAt(j) === 34) {\n\t var i = j;\n\t while (i++ < N) {\n\t if (text.charCodeAt(i) === 34) {\n\t if (text.charCodeAt(i + 1) !== 34) break;\n\t ++i;\n\t }\n\t }\n\t I = i + 2;\n\t c = text.charCodeAt(i + 1);\n\t if (c === 13) {\n\t eol = true;\n\t if (text.charCodeAt(i + 2) === 10) ++I;\n\t } else if (c === 10) {\n\t eol = true;\n\t }\n\t return text.slice(j + 1, i).replace(/\"\"/g, \"\\\"\");\n\t }\n\n\t // common case: find next delimiter or newline\n\t while (I < N) {\n\t var k = 1;\n\t c = text.charCodeAt(I++);\n\t if (c === 10) eol = true; // \\n\n\t else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \\r|\\r\\n\n\t else if (c !== delimiterCode) continue;\n\t return text.slice(j, I - k);\n\t }\n\n\t // special case: last token before EOF\n\t return text.slice(j);\n\t }", "title": "" }, { "docid": "93a1c697368347a64d8b8e32a95efc6b", "score": "0.5932313", "text": "function token() {\n\t if (I >= N) return EOF; // special case: end of file\n\t if (eol) return eol = false, EOL; // special case: end of line\n\n\t // special case: quotes\n\t var j = I, c;\n\t if (text.charCodeAt(j) === 34) {\n\t var i = j;\n\t while (i++ < N) {\n\t if (text.charCodeAt(i) === 34) {\n\t if (text.charCodeAt(i + 1) !== 34) break;\n\t ++i;\n\t }\n\t }\n\t I = i + 2;\n\t c = text.charCodeAt(i + 1);\n\t if (c === 13) {\n\t eol = true;\n\t if (text.charCodeAt(i + 2) === 10) ++I;\n\t } else if (c === 10) {\n\t eol = true;\n\t }\n\t return text.slice(j + 1, i).replace(/\"\"/g, \"\\\"\");\n\t }\n\n\t // common case: find next delimiter or newline\n\t while (I < N) {\n\t var k = 1;\n\t c = text.charCodeAt(I++);\n\t if (c === 10) eol = true; // \\n\n\t else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \\r|\\r\\n\n\t else if (c !== delimiterCode) continue;\n\t return text.slice(j, I - k);\n\t }\n\n\t // special case: last token before EOF\n\t return text.slice(j);\n\t }", "title": "" }, { "docid": "93a1c697368347a64d8b8e32a95efc6b", "score": "0.5932313", "text": "function token() {\n\t if (I >= N) return EOF; // special case: end of file\n\t if (eol) return eol = false, EOL; // special case: end of line\n\n\t // special case: quotes\n\t var j = I, c;\n\t if (text.charCodeAt(j) === 34) {\n\t var i = j;\n\t while (i++ < N) {\n\t if (text.charCodeAt(i) === 34) {\n\t if (text.charCodeAt(i + 1) !== 34) break;\n\t ++i;\n\t }\n\t }\n\t I = i + 2;\n\t c = text.charCodeAt(i + 1);\n\t if (c === 13) {\n\t eol = true;\n\t if (text.charCodeAt(i + 2) === 10) ++I;\n\t } else if (c === 10) {\n\t eol = true;\n\t }\n\t return text.slice(j + 1, i).replace(/\"\"/g, \"\\\"\");\n\t }\n\n\t // common case: find next delimiter or newline\n\t while (I < N) {\n\t var k = 1;\n\t c = text.charCodeAt(I++);\n\t if (c === 10) eol = true; // \\n\n\t else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \\r|\\r\\n\n\t else if (c !== delimiterCode) continue;\n\t return text.slice(j, I - k);\n\t }\n\n\t // special case: last token before EOF\n\t return text.slice(j);\n\t }", "title": "" }, { "docid": "93a1c697368347a64d8b8e32a95efc6b", "score": "0.5932313", "text": "function token() {\n\t if (I >= N) return EOF; // special case: end of file\n\t if (eol) return eol = false, EOL; // special case: end of line\n\n\t // special case: quotes\n\t var j = I, c;\n\t if (text.charCodeAt(j) === 34) {\n\t var i = j;\n\t while (i++ < N) {\n\t if (text.charCodeAt(i) === 34) {\n\t if (text.charCodeAt(i + 1) !== 34) break;\n\t ++i;\n\t }\n\t }\n\t I = i + 2;\n\t c = text.charCodeAt(i + 1);\n\t if (c === 13) {\n\t eol = true;\n\t if (text.charCodeAt(i + 2) === 10) ++I;\n\t } else if (c === 10) {\n\t eol = true;\n\t }\n\t return text.slice(j + 1, i).replace(/\"\"/g, \"\\\"\");\n\t }\n\n\t // common case: find next delimiter or newline\n\t while (I < N) {\n\t var k = 1;\n\t c = text.charCodeAt(I++);\n\t if (c === 10) eol = true; // \\n\n\t else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \\r|\\r\\n\n\t else if (c !== delimiterCode) continue;\n\t return text.slice(j, I - k);\n\t }\n\n\t // special case: last token before EOF\n\t return text.slice(j);\n\t }", "title": "" }, { "docid": "67a3520da22546fa32359aade955e574", "score": "0.5924992", "text": "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function() {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var prev = node.position\n var start = prev ? prev.start : before\n var combined = []\n var n = prev && prev.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (prev && indent && prev.indent) {\n combined = prev.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var prev = children[children.length - 1]\n var fn\n\n if (\n prev &&\n node.type === prev.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, prev, node)\n }\n\n if (node !== prev) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.substring(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "title": "" }, { "docid": "ef48d01597394e6d9a2ff3c541d948dc", "score": "0.5910922", "text": "function Lexer() {\n\n}", "title": "" }, { "docid": "ef48d01597394e6d9a2ff3c541d948dc", "score": "0.5910922", "text": "function Lexer() {\n\n}", "title": "" }, { "docid": "24f355f5e3b3aa5ee4b3ea096b8cd89c", "score": "0.590509", "text": "static tokenize(text) {\n const tokens = [];\n let token = \"\";\n if (typeof text !== \"string\") {\n return tokens;\n }\n for (let i = 0; i < text.length; i++) {\n const char = text[i];\n const nextChar = text[i + 1];\n if (_CanvasTextMetrics.isBreakingSpace(char, nextChar) || _CanvasTextMetrics.isNewline(char)) {\n if (token !== \"\") {\n tokens.push(token);\n token = \"\";\n }\n tokens.push(char);\n continue;\n }\n token += char;\n }\n if (token !== \"\") {\n tokens.push(token);\n }\n return tokens;\n }", "title": "" }, { "docid": "503de9fa934550a132126f9be63f42e4", "score": "0.5899911", "text": "function token() {\n\t if (I >= N) return EOF; // special case: end of file\n\t if (eol) return eol = false, EOL; // special case: end of line\n\t\n\t // special case: quotes\n\t var j = I, c;\n\t if (text.charCodeAt(j) === 34) {\n\t var i = j;\n\t while (i++ < N) {\n\t if (text.charCodeAt(i) === 34) {\n\t if (text.charCodeAt(i + 1) !== 34) break;\n\t ++i;\n\t }\n\t }\n\t I = i + 2;\n\t c = text.charCodeAt(i + 1);\n\t if (c === 13) {\n\t eol = true;\n\t if (text.charCodeAt(i + 2) === 10) ++I;\n\t } else if (c === 10) {\n\t eol = true;\n\t }\n\t return text.slice(j + 1, i).replace(/\"\"/g, \"\\\"\");\n\t }\n\t\n\t // common case: find next delimiter or newline\n\t while (I < N) {\n\t var k = 1;\n\t c = text.charCodeAt(I++);\n\t if (c === 10) eol = true; // \\n\n\t else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \\r|\\r\\n\n\t else if (c !== delimiterCode) continue;\n\t return text.slice(j, I - k);\n\t }\n\t\n\t // special case: last token before EOF\n\t return text.slice(j);\n\t }", "title": "" }, { "docid": "3d2748a6e933ce6617d24cbc387c09f2", "score": "0.58821255", "text": "function token(){if(I>=N)return EOF;// special case: end of file\n\tif(eol)return eol=false,EOL;// special case: end of line\n\t// special case: quotes\n\tvar j=I,c;if(text.charCodeAt(j)===34){var i=j;while(i++<N){if(text.charCodeAt(i)===34){if(text.charCodeAt(i+1)!==34)break;++i;}}I=i+2;c=text.charCodeAt(i+1);if(c===13){eol=true;if(text.charCodeAt(i+2)===10)++I;}else if(c===10){eol=true;}return text.slice(j+1,i).replace(/\"\"/g,\"\\\"\");}// common case: find next delimiter or newline\n\twhile(I<N){var k=1;c=text.charCodeAt(I++);if(c===10)eol=true;// \\n\n\telse if(c===13){eol=true;if(text.charCodeAt(I)===10)++I,++k;}// \\r|\\r\\n\n\telse if(c!==delimiterCode)continue;return text.slice(j,I-k);}// special case: last token before EOF\n\treturn text.slice(j);}", "title": "" }, { "docid": "44dc90b5726578518d67752b5cf170ac", "score": "0.5866757", "text": "function twTokenStrong(stream, state) {\n var maybeEnd = false,\n ch;\n while (ch = stream.next()) {\n if (ch == \"'\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"'\");\n }\n return \"strong\";\n }", "title": "" } ]
0aa8a02a553e04958d98025254f37c20
Function to empty all the game populated sections
[ { "docid": "3c27970be493e4ee01a422295ef285cc", "score": "0.70224786", "text": "function clearGameDivs() {\n $('#question-area').empty();\n\n }", "title": "" } ]
[ { "docid": "736fba3335b6d6a0e72d34601868d77d", "score": "0.7226761", "text": "clear() {\n this.sections = [];\n }", "title": "" }, { "docid": "52f495ecbafba51a6682cb8494343496", "score": "0.72259426", "text": "clear () {\n const tempSections = this.sections\n this.sections.forEach(section => section.destroy())\n this.sections = []\n return tempSections\n }", "title": "" }, { "docid": "ee194b826f6ce3e34db51d56ff73e6f1", "score": "0.72080076", "text": "function clearAll() {\n recipeArea.empty();\n recipeTitle.empty();\n }", "title": "" }, { "docid": "920a232160ae6da40da68c6ba0765c98", "score": "0.70429134", "text": "function clear(){\n allElementsList=[];\n minesList=[];\n uncoveredList=[];\n flagList=[];\n elementsAroundMines.clear();\n firstClick=false;\n gameOver=false;\n document.getElementById('minutes').innerHTML='00';\n document.getElementById('seconds').innerHTML='00';\n document.querySelectorAll('.underDiv').forEach(item=>{\n item.parentNode.removeChild(item);\n });\n }", "title": "" }, { "docid": "46e89ce243c0ef7e3924d637b92b14aa", "score": "0.7017985", "text": "function clearData() {\n document.getElementById('mineSweeper').innerHTML = '';\n mineMap = {};\n flagMap = {};\n handleMessage('', 'hide');\n gameOver = false;\n }", "title": "" }, { "docid": "92965ae6bdb9861441e50f80517a9695", "score": "0.70016515", "text": "function Clear()\n{\n\tUnspawnAll();\n\tavailable.Clear();\n\tall.Clear();\n}", "title": "" }, { "docid": "96fd3ec585ec6593d2cb3245d9f6dfa7", "score": "0.6956076", "text": "function emptyDivs () {\n // empty out all content areas\n $('#selected-character').empty()\n $('#defender').empty()\n $('#available-to-attack-section .enemy').empty()\n $('#character-area').empty()\n $('#characters-section').show()\n}", "title": "" }, { "docid": "02981aaca56019b3ff3866baafedc839", "score": "0.6944449", "text": "function clearAll(){\n\n\t//clear all 9 boxes\n\tdocument.getElementById(\"r1c1\").innerHTML=\"\";\n\tdocument.getElementById(\"r1c2\").innerHTML=\"\";\n\tdocument.getElementById(\"r1c3\").innerHTML=\"\";\n\tdocument.getElementById(\"r2c1\").innerHTML=\"\";\n\tdocument.getElementById(\"r2c2\").innerHTML=\"\";\n\tdocument.getElementById(\"r2c3\").innerHTML=\"\";\n\tdocument.getElementById(\"r3c1\").innerHTML=\"\";\n\tdocument.getElementById(\"r3c2\").innerHTML=\"\";\n\tdocument.getElementById(\"r3c3\").innerHTML=\"\";\n\n\t//reseet gameOver so players can play again\n\tgameOver = false;\n}", "title": "" }, { "docid": "c95ef61c88f7f50d352e320a9b7c754a", "score": "0.6936473", "text": "function clear() {\r\n\r\n\t\tturn = \"\";\r\n\t\tgrid = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\r\n\t\tmsg(\"\");\r\n\t\t// We use map to generate a new empty array\r\n\t\t$(\".tile\").map(function () {\r\n\t\t\t$(this).text(\"\");\r\n\r\n\t\t});\r\n\r\n\t\twinner = 0;\r\n\t\tcount = 0;\r\n\t}", "title": "" }, { "docid": "ba88b6d8554d92b99945aad7dc1d3506", "score": "0.69218236", "text": "function clearGame(){\n tableInfo()\n pckdNumbers = []\n}", "title": "" }, { "docid": "820a06888a03049a8859408238a40476", "score": "0.6891828", "text": "function clearGame() {\n $(\"#question\").text(\"\");\n for (i = 0; i < answerArrays[questionSelector].length; i++) {\n $(\"#answerSection\" + i).html(\"\");\n }\n }", "title": "" }, { "docid": "712e6bb61b0f4cf4732600520213fbc4", "score": "0.68813044", "text": "function reset_game_board(){\n $('.community_cards').empty();\n $('.players_cards').empty();\n $('.feedback').empty();\n }", "title": "" }, { "docid": "93741a381207bf7fced44ce4dd127f0b", "score": "0.6860728", "text": "function reset() {\n clear();\n initialize(gameData);\n }", "title": "" }, { "docid": "72ac7909b356a187a025e59e5a797e61", "score": "0.68206483", "text": "function clearArrays() {\n clearPeople();\n clearBoats();\n clearFaces();\n}", "title": "" }, { "docid": "d8e1b4ab05ade3bb8f75c742e5285ce6", "score": "0.681868", "text": "function emptyApp() {\n $('.flag-1').empty();\n $('.left-main').empty();\n $('.leading-content').empty();\n $('.flag-2').empty();\n $('.right-main').empty();\n $('.list-of-teams-container').empty();\n $('.game-chooser').empty();\n $('.main').addClass('hidden');\n $('.game-chooser').addClass('hidden');\n $('.main-list').addClass('hidden');\n $('.current-game').addClass('hidden');\n $('.scroll-to-top').addClass('hidden');\n $('.scroll-to-top-2').addClass('hidden');\n}", "title": "" }, { "docid": "5c4775e899d6c301960b9c47ba091b31", "score": "0.68137866", "text": "function clearScreen() {\n $(\"#answers-section\").empty();\n $(\"#question-section\").empty();\n $(\"#timer-section\").empty();\n $(\"#gif-section\").empty();\n }", "title": "" }, { "docid": "62d213ee7056308102467d9c9214ce67", "score": "0.6797063", "text": "function empty () {\t\n\t\ti++;\n\t\tif (i===trivia.length) {\n\t\t\tendGame();\n\t\t}\n\t\telse {\t\n\t\t\t$(\"#timer\").show();\n\t \t\t$(\"#game\").empty();\n\t \tgetQuestion(i);\n \t}\n\t}", "title": "" }, { "docid": "58b00f597de303f38b2ccc24ae0be348", "score": "0.6768873", "text": "function resetGame() {\n game.lives = 1;\n game.score = 0;\n game.blockCount = ROWS*COLS;\n \n //remove everything\n scene.remove(baseBlock.mesh);\n scene.remove(ball.mesh);\n for (var i = 0; i < ROWS; i++)\n\t for (var j = 0; j < COLS; j++)\n\t scene.remove(blocks[i][j].object);\n //anddddd then reinitialize it all, i tried to just reinitialize and not remove and had some issues\n initGame();\n}", "title": "" }, { "docid": "b6071f73c91ab30b78b3b4cbbabbcc86", "score": "0.6749994", "text": "function clearBuildings() {\n document.getElementById('building1').innerHTML = \"\";\n document.getElementById('building2').innerHTML = \"\";\n document.getElementById('building3').innerHTML = \"\";\n document.getElementById('building4').innerHTML = \"\";\n document.getElementById('building5').innerHTML = \"\";\n document.getElementById('building6').innerHTML = \"\";\n}", "title": "" }, { "docid": "56e3fb589bc8a1a811116fa2c29b2dd0", "score": "0.6748401", "text": "function clearAll() {\n CURRENT_STATE = STATES.READY;\n nodesArrays = Array.from(Array(GRID_SIZE_Y), () => new Array(GRID_SIZE_X));\n Graph.clearGraph();\n NodeHandler.createNodeGrid();\n}", "title": "" }, { "docid": "dfe7e14d779ea79d96b5b080b175832e", "score": "0.6725752", "text": "function resetOverlays(){\n\t\t$('.endGame').find('#header').empty();\n\t\t$('.end_round').find('#header').empty();\n\t\t$('.stars').hide();\n\t}", "title": "" }, { "docid": "adae9ccfa298085945d8e01f353c05d7", "score": "0.67153955", "text": "function _clear() {\n Utils.removeChildren(sprites_placeholder);\n Utils.removeChildren(name_sec);\n Utils.removeChildren(ability_sec);\n }", "title": "" }, { "docid": "5a5591429fd96bf93eed2591e34d22d8", "score": "0.6709926", "text": "clearAllData() {\n this.startTime = 0;\n this.nowTime = 0;\n this.diffTime = 0;\n this.stopTimer();\n this.animateFrame = 0;\n this.gameNumbers = gameNumbers();\n this.colors = setButtonColor();\n this.checkCounter = 0;\n this.isShow = false;\n }", "title": "" }, { "docid": "865b5c2cd58d79a41ef705d4ff8c2820", "score": "0.67030025", "text": "function clearBoard() {\n for (i=0; i<=maxX; i++) {\n for (j=0; j<=maxY; j++) {\n with (cellArray[arrayIndexOf(i,j)]) {\n isExposed = false;\n isBomb = false;\n isFlagged = false;\n isMarked = false;\n isQuestion = false;\n neighborBombs = 0; } } } }", "title": "" }, { "docid": "ba03ca39b70d12ba02d68bdfbd5c1e55", "score": "0.66939574", "text": "reset() {\n\t\tfor (let i = 0; i < this.tiles.length; i++) {\n\t\t\tthis.tiles[i].unsetPiece();\n\t\t}\n\t\tfor (let i = 0; i < this.whitePieces.length; i++) {\n\t\t\tthis.whitePieces[i].unsetTile();\n\t\t\tthis.whitePieces[i].animation = null;\n\t\t\tthis.blackPieces[i].unsetTile();\n\t\t\tthis.blackPieces[i].animation = null;\n\t\t}\n\t}", "title": "" }, { "docid": "9c4feedc91a1f6a3a1158a2a5056b39f", "score": "0.668097", "text": "function clearGrid() {\n clearPipes();\n clearObstacles();\n}", "title": "" }, { "docid": "6ed15312a181fe395f2331ff5ef1f274", "score": "0.66766983", "text": "function clear() {\n if (generate) return\n const freshGrid = buildGrid()\n setGrid(freshGrid)\n genCount.current = 0\n }", "title": "" }, { "docid": "52f0dda2793a40536224e1abd7048962", "score": "0.66669744", "text": "function clear()\n{\n _list = [];\n if (_debug && _debug.percent)\n {\n _percentageList = {};\n _percentageList['Other'] = {current: 0, amounts: []};\n Debug.resize();\n }\n}", "title": "" }, { "docid": "3aae8d13d09670e74413aebe104f225e", "score": "0.6659419", "text": "function resetGame() {\n // Clear the main boxes and the minimap boxes\n for(var rIndex = 0; rIndex < NUM_ROWS; rIndex++) {\n for(var cIndex = 0; cIndex < NUM_COLS; cIndex++) {\n // Clear main boxes\n boxes[rIndex][cIndex].classList.remove(xClass, oClass);\n boxes[rIndex][cIndex].textContent = \"\";\n // Clear minimap boxes\n miniboxes[rIndex][cIndex].classList.remove(xClass, oClass);\n miniboxes[rIndex][cIndex].textContent = \"\";\n }\n }\n\n // Hide end game text\n $(victoryText).hide();\n\n // Reset number of filled boxes\n boxCount = 0;\n\n // Start the game again\n gameOver = false;\n }", "title": "" }, { "docid": "ab4aa19756821d0b8a770f6881cead5c", "score": "0.66594076", "text": "function reset() {\n if (ref_div_main.children.length != 0) {\n for (let i = 0; i < (cant_bloques); i++) {\n ref_div_main.children[0].remove()\n }\n }\n blocksPositions = {}\n objArray = []\n first_row_index = []\n last_row_index = []\n ref_div_main.style.display = 'none'\n}", "title": "" }, { "docid": "63116e19d37e47e5e27f1354bec05db6", "score": "0.66589063", "text": "function htmlClearGame(){\n //* remove classes from the run that may have been added by the htmlIndicateWin function\n $('#run').removeClass('slideInRight').removeClass('slideOutLeft');\n\n //* reset the notifier count\n $('#notifier').empty();\n\n //* clear the run of all cards\n $('#run').empty();\n //* reset the run to its initial width\n $('#run').css('width', '150px');\n //* reset the run to its initial left position\n $('#run').css('left', '25px');\n //* hide the run to prepare for the new game\n $('#run').addClass('hidden');\n\n //* remove the class of 'fadeIn' from the hand\n $('#hand').removeClass('fadeIn');\n //* clear the hand of all cards\n $('#hand').empty();\n}", "title": "" }, { "docid": "2a57bc2eb307710957cd3d66e7177909", "score": "0.66436625", "text": "function clear() {\n consoleClear();\n buttonChecked = button_options.NONE;\n clearGlobals();\n while(scene.children.length > 0){ //removes all children from the scene\n scene.remove(scene.children[0]); \n }\n}", "title": "" }, { "docid": "a3f61feea1335e4e27e9f856adcfd2a8", "score": "0.66410345", "text": "function wipeContents() {\n upperContent.empty();\n lowerContent.empty();\n}", "title": "" }, { "docid": "88156312e4d5a6b090982cdd8adbfbad", "score": "0.66388005", "text": "function clear() {\t\t\n\t\t\tresetData();\n refreshTotalCount();\n for(var i=0;i<5; i++) { addMutationInvolvesRow(); }\n for(var i=0;i<5; i++) { addExpressesComponentsRow(); }\n for(var i=0;i<5; i++) { addDriverComponentsRow(); }\n\t\t\tsetFocus();\n\t\t}", "title": "" }, { "docid": "acf770e384425f773686b008050adc90", "score": "0.6637666", "text": "function clearValues() {\n document.getElementById('tile-grid').innerHTML = '';\n tileChoice = [];\n tileChoiceId = [];\n totalMatchAttempts = [];\n tilesMatched = [];\n document.getElementById('tries').innerText = ' 0';\n}", "title": "" }, { "docid": "600bfc75a79cb0a70e39e4d4e72b44f2", "score": "0.6634102", "text": "resetGame() {\r\n this.scrollingBG.tilePosition = ({x: 0, y: 0});\r\n this.distance = BOUND_LEFT;\r\n this.completed = 0;\r\n this.gameActive = true;\r\n\r\n // Reset the houses\r\n this.houses.removeChildren();\r\n this.houseArray = [];\r\n this.addHouses(this.goal);\r\n }", "title": "" }, { "docid": "d5c740b4eee4257fa8050617e4bc278e", "score": "0.6633453", "text": "removeAllSpawnables(){\n\n let currentSpawnables = this.spawnables.children;\n let amntCurrentSpawnables = currentSpawnables.entries.length;\n\n // done manually to as iterate will miss some blocks off\n for(var currentSpawnableNum = 0; currentSpawnableNum < amntCurrentSpawnables; currentSpawnableNum++){\n let currentSpawnable = currentSpawnables.get(currentSpawnableNum);\n currentSpawnable.destroy();\n }\n\n // duplicate the array instead of passing by reference\n availableBlocks = JSON.parse(JSON.stringify( levelBaseBlocks ));\n this.munchkinSpawner.currentMunchkins = 0;\n // add to the calculation of score\n MainGameScene.gameStats.addToCount(\"resets\");\n this.updateUI()\n }", "title": "" }, { "docid": "3dc139a397b0ccd82c0b206979807ab1", "score": "0.6629805", "text": "function clearGame() {\n disableButton();\n clearForms();\n removeBunny();\n}", "title": "" }, { "docid": "3e22714025131fa98aa4706c5ebac7e7", "score": "0.6615579", "text": "function clearAll() {\n while (service.heroes.length > 0) {\n service.heroes.splice(0, 1);\n }\n }", "title": "" }, { "docid": "fdd5fc31cafce58667346642d65b3e48", "score": "0.66132253", "text": "function destroyStructure(){\n //reseting the `top` or `translate` properties to 0\n silentScroll(0);\n\n //loading all the lazy load content\n $('img[data-src], source[data-src], audio[data-src], iframe[data-src]', container).forEach(function(item){\n setSrc(item, 'src');\n });\n\n $('img[data-srcset]').forEach(function(item){\n setSrc(item, 'srcset');\n });\n\n remove($(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL));\n\n //removing inline styles\n css($(SECTION_SEL), {\n 'height': '',\n 'background-color' : '',\n 'padding': ''\n });\n\n css($(SLIDE_SEL), {\n 'width': ''\n });\n\n css(container, {\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n\n css($htmlBody, {\n 'overflow': '',\n 'height': ''\n });\n\n // remove .fp-enabled class\n removeClass($html, ENABLED);\n\n // remove .fp-responsive class\n removeClass($body, RESPONSIVE);\n\n // remove all of the .fp-viewing- classes\n $body.className.split(/\\s+/).forEach(function (className) {\n if (className.indexOf(VIEWING_PREFIX) === 0) {\n removeClass($body, className);\n }\n });\n\n //removing added classes\n $(SECTION_SEL + ', ' + SLIDE_SEL).forEach(function(item){\n if(options.scrollOverflowHandler && options.scrollOverflow){\n options.scrollOverflowHandler.remove(item);\n }\n removeClass(item, TABLE + ' ' + ACTIVE + ' ' + COMPLETELY);\n var previousStyles = item.getAttribute('data-fp-styles');\n if(previousStyles){\n item.setAttribute('style', item.getAttribute('data-fp-styles'));\n }\n\n //removing anchors if they were not set using the HTML markup\n if(hasClass(item, SECTION) && !g_initialAnchorsInDom){\n item.removeAttribute('data-anchor');\n }\n });\n\n //removing the applied transition from the fullpage wrapper\n removeAnimation(container);\n\n //Unwrapping content\n [TABLE_CELL_SEL, SLIDES_CONTAINER_SEL,SLIDES_WRAPPER_SEL].forEach(function(selector){\n $(selector, container).forEach(function(item){\n //unwrap not being use in case there's no child element inside and its just text\n unwrap(item);\n });\n });\n\n //removing the applied transition from the fullpage wrapper\n css(container, {\n '-webkit-transition': 'none',\n 'transition': 'none'\n });\n\n //scrolling the page to the top with no animation\n window.scrollTo(0, 0);\n\n //removing selectors\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\n usedSelectors.forEach(function(item){\n removeClass($('.' + item), item);\n });\n }", "title": "" }, { "docid": "fdd5fc31cafce58667346642d65b3e48", "score": "0.66132253", "text": "function destroyStructure(){\n //reseting the `top` or `translate` properties to 0\n silentScroll(0);\n\n //loading all the lazy load content\n $('img[data-src], source[data-src], audio[data-src], iframe[data-src]', container).forEach(function(item){\n setSrc(item, 'src');\n });\n\n $('img[data-srcset]').forEach(function(item){\n setSrc(item, 'srcset');\n });\n\n remove($(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL));\n\n //removing inline styles\n css($(SECTION_SEL), {\n 'height': '',\n 'background-color' : '',\n 'padding': ''\n });\n\n css($(SLIDE_SEL), {\n 'width': ''\n });\n\n css(container, {\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n\n css($htmlBody, {\n 'overflow': '',\n 'height': ''\n });\n\n // remove .fp-enabled class\n removeClass($html, ENABLED);\n\n // remove .fp-responsive class\n removeClass($body, RESPONSIVE);\n\n // remove all of the .fp-viewing- classes\n $body.className.split(/\\s+/).forEach(function (className) {\n if (className.indexOf(VIEWING_PREFIX) === 0) {\n removeClass($body, className);\n }\n });\n\n //removing added classes\n $(SECTION_SEL + ', ' + SLIDE_SEL).forEach(function(item){\n if(options.scrollOverflowHandler && options.scrollOverflow){\n options.scrollOverflowHandler.remove(item);\n }\n removeClass(item, TABLE + ' ' + ACTIVE + ' ' + COMPLETELY);\n var previousStyles = item.getAttribute('data-fp-styles');\n if(previousStyles){\n item.setAttribute('style', item.getAttribute('data-fp-styles'));\n }\n\n //removing anchors if they were not set using the HTML markup\n if(hasClass(item, SECTION) && !g_initialAnchorsInDom){\n item.removeAttribute('data-anchor');\n }\n });\n\n //removing the applied transition from the fullpage wrapper\n removeAnimation(container);\n\n //Unwrapping content\n [TABLE_CELL_SEL, SLIDES_CONTAINER_SEL,SLIDES_WRAPPER_SEL].forEach(function(selector){\n $(selector, container).forEach(function(item){\n //unwrap not being use in case there's no child element inside and its just text\n unwrap(item);\n });\n });\n\n //removing the applied transition from the fullpage wrapper\n css(container, {\n '-webkit-transition': 'none',\n 'transition': 'none'\n });\n\n //scrolling the page to the top with no animation\n window.scrollTo(0, 0);\n\n //removing selectors\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\n usedSelectors.forEach(function(item){\n removeClass($('.' + item), item);\n });\n }", "title": "" }, { "docid": "fdd5fc31cafce58667346642d65b3e48", "score": "0.66132253", "text": "function destroyStructure(){\n //reseting the `top` or `translate` properties to 0\n silentScroll(0);\n\n //loading all the lazy load content\n $('img[data-src], source[data-src], audio[data-src], iframe[data-src]', container).forEach(function(item){\n setSrc(item, 'src');\n });\n\n $('img[data-srcset]').forEach(function(item){\n setSrc(item, 'srcset');\n });\n\n remove($(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL));\n\n //removing inline styles\n css($(SECTION_SEL), {\n 'height': '',\n 'background-color' : '',\n 'padding': ''\n });\n\n css($(SLIDE_SEL), {\n 'width': ''\n });\n\n css(container, {\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n\n css($htmlBody, {\n 'overflow': '',\n 'height': ''\n });\n\n // remove .fp-enabled class\n removeClass($html, ENABLED);\n\n // remove .fp-responsive class\n removeClass($body, RESPONSIVE);\n\n // remove all of the .fp-viewing- classes\n $body.className.split(/\\s+/).forEach(function (className) {\n if (className.indexOf(VIEWING_PREFIX) === 0) {\n removeClass($body, className);\n }\n });\n\n //removing added classes\n $(SECTION_SEL + ', ' + SLIDE_SEL).forEach(function(item){\n if(options.scrollOverflowHandler && options.scrollOverflow){\n options.scrollOverflowHandler.remove(item);\n }\n removeClass(item, TABLE + ' ' + ACTIVE + ' ' + COMPLETELY);\n var previousStyles = item.getAttribute('data-fp-styles');\n if(previousStyles){\n item.setAttribute('style', item.getAttribute('data-fp-styles'));\n }\n\n //removing anchors if they were not set using the HTML markup\n if(hasClass(item, SECTION) && !g_initialAnchorsInDom){\n item.removeAttribute('data-anchor');\n }\n });\n\n //removing the applied transition from the fullpage wrapper\n removeAnimation(container);\n\n //Unwrapping content\n [TABLE_CELL_SEL, SLIDES_CONTAINER_SEL,SLIDES_WRAPPER_SEL].forEach(function(selector){\n $(selector, container).forEach(function(item){\n //unwrap not being use in case there's no child element inside and its just text\n unwrap(item);\n });\n });\n\n //removing the applied transition from the fullpage wrapper\n css(container, {\n '-webkit-transition': 'none',\n 'transition': 'none'\n });\n\n //scrolling the page to the top with no animation\n window.scrollTo(0, 0);\n\n //removing selectors\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\n usedSelectors.forEach(function(item){\n removeClass($('.' + item), item);\n });\n }", "title": "" }, { "docid": "20fa0338c2ecb18bcce3af37b7f16db9", "score": "0.6608734", "text": "function clearSection(sectionIds) {\r\n sectionIds.forEach(\r\n (sectionId) => (document.getElementById(sectionId).innerHTML = \"\")\r\n );\r\n}", "title": "" }, { "docid": "7387367c172a09f01d4c72784fca39ea", "score": "0.6606547", "text": "function clearGame() {\n playerArrayOfChoicestoMatch = [];\n computerArrayOfChoicesToMatch = [];\n}", "title": "" }, { "docid": "bae5ff5f0ab196c5828d1cfc8761ad81", "score": "0.6598547", "text": "function clear() {\n $(\"#college-section\").empty();\n}", "title": "" }, { "docid": "3977f1843189c6918e3aa07eb2ea2388", "score": "0.6592872", "text": "function clearAll () {\n\tfor (var i = 0; i < num; i++) {\n\t\tp[i].finish();\n\t\tdelete p[i];\n\t}\n\tPelota.prototype.ID = 0;\n\tnum = 0;\n\tsetTimeout(function () {\n\t\tctx.clearRect(0, 0, can.width, can.height);\n\t}, 100);\n}", "title": "" }, { "docid": "c3bf94a2398328216715a9e710ff677d", "score": "0.6588556", "text": "function destroyStructure(){\r\n //reseting the `top` or `translate` properties to 0\r\n silentScroll(0);\r\n\r\n //loading all the lazy load content\r\n $('img[data-src], source[data-src], audio[data-src], iframe[data-src]', container).forEach(function(item){\r\n setSrc(item, 'src');\r\n });\r\n\r\n $('img[data-srcset]').forEach(function(item){\r\n setSrc(item, 'srcset');\r\n });\r\n\r\n remove($(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL));\r\n\r\n //removing inline styles\r\n css($(SECTION_SEL), {\r\n 'height': '',\r\n 'background-color' : '',\r\n 'padding': ''\r\n });\r\n\r\n css($(SLIDE_SEL), {\r\n 'width': ''\r\n });\r\n\r\n css(container, {\r\n 'height': '',\r\n 'position': '',\r\n '-ms-touch-action': '',\r\n 'touch-action': ''\r\n });\r\n\r\n css($htmlBody, {\r\n 'overflow': '',\r\n 'height': ''\r\n });\r\n\r\n // remove .fp-enabled class\r\n removeClass($html, ENABLED);\r\n\r\n // remove .fp-responsive class\r\n removeClass($body, RESPONSIVE);\r\n\r\n // remove all of the .fp-viewing- classes\r\n $body.className.split(/\\s+/).forEach(function (className) {\r\n if (className.indexOf(VIEWING_PREFIX) === 0) {\r\n removeClass($body, className);\r\n }\r\n });\r\n\r\n //removing added classes\r\n $(SECTION_SEL + ', ' + SLIDE_SEL).forEach(function(item){\r\n if(options.scrollOverflowHandler && options.scrollOverflow){\r\n options.scrollOverflowHandler.remove(item);\r\n }\r\n removeClass(item, TABLE + ' ' + ACTIVE + ' ' + COMPLETELY);\r\n var previousStyles = item.getAttribute('data-fp-styles');\r\n if(previousStyles){\r\n item.setAttribute('style', item.getAttribute('data-fp-styles'));\r\n }\r\n\r\n //removing anchors if they were not set using the HTML markup\r\n if(hasClass(item, SECTION) && !g_initialAnchorsInDom){\r\n item.removeAttribute('data-anchor');\r\n }\r\n });\r\n\r\n //removing the applied transition from the fullpage wrapper\r\n removeAnimation(container);\r\n\r\n //Unwrapping content\r\n [TABLE_CELL_SEL, SLIDES_CONTAINER_SEL,SLIDES_WRAPPER_SEL].forEach(function(selector){\r\n $(selector, container).forEach(function(item){\r\n //unwrap not being use in case there's no child element inside and its just text\r\n unwrap(item);\r\n });\r\n });\r\n\r\n //removing the applied transition from the fullpage wrapper\r\n css(container, {\r\n '-webkit-transition': 'none',\r\n 'transition': 'none'\r\n });\r\n\r\n //scrolling the page to the top with no animation\r\n window.scrollTo(0, 0);\r\n\r\n //removing selectors\r\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\r\n usedSelectors.forEach(function(item){\r\n removeClass($('.' + item), item);\r\n });\r\n }", "title": "" }, { "docid": "5e821837eb87d86176835b9be0f8b009", "score": "0.65850633", "text": "function clearGameCards() {\n app.game.querySelectorAll('*').forEach(child => child.remove());\n app.cardArray = [];\n app.firstCard = '';\n app.secondCard = '';\n app.matchedCards = [];\n}", "title": "" }, { "docid": "e8cbfedced97c4cc3f487e9189bbd817", "score": "0.656676", "text": "function destroyStructure() {\n //reseting the `top` or `translate` properties to 0\n silentScroll(0); //loading all the lazy load content\n\n $('img[data-src], source[data-src], audio[data-src], iframe[data-src]', container).forEach(function (item) {\n setSrc(item, 'src');\n });\n $('img[data-srcset]').forEach(function (item) {\n setSrc(item, 'srcset');\n });\n remove($(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL)); //removing inline styles\n\n css($(SECTION_SEL), {\n 'height': '',\n 'background-color': '',\n 'padding': ''\n });\n css($(SLIDE_SEL), {\n 'width': ''\n });\n css(container, {\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n css($htmlBody, {\n 'overflow': '',\n 'height': ''\n }); // remove .fp-enabled class\n\n removeClass($html, ENABLED); // remove .fp-responsive class\n\n removeClass($body, RESPONSIVE); // remove all of the .fp-viewing- classes\n\n $body.className.split(/\\s+/).forEach(function (className) {\n if (className.indexOf(VIEWING_PREFIX) === 0) {\n removeClass($body, className);\n }\n }); //removing added classes\n\n $(SECTION_SEL + ', ' + SLIDE_SEL).forEach(function (item) {\n if (options.scrollOverflowHandler && options.scrollOverflow) {\n options.scrollOverflowHandler.remove(item);\n }\n\n removeClass(item, TABLE + ' ' + ACTIVE + ' ' + COMPLETELY);\n var previousStyles = item.getAttribute('data-fp-styles');\n\n if (previousStyles) {\n item.setAttribute('style', item.getAttribute('data-fp-styles'));\n } //removing anchors if they were not set using the HTML markup\n\n\n if (hasClass(item, SECTION) && !g_initialAnchorsInDom) {\n item.removeAttribute('data-anchor');\n }\n }); //removing the applied transition from the fullpage wrapper\n\n removeAnimation(container); //Unwrapping content\n\n [TABLE_CELL_SEL, SLIDES_CONTAINER_SEL, SLIDES_WRAPPER_SEL].forEach(function (selector) {\n $(selector, container).forEach(function (item) {\n //unwrap not being use in case there's no child element inside and its just text\n unwrap(item);\n });\n }); //removing the applied transition from the fullpage wrapper\n\n css(container, {\n '-webkit-transition': 'none',\n 'transition': 'none'\n }); //scrolling the page to the top with no animation\n\n window.scrollTo(0, 0); //removing selectors\n\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\n usedSelectors.forEach(function (item) {\n removeClass($('.' + item), item);\n });\n }", "title": "" }, { "docid": "a2d20d88ea2e71e5db44903834fe4d32", "score": "0.6563912", "text": "function destroyStructure(){\r\n //reseting the `top` or `translate` properties to 0\r\n silentScroll(0);\r\n\r\n //loading all the lazy load content\r\n $('img[data-src], source[data-src], audio[data-src], iframe[data-src]', container).forEach(function(item){\r\n setSrc(item, 'src');\r\n });\r\n\r\n $('img[data-srcset]').forEach(function(item){\r\n setSrc(item, 'srcset');\r\n });\r\n\r\n remove($(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL));\r\n\r\n //removing inline styles\r\n css($(SECTION_SEL), {\r\n 'height': '',\r\n 'background-color' : '',\r\n 'padding': ''\r\n });\r\n\r\n css($(SLIDE_SEL), {\r\n 'width': ''\r\n });\r\n\r\n css(container, {\r\n 'height': '',\r\n 'position': '',\r\n '-ms-touch-action': '',\r\n 'touch-action': ''\r\n });\r\n\r\n css($htmlBody, {\r\n 'overflow': '',\r\n 'height': ''\r\n });\r\n\r\n // remove .fp-enabled class\r\n removeClass($('html'), ENABLED);\r\n\r\n // remove .fp-responsive class\r\n removeClass($body, RESPONSIVE);\r\n\r\n // remove all of the .fp-viewing- classes\r\n $body.className.split(/\\s+/).forEach(function (className) {\r\n if (className.indexOf(VIEWING_PREFIX) === 0) {\r\n removeClass($body, className);\r\n }\r\n });\r\n\r\n //removing added classes\r\n $(SECTION_SEL + ', ' + SLIDE_SEL).forEach(function(item){\r\n if(options.scrollOverflowHandler){\r\n options.scrollOverflowHandler.remove(item);\r\n }\r\n removeClass(item, TABLE + ' ' + ACTIVE + ' ' + COMPLETELY);\r\n var previousStyles = item.getAttribute('data-fp-styles');\r\n if(previousStyles){\r\n item.setAttribute('style', item.getAttribute('data-fp-styles'));\r\n }\r\n });\r\n\r\n //removing the applied transition from the fullpage wrapper\r\n removeAnimation(container);\r\n\r\n //Unwrapping content\r\n [TABLE_CELL_SEL, SLIDES_CONTAINER_SEL,SLIDES_WRAPPER_SEL].forEach(function(selector){\r\n $(selector, container).forEach(function(item){\r\n //unwrap not being use in case there's no child element inside and its just text\r\n item.outerHTML = item.innerHTML;\r\n });\r\n });\r\n\r\n //removing the applied transition from the fullpage wrapper\r\n css(container, {\r\n '-webkit-transition': 'none',\r\n 'transition': 'none'\r\n });\r\n\r\n //scrolling the page to the top with no animation\r\n $('html')[0].scrollTo(0, 0);\r\n $('body')[0].scrollTo(0, 0);\r\n\r\n //removing selectors\r\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\r\n usedSelectors.forEach(function(item){\r\n removeClass($('.' + item), item);\r\n });\r\n }", "title": "" }, { "docid": "e28620eb43bb49635c1149cf15171de1", "score": "0.6542241", "text": "reset() {\n document.getElementById(\"block-container\").innerHTML = null;\n this.index = 0;\n this.lookUp = {};\n this.initCellMaps();\n }", "title": "" }, { "docid": "6295d18585f652461efaa067e0cc7dc2", "score": "0.6531607", "text": "static clearData(sectionToClear) {\n let container = document.querySelector(sectionToClear);\n\n // For as long as there are children in container the first child will be removed\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n }", "title": "" }, { "docid": "7f7f9fc4c58e8d449b1a839e5c3d5f13", "score": "0.65276587", "text": "function clearPage() {\n\tlet to_clear = document.getElementById(\"rounds\");\n\twhile (to_clear.firstChild) to_clear.removeChild(to_clear.firstChild);\n\tto_clear = document.getElementById(\"bracket_span\");\n\twhile (to_clear.firstChild) to_clear.removeChild(to_clear.firstChild);\n\tto_clear = document.getElementById(\"bracket_rounds\");\n\twhile (to_clear.firstChild) to_clear.removeChild(to_clear.firstChild);\n\tto_clear = document.getElementById(\"error\");\n\twhile (to_clear.firstChild) to_clear.removeChild(to_clear.firstChild);\n\tto_clear = document.getElementById(\"change_bracket_bounds\");\n\twhile (to_clear.firstChild) to_clear.removeChild(to_clear.firstChild);\n\ttoggleableElements = [];\t\n}", "title": "" }, { "docid": "6655dff6b4b6dad95b89b736f46d85dc", "score": "0.65230715", "text": "function reset() {\n\n //clear enemies\n allEnemies.length = 0;\n //clear any text messages from the heads-up display.\n hud.textElements.length = 0;\n }", "title": "" }, { "docid": "32f7150b0f60f5e8520247a39e84e6d3", "score": "0.652215", "text": "function resetPuzzlePieces(){\n //empty the thumbnail container\n // debugger;\n \tpiecesBoards.innerHTML = \"\";\n \tcreatePuzzlePieces(this.dataset.puzzleref);\n // foreach has specify a callback function in the array\n // empty the drop zones\n dropZones.forEach(zone => {\n // removeChild\n while (zone.firstChild) zone.removeChild(zone.firstChild);\n // ouputs a message and writes into the console of the browser Chrome\n console.log(\"Ciao, see you later!\");\n });\n }", "title": "" }, { "docid": "32afcb38bfbe1964c74b28e9749d52fc", "score": "0.651497", "text": "function clearGame() {\n gameSequence = [];\n playerSequence = [];\n currentLevel = 0;\n clearInterval(intervalId);\n}", "title": "" }, { "docid": "9c9e61c3843c45e7063032732916baf6", "score": "0.6508632", "text": "function reset() {\n time = 0;\n totalScore = 0;\n lives = 5;\n speed = 10;\n points.innerText = \"00\";\n totalImmunity = 0;\n blocks = document.querySelectorAll(\".collidable\");\n blocks.forEach(block => {\n block.remove()\n });\n }", "title": "" }, { "docid": "e1e145e5a665e6a8b4931ad75025ff29", "score": "0.6501184", "text": "function clearGame() {\n if (DEBUG) console.log('inside clearGame(), removing cards from board, clearing stacks, and disabling the Battle button...');\n $(opponentCardsDivId).children().remove();\n $(opponentBattlefieldDivId).children().remove();\n $(playerBattlefieldDivId).children().remove();\n $(playerCardsDivId).children().remove();\n\n playerStack.clear();\n opponentStack.clear();\n playerWarStack.clear();\n opponentWarStack.clear();\n\n // disable the Battle button since it is only applicable when a game is being played\n $(battleButtonId).attr(\"disabled\", \"disabled\");\n\n // clear any remaining timed operations\n window.clearTimeout(delayOperation);\n }", "title": "" }, { "docid": "5ee31eccb0e6559278dca222e11a870d", "score": "0.6501112", "text": "function clear() {\n $(\"#article-section\").empty();\n }", "title": "" }, { "docid": "5c78a1162a3acfbf0a64e6e25c9f9e6a", "score": "0.64957553", "text": "clear() {\n for (let i = 0; i < this.rounds; i++)\n for (let j = 0; j < 3; j++)\n this.keySchedule[i][j] = 0;\n }", "title": "" }, { "docid": "1dcf40776ef7955c9522ee3b1d4bfb01", "score": "0.6491464", "text": "function clearAll(){\n for (let i = 0; i < playerMap.length; i++) {\n let scoreBox = document.getElementById('mainBord' + (i+1));\n scoreBox.innerHTML = \" \";\n }\n while (playerMap.length > 0){\n playerMap.pop();\n currentScoreArray.pop();\n }\n document.getElementById(\"find\").innerHTML = \" \";\n}", "title": "" }, { "docid": "86a98972853181d215587571c566cce0", "score": "0.6488192", "text": "clear() {\n this._features = {};\n this._render();\n }", "title": "" }, { "docid": "92df6d208342772e221d770068dccf86", "score": "0.648269", "text": "function reset() {\n counter = 0;\n allEvents = [];\n markers = [];\n currentEvent = undefined;\n periods = undefined;\n $('.blacktop').show();\n $mapDiv.hide();\n preGame();\n }", "title": "" }, { "docid": "c3f3a2973dd5022afea3cef554cdf201", "score": "0.6479163", "text": "function removeAllBlocks() {\n\tblocks.innerHTML = '';\n\tsetScriptNumber('');\n}", "title": "" }, { "docid": "93e32a2c237b3ec0f5a95021c10ea010", "score": "0.6470967", "text": "function clear() {\n $(\"#article-section\").empty();\n }", "title": "" }, { "docid": "fdbfd80b90574e3b22faeeb461a215c3", "score": "0.64691293", "text": "function clearPlayArea () {\n // queryselect only after the divs have been added. else it only consists of bottombun\n ingredients = document.querySelectorAll('.ingredients')\n ingredients.forEach(function (el) {\n if (el.id !== 'bottombun') { // remove everything leaving bottom div\n el.parentNode.removeChild(el)\n }\n })\n }", "title": "" }, { "docid": "20a144dcf0b656e5ff35e20ce81c56a1", "score": "0.6465753", "text": "function clear() {\n clearContainer();\n items.length = 0;\n }", "title": "" }, { "docid": "5a25bc2c227b180675a1104cd6335ebd", "score": "0.64633906", "text": "function clear() {\n\t$(\".square\").remove();\n\tload(present_size);\n\tset_running();\n}", "title": "" }, { "docid": "d290accf8cf1793515994971c7281adc", "score": "0.64632344", "text": "function resetGameBoard() {\n for (var id in cars) {\n cars[id].destroy();\n }\n cars = {};\n dests = {};\n locations = {};\n\n var shape_graphics = [];\n\n configAndStart();\n}", "title": "" }, { "docid": "7f6441cf03be6514cc35b20c874714ec", "score": "0.6461518", "text": "function clearArea() {\n while (playerArea.firstChild) {\n playerArea.removeChild(playerArea.firstChild);\n }\n}", "title": "" }, { "docid": "6055b181d9a6ea31f44b00328f2a2ae6", "score": "0.6460051", "text": "function clearSection() {\n quizEl.innerHTML = \"\";\n}", "title": "" }, { "docid": "98d3883832b787876088dac1463301ad", "score": "0.6442241", "text": "async clear() {\n if (this._store) await this._store.clear(this.name);\n this._undos = {};\n this._cells = {};\n }", "title": "" }, { "docid": "ddbcc27078b57094e51b76db8ca0bb3d", "score": "0.6438255", "text": "function clearData() {\n\tvar i, j;\n\tfor (i = 0; i < realWidth; i++) {\n\t\tfor (j = 0; j < realHeight; j++) {\n\t\t\tif (map[i][j] === 1) {\n\t\t\t\tmap[i][j] = 0;\n\t\t\t}\n\t\t}\n\t}\n\tpreviousLiveCells.splice(0, previousLiveCells.length);\t\n}", "title": "" }, { "docid": "3e6c845d268286cc2ab6b7d627b7eada", "score": "0.64379317", "text": "function clearVenues() {\n hideClusterNavigation();\n $('#venue-text').text('');\n console.log('removing venue markers' + venueDetails.length); //note didn't remove from the screen?\n if (venueDetails.length > 0)\n for (var i = 0; i < venueDetails.length; i++) {\n venueDetails[i].removeMarker();\n }\n venueDetails = [];\n venueDetails=$.extend(true,[],permanentMarkers);\n\n}", "title": "" }, { "docid": "5a00f2daa9d8b2a5d3eec4fa14453416", "score": "0.64375454", "text": "function destroyStructure(){\n //reseting the `top` or `translate` properties to 0\n silentScroll(0);\n\n //loading all the lazy load content\n container.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function(){\n setSrc($(this), 'src');\n });\n\n container.find('img[data-srcset]').each(function(){\n setSrc($(this), 'srcset');\n });\n\n $(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL).remove();\n\n //removing inline styles\n $(SECTION_SEL).css( {\n 'height': '',\n 'background-color' : '',\n 'padding': ''\n });\n\n $(SLIDE_SEL).css( {\n 'width': ''\n });\n\n container.css({\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n\n $htmlBody.css({\n 'overflow': '',\n 'height': ''\n });\n\n // remove .fp-enabled class\n $('html').removeClass(ENABLED);\n\n // remove .fp-responsive class\n $body.removeClass(RESPONSIVE);\n\n // remove all of the .fp-viewing- classes\n $.each($body.get(0).className.split(/\\s+/), function (index, className) {\n if (className.indexOf(VIEWING_PREFIX) === 0) {\n $body.removeClass(className);\n }\n });\n\n //removing added classes\n $(SECTION_SEL + ', ' + SLIDE_SEL).each(function(){\n options.scrollOverflowHandler.remove($(this));\n $(this).removeClass(TABLE + ' ' + ACTIVE);\n });\n\n removeAnimation(container);\n\n //Unwrapping content\n container.find(TABLE_CELL_SEL + ', ' + SLIDES_CONTAINER_SEL + ', ' + SLIDES_WRAPPER_SEL).each(function(){\n //unwrap not being use in case there's no child element inside and its just text\n $(this).replaceWith(this.childNodes);\n });\n\n //removing the applied transition from the fullpage wrapper\n container.css({\n '-webkit-transition': 'none',\n 'transition': 'none'\n });\n\n //scrolling the page to the top with no animation\n $htmlBody.scrollTop(0);\n\n //removing selectors\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\n $.each(usedSelectors, function(index, value){\n $('.' + value).removeClass(value);\n });\n }", "title": "" }, { "docid": "5a00f2daa9d8b2a5d3eec4fa14453416", "score": "0.64375454", "text": "function destroyStructure(){\n //reseting the `top` or `translate` properties to 0\n silentScroll(0);\n\n //loading all the lazy load content\n container.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function(){\n setSrc($(this), 'src');\n });\n\n container.find('img[data-srcset]').each(function(){\n setSrc($(this), 'srcset');\n });\n\n $(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL).remove();\n\n //removing inline styles\n $(SECTION_SEL).css( {\n 'height': '',\n 'background-color' : '',\n 'padding': ''\n });\n\n $(SLIDE_SEL).css( {\n 'width': ''\n });\n\n container.css({\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n\n $htmlBody.css({\n 'overflow': '',\n 'height': ''\n });\n\n // remove .fp-enabled class\n $('html').removeClass(ENABLED);\n\n // remove .fp-responsive class\n $body.removeClass(RESPONSIVE);\n\n // remove all of the .fp-viewing- classes\n $.each($body.get(0).className.split(/\\s+/), function (index, className) {\n if (className.indexOf(VIEWING_PREFIX) === 0) {\n $body.removeClass(className);\n }\n });\n\n //removing added classes\n $(SECTION_SEL + ', ' + SLIDE_SEL).each(function(){\n options.scrollOverflowHandler.remove($(this));\n $(this).removeClass(TABLE + ' ' + ACTIVE);\n });\n\n removeAnimation(container);\n\n //Unwrapping content\n container.find(TABLE_CELL_SEL + ', ' + SLIDES_CONTAINER_SEL + ', ' + SLIDES_WRAPPER_SEL).each(function(){\n //unwrap not being use in case there's no child element inside and its just text\n $(this).replaceWith(this.childNodes);\n });\n\n //removing the applied transition from the fullpage wrapper\n container.css({\n '-webkit-transition': 'none',\n 'transition': 'none'\n });\n\n //scrolling the page to the top with no animation\n $htmlBody.scrollTop(0);\n\n //removing selectors\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\n $.each(usedSelectors, function(index, value){\n $('.' + value).removeClass(value);\n });\n }", "title": "" }, { "docid": "13fb6d27314b4b925956bb5882ea887e", "score": "0.64355123", "text": "function resetContainers() {\n \n $(\"#featureList\").empty();\n $(\"#form\").empty();\n $(\"#selectedFeatureList\").empty();\n $(\"#legend\").empty();\n \n}", "title": "" }, { "docid": "9c02b3c092cc1a5f54832ef3d47d9772", "score": "0.64346814", "text": "function resetAllGame() {\n /* Setting up player and all ghosts colors */\n player.spawn();\n enemies.forEach(spawnAll); \n\n /* setting up center */\n player.updateCenter(); //player center\n enemies.forEach(UpdateCAll);\n \n resetHUD();\n}", "title": "" }, { "docid": "5ca03e63e51ea8dd98d07e5b59f6efe0", "score": "0.6434006", "text": "function clearAll() {\n for (let i = 0; i < 11; i++) {\n setNone(i);\n }\n running = false;\n }", "title": "" }, { "docid": "00ec8a9d6ff9c95d636dcaaaa6eef170", "score": "0.64326936", "text": "clearBoard () {\n $('.mushroom-container').empty();\n }", "title": "" }, { "docid": "c099da60e583a41867eceab72d276a2e", "score": "0.643011", "text": "function destroyStructure(){\n $('html,body').css({\n 'overflow' : 'visible',\n 'height' : 'initial'\n });\n\n $('#pp-nav').remove();\n\n //removing inline styles\n $('.pp-section').css({\n 'height': '',\n 'background-color' : '',\n 'padding': '',\n 'z-index': 'auto'\n });\n\n container.css({\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n\n //removing added classes\n $('.pp-section').each(function(){\n $(this).removeData('index').removeAttr('style')\n .removeData('index').removeAttr('data-index')\n .removeData('anchor').removeAttr('data-anchor')\n .removeClass('pp-table active pp-easing pp-section');\n });\n\n if(options.menu){\n $(options.menu).find('[data-menuanchor]').removeClass('active');\n $(options.menu).find('[data-menuanchor]').removeData('menuanchor');\n }\n\n //removing previous anchor classes\n $('body')[0].className = $('body')[0].className.replace(/\\b\\s?pp-viewing-[^\\s]+\\b/g, '');\n\n //Unwrapping content\n container.find('.pp-tableCell').each(function(){\n //unwrap not being use in case there's no child element inside and its just text\n $(this).replaceWith(this.childNodes);\n });\n }", "title": "" }, { "docid": "78cb5a683845ba1b6c725db3c2850ca4", "score": "0.6429371", "text": "function clearSections(){\n $('#js-list, #js-login, #js-signup, #js-post, #js-detail, #js-admin-form').addClass('hidden');\n}", "title": "" }, { "docid": "050ebb933d1a5b515b2430c5c8bb21e7", "score": "0.6428266", "text": "function gameReset(){\n\n\t\t// clear instances\n\t\tHead.resetInstanceList();\n\t\tBody.resetInstanceList();\n\t\tFood.resetInstanceList();\n\n\t\t// clear map\n\t\tmap = newMap();\n\t}", "title": "" }, { "docid": "7292518de66de8a532e3045964cb6912", "score": "0.64275134", "text": "removeAll() {\n\t\tfor (const key of Object.keys(this.cards)) { this.cards[key].df = null; }\n\t\tthis.cards = {}; this.multiple = []; this.ctrlDelete = []; this.tabs = null;\n }", "title": "" }, { "docid": "a560a60e7e0b425f012c61fc2b1c3cf9", "score": "0.6427013", "text": "function reset() {\n $holder.children().remove();\n $(\"#boardLine\").children().remove();\n boardLine = createBoardLine();\n\n // create an array of tiles\n tiles = createRandomTiles(7, json);\n // changed my mind, didnt want to reset highscore but kept functionality\n // highScore = 0;\n // $highScore.text(`High Score: ${highScore}`);\n score = updateScore(boardLine);\n $score.text(`Score: ${score}`);\n }", "title": "" }, { "docid": "2fe08f58e5414fce243b992f2d2009c4", "score": "0.64250755", "text": "function clearBoard() {\r\n\tcells.forEach(element => {\r\n\t\tvar cell = document.getElementById(element);\r\n\t\tcell.innerHTML='';\r\n\t});\r\n\r\n\tstate.board = Array(9).fill(null);\r\n}", "title": "" }, { "docid": "ef0e4c40f38fe03f0c5d645da4ba7d9c", "score": "0.6416837", "text": "function clearGrid() {\n canvas.empty();\n}", "title": "" }, { "docid": "d2e458eefdc6eaa9ad0c4e42c75e0149", "score": "0.6413903", "text": "function eraseGrid(){ \n grid.innerHTML = '';\n buildGrid(selectedSize);\n}", "title": "" }, { "docid": "24a8e3afaadb2e9fc9eaa93b02e6de1c", "score": "0.64099026", "text": "function clearGrid() {\n for (let i = 0; i < numRectanglesWide; i++) {\n for (let j = 0; j < numRectanglesHigh; j++) {\n setAndPlotRectangle(i, j, false);\n }\n }\n }", "title": "" }, { "docid": "e0cad7658073cb0a4edde60b4f0279d4", "score": "0.6399658", "text": "cleanUpUI(sectionElement) {\n allQuestionsSection.getElementsByClassName('questions-container')[0].innerHTML = '';\n userQuestionsSection.getElementsByClassName('questions-container')[0].innerHTML = '';\n answersForQuestionSection.getElementsByClassName('answers-container')[0].innerHTML = '';\n }", "title": "" }, { "docid": "1a8b328ef9f9abe6f751c083d7f34662", "score": "0.63977003", "text": "function destroyStructure(){\r\n //reseting the `top` or `translate` properties to 0\r\n silentScroll(0);\r\n\r\n //loading all the lazy load content\r\n container.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function(){\r\n setSrc($(this), 'src');\r\n });\r\n\r\n container.find('img[data-srcset]').each(function(){\r\n setSrc($(this), 'srcset');\r\n });\r\n\r\n $(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL).remove();\r\n\r\n //removing inline styles\r\n $(SECTION_SEL).css( {\r\n 'height': '',\r\n 'background-color' : '',\r\n 'padding': ''\r\n });\r\n\r\n $(SLIDE_SEL).css( {\r\n 'width': ''\r\n });\r\n\r\n container.css({\r\n 'height': '',\r\n 'position': '',\r\n '-ms-touch-action': '',\r\n 'touch-action': ''\r\n });\r\n\r\n $htmlBody.css({\r\n 'overflow': '',\r\n 'height': ''\r\n });\r\n\r\n // remove .fp-enabled class\r\n $('html').removeClass(ENABLED);\r\n\r\n // remove .fp-responsive class\r\n $body.removeClass(RESPONSIVE);\r\n\r\n // remove all of the .fp-viewing- classes\r\n $.each($body.get(0).className.split(/\\s+/), function (index, className) {\r\n if (className.indexOf(VIEWING_PREFIX) === 0) {\r\n $body.removeClass(className);\r\n }\r\n });\r\n\r\n //removing added classes\r\n $(SECTION_SEL + ', ' + SLIDE_SEL).each(function(){\r\n options.scrollOverflowHandler.remove($(this));\r\n $(this).removeClass(TABLE + ' ' + ACTIVE);\r\n });\r\n\r\n removeAnimation(container);\r\n\r\n //Unwrapping content\r\n container.find(TABLE_CELL_SEL + ', ' + SLIDES_CONTAINER_SEL + ', ' + SLIDES_WRAPPER_SEL).each(function(){\r\n //unwrap not being use in case there's no child element inside and its just text\r\n $(this).replaceWith(this.childNodes);\r\n });\r\n\r\n //removing the applied transition from the fullpage wrapper\r\n container.css({\r\n '-webkit-transition': 'none',\r\n 'transition': 'none'\r\n });\r\n\r\n //scrolling the page to the top with no animation\r\n $htmlBody.scrollTop(0);\r\n\r\n //removing selectors\r\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\r\n $.each(usedSelectors, function(index, value){\r\n $('.' + value).removeClass(value);\r\n });\r\n }", "title": "" }, { "docid": "1a8b328ef9f9abe6f751c083d7f34662", "score": "0.63977003", "text": "function destroyStructure(){\r\n //reseting the `top` or `translate` properties to 0\r\n silentScroll(0);\r\n\r\n //loading all the lazy load content\r\n container.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function(){\r\n setSrc($(this), 'src');\r\n });\r\n\r\n container.find('img[data-srcset]').each(function(){\r\n setSrc($(this), 'srcset');\r\n });\r\n\r\n $(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL).remove();\r\n\r\n //removing inline styles\r\n $(SECTION_SEL).css( {\r\n 'height': '',\r\n 'background-color' : '',\r\n 'padding': ''\r\n });\r\n\r\n $(SLIDE_SEL).css( {\r\n 'width': ''\r\n });\r\n\r\n container.css({\r\n 'height': '',\r\n 'position': '',\r\n '-ms-touch-action': '',\r\n 'touch-action': ''\r\n });\r\n\r\n $htmlBody.css({\r\n 'overflow': '',\r\n 'height': ''\r\n });\r\n\r\n // remove .fp-enabled class\r\n $('html').removeClass(ENABLED);\r\n\r\n // remove .fp-responsive class\r\n $body.removeClass(RESPONSIVE);\r\n\r\n // remove all of the .fp-viewing- classes\r\n $.each($body.get(0).className.split(/\\s+/), function (index, className) {\r\n if (className.indexOf(VIEWING_PREFIX) === 0) {\r\n $body.removeClass(className);\r\n }\r\n });\r\n\r\n //removing added classes\r\n $(SECTION_SEL + ', ' + SLIDE_SEL).each(function(){\r\n options.scrollOverflowHandler.remove($(this));\r\n $(this).removeClass(TABLE + ' ' + ACTIVE);\r\n });\r\n\r\n removeAnimation(container);\r\n\r\n //Unwrapping content\r\n container.find(TABLE_CELL_SEL + ', ' + SLIDES_CONTAINER_SEL + ', ' + SLIDES_WRAPPER_SEL).each(function(){\r\n //unwrap not being use in case there's no child element inside and its just text\r\n $(this).replaceWith(this.childNodes);\r\n });\r\n\r\n //removing the applied transition from the fullpage wrapper\r\n container.css({\r\n '-webkit-transition': 'none',\r\n 'transition': 'none'\r\n });\r\n\r\n //scrolling the page to the top with no animation\r\n $htmlBody.scrollTop(0);\r\n\r\n //removing selectors\r\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\r\n $.each(usedSelectors, function(index, value){\r\n $('.' + value).removeClass(value);\r\n });\r\n }", "title": "" }, { "docid": "2c23da99b6db73467731515ae77e7c22", "score": "0.6397248", "text": "function reset(){\n let length = document.body.children.length;\n for(let i = length-1; i > 0; i--){//clears the field\n if(document.body.children[i].id !== \"menu\"&&\n document.body.children[i].id !== \"food\")\n document.body.removeChild(document.body.children[i]);\n }\n setUpField(false);\n setupSnake(15);\n openMenu(\"dead\"); \n}", "title": "" }, { "docid": "066584d957a412970f35cfe38133a11f", "score": "0.63969064", "text": "function cleanGrid(){\n while (canvasBox.hasChildNodes()){\n canvasBox.removeChild(canvasBox.firstChild);\n }\n}", "title": "" }, { "docid": "7c8a28100a9480918242cafb6666e7b4", "score": "0.63939893", "text": "function clearGrid() {\n while (grid.firstChild) {\n grid.removeChild(grid.firstChild);\n }\n }", "title": "" }, { "docid": "5e9c60915ddb0b66da9078a4609b5bbb", "score": "0.63906103", "text": "function destroyStructure() {\n //reseting the `top` or `translate` properties to 0\n silentScroll(0);\n\n //loading all the lazy load content\n container.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function() {\n setSrc($(this), 'src');\n });\n\n container.find('img[data-srcset]').each(function() {\n setSrc($(this), 'srcset');\n });\n\n $(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL).remove();\n\n //removing inline styles\n $(SECTION_SEL).css({\n 'height': '',\n 'background-color': '',\n 'padding': ''\n });\n\n $(SLIDE_SEL).css({\n 'width': ''\n });\n\n container.css({\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n\n $htmlBody.css({\n 'overflow': '',\n 'height': ''\n });\n\n // remove .fp-enabled class\n $('html').removeClass(ENABLED);\n\n // remove .fp-responsive class\n $body.removeClass(RESPONSIVE);\n\n // remove all of the .fp-viewing- classes\n $.each($body.get(0).className.split(/\\s+/), function(index, className) {\n if (className.indexOf(VIEWING_PREFIX) === 0) {\n $body.removeClass(className);\n }\n });\n\n //removing added classes\n $(SECTION_SEL + ', ' + SLIDE_SEL).each(function() {\n if (options.scrollOverflowHandler) {\n options.scrollOverflowHandler.remove($(this));\n }\n $(this).removeClass(TABLE + ' ' + ACTIVE);\n $(this).attr('style', $(this).data('fp-styles'));\n });\n\n removeAnimation(container);\n\n //Unwrapping content\n container.find(TABLE_CELL_SEL + ', ' + SLIDES_CONTAINER_SEL + ', ' + SLIDES_WRAPPER_SEL).each(function() {\n //unwrap not being use in case there's no child element inside and its just text\n $(this).replaceWith(this.childNodes);\n });\n\n //removing the applied transition from the fullpage wrapper\n container.css({\n '-webkit-transition': 'none',\n 'transition': 'none'\n });\n\n //scrolling the page to the top with no animation\n $htmlBody.scrollTop(0);\n\n //removing selectors\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\n $.each(usedSelectors, function(index, value) {\n $('.' + value).removeClass(value);\n });\n }", "title": "" }, { "docid": "24e6176a2f436673ccde886c9d385083", "score": "0.639025", "text": "function clearAll() {\n\tdocument.getElementById(\"r1c1\").innerHTML = \"\";\n\tdocument.getElementById(\"r1c2\").innerHTML = \"\";\n\tdocument.getElementById(\"r1c3\").innerHTML = \"\";\n\tdocument.getElementById(\"r2c1\").innerHTML = \"\";\n\tdocument.getElementById(\"r2c2\").innerHTML = \"\";\n\tdocument.getElementById(\"r2c3\").innerHTML = \"\";\n\tdocument.getElementById(\"r3c1\").innerHTML = \"\";\n\tdocument.getElementById(\"r3c2\").innerHTML = \"\";\n\tdocument.getElementById(\"r3c3\").innerHTML = \"\";\n}", "title": "" }, { "docid": "1cab092106b2663eea0900566c1e4405", "score": "0.638203", "text": "function sched_clear() {\n\tfor (let name in schedule.list) {\n\t\t// Remove summary sidebar elements.\n\t\tdiv.summary_tbody.removeChild(schedule.list[name].tr);\n\n\t\t// Remove cards.\n\t\tfor (let i in schedule.list[name].cards)\n\t\t\tdiv.deck.removeChild(schedule.list[name].cards[i]);\n\n\t\tdelete schedule.list[name];\n\t}\n}", "title": "" }, { "docid": "a69e64e9e45f51cc8ec29d9abd2a04ee", "score": "0.6380893", "text": "clearAll() {\n this.clearGraphic()\n this.clearData()\n }", "title": "" }, { "docid": "10df832c33c6124f415c591831b7ad67", "score": "0.63789296", "text": "function resetGame() {\n const blocksToRemove = document.querySelectorAll('.new-block')\n for (let i = 0; i < blocksToRemove.length; i++) {\n blocksToRemove[i].remove()\n }\n currentScore = 0\n}", "title": "" } ]
d321a08c58c864b7c09525ef96a9208f
no specific middleware to add
[ { "docid": "dc81ec3b4123abb48f5012941605cc28", "score": "0.0", "text": "function azure_express(app){\n return app;\n}", "title": "" } ]
[ { "docid": "549c701664f62226c612130e299bf696", "score": "0.7471825", "text": "function doNothingMiddleware(req, res, next) {\n next();\n}", "title": "" }, { "docid": "4dc0d3d945e45de6979963c55ce78cb3", "score": "0.6997311", "text": "middleware() {\n\n\t}", "title": "" }, { "docid": "7062829ca32f5275eda23104c5b24fc9", "score": "0.6912248", "text": "function applyMiddleware() {\n}", "title": "" }, { "docid": "259ac736729c5b99ae04526dd590fff7", "score": "0.6587407", "text": "function blankhandler(req, res, next){\r\n next();\r\n}", "title": "" }, { "docid": "ebff4f50efc47792d0bad0c544d55ea6", "score": "0.65320295", "text": "_addMiddleware() {\n const app = this._app;\n\n // Logging.\n app.use(this._requestLogger.expressMiddleware);\n\n // Thwack the `X-Powered-By` header that Express provides by default,\n // replacing it with something that identifies this product.\n app.use((req_unused, res, next) => {\n res.setHeader('X-Powered-By', ServerEnv.theOne.buildInfo.buildId);\n next();\n });\n }", "title": "" }, { "docid": "b7b12107dbb918d0dbd413a556bc624c", "score": "0.6259042", "text": "addPreroutingMiddlewares() { \n // cross-sites request middleware\n this.express.use(cors());\n\n // logger middleware\n this.express.use(logger('dev'));\n\n // query parser middlewares\n this.express.use(methodOverride());\n this.express.use(bodyParser.urlencoded({\n extended: false,\n }));\n\n // json form parser middleware\n this.express.use(bodyParser.json());\n \n\n // error handling\n //this.express.use(errorHandler());\n }", "title": "" }, { "docid": "790778ffb3069b30720cf1f6ee8dbf6b", "score": "0.62244874", "text": "unlessRoutes() {\n this.router.use(expressJWT({\n secret: env.secret,\n }).unless({\n path: [\n this.admin_api_path + 'login-admin',\n this.admin_api_path + 'forgot-password',\n this.admin_api_path + 'reset-password',\n this.admin_api_path + 'add-user',\n ]\n }));\n }", "title": "" }, { "docid": "d0156b8d2e2d04de62b370c80e61be20", "score": "0.6218073", "text": "set middleware(name) {\n this.#middleware = [];\n this.addMiddleware(name);\n }", "title": "" }, { "docid": "c22b38e0b9bd8232639476785367b04e", "score": "0.6185839", "text": "_postMiddlewares() {\n this._app.use(errorHandler);\n this._app.use(notFoundHandler);\n }", "title": "" }, { "docid": "2e861435df9baef3d8a0c6aff15484b3", "score": "0.6182348", "text": "push(middleware) {\n this._middleware.push(middleware);\n }", "title": "" }, { "docid": "055608d1b729d070cb643b0315149e94", "score": "0.61302865", "text": "function Middleware() {\n this.args = [];\n}", "title": "" }, { "docid": "db294fb3cca820e92dbf3c65b7bd6297", "score": "0.61177516", "text": "function ignorer(req, res, next){\n\t// Ignore our own messages\n\tif (req.body.userId === appId) {\n\t\tres.status(201).send().end();\n\t\treturn;\n\t} else {\n\t\tconsole.log('Sending body to next middleware ' + JSON.stringify(req.body));\n\t\tnext();\n\t}\n}", "title": "" }, { "docid": "6817b1e7caca9be81b8112aeb419e296", "score": "0.6075517", "text": "_preMiddlewares() {\n this.app.use(expressStatusMonitor({ path: config.status_chart_route }));\n this.app.use(morgan('combined', { stream: logger.stream }));\n this._app.use(compression());\n this._app.use(helmet());\n this._app.use(cors());\n this._app.use(express.json());\n this._app.use(passport.initialize());\n }", "title": "" }, { "docid": "9e0f8b69f525d379307eeb069ffce324", "score": "0.6028011", "text": "applyMiddlewares() {\n this.app.use(BodyParser.json());\n this.app.use(BodyParser.urlencoded({ extended: true }));\n this.app.use(MethodOverride());\n }", "title": "" }, { "docid": "f01c9a9220deed6cee44d0e479be2eb2", "score": "0.6000367", "text": "addMiddleware(name) {\n if (typeof name === \"string\") {\n this.#pushMiddleware(name);\n } else if (Array.isArray(name)) {\n name.forEach((item) => {\n this.#pushMiddleware(item);\n });\n }\n\n return this;\n }", "title": "" }, { "docid": "2128c490c2afd89c899e95bd787c696e", "score": "0.59801155", "text": "addMiddleware(middlewareFunc) {\n this.middleware.add(middlewareFunc);\n }", "title": "" }, { "docid": "d3e185b72fe79f4e0a033a6ee33be5eb", "score": "0.5943322", "text": "use(middleware) {\n logger.debug('use middleware', { name: middleware.name });\n this.middlewares.push(middleware);\n }", "title": "" }, { "docid": "c16e7b7b03890b637de44053b554d28a", "score": "0.5939682", "text": "function myAppMiddleware(request, response, next) {\n user = 'Guest';\n next();\n}", "title": "" }, { "docid": "ac1a2d0367a1416e70639af4303981d2", "score": "0.5933895", "text": "use(...middleware) {\n this.middlewares.push(...middleware);\n }", "title": "" }, { "docid": "0d1c7608618bf279347692d711d17541", "score": "0.5932481", "text": "push(middleware) {\n this._middleware.push(middleware);\n }", "title": "" }, { "docid": "8fdd0753f6df4b038bf142429079d971", "score": "0.5930613", "text": "get hasMiddleware() {\n return this.catchAllMiddleware.length > 0;\n }", "title": "" }, { "docid": "45b943c533b7627923136042cee5aef4", "score": "0.5924906", "text": "middleware() {\n this.app.use(express_1.default.json());\n this.app.use(cors_1.default());\n this.app.use(morgan_1.default('dev'));\n }", "title": "" }, { "docid": "decd63f42a842fd287eeaa2e681b2cc0", "score": "0.59043705", "text": "function strictRouting (req, res, next) {\n if (req.originalUrl.slice(-1) === '/') return next()\n next('route')\n}", "title": "" }, { "docid": "5c41bee0b7296c46f642f48588076904", "score": "0.5881048", "text": "middle(req, res, next) {\n next();\n }", "title": "" }, { "docid": "7dc786f6f0f9f53209028fed3ba66b39", "score": "0.5862663", "text": "function whitelist(req, res, next) {\n // Do not check a request that has tracking disabled.\n if(req.isTrackingEnabled === false) {\n return next();\n }\n\n //TODO: Enforce a whitelist of urls that will not be \n // tracked by the tracker, so sayith the config.\n\n next();\n }", "title": "" }, { "docid": "91438bcd673cd8128961f5f1f05ca085", "score": "0.58394206", "text": "function bouncer(req, res, next) {\n return res.status(404).json(\"These are not the droids you're looking for\");\n next(); // <== this will not execute because the 'return' statement ensures that it won't run\n}", "title": "" }, { "docid": "6a82026d9a1266866f40a89d2cbff1b5", "score": "0.5837904", "text": "constructor() {\n this.middlewares = [];\n }", "title": "" }, { "docid": "bcd19a77c7dc953c0c1fab58a7a62c8f", "score": "0.5824841", "text": "initMiddleware() {\n this.app.use(this.express.json());\n this.app.use(this.express.urlencoded({ extended: true }));\n }", "title": "" }, { "docid": "541c1faa6782736487a48366d8c9e894", "score": "0.5822734", "text": "addPostRoutingMiddlewares() {\n // catches 404 not found error and forward to error handler\n this.express.use((err, req, res, next) => {\n console.log(err);\n err.status = 404;\n next(err);\n });\n\n // debug error handling\n /* eslint-disable no-unused-vars */\n this.express.use((err, req, res, next) => {\n /* eslint-enable no-unused-vars */\n console.log(err.stack);\n res.status(err.status || 500);\n\n return res.json({'errors': {\n message: err.message,\n error: err\n }});\n\n // STOP MIDDLEWARES CHAIN\n });\n }", "title": "" }, { "docid": "48131704c239df8408ff9dd2ba8b5401", "score": "0.5808062", "text": "function NoopHandler() {}", "title": "" }, { "docid": "6a5d7d3bd0a3d40f866f8ed7e2dabb83", "score": "0.5793496", "text": "onNoMatch(req, res) {\r\n res.status(405).json({ error: `Method '${req.method}' Not Allowed` });\r\n }", "title": "" }, { "docid": "1c768f6e2c570fbf236479b97a4d2c05", "score": "0.57932144", "text": "onNoMatch(req, res) {\n res.status(405).json({ error: `Method '${req.method}' Not Allowed` });\n }", "title": "" }, { "docid": "a41c7b8fc1e26ea4b571cc20566e54af", "score": "0.5773515", "text": "koaMiddleware() {\n return this.middleware.middleware();\n }", "title": "" }, { "docid": "2328ed192acd1c633831200a56a3acdc", "score": "0.5748994", "text": "middleware(connect, opt) {\n\t\t\treturn [\n\t\t\t\tfunction(req, res, next) {\n\t\t\t\t\t// only in case url is following format: /build/dashboard/1\n\t\t\t\t\t// and not in these cases: /build/index.html#/dashboard/1\n\t\t\t\t\tif (req.url.indexOf('build') > -1 && req.url.indexOf('#') === -1 &&\n\t\t\t\t\t\t!req.url.match(/\\..{2,4}$/g) && req.url.indexOf('css') === -1 &&\n\t\t\t\t\t\treq.url.indexOf('?') === -1) {\n\t\t\t\t\t\treq.url = '/build/index.html';\n\t\t\t\t\t}\n\n\t\t\t\t\tnext();\n\t\t\t\t}\n\t\t\t];\n\t\t}", "title": "" }, { "docid": "26a3d8fdd4f2f2bfb38c41d673cd35d3", "score": "0.5746366", "text": "prependAllMiddleware(middlewares) {\n middlewares.slice().reverse().forEach(middleware => {\n this.prependMiddleware(middleware);\n });\n }", "title": "" }, { "docid": "92372e4ba89a5d0a8374c268ce08050c", "score": "0.5745168", "text": "wrapMiddleware (req, middleware, name, fn) {\n if (!this.active(req)) return fn()\n\n const context = contexts.get(req)\n const tracer = context.tracer\n const childOf = this.active(req)\n const config = context.config\n\n if (config.middleware === false) return this.bindAndWrapMiddlewareErrors(fn, req, tracer, childOf)\n\n const span = tracer.startSpan(name, { childOf })\n\n analyticsSampler.sample(span, config.measured)\n\n span.addTags({\n [RESOURCE_NAME]: middleware._name || middleware.name || '<anonymous>'\n })\n\n context.middleware.push(span)\n\n return tracer.scope().activate(span, fn)\n }", "title": "" }, { "docid": "6612bc0da78804865e12e6e924c0c4c6", "score": "0.5744282", "text": "function consoleForMiddleWare(req,res,next) {\n console.log('filtered api ', req.originalUrl);\n console.log('redirecting to ', uplinkServerAddress);\n next();\n}", "title": "" }, { "docid": "e310e7f631eb60c64565fc1770169b52", "score": "0.5732751", "text": "middlewares() {\n this.express.use(express.json());\n this.express.use(Sentry.Handlers.requestHandler());\n }", "title": "" }, { "docid": "a2f301e73480e447238c179f2b5b794d", "score": "0.57314", "text": "initMiddlewares() {\n this.app.use(ddos.express);\n this.app.use(cors());\n this.app.use(express.json());\n this.app.use(express.urlencoded({extended: true}));\n }", "title": "" }, { "docid": "3161fc1e14fea945e0ce5d98c048e800", "score": "0.57254004", "text": "function DefaultMiddleware(context, next) {\n var value = next();\n\n if (typeof value == 'undefined') {\n context.log.error(\"Server Error: One of the middleware functions returned no value\");\n }\n else\n return value;\n}", "title": "" }, { "docid": "f120bd7c537cb1e1da6ef507514a0674", "score": "0.5724704", "text": "requiresGossipMiddleware() {\n const requiresGossipMiddleware = (req, res, next) => {\n if (!req.gossip) {\n return res.status(404).send({\n success: false,\n message: 'No gossip found',\n system_code: '4000201804040320UEUPEWWQBQWDW',\n id: req.params.gossip_id,\n });\n }\n next();\n };\n return requiresGossipMiddleware;\n }", "title": "" }, { "docid": "59777267dc1b5096ec6fe9a6a4cd35cc", "score": "0.56884897", "text": "function disabledMiddleware(req, res) {\n res.json({\n success: false,\n messages: ['This feature is disabled'],\n errTypes: ['disabled'],\n });\n}", "title": "" }, { "docid": "bbc828f98c806c30e949547d5476d2f8", "score": "0.5670468", "text": "prepareRequest(req, res, next) {\n req.isAPI = true;\n if (req.get('x-requested-with') != 'XMLHttpRequest' &&\n req.get('x-requested-with') != 'app') {\n let response = {};\n response.message = 'Access denied.';\n response.errors = ['Missing X-Requested-With header. Must be set to \"XMLHttpRequest\" or \"app\" to avoid request forgery.'];\n res.status(400);\n res.type('json');\n res.send(JSON.stringify(response, null, 2));\n } else\n return next();\n }", "title": "" }, { "docid": "5095aaf83f15390b65e0af6fd3577ca0", "score": "0.56351495", "text": "setupMiddleware() {\n // Serve static files in the public directory\n this._app.use(express.static('public'));\n\n // Process application/x-www-form-urlencoded\n this._app.use(bodyParser.urlencoded({\n \textended: false\n }))\n\n // Process application/json\n this._app.use(bodyParser.json())\n }", "title": "" }, { "docid": "a95b1541aff145a4dcee6f47507e7066", "score": "0.5634255", "text": "function authenticatorOnlyMiddleware(req, res, next) {\n if ( ! req.session || ! req.session.user ) {\n res.redirect('/users/login')\n return\n }\n\n next()\n}", "title": "" }, { "docid": "e06e0eb7d13666311c47d9e44e8a854c", "score": "0.5627171", "text": "initExpressMiddleWare() {\n this.app.use(BodyParser.urlencoded({ extended: true }));\n this.app.use(BodyParser.json());\n }", "title": "" }, { "docid": "aa05a73a9b40c723fe1eb73270026b14", "score": "0.5612443", "text": "function middleHandler(req, res, next) {\n var p = {\n \"id\": shortid.generate(),\n \"timestamp\": new Date().getTime(),\n \"path\": req.originalUrl\n };\n req.trace = p;\n \n next();\n}", "title": "" }, { "docid": "229a6da4805553fdea1a9560c783e4e5", "score": "0.560874", "text": "initExpressMiddleWare() {\n\t\tthis.app.use(bodyParser.urlencoded({extended:true}));\n\t\tthis.app.use(bodyParser.json());\n\t}", "title": "" }, { "docid": "32a5bd72f5c3e300b3dbf301b7a3c3b5", "score": "0.5595207", "text": "errorMiddleware() {\n this.app.use(function (err, req, res, next) {\n if (err.message === \"Cannot read property 'catch' of undefined\") { //! if user didn't found\n let errorMessage = `Got wrong with the request, please check the req.body`\n console.error(`client send incurrent request at : `, req.body)\n res.status(422).send({\n errorMessage\n })\n } else {\n console.error(`${err.message}`)\n res.status(422).send({\n error: err.message\n })\n }\n })\n }", "title": "" }, { "docid": "9b4306da1a1e9c3d0f940fc60bd4b3f0", "score": "0.55946493", "text": "function NoopHandler() { }", "title": "" }, { "docid": "4cfc5ae353f2c679ee67c7bd7dea62e6", "score": "0.5581784", "text": "createEmptyMW () {\n switch (this.ServerType) {\n case Constants.ServerOfExpress:\n return (req, res, next) => next()\n case Constants.ServerOfKoa2:\n return (ctx, next) => next()\n case Constants.ServerOfKoa:\n default:\n return function *(next) {\n return yield next\n }\n }\n }", "title": "" }, { "docid": "64c881be8a5bd8a65b6d4b01f308e588", "score": "0.55809927", "text": "function next(err) {\n if (err) throw (err)\n index++\n if (index >= middleware.length) return\n let fn = middleware[index]\n if (!fn) next(err)\n fn(req, res, next)\n }", "title": "" }, { "docid": "a5526b44b72cdfa324695528a61f9713", "score": "0.55627626", "text": "use(fn) {\n if (!fn || typeof fn !== 'function') {\n throw new TypeError(\"Argument to use must be of type 'Function'\");\n }\n\n this.middlewares.push(fn);\n }", "title": "" }, { "docid": "6c739abdd4ea109974af2135cab9dd73", "score": "0.5551503", "text": "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n } // Fall through for normal HTTP requests.\n\n\n return next.handle(req);\n }", "title": "" }, { "docid": "91dc08edc72f682b2f70bc8b28715b85", "score": "0.55311006", "text": "function middlewares (app) {\napp.use(bodyParser.urlencoded({ extended: false }))\n // To parse json\n app.use(bodyParser.json())\n \n // For security\n app.use(helmet())\n \n // Enable logging during development\n app.use(morgan('dev', {\n skip(req, res) {\n return res.statusCode < 400\n },\n stream: process.stderr\n }))\n\n app.use(morgan('dev', {\n skip(req, res) {\n return res.statusCode >= 400\n },\n stream: process.stdout\n }))\n}", "title": "" }, { "docid": "9ea46b4c916a6c5a1a84db2c43753b7d", "score": "0.55300945", "text": "function log(req, res, next){\n console.log(\"I am middleware\")\n\n next()\n // always have to tell the middlware to go to the next request or the browser will just keep loading\n \n}", "title": "" }, { "docid": "69542da2db2f2fe9bdf4b2868c21aa2e", "score": "0.5515241", "text": "function notImplemented(req, res, next) {\n\tnext(new Error(\n \t'Data service method for ' + req.method + ' ' + req.url+ ' is not implemented'\n \t));\n}", "title": "" }, { "docid": "e213ca933f77a13773d6b735956d2845", "score": "0.55119973", "text": "requireAuth(req, res, next) {\n let jwt = req.header('Authorization');\n \n if (jwt == null || jwt == '') {\n res.status(403).send(`No JWT provided.`)\n } else {\n // TODO: restrict all endpoints except GET to admin\n next();\n }\n }", "title": "" }, { "docid": "46ce1e478ea83e677dcf0a742d919d8c", "score": "0.55101794", "text": "function noResponse(req, res) {\r\n res.writeHead(405);\r\n res.write('Method not allowed');\r\n res.end();\r\n}", "title": "" }, { "docid": "3f656b75e4f5fbdf171dd3724ac4f2a8", "score": "0.55056393", "text": "getMiddleware(request) {\n return {\n get: () => {\n return this.match(request);\n },\n put: response => {\n // eslint-disable-next-line\n console.log(response);\n }\n };\n }", "title": "" }, { "docid": "638bd592972d54be6f815d2a7dd6b10b", "score": "0.55054206", "text": "function initMiddleware(){\r\n app.use(cors());\r\n app.use(bodyParser.json());\r\n app.use(passport.initialize());\r\n app.use(passport.session());\r\n require('./config/passport')(passport);\r\n}", "title": "" }, { "docid": "a180718f6326b8c6b0e2d96845ad1333", "score": "0.55034816", "text": "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "title": "" }, { "docid": "a180718f6326b8c6b0e2d96845ad1333", "score": "0.55034816", "text": "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "title": "" }, { "docid": "a180718f6326b8c6b0e2d96845ad1333", "score": "0.55034816", "text": "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "title": "" }, { "docid": "3fbad8fc2d98c49e0b9eab7a9ec5f790", "score": "0.5500685", "text": "function checkUserMiddlware(req, res, next) {\n if (!req.data.loggedIn) return next(new Error('No user found')); // loggedIn is created in the openstad-auth module and checked against requiredRoles = ['member', 'moderator', 'admin', 'editor'];\n return next();\n }", "title": "" }, { "docid": "f246b8b666b11113d280ae22558b394c", "score": "0.54960483", "text": "function factory() {\n\treturn middleware;\n}", "title": "" }, { "docid": "f246b8b666b11113d280ae22558b394c", "score": "0.54960483", "text": "function factory() {\n\treturn middleware;\n}", "title": "" }, { "docid": "bda2c7d094e8d99f4a82babcc93ca51a", "score": "0.5492399", "text": "_validatePushMethod(req, res, next) {\n if(this.container.get('config').application.strictPushMethod) {\n if (req.originalMethod == 'PUSH') next();\n else res.sendStatus(404);\n }\n else next();\n }", "title": "" }, { "docid": "e5fc11f3ccbc39c9f27ab0497365bf95", "score": "0.5488321", "text": "function notImplemented(req, res, next){\n\tnext(new Error(\n \t'Data service method for ' + req.method + ' ' + req.url+ ' is not implemented'\n \t));\n}", "title": "" }, { "docid": "e5fc11f3ccbc39c9f27ab0497365bf95", "score": "0.5488321", "text": "function notImplemented(req, res, next){\n\tnext(new Error(\n \t'Data service method for ' + req.method + ' ' + req.url+ ' is not implemented'\n \t));\n}", "title": "" }, { "docid": "f5ae3fb797a07228ab731abf41fbecb9", "score": "0.54842925", "text": "RouteNotMatched() {\n server_1.WEB_SERVER.use('*', (req, res) => {\n res.status(404).send({\n error: true,\n msg: \"Ruta no encontrada\"\n });\n });\n }", "title": "" }, { "docid": "9013ef1eaf925779775d94ec39a2fc53", "score": "0.5483439", "text": "middleware(req, res, next) {\n require(join(ROOT_DIR, 'api', 'api'))(req, res, next);\n }", "title": "" }, { "docid": "2e2ae6322e6fb9c18761e963a8a7d89a", "score": "0.547561", "text": "function NoController() {}", "title": "" }, { "docid": "8de5e82d15043b8a5033d86611b6369d", "score": "0.54659253", "text": "function notLoggedIn(request, response, next){\n if(!request.isAuthenticated()){\n return next();\n }\n response.redirect('/');\n }", "title": "" }, { "docid": "2c4b6856761431636a661e209880b9ab", "score": "0.5464138", "text": "function init (req, next) {\n req.unhandled = false;\n next();\n}", "title": "" }, { "docid": "296834e62ca34ab739040d763c4d4b1b", "score": "0.54497945", "text": "function notImplemented(req, res, next) {\n next(new Error(\n 'Data service method for ' + req.method + ' ' + req.url+ ' is not implemented'\n ));\n}", "title": "" }, { "docid": "bc077a8f96474c1db83094aab5bf662b", "score": "0.54451036", "text": "function notImplemented(req, res, next){\n next(new Error(\n 'Data service method for ' + req.method + ' ' + req.url+ ' is not implemented'\n ));\n}", "title": "" }, { "docid": "8c53b98740222dc40a3ec15b95cafa28", "score": "0.5444271", "text": "setupMiddlewareHttpLogger_() {\n switch (this.config.magnet.logLevel) {\n case 'silent':\n return;\n }\n if (this.config.magnet.requestLogger) {\n this.getServer()\n .getEngine()\n .use(this.config.magnet.requestLogger);\n }\n }", "title": "" }, { "docid": "5bb753251db1a3f3841ea8d7612d618a", "score": "0.5439241", "text": "expressMiddleware() {\n return [\n async (req, res, next) => {\n req.log = this.child({req_id: uuid.v4()});\n\n await next();\n },\n responseTime((req, res, time) => {\n res.responseTime = time;\n })\n ];\n }", "title": "" }, { "docid": "16de995eaaa5ae2cdb2266c98c3df29c", "score": "0.54221356", "text": "middlewares() {\n this.server.use(express.json());\n }", "title": "" }, { "docid": "8be23ed755faededa765853c52bc5844", "score": "0.54153067", "text": "function isLoggedInNoRedirect (req, res, next) {\n\n if (req.isAuthenticated()) {\n\n return next()\n }\n else {\n\n res.send('jChat');\n }\n }", "title": "" }, { "docid": "bf58d0ca261359ff937fbf499e3166a7", "score": "0.5414364", "text": "function isLoggedInDontCare(req, res, next) {\n //if (req.isAuthenticated())\n return next();\n\n //res.redirect('/');\n}", "title": "" }, { "docid": "14fb5a72938719ccef8557b27539ef7d", "score": "0.5412737", "text": "requestNotExistentPath(req, res, next) {\n res.redirect('/signin');\n }", "title": "" }, { "docid": "19a944c1c6ff2eff6e57a5c98933d858", "score": "0.54059124", "text": "function use(fn) {\n\t if (typeof fn !== 'function') {\n\t throw new Error('Expected `fn` to be a function, not ' + fn);\n\t }\n\t\n\t fns.push(fn);\n\t\n\t return middleware;\n\t }", "title": "" }, { "docid": "939a180c4a43fb58e672378e0c95e0e8", "score": "0.54057467", "text": "middleware({ enableCors = false, end = true } = {}) {\n // Don't start the stand-alone server if we're exporting middleware.\n started = true;\n\n const middlewares = [jsonParser(), jaysonMiddleware(server, { end })];\n // TODO: Dedup with `start` above\n if (enableCors === true) {\n middlewares.unshift(cors({ methods: ['POST'] }));\n }\n if (typeof enableCors === 'object') {\n middlewares.unshift(cors(enableCors));\n }\n return middlewares;\n }", "title": "" }, { "docid": "6d39cf62128090ac17486aa2d641d870", "score": "0.5380366", "text": "middleware () {\n // active body from requisition\n this.express.use(express.urlencoded({ extended: false }))\n this.express.use(flash())\n // configure session to register on request session and inside a json file\n this.express.use(\n session({\n name: 'root',\n store: new FileStore({\n path: path.resolve(__dirname, '..', 'tmp', 'sessions')\n }),\n secret: 'MyAppSecret',\n resave: true,\n saveUninitialized: true\n })\n )\n }", "title": "" }, { "docid": "2f766a2b8661aa4a36b57179792b1e93", "score": "0.5374795", "text": "route ( app, req ) {\n\t\t// if we receive a request with header like this we choose one handler\n\t\tif ( req.headers[ 'my-proc' ] == 'NonExistentProc' ) {\n\t\t\treturn NonExistentProc;\n\t\t}\n\t\t// otherwise we choose other handler\n\t\telse {\n\t\t\treturn MyAppRequest;\n\t\t}\n\t}", "title": "" }, { "docid": "174b1e3110c1bfa2e89c60b81d666b40", "score": "0.53728336", "text": "setupMiddlewareBodyParser_() {\n this.getServer()\n .getEngine()\n .use(bodyParser.urlencoded({extended: false}));\n\n this.getServer()\n .getEngine()\n .use(bodyParser.json());\n }", "title": "" }, { "docid": "d0b6b8a275a357201d6e7aedaed3e1a2", "score": "0.5369539", "text": "function myAdminMiddleware(request, response, next) {\n user = 'Admin';\n next();\n}", "title": "" }, { "docid": "9a3af02e73b99a9b0425b9ff2c1e957d", "score": "0.5359112", "text": "function blacklist(req, res, next) {\n // Do not track a request that has tracking disabled.\n if(req.isTrackingEnabled === false) {\n return next();\n }\n\n if(req.url === undefined) {\n log.error(\"Request url is missing.\");\n return next();\n }\n\n //TODO: Enforce a blacklist of urls that will not be \n // tracked by the tracker, so sayith the config.\n\n // Do not track a call made to query for messages.\n if(req.url.indexOf('/messages') !== -1) {\n req.isTrackingEnabled = false;\n }\n\n next();\n }", "title": "" }, { "docid": "f04e644d0be3ee6df8f3d734843272c0", "score": "0.5356901", "text": "function requireNoAuth(req, res, next) {\n if (req.user) {\n res.redirect(localify(req.i18n.getLocale())('/user'));\n } else {\n next();\n }\n}", "title": "" }, { "docid": "1afa4056d5c82a9cbda3328b3fa1cddb", "score": "0.5356365", "text": "function expectNormalMiddlewareWasCalled () {\n expect(helmetMock.frameguard).toHaveBeenCalled();\n expect(helmetMock.ieNoOpen).toHaveBeenCalled();\n expect(helmetMock.hidePoweredBy).toHaveBeenCalled();\n expect(helmetMock.ieNoOpen).toHaveBeenCalled();\n expect(helmetMock.noCache).toHaveBeenCalled();\n expect(helmetMock.noSniff).toHaveBeenCalled();\n expect(helmetMock.xssFilter).toHaveBeenCalled();\n expect(restifyLinks).toHaveBeenCalled();\n }", "title": "" }, { "docid": "4644f4cb928e75a86767a297cfb13a28", "score": "0.5331538", "text": "middleware(req, res, next) {\n const token = req.headers ? req.headers.token : null;\n\n Session.check(token).then((user) => {\n if (user) {\n req.userId = user.id;\n req.user = user;\n req.session = req.headers.token;\n }\n next();\n }).catch(() => {\n next();\n });\n }", "title": "" }, { "docid": "a107b7bb0a01b0009778e21b063107e0", "score": "0.5317859", "text": "registerHttpMiddleware() {\n Base.build(this.app);\n }", "title": "" }, { "docid": "d7ac091f01ef76d0615de9bc5e1dde38", "score": "0.5312767", "text": "addApolloMiddleware(middlewareFunc) {\n this.apolloMiddleware.push(middlewareFunc);\n }", "title": "" }, { "docid": "2ec55b2bdebbf519bf8c91c07879324b", "score": "0.5312353", "text": "applyRegistrationMiddleware(route) {\r\n this.configuration.registrationMiddleware.forEach(middleware => {\r\n route = middleware.applyMiddleware(route);\r\n });\r\n return route;\r\n }", "title": "" }, { "docid": "909a22865df17e6201705e570eff38c8", "score": "0.5310487", "text": "function authorize() {\n return (req, res, next) => {\n console.log('someone pulled');\n next();\n };\n}", "title": "" }, { "docid": "113cfb2e45244fbaf0b2c7da6c127d86", "score": "0.5307706", "text": "asMiddleware() {\n return async (req, res, next, end) => {\n try {\n const [middlewareError, isComplete, returnHandlers] = await JsonRpcEngine._runAllMiddleware(req, res, this._middleware);\n\n if (isComplete) {\n await JsonRpcEngine._runReturnHandlers(returnHandlers);\n return end(middlewareError);\n }\n\n return next(async handlerCallback => {\n try {\n await JsonRpcEngine._runReturnHandlers(returnHandlers);\n } catch (error) {\n return handlerCallback(error);\n }\n\n return handlerCallback();\n });\n } catch (error) {\n return end(error);\n }\n };\n }", "title": "" }, { "docid": "3a6a8d07d8e61f85e610c83d59d1bd5c", "score": "0.52984107", "text": "asMiddleware() {\n return async (req, res, next, end) => {\n try {\n const [middlewareError, isComplete, returnHandlers,] = await JsonRpcEngine._runAllMiddleware(req, res, this._middleware);\n if (isComplete) {\n await JsonRpcEngine._runReturnHandlers(returnHandlers);\n return end(middlewareError);\n }\n return next(async (handlerCallback) => {\n try {\n await JsonRpcEngine._runReturnHandlers(returnHandlers);\n }\n catch (error) {\n return handlerCallback(error);\n }\n return handlerCallback();\n });\n }\n catch (error) {\n return end(error);\n }\n };\n }", "title": "" }, { "docid": "59b4128b44a3c4c666abbaa7959bb6bd", "score": "0.5298255", "text": "function checkNotLoggedIn(req, res, next) {\n if (req.isAuthenticated()) {\n res.redirect('/bLogPoster/posts');\n return;\n }\n\n next();\n}", "title": "" }, { "docid": "babc0cd620b28078082d29ad2f5b2921", "score": "0.5287146", "text": "function requireAdmin(req, res, next) {\n next();\n}", "title": "" } ]
096fe5ca18fae09e2c0aec95c657ba38
Sync Models With API
[ { "docid": "6b2e9d0812d10ed2276428d62cd49bb0", "score": "0.7002514", "text": "function syncModels(company_uid, success, err_call){\n console.log('Syncing Models');\n APIService.getResourceWithParams(APIService.SEP.MODEL_SYNC, {company_uid: company_uid}, function(data){\n models = data;\n console.log('Models:',models);\n success();\n }, function(error){\n console.log(error);\n err_call();\n });\n }", "title": "" } ]
[ { "docid": "c842681db77cfe3e52110dcff4d3d74a", "score": "0.7308797", "text": "sync(method, model, options) {\n }", "title": "" }, { "docid": "3f21101127362d7c085f709a25ce8578", "score": "0.7288805", "text": "syncModel () {\n this.WorkOfArtModel.sync({force: false})\n .then(() => { console.log('==>> WorkOfArtModel synched =====================================') })\n }", "title": "" }, { "docid": "bd1cd73a7692f05a34310bc56927d4bc", "score": "0.6872502", "text": "async sync() {\n await this.sequelize.sync();\n }", "title": "" }, { "docid": "25ab805b52b5b65832526ebe97db18b7", "score": "0.6788085", "text": "sync(method, model, options) {\n const syncOptions = Object.assign({}, options, {\n headers: {\n Accept: 'application/vnd.org.internations.frontend+json',\n 'Content-Type': 'application/vnd.org.internations.frontend+json',\n },\n })\n return Backbone.Model.prototype.sync.call(this, method, model, syncOptions)\n }", "title": "" }, { "docid": "3f7f736f21bed4587088e99a19bb53bd", "score": "0.67107594", "text": "sync(){\n User.sync();\n }", "title": "" }, { "docid": "ac796a33ce7426742df4a674b2112a29", "score": "0.6429658", "text": "function syncAPIData() {\n logger.info('Syncing API data');\n return Promise.all([\n releaseSyncDAO.synced,\n webInterfaceSyncDAO.synced,\n releaseWebInterfaceJunctionSyncDAO.synced,\n ]).then(function() {\n logger.info('Synced API data');\n });\n}", "title": "" }, { "docid": "69eff1fe3d8a088f25cf72548317fdc2", "score": "0.62671226", "text": "async updateSpecificModel(collection, model_name) {\n\n let was = this.server.sync_models;\n this.server.sync_models = [model_name];\n\n // this calls uses the global SYNC_MODELS to know which models should go on backend\n let result = await this.updateRemoteModel(collection);\n\n this.server.sync_models = was;\n\n return result;\n }", "title": "" }, { "docid": "375caa38a16074d6342e465851e1a69e", "score": "0.621539", "text": "async update({ params, request, response, Model, model }) {\n model.fill(request.all())\n await model.save()\n return model\n }", "title": "" }, { "docid": "69498742de35b7f8e06782158c20e320", "score": "0.61804235", "text": "sync() {\n return Resource.get(this).resource('Admin:syncWithBi');\n }", "title": "" }, { "docid": "a252e2aa335a0485bb7514e02deef0d4", "score": "0.6123354", "text": "alterModel(model) {\n return model.sync()\n }", "title": "" }, { "docid": "2003855bd30fdc5d80469f22fac88b81", "score": "0.6041727", "text": "async insertSpecificModel(collection, model_name) {\n\n let was = this.server.sync_models;\n this.server.sync_models = [model_name];\n\n // this calls uses the global SYNC_MODELS to know which models should go on backend\n let result = await this.insertRemoteModel(collection);\n\n this.server.sync_models = was;\n\n return result;\n }", "title": "" }, { "docid": "17876706dea3ad5253fca3920b9da3bc", "score": "0.5993046", "text": "sync(objects) {\n\t\tif (!objects) {\n\t\t\tobjects = [];\n\t\t}\n\n\t\tif (!Array.isArray(objects)) {\n\t\t\tobjects = [objects];\n\t\t}\n\n\t\tfor (var object of objects){\n\t\t\tvar id = this.encode_id(object.constructor.name, object.id);\n\t\t\tvar json_min = object.toJSON(true);\n\t\t\tjson_min.id = id;\n\t\t\tthis.pending[id] = json_min;\n\t\t}\n\n\t\tthis.save_localy();\n\n\t\tvar list_pending_encoded = [];\n\t\tfor(var id in this.pending) {\n\t\t\tlist_pending_encoded.push(this.pending[id]);\n\t\t}\n\n\t\tif (email) {\n\t\t\t$.ajax({\n\t\t\t\tcontext: this,\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: this.endpoint,\n\t\t\t\tdataType: \"json\",\n\t\t\t\tdata: {\n\t\t\t\t\t'email': email, \n\t\t\t\t\t'pass': pass,\n\t\t\t\t\t'sincronize_data': JSON.stringify(list_pending_encoded), \n\t\t\t\t\t'last_checkpoint': this.last_checkpoint\n\t\t\t\t},\n\t\t\t\tsuccess: function (status) {\n\t\t\t\t\tif (status.succesfully) {\n\n\t\t\t\t\t\tfor (var data of status.need_sincronize){\n\t\t\t\t\t\t\tvar collection_id = this.decode_id(data.id);\n\t\t\t\t\t\t\tvar class_name = collection_id[0];\n\t\t\t\t\t\t\tdata.id = collection_id[1];\n\t\t\t\t\t\t\t// if is not here I must retrive it\n\t\t\t\t\t\t\tthis.update(this.classes[class_name], data)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var sincronized_id of status.sincronized_ids){\n\t\t\t\t\t\t\tdelete this.pending[sincronized_id];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.last_checkpoint = status.last_checkpoint;\n\t\t\t\t\t\tthis.save_localy();\n\t\t\t\t\t\tif (this.after_sync) this.after_sync(false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (this.after_sync) this.after_sync(true);\n\t\t\t\t\t\tconsole.log('WARNING: Could not send data to sincronize.', status);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function (xhr, status, errorThrown) {\n\t\t\t\t\tconsole.log('WARNING: Server error to sincronize.', status);\n\t\t\t\t\tif (this.after_sync) this.after_sync(true); \n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "513b0bd0ef3bc6bcf8673405a84fd806", "score": "0.59859306", "text": "static updateSingleDeviceModel(model) {\n return HttpClient.put(`${ENDPOINT}/${model.id}`, toDeviceModelRequestModel(model))\n .map(toDeviceModel);\n }", "title": "" }, { "docid": "7182f6cdf168c63e7669290312d6a464", "score": "0.5981019", "text": "static async syncDb() {\n await db.sync();\n }", "title": "" }, { "docid": "606d4743a52d5bcfad9ced425b0e8079", "score": "0.5904348", "text": "function syncData() {\n // Get All Data from indexedDB\n useIndexedDb(\"transactions\", \"TransactionStore\", \"get\").then((results) => {\n // If Local Data exists,\n if (results.length) {\n // Fetch DB Data\n fetch(\"/api/transaction\")\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n // Find Transactions that need to be synced\n const offlineTransactions = results.filter((localTransaction) => {\n return !data.some((item) => item._id === localTransaction._id);\n });\n\n const offlineTransactionData = offlineTransactions.map((item) => {\n return { name: item.name, value: item.value, date: item.date };\n });\n\n // POST Offline Transactions To API\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(offlineTransactionData),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => {\n return response.json();\n })\n .then(() => {\n // Fetch updated transactions list from API\n fetch(\"/api/transaction\")\n .then((response) => {\n return response.json();\n })\n .then((newData) => {\n // Clear Stale Data From IndexedDB\n useIndexedDb(\"transactions\", \"TransactionStore\", \"deleteAll\");\n\n // Push New Data To IndexedDB\n newData.forEach((item) =>\n useIndexedDb(\n \"transactions\",\n \"TransactionStore\",\n \"post\",\n item\n )\n );\n\n return newData;\n })\n .then((newData) => {\n transactions = newData;\n populateTotal();\n populateTable();\n populateChart();\n });\n })\n .catch((err) => {\n console.log(\"ERROR!\");\n throw err;\n });\n });\n }\n });\n}", "title": "" }, { "docid": "6642ce4f5faa775645cda244158c9f03", "score": "0.5850722", "text": "function overallModelUpdater() {\r\n const MLModel = periodic.datas.get('standard_mlmodel');\r\n const io = periodic.servers.get('socket.io').server;\r\n MLModel.model.find({ 'status': 'training', })\r\n .then(models => {\r\n if (models && models.length) {\r\n return Promise.all(models.map(model => {\r\n model = model.toJSON ? model.toJSON() : model;\r\n const aws_models = model.aws_models || [];\r\n const digifi_models = model.digifi_models || [];\r\n const all_training_models = [...aws_models, ...digifi_models].length ? [...aws_models, ...digifi_models] : ['aws', 'sagemaker_ll', 'sagemaker_xgb'];\r\n let allComplete = all_training_models.every(provider => model[provider] && (model[provider].status === 'complete' || model[provider].status === 'completed'));\r\n if (allComplete) {\r\n MLModel.update({ id: model._id.toString(), isPatch: true, updatedoc: { \r\n updatedat: new Date(), \r\n status: 'complete',\r\n }, });\r\n // io.sockets.emit('provider_ml', { model_complete: true });\r\n } \r\n else {\r\n return null;\r\n }\r\n }))\r\n .then((results) => {\r\n if (results && results[ 0 ]) logger.warn('Updated models to complete');\r\n });\r\n }\r\n })\r\n .catch(e => logger.warn('Error in overallModelUpdater', e));\r\n}", "title": "" }, { "docid": "7f4a592efe78fae01bace9a046a63718", "score": "0.5846244", "text": "function updateSet(model){\n model.dbOpsType=\"read\"\n model.schema=emailAndSmsSchema\n model.offset=0\n model.readLimit=1\n model.data={\n \"stage\":model.req.body.stageName\n }\n \n model.callBackFromDataAccess=\"readSet\"\n model.on(model.callBackFromDataAccess,(model)=>{\n model.dbOpsType=\"update\"\n model.schema=emailAndSmsSchema\n model.id=model.status[0]._id\n model.data=model.req.body.newData\n model.callBackFromDataAccess=\"updatedSet\"\n model.on(model.callBackFromDataAccess,(model)=>{\n model.info=\"Updated Set Successfully\"\n model.emit(globalCallBackRouter,model)\n })\n global.emit(globalDataAccessCall,model)\n model.emit(model.dbOpsType,model)\n })\n global.emit(globalDataAccessCall,model)\n model.emit(model.dbOpsType,model)\n \n}", "title": "" }, { "docid": "911c7412a13c7203ef971bb1af591601", "score": "0.5831002", "text": "persistPublicDeviceModel(context, devicePublicModel) {\n // debugger\n\n var obContract = \"\";\n if (devicePublicModel.obContract) obContract = devicePublicModel.obContract;\n\n var renterUser = \"\";\n if (devicePublicModel.renterUser) obContract = devicePublicModel.renterUser;\n\n // Create a publicDeviceModel from data in the store.\n var tmpModel = {\n ownerUser: devicePublicModel.ownerUser,\n renterUser: renterUser,\n privateData: devicePublicModel.privateData,\n obContract: obContract,\n // rentStartDate: '',\n // rentStopDate: '',\n deviceName: devicePublicModel.deviceName,\n deviceDesc: devicePublicModel.deviceDesc\n // rentHourlyRate: '',\n // subdomain: '',\n // httpPort: '',\n // sshPort: '',\n // memory: testModel.memory,\n // diskSpace: testModel.diskSpace,\n // processor: testModel.processor,\n // internetSpeed: testModel.internetSpeed\n // checkinTimeStamp: testModel.checkinTimeStamp\n };\n\n // JSON.stringify(tmpModel, null, 2)\n\n // Upload the data to the server.\n $.post(\n \"/api/devicePublicData/\" + devicePublicModel._id + \"/update\",\n tmpModel,\n function(publicData) {\n // debugger\n console.log(`devicePublidModel ${publicData.collection._id} updated.`);\n }\n ).fail(function(jqxhr, textStatus, error) {\n // debugger\n console.error(\n \"API call to /devicePublicData/\" +\n devicePublicModel._id +\n \"/update unsuccessful. Error: \" +\n jqxhr.responseJSON.detail,\n error\n );\n throw error;\n });\n }", "title": "" }, { "docid": "b2be41421213d4ec9ca75df1b1e36592", "score": "0.5824282", "text": "static sync(params) {\n let newParams = {};\n // Check if needs alter and alter is allowed\n if (params.alter && options.db.sync.allow_alter === true) newParams.alter = true;\n // Check if needs force and force is allowed and we in debug mde\n if (params.force && options.db.sync.allow_force === true && options.state.debug === true) newParams.force = true;\n // Pass updated params\n super.sync(newParams);\n }", "title": "" }, { "docid": "ab714ed207c5ec08ad48a9876881f4f8", "score": "0.576766", "text": "submitModel() {\n \t\tvar modelInfo = {\n \t\t\tname: \"Dean\",\n \t\t\tdesc: \"hey\"\n \t\t}\n \t\tapi.postModel(modelInfo);\n \t}", "title": "" }, { "docid": "0e00a886117d1043322039977e1827ab", "score": "0.57670456", "text": "async updateRemoteModel(collection) {\n return await this.server.patchInCollection(collection, this.server.getDataModel());\n }", "title": "" }, { "docid": "fc6737c5f9a28b941ddc42e11f540975", "score": "0.57540554", "text": "function sync(retries = 0, maxRetries = 5) {\n return db\n .sync({ force: false })\n .then(ok => console.log(`Synced models to db ${name}`))\n .catch(fail => {\n console.log(fail);\n });\n}", "title": "" }, { "docid": "b5f70ece29e344bac33f1b4987539060", "score": "0.5748905", "text": "sync() { }", "title": "" }, { "docid": "830558327c05bb7daecc013d865c4ba9", "score": "0.5726032", "text": "async save() {\n await this.config.rpc.sendJsonRequest(\"store\");\n }", "title": "" }, { "docid": "36ffa697c51543a38872669ca71e00ed", "score": "0.5722586", "text": "function sync() {\n const metadata = commands.sync();\n metadata.displayName = 'sync';\n createRequestObservable$(metadata)\n .repeat(10)\n .subscribe(\n x => log.debug(\"Sync round complete\", x),\n err => log.error(\"Sync problems\", err),\n () => {\n log.info(\"Successful sync, setting mode\");\n setBootloaderMode(true);\n }\n );\n }", "title": "" }, { "docid": "f08bdb111ea2515e6d0a45e905ca2590", "score": "0.57147413", "text": "async function init() {\n return sequelize.sync();\n}", "title": "" }, { "docid": "c62cca804923bc97d7c101436b4dc1d8", "score": "0.5704165", "text": "bewareStorageUpdate(collection, name, obj) {\n if (this.server.sync_models.indexOf(name) == -1) {\n this.server.authenticated_models.push(name);\n this.updateObject(collection, obj);\n } else {\n this.updateSpecificModel(collection, name);\n }\n }", "title": "" }, { "docid": "e0083ca278e12763d4f7b0c37bc97fc9", "score": "0.570006", "text": "async save(model) {\n if (!model) return false;\n if (model.password) {\n model.password.name = model.password.name || model.password.domain;\n model.password.synced = true;\n this.$password.saveOrUpdate(model.password).then();\n }\n if (model.creditcard) {\n model.creditcard.synced = true;\n this.$creditCards.saveOrUpdate(model.creditcard).then();\n }\n if (model.address) {\n model.address.synced = true;\n this.$addressService.saveOrUpdate(model.address).then();\n }\n\n return false;\n }", "title": "" }, { "docid": "e2bb55f932c7a0956880cf2f0956bbc9", "score": "0.5696318", "text": "patch(additionalData = {}) {\n const data = {\n // the model attributes will get nested in { attributes: ... }\n ...this.toJsonApi(),\n // additionalData could include { cancel_sync: true }\n ...additionalData,\n }\n return this.apiStore.request(this.baseApiPath, 'PATCH', {\n data,\n })\n }", "title": "" }, { "docid": "6503cf6393896f85fe70ee4212e8f25f", "score": "0.56846124", "text": "* update (request, response) {\n const model = this.resource(request.param('resource'))\n const data = JSON.parse(request.input('model')) //with JSON.stringify or postman\n // const data = request.input('model') //with ajax key 'model' to literal json\n const instance = yield model.find(request.param('id'))\n Object.keys(instance.attributes).map((f) => {\n instance[f] = data[f]\n })\n const result = yield instance.save()\n response.json({ result })\n }", "title": "" }, { "docid": "36bb162f8b43d5c56c570697a513b5b0", "score": "0.56567264", "text": "function Model() {\n /**\n * Common method which \"promisifies\" the XHR calls.\n *\n * @param {string} url the URL address to fetch.\n *\n * @return {Promise} the promise object will be resolved once XHR gets loaded/failed.\n *\n * @public\n */\n this.fetchData = function(url) {\n return new Promise(function(resolve, reject) {\n let req = new XMLHttpRequest();\n\n req.open(\"GET\", url, true);\n\n // listen to load event\n req.addEventListener(\"load\", function() {\n if (req.status < 400) {\n resolve(JSON.parse(req.response));\n } else {\n reject(new Error(\"Request failed: \" + req.statusText));\n }\n });\n\n // listen to error event\n req.addEventListener(\"error\", function() {\n reject(new Error(\"Network error\"));\n });\n\n req.send(null);\n });\n };\n\n /**\n * Common method which \"promisifies\" the XHR calls.\n *\n * @param {string} url the URL address to fetch.\n *\n * @param {object} data the object to post on the db.\n *\n * @return {Promise} the promise object will be resolved once XHR gets loaded/failed.\n *\n * @public\n */\n this.fetchDataPost = function(url, data) {\n return new Promise(function(resolve, reject) {\n let req = new XMLHttpRequest();\n\n req.open(\"POST\", url, true);\n req.setRequestHeader(\"Content-Type\", \"application/json\");\n // listen to load event\n req.addEventListener(\"load\", function() {\n if (req.status < 400) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"Request failed: \" + req.statusText));\n }\n });\n\n // listen to error event\n req.addEventListener(\"error\", function() {\n reject(new Error(\"Network error\"));\n });\n\n let postData = JSON.stringify(data);\n req.send(postData);\n });\n };\n\n /**\n * Common method which \"promisifies\" the XHR calls.\n *\n * @param {string} url the URL address to fetch.\n *\n * @return {Promise} the promise object will be resolved once XHR gets loaded/failed.\n *\n * @public\n */\n this.fetchDataDelete = function(url) {\n return new Promise(function(resolve, reject) {\n let req = new XMLHttpRequest();\n\n req.open(\"DELETE\", url, true);\n req.setRequestHeader(\"Content-Type\", \"application/json\");\n // listen to load event\n req.addEventListener(\"load\", function() {\n if (req.status < 400) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"Request failed: \" + req.statusText));\n }\n });\n\n // listen to error event\n req.addEventListener(\"error\", function() {\n reject(new Error(\"Network error\"));\n });\n\n req.send(null);\n });\n };\n\n /**\n * Common method which \"promisifies\" the XHR calls.\n *\n * @param {string} url the URL address to fetch.\n *\n * @param {object} data the object to PUT on the db.\n *\n * @return {Promise} the promise object will be resolved once XHR gets loaded/failed.\n *\n * @public\n */\n this.fetchDataPut = function(url, data) {\n return new Promise(function(resolve, reject) {\n let req = new XMLHttpRequest();\n\n req.open(\"PUT\", url, true);\n req.setRequestHeader(\"Content-Type\", \"application/json\");\n // listen to load event\n req.addEventListener(\"load\", function() {\n if (req.status < 400) {\n resolve(JSON.parse(req.response));\n } else {\n reject(new Error(\"Request failed: \" + req.statusText));\n }\n });\n\n // listen to error event\n req.addEventListener(\"error\", function() {\n reject(new Error(\"Network error\"));\n });\n\n let postData = JSON.stringify(data);\n req.send(postData);\n });\n };\n}", "title": "" }, { "docid": "b1f6521131d6478cad3028414f083327", "score": "0.5654502", "text": "syncTypes() {\n return this.TypeService.getTypes()\n .then(response => {\n this.typesData = response;\n this.socket.syncUpdates('type', this.typesData, this.formatTypesData());\n })\n }", "title": "" }, { "docid": "10d6b8ac6c646e9f1a46275d2325ddb1", "score": "0.56502914", "text": "function syncOverride(mc, eventPubSub){\r\n Backbone.sync = function(method, model, options){\r\n var qsStr = '', relationship = '', uModel = {}, relations = [];\r\n var url = model.urlRoot;\r\n var entity = url;\r\n if(model.attributes){\r\n // handle models\r\n var magnetId = model.attributes.magnetId;\r\n // build an entity object, removing empty properties and relationship properties\r\n if(model.data){\r\n if(model.data.relations){\r\n relations = model.data.relations;\r\n }\r\n }\r\n $.each(model.attributes, function(key, val){ \r\n if($.trim(val) != '' && key != 'profileName' & key != 'magnetId' && key != 'image'&& key != 'id' && key != 'dataUrl' && key != 'contentUrls' && key != 'formatTime' && key != 'formatCreatedTime' && key != 'formattedLatestAssetGeneratedTime' && $.inArray(key, relations) == -1){\r\n uModel[key] = val;\r\n }\r\n });\r\n }else{\r\n // handle collections\r\n }\r\n // handle url parameters\r\n if(options.data){\r\n // get relationships using _magnet_relation url parameters\r\n if(!$.isEmptyObject(options.data.relations)){\r\n $.each(options.data.relations, function(i, relation){\r\n qsStr += '&_magnet_relation='+relation;\r\n });\r\n }\r\n // get relationships using /{relationship} parameter\r\n if(!$.isEmptyObject(options.data.relationship)){\r\n relationship = options.data.relationship.name;\r\n var relId = options.data.relationship.magnetId || model.attributes.magnetId;\r\n magnetId = null;\r\n url += '/'+relId+'/'+relationship;\r\n }\r\n // for a complete un-RESTful hack\r\n if(options.data.magnetId){\r\n url += '/'+options.data.magnetId;\r\n }\r\n // retrieve next page of results using \r\n if(options.data.nextPage && options.data.nextPage != ''){\r\n options.data.col = model;\r\n url = options.data.nextPage.slice(options.data.nextPage.lastIndexOf('_magnet_queries'));\r\n }\r\n // build magnet sort querystring\r\n if(!$.isEmptyObject(options.data.sorts)){\r\n $.each(options.data.sorts, function(key, val){\r\n qsStr += '&'+(val == 'asc' ? '_magnet_ascending' : '_magnet_descending')+'='+key;\r\n });\r\n }\r\n // append selected page size\r\n if(options.data.pageSize){\r\n qsStr += '&_magnet_page_size='+options.data.pageSize;\r\n }\r\n // build magnet search querystring\r\n if(options.data.search){\r\n $.each(options.data.search, function(i, obj){\r\n $.each(obj, function(key, val){\r\n qsStr += '&'+key+'=%25'+val+'%25';\r\n });\r\n });\r\n }\r\n // return specified entity properties only\r\n if(!$.isEmptyObject(options.data.selects)){\r\n $.each(options.data.selects, function(i, select){\r\n qsStr += '&_magnet_select='+select;\r\n });\r\n }\r\n // build magnet current page querystring\r\n if(options.data.page && options.data.page != ''){\r\n qsStr += '&_magnet_page='+options.data.page;\r\n }\r\n // manually set max results\r\n if(options.data.maxResults){\r\n qsStr += '&_magnet_max_results='+options.data.maxResults;\r\n }\r\n model.data = options.data;\r\n }\r\n switch(method){\r\n case 'read':\r\n mc.get(url, magnetId, qsStr, options.data, function(data, status, xhr){\r\n if(typeof options.success === typeof Function){\r\n options.success(data, status, xhr);\r\n }\r\n }, function(xhr, ajaxOptions, thrownError){\r\n if(typeof options.error === typeof Function){\r\n options.error(xhr, ajaxOptions, thrownError);\r\n }\r\n }, entity);\r\n break;\r\n case 'delete': \r\n mc.remove(url, magnetId, function(data, status, xhr){\r\n if(typeof options.success === typeof Function){\r\n options.success(data, status, xhr);\r\n }\r\n }, function(xhr, ajaxOptions, thrownError){\r\n if(typeof options.error === typeof Function){\r\n options.error(xhr, ajaxOptions, thrownError);\r\n }\r\n });\r\n break;\r\n case 'update': \r\n mc.update(url, magnetId, uModel, function(data, status, xhr){\r\n if(typeof options.success === typeof Function){\r\n options.success(data, status, xhr);\r\n }\r\n }, function(xhr, ajaxOptions, thrownError){\r\n if(typeof options.error === typeof Function){\r\n options.error(xhr, ajaxOptions, thrownError);\r\n }\r\n });\r\n break;\r\n case 'create':\r\n mc.create(url, uModel, function(data, status, xhr){\r\n if(Object.prototype.toString.call(data) == '[object Object]'){\r\n model.set({magnetId:data.magnetId, id:data.id});\r\n }else{\r\n model.set({magnetId:data, id:data});\r\n }\r\n if(typeof options.success === typeof Function){\r\n options.success(model, status, xhr);\r\n }\r\n }, function(xhr, ajaxOptions, thrownError){\r\n if(typeof options.error === typeof Function){\r\n options.error(xhr, ajaxOptions, thrownError);\r\n }\r\n });\r\n break;\r\n }\r\n };\r\n}", "title": "" }, { "docid": "8d25f5ba8022be9106b5f2be5704d10a", "score": "0.5644842", "text": "async getModels(ctx) {\n const models = Service.getModels();\n const allModels = await Promise.all(\n models.map(({ name, source }) => Service.getModel(name, source))\n );\n\n ctx.send({ allModels, models });\n }", "title": "" }, { "docid": "47a9223d97595e8d9b039ecc9789f1ff", "score": "0.5631917", "text": "async syncOrdersViaRestApi() {\n var verb = 'GET',\n path = '/api/v1/order?' + querystring.stringify({\"filter\": JSON.stringify({ \"open\": true})}),\n expires = new Date().getTime() + (60 * 1000) // 1 min in the future\n ;\n\n var signature = crypto.createHmac('sha256', this.apiSecret).update(verb + path + expires).digest('hex');\n\n var headers = {\n 'content-type' : 'application/json',\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'api-expires': expires,\n 'api-key': this.apiKey,\n 'api-signature': signature\n }\n\n let me = this\n\n let result = await this.requestClient.executeRequestRetry({\n headers: headers,\n url: this.getBaseUrl() + path,\n method: verb,\n }, result => {\n return result && result.response && result.response.statusCode === 503\n }, this.retryOverloadMs, this.retryOverloadLimit)\n\n let error = result.error\n let response = result.response\n let body = result.body\n\n if (error || !response || response.statusCode !== 200) {\n me.logger.error('Bitmex: Invalid orders sync:' + JSON.stringify({'error': error, 'body': body}))\n return\n }\n\n me.logger.debug('Bitmex: Orders via API updated')\n\n me.fullOrdersUpdate(JSON.parse(body))\n }", "title": "" }, { "docid": "54ec88fceace742fac07eecbff563344", "score": "0.56115234", "text": "async _sync() {\n await new Promise((resolve, reject) => {\n this.s3.putObject(\n {\n Bucket: this.config.bucket,\n Key: `${this.config.keyPrefix}verdaccio-s3-db.json`,\n Body: JSON.stringify(this._localData)\n },\n (err, data) => {\n if (err) {\n reject(err);\n return;\n }\n resolve();\n }\n );\n });\n }", "title": "" }, { "docid": "9d0573c2c73de5b18ad19459b227e52e", "score": "0.56064206", "text": "function Sync(method, model, settings) {\n settings || (settings = {\n });\n // Default JSON-request options.\n var params = {\n type: method,\n dataType: 'json',\n url: model.Url()\n };\n // Ensure that we have the appropriate request data.\n if(model && (method === Backbone.MethodType.CREATE || method === Backbone.MethodType.UPDATE)) {\n params.contentType = 'application/json';\n params.data = JSON.stringify(model.ToJSON());\n }\n // Don't process data on a non-GET request.\n if(params.type !== 'GET') {\n params.processData = false;\n }\n // Make the request, allowing the user to override any Ajax options.\n return Backbone.$.ajax(Backbone._.extend(params, settings));\n }", "title": "" }, { "docid": "0731d66fb6d6996eed3329a4a97c85e5", "score": "0.559893", "text": "static $updateToken() {\n let models = [User, AdminAccessModel, UserModel, UserRelatedModel];\n models.forEach(model => {\n model.methodConf.http.headers['Authorization'] = 'Bearer ' + localStorage.getItem('auth__token');\n })\n }", "title": "" }, { "docid": "c0bda47c465d976e251b6ec3d0915ca2", "score": "0.5593858", "text": "function sync() {\n var opts = {live: true};\n database.replicate.to(remoteDB, opts);\n database.replicate.from(remoteDB, opts);\n\n }", "title": "" }, { "docid": "73d0a01e8ea5a745dfb0cd29448a5766", "score": "0.5583945", "text": "static associate(models) {\n \n \n \n }", "title": "" }, { "docid": "d919f8da7204cb1917a571d1dc8f768e", "score": "0.55735266", "text": "async defineModel(){cov_11w8qvd3rv().f[2]++;cov_11w8qvd3rv().s[10]++;this._herois=driver.define('herois',{id:{type:Sequelize.INTEGER,required:true,primaryKey:true,autoIncrement:true},nome:{type:Sequelize.STRING,required:true},poder:{type:Sequelize.STRING,required:true}},{tableName:'heroes',freezeTableName:false,timestamps:false});// Sincronizamo com nosso banco de dados.\ncov_11w8qvd3rv().s[11]++;await this._herois.sync();}", "title": "" }, { "docid": "a4ab42f3355e440ba3e0ed32b6eb4413", "score": "0.5562643", "text": "syncAssets() {\n return this.AssetService.getAssets()\n .then(response => {\n this.assetsAsyncData = response;\n this.socket.syncUpdates('asset', this.assetsAsyncData);\n })\n }", "title": "" }, { "docid": "253bd4d0337535f1a3cffe1437536d54", "score": "0.55605626", "text": "static associate(models) {}", "title": "" }, { "docid": "253bd4d0337535f1a3cffe1437536d54", "score": "0.55605626", "text": "static associate(models) {}", "title": "" }, { "docid": "57a7d9123fb9b761f2512cc0596d78b9", "score": "0.5556996", "text": "async _sync() {\n try {\n const syncToken = this.syncToken;\n const perPage = this._perPage;\n let records = [];\n // @ts-expect-error\n let response = await this._fetch(perPage, syncToken);\n records = records.concat(response.records ?? []);\n let pageNum = 0;\n while (response.nextPageId) {\n const fetchInterval = pageNum > 3 ? 6000 : 2000; \n await sleep(fetchInterval);\n // @ts-expect-error\n response = await this._fetch(perPage, syncToken, response.nextPageId);\n records = records.concat(response.records ?? []);\n pageNum += 1;\n }\n if (response.syncInfo!.syncType === 'ISync') {\n // @ts-expect-error\n records = this._processISyncData(records);\n }\n return {\n syncToken: response.syncInfo!.syncToken,\n records,\n };\n } catch (error) {\n if (error?.response?.status === 403) {\n return {};\n }\n throw error;\n }\n }", "title": "" }, { "docid": "cbf60db2a6f16ae11aa04e56343c7646", "score": "0.55524284", "text": "updateModels(models = []) {\n for (let model of models) {\n this.models.add(model.name, new Luis.LuisModel(model.name, model.url));\n }\n }", "title": "" }, { "docid": "2e9a4d302726dcf0d55f9d65d8a05d47", "score": "0.5518554", "text": "update(model) {\n //some logic \n }", "title": "" }, { "docid": "258357e67e067c01f9f054a01c1a6ccc", "score": "0.55066663", "text": "function syncTrDB() {\n transmission.sync(function(tr){\n \n })\n}", "title": "" }, { "docid": "e8d7789d564b2eeca3346bab35af5c1a", "score": "0.5498343", "text": "function wrapSync(method, model, options) {\n if (options !== undefined && _.isObject(options)) {\n NProgress.start();\n\n var self = this,\n oldSuccess = options.success;\n\n options.success = function () {\n NProgress.done();\n return oldSuccess.apply(self, arguments);\n };\n }\n\n return Backbone.sync.call(this, method, model, options);\n }", "title": "" }, { "docid": "08b2264f994561788e108d553a0cb527", "score": "0.549791", "text": "function sync(force=true, retries=0, maxRetries=5) {\n return db.sync({force})\n .then(function () {\n console.log(\"Dropped old data, now inserting data\");\n return Promise.map(Object.keys(data), function (name) {\n return Promise.map(data[name], function (item) {\n return db.model(name)\n .create(item);\n });\n });\n})\n .then(ok => console.log(`Synced models to db ${connectionString}`))\n .catch(fail => {\n // Don't do this auto-create nonsense in prod, or\n // if we've retried too many times. \n if (process.env.NODE_ENV === 'production' || retries > maxRetries) {\n console.error(chalk.red(`********** database error ***********`))\n console.error(chalk.red(` Couldn't connect to ${connectionString}`))\n console.error()\n console.error(chalk.red(fail))\n console.error(chalk.red(`*************************************`))\n return\n }\n // Otherwise, do this autocreate nonsense\n console.log(`${retries ? `[retry ${retries}]` : ''} Creating database ${name}...`)\n return new Promise((resolve, reject) =>\n require('child_process').exec(`createdb \"${name}\"`, resolve)\n ).then(() => sync(true, retries + 1))\n })\n}", "title": "" }, { "docid": "0cfe08fbe49d61ac7e1c2cdcd3935062", "score": "0.5490368", "text": "function sync(){\n\t\t// console.log('wwwwwwww');\n\n\t \t\tdbService.connect().then(function(){\n\t \t\t\tvar orderQuery = dbService.db_.select()\n\t\t\t \t\t\t\t\t.from(dbService.orderTable)\n\t\t\t \t\t\t\t\t.where(dbService.orderTable.synced.eq(false))\n\t\t\t \t\t\t\t\t.exec();\n\n\t\t \t\tvar orders = [];\n\t\t \t\tvar itemsQuery = orderQuery.then(function(_orders){\n\t\t \t\t\torders = _orders;\n\t\t \t\t\tvar orderIds = orders.map(function(r){\n\t\t \t\t\t\treturn r.id;\n\t\t \t\t\t});\n\n\t\t \t\t\treturn dbService.db_\n\t\t \t\t\t\t\t.select()\n\t\t \t\t\t\t\t.from(dbService.orderItemsTable)\n\t\t \t\t\t\t\t.where(dbService.orderItemsTable.order_id.in(orderIds))\n\t\t \t\t\t\t\t.exec();\n\t\t \t\t});\n\n\n\t \t\t\titemsQuery.then(function(order_items){\n\t\t\t \t\t//nothing to post\n\t\t\t \t\tif(orders.length == 0){\n\t\t\t \t\t\ttoastr.Warning(order_items.Message,'Warning');\n\t\t\t \t\t\treturn;\n\t\t\t \t\t};\n\n\t\t\t \t\tangular.forEach(orders, function(o){\n\t\t\t \t\t\to.items = [];\n\t\t\t \t\t\tangular.forEach(order_items, function(i){\n\t\t\t \t\t\t\tif(i.order_id == o.id)\n\t\t\t \t\t\t\t\to.items.push(i);\n\t\t\t \t\t\t});\n\t\t\t \t\t});\n\n\t \t\t\t\tvar data = {\n\t \t\t\t\t\tOrders : orders,\n\t \t\t\t\t};\n\t \t\t\t\tconsole.log(data);\n\n\t \t\t\t\tsetTimeout(() => {\n\t \t\t\t\t\t$('#LoaderDiv').hide();\n\t\t\t\t\t}, 2000);\n\t \t\t\t\tajaxService.post('order/sync', data, true)\n\t \t\t\t\t\t.then(function (response) {\n\t \t\t\t\t\t if (response.IsValid) {\n\t \t\t\t\t\t /*toastr.success('Order have been synced successfully','Orders Synced');\n\t \t\t\t\t\t let lang = languageService.get('Order Synced');\n console.log(lang);*/\n toastr.success(response.Message,'Success');\n\t \t\t\t\t\t\t\tupdateSyncTime(orders);\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t});\n\t \t\t\t});\n\t \t\t});\n\t \t}", "title": "" }, { "docid": "32e2281ff66d50be6c998b9330541059", "score": "0.54847145", "text": "populateTable()\n {\n if(path.extname(process.env.celebrityDataPath)=='.json')\n {\n \n var celebrityList= this.readData();\n \n celebrityModel.sync({force: true}).then(function () \n {\n celebrityList.forEach((celebrityDetails)=>\n {\n \n return celebrityModel.create(\n {\n\n firstname:celebrityDetails.firstName,middlename:celebrityDetails.middleName,lastname:celebrityDetails.lastName,profession:celebrityDetails.profession\n })\n .catch(err => \n {\n console.log(err);\n })\n \n });\n })\n .catch(() =>\n {\n console.log(\"Unabale to sync the database in app - repo - celebrityRepo - populateTable() - line 41 \");\n })\n \n }\n\n else\n {\n console.log(\"response from path extension error in app - repo - celebrityRepo - populateTable() - line 47 \")\n \n }\n \n }", "title": "" }, { "docid": "06a4c921fd4506d88008221625e98fa1", "score": "0.5482688", "text": "function updateGuard(model){\n \n var updateParams={\n \"mod\" : \"guard\",\n \"operation\" : \"update\",\n \"data\" : {\n \"key\" : guardKey,\n \"schema\": \"Lead\",\n \"id\" :model.docToUpdateInLead,\n \"data\" :{\n \"tags\":[model.newTags]\n }\n }\n };\n \n var updateRequestParams = {\n url : commonAccessUrl,\n method : 'POST',\n headers : headers,\n body : JSON.stringify(updateParams)\n }\n \n request(updateRequestParams, function (error, response, body){\n \n if(body){ \n try{\n body=JSON.parse(body);\n if(!body.error){\n model.body=body\n global.emit(\"userAccountSetup\",model)\n model.emit(\"userAccountService\",model)\n }\n else{\n commonVar.add()\n commonVar.check()\n model.info=body.error\n }\n }\n catch(err){\n commonVar.add()\n commonVar.check()\n model.info=err\n }\n }\n else if(error){\n commonVar.add()\n commonVar.check()\n model.info=error\n }\n else{\n commonVar.add()\n commonVar.check()\n model.info=\"Error while updating guard : Thyrocare API \\n\"\n }\n \n if(model.info){\n model.fileName=path.basename(__filename)\n global.emit(\"errorLogsSetup\",model)\n model.emit(\"errorLogs\",model)\n }\n \n });\n}", "title": "" }, { "docid": "0c33f8f6aa950f5a453866dd162cd606", "score": "0.5481853", "text": "function sync() {}", "title": "" }, { "docid": "d085ff2727a65bcf257bf14db4e09274", "score": "0.54712546", "text": "getAllModels() {\n return this.rest.get(`${this.baseUrl}/models`);\n }", "title": "" }, { "docid": "0860bc1ce82011b4c9e0f7bca463f043", "score": "0.5469709", "text": "async sync(method = \"READ\", model, options = {}) {\n if (this._uri) {\n options.uri = this._uri;\n }\n\n if (this.crossOrigin === true) {\n options.crossDomain = true;\n }\n if (!options.xhrFields) {\n options.xhrFields = {\n withCredentials: true\n };\n }\n\n return await sync(method, model, options);\n }", "title": "" }, { "docid": "8432600d75cb81f3814dc9006ff5bfeb", "score": "0.5462884", "text": "bind_model_json(id){\n var that = this;\n if(id)\n id = Number(id);\n if(id){\n return new Promise((resolve, reject)=>{\n that.get_single(id).then(function(m_js) {\n let m_x = that.new_object_json();\n _.each(_.keys(m_js), function(pr) {\n if(!_.has(m_x, pr))\n m_js = _.omit(m_js, [pr]);\n });\n resolve(m_js);\n }).catch(function(err) {\n reject(err);\n });\n });\n }\n else {\n return new Promise((resolve, reject)=>{\n let m = that.new_object_json();\n resolve(m);\n });\n }\n }", "title": "" }, { "docid": "f90d41f030c30db9559bdb8fffc26608", "score": "0.54569703", "text": "static uploadDeviceModel(model) {\n return HttpClient.post(ENDPOINT, toDeviceModelUploadRequestModel(model))\n .map(toDeviceModel);\n }", "title": "" }, { "docid": "e595dbd57a0b3b32848aa478acff394e", "score": "0.54476297", "text": "async function loadData(){\r\n (async () => {\r\n await sequelize // Método que sincroniza todos os models (cada classe que extende a classe Model)\r\n .sync()\r\n .then(() =>{\r\n Categorias.bulkCreate(data.categorias)\r\n .then((element) =>{\r\n console.log(element);\r\n });\r\n })\r\n .then(() =>{\r\n Videos.bulkCreate(data.videos)\r\n .then((element) =>{\r\n console.log(element);\r\n });\r\n \r\n }); \r\n })();\r\n\r\n await console.log(Categorias === sequelize.models.Categorias); // true\r\n await console.log(Videos === sequelize.models.Videos); // true\r\n}", "title": "" }, { "docid": "4a8859f1435f0de95d435a3f07b5cb3a", "score": "0.54266524", "text": "putModel(route, data) {\n return axios.patch(`${this.rootAPI}${route}`, data, { /*headers: { \"Authorization\": this.accessToken }, withCredentials: true*/ })\n }", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.54131484", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.54131484", "text": "function SYNC() {}", "title": "" }, { "docid": "3d0d6f1760d787b2ff3bdfa0c502f22d", "score": "0.5410571", "text": "function sync() {\n var opts = {live: true};\n database.replicate.to(remoteCouch, opts);\n database.replicate.from(remoteCouch, opts);\n\n}", "title": "" }, { "docid": "1830d473f196497d7814875ef121e669", "score": "0.5398221", "text": "sync() {\n\n let _this = this;\n log.info('[DataObject.sync] synchronising ');\n\n return new Promise((resolve, reject) => {\n\n let criteria = {};\n\n// if (this.metadata.backupRevision) criteria.backupRevision = this.metadata.backupRevision;\n\n _this._syncher.read(_this._metadata.url, criteria).then((value) => {\n console.log('[DataObject.sync] value to sync: ', value);\n\n Object.assign(_this.data, deepClone(value.data));\n\n _this._version = value.version;\n\n _this._metadata.lastModified = value.lastModified;\n\n //TODO: check first if there are new childrenObjects to avoid overhead\n\n if (value.childrenObjects) {\n _this.resumeChildrens(value.childrenObjects);\n// _this._storeChildrens();\n resolve(true);\n } else resolve(true);\n\n\n /*if (value.version != _this._version) {\n log.info('[DataObject.sync] updating existing data: ', _this.data);\n\n Object.assign(_this.data || {}, deepClone(value.data));\n\n _this._metadata = deepClone(value);\n\n delete _this._metadata.data;\n\n _this._version = value.version;\n\n } else {\n log.info('[DataObject.sync] existing data is updated: ', value);\n }*/\n\n }).catch((reason) => {\n log.info('[DataObject.sync] sync failed: ', reason);\n resolve(false);\n });\n\n });\n\n\n }", "title": "" }, { "docid": "f45d5dd4ddaf797252bd7c0538856747", "score": "0.53945315", "text": "sync() {\n return\n }", "title": "" }, { "docid": "145980ebb16a6b68f96b0c434ed0960e", "score": "0.5385885", "text": "async insertRemoteModel(collection) {\n return await this.server.postInCollection(collection, this.server.getDataModel());\n }", "title": "" }, { "docid": "b4a2f96134aa3d3c794977a541547cb0", "score": "0.5373022", "text": "async syncUserObject() {\n try {\n const user = await User.getInfo()\n\n // update user table\n updateUserTable(user)\n\n // dispatch user attributes\n store.dispatch(setUserAttributes(user))\n } catch(e) {}\n }", "title": "" }, { "docid": "fe81017abc7a1ae67ca2d502ea681cec", "score": "0.53713334", "text": "async function sendEdits(changes)\r\n{\r\n\r\n const toSend = {\r\n \"_id\" : {\r\n \"$oid\": userID\r\n },\r\n username : changes.username,\r\n bio : changes.bio,\r\n avatarurl : changes.avatar_src,\r\n steam: changes.steamid\r\n };\r\n\r\n const sendOptions =\r\n {\r\n method : 'PUT',\r\n headers: {'Content-Type': 'application/json'},\r\n body : JSON.stringify(toSend)\r\n };\r\n\r\n let updated = await fetch('/api/user', sendOptions);\r\n let fullupdate = await updated.json();\r\n console.log(fullupdate);\r\n}", "title": "" }, { "docid": "862d73802b730fcf41df0cd7d852f702", "score": "0.5339189", "text": "saveData() {\n this.savingReferences()\n // API call...\n }", "title": "" }, { "docid": "1343ef171c573a89a5ba746fd2f4dd11", "score": "0.53308094", "text": "discoverApis() {\n let kites = this.kites;\n let definition = this.definition;\n // discover models\n kites.logger.debug('preparing register kites models ...');\n kites.models = discover(this.modelsDir, /.js$/i).map((modelFileName) => {\n var modelName = path.basename(modelFileName).replace(/.js$/i, '').toLowerCase();\n kites.logger.debug(`register model (${modelName}): ` + modelFileName);\n\n var DerivedModel = require(modelFileName);\n\n if (!DerivedModel) {\n kites.logger.info(`Model definition does not have constructor: [${modelName}]!`);\n return DerivedModel;\n }\n\n // get model prototype\n var inheritsBaseObj = DerivedModel.prototype;\n\n if (inheritsBaseObj == null) {\n inheritsBaseObj = DerivedModel;\n }\n\n if (typeof inheritsBaseObj === 'object') {\n Object.setPrototypeOf(inheritsBaseObj, BaseModel.prototype);\n }\n\n Object.defineProperties(inheritsBaseObj, {\n kites: {\n writable: false,\n enumerable: false,\n value: kites\n },\n logger: {\n writable: true,\n enumerable: false,\n value: kites.logger\n },\n modelName: {\n writable: false,\n enumerable: false,\n value: modelName\n },\n modelFileName: {\n writable: false,\n enumerable: false,\n value: modelFileName\n },\n name: {\n writable: true,\n enumerable: false,\n value: modelName\n },\n options: {\n writable: true,\n enumerable: false,\n value: definition.options\n }\n });\n\n var options = Object.assign({}, definition.options);\n return typeof DerivedModel === 'function' ? new DerivedModel(kites, options) : DerivedModel;\n });\n\n // init data source connection, after models have initialized\n kites.emit('apiModelRegistered', kites);\n\n // discover services\n kites.logger.debug('preparing register kites services ...');\n kites.services = discover(this.servicesDir, /service.js/i).map((serviceFileName) => {\n var serviceName = path.basename(serviceFileName).replace(/service.js$/i, '').toLowerCase();\n var DerivedService = require(serviceFileName);\n kites.logger.debug(`register service (${serviceName}):`, serviceFileName);\n\n if (!DerivedService) {\n kites.logger.info(`Service definition does not have constructor: [${serviceName}]!`);\n return DerivedService;\n }\n\n // get service prototype\n var inheritsBaseObj = DerivedService.prototype;\n\n if (inheritsBaseObj == null) {\n inheritsBaseObj = DerivedService;\n }\n\n if (typeof inheritsBaseObj === 'object') {\n // inherits from base service\n Object.setPrototypeOf(inheritsBaseObj, BaseService.prototype);\n }\n\n Object.defineProperties(inheritsBaseObj, {\n kites: {\n writable: false,\n enumerable: false,\n value: kites\n },\n logger: {\n writable: true,\n enumerable: false,\n value: kites.logger\n },\n serviceName: {\n writable: false,\n enumerable: false,\n value: serviceName\n },\n serviceFileName: {\n writable: false,\n enumerable: false,\n value: serviceFileName\n },\n name: {\n writable: true,\n enumerable: false,\n value: serviceName\n },\n useNativeModel: {\n writable: true,\n enumerable: false,\n value: definition.options.useBaseModel\n }\n });\n var options = Object.assign({}, definition.options);\n return typeof DerivedService === 'function' ? new DerivedService(kites, options) : DerivedService;\n });\n\n // discover controllers\n kites.logger.debug('preparing register kites controllers ...');\n kites.controllers = discover(this.ctrlsDir, /controller.js/i).map((ctrlFileName) => {\n // extends base controller\n var ctrlName = path.basename(ctrlFileName).replace(/controller.js$/i, '').toLowerCase();\n var DerivedController = require(ctrlFileName);\n\n if (!DerivedController) {\n kites.logger.info(`Controller definition does not have constructor: [${ctrlName}]!`);\n return DerivedController;\n }\n\n // get controller prototype\n var inheritsBaseObj = DerivedController.prototype;\n\n if (inheritsBaseObj == null) {\n inheritsBaseObj = DerivedController;\n }\n\n if (typeof inheritsBaseObj === 'object') {\n // for (curd, actions) still inherits from base controller\n Object.setPrototypeOf(inheritsBaseObj, BaseController.prototype);\n }\n\n var propNames = Object.getOwnPropertyNames(inheritsBaseObj);\n\n kites.logger.debug(`register controller (${ctrlName}):`, ctrlFileName);\n\n Object.defineProperties(inheritsBaseObj, {\n kites: {\n writable: false,\n enumerable: false,\n value: kites\n },\n logger: {\n writable: true,\n enumerable: false,\n value: kites.logger\n },\n controllerName: {\n writable: false,\n enumerable: false,\n value: ctrlName\n },\n controllerFileName: {\n writable: false,\n enumerable: false,\n value: ctrlFileName\n },\n name: {\n writable: true,\n enumerable: false,\n value: ctrlName\n },\n propNames: {\n writable: true,\n enumerable: false,\n value: propNames\n },\n actions: {\n writable: true,\n enumerable: false,\n value: definition.options.actions\n },\n crud: {\n writable: true,\n enumerable: false,\n value: definition.options.crud\n }\n });\n\n var options = Object.assign({}, definition.options);\n return typeof DerivedController === 'function' ? new DerivedController(kites, options) : DerivedController;\n });\n }", "title": "" }, { "docid": "d00d5a3d88d31ff9e4ef98b16304e936", "score": "0.5316105", "text": "save(key, val, options = {}) {\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\n let attrs;\n if (key == null || typeof key === \"object\") {\n attrs = key;\n options = val;\n } else {\n (attrs = {})[key] = val;\n }\n\n options = extend({validate: true, parse: true}, options);\n let wait = options.wait;\n\n // If we're not waiting and attributes exist, save acts as\n // `set(attr).save(null, opts)` with validation. Otherwise, check if\n // the model will be valid when the attributes, if any, are set.\n if (attrs && !wait) {\n if (!this.set(attrs, options)) {\n return false;\n }\n } else if (!this._validate(attrs, options)) {\n return false;\n }\n\n // After a successful server-side save, the client is (optionally)\n // updated with the server-side state.\n let model = this;\n let success = options.success;\n let attributes = this._attributes;\n options.success = (resp) => {\n // Ensure attributes are restored during synchronous saves.\n model.attributes = attributes;\n let serverAttrs = options.parse ? model.parse(resp, options) : resp;\n if (wait) {\n serverAttrs = extend({}, attrs, serverAttrs);\n }\n if (serverAttrs && !model.set(serverAttrs, options)) {\n return false;\n }\n if (success) {\n success.call(options.context, model, resp, options);\n }\n model.trigger(\"sync\", model, resp, options);\n };\n wrapError(this, options);\n\n // Set temporary attributes if `{wait: true}` to properly find new ids.\n if (attrs && wait) {\n this._attributes = extend({}, attributes, attrs);\n }\n\n let method = this.isNew() ? \"create\" : (options.patch ? \"patch\" : \"update\");\n if (method === \"patch\" && !options.attrs) {\n options.attrs = attrs;\n }\n let request = this.sync(method, this, options);\n\n // Restore attributes.\n this._attributes = attributes;\n\n return request;\n }", "title": "" }, { "docid": "bb46e524548eb0ec82214ba368ecf3b6", "score": "0.53093636", "text": "function initialize(publicAPI, model) {}", "title": "" }, { "docid": "c1af91be5fd051ca79d5a55579fec3bb", "score": "0.53074217", "text": "function SyncClient(){}", "title": "" }, { "docid": "f84bc34451417066af2bd2fb1b3e9dcf", "score": "0.5301675", "text": "SeedApiList() {\n this.ASyncApiCallList[\"1\"] = { \"RunningState\": \"Running\", \"runResult\": \"\" };\n this.ASyncApiCallList[\"2\"] = { \"RunningState\": \"Completed\", \"runResult\": \"some object here... \" };\n }", "title": "" }, { "docid": "632d137663f6bda3d59cf01b7d4ed7e2", "score": "0.52927", "text": "static associate(models) { }", "title": "" }, { "docid": "fa7316221a2ee279efff1a58163b8072", "score": "0.5286695", "text": "'UpdateModel'() {\n this.update();\n }", "title": "" }, { "docid": "f392b046c5e0acd5d927ac86153c4f58", "score": "0.5285032", "text": "constructor() {\n this.api = null;\n\n this.refreshClient();\n this.syncingInterval = setInterval(() => {\n this.sync({direction: 'both'});\n }, 60 * 1000 ); // every 60 sec\n }", "title": "" }, { "docid": "6e2e27c099e9ceb3ec2bba0f4aa76bb5", "score": "0.52845544", "text": "async function getModels() {\n try {\n const response = await axios.get(urlGetModels);\n console.log(\"api call \");\n setModels(response.data);\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "6f9b78bc3bfcddd4b343808cd44d4a39", "score": "0.52839667", "text": "async function initializeModels(connection) {\r\n let promises = []\r\n\r\n Object.values(models).forEach((model) => {\r\n promises.push(model.initializeModel(connection))\r\n })\r\n\r\n return Promise.all(promises)\r\n}", "title": "" }, { "docid": "6259812b3185b0b21dda86607418205e", "score": "0.5281389", "text": "function doSync(){\n if (!firstName && !secondName) return;\n \n RhoConnect.syncAllSources().done(function(){\n //alert('data sync OK!');\n // set my location\n setMyLocation();\n // update locations\n updateLocations();\n }).fail(function(errCode, err){\n alert('Data sync error: ' +errCode);\n clearInterval(syncInterval);\n syncInterval = null;\n });\n }", "title": "" }, { "docid": "d33761a77c4e92233f5ab0ac98e3b483", "score": "0.5271625", "text": "syncDatabase() {\n\t\tif(Meteor.isServer)\n\t\t\tMeteor.publish('aclEntities', () => {\n\t\t\t\treturn this.entities.find({});\n\t\t\t});\n\t\telse {\n\t\t\tMeteor.subscribe('aclEntities');\n\t\t}\n\t}", "title": "" }, { "docid": "d57f5df6ece7f4138c8bcb36a56ac1a7", "score": "0.5269957", "text": "static associate(models) {\n }", "title": "" }, { "docid": "fb1268d7d62c80fb17308c5fbf0cbb35", "score": "0.52605045", "text": "async store({ request, response, Model }) {\n const model = await Model.create(request.all())\n return model\n }", "title": "" }, { "docid": "013f72b0819405344802bfdbc25be197", "score": "0.5257398", "text": "static async save(ctx) {\n const data = ctx.request.body\n await DataModel.create(data)\n ctx.body = {\n succ: true,\n }\n }", "title": "" }, { "docid": "f110998f98acedaeda401942ab7f25ec", "score": "0.5257367", "text": "init() {\n this.connection = new Sequelize(databeseConfig);\n\n models\n .map(model => model.init(this.connection))\n .map(model => model.associate && model.associate(this.connection.models));\n }", "title": "" }, { "docid": "1cb69bf8278a175d29825c357cd5e1aa", "score": "0.5252659", "text": "save(options) {\n this.sync(\"create\", this, options);\n }", "title": "" }, { "docid": "b842ff68f3394fc21dcc8d79dfdc63c0", "score": "0.5245185", "text": "modelUpdate(aCollection,aId,aValues) {\n aValues = Object.assign({},aValues,{\n updated_at: this.serverTimestamp\n });\n delete aValues.id;\n delete aValues.created_at;\n return this.update(aCollection,aId,aValues);\n }", "title": "" }, { "docid": "afa7f73c616b69533601bab7cdfdb559", "score": "0.5242573", "text": "async function main() {\n await User.sync({force: true})\n await User.create({username: 'test', password: sha512('test' + salt), salt: salt})\n await Project.sync({force: true})\n await Project.create({title: 'My new project'})\n // await ProjectsUsers.sync({force: true})\n // await ProjectsUsers.create({userId: 1, projectId: 1})\n // await Column.sync({force: true})\n // await Column.create({title: 'TODO', order: 0, projectId: 1})\n // await Card.sync({force: true})\n // await Card.create({description: 'Card one!', columnId: 1})\n // await CardsUsers.sync({force: true})\n // await CardsUsers.create({userId: 1, projectId: 1})\n // KEPT here as a reference for everything\n\n // const User = sequelize.define('users', {\n // username: {\n // type: DataTypes.STRING,\n // allowNull: false\n // },\n // password: {\n // type: DataTypes.STRING,\n // allowNull: false\n // },\n // salt: {\n // type: DataTypes.STRING,\n // allowNull: false\n // }\n // })\n // const salt = createSalt(20)\n // await User.sync({force: true})\n // await User.create({username: 'test', password: sha512('test' + salt), salt: salt})\n\n // const Project = sequelize.define('projects', {\n // title: {\n // type: DataTypes.STRING,\n // allowNull: false\n // } \n // })\n // await Project.sync({force: true})\n // await Project.create({title: 'My new project'})\n // const ProjectsUsers = sequelize.define('projectsUsers', {\n // projectId: {\n // type: DataTypes.INTEGER,\n // references: {\n // model: Project,\n // key: 'id'\n // }\n // },\n // userId: {\n // type: DataTypes.INTEGER,\n // references: {\n // model: User,\n // key: 'id'\n // }\n // }\n // })\n // await ProjectsUsers.sync({force: true})\n // Project.belongsToMany(User, {through: ProjectsUsers})\n // User.belongsToMany(Project, {through: ProjectsUsers})\n // await ProjectsUsers.create({userId: 1, projectId: 1})\n // const Column = sequelize.define('columns', {\n // title: {\n // type: DataTypes.STRING,\n // },\n // order: {\n // type: DataTypes.INTEGER,\n // },\n // projectId: {\n // type: DataTypes.INTEGER,\n // references: {\n // model: Project,\n // key: 'id'\n // }\n // }\n // })\n // await Column.sync({force: true})\n // Project.hasMany(Column)\n // Column.belongsTo(Project)\n // await Column.create({title: 'TODO', order: 0, projectId: 1})\n\n // const Card = sequelize.define('cards', {\n // columnId: {\n // type: DataTypes.INTEGER,\n // references: {\n // model: Column,\n // key: 'id'\n // }\n // },\n // description: {\n // type: DataTypes.STRING,\n // }\n // })\n // await Card.sync({force: true})\n // Card.hasOne(Column)\n // Column.hasMany(Card)\n // await Card.create({description: 'Card one!', columnId: 1})\n // const CardsUsers = sequelize.define('cardsUsers', {\n // cardId: {\n // type: DataTypes.INTEGER,\n // references: {\n // model: Card,\n // key: 'id'\n // }\n // },\n // userId: {\n // type: DataTypes.INTEGER,\n // references: {\n // model: User,\n // key: 'id'\n // }\n // }\n // })\n // await CardsUsers.sync({force: true})\n // Card.belongsToMany(User, {through: CardsUsers})\n // User.belongsToMany(Card, {through: CardsUsers})\n // await CardsUsers.create({cardId: 1, userId: 1})\n}", "title": "" }, { "docid": "988ad33d8ccc65456478e9fac54a0422", "score": "0.52416813", "text": "function update() {\n if (model) {\n model.update();\n }\n }", "title": "" }, { "docid": "a29d1e65d7c53bdaf3f64a6f1cad995c", "score": "0.5233482", "text": "async function getData () {\n const brands = await getBrands();\n brands.forEach(async brand => {\n const models = await getodels(brand);\n models.forEach(model => {\n var line ='{\"brand\":\"'+model.brand+'\",\"model\":\"'+model.model+'\",\"volume\":\"'+model.volume+'\",\"uuid\":\"'+model.uuid+'\",\"name\":\"'+model.name+'\"}'; \n \n var jsonObject = JSON.parse(line);\n \n client.create({\n index: 'cars',\n type: 'car',\n id: jsonObject['uuid'],\n body: jsonObject\n }, function (error, response) {\n if(error)\n {\n console.log(error);\n }\n });\n }); \n });\n }", "title": "" }, { "docid": "9b8ac63516b7476d308c5267bc29c33c", "score": "0.5230728", "text": "static updateModel(file, id) {\n let formData = new FormData();\n formData.append(\"model\", file);\n\n const request = new Request(\"/api/upload_model/\" + id, {\n // Prepare the Request\n method: \"POST\",\n body: formData,\n });\n\n return fetch(request)\n .then((response) => {\n // Return the Result of the Request\n return response.text();\n })\n .catch((error) => {\n return error;\n });\n }", "title": "" }, { "docid": "ee26408490bc2190adbba6f64be02bc6", "score": "0.52288157", "text": "function updateAll(){\n updateRepositories();\n updateUsers();\n}", "title": "" }, { "docid": "ec453cdeb23f93d5b5099d0893bab571", "score": "0.5227639", "text": "loadModelsForGenerator() {\n var done = this.async();\n workspace.models.ModelDefinition.find(function(err, results) {\n if (err) return done(err);\n this.projectModels = results;\n this.modelNames = results.map(function(m) {\n return m.name;\n });\n this.editableModels = results.filter(function(result) {\n return !result.readonly;\n });\n this.editableModelNames = this.editableModels.map(function(m) {\n return m.name;\n });\n done();\n }.bind(this));\n }", "title": "" }, { "docid": "9ad011499d485f437de5ed7580817577", "score": "0.5226444", "text": "function sync(method, opts, collection, idField){\n idField = idField || 'id';\n\n meetup[method](opts, function(err, resp){\n if(err) return;\n\n var results = resp.data.results;\n var meta = resp.data.meta;\n\n results.forEach(function(doc){\n console.log('Upserting ' + method, doc.name ? doc.name : doc[idField] /*, doc */);\n updateOrInsert(collection, doc, idField);\n });\n\n // Are there more pages of data to get?\n if (meta.next){\n opts.offset = opts.offset || 0;\n opts.offset++;\n console.log('Syncing next page', opts.offset);\n sync(method, opts, collection, idField);\n }\n });\n}", "title": "" }, { "docid": "c8b4c018c5e67fe2d77edb36fd587ce8", "score": "0.52187204", "text": "init() {\n this.connection = new Sequelize(databaseConfig); // Conexao com o bd\n\n // Manda a conexao para cada model\n models\n .map(model => model.init(this.connection))\n .map(model => model.associate && model.associate(this.connection.models));\n }", "title": "" }, { "docid": "116bc8346fb3c305b9e45bd160a8e503", "score": "0.52161825", "text": "update(rent, callback) {\n window.$.ajax({\n url: this.baseUrl + \"/\" + rent.id,\n //contentType:\"application/json\",\n //data: JSON.stringify(rent),\n data: rent,\n method: \"PUT\",\n crossDomain: true,\n context: this\n }).done(data => {\n this.findAll(callback);\n })\n .fail(msg => {\n console.log(msg);\n }); \n }", "title": "" }, { "docid": "42fac0c165cc3fb325480d2853be6784", "score": "0.5211068", "text": "static find(state, query){\n\t\tif(state === undefined){\n\t\t\t//try to use global store\n\t\t\tif(window.store && typeof window.store.getState === 'function'){\n\t\t\t\tstate = window.store.getState()\n\t\t\t} else {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t}\n\t\tvar ModelClass = this;\n\t\tvar model = new ModelClass();\n\t\tvar localState \n\t\tvar totalCount\n\t\tif(query && query instanceof Query) {\n\t\t\t\tlocalState = stateMapper(state, model.getOption('collection'));\n\t\t\t\tvar queryWithData = query.withData(localState);\n\t\t\t\tlocalState = queryWithData.get();\n\t\t\t\ttotalCount = queryWithData.count();\n\t\t} else {\n\t\t\tlocalState = stateMapper(state, model.getOption('collection'), query);\n\t\t\ttotalCount = localState?localState.length:0;\n\t\t}\n\t\t// require sync or not? How to determind that we need to do syncing with REST API?\n\t\t// rule1: localState is empty?\n\t\t// rule2: check for last sync timestamps\n\t\tvar needSync = false;\n\t\t// if yes, return a promise\n\t\tvar rtn;\n\t\tif(needSync){\n\t\t\tvar modelName = this;\n\t\t\trtn = new Promise((s,j) => {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// perform syncing here\n\t\t\t\t\tvar model = modelName.new({name: 'test' + Date.now()})\n\t\t\t\t\tvar action = ActionCollection.actions([model.save()])\n\t\t\t\t\tfor (var i = 0; i < 10; i ++){\n\t\t\t\t\t\tmodel = modelName.new({name: 'test' + Date.now()})\n\t\t\t\t\t\taction.add(model.save())\n\t\t\t\t\t}\n\t\t\t\t\ts(action)\n\t\t\t\t}, 5000)\n\t\t\t})\n\t\t\treturn rtn;\n\t\t}\n\n\t\t\n\t\t// if no, just return an array of models\n\t\tif(Array.isArray(localState)){\n\t\t\trtn = localState.map((val) => {\n\t\t\t\treturn ModelClass.fromState(state, val);\n\t\t\t})\n\t\t} else {\n\t\t\trtn = [];\n\t\t}\n\t\t//set total count\n\t\trtn.totalCount = totalCount;\n\t\t//set query\n\t\trtn.query = query;\n\t\treturn rtn\n\t}", "title": "" }, { "docid": "1b5dafefd289fea146d05851ac95d8a5", "score": "0.5210042", "text": "* store(request,response){\n const model = this.resource(request.param('resource'))\n const data = JSON.parse(request.input('model')) //with JSON.stringify or postman\n // const data = request.input('model') //with ajax key 'model' to literal json\n const result = yield model.create(data)\n response.json(result)\n }", "title": "" }, { "docid": "bdfe135feaa1c5ef92e8da50b886148a", "score": "0.5197159", "text": "syncFromDirectory () {\n\n }", "title": "" }, { "docid": "f0a3e7406f4a60bb3b2bfb06ab4c94a3", "score": "0.5196415", "text": "function setup() {\n User.sync({ force: true }) // Using 'force: true' drops the table Users if it already exists and then creates a new one.\n .then(function() {\n // Add default users to the database\n // for (var i = 0; i < users.length; i++) {\n // // loop through all users\n User.create({ name: users[0] }); // create a new entry in the users table\n // }\n });\n Activity.sync({ force: true }).then(() => {\n defaultActivities.forEach(a => {\n Activity.create({\n title: a,\n active: true\n });\n });\n });\n ActivityLog.sync({ force: false });\n}", "title": "" } ]
528f492e18a1b85ee481c7e1a414bace
Class for parsed ContentDisposition header for v8 optimization
[ { "docid": "9a756c1fe1a3ceb3583c7fc3b3e20f33", "score": "0.738215", "text": "function ContentDisposition (type, parameters) {\n this.type = type\n this.parameters = parameters\n}", "title": "" } ]
[ { "docid": "d30700b335a321f4a43f0405a66d373f", "score": "0.73943967", "text": "function ContentDisposition(type, parameters) {\n this.type = type\n this.parameters = parameters\n}", "title": "" }, { "docid": "d30700b335a321f4a43f0405a66d373f", "score": "0.73943967", "text": "function ContentDisposition(type, parameters) {\n this.type = type\n this.parameters = parameters\n}", "title": "" }, { "docid": "898c962eea26603c918cc3fdc1346dce", "score": "0.72214586", "text": "function ContentDisposition(type, parameters) {\n\t this.type = type\n\t this.parameters = parameters\n\t}", "title": "" }, { "docid": "898c962eea26603c918cc3fdc1346dce", "score": "0.72214586", "text": "function ContentDisposition(type, parameters) {\n\t this.type = type\n\t this.parameters = parameters\n\t}", "title": "" }, { "docid": "beab985430cfc851e1c35a4a75d6373a", "score": "0.6421893", "text": "_computePracticalDisposition() {\n var disposition = this.getParameterHeader('content-disposition');\n\n // First, check whether an explict disposition exists.\n if (disposition) {\n // If it exists, keep it, except in the case of inline disposition\n // without a content-id. (Displaying text/* inline is not a problem for\n // us, but we need a content id for other embedded content. Currently only\n // images are supported, but that is enforced in a subsequent check.)\n if (disposition.toLowerCase() === 'inline' &&\n this.mediatype !== 'text' &&\n !this.contentId) {\n disposition = 'attachment';\n }\n }\n // If not, guess. TODO: Ensure 100% correctness in the future by fixing up\n // mis-guesses during sanitization as part of <https://bugzil.la/1024685>.\n else if (this.parentContentType === 'multipart/related' &&\n this.contentId &&\n this.mediatype === 'image') {\n // Inline image attachments that belong to a multipart/related may lack a\n // disposition but have a content-id.\n disposition = 'inline';\n } else if (this.filename || this.mediatype !== 'text') {\n disposition = 'attachment';\n } else {\n disposition = 'inline';\n }\n\n // Some clients want us to display things inline that we can't display\n // (historically and currently, PDF) or that our usage profile does not want\n // to automatically download (in the future, PDF, because they can get big).\n if (this.mediatype !== 'text' && this.mediatype !== 'image') {\n disposition = 'attachment';\n }\n\n return disposition;\n }", "title": "" }, { "docid": "6dc3f38fcea626b7c59f64cc78588806", "score": "0.63061666", "text": "get disposition () {\n\t\treturn this._disposition;\n\t}", "title": "" }, { "docid": "29dc847dcce229112d168bd4032328e9", "score": "0.62103945", "text": "function parseFileHeaders(headers, cb) {\n var match = headers['content-disposition'] && headers['content-disposition'].match(filenameRegex);\n\n cb(null, {\n filename: (match && match[2]) ? match[2] : \"unknow-file-name\",\n contentType: headers[\"content-type\"] || \"unknow-content-type\"\n });\n}", "title": "" }, { "docid": "51b74dd7125dae8166f5bf04b55310f2", "score": "0.60677856", "text": "onHeadersReceivedHandler( details ) {\n try {\n details = JSON.parse( Buffer.from( details, 'base64' ).toString( 'utf8' ) );\n } catch( error ) {\n console.error( error, details );\n return undefined;\n }\n let uri = new URL( details.url );\n\n /*\n * Some video sreaming sites (Streamango, OpenVideo) using 'X-Redirect' header instead of 'Location' header,\n * but fetch API only follows 'Location' header redirects => assign redirect to location\n */\n let redirect = details.responseHeaders['X-Redirect'] || details.responseHeaders['x-redirect'];\n if( redirect ) {\n details.responseHeaders['Location'] = redirect;\n }\n if( uri.hostname.includes( 'mp4upload' ) ) {\n /*\n *details.responseHeaders['Access-Control-Allow-Origin'] = '*';\n *details.responseHeaders['Access-Control-Allow-Methods'] = 'HEAD, GET';\n */\n details.responseHeaders['Access-Control-Expose-Headers'] = ['Content-Length'];\n }\n\n return details;\n }", "title": "" }, { "docid": "698630a01d02f5095d874834d60b2d35", "score": "0.5619781", "text": "function setHeaders (res, path) {\n res.setHeader('Content-Disposition', contentDisposition(path))\n}", "title": "" }, { "docid": "27f2b31265c88eb47174252738a9631f", "score": "0.55810964", "text": "get headers() {\n return {\n \"Content-Type\": concat([\n \"multipart/form-data; \", \"boundary=\", this.boundary\n ])\n }\n }", "title": "" }, { "docid": "1ef0b59b2207dc4c7cff4dc6c6b0edca", "score": "0.5561619", "text": "function onHeadersReceivedListener(details) {\n\t\t// Check if the request has been added.\n\t\tif (requests.hasOwnProperty(details.requestId)) {\n\t\t\t// Initialzie the iterator.\n\t\t\tvar i,\n\t\t\t\t// Initialize the name.\n\t\t\t\tname;\n\t\t\t// Iterate through each response header.\n\t\t\tfor (i = 0; i < details.responseHeaders.length; i += 1) {\n\t\t\t\t// Initialize the name.\n\t\t\t\tname = details.responseHeaders[i].name;\n\t\t\t\t// Check if this is a location header.\n\t\t\t\tif (name.toLowerCase() === 'location') {\n\t\t\t\t\t// Return null.\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Initialize the name.\n\t\t\tname = encodeRFC5987(requests[details.requestId] + '.mp4');\n\t\t\t// Push the response header ...\n\t\t\tdetails.responseHeaders.push({\n\t\t\t\t// ... with the name ...\n\t\t\t\tname: 'Content-Disposition',\n\t\t\t\t// .. and the value.\n\t\t\t\tvalue: 'attachment; filename*=UTF-8\\'\\'' + name\n\t\t\t});\n\t\t\t// Delete the request.\n\t\t\tdelete requests[details.requestId];\n\t\t\t// Return the modified response headers.\n\t\t\treturn {responseHeaders: details.responseHeaders};\n\t\t}\n\t\t// Return null.\n\t\treturn null;\n\t}", "title": "" }, { "docid": "c815da2dae1cf2b940b4d7b1bb560d9f", "score": "0.52726287", "text": "function hackHeaders(multipart) {\n const result = {};\n const headers = multipart.headers();\n Object.keys(headers).forEach((key) => {\n result[key.toLowerCase()] = headers[key];\n });\n multipart.headers = result;\n}", "title": "" }, { "docid": "2a0e0712bf967cc038c5c6451d605980", "score": "0.52258253", "text": "function contentTypeToContentDisposition(contentType) {\n if (contentType === \"application/sdp\") {\n return \"session\";\n }\n else {\n return \"render\";\n }\n}", "title": "" }, { "docid": "5a37b45f3113c0fb16dc16e9d697c1de", "score": "0.5216163", "text": "getHeader(name){const header=this.headers[Utils.headerize(name)];if(header){if(header[0]){return header[0].raw;}}else{return;}}", "title": "" }, { "docid": "2f8523c68d99618d99be2c3faa2043e8", "score": "0.5194588", "text": "function isDispositionSupported(){\r\n\treturn eval(dispositionEnabled);\r\n}", "title": "" }, { "docid": "ae6af1ed14906cd6826ad119b43fa533", "score": "0.5115156", "text": "function contentTypeToContentDisposition(contentType) {\n if (contentType === \"application/sdp\") {\n return \"session\";\n }\n else {\n return \"render\";\n }\n }", "title": "" }, { "docid": "ae6af1ed14906cd6826ad119b43fa533", "score": "0.5115156", "text": "function contentTypeToContentDisposition(contentType) {\n if (contentType === \"application/sdp\") {\n return \"session\";\n }\n else {\n return \"render\";\n }\n }", "title": "" }, { "docid": "8deb4817a945d5cf5a2b8712e82a926c", "score": "0.50911874", "text": "getHeaders(props) {\n return {\n \"Content-Type\": this.getContentType()\n };\n }", "title": "" }, { "docid": "564bc017fd265265fe718cdeb50d24b6", "score": "0.50887376", "text": "function name3198(response) {\n\n const request = response.request;\n if (!request.connection.settings.compression) {\n return null;\n }\n\n const mime = request.server.mime.type(response.headers['content-type'] || 'application/octet-stream');\n if (!mime.compressible) {\n return null;\n }\n\n response.vary('accept-encoding');\n\n if (response.headers['content-encoding']) {\n return null;\n }\n\n return (request.info.acceptEncoding === 'identity' ? null : request.info.acceptEncoding);\n}", "title": "" }, { "docid": "5658b94983f2b013796dab2734c2762e", "score": "0.50397927", "text": "function parseHeaders(headers) {\n let infos = {}\n let contentLength = headers.match(/content-length:(.*)/i);\n if (contentLength) {\n contentLength = contentLength[1].trim();\n if (!isNaN(contentLength) && contentLength > 0) {\n contentLength /= 1024;\n if (contentLength < 1000) infos.contentLength = (contentLength).toFixed(0) + ' KB';\n else infos.contentLength = (contentLength / 1024).toFixed(1) + ' MB';\n }\n }\n let lastModified = headers.match(/last-modified:(.*)/i);\n if (lastModified && lastModified[1].indexOf('01 Jan 1970') === -1) infos.lastModified = lastModified[1].trim();\n return infos;\n }", "title": "" }, { "docid": "9e29b2b21b7a80c306b2273ede442782", "score": "0.503599", "text": "function parseResponseHeaders(headerStr){var headers={};headerStr&&headerStr.split(\"\\r\\n\").forEach(function(headerPair){// Can't use split() here because it does the wrong thing\n\t// if the header value has the string \": \" in it.\n\tvar index=headerPair.indexOf(\": \");headers[headerPair.substring(0,index)]=headerPair.substring(index+2);});return headers;}", "title": "" }, { "docid": "74d3fe8c37a3d419b742f24b006ef986", "score": "0.49465212", "text": "function parseHeaders(xhr) {\n const rawHeader = xhr.getAllResponseHeaders() || \"\";\n const rawHeaderLines = rawHeader.split(/\\r?\\n/);\n let headers = new Headers();\n for (let line of rawHeaderLines) {\n let parts = line.split(\":\");\n let key = parts.shift().trim();\n if (key) {\n let value = parts.join(\":\").trim();\n headers.append(key, value);\n }\n }\n return headers;\n }", "title": "" }, { "docid": "c0ade566a8bb613ae9a6697639c42722", "score": "0.49365416", "text": "setCtxHeader(ctx) {\n const ua = (ctx.req.headers[\"user-agent\"] || \"\").toLowerCase();\n let fileName = encodeURIComponent(this.fileName + \".\" + this.suffix);\n if (ua.indexOf(\"msie\") >= 0 || ua.indexOf(\"chrome\") >= 0) {\n ctx.set(\"Content-Disposition\", `attachment; filename=${fileName}`);\n }\n else if (ua.indexOf(\"firefox\") >= 0) {\n ctx.set(\"Content-Disposition\", `attachment; filename*=${fileName}`);\n }\n else {\n ctx.set(\"Content-Disposition\", `attachment; filename=${Buffer.from(this.fileName + \".\" + this.suffix).toString(\"binary\")}`);\n }\n }", "title": "" }, { "docid": "2e0db33794604fb8915fdb5fb3560a84", "score": "0.49339423", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n headerStr && headerStr.split('\\u000d\\u000a').forEach(function (headerPair) {\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n headers[headerPair.substring(0, index)] = headerPair.substring(index + 2);\n });\n return headers;\n }", "title": "" }, { "docid": "c6f28dd43ca69164385f9e341cb745dd", "score": "0.49301103", "text": "getHeader() {}", "title": "" }, { "docid": "1955a08f70eafae16df4687a6fc0e9a7", "score": "0.4925672", "text": "function handler_header(k, v) {\n\tk = helpers.formatHeaderKey(k);\n\t// Convert mime if needed\n\tif (k == 'Accept' || k == 'ContentType') {\n\t\tv = contentTypes.lookup(v);\n\t}\n\tthis.__headers__[k] = v;\n}", "title": "" }, { "docid": "c87eecba8a6c9a7fe765d47fb150b4dc", "score": "0.49100125", "text": "get PARTIAL_CONTENT() {\n return 206;\n }", "title": "" }, { "docid": "7dcde08a7167cf6845f7d9f9e8db0d75", "score": "0.49073726", "text": "function responseHeaders(){}", "title": "" }, { "docid": "c5d28543baf27295591ff9a07a36ba57", "score": "0.4905842", "text": "parseHeader() {\n if (!this.callback) {\n return;\n }\n\n if (!this.headerLength || this.header) {\n return;\n }\n\n if (this.chunk.length >= this.headerLength) {\n var header = {};\n var offset = 0;\n while (offset < this.headerLength) {\n var headerNameLength = this.chunk[offset] * 1;\n var headerName = this.chunk.toString('ascii', offset + 1, offset + 1 + headerNameLength);\n var headerValueLength = this.chunk.readInt16BE(offset + headerNameLength + 2);\n var headerValue = this.chunk.toString(\n 'ascii',\n offset + headerNameLength + 4,\n offset + headerNameLength + 4 + headerValueLength,\n );\n header[headerName] = headerValue;\n offset += headerNameLength + 4 + headerValueLength;\n }\n this.header = header;\n this.chunk = this.chunk.slice(this.headerLength);\n this.checkErrorHeader();\n } else {\n this.callback();\n this.callback = null;\n }\n }", "title": "" }, { "docid": "7c7c1f6d8b4db7e98e1117412ce51020", "score": "0.48901772", "text": "function parseHeaders(xhr) {\n var responseHeaders = new _httpHeaders__WEBPACK_IMPORTED_MODULE_0__[\"HttpHeaders\"]();\n var headerLines = xhr.getAllResponseHeaders().trim().split(/[\\r\\n]+/);\n for (var _i = 0, headerLines_1 = headerLines; _i < headerLines_1.length; _i++) {\n var line = headerLines_1[_i];\n var index = line.indexOf(\":\");\n var headerName = line.slice(0, index);\n var headerValue = line.slice(index + 2);\n responseHeaders.set(headerName, headerValue);\n }\n return responseHeaders;\n}", "title": "" }, { "docid": "72686980903eb8a7b1b7a7b794d4ab12", "score": "0.48681903", "text": "function resHeaders(headers) {\n if (!headers.hasOwnProperty('content-length') &&\n !headers.hasOwnProperty('transfer-encoding'))\n headers['transfer-encoding'] = 'chunked';\n\n if (headers.location && this.downstream)\n headers.location = resLocation.call(this, headers.location);\n\n return headers;\n}", "title": "" }, { "docid": "c310fd7f341b5ba2a10aa27bf6181230", "score": "0.48592806", "text": "function setFileFormHeaders(headers, isChunked, chunkStart, chunkEnd, fileSize) {\n // we want the browser to auto-set the content type with the right form boundaries\n // see https://stackoverflow.com/questions/36067767/how-do-i-upload-a-file-with-the-js-fetch-api\n delete headers['Content-Type']\n if (isChunked) {\n headers['Content-Range'] = `bytes ${chunkStart}-${chunkEnd-1}/${fileSize}`\n }\n}", "title": "" }, { "docid": "239131d54b24eaa38782215ed0bf6ef5", "score": "0.4855688", "text": "getHeaders(name){const headers=this.headers[Utils.headerize(name)];const result=[];if(!headers){return[];}for(const header of headers){result.push(header.raw);}return result;}", "title": "" }, { "docid": "c3355b9c101d0438ba6d7b340312b1ed", "score": "0.48523974", "text": "function parseMimeHeaders(str) {\n let rx = /(\\S[^:]+):(.*(\\r?\\n[ \\t].*)*)/g;\n let res = {};\n for (let m = rx.exec(str); m; m = rx.exec(str)) {\n let k = m[1].trim().toLowerCase();\n let v = m[2].trim().replace(/\\s+/g, ' ');\n res[k] = v;\n }\n return res;\n}", "title": "" }, { "docid": "f92a476b748065eede2423d25eac49b7", "score": "0.48429656", "text": "function contentLengthFromResponseHeaders(headers) {\n const name = 'content-length';\n for (let i = 0; i < headers.length; i += 2) {\n const k = headers[i];\n if (k.length === name.length && k.toString().toLowerCase() === name) {\n const v = Number(headers[i + 1]);\n if (!isNaN(v)) {\n return v;\n } else {\n return null;\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "ddad4b2e4753bed61a0f647047cec808", "score": "0.4809987", "text": "function Dish (data, options) {\n this.buf = Buffer.isBuffer(data) ? data : Buffer(data);\n\n this.options = copy(options);\n this.headers = copy(this.options.headers);\n\n var str = this.buf.toString();\n if (!this.findHeader('ETag')) {\n this.headers['ETag'] = sha1(str);\n }\n if (!this.findHeader('Content-Length')) {\n this.headers['Content-Length'] = this.buf.length;\n }\n\n this.mime = this.findHeader('Content-Type');\n if (this.mime) {\n this.mime = this.mime.split(';')[0].trim();\n }\n else {\n this.mime = this.options.defaultContentType || 'application/octet-stream';\n this.headers['Content-Type'] = this.mime;\n }\n\n this.lastModified = this.findHeader('Last-Modified');\n if (this.lastModified) {\n this.lastModified = Date.parse(this.lastModified);\n }\n else {\n var d = new Date();\n this.headers['Last-Modified'] = d.toUTCString();\n this.lastModified = d.getTime();\n }\n\n this.gzippable = gzippable(this.mime) && this.options.gzip !== false;\n if (this.gzippable) {\n if (this.findHeader('Vary')) {\n this.headers['Vary'] += ', Accept-Encoding';\n }\n else {\n this.headers['Vary'] = 'Accept-Encoding';\n }\n }\n\n if (typeof this.options.maxAge === 'number') {\n this.headers['Cache-Control'] = 'public, max-age=' + this.options.maxAge;\n }\n}", "title": "" }, { "docid": "216cdf817565dd974fc051951d9b59c5", "score": "0.48092023", "text": "function headerReduce(headers, format) {\n var minmtime = new Date('Sun, 23 Feb 2014 18:00:00 UTC');\n var composed = {};\n\n composed['Cache-Control'] = 'max-age=3600';\n\n switch (format) {\n case 'vector.pbf':\n composed['Content-Type'] = 'application/x-protobuf';\n composed['Content-Encoding'] = 'deflate';\n break;\n case 'jpeg':\n composed['Content-Type'] = 'image/jpeg';\n break;\n case 'png':\n composed['Content-Type'] = 'image/png';\n break;\n }\n\n var times = headers.reduce(function(memo, h) {\n if (!h) return memo;\n for (var k in h) if (k.toLowerCase() === 'last-modified') {\n memo.push(new Date(h[k]));\n return memo;\n }\n return memo;\n }, []);\n if (!times.length) {\n times.push(new Date());\n } else {\n times.push(minmtime);\n }\n composed['Last-Modified'] = (new Date(Math.max.apply(Math, times))).toUTCString();\n\n var etag = headers.reduce(function(memo, h) {\n if (!h) return memo;\n for (var k in h) if (k.toLowerCase() === 'etag') {\n memo.push(h[k]);\n return memo;\n }\n return memo;\n }, []);\n if (!etag.length) {\n composed['ETag'] = '\"' + crypto.createHash('md5').update(composed['Last-Modified']).digest('hex') + '\"';\n } else {\n composed['ETag'] = etag.length === 1 ? etag[0] : '\"' + crypto.createHash('md5').update(etag.join(',')).digest('hex') + '\"';\n }\n\n return composed;\n}", "title": "" }, { "docid": "ced39b8dd8edb727bcea6bd677a73cca", "score": "0.48064795", "text": "checkHeader (buf) {\n const fullheader = {\n raw: buf,\n parsed: {\n versionStr: null,\n versionMaj: null,\n size: null,\n totalsize: null,\n flags: {\n unsynch: null,\n extended: null,\n experimental: null,\n footer: null\n }\n }\n }\n const header = fullheader.parsed\n\n if (buf[0] !== 73 || buf[1] !== 68 || buf[2] !== 51) {\n return false\n }\n // version\n let b0 = buf[3]\n const b1 = buf[4]\n if (b0 === 255 || b1 === 255) {\n return false\n }\n header.versionStr = `ID3v2.${String.fromCharCode(b0 + 48)}.${String.fromCharCode(b1 + 48)}`\n header.versionMaj = b0\n\n if (b0 !== 3 && b0 !== 4) {\n console.warn('Only support ID3v2.3 and ID3v2.4', header.versionStr)\n return false\n }\n\n // abcd0000\n b0 = buf[5]\n if (b0 & 0x0f !== 0) {\n // no 0000\n return false\n }\n header.flags.unsynch = (b0 & 0x80) !== 0\n header.flags.extended = (b0 & 0x40) !== 0\n header.flags.experimental = (b0 & 0x20) !== 0\n header.flags.footer = (b0 & 0x10) !== 0\n\n header.size = this.readSyncsafeInt32(buf.slice(6, 10))\n if (header.size === false) {\n return false\n }\n\n header.totalsize = header.size + 10 + header.flags.footer * 10\n\n return fullheader\n }", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "db07db475dd3965cd10a4b397acfa9df", "score": "0.4796059", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n headerStr && headerStr.split(\"\\r\\n\").forEach(function (headerPair) {\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf(\": \");\n headers[headerPair.substring(0, index)] = headerPair.substring(index + 2);\n });\n return headers;\n }", "title": "" }, { "docid": "993a48ec43eee6afd733ae04f1272c08", "score": "0.47630164", "text": "function readHeaders(headers) {\n var parsedHeaders = {};\n var previous = \"\"; \n headers.forEach(function (val) {\n // check if the next line is actually continuing a header from previous line\n if (isContinuation(val)) {\n if (previous !== \"\") {\n parsedHeaders[previous] += decodeURIComponent(val.trimLeft());\n return;\n } else {\n throw \"continuation, but no previous header\";\n }\n }\n\n // parse a header that looks like : \"name: SP value\".\n var index = val.indexOf(\":\");\n\n if (index === -1) {\n throw \"bad header structure: \" + val;\n }\n\n var head = val.substr(0, index).toLowerCase();\n var value = val.substr(index + 1).trimLeft();\n\n previous = head;\n if (value !== \"\") {\n parsedHeaders[head] = decodeURIComponent(value);\n } else {\n parsedHeaders[head] = null;\n }\n });\n return parsedHeaders;\n}", "title": "" }, { "docid": "495dad1ee9cf5a2483a83e8b9cc80c32", "score": "0.4760549", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n if (!headerStr) {\n return headers;\n }\n \n var headerPairs = headerStr.split('\\u000d\\u000a');\n for (var i = 0, len = headerPairs.length; i < len; i++) {\n var headerPair = headerPairs[i];\n var index = headerPair.indexOf('\\u003a\\u0020');\n if (index > 0) {\n var key = headerPair.substring(0, index);\n var val = headerPair.substring(index + 2);\n \n key = key && key.split('\\r').join('').split('\\n').join('');\n val = val && val.split('\\r').join('').split('\\n').join('');\n headers[key] = val;\n }\n }\n \n return headers;\n}", "title": "" }, { "docid": "ea65610d3be53ae0c26ace8987d5d6c7", "score": "0.4752813", "text": "function name3176(req, res) {\n // set appropriate Vary header\n vary(res, str)\n\n // multiple headers get joined with comma by node.js core\n return (req.headers[header] || '').split(/ *, */)\n }", "title": "" }, { "docid": "4acec4d70f22697b53be30efdbd5c309", "score": "0.4751872", "text": "function convertPDFAttachmentToInline(e) {\n for(var header of e.responseHeaders) {\n if(header.name.toLowerCase() === \"content-disposition\") {\n var s = header.value.split(\" \");\n var ptn = /filename=\".*\\.pdf/;\n if(s[0] === \"attachment;\" && s[1].match(ptn)) {\n //console.log(header);\n header.value = \"inline; \" + s[1];\n }\n }\n }\n\n return { responseHeaders: e.responseHeaders };\n\n}", "title": "" }, { "docid": "548cf1b7cf79440271d1e1f108b96f31", "score": "0.47476792", "text": "function parseResponseHeaders (headerStr) {\n var headers = {}\n\n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function (headerPair) {\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020')\n\n headers[headerPair.substring(0, index)] =\n headerPair.substring(index + 2)\n })\n\n return headers\n}", "title": "" }, { "docid": "a4beaf81e8815e8d0e7ffafa0607f4e1", "score": "0.47436038", "text": "function parseRangeHeader(value, size) {\n var _a, _b, _c;\n if (value === undefined) {\n return {\n status: 200,\n offset: 0,\n length: size,\n size: size\n };\n }\n let s416 = {\n status: 416,\n offset: 0,\n length: 0,\n size: size\n };\n let parts;\n parts = (_a = /^bytes[=]([0-9]+)[-]$/.exec(String(value))) !== null && _a !== void 0 ? _a : undefined;\n if (parts !== undefined) {\n let one = Number.parseInt(parts[1], 10);\n if (one >= size) {\n return s416;\n }\n return {\n status: 206,\n offset: one,\n length: size - one,\n size: size\n };\n }\n parts = (_b = /^bytes[=]([0-9]+)[-]([0-9]+)$/.exec(String(value))) !== null && _b !== void 0 ? _b : undefined;\n if (parts !== undefined) {\n let one = Number.parseInt(parts[1], 10);\n let two = Number.parseInt(parts[2], 10);\n if (two < one) {\n return s416;\n }\n if (one >= size) {\n return s416;\n }\n if (two >= size) {\n two = size - 1;\n }\n return {\n status: 206,\n offset: one,\n length: two - one + 1,\n size: size\n };\n }\n parts = (_c = /^bytes[=][-]([0-9]+)$/.exec(String(value))) !== null && _c !== void 0 ? _c : undefined;\n if (parts !== undefined) {\n let one = Number.parseInt(parts[1], 10);\n if (one < 1) {\n return s416;\n }\n if (size < 1) {\n return s416;\n }\n if (one > size) {\n one = size;\n }\n return {\n status: 206,\n offset: size - one,\n length: one,\n size: size\n };\n }\n return s416;\n}", "title": "" }, { "docid": "3a587ce926bcc85e672bcfefddb7022d", "score": "0.47377467", "text": "function writeHeader(status, fileType, fileName) {\n return `HTTP/1.1 ${status}\nDate: ${new Date()};\nContent-Type: ${fileType}; charset=utf-8\nContent-Length: ${fileName.length}\n${fileName}`;\n}", "title": "" }, { "docid": "6ae02752f8b2ae48422228d012a910a4", "score": "0.47369707", "text": "static invalidHeader(errorDetails) {\n\n return new HTTPError({\n statusCode: 400,\n errorCode: 'invalid_header',\n errorMessage: 'The request specified an invalid header.',\n errorDetails\n });\n }", "title": "" }, { "docid": "c3782460ad666e279a60732a4d540774", "score": "0.47063679", "text": "function ParseFogDownload( line )\n{\n\tvar prefix, offs;\n\tvar prefix = \"HttpRequestEnd: \";\n\tvar offs = line.indexOf(prefix);\n\tif( offs>=0 )\n\t{\n\t\tvar payload = line.substr(offs+prefix.length);\n\t\tvar temp = sscanf( payload, \"Type: %%, TotalTime: %%, ConnectTime: %% APPConnectTime: %%, PreTransferTime: %%, StartTransferTime: %%, RedirectTime: %%, DownloadSize: %%, RequestedSize: %%, cerr: %%, hcode: %%, Url: %%\" );\n\t\tvar httpRequestEnd = {};\n\t\thttpRequestEnd.responseCode = parseInt(temp[9])||parseInt(temp[10]);\n\t\thttpRequestEnd.curlTime = parseFloat(temp[1]);\n\t\thttpRequestEnd.url = temp[11];\n\t\thttpRequestEnd.type = temp[0];\n\t\thttpRequestEnd.ulSz = temp[8];\n\t\thttpRequestEnd.dlSz = temp[7];\n\t\tif( httpRequestEnd.url.indexOf(\"-header\")>=0 )\n\t\t{\n\t\t\thttpRequestEnd.type = \"INIT_\" + httpRequestEnd.type;\n\t\t}\n\t\treturn httpRequestEnd;\n\t}\n\treturn null;\n\t\n}", "title": "" }, { "docid": "4d9ba42cca2d4a8238afb8634247a3fd", "score": "0.46867695", "text": "constructor(){\n this.uri = \"\";\n this.type = 1;\n this.file = null;\n this.downloaded = false;\n this.name = \"\";\n this.url = \"\";\n }", "title": "" }, { "docid": "7e40362db16442174eab4f9cc09dc5c6", "score": "0.4628943", "text": "get HEADER_TOO_LARGE() {\n return 494;\n }", "title": "" }, { "docid": "5759f869f7edcdc47f7e142b0c2f57bc", "score": "0.46208152", "text": "function readHeader(headers) {\n return name => (headers[name] ? new Some(headers[name]) : None);\n }", "title": "" }, { "docid": "bbfee9592a6289965a30be1a90f10318", "score": "0.46167096", "text": "parseHeader() {\n this.uuid = this.getGUID();\n\n this.timestamp = new Date(this.readBytes(8));\n this.frameNumber = this.readBytes(4);\n this.dataSize = this.readBytes(4);\n this.headerSize = this.readBytes(2);\n\n let MainHeader = this.readBytes(2);\n\n this.hasSizeInformation = MainHeader & FrameHeaders.HeaderExtensionSize;\n this.hasLiveInformation = MainHeader & FrameHeaders.HeaderExtensionLiveEvents;\n this.hasPlaybackInformation = MainHeader & FrameHeaders.HeaderExtensionPlaybackEvents;\n this.hasNativeData = MainHeader & FrameHeaders.HeaderExtensionNative;\n this.hasMotionInformation = MainHeader & FrameHeaders.HeaderExtensionMotionEvents;\n this.hasLocationData = MainHeader & FrameHeaders.HeaderExtensionLocationInfo;\n this.hasStreamInfo = MainHeader & FrameHeaders.HeaderExtensionStreamInfo;\n this.hasCarouselInfo = MainHeader & FrameHeaders.HeaderExtensionCarouselInfo;\n\n if (this.hasSizeInformation) {\n this.parseSizeInformation();\n }\n\n if (this.hasLiveInformation) {\n this.parseLiveInformation();\n }\n if (this.hasPlaybackInformation) {\n this.parsePlaybackInformation();\n }\n if (this.hasNativeData) {\n this.nativeData = this.readBytes(4); // Remove this by header parser when we have support for Native data\n }\n if (this.hasMotionInformation) {\n this.parseMotionInformation();\n }\n if (this.hasLocationData) {\n this.locationData = this.readBytes(4); // Remove this by header parser when we have support for Stream location\n }\n if (this.hasStreamInfo) {\n this.parseStreamInfo();\n }\n if (this.hasCarouselInfo) {\n this.parseCarouselInfo();\n }\n }", "title": "" }, { "docid": "7df8dc43cfe6f15fce6f01905c4364e9", "score": "0.46142605", "text": "function getHeaders(headerString) {\n var headers = Object.create(null);\n var regexp = /:\\s?(.*)/;\n\n headerString.split(/\\r\\n/).forEach(function(value){\n if (!value || !value.trim()) return; // Abort, this value is meaningless!\n var chop = value.split(regexp);\n\n Object.defineProperty(headers, chop[0], {\n value: chop[1],\n enumerable: true,\n configurable: false,\n writable: false\n } );\n })\n\n return headers;\n}", "title": "" }, { "docid": "c1cf8a903719868b300657a82b986d8a", "score": "0.4613923", "text": "function sendFile (archive, entry, req, res, cb) {\n var headersSent = false\n let statusCode = 200\n\n // Try to get the cspHeader from the manifest\n getCSP(archive, function (err, cspHeader) {\n if (err) return cb(err)\n\n // handle range\n res.set('Accept-Ranges', 'bytes')\n let range = req.headers.range && parseRange(entry.size, req.headers.range)\n if (range && range.type === 'bytes') {\n range = range[0] // only handle first range given\n statusCode = 206\n res.set('Content-Range', 'bytes ' + range.start + '-' + range.end + '/' + entry.size)\n res.set('Content-Length', range.end - range.start + 1)\n } else {\n if (entry.size) {\n res.set('Content-Length', entry.size)\n }\n }\n\n let fileReadStream = archive.createReadStream(entry.path, range)\n let dataStream = fileReadStream\n .pipe(mime.identifyStream(entry.path, mimeType => {\n // cleanup the timeout now, as bytes have begun to stream\n\n // send headers, now that we can identify the data\n headersSent = true\n res.set({\n 'Content-Type': mimeType,\n 'Content-Security-Policy': cspHeader,\n 'Access-Control-Allow-Origin': '*',\n 'Cache-Control': 'public, max-age: 60'\n })\n\n if (req.method === 'HEAD') {\n dataStream.destroy() // stop reading data\n res.status(204).end()\n } else {\n res.status(statusCode)\n dataStream.pipe(res)\n }\n }))\n\n // handle empty files\n fileReadStream.once('end', () => {\n cb(null)\n if (!headersSent) {\n res.set({\n 'Content-Security-Policy': cspHeader,\n 'Access-Control-Allow-Origin': '*'\n })\n res.status(200).end()\n }\n })\n\n // handle read-stream errors\n fileReadStream.once('error', () => {\n if (!headersSent) cb(createError(500, 'Failed to read file'))\n })\n })\n}", "title": "" }, { "docid": "3d354cf3ec8b88badd7b04ead2d02f97", "score": "0.4606158", "text": "function parseCFFHeader(data, start) {\n\t var header = {};\n\t header.formatMajor = parse.getCard8(data, start);\n\t header.formatMinor = parse.getCard8(data, start + 1);\n\t header.size = parse.getCard8(data, start + 2);\n\t header.offsetSize = parse.getCard8(data, start + 3);\n\t header.startOffset = start;\n\t header.endOffset = start + 4;\n\t return header;\n\t}", "title": "" }, { "docid": "1d0ebbac6fcd94657e1937cc215c9852", "score": "0.46032083", "text": "headers() {\n return this.parseHeaders()\n }", "title": "" }, { "docid": "9c1abd19cdc1595d5041d0f2546885de", "score": "0.4588164", "text": "static missingHeader(errorDetails) {\n\n return new HTTPError({\n statusCode: 400,\n errorCode: 'missing_header',\n errorMessage: 'The request is missing a required header.',\n errorDetails\n });\n }", "title": "" }, { "docid": "7719001464deafbc2425591174e3663c", "score": "0.45646974", "text": "getHeader(name)\n {\n const header = this.headers[Utils.headerize(name)];\n\n if (header)\n {\n if (header[0])\n {\n return header[0].raw;\n }\n }\n else\n {\n return;\n }\n }", "title": "" }, { "docid": "ad86a07d715b2fc7c8521af517f41a94", "score": "0.45525435", "text": "function parseRequestHeader(headerText) {\n\t\tconst header = {};\n\n\t\theader.method = headerText.substring(0, headerText.indexOf(' '));\n\t\theaderText = headerText.substring(headerText.indexOf(' ') + 1);\n\n\t\theader.uri = headerText.substring(0, headerText.indexOf(' '));\n\t\theaderText = headerText.substring(headerText.indexOf(' ') + 1);\n\n\t\theader.version = headerText.substring(0, headerText.indexOf('\\r'));\n\t\theaderText = headerText.substring(headerText.indexOf('\\n') + 1);\n\n\t\theader.fields = {};\n\t\twhile (headerText !== '') {\n\t\t\tconst field = headerText.substring(0, headerText.indexOf(':'));\n\t\t\theaderText = headerText.substring(headerText.indexOf(':') + 2);\n\t\t\tlet value;\n\n\t\t\tif (headerText.indexOf('\\n') < 0) {\n\t\t\t\tvalue = headerText;\n\t\t\t\theaderText = '';\n\t\t\t} else {\n\t\t\t\tvalue = headerText.substring(0, headerText.indexOf('\\n'));\n\t\t\t\theaderText = headerText.substring(headerText.indexOf('\\n') + 1);\n\t\t\t}\n\n\t\t\theader.fields[field] = value;\n\t\t}\n\n\t\treturn header;\n\t}", "title": "" }, { "docid": "a4b2f25235d37c6b7b6b4708ba9bc298", "score": "0.45481074", "text": "function parseCFFHeader(data, start) {\n var header = {};\n header.formatMajor = parse.getCard8(data, start);\n header.formatMinor = parse.getCard8(data, start + 1);\n header.size = parse.getCard8(data, start + 2);\n header.offsetSize = parse.getCard8(data, start + 3);\n header.startOffset = start;\n header.endOffset = start + 4;\n return header;\n}", "title": "" }, { "docid": "a4b2f25235d37c6b7b6b4708ba9bc298", "score": "0.45481074", "text": "function parseCFFHeader(data, start) {\n var header = {};\n header.formatMajor = parse.getCard8(data, start);\n header.formatMinor = parse.getCard8(data, start + 1);\n header.size = parse.getCard8(data, start + 2);\n header.offsetSize = parse.getCard8(data, start + 3);\n header.startOffset = start;\n header.endOffset = start + 4;\n return header;\n}", "title": "" }, { "docid": "e38aabfac6328cea7129d80c07e0d922", "score": "0.4544978", "text": "function FileHand(path, type, filename, cache, gzip)\n{\n this.path = path; // :String (pathname to match)\n this.filename = filename; // :String\n this.cache = cache; // :int (cache-control)\n\n this.type = type; // :String (file mime-type)\n this.sess = false; // :boolean\n this.gzip = gzip; // :boolean\n}", "title": "" }, { "docid": "24c44750156b87a09b09679d3a4b1719", "score": "0.45316485", "text": "function addContentTypeToHeader() {\n\t return {\n\t request : requestInterceptor\n\t };\n\n\t function requestInterceptor(config) {\n\t if (angular.isDefined(config.headers['Content-Type']) && !angular.isDefined(config.data))\n\t config.data = '';\n\n\t return config;\n\t }\n\t }", "title": "" }, { "docid": "3d1ab57ac03dc12dfaeaa421ec9d65b0", "score": "0.45115462", "text": "headers(req, res, opt) {\n for (const key in opt) {\n if (opt.hasOwnProperty(key)) {\n if (!req.headers[key]) return res.status(400).json({ message: `Missing ${key} header` })\n if (req.headers[key] !== opt[key]) return res.status(415).json({ message: `Invalid ${key}, expected ${opt[key]}, given ${req.headers['content-type']}` })\n }\n }\n }", "title": "" }, { "docid": "2c21f2b51ba22b46caca67b5c5b64eb5", "score": "0.45072058", "text": "get headers() {\n if (this.isDefined) {\n return _cx().attributes().getOrElseUpdate(\"requestHeaders\",\n scalaF0(_enumeratorMap(_req(), \"getHeaderNames\", \"getHeaders\")));\n }\n}", "title": "" }, { "docid": "1db72ecc741505396f751e933913c949", "score": "0.44995895", "text": "function httptoce(headers) {\n return Object.keys(headers).reduce((event, key) => {\n if (key.startsWith('ce-')) {\n event[key.substr(3)] = headers[key]\n }\n return event\n }, {})\n}", "title": "" }, { "docid": "853f3957f98e0f8518424032b7f4b2e7", "score": "0.44877025", "text": "readFrameHeader (buf, tagheader) {\n const header = {\n raw: buf,\n id: null,\n size: null,\n totalsize: null,\n flags: {\n tagAlterPreservation: null,\n fileAlterPreservation: null,\n readOnly: null,\n groupingIdentity: null,\n compression: null,\n encryption: null,\n unsynchronisation: null,\n dataLengthIndicator: null\n }\n }\n let [b0, b1, b2, b3] = [buf[0], buf[1], buf[2], buf[3]]\n if (!((b0 >= 48 && b0 <= 57) || (b0 >= 65 && b0 <= 90))) { return false }\n if (!((b1 >= 48 && b1 <= 57) || (b1 >= 65 && b1 <= 90))) { return false }\n if (!((b2 >= 48 && b2 <= 57) || (b2 >= 65 && b2 <= 90))) { return false }\n if (!((b3 >= 48 && b3 <= 57) || (b3 >= 65 && b3 <= 90))) { return false }\n\n header.id = String.fromCharCode(b0, b1, b2, b3)\n\n if (tagheader.parsed.versionMaj === 3) {\n // id3v2.3 to id3v2.4\n header.size = this.convertInt32toSyncsafe(buf.subarray(4, 8)) // must use subarray\n } else {\n header.size = this.readSyncsafeInt32(buf.slice(4, 8))\n if (header.size === false) {\n return false\n }\n }\n\n header.totalsize = header.size + 10;\n\n // flags\n [b0, b1] = [buf[8], buf[9]]\n header.flags.tagAlterPreservation = (b0 & 0x40) !== 0\n header.flags.fileAlterPreservation = (b0 & 0x20) !== 0\n header.flags.readOnly = (b0 & 0x10) !== 0\n header.flags.groupingIdentity = (b1 & 0x40) !== 0\n header.flags.compression = (b1 & 0x08) !== 0\n header.flags.encryption = (b1 & 0x04) !== 0\n header.flags.unsynchronisation = (b1 & 0x02) !== 0\n header.flags.dataLengthIndicator = (b1 & 0x01) !== 0\n\n return header\n }", "title": "" }, { "docid": "a1d45485302ca1498afd916f8ac916f3", "score": "0.44821513", "text": "function mime(uri) {\n return uri.split(';')[0].slice(5);\n }", "title": "" }, { "docid": "93f1bc7c5c3abdc51a2a5eaf7b9db985", "score": "0.44785345", "text": "header(header, value) {\n if (header && !_.isUndefined(value)) {\n this._headers[header] = value;\n } else if (_.isObject(header)) {\n this._headers = header;\n }\n\n return Promise.resolve();\n }", "title": "" }, { "docid": "23ddbd88a41e9c20ddd1ed5f05bb9bf4", "score": "0.4475034", "text": "function normalizeHeaders(headers){\n return headers\n}", "title": "" }, { "docid": "574d7d0c741377f171846ad5682d1523", "score": "0.4470318", "text": "function RequestedFile(url) {\r\n\t\t\t\tthis.url = url;\r\n\t\t\t\tthis.content = null;\r\n\t\t\t}", "title": "" }, { "docid": "ac0045301c9b0fc5d7d0419d9fbd724b", "score": "0.44659007", "text": "function parseHeaders(stringHeaders) {\n\t\tvar headers = {};\n\t\tfor (var i = 0; i < stringHeaders.length; i++) {\n\t\t\tvar split = stringHeaders[i].indexOf(\":\");\n\t\t\tif (split == -1) continue;\n\t\t\tvar name = stringHeaders[i].substr(0, split).trim();\n\t\t\tvar value = stringHeaders[i].substr(split+1).trim();\n\t\t\theaders[toTitleCase(name)] = value;\n\t\t}\n\t\treturn headers;\n\t}", "title": "" }, { "docid": "ddb619e6cd8e88a0d10207e7fce6b2fb", "score": "0.44575036", "text": "function _headers(headers) {\n var h = {};\n for (var i in headers) {\n h[i] = headers[i];\n }\n return h;\n }", "title": "" }, { "docid": "f099174fd6345f91c53b1b5b541dbbbe", "score": "0.44574103", "text": "constructor(httpRequest){\n this.path = httpRequest.split(' ')[1];\n this.method = httpRequest.split(' ')[0];\n\n const hdArray = httpRequest.split('\\r\\n');\n const headTemp = {};\n for (let i = 1; i < hdArray.length; i++){\n let element = hdArray[i];\n let key = element.split(\" \")[0];\n let val = element.split(\" \")[1];\n if(key !== undefined && val !== undefined){\n headTemp[key.slice(0,key.length - 1)] = val;\n }\n }\n this.headers = headTemp;\n\n let body = hdArray[hdArray.length - 1]\n this.body = body;\n }", "title": "" }, { "docid": "90c89bfca74dd042b0ed3074b70cfd12", "score": "0.4455831", "text": "function mime(uri) {\n return uri.split(';')[0].slice(5);\n}", "title": "" }, { "docid": "90c89bfca74dd042b0ed3074b70cfd12", "score": "0.4455831", "text": "function mime(uri) {\n return uri.split(';')[0].slice(5);\n}", "title": "" }, { "docid": "9337821bd467ce1c3b4ab5c5260160aa", "score": "0.4452216", "text": "procesarHeaders(req){\n return req;\n }", "title": "" }, { "docid": "2ce6e3155fb8825a015fe99e2449e156", "score": "0.44495586", "text": "function parseResponseHeader(headerText) {\n\t\tconst header = {};\n\n\t\theader.version = headerText.substring(0, headerText.indexOf(' '));\n\t\theaderText = headerText.substring(headerText.indexOf(' ') + 1);\n\n\t\theader.status = headerText.substring(0, headerText.indexOf(' '));\n\t\theaderText = headerText.substring(headerText.indexOf(' ') + 1);\n\n\t\theader.reason = headerText.substring(0, headerText.indexOf(' '));\n\t\theaderText = headerText.substring(headerText.indexOf(' ') + 1);\n\n\t\theader.fields = {};\n\t\twhile (headerText !== '') {\n\t\t\tconst field = headerText.substring(0, headerText.indexOf(':'));\n\t\t\theaderText = headerText.substring(headerText.indexOf(':') + 2);\n\n\t\t\tconst value = headerText.substring(0, headerText.indexOf('\\n'));\n\t\t\theaderText = headerText.substring(headerText.indexOf('\\n') + 1);\n\n\t\t\theader.fields[field] = value;\n\t\t}\n\n\t\treturn header;\n\t}", "title": "" }, { "docid": "7c836c4f7a862b6074a01e8618717fff", "score": "0.44433558", "text": "function buildHeaders (req_opts, last_mod) {\n var cache_control = req_opts.cache_control;\n var headers = {};\n if (cache_control) {\n headers['Cache-Control'] = cache_control;\n }\n if (cache_control != 'no-cache') {\n if (last_mod) {\n headers['If-Modified-Since'] = last_mod;\n }\n // TODO: Maybe Etag, someday. But, Kuma doesn't / can't send it, so\n // don't bother for now.\n }\n // Extend existing or set new request headers.\n if ('headers' in req_opts) {\n _.extend(req_opts.headers, headers);\n } else {\n req_opts.headers = headers;\n }\n}", "title": "" }, { "docid": "55266c623a9c7712da5c73628057162c", "score": "0.44431815", "text": "get UNSUPPORTED_MEDIA_TYPE() {\n return 415;\n }", "title": "" }, { "docid": "2308b92ad68a6f71bbd16df656ebaf97", "score": "0.44071332", "text": "function FormDataShim(xhr){\n\tvar o = this;\n\tvar parts = [];// Data to be sent\n var boundary = new Array(5).join('-') + (+new Date() * (1e16*Math.random())).toString(32);\n\tvar oldSend = XMLHttpRequest.prototype.send;\n\t\n\tthis.append = function (name, value, filename) {\n\t\tparts.push('--' + boundary + '\\r\\nContent-Disposition: form-data; name=\"' + name + '\"');\n\t\tif (value instanceof Blob) {\n\t\t\tparts.push('; filename=\"'+ (filename || 'blob') +'\"\\r\\nContent-Type: ' + value.type + '\\r\\n\\r\\n');\n\t\t\tparts.push(value);\n\t\t} else {\n\t\t\tparts.push('\\r\\n\\r\\n' + value);\n\t\t}\n\t\tparts.push('\\r\\n');\n };\n\n // Override XHR send()\n xhr.send = function (val) {\n var fr,data,oXHR = this;\n if (val === o) {\n //注意不能漏最后的\\r\\n ,否则有可能服务器解析不到参数.\n parts.push('--' + boundary + '--\\r\\n');\n data = new blob.XBlob(parts);\n fr = new FileReader();\n fr.onload = function () { oldSend.call(oXHR, fr.result); };\n fr.onerror = function (err) { throw err; };\n fr.readAsArrayBuffer(data);\n \n this.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary);\n XMLHttpRequest.prototype.send = oldSend;\n }\n else {\n \toldSend.call(this, val);\n }\n };\n}", "title": "" }, { "docid": "2ec5bfc302a289f72b19dc7fa3a8ebd7", "score": "0.4405751", "text": "static parse(s, position = 0) {\n // https://mimesniff.spec.whatwg.org/#parsing-a-mime-type\n const { length } = s;\n\n // Match permissive pattern for type, subtype, and suffix.\n TYPE_SUBTYPE_SUFFIX.lastIndex = position;\n let [match, type, subtype, suffix] = TYPE_SUBTYPE_SUFFIX.exec(s) ?? [];\n\n // Perform checks specified in algorithm.\n if (!match) return { next: position };\n position += match.length;\n\n if (\n type === '' ||\n !TOKEN.test(type) ||\n subtype === '' ||\n !TOKEN.test(subtype)\n ) {\n return { next: position };\n }\n\n // Normalize type, subtype, and suffix values.\n type = type.toLowerCase();\n subtype = subtype.toLowerCase();\n suffix = suffix != null ? suffix.toLowerCase() : undefined;\n\n // Parse parameters.\n let parameters;\n while (position < length && s.charCodeAt(position) === SEMICOLON) {\n // Match against permissive parameter regex.\n PARAMETER.lastIndex = position;\n let [match, name, value] = PARAMETER.exec(s) ?? [];\n if (!match) break;\n position += match.length;\n\n // Perform checks specified in algorithm.\n if (name === '' || !TOKEN.test(name)) continue;\n if (value === undefined || value === '') continue;\n if (value.charCodeAt(0) === DQUOTE) {\n value = MediaType.unquote(value).value;\n }\n if (!QUOTED_STRING_CHARS.test(value)) continue;\n\n // Normalize parameter name. Treat charset and q as special.\n name = name.toLocaleLowerCase();\n if (name === 'charset' && UTF8.test(value)) {\n value = 'UTF-8';\n } else if (name === 'q') {\n value = Number(value);\n }\n\n // If the parameter hasn't been declared yet, add it to collection.\n if (!parameters) parameters = create(null);\n if (parameters[name] === undefined) parameters[name] = value;\n }\n\n // Et voila!\n const mediaType = { type, subtype, suffix, parameters };\n return { mediaType, next: position };\n }", "title": "" }, { "docid": "cb2feb1965cbeddb6eae4ed9f1fed26d", "score": "0.439242", "text": "function onPiped() {\n options.headers = options.headers || {};\n \n if (ended) {\n options.headers['content-length'] = buffer.size;\n }\n else {\n // this was crashing all getServer Tests\n //options.headers['transfer-encoding'] = 'chunked';\n // from teh docs\n // The Cloud Server API does not support chunked transfer-encoding.\n }\n }", "title": "" }, { "docid": "73c888fb090b98f0099a75738d3e9067", "score": "0.43918192", "text": "hasHeader(name){return this.headers[Utils.headerize(name)]?true:false;}", "title": "" }, { "docid": "ffd632080e59886a617522d0b013b3e1", "score": "0.43806314", "text": "getHeader(name) {\n const header = this.headers[headerize(name)];\n if (header) {\n if (header[0]) {\n return header[0].raw;\n }\n }\n else {\n return;\n }\n }", "title": "" } ]
f9954e9c41b783afcea37c417d34eb32
| inCirc:float returns eased float value | | t:number current time | b:number beginning value | c:number change in value | d:number duration | | Get an eased float value based on inCirc.
[ { "docid": "c28018d813c9b09e2c962f022d7be29d", "score": "0.6574016", "text": "inCirc(t, b, c, d) {\n\t\treturn -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;\n\t}", "title": "" } ]
[ { "docid": "8cfa2d0959532926b1537de0130e764c", "score": "0.7716374", "text": "function easeInOutCirc(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;\n }\n return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\n }", "title": "" }, { "docid": "8cfa2d0959532926b1537de0130e764c", "score": "0.7716374", "text": "function easeInOutCirc(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;\n }\n return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\n }", "title": "" }, { "docid": "8cfa2d0959532926b1537de0130e764c", "score": "0.7716374", "text": "function easeInOutCirc(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;\n }\n return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\n }", "title": "" }, { "docid": "8cfa2d0959532926b1537de0130e764c", "score": "0.7716374", "text": "function easeInOutCirc(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;\n }\n return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\n }", "title": "" }, { "docid": "8cfa2d0959532926b1537de0130e764c", "score": "0.7716374", "text": "function easeInOutCirc(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;\n }\n return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\n }", "title": "" }, { "docid": "e529800367342edeed0f3a2ddc88b8c8", "score": "0.7258122", "text": "function easeOutCirc(t, b, _c, d) {\n var c = _c - b;\n return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;\n}", "title": "" }, { "docid": "239d93f072062490d6e04884725be215", "score": "0.6959913", "text": "function easeInCubic (t, b, c, d)\n {\n return c*(t/=d)*t*t + b;\n }", "title": "" }, { "docid": "9a4c0f43689fcbe11c587c23627feefe", "score": "0.6943833", "text": "function easeInOutCubic (t, b, c, d)\n {\n if ((t/=d/2) < 1)\n {\n return c/2*t*t*t + b;\n }\n else\n {\n return c/2*((t-=2)*t*t + 2) + b;\n }\n }", "title": "" }, { "docid": "6f75c5c1c5b19f08d799ec795d06ef35", "score": "0.6851424", "text": "function easeInOutCubic(t, b, c, d) {\n\tif ((t/=d/2) < 1) return c/2*t*t + b;\n\treturn -c/2 * ((--t)*(t-2) - 1) + b;\n}", "title": "" }, { "docid": "f75d17089e1c61efc8b73135bae3d953", "score": "0.6843437", "text": "function easeInOutCubic(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "title": "" }, { "docid": "f75d17089e1c61efc8b73135bae3d953", "score": "0.6843437", "text": "function easeInOutCubic(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "title": "" }, { "docid": "f75d17089e1c61efc8b73135bae3d953", "score": "0.6843437", "text": "function easeInOutCubic(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "title": "" }, { "docid": "eb5b77ea38e9356982433c53fd0d16ea", "score": "0.68250924", "text": "function easeInOutCubic(t, b, c, d) {\n t /= d/2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "title": "" }, { "docid": "eb5b77ea38e9356982433c53fd0d16ea", "score": "0.68250924", "text": "function easeInOutCubic(t, b, c, d) {\n t /= d/2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "title": "" }, { "docid": "a19496da81cbd71213660db87f002071", "score": "0.6809673", "text": "function easeInOutCubic(t, b, c, d) {\n\t if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;\n\t return c / 2 * ((t -= 2) * t * t + 2) + b;\n\t}", "title": "" }, { "docid": "17bfdd69e438028c59df0af832205360", "score": "0.67367584", "text": "function easeInCubic(t, b, c, d) {\n\t return c * (t /= d) * t * t + b;\n\t}", "title": "" }, { "docid": "99d597854c465bbd5ef04567a10576b6", "score": "0.65715057", "text": "easeInOutCubic(t) {\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n }", "title": "" }, { "docid": "d3a027dadbda6fd2dae05259a93dbd5f", "score": "0.65443397", "text": "function easeInCubic(t) {\n return t * t * t;\n }", "title": "" }, { "docid": "d3a027dadbda6fd2dae05259a93dbd5f", "score": "0.65443397", "text": "function easeInCubic(t) {\n return t * t * t;\n }", "title": "" }, { "docid": "b2102957e7c0997c5134fbf57e33b6c3", "score": "0.65176797", "text": "function easeInOutCubic(t) {\n return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n }", "title": "" }, { "docid": "b2102957e7c0997c5134fbf57e33b6c3", "score": "0.65176797", "text": "function easeInOutCubic(t) {\n return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n }", "title": "" }, { "docid": "8a824b124ef94d4087bb01530b3214a2", "score": "0.64826477", "text": "easeInCubic(t) {\n return t * t * t;\n }", "title": "" }, { "docid": "1e7bf7444c73a05e7a91ef434a9c1044", "score": "0.643722", "text": "function easeOutCubic (t, b, c, d)\n {\n return c*((t=t/d-1)*t*t + 1) + b;\n }", "title": "" }, { "docid": "e875b5290427d281703ff0fd59c0ea06", "score": "0.6344379", "text": "function ease(t, b, c, d){\n t /= d / 2;\n if (t < 1) return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n }", "title": "" }, { "docid": "f64f9f38172c20f1fdb8cf1d600dbf75", "score": "0.6338826", "text": "function global_ease_in(t, b, c, d) {\n\n return -c *(t/=d)*(t-2) + b;\n\n}", "title": "" }, { "docid": "078d9aaad729f10c8fe4010e8af24976", "score": "0.632472", "text": "inOutCirc(t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;\n\t\treturn c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;\n\t}", "title": "" }, { "docid": "c9a039b1967cb13a135bb4fc6a0a7712", "score": "0.6280519", "text": "inCubic(t, b, c, d) {\n\t\treturn c*(t/=d)*t*t + b;\n\t}", "title": "" }, { "docid": "8d01c020bc720e53a878de8a5a4765f1", "score": "0.62191606", "text": "function easeOutInCubic (t, b, c, d)\n {\n if (t < d/2) \n { \n return easeOutCubic (t*2, b, c/2, d);\n }\n else\n {\n return easeInCubic((t*2)-d, b+c/2, c/2, d);\n }\n }", "title": "" }, { "docid": "308d24f55c6d91ea3b48227df4dfa457", "score": "0.620812", "text": "outCirc(t, b, c, d) {\n\t\treturn c * Math.sqrt(1 - (t=t/d-1)*t) + b;\n\t}", "title": "" }, { "docid": "636ac204ce9a81e30af0d95121ec2b06", "score": "0.6206884", "text": "function easeInQuad(t, b, c, d) {\n return c*(t/=d)*t + b;\n}", "title": "" }, { "docid": "9717b0dc6e4538b4c7a7f4fefbae4645", "score": "0.6180234", "text": "function easeOut(t, b, c, d) {\n var ts = (t/=d)*t;\n var tc = ts*t;\n return b+c*(tc + -3*ts + 3*t);\n }", "title": "" }, { "docid": "973e7bf5a8971b052016bedce30e56ea", "score": "0.61765075", "text": "function easeOutCubic(t, b, c, d) {\n\t return c * ((t = t / d - 1) * t * t + 1) + b;\n\t}", "title": "" }, { "docid": "b8dc2bb70766b1e4361454d6ffc9c93d", "score": "0.6175828", "text": "function easeInOutBounce(t, b, c, d) {\n if (t < d / 2) {\n return easeInBounce (t * 2, 0, c, d) * 0.5 + b;\n }\n return easeOutBounce(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;\n }", "title": "" }, { "docid": "b8dc2bb70766b1e4361454d6ffc9c93d", "score": "0.6175828", "text": "function easeInOutBounce(t, b, c, d) {\n if (t < d / 2) {\n return easeInBounce (t * 2, 0, c, d) * 0.5 + b;\n }\n return easeOutBounce(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;\n }", "title": "" }, { "docid": "b8dc2bb70766b1e4361454d6ffc9c93d", "score": "0.6175828", "text": "function easeInOutBounce(t, b, c, d) {\n if (t < d / 2) {\n return easeInBounce (t * 2, 0, c, d) * 0.5 + b;\n }\n return easeOutBounce(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;\n }", "title": "" }, { "docid": "b8dc2bb70766b1e4361454d6ffc9c93d", "score": "0.6175828", "text": "function easeInOutBounce(t, b, c, d) {\n if (t < d / 2) {\n return easeInBounce (t * 2, 0, c, d) * 0.5 + b;\n }\n return easeOutBounce(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;\n }", "title": "" }, { "docid": "b8dc2bb70766b1e4361454d6ffc9c93d", "score": "0.6175828", "text": "function easeInOutBounce(t, b, c, d) {\n if (t < d / 2) {\n return easeInBounce (t * 2, 0, c, d) * 0.5 + b;\n }\n return easeOutBounce(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;\n }", "title": "" }, { "docid": "c4370bc80dc8252e80763057c9a44a26", "score": "0.61537987", "text": "function ease(t, b, c, d) {\n\t\tt /= d / 2;\n\t\tif (t < 1) return (c / 2) * t * t * t + b;\n\t\tt -= 2;\n\t\treturn (c / 2) * (t * t * t + 2) + b;\n\t}", "title": "" }, { "docid": "08fde98bb860ee914145ae14c99750a6", "score": "0.6092542", "text": "function easeInOutQuad(t, b, c, d) {\n if ((t/=d/2) < 1) return c/2*t*t + b;\n return -c/2 * ((--t)*(t-2) -1) + b;\n}", "title": "" }, { "docid": "72c65f430f317cc01a09b0b953cbb7e1", "score": "0.6057811", "text": "function easeInOutExpo(t, b, c, d) {\n t /= d / 2;\n if (t < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n t--;\n return c / 2 * (-Math.pow(2, -10 * t) + 2) + b;\n }", "title": "" }, { "docid": "9d16658694677f8622a2fd0553cc9330", "score": "0.60505766", "text": "function easeInQuad(t, b, c, d) {\n\t\treturn c * (t /= d) * t + b;\n\t}", "title": "" }, { "docid": "7e8740f3fb33c85cea6ebadaeb5d4e2c", "score": "0.6049053", "text": "function easeInOutQuart(t, b, c, d) {\n if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n}", "title": "" }, { "docid": "1891dcbc5b5c8bfe135244953de3abee", "score": "0.6048028", "text": "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "title": "" }, { "docid": "1891dcbc5b5c8bfe135244953de3abee", "score": "0.6048028", "text": "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "title": "" }, { "docid": "1891dcbc5b5c8bfe135244953de3abee", "score": "0.6048028", "text": "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "title": "" }, { "docid": "1891dcbc5b5c8bfe135244953de3abee", "score": "0.6048028", "text": "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "title": "" }, { "docid": "1891dcbc5b5c8bfe135244953de3abee", "score": "0.6048028", "text": "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "title": "" }, { "docid": "3759325f0bbd40d6c14723dbfd8fa1c9", "score": "0.60174197", "text": "function easeInOutQuad(t, b, c, d) {\n if ((t /= d / 2) < 1) return c / 2 * t * t + b;\n return -c / 2 * (--t * (t - 2) - 1) + b;\n }", "title": "" }, { "docid": "78452fd72a5ce832c567ab3abaa91015", "score": "0.60165334", "text": "function easeInQuad(t, b, c, d) {\n\t return c * (t /= d) * t + b;\n\t}", "title": "" }, { "docid": "22e24907a8a8f164cb1ff9c1cc0dd858", "score": "0.60088074", "text": "function easeInOutQuart(t, b, c, d) {\n if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }", "title": "" }, { "docid": "8c19cafd3eacf56e3a6b09f20937727c", "score": "0.6001504", "text": "function easeInOutQuad(t, b, c, d) {\n t /= d/2;\n if (t < 1) return c/2*t*t + b;\n t--;\n return -c/2 * (t*(t-2) - 1) + b;\n}", "title": "" }, { "docid": "f78b6eb81035d565b1cece708ef13a0a", "score": "0.5995857", "text": "easeOutCubic(t) {\n return --t * t * t + 1;\n }", "title": "" }, { "docid": "ccef70326fab45ab3feed193c630a326", "score": "0.5986108", "text": "function easeInOutQuad(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t + b;\n }\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n}", "title": "" }, { "docid": "d640749bdefb26e8121d853aa292f764", "score": "0.5980653", "text": "function easeInOutQuart(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t + b;\n }\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }", "title": "" }, { "docid": "d640749bdefb26e8121d853aa292f764", "score": "0.5980653", "text": "function easeInOutQuart(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t + b;\n }\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }", "title": "" }, { "docid": "d640749bdefb26e8121d853aa292f764", "score": "0.5980653", "text": "function easeInOutQuart(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t + b;\n }\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }", "title": "" }, { "docid": "d640749bdefb26e8121d853aa292f764", "score": "0.5980653", "text": "function easeInOutQuart(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t + b;\n }\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }", "title": "" }, { "docid": "d640749bdefb26e8121d853aa292f764", "score": "0.5980653", "text": "function easeInOutQuart(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t + b;\n }\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }", "title": "" }, { "docid": "e9396ab6cd591c93199263a051b0aa17", "score": "0.59444284", "text": "function easeInOutQuad(t, b, c, d) {\n\t if ((t /= d / 2) < 1) return c / 2 * t * t + b;\n\t return -c / 2 * (--t * (t - 2) - 1) + b;\n\t}", "title": "" }, { "docid": "4c583fe42ab0f1f104185f062ee1a729", "score": "0.59264165", "text": "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "title": "" }, { "docid": "4c583fe42ab0f1f104185f062ee1a729", "score": "0.59264165", "text": "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "title": "" }, { "docid": "4c583fe42ab0f1f104185f062ee1a729", "score": "0.59264165", "text": "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "title": "" }, { "docid": "4c583fe42ab0f1f104185f062ee1a729", "score": "0.59264165", "text": "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "title": "" }, { "docid": "4c583fe42ab0f1f104185f062ee1a729", "score": "0.59264165", "text": "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "title": "" }, { "docid": "d3e5202037e9425cbca3468da9a2040d", "score": "0.5922248", "text": "function linearTween(t, b, c, d) {\n return c * t / d + b;\n}", "title": "" }, { "docid": "4c1ac4a67e8bea62240a7172eaeeae5b", "score": "0.5896472", "text": "inOutCubic(t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t + b;\n\t\treturn c/2*((t-=2)*t*t + 2) + b;\n\t}", "title": "" }, { "docid": "d811372cf682a7fd9805e82a05bff9d9", "score": "0.589192", "text": "function linearTween(t, b, c, d) {\n\t return c * t / d + b;\n\t}", "title": "" }, { "docid": "8e98744e80cd3e4bc820caf9491730b0", "score": "0.5876467", "text": "function easeInOutQuint(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\n }", "title": "" }, { "docid": "8e98744e80cd3e4bc820caf9491730b0", "score": "0.5876467", "text": "function easeInOutQuint(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\n }", "title": "" }, { "docid": "8e98744e80cd3e4bc820caf9491730b0", "score": "0.5876467", "text": "function easeInOutQuint(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\n }", "title": "" }, { "docid": "8e98744e80cd3e4bc820caf9491730b0", "score": "0.5876467", "text": "function easeInOutQuint(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\n }", "title": "" }, { "docid": "8e98744e80cd3e4bc820caf9491730b0", "score": "0.5876467", "text": "function easeInOutQuint(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\n }", "title": "" }, { "docid": "df2bae6b8e4e0b680ad81eaa76482d3c", "score": "0.58574647", "text": "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "title": "" }, { "docid": "df2bae6b8e4e0b680ad81eaa76482d3c", "score": "0.58574647", "text": "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "title": "" }, { "docid": "e688ee4e55e22b7155e883da4c424fef", "score": "0.58543134", "text": "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n}", "title": "" }, { "docid": "b20767bb3eb871c9c9ed5c424389f616", "score": "0.5848863", "text": "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "title": "" }, { "docid": "b20767bb3eb871c9c9ed5c424389f616", "score": "0.5848863", "text": "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "title": "" }, { "docid": "9208887630510bad287a14548ddeff5b", "score": "0.5840359", "text": "function easeInOutQuint(t, b, c, d) {\n\t if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;\n\t return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\n\t}", "title": "" }, { "docid": "3cd1ece6b10f146ba009f158b1810d27", "score": "0.5838393", "text": "function easeOutBack (t, b, c, d, s)\n {\n if (!s) \n {\n s = 1.70158;\n }\n return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;\n }", "title": "" }, { "docid": "9f1b2b29867d536ee799d30f73370e96", "score": "0.5819511", "text": "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "title": "" }, { "docid": "9f1b2b29867d536ee799d30f73370e96", "score": "0.5819511", "text": "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "title": "" }, { "docid": "9f3b88d64b656e2ef9956e68ac5da032", "score": "0.58150494", "text": "function easing(t, b, c, d) {\n t /= d / 2;\n if (t < 1) return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n }", "title": "" }, { "docid": "de6b881ce0434c87d5ed1506fe090e25", "score": "0.58087885", "text": "function easeInQuint(t, b, c, d) {\n\t return c * (t /= d) * t * t * t * t + b;\n\t}", "title": "" }, { "docid": "5af7cebaa2a4686be00f08be41db7cee", "score": "0.5768608", "text": "outCubic(t, b, c, d) {\n\t\treturn c*((t=t/d-1)*t*t + 1) + b;\n\t}", "title": "" }, { "docid": "91f590add4fc21594867e73dbd0ca2a2", "score": "0.5754879", "text": "get animationCurveValue() {}", "title": "" }, { "docid": "d5ceeb000d546ef00dc429c0d4b3617f", "score": "0.5727847", "text": "function Quad_easeIn(t, b, c, d) {\n return c * (t /= d) * t * t * t + b;\n}", "title": "" }, { "docid": "842dff05d7bdab7cf0378b01f58633cc", "score": "0.5722831", "text": "easeInOutQuint(t) {\n return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;\n }", "title": "" }, { "docid": "15bc01af5778ff8886ebe24d76be67d5", "score": "0.5702738", "text": "function cubicIn(t) {\n return t * t * t;\n}", "title": "" }, { "docid": "f5e87de7eb2f03e854b02d53aee9daf7", "score": "0.56818336", "text": "function easeInOutSine(t, b, c, d) {\n return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n }", "title": "" }, { "docid": "f5e87de7eb2f03e854b02d53aee9daf7", "score": "0.56818336", "text": "function easeInOutSine(t, b, c, d) {\n return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n }", "title": "" }, { "docid": "f5e87de7eb2f03e854b02d53aee9daf7", "score": "0.56818336", "text": "function easeInOutSine(t, b, c, d) {\n return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n }", "title": "" }, { "docid": "f5e87de7eb2f03e854b02d53aee9daf7", "score": "0.56818336", "text": "function easeInOutSine(t, b, c, d) {\n return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n }", "title": "" }, { "docid": "f5e87de7eb2f03e854b02d53aee9daf7", "score": "0.56818336", "text": "function easeInOutSine(t, b, c, d) {\n return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n }", "title": "" }, { "docid": "d2953d16d2dee687cb1254c4397f3e80", "score": "0.5665633", "text": "function easeOutQuad(t, b, c, d) {\n return -c*(t/=d)*(t-2) + b;\n}", "title": "" }, { "docid": "0658e264dacfcb6fa5a2117d8b661229", "score": "0.5655559", "text": "function easeInOutElastic(t, b, c, d) {\n var s = 1.70158, p = 0, a = c;\n if (t === 0) {\n return b;\n }\n t /= d / 2;\n if (t === 2) {\n return b + c;\n }\n if (!p) {\n p = d * (0.3 * 1.5);\n }\n var opts = normalize(a, c, p, s);\n if (t < 1) {\n return -0.5 * elastic(opts, t, d) + b;\n }\n return opts.a * Math.pow(2, -10 * (t -= 1)) *\n Math.sin((t * d - opts.s) * (2 * Math.PI) / opts.p ) * 0.5 + opts.c + b;\n }", "title": "" }, { "docid": "0658e264dacfcb6fa5a2117d8b661229", "score": "0.5655559", "text": "function easeInOutElastic(t, b, c, d) {\n var s = 1.70158, p = 0, a = c;\n if (t === 0) {\n return b;\n }\n t /= d / 2;\n if (t === 2) {\n return b + c;\n }\n if (!p) {\n p = d * (0.3 * 1.5);\n }\n var opts = normalize(a, c, p, s);\n if (t < 1) {\n return -0.5 * elastic(opts, t, d) + b;\n }\n return opts.a * Math.pow(2, -10 * (t -= 1)) *\n Math.sin((t * d - opts.s) * (2 * Math.PI) / opts.p ) * 0.5 + opts.c + b;\n }", "title": "" }, { "docid": "0658e264dacfcb6fa5a2117d8b661229", "score": "0.5655559", "text": "function easeInOutElastic(t, b, c, d) {\n var s = 1.70158, p = 0, a = c;\n if (t === 0) {\n return b;\n }\n t /= d / 2;\n if (t === 2) {\n return b + c;\n }\n if (!p) {\n p = d * (0.3 * 1.5);\n }\n var opts = normalize(a, c, p, s);\n if (t < 1) {\n return -0.5 * elastic(opts, t, d) + b;\n }\n return opts.a * Math.pow(2, -10 * (t -= 1)) *\n Math.sin((t * d - opts.s) * (2 * Math.PI) / opts.p ) * 0.5 + opts.c + b;\n }", "title": "" }, { "docid": "0658e264dacfcb6fa5a2117d8b661229", "score": "0.5655559", "text": "function easeInOutElastic(t, b, c, d) {\n var s = 1.70158, p = 0, a = c;\n if (t === 0) {\n return b;\n }\n t /= d / 2;\n if (t === 2) {\n return b + c;\n }\n if (!p) {\n p = d * (0.3 * 1.5);\n }\n var opts = normalize(a, c, p, s);\n if (t < 1) {\n return -0.5 * elastic(opts, t, d) + b;\n }\n return opts.a * Math.pow(2, -10 * (t -= 1)) *\n Math.sin((t * d - opts.s) * (2 * Math.PI) / opts.p ) * 0.5 + opts.c + b;\n }", "title": "" }, { "docid": "0658e264dacfcb6fa5a2117d8b661229", "score": "0.5655559", "text": "function easeInOutElastic(t, b, c, d) {\n var s = 1.70158, p = 0, a = c;\n if (t === 0) {\n return b;\n }\n t /= d / 2;\n if (t === 2) {\n return b + c;\n }\n if (!p) {\n p = d * (0.3 * 1.5);\n }\n var opts = normalize(a, c, p, s);\n if (t < 1) {\n return -0.5 * elastic(opts, t, d) + b;\n }\n return opts.a * Math.pow(2, -10 * (t -= 1)) *\n Math.sin((t * d - opts.s) * (2 * Math.PI) / opts.p ) * 0.5 + opts.c + b;\n }", "title": "" }, { "docid": "38d602caf4df3461c1a2969dd4620fb5", "score": "0.5631721", "text": "easeInOutQuart(t) {\n return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;\n }", "title": "" } ]
c466c09731085d5e302cbf40b33446f0
Handles messages sent to the bot
[ { "docid": "12f54cb48a160203cff4e5284c74e93f", "score": "0.63050795", "text": "function handleMessage(sender_psid, received_message) {}", "title": "" } ]
[ { "docid": "5ddb3b03574d1cccdece3c33c6f7668a", "score": "0.71367466", "text": "function handleMessage(message){\n \n }", "title": "" }, { "docid": "3989a1fc6a23d80e66f832bd8aceb951", "score": "0.7088406", "text": "handleSend() {\n // Send the message\n this.SendMessage();\n }", "title": "" }, { "docid": "af5d434788990da51f17b5c3014ad397", "score": "0.70718795", "text": "function handleMessageInAppropriateWay(msg) {\n messages.push(msg);\n io.emit('chat message', msg);\n if (chekIfContainWord(msg.text, KEY_BOT)) {\n if (chekIfContainWord(msg.text, KEY_SHOW_LIST_NOTE)) {\n newChatBotMessage(showNotes(msg.text)).send()\n } else if (chekIfContainWord(msg.text, KEY_SHOW_NOTE)) {\n newChatBotMessage(getNote(msg.text)).send()\n } else if (chekIfContainWord(msg.text, KEY_DELETE_NOTE)) {\n deleteNote(msg.text)\n newChatBotMessage(\"Note successfuly deleted\").send()\n } else if (chekIfContainWord(msg.text, KEY_SAVE_NOTE)) {\n saveNote(msg.text)\n newChatBotMessage(\"Note successfuly saved\").send()\n } else if (chekIfContainWord(msg.text, KEY_SHOW_QUOTE)) {\n newChatBotMessage(getQuote()).send()\n } else if (chekIfContainWord(msg.text, KEY_SHOW_ADVISE)) {\n newChatBotMessage(getAdvise()).send()\n } else if (chekIfContainWord(msg.text, KEY_EXCHANGE)) {\n getExchangedSumMessage(msg.text)\n } else if (chekIfContainWord(msg.text, KEY_WEATHER)) {\n getWeather(msg.text)\n }\n }\n}", "title": "" }, { "docid": "500faec2a5022bf24dacd5277d660580", "score": "0.7056204", "text": "onMessage(message) {\n const text = this.getText(message);\n const senderId = this.getSenderId(message);\n const chatId = this.getChatId(message);\n console.log('got message: ', text, senderId, chatId); // eslint-disable-line\n (async () => {\n const reply = await this.getCommandReply(text, senderId, chatId);\n if (reply) {\n this.botApi.sendMessage(chatId, reply);\n } else {\n for (const h of this.defaultHandlers) {\n const defaultReply = await h.handle(text, senderId, chatId);\n if (defaultReply) this.botApi.sendMessage(chatId, defaultReply);\n }\n }\n })();\n }", "title": "" }, { "docid": "32c66fdca8c382e142c81b7945c3a6d0", "score": "0.7033869", "text": "run() {\n\t\tthis.bot.on('messageCreate', this.messageHandler);\n\t}", "title": "" }, { "docid": "bc9515e2dbf49b9c04ac77f5ff187678", "score": "0.6961292", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n // Remove whitespace from chat message\n // const commandName = msg.trim();\n\n // Turn chat message into array\n const commandName = msg.split(' ');\n // Sends each word in the array to the switch looking for commands\n commandName.forEach(commandName => {cmdSwitch(commandName, target, context);});\n\n}", "title": "" }, { "docid": "9ddc67baa96a9f51f8e9ca5b0e46bd2b", "score": "0.6780579", "text": "function receivedMessageEvent(event) {\n const senderID = event.sender.id;\n const recipientID = event.recipient.id;\n const timestamp = event.timestamp;\n\n // Retrieve or create a session for the user\n const sessionID = findOrCreateSession(senderID);\n\n // Unwrap the content of the message\n const {is_echo, text, attachments} = event.message;\n\n if (attachments) {\n sendTextMessage(senderID, `Sorry, I can only process text for now.`)\n } else if (text) {\n // Text message recieved\n\n if (is_echo) {\n // This sender is the wit bot\n return;\n }\n\n // Forward the message to wit.ai bot if the senderID is not the bots senderID\n // This runs all actions until our bot has nothing left to do\n wit_client.runActions(\n sessionID,\n text,\n sessions[sessionID].context\n ).then((context) => {\n // The bot has done everything it has to do\n // Now it's waiting for further message to proceed.\n console.log(`Waiting for next user message with context: ${JSON.stringify(context)}`);\n\n // Update context state if needed\n sessions[sessionID].context = context;\n })\n .catch((err) => {\n console.error(`Got an error from Wit: ${err.stack || err}`);\n });\n } else {\n console.log(`recieved event ${JSON.stringify(event)}`);\n }\n\n}", "title": "" }, { "docid": "80f62184c1014c06ee31528a7e056a4e", "score": "0.67780364", "text": "async function onMessageHandler(target, context, msg, self, data) {\n/* console.log(msg);\n console.log(self);\n console.log(context);\n console.log(data); */\n\n if (self) { log.debug('ignoring message from self'); return; } // Ignore messages from the bot\n\n // Remove whitespace from chat message\n const commandName = msg.trim();\n const commandParts = commandName.split(\" \");\n\n let tmiContext = TmiContext.parse(context);\n\n log.verbose('Message received: %s[%s]: %s', tmiContext.username, target, msg);\n log.debug('Message metadata: isSelf %s, context: %s, data: %s', self, JSON.stringify(context), JSON.stringify(data));\n\n let outputText = ''; // initialize in case we use\n const cmd = commandParts[0].toLowerCase();\n\n if (cmd[0] !== '!') return // we don't have a command, don't process\n\n log.verbose('Parsing command: %s', cmd);\n log.debug('Full command parts: %s', commandParts);\n switch (cmd) {\n case '!bet':\n log.debug('processing !bet command')\n if (commandParts.length > 1) {\n gtBets(context, target, commandParts[1], tmiContext.isMod);\n }\n else {\n client.say(target, `Place your bets on GT! Just enter '!bet <number>' to bet!`);\n }\n break;\n case '!betwinner':\n log.debug('processing !betwinner command')\n if (commandParts.length > 1 && tmiContext.isMod) {\n gtWinner(target, context, commandParts[1]);\n }\n break;\n case '!betstatus':\n log.debug('processing !betstatus command')\n outputText = JSON.stringify(bets, null, 1);\n outputText = outputText.replace(/(\"{|}\")/gi, '\"');\n client.say(target, `Current bets: ${outputText}`);\n break;\n case '!wheeladd':\n log.debug('processing !wheeladd command')\n if (commandParts.length > 1) {\n updateWheel(tmiContext.username, msg, target);\n }\n break;\n case '!wheeloptions':\n log.debug('processing !wheeloptions command')\n client.say(target, `Valid categories: ${categories.join(\" , \")}`);\n break;\n case '!wheelweight':\n log.debug('processing !wheelweight command')\n printWheel(target);\n break;\n case '!wheelvotes':\n let votes= await getVoteCount(tmiContext.username, target)\n client.say(target, `@${tmiContext.username}, you have ${ votes } vote${votes!=1 ? \"s\":\"\"} for the wheel.`);\n break;\n case '!wheelclear':\n log.debug('processing !wheelclear command')\n if (commandParts.length > 1 && tmiContext.isMod) {\n clearWheel(commandParts[1], target);\n }\n break;\n case '!adduservote':\n if (commandParts.length > 1 && tmiContext.isMod) {\n incrementUserVotes(commandParts[1], target);\n }\n break;\n default:\n log.warn('unknown command: %s', cmd)\n break;\n }\n}", "title": "" }, { "docid": "ab45e02c2d74f0bf1c83ed9bb27517c6", "score": "0.6762912", "text": "function handleMessage(data) {\n const dataObj = JSON.parse(data);\n let message = '';\n // Logic for directing a proper response\n switch (dataObj.type) {\n case 'notification':\n if(dataObj.content === dataObj.username) {\n dataObj.content = `${dataObj.username} You cannot change your name to the same name.`;\n dataObj.username = 'ChattyBot';\n message = JSON.stringify(dataObj);\n break;\n } else {\n dataObj.content = `${dataObj.username} has changed their name to ${dataObj.content}`;\n dataObj.username = 'System Notification';\n dataObj.textcolor = { color: 'black' };\n message = JSON.stringify(dataObj);\n break;\n }\n case 'post':\n message = JSON.stringify(dataObj);\n break;\n default:\n message = JSON.stringify(dataObj);\n break;\n }\n broadcast(message);\n}", "title": "" }, { "docid": "e1e51ecaa632943b0460ff30489212cd", "score": "0.67518586", "text": "function onMessageHandler (target, context, msg, self) {\n\tif (self) { return; } // Ignore messages from the bot\n\tconsole.log(target);\n\tconsole.log(context);\n\tconsole.log(msg);\n\t\n\tlet user = context.username;\n\t// Remove whitespace from chat message\n\tconst commandName = msg.trim();\n\n \n\tswitch (commandName) {\n\t\tcase '!cc hurt':\n\t\t\tcurrentCommands.push(new Command(user,'hurt 10'));\n\t\t\tbreak;\n\t\tcase '!cc bomb':\n\t\t\tcurrentCommands.push(new Command(user,'bomb'));\n\t\t\tbreak;\n\t\tcase '!cc overload':\n\t\t\tcurrentCommands.push(new Command(user,'overload'));\n\t\t\tbreak;\n\t\tcase '!cc laser':\n\t\t\tcurrentCommands.push(new Command(user,'laser'));\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "a31ff9f20184c2da7a0e5319cc85741d", "score": "0.674392", "text": "function handleMessage(sender_psid, received_message) {\r\n\r\n let response\r\n let messageData = received_message.text\r\n\r\n //User input is analysed and approprite action is taken\r\n if (messageData) {\r\n switch (messageData){\r\n //When user decides to add new task, bot asks for its title\r\n case 'Add Task':\r\n response = {\r\n \"text\": `Please enter the title of your task.`\r\n }\r\n typing(sender_psid)\r\n callSendAPI(sender_psid, response)\r\n break\r\n\r\n //User picks importance of the task and bot asks about urgency\r\n case 'Important':\r\n case 'Not Important':\r\n importance = messageData\r\n response = {\r\n \"text\": `How urgent is your task?`,\r\n\r\n \"quick_replies\":[\r\n {\r\n \"content_type\":\"text\",\r\n \"title\":\"Urgent\",\r\n \"payload\":\"URGENT\"\r\n },\r\n {\r\n \"content_type\":\"text\",\r\n \"title\":\"It Could Wait\",\r\n \"payload\":\"NOT_URGENT\"\r\n }\r\n ]\r\n }\r\n callSendAPI(sender_psid, response)\r\n break\r\n\r\n //User decides how urgent the task is\r\n //Bot asks if user wants to add another task or finish\r\n case 'Urgent':\r\n case 'It Could Wait':\r\n urgency = messageData\r\n response = {\r\n\r\n \"text\": `Thanks!`,\r\n \"quick_replies\":[\r\n {\r\n \"content_type\":\"text\",\r\n \"title\":\"Add Task\",\r\n \"payload\":\"ADD_TASK\"\r\n },\r\n {\r\n \"content_type\":\"text\",\r\n \"title\":\"Done\",\r\n \"payload\":\"DONE\"\r\n }\r\n ]\r\n }\r\n callSendAPI(sender_psid, response)\r\n saveMessage(sender_psid, taskTitle, importance, urgency)\r\n break\r\n\r\n //User indicates that no new tasks will be added and output can be evaluated\r\n case 'Done':\r\n typing(sender_psid)\r\n evaluateResult(sender_psid, userDataArray)\r\n typing(sender_psid)\r\n setTimeout(() => farewell(sender_psid), 2000)\r\n break\r\n\r\n //User indicates that he wants to start a new list\r\n //User data is cleared\r\n case 'Start Over':\r\n\r\n userDataArray.length = 0\r\n response = {\r\n \"text\": `What is the title of your task?`\r\n }\r\n typing(sender_psid)\r\n callSendAPI(sender_psid, response)\r\n break\r\n\r\n //Default case catches all input that doesn't match any of the previous options\r\n //and takes that as the title of the task\r\n default:\r\n taskTitle = messageData\r\n response = {\r\n\r\n \"text\": `How important is your task?`,\r\n\r\n \"quick_replies\":[\r\n {\r\n \"content_type\":\"text\",\r\n \"title\":\"Important\",\r\n \"payload\":\"IMPORTANT\"\r\n },\r\n {\r\n \"content_type\":\"text\",\r\n \"title\":\"Not Important\",\r\n \"payload\":\"NOT_IMPORTANT\"\r\n }\r\n ]\r\n }\r\n callSendAPI(sender_psid, response)\r\n }\r\n }\r\n\r\n}", "title": "" }, { "docid": "4d6cb627295f9fe6ef3eceba59495365", "score": "0.6723783", "text": "function onMessageHandler (channel, tags, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n // Remove whitespace from chat message\n const message = msg.trim();\n\n handleMessage('twitch', tags.username, message);\n}", "title": "" }, { "docid": "a5289235d8755bc8e069ece0f8c17f1d", "score": "0.6705079", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n if (_target !== target) {\n _target = target;\n }\n \n if (!_chatters.includes(context['user-id'])) {\n _chatters.push(context['user-id']);\n }\n\n // Remove whitespace from chat message\n const command = msg.trim();\n // create an array with each word, as seperated by spaces\n const args = command.split(' ');\n // define the command name as the first word and remove it from the list of arguments\n const commandName = args.shift();\n\n // checks commandName against all defined commands\n switch(commandName) {\n case '!dice':\n const num = calculateRoll(context, args);\n client.say(target, `You rolled a ${num}`);\n break\n case '!wag':\n client.say(target, `Join Wag! for all your dog walking needs! With this link, you get $25 in credit, and you support Joe with a FAT referral bonus! https://wagwalking.app.link/uyxnZKJCKT`);\n break\n case '!rigged':\n client.say(target, 'TheIlluminati The dice are rigged. Try adding the \"cheat\" argument to your dice roll to even the odds. TheIlluminati');\n break\n case `!${_pointsName}s`:\n let numpoints = 0;\n if (context['user-id'] in _pointsFile) {\n numpoints = _pointsFile[context['user-id']]['points'];\n }\n client.say(target, `${context['display-name']} you have ${numpoints} ${_pointsName}s`);\n break\n case '!system':\n client.say(target, `You get 1 ${_pointsName} every ${_pointsInterval} minutes for watching. If you type in chat within that time you get 1 additional ${_pointsName} PogChamp`);\n break\n case '!followage':\n checkFollower(context, followage);\n break\n case '!uptime':\n getStartTime(uptime);\n break\n case '!github':\n client.say(target, `Check out code for my chat bot MrDestructoid and maybe some other stuff: ${_githubLink}`);\n break\n default:\n console.log(`* Unknown command ${commandName}`);\n }\n console.log(`* Executed ${commandName} command`);\n}", "title": "" }, { "docid": "29025acc3a84cbc999f8c09c2f6b5a71", "score": "0.6702223", "text": "_onMessage(event) {\n\n\n if (this._isMessage(event)\n && this._isChannelConversation(event)\n && this._isNotFromJokeBot(event)\n && this._isMentioningJokeBot(event)) {\n\n this._sendMessage(event);\n }\n }", "title": "" }, { "docid": "a1550ccb4a8b9062fcaf134b8e8579a5", "score": "0.6689609", "text": "function handleMessage(senderId, event) {\n const email = firstEntity(event.nlp, 'email');\n const phone_number = firstEntity(event.nlp, 'phone_number');\n const date_time = firstEntity(event.nlp, 'datetime');\n const amount_of_money = firstEntity(event.nlp, 'amount_of_money');\n const distance = firstEntity(event.nlp, 'distance');\n const quantity = firstEntity(event.nlp, 'quantity');\n const temperature = firstEntity(event.nlp, 'temperature');\n const volume = firstEntity(event.nlp, 'volume');\n const location = firstEntity(event.nlp, 'location');\n const duration = firstEntity(event.nlp, 'duration');\n const url = firstEntity(event.nlp, 'url');\n const sentiment = firstEntity(event.nlp, 'sentiment');\n const greeting = firstEntity(event.nlp, 'greeting');\n const ask_sentiment = firstEntity(event.nlp, 'ask_sentiment');\n const ask_bot = firstEntity(event.nlp, 'ask_bot');\n const buy_bot = firstEntity(event.nlp, 'buy_bot');\n const ask_products = firstEntity(event.nlp, 'ask_products');\n const messageText = event.text;\n\n if (email && email.confidence > 0.8) {\n console.log(email);\n console.log(\"Correo electrónico\");\n emailMessage(senderId, messageText);\n receipt(senderId)\n }else if (phone_number && phone_number.confidence > 0.8) {\n console.log(phone_number);\n console.log(\"Número de Telefono\");\n phoneMessage(senderId);\n }else if (date_time && date_time.confidence > 0.85) {\n console.log(date_time);\n console.log(\"Fecha y Hora\");\n datetimeMessage(senderId);\n }else if (amount_of_money && amount_of_money.confidence > 0.8) {\n console.log(amount_of_money);\n console.log(\"Dinero\");\n moneyMessage(senderId);\n }else if (distance && distance.confidence > 0.8) {\n console.log(distance);\n console.log(\"Distancia\");\n distanceMessage(senderId);\n }else if (quantity && quantity.confidence > 0.8) {\n console.log(quantity);\n console.log(\"Cantidad\");\n quantityMessage(senderId);\n }else if (temperature && temperature.confidence > 0.8) {\n console.log(temperature);\n console.log(\"Temperatura\");\n temperatureMessage(senderId);\n }else if (volume && volume.confidence > 0.8) {\n console.log(volume);\n console.log(\"Volumen\");\n volumeMessage(senderId);\n }else if (location && location.confidence > 0.8) {\n console.log(location);\n console.log(\"Ubicación\");\n locationMessage(senderId);\n }else if (duration && duration.confidence > 0.8) {\n console.log(duration);\n console.log(\"Duración\");\n durationMessage(senderId);\n }else if (url && url.confidence > 0.8) {\n console.log(url);\n console.log(\"Sitio Web\");\n urlMessage(senderId);\n }else if (sentiment && sentiment.confidence > 0.8) {\n console.log(sentiment);\n console.log(\"Sentimiento\");\n sentimentMessage(senderId);\n }\n else if (greeting && greeting.confidence > 0.68) {\n console.log(greeting);\n console.log(\"greeting\");\n //defaultMessage(senderId);\n greetingMessage(senderId);\n }\n else if (ask_sentiment && ask_sentiment.confidence > 0.68) {\n console.log(ask_sentiment);\n console.log(\"ask_sentiment\");\n feelingMessage(senderId);\n }\n else if (ask_bot && ask_bot.confidence > 0.8) {\n console.log(ask_bot);\n console.log(\"ask_bot\");\n botsMessage(senderId);\n }\n else if (buy_bot && buy_bot.confidence > 0.8) {\n console.log(buy_bot);\n console.log(\"buy_bot\");\n showBots(senderId);\n }\n else if (ask_products && ask_products.confidence > 0.8) {\n console.log(ask_products);\n console.log(\"ask_products\");\n giveContext(senderId);\n }\n //manychat\n else if (event.text.toLowerCase() == 'correo') {\n console.log(\"Correo\");\n //break;\n }else if (event.text.toLowerCase() == 'si, claro') {\n console.log(\"si\");\n //break;\n }else if (event.text.toLowerCase() == 'no, cúentame') {\n console.log(\"no\");\n //break;\n }else if (event.text.toLowerCase() == 'genial') {\n console.log(\"si\");\n //break;\n }else if (event.text.toLowerCase() == 'no, gracias') {\n console.log(\"no\");\n //break;\n }else if (event.text.toLowerCase() == 'busco información') {\n console.log(\"no\");\n //break;\n }else {\n defaultMessage(senderId);\n }\n \n if (event.text.toLowerCase() == 'llamar a fredy') {\n contactSupport(senderId);\n }else if (event.text.toLowerCase() == 'busco información') {\n showTopics(senderId);\n }else if (event.text.toLowerCase() == '¿Cuales me ofrecen?') {\n showBots(senderId);\n }else if (event.text.toLowerCase() == 'contacto') {\n contactSupport(senderId);\n }else if (event.text.toLowerCase() == 'si, claro') {\n salesMessage(senderId);\n showBots(senderId);\n }else if (event.text.toLowerCase() == 'no, cúentame') {\n botsMessage(senderId);\n salesMessage(senderId);\n showBots(senderId);\n }else if (event.text.toLowerCase() == 'genial') {\n console.log(\"correo si\");\n }else if (event.text.toLowerCase() == 'no, gracias') {\n console.log(\"correo no\");\n }else if (event.attachments) {\n handleAttachments(senderId, event);\n }\n}", "title": "" }, { "docid": "5e2eddcbb757b44a76fcff59d7ff4792", "score": "0.6688548", "text": "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\",\n senderID, recipientID, timeOfMessage);\n\n var messageId = message.mid;\n\n var messageText = message.text;\n var messageAttachments = message.attachments;\n\n if (messageText) {\n // If we receive a text message, check to see if it matches a keyword\n // and send back the example. Otherwise, just echo the text we received.\n\n\n callWitApi(messageText, function(err, data) {\n if (err) {\n console.error(err);\n } else {\n //console.log(data);\n //console.log(\"Important fields: \" + JSON.stringify(data));\n var witIntent;\n if (data.entities.intent !== undefined) {\n witIntent = data.entities.intent[0].value;\n }\n //console.log(witIntent);\n switch (witIntent) {\n case 'greeting':\n getUserInfo(senderID, function(err, data) {\n text = [\"Hello \" + data.first_name + \"!\", \"Howdy \" + data.first_name + \"!\", \"Yo \" + data.first_name + \"!\"];\n sendTextMessage(senderID, new fbTemplate.Text(text[Math.floor(Math.random() * 3) + 0]).get());\n });\n break;\n case 'company_about':\n findDetails(senderID, witIntent);\n break;\n case 'get_name':\n sendTextMessage(senderID, new fbTemplate.Text(\"My name is Sopra Steria Bot!\").get());\n break;\n case 'get_job':\n sendTextMessage(senderID, new fbTemplate.Text(\"I am here to help you with all the things related to Sopra Stera :D\").get());\n break;\n case 'get_responsibility':\n findDetails(senderID, witIntent);\n break;\n case 'company_model':\n findDetails(senderID, witIntent);\n break;\n case 'company_locations':\n findDetails(senderID, witIntent);\n break;\n case 'company_workexp':\n findDetails(senderID, witIntent);\n break;\n case 'company_markets':\n findDetails(senderID, witIntent);\n break;\n case 'company_solutions':\n findDetails(senderID, witIntent);\n break;\n case 'company_plm_cimpa':\n findDetails(senderID, witIntent);\n break;\n case 'company_life':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_aerospace':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_banking':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_defence':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_energy':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_insurance':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_homeland':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_retail':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_public_sector':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_tele':\n findDetails(senderID, witIntent);\n break;\n case 'company_market_transport':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_banking':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_bigdata':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_cloud':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_cim':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_cybersecurity':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_enterprisearch':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_erp':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_hrs':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_itassets':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_mobility':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_pms':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_smartcities':\n findDetails(senderID, witIntent);\n break;\n case 'company_offerings_socialmedia':\n findDetails(senderID, witIntent);\n break;\n case 'company_solutions_am':\n findDetails(senderID, witIntent);\n break;\n case 'company_solutions_bps':\n findDetails(senderID, witIntent);\n break;\n case 'company_solutions_consulting':\n findDetails(senderID, witIntent);\n break;\n case 'company_solutions_im':\n findDetails(senderID, witIntent);\n break;\n case 'company_solutions_sti':\n findDetails(senderID, witIntent);\n break;\n case 'company_solutions_software':\n findDetails(senderID, witIntent);\n break;\n case 'company_solutions_systemsint':\n findDetails(senderID, witIntent);\n break;\n case 'company_solutions_testing':\n findDetails(senderID, witIntent);\n break;\n case 'full_form_sopra':\n sendTextMessage(senderID, new fbTemplate.Text(\"It stands for Society Of Programmers Researchers and Analysts. Bet you didn't know that :p\").get());\n break;\n case 'thanks':\n getUserInfo(senderID, function(err, data) {\n sendTextMessage(senderID, new fbTemplate.Text(\"No need for that \" + data.first_name + \". Always there to help :D\").get());\n });\n break;\n case 'company_jobs_skill':\n processJob(senderID, data.entities);\n break;\n case 'company_jobs':\n sendTextMessage(senderID, new fbTemplate.Text(\"Please tell me the skills you posses and the years of experience you have! Or you can view all the jobs without me sorting them for you :)\").get());\n break;\n case 'company_all_jobs':\n processJob(senderID, 'all');\n break;\n default:\n sendTextMessage(senderID, new fbTemplate.Text(\"Sorry I didn't understand that! Please ask me questions related to Sopra Steria India only :)\").get());\n }\n }\n });\n } else if (messageAttachments) {\n sendTextMessage(senderID, new fbTemplate.Text(\"I can only handle text messages currently :)\").get());\n }\n}", "title": "" }, { "docid": "089337ac68fac8e214b796065e97511d", "score": "0.66863436", "text": "function botHandler(from, msg){\n // Options for processing API.AI requests\n var options = {\n sessionId: configs.SESSIONID\n };\n \n var request = apiAIClient.textRequest(msg, options);\n\n request.on('response', function(res){\n var botMsg = getBotFulfillment(res);\n ioSocket.emit('botMsg', configs.HOSTNAME, botMsg);\n actionDispatch(res);\n logger.log('info', 'Matcher message. name: ' + configs.HOSTNAME + ', msg: ' + botMsg);\n });\n\n request.on('error', function(err){\n logger.log('error', 'API.AI ERROR: ' + err);\n// ioSocket.emit('SysErr', configs.SYSTEM, \"Well this is embarassing! An error occurred within <b>RemoteMatch</b>. This is reported!\");\n });\n\n request.end();\n}", "title": "" }, { "docid": "c7ea4e1cf23db7f000e75abce24a321f", "score": "0.66812265", "text": "sendMessage() {\n window.events.emit(\"notification\", {\n title: \"Sending message...\",\n color: \"primary\"\n });\n\n // Reset checks\n this.fields.message.classList.remove(\"is-invalid\");\n\n if(this.fields.message.value === \"\") {\n this.fields.message.classList.add(\"is-invalid\");\n } else {\n Socket.send(\"game_say\", {\n id: parseInt(this.state.match.index),\n message: this.fields.message.value\n });\n\n this.fields.message.value = \"\";\n }\n }", "title": "" }, { "docid": "997a3db501d86b9049f44da0a3ebd8a2", "score": "0.6646446", "text": "function handleSendmessage(newMessage) {\n\n var receiverID = \"SUPERHERO2\";\n var receiverType = CometChat.RECEIVER_TYPE.USER;\n \n var textMessage = new CometChat.TextMessage(receiverID, newMessage, receiverType);\n \n CometChat.sendMessage(textMessage).then(\n message => {\n console.log(\"Message sent successfully:\", message);\n // Do something with message\n },\n error => {\n console.log(\"Message sending failed with error:\", error);\n // Handle any error\n }\n );\n \n }", "title": "" }, { "docid": "8a1a76299c319d9e6bb8ff81ccb0d026", "score": "0.65582305", "text": "function messageHandler (rtm, message) {\n if (/hello/.test(message.text)) {\n reply(rtm, message, 'GO CUBS')\n } else if (/howdy/.test(message.text)) {\n reply(rtm, message, 'GO TRIBE')\n }\n}", "title": "" }, { "docid": "e423d903e0a6396689efa17927c5cedb", "score": "0.6555463", "text": "function handleMessage(sender_psid, received_message) {\r\n //let message;\r\n let response;\r\n let user_message = received_message.text;\r\n console.log(user_message);\r\n switch (user_message) {\r\n case \"hi\":\r\n case \"Hi\":\r\n greetUser(sender_psid);\r\n break;\r\n default:\r\n unknownCommand(sender_psid);\r\n }\r\n\r\n}", "title": "" }, { "docid": "66d02fc24d1772bab1f27e03daf76ed6", "score": "0.6553446", "text": "function handleMessage(content, body, i, o, len) {\n console.log(body);\n // replace texts in parenthesis\n let editedBody = body\n .replace(/ *\\([^)]*\\) */g, '')\n .replace(/\\[(.*?)\\]/g, '')\n .replace(/\\*\\*\\*\\*/g, '');\n let data = {\n author: content[i].author,\n permlink: content[i].permlink,\n };\n if (data.author !== bot.config.user) {\n // get answer from dialogflow for the specific message\n getAnswer(editedBody, data, function(res, data) {\n // checks list of intends and whether it can handle the message\n if (res !== undefined && res.length > 2) {\n // create and add a comment broadcast to the main queue\n bot.execQueue.unshift(\n function(callback) {\n // basic comment broadcast\n // using catch for later permlink and long discussions handling\n bot.steem.broadcast.comment(\n bot.wif,\n data.author,\n data.permlink,\n bot.config.user,\n data.user +\n ('-re-' + data.author + data.permlink).substr(0, 200),\n '',\n res,\n '{\"app\":\"bostrot/0.1\"}',\n function(err, result) {\n if (err === null || err === undefined) {\n console.log(\n 'Dialogflow replied on ' +\n data.author +\n ' ' +\n data.permlink\n );\n } else {\n console.log(err, result);\n }\n callback('DIALOGFLOW');\n // when all messages have been handled\n if (o === len - 1) {\n replyListener();\n }\n }\n );\n },\n function(err) {}\n );\n } else {\n // use cleverbot instead\n // create and add a comment broadcast to the main queue\n bot.execQueue.unshift(\n function(callback) {\n cleverbot.write(content[i].editedBody, function(response) {\n let res = response.output;\n bot.steem.broadcast.comment(\n bot.wif,\n data.author,\n data.permlink,\n bot.config.user,\n data.user +\n ('-re-' + data.author + data.permlink).substr(0, 200),\n '',\n res,\n '{\"app\":\"bostrot/0.1\"}',\n function(err, result) {\n if (err === null || err === undefined) {\n console.log(\n 'Cleverbot replied on ' +\n data.author +\n ' ' +\n data.permlink\n );\n } else {\n console.log(err, result);\n }\n callback('CLEVERBOT');\n // when all messages have been handled\n if (o === len - 1) {\n replyListener();\n }\n }\n );\n });\n },\n function(err) {}\n );\n }\n });\n }\n }", "title": "" }, { "docid": "95aa48ceb72189693eb583571c36bdff", "score": "0.65482175", "text": "function onMessageHandler (target, context, msg, self) {\r\n if (self) { return; } // Ignore messages from the bot\r\n\r\n // Remove whitespace from chat message\r\n const commandName = msg.trim();\r\n\r\n // If the command is known, let's execute it\r\n if (commandName === '!dice') {\r\n const num = rollDice();\r\n client.say(target, `You rolled a ${num}`);\r\n console.log(`* Executed ${commandName} command`);\r\n }\r\n else if (commandName === '!hello'){\r\n client.say(target, `Hello, ${context.username}`);\r\n console.log(context);\r\n console.log(msg);\r\n }\r\n else if (commandName.includes('!add')){\r\n if (context.badges.broadcaster === '1'){\r\n let indexOfFirstSpace = msg.indexOf(' ');\r\n let newCommandName = msg.slice(indexOfFirstSpace + 1, msg.indexOf(' ', indexOfFirstSpace + 1));\r\n let newCommandText = msg.slice(msg.indexOf(' ', indexOfFirstSpace + 1) + 1);\r\n\r\n console.log('The name of the new command: ' + newCommandName)\r\n console.log('The text of the new command: ' + newCommandText)\r\n fs.appendFile(`${process.env.CHANNEL_NAME}Commands.txt`, `${newCommandName}|||${newCommandText}|||`, function (err) {\r\n if (err) throw err;\r\n console.log('Command Saved!');\r\n let newCommand = {command: `!${newCommandName}`, text: newCommandText};\r\n customChannelCommands.push(newCommand);\r\n });\r\n }\r\n }\r\n else {\r\n let commandDone = false;\r\n customChannelCommands.forEach(command => {\r\n if (commandName === command.command){\r\n client.say(target, command.text);\r\n commandDone = true;\r\n }\r\n });\r\n if(commandDone === false){\r\n console.log('Unknown Command')\r\n }\r\n }\r\n}", "title": "" }, { "docid": "9799dbceb5972b3d6075ab2a572b093c", "score": "0.6547701", "text": "handleMessage() {\n let event = this.webhookEvent;\n\n let responses;\n\n try {\n if (event.message) {\n let message = event.message;\n\n if (message.quick_reply) {\n responses = this.handleQuickReply();\n } else if (message.attachments) {\n responses = this.handleAttachmentMessage();\n } else if (message.text) {\n responses = this.handleTextMessage();\n }\n } else if (event.postback) {\n responses = this.handlePostback();\n } else if (event.referral) {\n responses = this.handleReferral();\n }\n } catch (error) {\n console.error(error);\n responses = {\n text: `An error has occured: '${error}'. We have been notified and \\\n will fix the issue shortly!`\n };\n }\n\n if (Array.isArray(responses)) {\n let delay = 0;\n for (let response of responses) {\n this.sendMessage(response, delay * 2000);\n delay++;\n }\n } else {\n this.sendMessage(responses);\n }\n }", "title": "" }, { "docid": "f72141a354319239558fa552ffb0287f", "score": "0.65337884", "text": "function onMessageHandler(target, context, msg, self) {\n if (self) {\n return;\n } // Ignore messages from the bot\n\n // // DEBUG\n // console.log('target')\n // console.log(target)\n // console.log('context')\n // console.log(context)\n // console.log('msg')\n // console.log(msg)\n\n // Remove whitespace from chat message\n const comment = msg.trim();\n\n // If the command is known, let's execute it\n if (comment.match(/^!dice/)) {\n console.debug(\"command was triggered: dice\");\n const message = dice.rollDice(comment);\n client.say(target, message);\n } else if (config.COMMENT_REMEMVER_AVAILABLE) {\n const regexpRemember = new RegExp(\n `^!(${config.COMMENT_REMEMVER_COMMAND}U?)`\n );\n const regexpForget = new RegExp(`^!(${config.COMMENT_FORGET_COMMAND}U?)`);\n const regexpUser = new RegExp(\n `^!(${config.COMMENT_REMEMVER_COMMAND}U|${config.COMMENT_FORGET_COMMAND}U)`\n );\n const convertType = comment.match(regexpUser) ? \"user\" : \"comment\";\n\n if (comment.match(regexpRemember)) {\n console.debug(`command was triggered: remember ${convertType}`);\n updateConvertList.remember(msg, target, client);\n }\n if (comment.match(regexpForget)) {\n console.debug(`command was triggered: forget ${convertType}`);\n updateConvertList.forget(msg, target, client);\n }\n } else if (comment.match(/^[!/]/)) {\n console.log(`* Executed ${comment} command`);\n }\n\n let displayName = modifiedUsername(context.username);\n console.log(`${displayName}: ${msg}`);\n let segment = modifiedMessage(msg);\n let discordSegment, ttsSegment;\n\n if (config.READ_USERNAME) {\n discordSegment = \"`\" + displayName + \"`: \" + escapeMassMension(msg);\n ttsSegment = displayName + \": \" + escapeTtsErrorString(segment);\n } else {\n discordSegment = escapeMassMension(msg);\n ttsSegment = escapeTtsErrorString(segment);\n }\n\n // // debug\n // console.log(\"displayName && segment && !isIgnored\")\n // console.log(!!displayName)\n // console.log(!!segment)\n // console.log(!isIgnoredMessage(msg))\n if (displayName && !isIgnoredMessage(msg)) {\n sendToDiscord(discordSegment);\n // TTS\n sendToTts(ttsSegment);\n } else {\n // console.debug(`ignored: ${msg}`);\n }\n}", "title": "" }, { "docid": "9a428eb99e3afc86eed47a9c246fc609", "score": "0.65251", "text": "function handleMessage(message) {\r\n if (message.includes(' growth')) {\r\n goToGrowth();\r\n } else if (message.includes(' help')) {\r\n getHelp();\r\n } else if (message.includes(' yomomma')){\r\n yomommajoke();\r\n } else if (message.includes(' random')) {\r\n randomjoke();\r\n }\r\n}", "title": "" }, { "docid": "9eedc29a73a2464934e9911b7be25de5", "score": "0.6515769", "text": "function onMessageHandler(target, context, msg, self) {\n if (self) { return } // Ignore messagges from the bot\n\n // This isn't a command since it has no prefix:\n if (msg.substr(0, 1) !== commandPrefix) {\n if (msg.includes('house') || msg.includes('clean')) {\n msg = \"Did someone say a CLEAN HOUSE!?!\"\n sendMessage(target, context, msg)\n } else if (msg.includes('vote')){\n msg = \"You can vote for the team you think will win by using the \\\"team! \\\" command followed by the team name at anytime!\"\n sendMessage(target, context, msg)\n }\n console.log(`[${target} (${context['message-type']})] ${context.username}: ${msg}`)\n return\n }\n\n // Split the message into individual words\n const parse = msg.slice(1).split(' ')\n // The command name is the first (0th) one:\n const commandName = parse[0]\n // The rest (if any) are the parameters\n const params = parse.splice(1)\n\n // If the command is known, execute it\n if (commandName in knownCommands) {\n // Retrieve the function by its name\n const command = knownCommands[commandName]\n // Then call the command with parameters\n command(target, context, params)\n console.log(` Executed ${commandName} command for ${context.username}, params were ${params}`)\n } else {\n console.log(`* Unknown command ${commandName} from ${context.username}`)\n }\n}", "title": "" }, { "docid": "8cf0ea5f41f49f8146a59a497a5351de", "score": "0.6511514", "text": "function onMessageHandler(target, context, msg, self) {\n if (self) {\n return;\n } // Ignore messages from the bot\n const date = new Date();\n const now = date.getHours() * 60 + date.getMinutes();\n if (startTime > now || now > endTime) {\n return;\n } // markets not open\n // process message\n const message = msg.trim();\n orderQLock.acquire(lockKey, (done) => {\n messageProcessing_1.processMessage(message, context, orderQ);\n done();\n });\n}", "title": "" }, { "docid": "591cde14bb779dba4cbc4f181d60bd00", "score": "0.65003866", "text": "function onMessageHandler(target, context, msg, self) {\r\n if (self) {\r\n return;\r\n } // Ignore messages from the bot\r\n}", "title": "" }, { "docid": "47bdf86ad474228233314d3fe14c462e", "score": "0.6491981", "text": "function handleEvent(event) {\n const type = event.type;\n if (!isChatting || type === 'postback') {\n switch (type) {\n case 'message': {\n if (event.message.text === '開始查詢' || event.message.text === '回主選單' || event.message.text === '點錯了') {\n client.replyMessage(event.replyToken, searchBegin);\n }\n break;\n }\n case 'postback': {\n const action = event.postback.data;\n if (action) {\n switch (action) {\n case 'latestProduct': {\n client.replyMessage(event.replyToken, latestProduct).then(() => {\n console.log('Latest Products Sent!');\n }).catch((err) => {\n console.log(err.response.data);\n });\n break;\n }\n case 'latestDiscount': {\n client.replyMessage(event.replyToken, latestDiscount).then(() => {\n console.log('Latest Discount Sent!');\n }).catch((err) => {\n console.log(err.response.data);\n });\n break;\n }\n case 'customerService': {\n client.replyMessage(event.replyToken, customerService).then(() => {\n isChatting = true;\n console.log('Customer Service Called!');\n }).catch((err) => {\n console.log(err.response.data);\n });\n break;\n }\n }\n }\n break;\n }\n }\n } else if (isChatting) {\n console.log(event.message.type);\n if (event.message.text === '開始查詢') {\n isChatting = false;\n client.replyMessage(event.replyToken, searchBegin).then(() => {\n console.log('Search Bot Called!');\n }).catch((err) => {\n console.log(err.response.data);\n });\n \n } else if (event.message.type === 'text') {\n console.log(event);\n isChatting = false;\n client.replyMessage(event.replyToken, {\n type: \"text\",\n text: `你好 ${event.message.text},請問你想查詢什麼?`,\n quickReply: {\n items: [\n {\n type: \"action\",\n action: {\n type: \"message\",\n label: \"會員積分\",\n text: \"會員積分\"\n }\n },\n {\n type: \"action\",\n action: {\n type: \"message\",\n label: \"退/換貨\",\n text: \"退/換貨\"\n }\n },\n {\n type: \"action\",\n action: {\n type: \"message\",\n label: \"點錯了\",\n text: \"點錯了\"\n }\n }\n ]\n }\n }).then(() => {\n console.log(isChatting);\n }).catch((err) => {\n console.log(err.response.data);\n });\n } else {\n client.replyMessage(event.replyToken, {type: 'sticker', packageId: \"11537\", stickerId: \"52002744\"})\n .then(() => {\n console.log(isChatting);\n }).catch((err) => {\n console.log(err.response.data);\n });\n }\n }\n}", "title": "" }, { "docid": "a997adc463c8a8a1cca9030d89b70fda", "score": "0.6480079", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n // Remove whitespace from chat message and tokenize\n msg_parts = msg.trim().split(\" \")\n const command = msg_parts[0];\n const argument = msg_parts[1];\n const argument_2 = msg_parts[2];\n\n if (command[0] == '!') {\n\n console.log(`Recieved a command:`)\n console.log(` target: ${target}`)\n console.log(` msg: ${msg}`)\n\n // If the command is known, let's execute it\n switch(command) {\n case \"!commands\":\n return_msg = \"Available commands: !bot, !social(s), !account(s), !psn, !epic, !activision, !pyramid, !pyrmd, !cc, !discord, !merch, !controller, !lurk, !unlurk, !brb, !joke, !blind, !safeword, !queue, !join\"\n sendMessage(target, return_msg, command)\n break;\n case \"!bot\":\n return_msg = \"Teaja wrote me himself (based on a tutorial code). https://github.com/thomas-j-sell/twitch-chatbot\"\n sendMessage(target, return_msg, command)\n break;\n case \"!socials\": // fall through\n case \"!social\":\n sendMessage(target, socials(), command)\n break;\n case \"!accounts\":\n case \"!account\":\n return_msg = \"PSN: teaja, Epic: dredgen_teaja, Activision: teaja#7667376\"\n sendMessage(target, return_msg, command)\n break;\n case \"!psn\":\n sendMessage(target, \"PSN: teaja\", command)\n break;\n case \"!epic\":\n sendMessage(target, \"Epic: dredgen_teaja\", command)\n break;\n case \"!activision\":\n sendMessage(target, \"Activision: teaja#7667376\", command)\n break;\n case \"!pyramid\":\n case \"!pyrmd\":\n return_msg = \"You can connect with and support Team Pyramid by: joining the discord https://discord.gg/FwMhsgp -- using the Epic creator code: pyrmd -- buying merch: https://pyrmd-design.myshopify.com/ -- or most importanly, just hanging out in stream.\"\n sendMessage(target, return_msg, command)\n break;\n case \"!cc\":\n sendMessage(target, \"You can support Team Pyramid by using the Epic Creator Code: pyrmd\")\n break;\n case \"!discord\":\n sendMessage(target, \"Come hang out with Teaja and the other members of Team Pyramid in our Discord! https://discord.gg/FwMhsgp\")\n break;\n case \"!merch\":\n sendMessage(target, \"Check out the Team Pyramid merch! https://pyrmd-design.myshopify.com/\")\n break;\n case \"!controller\":\n sendMessage(target, \"I use a Scuf Impact: https://scufgaming.com/playstation-impact-controller\")\n break;\n case \"!lurk\":\n return_msg = `${getLurkMessage()} Thanks for the lurk ${context['display-name']} !`\n sendMessage(target, return_msg, command)\n break;\n case \"!unlurk\":\n sendMessage(target, `Welcome back ${context['display-name']}.`, command)\n break;\n case \"!brb\":\n return_msg = \"I have to step away for a moment, but I'll be right back. Would you kindly stick around?\"\n sendMessage(target, return_msg, command)\n break;\n case \"!joke\":\n sendMessage(target, getJoke(), command)\n break;\n case \"!blind\":\n switch(argument) {\n case \"on\":\n if (isMod(context)) {\n isBlind = true\n sendMessage(target, \"Blind mode is now on.\", command)\n } else {\n return_msg = `Sorry ${context['display-name']}, only mods can do that.`\n sendMessage(target, return_msg, command)\n }\n break;\n case \"off\":\n if (isMod(context)) {\n isBlind = false\n sendMessage(target, \"Blind mode is now off.\", command)\n } else {\n return_msg = `Sorry ${context['display-name']}, only mods can do that.`\n sendMessage(target, return_msg, command)\n }\n break;\n default:\n if (isBlind) {\n return_msg = `This is a blind play-through. Please do not give any hints, tips, or criticisms unless I explicitly ask for them using my safeword: ${safeword}.`\n sendMessage(target, return_msg, command)\n } else {\n return_msg = \"This is not a blind playthrough. Tips, hints, and other constructive criticisms are welcome.\"\n sendMessage(target, return_msg, command)\n }\n break;\n }\n break;\n case \"!safeword\" || \"!safe word\":\n sendMessage(target, `My safeword is ${safeword}.`, command)\n break;\n case \"!queue\":\n switch(argument) {\n case \"open\":\n if (isMod(context)) {\n queueIsOpen = true;\n return_msg = \"The queue is now open. You can join with !join.\"\n sendMessage(target, return_msg, command)\n } else {\n return_msg = `Sorry ${context['display-name']}, only mods can do that.`\n sendMessage(target, return_msg, command)\n }\n break;\n case \"close\":\n if (isMod(context)) {\n queueIsOpen = false;\n return_msg = \"The queue is now closed.\"\n sendMessage(target, return_msg, command)\n } else {\n return_msg = `Sorry ${context['display-name']}, only mods can do that.`\n sendMessage(target, return_msg, command)\n }\n break;\n case \"next\":\n if (isMod(context)) {\n if (queue.length > 0) {\n let next = queue.shift()\n return_msg = `${next} is up next.`\n } else {\n return_msg = \"Queue is empty so there's no one to pop.\"\n }\n sendMessage(target, return_msg, command)\n } else {\n return_msg = `Sorry ${context['display-name']}, only mods can do that.`\n sendMessage(target, return_msg, command)\n }\n break;\n case \"rules\":\n return_msg = \"Queue is FIFO (first in first out). Place in the queue is good for two games, but I might add a third if one gets cut really short.\"\n sendMessage(target, return_msg, command)\n break;\n default:\n if (queue.length == 0) {\n if (queueIsOpen) {\n return_msg = \"Queue is currently empty. You can join with !join.\"\n } else {\n return_msg = \"Queue is currently empty. You cannot currently join.\"\n }\n } else {\n return_msg = queue.toString()\n }\n sendMessage(target, return_msg, command)\n }\n break;\n case \"!join\":\n if (queueIsOpen) {\n if (queue.includes(context['display-name'])) {\n let place = queue.indexOf(context['display-name']) + 1\n return_msg = `You are already in the queue ${context['display-name']}. Your position in line is ${place}.`\n } else {\n queue.push(context['display-name'])\n let place = queue.indexOf(context['display-name']) + 1\n return_msg = `You have been added to the queue ${context['display-name']}. Your position in line is ${place}.`\n }\n sendMessage(target, return_msg, command)\n } else {\n return_msg = `Sorry ${context['display-name']}, the queue is closed.`\n sendMessage(target, return_msg, command)\n }\n break;\n default:\n console.log(`Unknown command ${command}`)\n }\n } else {\n // console.log('not a command')\n // do nothing for regular messages\n }\n}", "title": "" }, { "docid": "0e14c7f473fba90f67301a1ba5a0bfe6", "score": "0.6478845", "text": "function onMessageHandler(target, context, msg, self) {\n if (self) {\n return;\n } // Ignore messages from the bot\n\n // remove whitespace, remove !, remove $, make uppercase\n const ticker = msg\n .trim()\n .replace(\"!\", \"\")\n .replace(\"$\", \"\")\n .toUpperCase();\n\n // if valid ticker, push vote data into votesArr\n if (validTickerCheck(ticker)) {\n votesArr.push({\n \"user_id\": context[\"user-id\"],\n \"username\": context.username,\n \"ticker\": ticker,\n \"timestamp\": parseInt(context[\"tmi-sent-ts\"])\n });\n }\n}", "title": "" }, { "docid": "4bb5f9a93c6c7522302791e4334583cf", "score": "0.64610255", "text": "function respond() {\n /* get the message data from the raw HTTP request */\n var message = JSON.parse(this.req.chunks[0]);\n\n /* If the message was sent by the bot, don't do anything (don't even log it) */\n if (String(message.sender_id) == process.env.MY_ID) {\n return;\n }\n\n /* Log the name and sender_id of the message */\n console.log(`We have a message from ${message.name}. (sender ID = ${message.sender_id}): ${message.text}`);\n if (!(message.name in known_sender_ids)) {\n known_sender_ids[message.name] = message.sender_id;\n }\n\n /* Send the message through each \"require\"d module's \"listener\" callback */\n people_listeners.map(person => person.listener(message));\n\n /* We don't send an HTTP response to the request at all, as our listener callbacks will handle responses. */\n this.res.end();\n}", "title": "" }, { "docid": "cd73fbe21df6a2f7920d6d3a43650320", "score": "0.6452237", "text": "function onMessageHandler(target, user, msg, self) {\n if (self || !msg.startsWith(prefix)) { return; } // Ignore messages from the bot and messages not starting with the prefix\n //console.log(user)\n const args = msg.slice(prefix.length).split(/ +/);\n // let argsClone = { ...args };\n const command = args.shift().toLowerCase();\n //const emoteArray = msg.slice(prefix.lenght).shift(/ +/);\n const emote = msg;\n\n let deathCount;\n // Remove whitespace from chat message\n //const command = msg.trim().toLowerCase();\n //console.log(args);\n\n // If the command is known, let's execute it\n switch (command) {\n case 'death':\n if (user['display-name'] == 'Mcloudi' || user['display-name'] == 'zillux' || user['display-name'] == 'Butterwhales' || user['display-name'] == 'gabethunder3') {\n fs.readFile('./deaths.txt', function (err, data) {\n if (err) { throw err } //reads file\n if (data.length != 0) deathCount = parseInt(data);\n if (isNaN(data)) deathCount = 0;\n switch (args[0]) {\n case '+':\n deathCount += parseInt(args[1]);\n client.say(target, `Added ${args[1]} to the death count`);\n break;\n case '-':\n deathCount -= parseInt(args[1]);\n client.say(target, `Subtracted ${args[1]} from the death count`);\n break;\n case 'set':\n deathCount = parseInt(args[1]);\n client.say(target, `Set the death count to ${args[1]}`);\n break;\n default:\n deathCount += parseInt(1);\n client.say(target, `Added 1 to the death count`);\n break\n }\n fs.writeFile(\"./deaths.txt\", deathCount, function (err) {\n if (err) return console.log(err);\n });\n });\n }\n break;\n case 'deaths':\n case 'deathcount':\n fs.readFile('./deaths.txt', function (err, data) {\n if (err) { throw err } //reads file\n if (data.length != 0) deathCount = data;\n client.say(target, `Mcloudi has died ${deathCount} times`);\n fs.writeFile(\"./deaths.txt\", deathCount, function (err) {\n if (err) return console.log(err);\n });\n });\n break;\n case 'ping':\n var a = Math.floor(Math.random() * 10) + 1;\n var b = Math.floor(Math.random() * 10) + 1;\n var op = [\"*\", \"+\", \"/\", \"-\"][Math.floor(Math.random() * 4)];\n client.say(target, `How much is ${a} ${op} ${b} ? ${user.username}`);\n break;\n case 'loop':\n if (loopInterval) { // Check if set\n console.log('stop loop');\n client.say(target, 'Loop Ended');\n clearInterval(loopInterval); // delete Timer\n loopInterval = false;\n } else {\n console.log('start loop');\n client.say(target, 'Loop Started');\n loopInterval = setInterval(function () {\n console.log('Discord Shoutout');\n shill();\n }, 1800000); // 60000ms = 60s = 1min\n }\n break;\n \n /* - The entirety of the !dicksize command in all it's glory! Bow before it!\n case 'size':\n case 'dicksize': // Sizes up Chris'! Magnum Dong (Or not)\n var num = dickRand();\n switch (true) {\n case num <= 1:\n client.say(target, `Mcloudi has a microscopic ${num} inch weiner`);\n break;\n case num <= 2:\n client.say(target, `Mcloudi has a tiny ${num} inch weiner`);\n break;\n case num <= 4:\n client.say(target, `Mcloudi has a small ${num} inch weiner`);\n break;\n case num <= 6:\n client.say(target, `Mcloudi has an average ${num} inch dick`);\n break;\n case num <= 8:\n client.say(target, `Mcloudi has a sizeable ${num} inch dick`);\n break;\n case num <= 10:\n client.say(target, `Mcloudi has a hefty ${num} inch cock`);\n break;\n case num <= 15:\n client.say(target, `Mcloudi has a giant ${num} inch cock`);\n break;\n case num <= 20:\n client.say(target, `Mcloudi has a huge ${num} inch cock`);\n break;\n case num <= 30:\n client.say(target, `Mcloudi has an enormous ${num} inch cock`);\n break;\n case num <= 38:\n client.say(target, `Mcloudi has a massive ${num} inch dong`);\n break;\n case num = 39:\n client.say(target, `Mcloudi has a colossal ${num} inch schlong`);\n break;\n case num = 40:\n client.say(target, `Mcloudi is packing a monstrous ${num} inch Schlong`);\n break;\n default:\n console.log(`* Executed default ${command\n } command num = ${num}`);\n break;\n }\n console.log(`* Executed ${command} command`);\n break;\n \n */\n \n \n case 'mcloud2dab':\n case 'dab': // Dabs the specified amount of times\n let num1 = randomNum(10);\n var dabs = (``);\n var i;\n for (i = 0; i < num1; i++) {\n dabs += 'mcloud2Dab ';\n }\n client.say(target, dabs);\n console.log(`* Executed ${command\n } command`);\n break;\n case 'coggers':\n case 'hackermans':\n case 'mcloud2triggered':\n case 'catjam': case 'clap': case 'pepega': case 'sumsmash': case 'tridance': case 'cloudpet': case 'gachibass': case 'kissahomie5': case 'kkool': case 'modcheck': case 'peped':\n case 'pepejam': case 'pepepls': case 'ppoverheat': case 'ricardoflick': case 'popcat': case 'pepegagun':\n case '4head'://FFZ \n case 'feelsdankman': case 'forsencd': case 'ayaya': case 'handsup': case 'hypers': case 'kkonaw': case 'lulw':\n case 'pausechamp': case 'peepopog': case 'pagchomp': case 'okaychamp': case 'monkaw': case 'pog': case 'pogu': case 'sadge': case 'weirdchamp': case 'widehard': case 'widehardo': case 'peeposad': case 'peepopogyoupoo':\n case 'widepeepohappy'://:case ':tf:'\n case 'widepeeposad': case 'd:': case 'duckerz': case 'angelthump': case 'ariw': case 'baconeffect': case 'basedgod': case 'brobalt': case 'bttvnice': case 'burself': case 'buttersauce': case 'candianrage': case 'cigrip': case 'concerndoge': case 'cruw': case 'cvhazmat': case 'cvl': case 'cvmask': case 'cvr': case 'datsauce':\n case 'fcreep': case 'feelsamazingman': case 'feelsbadman': case 'feelsbirthdayman': case 'feelsgoodman': case 'feelspumpkinman': case 'firespeed': case 'fishmoley': case 'foreveralone': case 'gaben': case 'hahaa': case 'hailhelix': case 'herbperve': case 'hhhehehe': case 'hhydro': case 'iamsocal': case 'idog': case 'kappacool': case 'karappa': case 'kkona':\n case 'lul': case 'm&mjc': case 'minijulia': case 'monkas': case 'nam': case 'notsquishy': case 'pedobear': case 'poledoge': case 'rarepepe': case 'rebeccablack': case 'ronsmug': case 'rstrike': case 'saltycorn': case 'savagejerky': case 'shoopdawhoop': case 'sosgame': case 'sourpls': case 'sqshy': case 'suchfraud':\n case 'swedswag': case 'taxibro': case 'tehpolecat': case 'topham': case 'twat': case 'vapenation': case 'vislaud': case 'watchusay': case 'wowee': case 'wubtf': case 'yetiz': case 'zappa':\n case '<3':// Regular twitch\n let num2 = randomNum(10);\n var cogs = (``);\n var i;\n for (i = 0; i < num2; i++) {\n cogs += emote + ' ';\n }\n client.say(target, cogs);\n console.log(`* Executed ${command\n } command`);\n break;\n case 'prime'://Automatically sends you to the command below \n case 'twitchprime':\n case 'tp': // Asks if any Twitch Primers are chillin'\n client.say(target, `Any Primers in the chat?`);\n console.log(`* Executed ${command\n } command`);\n break;\n // case 'twitter':\n // client.say(target, `Here is mcloudi's twitter: https://twitter.com/McloudI_?s=20 `);\n // break;\n // case 'streamraider':\n //case 'streamraiders':\n // client.say(target, `Join us in battle! https://www.streamraiders.com/t/mcloudi `);\n // break;\n case 'help'://Automatically sends you to the !commands output\n case 'commands': // Informs the issuer of *most* possible commands with the bot\n /*\n List of all possible commands with the bot (Including those not shown with the !help command )\n dicksize (disabled), dab, prime, discord, wap, sub (Disbaled), activate, f, about, \n */\n client.say(target, `List of current commands: !prime, !youtube, !discord, !wap, !coggers, !about, !onlyfans, !activate, !bttvemotes, !ffzemotes, !magic`);\n console.log(`* Executed ${command\n } command`);\n break;\n case 'discord': // Sends a link to the public stream discord\n client.say(target, `https://discord.gg/eaJt8DtQBV`);\n console.log(`* Executed ${command\n } command`);\n break;\n case 'website':\n client.say(target, `https://www.mcloudi.com`);\n console.log(`* Executed ${command\n } command`);\n break;\n case 'youtube':\n client.say(target, `https://bit.ly/3uPkjTE`);\n console.log(`* Executed ${command\n } command`);\n break;\n case 'wap': // Grabs a bucket and a mop! What'd you think it'd do?\n switch (randomNum(6)) {\n case 1:\n client.say(target, `Get a bucket and a mop!`);\n break;\n case 2:\n client.say(target, `Put on your life jacket because we're going swimming!`);\n break;\n case 3:\n client.say(target, `Warning: slippery when wet!`);\n break;\n case 4:\n client.say(target, `Don't forget your snorkel!`);\n break;\n case 5:\n client.say(target, `This pool is always open!`);\n break;\n case 6:\n client.say(target, `moist`);\n break;\n default:\n console.log(`* Executed default ${command\n } command`);\n break;\n }\n\n console.log(`* Executed ${command\n } command`);\n break;\n \n \n /* - The entirety of the Sub Command - Disabled until he can get subs\n case 'subscribe':\n case 'sub': // Generates a link to the subscribe button\n client.say(target, `https://subs.twitch.tv/mcloudi`);\n console.log(`* Executed ${command\n } command`);\n break;\n */\n \n \n case 'f': // The bot pays it's respects\n client.say(target, `F`);\n console.log(`* Executed ${command\n } command`);\n break;\n case 'window':\n case 'activate':\n case 'windows': // Reminds Chris he needs to activate windows\n client.say(target, `Activate Windows`);\n console.log(`* Executed ${command\n } command`);\n break\n case 'about': // Gives information about the bot and thanks the creators\n client.say(target, 'Coded by: @gabethunder3 , @NubsiePie , and @Butterwhales. Thanks to @BurningNomad for humoring our B.S.!')\n console.log(`* Exectued ${command\n } command`);\n break;\n case 'bttv':\n case 'bttvemotes': // Lists all currently enabled Better Twitch TV emotes\n client.say(target, 'The current enabled bttv emotes are catJAM , Clap , COGGERS , gachiBASS , HACKERMANS , Kissahomie5 , KKool , modCheck , pepeD , pepeJAM , PepePls , ppOverHeat , ricardoFlick , sumSmash , TriDance .')\n console.log(`* Exectued ${command\n } command`);\n break;\n case 'ffz':\n case 'ffzemotes': // Lists all currently enabled FrankerZ emotes\n client.say(target, 'The current enabled FrankerZ emotes are 4HEad , AYAYA , FeelsDankMan , forsenCD , HandsUp , HYPERS , KKonaW , LULW , monkaW , OkayChamp , PagChomp , PauseChamp , peepoPog , peepoPogYouPoo , peepoSad , Pepega , Pog , PogU , Sadge , WeirdChamp , WideHard , WideHardo , widepeepoHappy , widepeepoSad .')\n console.log(`* Exectued ${command\n } command`);\n break;\n case 'thicc':\n case 'thiccc': // Gives information about the bot and thanks the creators\n client.say(target, 'Damn boy he thicc. BurningFlame');\n console.log(`* Exectued ${command\n } command`);\n break;\n case 'onlyfans':\n switch (randomNum(2)) {\n case 1:\n client.say(target, 'BurningFlame https://bit.ly/3uPkjTE BurningFlame');\n console.log(`* Exectued ${command\n } command`);\n break;\n case 2:\n client.say(target, 'You wish. LUL');\n console.log(`* Exectued ${command\n } command`);\n break;\n }\n console.log(`* Exectued ${command\n } command`);\n break;\n case 'man': // Gives information about the bot and thanks the creators\n client.say(target, 'FeelsBadMan')\n console.log(`* Exectued ${command\n } command`);\n break;\n case 'magic': // lists all magic spells\n client.say(target, 'List of all magic spells: !lightningbolt, !firebolt, and !icebolt');\n console.log(`* Exectued ${command\n } command`);\n break;\n case 'icebolt':\n case 'firebolt':\n case 'lightningbolt':\n switch (randomNum(2)) {\n case 1:\n client.say(target, \"It's super effective!\");\n console.log(`* Exectued ${command\n } command`);\n break;\n case 2:\n client.say(target, \"It's not very effective!\");\n console.log(`* Exectued ${command\n } command`);\n break;\n }\n break;\n case 'server':\n client.say(target, \"This server is a private paper spigot server on a minecraft earth map\");\n console.log(`* Exectued ${command} command`);\n break;\n /*case '!gamble':\n switch(randomNum(6)){\n case 3:\n client.say(target, `mcloudibot struck ${context.username}`)\n client.timeout(target, context.username , 5, 'See you in 5s');\n console.log(`* Exectued ${command\n } command`);\n break;\n case 4:\n client.say(target, `mcloudibot headshot ${context.username}`)\n client.timeout(target, context.username , 30, 'See you in 30s');\n console.log(`* Exectued ${command\n } command`);\n break;\n default:\n client.say(target, `mcloudibot missed ${context.username}`)\n console.log(`* Exectued ${command\n } command`);\n break;\n }*/\n default:\n console.log(`* Unknown command ${command\n }`);\n break;\n }\n\n if (msg.includes('bigfollows*com') || msg.includes('https://clck.ru/R9gQV')) {\n //client.say(target, `mcloudibot headshot ${context.username}`)\n client.ban(target, user.username, 'Viewbot promotion ');\n console.log(`* Removed viewbot promotion`);\n }\n}", "title": "" }, { "docid": "5ac2ed2e23aef3bf76c3d48266bb4976", "score": "0.64508504", "text": "function onMessageHandler(channel, tags, message, self) {\n let message1;\n let postMsg = true\n\n const {\n 'user-name': username,\n 'display-name': displayName,\n 'user-id': userID,\n subscriber: sub,\n emotes: emote,\n } = tags;\n\n const commandName = [message.trim(), channel.substr(1)]\n\n pool.query('select response from commands where command_name=$1 and user_name=$2', commandName, (err, res) => {\n //console.log(commandName)\n //console.log(res)\n if (res.rowCount != 0) {\n client.say(channel, res.rows[0].response)\n }\n })\n\n console.log(commandName[1]);\n\n pool.query('select word, value from word_filter where channel=$1', [commandName[1]], (err, res) =>{\n if (err) {\n console.log(err)\n } else {\n let row = 0 \n let msgVal = 0\n console.log(res.rowCount)\n for ( i=0;i<parseInt(res.rowCount);i++){\n console.log(res.rows[row].word);\n if ( message.indexOf(res.rows[row].word) !== -1 ) {\n //console.log(res.rows[row].value)\n msgVal = msgVal + parseInt(res.rows[row].value);\n //console.log(msgVal)\n } else {\n //\n }\n console.log(msgVal)\n console.log(row)\n row++\n }\n if (msgVal >= 6){\n console.log('run for the hills! bad message!')\n postMsg = false;\n\n }\n //console.log(res)\n }\n })\n \n if (commandName === '!multimsg') {\n if ((displayName === 'Charja113') || (displayName === 'Samma_FTW')) {\n if (multi === 'off') {\n multi = 'on'\n console.log('multi link turned on')\n client.join('samma_ftw')\n //client.say('samma_ftw', 'multi link message: on')\n client.say('charja113', 'multi link message: on')\n multiIntervalc = setInterval(function () {\n client.say('charja113', \"Want to get in the action from both sides? The Multi twitch link to watch both streams is http://multitwitch.tv/charja113/samma_ftw\")\n }, 500000);\n //multiIntervalm = setInterval(function(){\n // client.say('samma_ftw', \"Want to get in the action from both sides? The Multi twitch link to watch both streams is http://multitwitch.tv/charja113/samma_ftw\")\n //}, 500000);\n return multi\n } else {\n clearInterval(multiIntervalc);\n //clearInterval(multiIntervalm);\n client.part('samma_ftw')\n //client.say('samma_ftw', 'multi link message: off')\n client.say('charja113', 'multi link message: off')\n multi = 'off'\n console.log('multi link turned off')\n return multi\n }\n }\n }\n\n if (commandName === '!multitwitch') {\n client.say(channel, \"Want to get in the action from both sides? The Multi twitch link to watch both streams is http://multitwitch.tv/charja113/samma_ftw\")\n }\n if ((displayName === 'StreamElements') || (displayName === 'PretzelRocks') || (displayName === 'Charja113') || (displayName === 'Samma_FTW')) {\n console.log('botmessage or streamer');\n return;\n }\n\n if (emote !== null) {\n message1 = message;\n const keyCount = Object.keys(emote).length;\n Object.keys(emote).forEach((key) => {\n // console.log(key, emote[key]);\n const emoteUrl = `<img class=\"emoteImg\" src=\"https://static-cdn.jtvnw.net/emoticons/v1/${key}/1.0\">`;\n const placement = JSON.stringify(emote[key]);\n // console.log(placement.indexOf('-'));\n const dashLoc = placement.indexOf('-');\n const furstnum = placement.slice(2, dashLoc);\n // console.log(furstnum);\n const secondnum = placement.slice(parseInt(dashLoc, 10) + 1, parseInt(placement.length) - 2);\n // console.log(secondnum);\n const rmWord = message.slice(furstnum, parseInt(secondnum) + 1);\n // console.log(`rmwork: ${rmWord}`);\n // console.log(`rmwork: ${rmWord}`);\n message1 = message1.replace(rmWord, emoteUrl);\n if (rmWord === ':/') {\n console.log('emote :/ was seen, bypassing second replace to prevent infinte loop issue # 6');\n } else {\n while (message1.indexOf(rmWord) !== -1) {\n message1 = message1.replace(rmWord, emoteUrl)\n console.log('there was more than one instance repalcing')\n }\n }\n // console.log(message1);\n return message1;\n });\n } else {\n // console.log('i think we messed up if theres an emote');\n message1 = message;\n }\n getUser(userID)\n .then((user) => {\n if (!user) {\n // console.log('User not found');\n } else {\n const {\n id,\n display_name,\n login,\n broadcaster_type,\n view_count,\n profile_image_url,\n } = user;\n let channelLogo\n const name = `[${id}] ${display_name} (${login})`;\n const props = `${broadcaster_type}, ${view_count} view(s), image: ${profile_image_url}`;\n switch (channel) {\n case '#samma_ftw':\n channelLogo = `<img align=\"left\" style=\"padding-right: 3px;\" class=\"chanlogo\" src=\"/css/samma-logo.png\" alt=\"null\" id=\"itemImg\">`;\n break;\n case '#charja113':\n channelLogo = `<img align=\"left\" style=\"padding-right: 3px;\" class=\"chanlogo\" src=\"/css/charja_logo_head.png\" alt=\"null\" id=\"itemImg\">`\n break;\n }\n\n // console.log(`${name} -- ${props}`);\n const profileElment = `<img align=\"left\" style=\"padding-right: 3px;\" class=\"profImg\" src=\"${profile_image_url}\" alt=\"null\" id=\"itemImg\">`;\n if (postMsg === true) {\n io.emit('twitch', `${profileElment}<p> ${channelLogo} ${displayName}:</p> <p class=\"msg\">${message1}</p></br>`);\n } else {\n console.log('message emitted for filter reasons')\n }\n }\n });\n}", "title": "" }, { "docid": "f1763df622ccc3cc8e6fd0a0e337e842", "score": "0.6436918", "text": "send (event) {\n let message = this.msg.trim()\n let by = this.currentUser\n\n if (message.length === 0) return\n\n this.msg = ''\n console.log('sending');\n\n this.socket.emit('chatChannel', {\n text: message,\n by: by\n })\n }", "title": "" }, { "docid": "39687ca6fac436c6b2d340a3455bf5bb", "score": "0.64307606", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n // Remove whitespace from chat message\n const chatMessage = msg.trim();\n\n console.log(chatMessage, context);\n\n dataParams.Item.message_id = context.id;\n dataParams.Item.timestamp = parseInt(context['tmi-sent-ts']);\n dataParams.Item.context.message_text = chatMessage;\n dataParams.Item.context.username = context.username;\n dataParams.Item.context.subscriber = context.subscriber;\n dataParams.Item.context.user_id = context['user-id'];\n\n console.log(\"Adding a new item...\");\n docClient.put(dataParams, function(err, data) {\n if (err) {\n console.error(\"Unable to add item. Error JSON:\", JSON.stringify(err, null, 2));\n } else {\n console.log(\"Added item:\", JSON.stringify(data, null, 2));\n }\n });\n}", "title": "" }, { "docid": "9104cec4a227efa29b6c5e7fe11bc298", "score": "0.64090395", "text": "function sendMessage(e){\n e.preventDefault();\n //normal message\n if(!editMessage) {\n axios.post('/api/v1/messages/new', {\n conversation_id: activeMessagesId, \n sender: me.username,\n sender_id: me._id,\n original_message: input,\n correction_message: ''\n })\n \n }\n //edit and new message\n if(editMessage && input) {\n axios.post('/api/v1/messages/edit-send', {\n message_id: editMessage._id, \n correction_message: correctionInput,\n conversation_id: editMessage.conversation_id,\n sender: me.username,\n sender_id: me._id,\n original_message: input\n }) \n }\n setInput('');\n dispatch(resetEdit())\n chatBodyRef.current.scrollTop = chatBodyRef.current.scrollTop + 40;\n }", "title": "" }, { "docid": "8364d06e8b7cae8e101cd0e0066827e6", "score": "0.6405989", "text": "handleMessage(message) {\n console.log(message);\n }", "title": "" }, { "docid": "0dd12733f35492ff1072f45e61d65728", "score": "0.64010936", "text": "_sendHandler() {\n console.log('message send');\n this.socket.emit('newMessage', {\n userName: this.state.userId, \n message: this.state.userTypedText,\n userId: this.state.userId,\n addedNewUser: this.state.addUserSuccess\n })\n }", "title": "" }, { "docid": "0ee802fa95f48f791ed655039ffda3ea", "score": "0.6392433", "text": "function handleMessage(sender_psid, received_message) {\n //let message;\n let response;\n \n \n if(received_message.text && addNewTask){ \n saveTask(sender_psid, received_message); \n } else if(received_message.attachments){\n let attachment_url = received_message.attachments[0].payload.url;\n response = {\n \"attachment\": {\n \"type\": \"template\",\n \"payload\": {\n \"template_type\": \"generic\",\n \"elements\": [{\n \"title\": \"Is this the right picture?\",\n \"subtitle\": \"Tap a button to answer.\",\n \"image_url\": attachment_url,\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"Yes!\",\n \"payload\": \"yes-attachment\",\n },\n {\n \"type\": \"postback\",\n \"title\": \"No!\",\n \"payload\": \"no-attachment\",\n }\n ],\n }]\n }\n }\n }\n callSend(sender_psid, response);\n } else {\n let user_message = received_message.text.toLowerCase();\n switch(user_message) {\n case \"hello\":\n case \"hi\":\n greetUser(sender_psid);\n break;\n case \"webview\":\n webviewTest(sender_psid);\n break;\n \n\n\n case \"who am i\":\n whoami(sender_psid);\n break;\n case \"add\":\n case \"new\":\n addTask(sender_psid); \n break;\n case \"view\":\n viewTasks(sender_psid);\n break;\n case \"attachment\":\n response = {\"text\": `You sent the message: \"${received_message.text}\". Now send me an attachment!`};\n callSend(sender_psid, response);\n break;\n default:\n unknownCommand(sender_psid);\n }\n }\n\n}", "title": "" }, { "docid": "b57c096a6725c3098bec06a684bfd111", "score": "0.63874", "text": "function handleMessage(msg) {\n\tswitch (msg.name) {\n\tcase 'performKeyboard':\n\t\tperformKeyboard(msg.message);\n\t\tbreak;\n\tcase 'parseQuery':\n\t\tapp.activeBrowserWindow.activeTab.page.dispatchMessage('queryParsed', parseQuery(msg.message));\n\t\tbreak;\n\tcase 'submitHUD':\n\t\tif (msg.message.value == '')\n\t\t\treturn;\n\t\tif (msg.message.command) {\n\t\t\topenUrl(parseQuery(msg.message.value).url, 'foreground');\n\t\t} else {\n\t\t\topenUrl(parseQuery(msg.message.value).url);\n\t\t}\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "4fae79adae15b8b93472a701a9b141d1", "score": "0.63677454", "text": "function messageListener(request, sender, sendResponse) {\n switch(request.message) {\n case 'displayname_availability':\n userExists({ 'displayname': request.data.displayname }, sendResponse);\n return true;\n case 'reset_passphrase':\n sendPassphraseResetLink(request.email, sendResponse);\n return true;\n case 'is_logged_in':\n sendResponse({ loggedIn: isLoggedIn() });\n return true;\n case 'create_user':\n registrationFlow(request.data, sendResponse);\n return true;\n case 'delete_user':\n deleteUser(sendResponse);\n return true;\n case 'login_user':\n loginFlow(request.email, request.passphrase, sendResponse);\n return true;\n case 'start_stripe_oauth':\n stripeOAuthFlow(sendResponse);\n return true;\n case 'start_youtube_connect_flow':\n youtubeConnectFlow(sendResponse);\n return true;\n case 'open_stripe_dashboard':\n openStripeDashboard(sendResponse);\n return true;\n case 'get_stripe_user_from_YT_video':\n getStripeIdFromVideo(request.video, sendResponse);\n return true;\n case 'perform_tipp':\n performTipp(request.data, sendResponse);\n return true;\n default:\n console.log('message not recognized');\n }\n }", "title": "" }, { "docid": "04962ebbde9e3614aa96ec3fb93df42c", "score": "0.6365162", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n const commandName = msg.trim();\n\n if (commands[commandName]) {\n if (commands[commandName] instanceof Function) {\n client.say(target, commands[commandName](context));\n } else {\n client.say(target, commands[commandName]);\n }\n\n console.log(`Executed ${commandName} command`);\n }\n}", "title": "" }, { "docid": "41ac3096bfc7d149dc18763af429ba52", "score": "0.63607454", "text": "function onMessageHandler (target, context, msg, self) {\n\tif (self) { return; } // Ignore messages from the bot\n\n\tconsole.log(\"Target: \\n\"+target);\n\tconsole.log(\"Context: \\n\"+context);\n\tconsole.log(\"MSG: \\n\"+msg);\n\t\n\tlet user = context.username;\n\tlet userIndex = null;\n\t//check if user exists in users, if not add them\n\tfor(var i = 0;i < users.length;i++) {\n\t\tif(users[i].name == user) {\n\t\t\tuserIndex = i;\n\t\t}\n\t}\n\tif(!userIndex){\n\t\tusers.push({name: user,lastTime:0});\n\t\tuserIndex = users.length-1;\n\t}\n\tconsole.log(users.toString());\n\t\n\t// Remove whitespace from chat message\n\tconst commandName = msg.trim();\n\t\n\tlet newCmd = null;\n\tswitch (commandName) {\n\t\tcase '!cc hurt':\n\t\t\tnewCmd = new Command(user,'hurt 10');\n\t\t\tbreak;\n\t\tcase '!cc bomb':\n\t\t\tnewCmd = new Command(user,'bomb');\n\t\t\tbreak;\n\t\tcase '!cc overload':\n\t\t\tnewCmd = new Command(user,'overload');\n\t\t\tbreak;\n\t\tcase '!cc laser':\n\t\t\tnewCmd = new Command(user,'laser');\n\t\t\tbreak;\n\t\tcase '!cc ice':\n\t\t\tnewCmd = new Command(user,'ice');\n\t\t\tbreak;\n\t\tcase '!cc hiGrav':\n\t\t\tnewCmd = new Command(user,'hiGrav');\n\t\t\tbreak;\n\t\tcase '!cc lowGrav':\n\t\t\tnewCmd = new Command(user,'lowgrav');\n\t\t\tbreak;\n\t\tcase '!cc sandwich':\n\t\t\tnewCmd = new Command(user,'sandwich');\n\t\t\tbreak;\n\t}\n\tif(newCmd) {\n\t\t\n\t\tvar d = new Date();\n\t\tvar curTime = d.getTime();\n\t\tvar timeDif = curTime-users[userIndex].lastTime;\n\t\tconsole.log(timeDif);\n\t\tif (timeDif >= 30000) {\n\t\t\tcurrentCommands.push(newCmd);\n\t\t\tusers[userIndex].lastTime = curTime;\n\t\t}\n\t\telse {\n\t\t\t//code to run if still on cooldown\n\t\t\tclient.say(target, user+\", you need to wait \"+(30-Math.round(timeDif/1000))+\" seconds until your next command\");\n\t\t}\n\t} else {\n\t\t//cmd not known\n\t\t//will need to grab any !cc at the start before implementing this\n\t\t\n\t}\n}", "title": "" }, { "docid": "2c255fcf9e3619431ec03fa53b66cb67", "score": "0.63511074", "text": "function onMessageHandler(target, userstate, msg, self) {\n if (self) {\n return;\n } // Ignore messages from the bot\n\n // Remove whitespace from chat message\n const commandName = msg.trim();\n\n // If the command is known, let's execute it\n if (commandName.startsWith(\"!d\")) {\n rollDice(target, commandName);\n } else if (commandName === \"!resetDie\") {\n resetDie(target, userstate);\n } else if (commandName.startsWith(\"!lock\")) {\n lockDice(target, commandName);\n } else if (commandName === \"!roll\") {\n rollLockedDice(target);\n } else if (commandName === \"!laughTrack\") {\n hype.laughTrack(target, client);\n } else if (commandName === \"say thank you, squizzle bot!\") {\n client.say(target, '\"Thank you squizzle bot!\"');\n } else if (commandName.startsWith(\"!throw\")) {\n rps.rockPaperScissors(target, commandName, userstate, client, db);\n } else if (commandName === \"!streamerHype\") {\n hype.streamerHype(target, userstate.username, client);\n } else if (commandName === \"!resetDb\") {\n resetDb(target, userstate);\n } else if (commandName === \"!raidMsg\") {\n hype.raidMessage(target, client);\n } else if (commandName === \"!encounter\") {\n if (utils.isMod(userstate, target)) {\n pokebot.encounter(target, client, db);\n }\n } else if (commandName === \"!pokeball\") {\n pokebot.handlePokeball(userstate.username, target, client);\n } else if (commandName === \"!pokedex\") {\n pokebot.pokedex(target, client, db);\n } else if (commandName === \"!testing\") {\n if (utils.isMod(userstate, target)) {\n client.say(target, \"testing 324\");\n }\n }\n}", "title": "" }, { "docid": "d5774237b0c8788a7b0c50be98ac8ffd", "score": "0.63394487", "text": "function handleSendMessage(message) {\n this.broadcast.emit(\n ServerConstants.USER_MESSAGE, {\n username: this.username,\n message: message\n }\n );\n}", "title": "" }, { "docid": "500f4af646767265619a1adf7bb93af8", "score": "0.63389826", "text": "function MessageHandler(context, event) {\r\n \r\n var entity=event.message.toLowerCase();\r\n var source=event.messageobj!==undefined?event.messageobj.refmsgid:\"notapplicable\";\r\n\r\n//----------------------------------------------------------------------------------------\r\n\r\n if(entity==\"@status\"){\r\n var lostItemsArray=[];\r\n for(var i=1;i<context.simpledb.roomleveldata.categoriesSubmitted.length;i++)\r\n if(context.simpledb.roomleveldata.categoriesSubmitted[i]===true)\r\n lostItemsArray.push(itemIndex[i-1]);\r\n\r\n if(lostItemsArray.length==0)\r\n context.sendResponse(\"You don't seem to have any previous report. Kindly type start to begin.\");\r\n\r\n else{\r\n\r\n var payload= {\r\n \"type\": \"quick_reply\",\r\n \"content\": {\r\n \"type\":\"text\",\r\n \"text\":\"You have reported following items to be lost. Please select the item you want to check status for\"\r\n },\r\n \"msgid\": \"status\",\r\n \"options\": lostItemsArray\r\n };\r\n\r\n context.sendResponse(JSON.stringify(payload));\r\n }\r\n }\r\n\r\n//----------------------------------------------------------------------------------------\r\n\r\n else if(source==\"status\"){\r\n var index=itemIndex.indexOf(entity)+1;\r\n context.simpledb.roomleveldata.index=index;\r\n serverkobhejo(context.simpledb.roomleveldata.submitted[index],false);\r\n }\r\n\r\n//----------------------------------------------------------------------------------------\r\n\r\n else if(entity==\"hi\" || entity==\"hello\" || entity==\"yo\" || entity==\"hey\" || entity==\"start\" || entity==\"hola\" || entity==\"hallo\" || entity==\"hei\") {\r\n\r\n // context.sendResponse(context.simpledb.roomleveldata.categoriesSubmitted.length);\r\n if(context.simpledb.roomleveldata.categoriesSubmitted===undefined)\r\n {\r\n initializeAll();\r\n }\r\n var question=\"Hey \"+event.senderobj.display.split(\" \")[0]+\"! How do I help you?\";\r\n var button = {\r\n \"type\": \"survey\",\r\n \"question\": question,\r\n \"options\": [\"I Lost Something\", \"I Found Something\"],\r\n \"msgid\": \"start001\"\r\n };\r\n context.sendResponse(JSON.stringify(button));\r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(source==\"start001\" && (entity==\"i lost something\" || entity==\"i found something\")) {\r\n //answer to first question\r\n var isLoss=entity==\"i lost something\"?true:false;\r\n context.simpledb.roomleveldata.isLoss=isLoss;\r\n\r\n var qq=isLoss?\"Damn. I hope I'll be able to help you locate it :) By the way, can you tell me what kind of item it is\":\"Awesome! I hope I can get you in touch with the person who has lost this item :) Can you tell me what kind of item it is?\";\r\n var payload= {\r\n \"type\": \"quick_reply\",\r\n \"content\": {\r\n \"type\":\"text\",\r\n \"text\":qq\r\n },\r\n \"msgid\": \"itemtype\",\r\n \"options\": [\r\n \"Key\",\r\n \"Bank Card\",\r\n \"ID Card\",\r\n \"Notebook\",\r\n \"Book\",\r\n \"Wallet\",\r\n \"Charger\",\r\n \"Passport\",\r\n \"Electronic Item\"\r\n ]\r\n };\r\n context.sendResponse(JSON.stringify(payload));\r\n\r\n }\r\n\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(source==\"itemtype\"){\r\n var isLoss=context.simpledb.roomleveldata.isLoss;\r\n\r\n //Setting the index of current item\r\n var index=isLoss?itemIndex.indexOf(entity)+1:0;\r\n context.simpledb.roomleveldata.index=index;\r\n var item=entity;\r\n context.simpledb.roomleveldata.itemtype[index]=item;\r\n\r\n if(isLoss){\r\n if(context.simpledb.roomleveldata.categoriesSubmitted[itemIndex.indexOf(entity)+1]===true){\r\n var button={\r\n \"type\":\"poll\",\r\n \"question\":\"You have a report pending. Do you want to start afresh?\",\r\n \"msgid\":\"resume001\"\r\n }\r\n context.sendResponse(JSON.stringify(button));\r\n }\r\n else{//if there is no previous report for this item\r\n \r\n if(entity==\"bank card\" || entity==\"id card\" || entity==\"passport\"){\r\n context.simpledb.roomleveldata.source=\"uniquename\";\r\n context.sendResponse(\"What is the name mentioned on the \"+item);\r\n }\r\n else{\r\n askForReward();\r\n }\r\n }\r\n }\r\n\r\n else{// if found\r\n if(entity==\"bank card\" || entity==\"id card\" || entity==\"passport\"){\r\n context.simpledb.roomleveldata.source=\"uniquename\";\r\n context.sendResponse(\"What is the name mentioned on the \"+item);\r\n }\r\n else{\r\n askForReward();\r\n }\r\n }\r\n\r\n }\r\n//----------------------------------------------------------------------------------------\r\n\r\n else if(context.simpledb.roomleveldata.source==\"uniquename\"){\r\n var index=context.simpledb.roomleveldata.index;\r\n context.simpledb.roomleveldata.source=\"invalid\";\r\n context.simpledb.roomleveldata.uniquename[index]=entity;\r\n \r\n askForReward();\r\n }\r\n\r\n\r\n//--------------------------------------------------------------------------------------\r\n \r\n else if(source==\"resume001\" && (entity==\"yes\" || entity==\"no\")) {\r\n var index = context.simpledb.roomleveldata.index;\r\n\r\n if(entity==\"yes\"){\r\n clearlocaldata(index);\r\n var item = context.simpledb.roomleveldata.itemtype[index];\r\n\r\n if(item==\"bank card\" || item==\"id card\" || item==\"passport\"){\r\n context.simpledb.roomleveldata.source=\"uniquename\";\r\n context.sendResponse(\"What is the name mentioned on the \"+item);\r\n }\r\n\r\n else\r\n askForReward();\r\n }\r\n\r\n else if(entity==\"no\")\r\n serverkobhejo(context.simpledb.roomleveldata.submitted[index],false);\r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n\r\n else if(source==\"reward\"){\r\n var index=context.simpledb.roomleveldata.index;\r\n context.simpledb.roomleveldata.reward[index]=entity==\"no reward\"?\"₹ 0\":entity;\r\n\r\n var qq={\r\n \"type\": \"quick_reply\",\r\n \"content\": {\r\n \"type\": \"text\",\r\n \"text\": \"Perfect! Can you please send me your location?\"\r\n },\r\n \"msgid\": \"askforloc\",\r\n \"options\": [\"Enter manually\",{\r\n \"type\": \"location\"\r\n }]\r\n };\r\n\r\n context.sendResponse(JSON.stringify(qq));\r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(entity==\"enter manually\" && source==\"askforloc\"){\r\n context.simpledb.roomleveldata.source=\"entermanually\";\r\n context.sendResponse(\"Enter the latitude and longitude of the location separated by a comma. Example: 89.475090,78.47484\");\r\n\r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(context.simpledb.roomleveldata.source==\"entermanually\"){\r\n context.simpledb.roomleveldata.source=\"invalid\";\r\n\r\n var index=context.simpledb.roomleveldata.index;\r\n var latlong=entity.split(',').map(Number);\r\n console.log(\"upto here\");\r\n // context.sendResponse(context.simpledb.roomleveldata.lat===undefined);\r\n context.simpledb.roomleveldata.lat[index]=latlong[0];\r\n context.simpledb.roomleveldata.lang[index]=latlong[1];\r\n\r\n if(context.simpledb.roomleveldata.isLoss){\r\n // end of journey for lost\r\n var DATA={\r\n \"islost\":true,\r\n \"name\":event.senderobj.display,\r\n \"userid\":event.sender,\r\n \"itemtype\":context.simpledb.roomleveldata.itemtype[index],\r\n \"reward\":context.simpledb.roomleveldata.reward[index],\r\n \"lat\":context.simpledb.roomleveldata.lat[index],\r\n \"lang\":context.simpledb.roomleveldata.lang[index]\r\n };\r\n if(context.simpledb.roomleveldata.uniquename[index])\r\n DATA.uniquename=context.simpledb.roomleveldata.uniquename[index];\r\n context.simpledb.roomleveldata.submitted[index]=DATA;\r\n context.simpledb.roomleveldata.categoriesSubmitted[index]=true;\r\n context.simpledb.roomleveldata.hasClaimedOnce[index]=undefined;\r\n serverkobhejo(DATA,true);\r\n\r\n }\r\n \r\n else{\r\n context.simpledb.roomleveldata.source=\"photo\";\r\n context.sendResponse(\"Please send a pic of the item you've found\");\r\n }\r\n }\r\n \r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(event.messageobj.type==\"image\" && context.simpledb.roomleveldata.source==\"photo\"){\r\n var index=context.simpledb.roomleveldata.index;\r\n context.simpledb.roomleveldata.foundimage=encodeURIComponent(event.messageobj.url);\r\n context.simpledb.roomleveldata.source=\"phone\";\r\n context.sendResponse(\"Can you mention your phone number so that we get you connected if someone reports the item's loss?\");\r\n\r\n }\r\n \r\n//--------------------------------------------------------------------------------------\r\n\r\n\r\n else if(context.simpledb.roomleveldata.source==\"phone\"){\r\n\r\n var index=context.simpledb.roomleveldata.index;\r\n context.simpledb.roomleveldata.source=\"invalid\";\r\n context.simpledb.roomleveldata.phone=entity;\r\n // end of journey for all found\r\n\r\n var DATA={\r\n \"islost\":false,\r\n \"name\":event.senderobj.display,\r\n \"userid\":event.sender,\r\n \"phone\":context.simpledb.roomleveldata.phone,\r\n \"itemtype\":context.simpledb.roomleveldata.itemtype[index],\r\n \"reward\":context.simpledb.roomleveldata.reward[index],\r\n \"foundimage\":context.simpledb.roomleveldata.foundimage,\r\n \"lat\":context.simpledb.roomleveldata.lat[index],\r\n \"lang\":context.simpledb.roomleveldata.lang[index]\r\n };\r\n\r\n if(context.simpledb.roomleveldata.uniquename[index])\r\n DATA.uniquename=context.simpledb.roomleveldata.uniquename[index];\r\n clearlocaldata(index);\r\n serverkobhejo(DATA,true); \r\n //context.sendResponse(\"All good so far\");\r\n }\r\n \r\n//--------------------------------------------------------------------------------------\r\n\r\n\r\n else if(source==\"confirmwarn\"){\r\n // context.sendResponse(\"coming here\")\r\n showmatchestolost(context.simpledb.roomleveldata.eventgetresp);\r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(source==\"matches\"){\r\n var index = context.simpledb.roomleveldata.index;\r\n var finderMatchedUserID=entity.split('#')[0];\r\n var finderIndex=parseInt(entity.split('#')[1]);\r\n var fetchFound=context.simpledb.roomleveldata.matcheditems[finderIndex];\r\n\r\n if(context.simpledb.roomleveldata.hasClaimedOnce[index]===true){\r\n context.sendResponse(\"Sorry, option disabled as you have already claimed your item once.\");\r\n }\r\n\r\n else{\r\n //process karo\r\n // context.sendResponse(\"hasClaimedOnce is: \"+ context.simpledb.roomleveldata.hasClaimedOnce[index]);\r\n\r\n context.simpledb.roomleveldata.hasClaimedOnce[index]=true;\r\n //since this is now claimed, remove the found id from database\r\n removeFinder(finderMatchedUserID,context.simpledb.roomleveldata.submitted[index]);\r\n clearlocaldata(index);\r\n \r\n context.sendResponse(\"Your item is with \"+fetchFound.name+\" and they can be reached at \"+fetchFound.phone+\"\\nPlease ensure you pay them the reward of ₹ \"+fetchFound.reward.split(\" \")[1]+\" when they hand you the item back.\");\r\n }\r\n\r\n \r\n }\r\n \r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(source==\"lastconfirmation\" && entity==\"no\"){\r\n context.sendResponse(\"Alright then, we shall keep the entry in the database until the problem is solved. Type start to search for a match later.\");\r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(entity==\"sudo destroy all data\"){\r\n context.simpledb.botleveldata.lostitems=undefined;\r\n context.simpledb.botleveldata.founditems=undefined;\r\n context.sendResponse(\"All data destroyed\");\r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n \r\n else if(entity==\"sudo show all users\"){\r\n\r\n context.sendResponse(context.simpledb.roomleveldata.matcheditems[0].name);\r\n }\r\n//--------------------------------------------------------------------------------------\r\n else if(entity==\"sudo reset\"){\r\n initializeAll();\r\n context.sendResponse(\"All data reset\");\r\n }\r\n//-------------------------------------------------------------------------------------- \r\n else if(entity==\"sudo total categories\"){\r\n \r\n context.sendResponse(\"Total categories: \" + context.simpledb.roomleveldata.categoriesSubmitted.length)\r\n \r\n }\r\n//-------------------------------------------------------------------------------------- \r\n else if(entity==\"sudo show categories\"){\r\n\r\n context.sendResponse(\"Categories array: \" + context.simpledb.roomleveldata.categoriesSubmitted)\r\n \r\n }\r\n\r\n//-------------------------------------------------------------------------------------- \r\n else if(entity==\"sudo categories 1\"){\r\n\r\n var index=parseInt(entity.split(\" \")[2]);\r\n context.sendResponse(\"Boolean value at \" + index + \" is \"+context.simpledb.roomleveldata.categoriesSubmitted[index]);\r\n \r\n }\r\n\r\n//-------------------------------------------------------------------------------------- \r\n else if(entity==\"sudo hasclaimed\"){\r\n\r\n var index= context.simpledb.roomleveldata.index;\r\n context.sendResponse(\"hasClaimedOnce at index: \" +index+ \" : \"+context.simpledb.roomleveldata.hasClaimedOnce);\r\n \r\n }\r\n//-------------------------------------------------------------------------------------- \r\n else if(entity==\"sudo show submitted\"){\r\n\r\n context.sendResponse(\"The submitted array is: \"+context.simpledb.roomleveldata.submitted);\r\n \r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n \r\n else if(entity==\"sudo delete all users\"){\r\n context.simpledb.botleveldata.users=undefined;\r\n context.sendResponse(\"Deleted all users\")\r\n }\r\n\r\n // else if(entity==\"sudo is submitted\"){\r\n // isUserSubmitted(event.sender);\r\n // }\r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(entity==\"sudo get all users\"){\r\n context.simplehttp.makeGet('https://fetchfind-12fc9.firebaseio.com/Users.json');\r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n else if(entity==\"facebook echo\"){\r\n context.sendResponse(\"I hear you loud and clear!\");\r\n }\r\n \r\n else {\r\n context.sendResponse('Sorry! I could not understand you. Type start to report a lost or found issue.'); \r\n }\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n\r\nfunction clearlocaldata(index){\r\n context.simpledb.roomleveldata.categoriesSubmitted[index]=undefined;\r\n context.simpledb.roomleveldata.userid=undefined;\r\n context.simpledb.roomleveldata.submitted[index]=undefined;\r\n context.simpledb.roomleveldata.uniquename[index]=undefined;\r\n context.simpledb.roomleveldata.islost=undefined;\r\n context.simpledb.roomleveldata.source=undefined;\r\n context.simpledb.roomleveldata.foundimage=undefined;\r\n}\r\n\r\n\r\n//--------------------------------------------------------------------------------------\r\n\r\n function removeFinder(finderID,tempData){\r\n var shoot={\r\n \"finderID\":finderID,\r\n \"tempData\":tempData,\r\n \"countryCode\":\"IN\"\r\n }\r\n var url = db+ '/removefinder/' + JSON.stringify(shoot);\r\n context.simplehttp.makeGet(url,null,deleteduserresponse);\r\n function deleteduserresponse(context,event){\r\n if(event.getresp!=\"perfecto\")context.sendResponse(\"Error. Recheck karo.\")\r\n } \r\n\r\n }\r\n//--------------------------------------------------------------------------------------\r\n\r\n\r\n function askForReward (){\r\n\r\n var usethissentence=context.simpledb.roomleveldata.isLoss===false?\"Do you want a reward for returning this item? Please remember your item will only be visible to item owners \\\r\n if the amount they are willing to pay is atleast half the amount you have demanded\":\"Would you offer a reward in return for your item?\\\r\n Remember offering higher rewards increases the chances of you getting your item back\";\r\n\r\n // var C=context.simpledb.roomleveldata.countryCode;\r\n // var countrycurrencypair={\r\n // \"rupee\":{\"countries\":[\"IN\"],\"symbol\":\"₹\"},\r\n // \"euro\":{\"countries\":[\"AL\",\"AD\",\"AM\",\"AT\",\"BY\",\"BE\",\"BA\",\"BG\",\"CH\",\"CY\",\"CZ\",\"DE\",\"DK\",\"EE\",\"ES\",\"FO\",\"FI\",\"FR\",\"GB\",\"GE\",\"GI\",\"GR\",\"HU\",\"HR\",\"IE\",\"IS\",\"IT\",\"LT\",\"LU\",\"LV\",\"MC\",\"MK\",\"MT\",\"NO\",\"NL\",\"PO\",\"PT\",\"RO\",\"RU\",\"SE\",\"SI\",\"SK\",\"SM\",\"TR\",\"UA\",\"VA\"],\"symbol\":\"€\"},\r\n // \"pound\":{\"countries\":[\"GB\"],\"symbol\":\"£\"},\r\n // \"yen\":{\"countries\":[\"JP\"],\"symbol\":\"¥\"},\r\n // \"swiss franc\":{\"countries\":[\"CH\"],\"symbol\":\"CHF\"},\r\n // \"canadian dollar\":{\"countries\":[\"CA\"],\"symbol\":\"CAD\"},\r\n // };\r\n \r\n // context.simpledb.roomleveldata.currency=\"USD\";\r\n context.simpledb.roomleveldata.ratelist={\"key\":[30,50,80,100,500],\"id card\":[50,100,200,500,1000],\"electronic item\":[100,200,500,1000,2000],\"passport\":[300,500,1000,2000,5000],\"bank card\":[100,200,500,800,1000],\"wallet\":[100,200,500,800,1000],\"notebook\":[10,20,50,80,100],\"book\":[10,20,50,80,100], \"charger\":[10,20,50,80,100]};\r\n // var countrymultiplier=1;\r\n // switch(C){\r\n // case(\"IN\"): countrymultiplier=10; break;\r\n // case(\"JP\"): countrymultiplier=40; break;\r\n // case(\"CA\"): countrymultiplier=2;break;\r\n // default: countrymultiplier=1;\r\n // }\r\n\r\n // for(curr in countrycurrencypair){\r\n // if(countrycurrencypair[curr].countries.indexOf(C)!=-1){\r\n // //matched\r\n // context.simpledb.roomleveldata.currency=countrycurrencypair[curr].symbol;\r\n // break;\r\n // }\r\n // }\r\n\r\n var index = context.simpledb.roomleveldata.index;\r\n var currencyArray=[];\r\n var item=context.simpledb.roomleveldata.itemtype[index];\r\n for(var i=0;i<context.simpledb.roomleveldata.ratelist[item].length;i++)\r\n currencyArray.push(\"₹ \"+context.simpledb.roomleveldata.ratelist[item][i]);\r\n currencyArray.push(\"No reward\");\r\n var payload = {\r\n \"type\": \"quick_reply\",\r\n \"content\": {\r\n \"type\":\"text\",\r\n \"text\":usethissentence\r\n },\r\n \"options\": currencyArray,\r\n \"msgid\": \"reward\"\r\n };\r\n \r\n context.sendResponse(JSON.stringify(payload));\r\n }\r\n\r\n \r\n }", "title": "" }, { "docid": "1796759c2d52e53fe7ae3b71a9e72b77", "score": "0.633747", "text": "handleMessage(msg) {\n try {\n let parsed = JSON.parse(msg.data);\n console.debug('msg received', parsed);\n switch (parsed.messageType) {\n case 'myInfo':\n this.setMyInfo(parsed);\n break;\n case 'newGame':\n this.addGame(parsed);\n break;\n case 'joinGame':\n this.joinGame(parsed);\n break;\n case 'newPlayer':\n this.newPlayer(parsed);\n break;\n case 'wonderOption':\n this.wonderOption(parsed);\n break;\n case 'playOrder':\n this.playOrder(parsed);\n break;\n case 'sideChosen':\n this.sideChosen(parsed);\n break;\n case 'hand':\n this.receiveHand(parsed);\n break;\n case 'playCombos':\n this.playCombos(parsed);\n break;\n default:\n console.debug('Unrecognized message type', parsed);\n break;\n }\n } catch (e) {\n console.debug('Invalid JSON msg received', msg);\n return;\n }\n }", "title": "" }, { "docid": "1e39404b02638a9c1fb6c493ceeb2740", "score": "0.6333164", "text": "function onMessageHandler (channel, user, msg, privateMessage) {\n console.log(`Message received.`, user);\n\n if (privateMessage.isCheer) {\n cheerEvents.cheer(privateMessage.totalBits, privateMessage.userInfo, coachBot.onMessage);\n }\n\n // Remove whitespace from chat message\n const commandName = msg.trim();\n\n if (commandName[0] != '!' && commandName[0] != 'o')\n return;\n\n console.log(`Parsing message: ${msg}`);\n \n const commandArray = commandName.split(' ');\n const cmd = commands.getCommand(commandArray[0], user);\n\n if (cmd) {\n cmd(client, channel, user, commandArray.slice(1), coachBot.onMessage);\n } else {\n console.log(`${commandName}: is borked`);\n }\n }", "title": "" }, { "docid": "e148f8483e8d0cd3eb7b7820289ff249", "score": "0.6331358", "text": "handleMessage(message, sendingPlayer){\n if(!sendingPlayer in this.gameState.players){\n this.loggingFunction(\"warn\", \"Message sent by player that does not exist in the game.\")\n return null\n }\n switch(message.type){\n case Shared.ClientMessageType.GAMESTATEREQ:\n return this.gameStateReqHandler(sendingPlayer)\n case Shared.ClientMessageType.VOTECAST:\n if(!(\"choice\" in message)){\n this.loggingFunction(\"warn\", \"Missing \\\"choice\\\" property in received vote cast message.\")\n return null\n }\n else {\n return this.voteCastHandler(sendingPlayer, message.choice)\n }\n case Shared.ClientMessageType.ACKNOWLEDGE:\n return this.ackHandler(sendingPlayer)\n case Shared.ClientMessageType.SUGGESTTARGET:\n if(!(\"target\" in message)){\n this.loggingFunction(\"warn\", \"Missing \\\"target\\\" property in received suggest target message.\")\n return null\n }\n else{\n return this.suggestHandler(sendingPlayer, message.target)\n }\n case Shared.ClientMessageType.CHATMESSAGE:\n if(!(\"text\" in message)){\n this.loggingFunction(\"warn\", 'Missing \"text\" property in chat message.')\n return null\n }\n else{\n return this.chatHandler(sendingPlayer, message.text, false)\n }\n case Shared.ClientMessageType.PRIVILEGEDCHATMESSAGE:\n if(!(\"text\" in message)){\n this.loggingFunction(\"warn\", 'Missing \"text\" property in privileged chat message.')\n return null\n }\n else{\n return this.chatHandler(sendingPlayer, message.text, true)\n }\n default:\n this.loggingFunction(\"warn\", `Unknown message type received: \\\"${message.type}\\\".`)\n return null\n }\n }", "title": "" }, { "docid": "c9cbe019ea431deca5d9592af8001037", "score": "0.6328325", "text": "messageHandler(target, context, msg, self) {\n if (self) {\n return\n }\n \n const command = msg.trim();\n //BUG: cannot call this.help and this.uptime, this is undefined and will need to be bound\n if (command === '!uptime') {\n //gets the time the stream was created\n try {\n this.uptime(client)\n } catch (error) {\n console.error(error)\n }\n \n }\n if (command === '!help') {\n try {\n client.action('blugil', 'Hi! The current working commands are: ...there are none it would seem')\n } catch (error) {\n console.error(error)\n }\n }\n }", "title": "" }, { "docid": "ec23082462fab0e069f1b359377c9fff", "score": "0.63232696", "text": "function receivedMessage(event) {\n const senderID = event.sender.id;\n const recipientID = event.recipient.id;\n const timeOfMessage = event.timestamp;\n const message = event.message;\n\n if(message.is_echo) {\n // for now simply log a message and return 200;\n // logger.info(\"Echo message received. Doing nothing at this point\");\n return;\n }\n\n // logger.info(\"receivedMessage: Received event for user %d, page %d, session %d at timestamp: %d, guid: %s Event: \", senderID, recipientID, this.session.fbid, timeOfMessage, this.session.guid, JSON.stringify(event));\n\n const messageText = message.text;\n const messageAttachments = message.attachments;\n if (messageText) {\n // If we receive a text message, check to see if it matches any special\n // keywords and send back the corresponding example. Otherwise, just echo\n // the text we received.\n switch (messageText) {\n case 'generic':\n sendGenericMessage(senderID);\n break;\n default:\n determineResponseType.call(this, event);\n }\n } else if (messageAttachments) {\n const response = this.travelSfoPageHandler.handleSendingAttractionsNearMe(message, this.pageId, senderID);\n if(response) return callSendAPI.call(this, response);\n const stickerId = message.sticker_id;\n if(stickerId && stickerId === 369239263222822) {\n const handleMesg = this.travelSfoPageHandler.handleLikeButton(this.pageId, senderID);\n if(handleMesg) {\n if(Array.isArray(handleMesg)) {\n callSendAPI.call(this, handleMesg[0]);\n const self = this;\n setTimeout(function() {\n callSendAPI.call(self, handleMesg[1]);\n }, 2000);\n return;\n }\n return callSendAPI.call(this, handleMesg);\n }\n return sendTextMessage.call(this, senderID, \"Glad you like us!\");\n }\n // sendTextMessage.call(this, senderID, \"Message with attachment received\");\n return sendTextMessage.call(this, senderID, \"Thanks!\");\n }\n}", "title": "" }, { "docid": "8309903668ae1c9514dedca387a883b6", "score": "0.63230485", "text": "function onMessageHandler (target, context, msg, self) {\r\n if (self) { return; } // Ignore messages from the bot\r\n\r\n // Remove whitespace from chat message\r\n const commandName = msg.trim().toLowerCase();\r\n\r\n // If the command is known, let's execute it\r\n if (commandName === '!flap') {\r\n client.say(target,\"I can open my fanny flaps in the night if I need a wee...\");\r\n console.log(\"Fanny flaps opened\");\r\n } else if (commandName == '!fart'){\r\n client.say(target,\"BRRRRAAAAAAAAP\");\r\n console.log(\"I farted\");\r\n } else if(commandName == '!wink'){\r\n client.say(target, \"I look at her fanny.. and it's winkin' at me!\");\r\n console.log(\"Sophie quoted\");\r\n } else if(commandName == \"!w\" || commandName == \"!W\"){\r\n client.say(target, \"Wet, wide and horny. -Charlotte Crosby\");\r\n console.log(\"No errors.\");\r\n } else if(commandName == \"!scat\"){\r\n client.say(target, \"Poo is just food that comes out your asshole..\");\r\n console.log(\"Never getting partner\");\r\n } else if(commandName == \"!fff\"){\r\n client.say(target, \"I'm fit, I'm flirty, and I've got double F's.\");\r\n console.log(\"I think that says it all...\");\r\n } else if(commandName == \"!secret\"){\r\n client.say(target, \"I'll never tell!!!\");\r\n setTimeout(function(){\r\n client.say(target, \"Or will I...\");},\r\n 3000\r\n );\r\n console.log(\"somehow this shit works\");\r\n }\r\n else {\r\n console.log(`* Unknown command ${commandName}`);\r\n }\r\n}", "title": "" }, { "docid": "a72104411f5fb25bce6282340c1a8056", "score": "0.6317949", "text": "function receivedMessage(event) {\n\tlet senderID = event.sender.id;\n\t//var recipientID = event.recipient.id;\n\t//var timeOfMessage = event.timestamp;\n\tlet message = event.message;\n\t//var messageId = message.mid;\n\tlet messageText = message.text;\n\t//var messageAttachments = message.attachments;\n\tconsole.log(\"Received Facebook message from \" + senderID + \": \" + messageText);\n\tif (messageText) {\n\t\tuserLogins.findOne( { FB_ID: senderID }, function(err, doc){\n\t\t\t//make sure the user has at least one slack account linked to their facebook account\n\t\t\t//if they don't, send them a sign in link\n\t\t\tif( doc === null ){\n\t\t\t\tconsole.error(senderID + \" is not signed into any Slack accounts.\")\n\t\t\t\tsendTextMessage(senderID, \"You must sign in with at least one Slack account\");\n\t\t\t\tSignIn(senderID);\n\t\t\t//if the message starts with \"/signin\", send them a sign in link\n\t\t\t} else if( messageText.substring(0,7) === \"/signin\" ){\n\t\t\t\tconsole.log(senderID + \" requested a sign in link.\")\n\t\t\t\tSignIn(senderID);\n\t\t\t//if the message starts with \"/signout\", prompt to find which team the user wants to sign out of\n\t\t\t} else if( messageText.substring(0,8) === \"/signout\" ){\n\t\t\t\t//go to the signout part of the condition below\n\t\t\t\tPromptTeams(senderID, \"signout\");\n\t\t\t//if the message starts with \"/subscribe\", prompt to get the team of the channel to which the user wants to subscribe\n\t\t\t} else if( messageText.substring(0,10) === \"/subscribe\"){\n\t\t\t\t//go to the subscribe part of the condition below\n\t\t\t\tPromptTeams(senderID, \"subscribe\");\n\t\t\t//if the message starts with \"/unsubscribe\", prompt to get the team of hte channel to which the users wants to unsubscribe\n\t\t\t} else if( messageText.substring(0,12) === \"/unsubscribe\"){\n\t\t\t\t//go to the unsubscribe part of the condition below\n\t\t\t\tPromptTeams(senderID, \"unsubscribe\");\n\t\t\t//if the message starts with \"/select\", prompt to find the team the user wants to select\n\t\t\t} else if(messageText.substring(0,7) === \"/select\"){\n\t\t\t\t//go to the select part of the condition below\n\t\t\t\tPromptTeams(senderID, \"select\");\n\t\t\t//if the message is a quick reply, process the payload\n\t\t\t} else if(message.quick_reply != undefined){\n\t\t\t\t//the payload is a string with pieces of information separated by \"~_!\", so split the payload by that string to get an array of information\n\t\t\t\tlet payload = message.quick_reply.payload.split(\"~_!\");\n\t\t\t\t//if the user was previously entered \"/subscribe\", prompt to get the channel to which the user wants to subscribe\n\t\t\t\tif(payload[0] === \"subscribe\"){\n\t\t\t\t\tlet teamName = payload[1];\n\t\t\t\t\tPromptAllChannels(senderID, teamName);\n\t\t\t\t//if the user previously chose a channel to which to subscribe, update the database with the new subscription\n\t\t\t\t} else if(payload[0] === \"subscribe2\"){\n\t\t\t\t\tlet teamID = payload[1];\n\t\t\t\t\tlet teamName = payload[2];\n\t\t\t\t\tlet channelID = payload[3];\n\t\t\t\t\tlet channelName = payload[4];\n\t\t\t\t\tSubscribeUpdateDatabase(senderID, teamID, teamName, channelID, channelName);\n\t\t\t\t//if the user previously entered \"/unsubscribe\", prompt to get the channel to which the user wants to unsubscribe\n\t\t\t\t} else if(payload[0] === \"unsubscribe\"){\n\t\t\t\t\tlet teamName = payload[1]\n\t\t\t\t\tPromptSubscribedChannels(senderID, teamName, \"unsubscribe2\");\n\t\t\t\t//if the user previously chose a channel to which to unsubscribe, update the database with the new changes\n\t\t\t\t} else if(payload[0] === \"unsubscribe2\"){\n\t\t\t\t\tlet teamName = payload[1];\n\t\t\t\t\tlet channelName = payload[2];\n\t\t\t\t\tUnsubscribe(teamName, channelName, senderID);\n\t\t\t\t//if the user previously entered \"/signout\", update the database with the new changes\n\t\t\t\t} else if(payload[0] === \"signout\"){\n\t\t\t\t\tlet teamName = payload[1]\n\t\t\t\t\tSignOut(senderID, teamName);\n\t\t\t\t//if the user previously entered \"/select\", prompt to find the channel the user wants to select\n\t\t\t\t} else if(payload[0] === \"select\"){\n\t\t\t\t\tlet teamName = payload[1];\n\t\t\t\t\tPromptSubscribedChannels(senderID, teamName, \"select2\");\n\t\t\t\t//if the user previously entered a channel to select, update the database with user's selected team and channel\n\t\t\t\t} else if(payload[0] === \"select2\"){\n\t\t\t\t\tlet teamName = payload[1];\n\t\t\t\t\tlet channelName = payload[2];\n\t\t\t\t\tSelectTeamChannel(senderID, teamName, channelName);\n\t\t\t\t}\n\t\t\t//if the message isn't one of the above formats, assume the user wants to send a message\n\t\t\t} else{\n\t\t\t\t//get the team name, channel name, and message from the facebook message\n\t\t\t\tlet colon = messageText.indexOf(\":\");\n\t\t\t\tlet space = messageText.indexOf(\" \", colon);\n\t\t\t\tlet teamName = null;\n\t\t\t\tlet channelName = null;\n\t\t\t\tlet message = null;\n\t\t\t\t//if the user doesn't specify the channel and team, get his/her selected team and channel\n\t\t\t\tif(colon === -1 || space === -1){\n\t\t\t\t\tuserSettings.findOne( {FB_ID: senderID}, function(err, doc){\n\t\t\t\t\t\tteamName = doc.SELECTED_TEAM;\n\t\t\t\t\t\tchannelName = doc.SELECTED_CHANNEL;\n\t\t\t\t\t\tmessage = messageText;\n\t\t\t\t\t\tsendSlackMessage(senderID, teamName, channelName, message);\n\t\t\t\t\t});\n\t\t\t\t//otherwise, parse the message for them and send the message based on them\n\t\t\t\t} else {\n\t\t\t\t\tteamName = messageText.substring(0, colon);\n\t\t\t\t\tchannelName = messageText.substring(colon+1, space);\n\t\t\t\t\tmessage = messageText.substring(space+1);\n\t\t\t\t\tsendSlackMessage(senderID, teamName, channelName, message);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n}", "title": "" }, { "docid": "4ab93ef086ab3201e0de1e62db2bcf93", "score": "0.6314038", "text": "sendMessage(req){\n \n }", "title": "" }, { "docid": "d7708f1fc9c2bb77b7f88cb4c2a0bfc0", "score": "0.63064396", "text": "function handleSend(newMessage = []) {\n setMessages(GiftedChat.append(messages, newMessage));\n }", "title": "" }, { "docid": "d7708f1fc9c2bb77b7f88cb4c2a0bfc0", "score": "0.63064396", "text": "function handleSend(newMessage = []) {\n setMessages(GiftedChat.append(messages, newMessage));\n }", "title": "" }, { "docid": "ddc382ec69be4c2edbda10356268439c", "score": "0.6303596", "text": "function doPost(e) {\n //Make sure to only reply to json request\n\n if (e.postData.type == \"application/json\") {\n\n // Parse the update sent from Telegram\n var update = JSON.parse(e.postData.contents);\n\n // Instantiate our bot passing the update \n var bot = new Bot(token, update);\n\n user.id = update.message.chat.id.toString();\n getSheet();\n getUser();\n // Building commands\n var bus = new CommandBus();\n\n bus.on(/\\/updates/, function () {\n var message = toggleDailyUpdates();\n if (user.name == \"Stranger\") {\n this.replyToSender(\"Hello Stranger, please register first to use the updates feature!\");\n } else {\n this.replyToSender(\"Hello \" + user.name + \", \" + message);\n }\n });\n\n bus.on(/\\/program/, function () {\n var message = getTrngProgram();\n this.replyToSender(\"Hello \" + user.name + \", \" + message);\n });\n\n bus.on(/\\/lineup/, function () {\n var message = getLineUp();\n this.replyToSender(\"Hello \" + user.name + \", \" + message);\n });\n\n bus.on(/\\/start/, function () {\n this.replyToSender(\"Hello fellow canoeist, daddy syaz will help you get updates on the /program and /lineup. \" +\n \"Begin by registering your name using /register [nickname on the sheets] (eg. /register syaz) and use /updates to toggle daily updates!\");\n });\n\n bus.on(/\\/register/, function () {\n user.name = update.message.text.substring(10).trim();\n if (user.name == \"\") { //Regex this part for input validation?\n this.replyToSender(\"Please enter something for your name!\");\n } else if (setUser()) {\n this.replyToSender(\"Hello \" + user.name + \", you have been sucessfully registered.\");\n } else {\n this.replyToSender(\"Hmm, I couldn't find your name.... are you sure you are one of us?\");\n }\n });\n\n bus.on(/\\/help/, function () {\n this.replyToSender(\"Here is a summary of what daddy syaz can do: \\n \\n\" +\n \"/program - the program for today (shows tomorrow's program after 1500) \\n\" +\n \"/lineup - the lineup for today (shows tomorrow's lineup after dana assigns usually around 2000) \\n\" +\n \"/updates - to toggle between enabling/disabling daily 0600 updates \\n\" +\n \"/register [nickname on sheet] (eg. /register syaz) - to register your name with me!\"\n );\n });\n }\n // Register the command bus\n bot.register(bus);\n\n // If the update is valid, process it\n if (update) {\n bot.process();\n }\n}", "title": "" }, { "docid": "0eb8b5b586ed86a6cb7543257a87f5bb", "score": "0.6289672", "text": "function handleSubmit(e) {\n e.preventDefault();\n Socket.emit('new message sent', {\n message: text,\n });\n setText('');\n }", "title": "" }, { "docid": "c31d6635fadb601e56562e0aba1bb413", "score": "0.62874407", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; } \n\n const channel = client.channels.cache.find(channel => channel.id === process.env.DISCORD_CHANNEL_ID);\n \n if(context['display-name'] !== \"Fossabot\") {\n channel.send(context['display-name'] + \": \" + msg);\n }\n \n}", "title": "" }, { "docid": "e01a7b8752278f3d52b61e3be7cb8ece", "score": "0.62844926", "text": "handleMessage(message) {\n\t\tlet args = message.content.split(' ')\n\n\t\t// Check if the message starts with the required prefix\n\t\tif (args[0] !== this.config.prefix) {\n\t\t\treturn\n\t\t}\n\n\t\t// Create an array of arguments passed to the bot\n\t\targs = args.slice(1)\n\n\t\t// If no arguments are present, imply the \"status\" action\n\t\tif (args.length === 0) {\n\t\t\targs = ['status']\n\t\t}\n\n\t\t// Run the right message handler\n\t\tlet handler = this.handlers.find((h) => h.commands.includes(args[0]))\n\n\t\t// If no handler was found, run the special 404 handler\n\t\tif (!handler) {\n\t\t\thandler = this.handlers.find((h) => h.commands.includes('404'))\n\t\t}\n\n\t\t// Run the handler\n\t\thandler.handler({\n\t\t\tbot: this,\n\t\t\tutil: this.util,\n\t\t\targs,\n\t\t\tmessage\n\t\t})\n\t}", "title": "" }, { "docid": "6b903116ff96ec8d0d071aa9be706468", "score": "0.6273637", "text": "handleSendMessage() {\n if (!this.state.input)\n return;\n \n this.state.client.emit('message', this.state.input, this.state.chatroomId, (err) => {\n if (err)\n return console.error(err);\n return this.setState({ input: '' });\n })\n }", "title": "" }, { "docid": "0ed6287196b99024ddfa5a35d72269fc", "score": "0.62702024", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; }\n\n const usr = context.username;\n const command = msg.split(' ');\n // console.log(command,context, usr);\n // console.log(\"**********\");\n if(command[0].startsWith('!')){\n\n const mod = (context.mod || usr === 'alexjett' || usr.toLowerCase() === 'tharpy_');\n handle_command(command[0].substr(1), command.slice(1), target, client, mod, usr);\n }\n}", "title": "" }, { "docid": "dcc9441650b486fcb2b2858d51832e2a", "score": "0.6269557", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n // Remove whitespace from chat message\n const commandName = msg.trim();\n\n // If the command is known, let's execute it\n if (commandName === '!dice') {\n const num = rollDice();\n client.say(target, `You rolled a ${num}`);\n console.log(`* Executed ${commandName} command`);\n } \n else if (commandName == '!helloworld') {\n client.say(target, `Hello World!`);\n console.log(`* Executed ${commandName} command`);\n }\n else if (commandName.search(`@${identity.identity.username}`) != -1) {\n if (commandName.toLowerCase().search('hi') != -1 || commandName.toLowerCase().search('hello') != -1) {\n client.say(target, `Hello ${context.username} !`);\n }\n }\n else if (commandName == '!pc') {\n client.say(target, `${context.username} Buddha plays on the Alienware Gaming Desktop | Intel core i7-9700 CPU | NVIDIA GeForce RTX 2060 GPU`);\n console.log(`* Executed ${commandName} command`);\n }\n else if (commandName == '!mic') {\n client.say(target, 'Buddha is using the HyperX Quadcast!');\n commandExecuted(commandName);\n }\n else {\n console.log(`* Unknown command ${commandName}`);\n }\n}", "title": "" }, { "docid": "11f371421d55c8b504316324e1e4f09b", "score": "0.626822", "text": "function handleMessage(message) {\n var messageEl = '';\n if (message.username === currentUser) {\n messageEl = $(\"<li class='text sent'>\"\n + \"<div class='reflect'></div><p><strong>\"\n + \"<a class='username' href='#'>\" + message.username + \"</a> said: \"\n + \"</strong>\"\n + message.text\n + \"</p></li>\");\n messageList.append(messageEl);\n }\n else if (message.username === receiverUser) {\n messageEl = $(\"<li class='text receive'>\"\n + \"<div class='reflect'></div><p><strong>\"\n + \"<a class='username' href='#'>\" + message.username + \"</a> said: \"\n + \"</strong>\"\n + message.text\n + \"</p></li>\");\n messageList.append(messageEl);\n }\n var newMesssage = {\n username: message.username,\n text: message.text,\n receiver: receiverUser\n }\n messageQueue.push(newMesssage);\n\n // Scroll to bottom of page\n $(\"html, body\").animate({ scrollTop: $(document).height() - $(window).height() }, 'slow');\n var scroller = document.getElementById(\"iPhoneBro\")\n scroller.scrollTop = scroller.scrollHeight;\n }", "title": "" }, { "docid": "ad187888ed144dc53f3a54d8e49e2dad", "score": "0.6261673", "text": "function handleMessage(sender_psid, received_message) {\n let response;\n \n // Send the next question in the sequence, the final evaluation, or nothing (once finished)\n if (received_message == \"\" || i == 0) {\n response = {\n \"attachment\": {\n \"type\": \"template\",\n \"payload\": {\n \"template_type\": \"generic\",\n \"elements\": [{\n \"title\": titles[i++],\n \"subtitle\": \"Select a button to answer.\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"Yes\",\n \"payload\": \"yes\",\n },\n {\n \"type\": \"postback\",\n \"title\": \"No\",\n \"payload\": \"no\",\n }\n ],\n }]\n }\n }\n } \n }\n else if (i == count) {\n response = {\n \"text\": `${received_message.text}`\n }\n }\n callSendAPI(sender_psid, response); \n}", "title": "" }, { "docid": "d521a7bc827c48fe5ecd2f85600b5bd0", "score": "0.626049", "text": "function onMessageHandler(target, context, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n // Remove whitespace from chat message\n const commandName = msg.trim();\n\n //context.username ===> @samuGarron\n // If the command is known, let's execute it\n if (commandName === '!dice') {\n client.say(target, `You rolled a 1`);\n console.log(`* Executed ${commandName} command`);\n }\n io.sockets.emit('messages', [{ autor: target, text: commandName }]);\n}", "title": "" }, { "docid": "2f5c2d20aef2d4f76bdae51982b706f6", "score": "0.62562215", "text": "sendMsg(){\n\t\tif(this.state.message.length > 0){\n\t\t\t\tlet msg = this.state.message;\n\t\t\t\tthis.setState({message:\"\"}, () => { axios.post(`/sendmessage`, {\n\t\t\t\t\t\t\"snippet\": {\n\t\t\t\t\t\t \"liveChatId\": this.props.chatID,\n\t\t\t\t\t\t \"type\": \"textMessageEvent\",\n\t\t\t\t\t\t \"textMessageDetails\": {\n\t\t\t\t\t\t \"messageText\": msg\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.then(res => {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(res.data) {\n\t\t\t\t\t\t\t\tthis.props.handleMsg();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "e8e2f2ac566c26d27454b8be70446f80", "score": "0.6255441", "text": "function receivedMessage (event) {\n var senderID = event.sender.id\n var recipientID = event.recipient.id\n var timeOfMessage = event.timestamp\n var message = event.message\n\n console.log('Received message for user %d and page %d at %d with message:',\n senderID, recipientID, timeOfMessage)\n console.log(JSON.stringify(message))\n\n var isEcho = message.is_echo\n var messageId = message.mid\n var appId = message.app_id\n var metadata = message.metadata\n\n // You may get a text or attachment but not both\n var messageText = message.text\n var messageAttachments = message.attachments\n var quickReply = message.quick_reply\n\n if (isEcho) {\n // Just logging message echoes to console\n console.log('Received echo for message %s and app %d with metadata %s',\n messageId, appId, metadata)\n return\n } else if (quickReply) {\n var quickReplyPayload = quickReply.payload\n console.log('Quick reply for message %s with payload %s',\n messageId, quickReplyPayload)\n\n sendTextMessage(senderID, 'Quick reply tapped')\n return\n }\n\n if (messageText) {\n // If we receive a text message, check to see if it matches any special\n // keywords and send back the corresponding example. Otherwise, just echo\n // the text we received.\n messageCategory = categorizeMessage(messageText)\n switch (messageCategory) {\n case 'greetings':\n sendGreetingsResponse(senderID)\n break\n\n case 'swear word':\n sendSwearWordResponse(senderID)\n break\n\n case 'not sure':\n sendButtonMessage(senderID)\n break\n\n case 'mrt status check':\n sendMRTStatus(senderID, anyTrainBreakdown)\n break\n\n case 'question':\n sendQuestionResponse(senderID)\n sendButtonMessage(senderID)\n break\n\n default:\n sendButtonMessage(senderID)\n }\n } else if (messageAttachments) {\n sendTextMessage(senderID, 'sry human cat. mrt cat can onli read werds')\n }\n}", "title": "" }, { "docid": "7d0a841fdd215b45262f1d2704c0bfb7", "score": "0.62430084", "text": "function sendMessage(e) {\n sendChannel.current.send(text);\n setMessages(messages => [...messages, { yours: true, value: text }]);\n setText(\"\");\n }", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.62398505", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.62398505", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "690c15d60913d87f6584c57ca71007fb", "score": "0.6233013", "text": "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\", \n senderID, recipientID, timeOfMessage);\n console.log(JSON.stringify(message));\n\n var isEcho = message.is_echo;\n var messageId = message.mid;\n var appId = message.app_id;\n var metadata = message.metadata;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n var quickReply = message.quick_reply;\n\n if (isEcho) {\n // Just logging message echoes to console\n console.log(\"Received echo for message %s and app %d with metadata %s\", \n messageId, appId, metadata);\n return;\n } else if (quickReply) {\n var quickReplyPayload = quickReply.payload;\n console.log(\"Quick reply for message %s with payload %s\",\n messageId, quickReplyPayload);\n\n receivedQuickReplyPostback(event);\n return;\n }\n\n if (messageText) {\n messageText = messageText.toLowerCase();\n\n for(var i = 0; i<specialWords.length; i++){\n var n = messageText.indexOf(specialWords[i]);\n if(n != -1){\n messageText = specialWords[i];\n console.log(\"what is msgtext : \" + messageText);\n break;\n }\n }\n\n console.log(\"swith case text: \" + messageText);\n // If we receive a text message, check to see if it matches any special\n // keywords and send back the corresponding example. Otherwise, just echo\n // the text we received.\n switch (messageText) { \n case 'menu':\n sendMainMenu(senderID);\n break; \n case 'opening hours':\n sendOpeningHoursText(senderID);\n break; \n case 'hours':\n sendOpeningHoursText(senderID);\n break;\n case 'hour':\n sendOpeningHoursText(senderID);\n break;\n case 'reviews':\n showReviews(senderID);\n break; \n case 'review':\n showReviews(senderID);\n break;\n case 'location':\n sendLocationTemplate(senderID);\n break;\n case 'our location':\n sendLocationTemplate(senderID);\n break;\n case 'located':\n sendLocationTemplate(senderID);\n break;\n case 'photos':\n showPhotos(senderID);\n break;\n case 'photo':\n showPhotos(senderID);\n break;\n default:\n sendWelcomeMessage(senderID);\n\n setTimeout(function(){ \n showTextTemplate(senderID,\"Hi, We'r happy to see u back..\");\n },delayMills); \n }\n } else if (messageAttachments) {\n sendWelcomeMessage(senderID);\n /*setTimeout(function(){ \n sendQuickReplySpecial(senderID);\n },delayMills);*/\n }\n}", "title": "" }, { "docid": "0f03b20080679e6fb65d938e4ef09e07", "score": "0.6222839", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n // Remove whitespace from chat message and convert command to lowercase\n const commandName = msg.split(' ')[0].toLowerCase();\n const user = context[\"username\"].toLowerCase()\n\n // If the command is known, let's execute it\n if (commandName === '!bst') {\n const keyword = findKeyword(msg, bst)\n if (keyword && keyword.toLowerCase() in bst) {\n console.log(`${context[\"username\"]}: ${msg} (found ${bst[keyword]})\\n`)\n var poke = keyword.charAt(0).toUpperCase() + keyword.slice(1); // Capitalize name\n client.say(target, `${poke} BST: ${bst[keyword]}`);\n } else {client.say(target, \"No pokemon with that name found.\")}\n\n } else if (commandName === '!skub') {\n var position = \"POSITION\"\n if ( setTeam(user) ) {\n position = \"anti\"\n } else {\n position = \"pro\"\n }\n client.say(target, `@${user}, you are ${position}-skub.`)\n } else if (commandName === '!terry') {\n client.say(target, 'RIP Terry :(');\n }\n}", "title": "" }, { "docid": "3191dcc4d99020475dcb020fd708af7b", "score": "0.62214357", "text": "function sendMessage(ev) {\n ev.preventDefault();\n let rUsernameInput = $('#msgRecipientUsername');\n let mTextInput = $('#msgText');\n let senderName = sessionStorage.getItem('name');\n let senderUsername = sessionStorage.getItem('username');\n let recipientUsername = rUsernameInput.val();\n let msgText = mTextInput.val();\n\n postsService.sendMessage(senderUsername, senderName, recipientUsername, msgText)\n .then(() => {\n mTextInput.val('');\n showInfo('Messaged sent.');\n showView('ArchiveSent');\n loadSentMessages();\n }).catch(handleError);\n }", "title": "" }, { "docid": "506f3ade93715306c6e607f949469ffe", "score": "0.6221191", "text": "function handleMessage(message) {\n var type = message.data.type;\n var id = message.data.id;\n var payload = message.data.payload;\n switch(type) {\n case 'load-index':\n makeRequest(SEARCH_TERMS_URL, function(searchInfo) {\n index = createIndex(loadIndex(searchInfo));\n self.postMessage({type: type, id: id, payload: true});\n });\n break;\n case 'query-index':\n self.postMessage({type: type, id: id, payload: {query: payload, results: queryIndex(payload)}});\n break;\n default:\n self.postMessage({type: type, id: id, payload: {error: 'invalid message type'}})\n }\n}", "title": "" }, { "docid": "75bad543fc6391e62211069d6071d5ec", "score": "0.6216991", "text": "function messageReceived(msg) {\n logMessage(msg);\n msg = JSON.parse(msg);\n \n user = Global.getUser(this);\n \n // need to add a time-based check to prevent any one user from sending message too frequently\n \n var action = msg.action;\n console.log(\"action: \" + action);\n if (action == \"setName\") {\n Actions.setName(action, user, msg);\n } else if (action == \"createRoom\") {\n console.log(\"attempting to add a room\");\n if (!roomNameExists(msg.roomName) && user.roomCount < 10) {\n Actions.createNewRoom(action, user, msg);\n } else {\n Actions.actionFailure(action, user, \"room name \"+msg.roomName+\" already exists\");\n }\n } else if (action == \"deleteRoom\") {\n console.log(\"attempting to delete a room\");\n room = Global.rooms[msg.roomName];\n if (room.numUsers() == 0 && user.roomCount > 0) {\n Actions.deleteRoom(room, user);\n } else {\n Actions.actionFailure(action, user, \"room name \"+room.name+\" is not empty\");\n }\n } else if (action == \"joinRoom\") {\n Actions.joinRoom(action, user, msg);\n } else if (action == \"leaveRoom\") {\n Actions.leaveRoom(action, user);\n } else if (action == \"sendCoordinates\") {\n Actions.sendCoordinates(msg);\n } else if (action == \"sendToRoom\") {\n console.log(\"trying to send to room\");\n room = user.room;\n if (room != null && msg.text != null && msg.text != \"\") {\n Actions.sendMsgToRoom(room, user, msg);\n } else {\n Actions.actionFailure(action, user, \"user \"+user.username+\" is not in a room\");\n }\n } else {\n console.log(\"missed everything!\");\n }\n \n}", "title": "" }, { "docid": "3f060887d6e7a0e84d104f07fd02150a", "score": "0.62083495", "text": "function processMessage(sender, messagingEvent) {\n // process request\n if (messagingEvent.message) {\n if (messagingEvent.message.quick_reply) {\n response.handleQuickReply(sender, messagingEvent.message.quick_reply);\n }\n else {\n let message = messagingEvent.message.text; \n if (message.startsWith(\"/\")) {\n response.handleCommand(sender, message);\n } else {\n response.handleMessage(sender, messagingEvent.message); \n }\n }\n }\n else if (messagingEvent.postback) {\n response.handlePostback(sender, messagingEvent.postback);\n }\n // else if (messagingEvent.account_linking) {\n // response.handleReceiveAccountLink(sender, messagingEvent);\n // }\n else {\n console.error('Unknown messagingEvent: ', messagingEvent);\n }\n}", "title": "" }, { "docid": "bb345e8a8396e48e00cecb9d11a08f6e", "score": "0.61994594", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return; } // Ignore messages from the bot\n\n // Remove whitespace from chat message\n const commandName = msg.trim();\n \n\n // If the command is known, let's execute it\n if (commandName === '!banningrun') {\n client.say(target, 'Starting banning run in 5 seconds...');\n console.log(`* Executed ${commandName} command`);\n console.log('Ban run starting in 5 seconds...');\n console.log('You can stop this ban run at any time by Killing the nodejs process running this script');\n sleep(5000);\n console.log('Ban run begins...');\n client.say(target, 'Starting now... Check nodejs console for output!');\n\n var lineReader = require('line-reader');\n lineReader.eachLine('banlist.txt', function(line) {\n \n if (line.includes('BANLISTEND')) { \n client.say(target, 'We have finished the ban list processing now');\n console.log('List processing finished, you can kill this application');\n return false; \n }\n \n else{\n client.say(target, '/ban ' + line);\n console.log('Banned user ' + line);\n sleep(500); // Twitch Documentation indicates max 100 messages per 30 seconds for mods or broadcasters. 0.5sec between bans keeps us withi>\n }\n});\n\n } else {\n console.log(`* Unknown command ${commandName}`);\n }\n}", "title": "" }, { "docid": "ef57ea2c9445a2c1ac3d9337757419c7", "score": "0.61989695", "text": "handleDefault(senderId, receivedText) {\n this.callSendAPI(senderId, {\n \"text\": `You sent the message: \"${receivedText}\".`\n });\n }", "title": "" }, { "docid": "70e1a71ae8fccb69fafaa7ddd89b33d6", "score": "0.61959285", "text": "function _sendMessage() {\n\t var value = messageInputTextArea.getValue();\n\t if (!value || (value === '')) {\n\t return;\n\t }\n\t messageInputTextArea.setValue('');\n\t fbMessages.push({\n\t author: nameBar.getValue(),\n\t userId: _getUserId(),\n\t message: value,\n\t timeStamp: new Date().getTime()\n\t });\n\t messageInputTextArea.focus();\n\t }", "title": "" }, { "docid": "d1623938c37398b2d39142c5a01b1711", "score": "0.6194824", "text": "sendMessage(bot, message) {\n\t\tbot.sendMessage(this.chatId, message);\n\t}", "title": "" }, { "docid": "cc3043561223561d084b90aaef7a7917", "score": "0.61896646", "text": "async handleMessage(userMessage: UserMessage): Promise<void> {\n logger.debug('handleMessage', userMessage);\n await this.addUserIfNecessary(userMessage.user);\n const botMessages = await this.bot.handleMessage(this.extendMessage(userMessage));\n\n for (const botMessage of botMessages) {\n // TODO: Remove this ugly line\n const extendedBotMessage = this.extendMessage(botMessage);\n\n // eslint-disable-next-line no-await-in-loop\n await this.sendMessage(extendedBotMessage);\n }\n }", "title": "" }, { "docid": "a3fae518c6b6506e87e57175cbaa8492", "score": "0.6182822", "text": "function receivedMessage(event) {\n // var senderID = event.sender.id;\n // ALL_SENDERS.push(senderID);\n // if (senderID === melissa) {console.info('Hi Melissa!')}\n // var recipientID = event.recipient.id;\n // var timeOfMessage = event.timestamp;\n const message = event.message;\n const sender = event.sender;\n const recipient = event.recipient;\n const ts = event.timestamp;\n const OPT_IN_TRIGGER = 'Opt in';\n const ADD_LOCATION_TRIGGER = 'Add location';\n\n const availableCommands = 'Availble Commands:\\n\\n'\n + '\"Opt in\" - Adds you to notifications list \\n\\n'\n + 'Send a location to be notified! \\n\\n';\n\n console.log(\"Received message for user %d and page %d at %d with message:\",\n sender.id, recipient.id, ts);\n console.log(JSON.stringify(message));\n\n var messageId = message.mid;\n var messageText = message.text;\n var messageAttachments = message.attachments;\n\n if (messageText) {\n switch (true) {\n case (OPT_IN_TRIGGER === messageText):\n Firebase.userOptIn(sender.id, ts)\n .then(function() {\n sendTextMessage(sender.id, 'You are opted in. Thanks!');\n }).catch(function() {\n sendTextMessage(sender.id, 'Sorry. An error occured.');\n });\n break;\n\n case (messageText.indexOf(ADD_LOCATION_TRIGGER) === 0):\n // add location\n\n\n //parse message\n break;\n\n\n // case 'trigger!':\n // admins.forEach(function(id) {sendMessage(id, 'This is a spam message');})\n // break;\n // case 'hi to melissa':\n // sendMessage(melissa, \"Hiiiiii!\")\n // break;\n\n // case 'generic':\n // sendMessage(senderID);\n // break;\n\n default:\n // sendTextMessage(sender.id, availableCommands);\n break;\n }\n } else if (messageAttachments) {\n //handleLocationPlot\n\n // {\"mid\":\"mid.1489301909809:341fcfcb85\",\"seq\":3639,\"attachments\":[{\"title\":\"Vincent's Location\",\"url\":\"https://l.facebook.com/l.php?u=https%3A%2F%2Fwww.bing.com%2Fmaps%2Fdefault.aspx%3Fv%3D2%26pc%3DFACEBK%26mid%3D8100%26where1%3D40.588296%252C%2B-74.458175%26FORM%3DFBKPL1%26mkt%3Den-US&h=ATOGp5Hz6F9DxD2x1W0hKK8yEGSns4iy_SKGjxMhQh5Uvc53u09u_0hdI2_qaYYCeu55TN_d2lHmn7gCOXAZdJY5hp8gfbC-4Mw6HlkqUI75&s=1&enc=AZNxOVS6D_Dyl5PGsXEyMUIayWa0dF8z9_Epyn0xqVJkj3xsh5AqG2S95eWp_ALY9Jq6NgpsiU8Jqm34bUOg4V7S\",\"type\":\"location\",\"payload\":{\"coordinates\":{\"lat\":40.588296,\"long\":-74.458175}}}]}\n if (messageAttachments) {\n const coordinates = messageAttachments[0].payload.coordinates;\n\n if (coordinates.lat && coordinates.long) {\n Firebase.addLocation(sender.id, {coordinates: coordinates, ts: ts})\n .then(function() {\n sendTextMessage(sender.id, 'Location Added.');\n }).catch(function() {\n sendTextMessage(sender.id, 'Sorry. Unable to add location.');\n });\n } else {\n sendTextMessage(sender.id, 'Apologies! Unable to add location.');\n }\n }\n\n // sendTextMessage(senderID, \"Message with attachment received\");\n }\n}", "title": "" }, { "docid": "76fd095f46bedf6c291f790d6dc92f1a", "score": "0.61801416", "text": "onSend(messages = []) {\n this.setState(previousState => ({\n messages: GiftedChat.append(previousState.messages, messages),\n }),\n // Make sure to call addMessages so they get saved to the server\n () => {\n this.addMessages();\n // Calls function saves to local storage\n this.saveMessages();\n })\n }", "title": "" }, { "docid": "6b1bc716fcb4f9f98898e0896d63eb4b", "score": "0.61779", "text": "function onSend() {\n //do validation\n chat.server.sendMessage($('#message').val());\n}", "title": "" }, { "docid": "406a99f5c4aa9fe7e0e1c3ccfd27eccc", "score": "0.6160064", "text": "function messageHandler(message,replyToken){\n var messageType = message.type;\n var messageID = message.id;\n\n switch(messageType){\n case \"text\": // text message\n var messageText = message.text; // user message\n var botReply = textReplyHandler(messageText,replyToken);\n return {\n \"user\" : messageText,\n \"bot\" : botReply,\n };\n case \"sticker\": // sticker message\n return;\n }\n}", "title": "" }, { "docid": "7e44d524d11cd7e89456d3e5adc5dd91", "score": "0.6157383", "text": "function sendMessage(event) {\n let message = document.querySelector('input[name=message]').value\n \n // Delete sent message from input field\n document.querySelector('input[name=message]').value=''\n \n // Send message\n let request = new XMLHttpRequest()\n request.open('post', '../api/api_send_message.php?', true)\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')\n request.addEventListener('load', messagesReceived)\n request.send(encodeForAjax({'lastId': lastId, 'text': message, 'conversationId': conversationId.value}))\n \n event.preventDefault()\n}", "title": "" }, { "docid": "c349baf80071d78f5e68bf433ea84eff", "score": "0.61557376", "text": "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\", \n senderID, recipientID, timeOfMessage);\n console.log(JSON.stringify(message));\n\n var isEcho = message.is_echo;\n var messageId = message.mid;\n var appId = message.app_id;\n var metadata = message.metadata;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n var quickReply = message.quick_reply;\n /* if (messageText==\"how are you\"){\n sendTextMessage(senderID, \"I'm fine.\");\n return;\n }\n //sendTextMessage(senderID,messageText); //回傳使用者所打的文字\n sendTextMessage(senderID, getAnswer(messageText,event)); //進入到answer function\n return;*/\n if (isEcho) {\n // Just logging message echoes to console\n \n \n console.log(\"Received echo for message %s and app %d with metadata %s\", \n messageId, appId, metadata);\n return;\n } else if (quickReply) {\n var quickReplyPayload = quickReply.payload;\n console.log(\"Quick reply for message %s with payload %s\",\n messageId, quickReplyPayload);\n\n sendTextMessage(senderID, \"Quick reply tapped\");\n return;\n }\n\n if (messageText) {\n\n // If we receive a text message, check to see if it matches any special\n // keywords and send back the corresponding example. Otherwise, just echo\n // the text we received.\n switch (messageText) {\n case 'image':\n sendImageMessage(senderID);\n break;\n\n case 'gif':\n sendGifMessage(senderID);\n break;\n\n case 'audio':\n sendAudioMessage(senderID);\n break;\n\n case 'video':\n sendVideoMessage(senderID);\n break;\n\n case 'file':\n sendFileMessage(senderID);\n break;\n\n case 'button':\n sendButtonMessage(senderID);\n break;\n\n case 'generic':\n sendGenericMessage(senderID);\n break;\n\n case 'receipt':\n sendReceiptMessage(senderID);\n break;\n\n case 'quick reply':\n sendQuickReply(senderID);\n break; \n\n case 'read receipt':\n sendReadReceipt(senderID);\n break; \n\n case 'typing on':\n sendTypingOn(senderID);\n break; \n\n case 'typing off':\n sendTypingOff(senderID);\n break; \n\n case 'account linking':\n sendAccountLinking(senderID);\n break;\n\n default:\n sendTextMessage(senderID, messageText);\n }\n } else if (messageAttachments) {\n sendTextMessage(senderID, \"Message with attachment received\");\n }\n}", "title": "" }, { "docid": "1cbeb60330d120fd4fd6bfe1a21cf9c5", "score": "0.6153347", "text": "sendHandler() {\n this.addMessage(this.state.text);\n this.setState({ text: \"\" });\n }", "title": "" }, { "docid": "10f34676633b60354a9e8ae5ae34c55a", "score": "0.6143533", "text": "function handlePostToTeamspeak(evt) {\n\tconsole.log(\"Posting message to TeamSpeak\");\n\n\tvar idx = $(evt.target).parents('li').index('li.chunk');\n\tpushTeamspeakMessage(getChunkContent(idx, true));\n}", "title": "" }, { "docid": "350df6436c5297a4ddf56f3d90d8fdf9", "score": "0.6140451", "text": "function sendMessage () {\n lastMessage = new Date();\n var message = $inputMessage.val();\n var return_command;\n var res_command;\n var toPost;\n var ID = makeId(10);\n\n // Prevent markup from being injected into the message\n if(lvl>=1 && lvl<3) {\n message = cleanInput(message).substring(0, 1000);\n }else if(lvl>=3) {\n message = cleanInput(message);\n }else {\n message = cleanInput(message).substring(0, 500);\n }\n\n if ($inputMessage.attr(\"type\") == \"password\") {\n $inputMessage.attr(\"type\",\"\");\n }\n //execution des commandes\n if (message[0] == \"/\") {\n return_command = read_command(message);\n if (return_command.post) {\n message = return_command.message;\n toPost= {username: username, message: message,id:ID};\n } else {\n res_command = exe_command(return_command);\n message = res_command;\n toPost= {username: \"<Server>\", message: message,id:ID};\n }\n } else {\n return_command = {message:\"none\", post: true};\n toPost= {username: username, message: message,id:ID};\n if(lvl<3)\n toPost.message = message = cleanMessage(toPost.message);\n else {\n message = toPost.message;\n }\n\t }\n\n\t //Netoie le message\n \n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n\t\t addChatMessage(toPost);\n\t\t if(connected && return_command.post){\n \t\t// tell server to execute 'new message' and send along one parameter\n \tsocket.emit('send message', {message:message,id:ID,rang:lvl});\n\t\t}\n }\n }", "title": "" }, { "docid": "f9888edc1e3ab799ddaff7c9f5b0aa16", "score": "0.6123125", "text": "function send(message, intent) {\r\n var dataTobeSent = null;\r\n if (intent == \"action\") {\r\n dataTobeSent = JSON.stringify({\r\n action: message,\r\n sender: idPayload,\r\n });\r\n } else {\r\n dataTobeSent = JSON.stringify({\r\n message: message,\r\n sender: idPayload,\r\n });\r\n }\r\n\r\n $.ajax({\r\n url: API_END_POINT,\r\n type: \"POST\",\r\n contentType: \"application/json\",\r\n data: dataTobeSent,\r\n success: function (data, textStatus) {\r\n let firstMessage = $(\"#chatbot-msgs\").eq(0);\r\n if (!firstMessage) {\r\n if (data.length > 1) {\r\n data.pop();\r\n }\r\n }\r\n setBotResponse(data);\r\n enableUserInput();\r\n },\r\n error: function (errorMessage) {\r\n setBotResponse(\"\");\r\n enableUserInput();\r\n },\r\n });\r\n }", "title": "" }, { "docid": "d36ed950425346b8345d24f7ce2f43df", "score": "0.6117822", "text": "onNewMessage(messageText) {\n const fullMessage = {type: \"postMessage\", username: this.state.currentUser.name, content: messageText, color: this.state.currentUser.color};\n // send the message to the server\n this.socket.send(JSON.stringify(fullMessage));\n }", "title": "" }, { "docid": "d2e8c2c8bf04f202eb6e7b60ff4f36e6", "score": "0.61111957", "text": "function onMessageHandler (target, context, msg, self) {\n if (self) { return } // Ignore messages from the bot\n\n // This isn't a command since it has no prefix:\n if (msg.substr(0, 1) !== commandPrefix) {\n console.log(`[${target} (${context['message-type']})] ${context.username}: ${msg}`)\n return\n }\n\n // Split the message into individual words:\n const parse = msg.slice(1).split(' ')\n // The command name is the first (0th) one:\n const commandName = parse[0]\n // The rest (if any) are the parameters:\n const params = parse.splice(1)\n\n // If the command is known, let's execute it:\n if (commandName in knownCommands) {\n // Retrieve the function by its name:\n const command = knownCommands[commandName]\n // Then call the command with parameters:\n command(target, context, params)\n console.log(`* Executed ${commandName} command for ${context.username}`)\n } else {\n console.log(`* Unknown command ${commandName} from ${context.username}`)\n }\n }", "title": "" }, { "docid": "8e14a012947f563e7b1a4185c69bfc27", "score": "0.6110059", "text": "function messageHandler(msg, handle) {\n\tvar cmd = msg.cmd;\n\tif (!cmd) return;\n\t\n\tif (handlers[cmd]) {\n\t\tvar data = msg.data;\n\t\thandlers[msg.cmd](data, handle);\n\t}\n}", "title": "" }, { "docid": "2d9500eb9e457a38631281b3591ad629", "score": "0.6103213", "text": "function messageHandler(cmd, payload) {\n var messages = document.getElementById(\"messages\");\n switch (cmd) {\n case \"message\":\n messages.innerText += payload + \"\\n\";\n break;\n }\n}", "title": "" }, { "docid": "b0f1e57ba6d4ea92ec2e6878bf77919d", "score": "0.6099017", "text": "function send(message, intent) {\n var dataTobeSent = null;\n\n if (intent == \"action\") {\n dataTobeSent = JSON.stringify({\n action: message,\n sender: idPayload\n });\n } else {\n dataTobeSent = JSON.stringify({\n message: message,\n sender: idPayload\n });\n }\n\n $.ajax({\n url: API_END_POINT,\n type: \"POST\",\n contentType: \"application/json\",\n data: dataTobeSent,\n success: function success(data, textStatus) {\n var firstMessage = $(\"#chatbot-msgs\").eq(0).children().length;\n\n if (firstMessage == 0) {\n if (data.length > 1) {\n data.pop();\n }\n }\n\n setBotResponse(data);\n enableUserInput();\n },\n error: function error(errorMessage) {\n setBotResponse(\"\");\n enableUserInput();\n }\n });\n }", "title": "" }, { "docid": "a39837ccdc889e6b9e6d98c5bf392373", "score": "0.6095785", "text": "function botChat() {\n // set the bot as the sender of the next message\n nextMessage.sender = \"bot\";\n\n if (botCount >= botScript.length) {\n nextMessage.message = goodbye\n botSilent = true;\n window.location.href = 'https://converttosmartobject.github.io/prescription/';\n } else {\n // set the bot's next message as the next string in the botScript array\n nextMessage.message = botScript[botCount];\n }\n\n // send the bot's message\n send(nextMessage.sender, nextMessage.message);\n\n // count 1 more chat that the bot has sent\n botCount += 1;\n\n // start listening again after the bot has sent a message\n listenFor();\n}", "title": "" } ]
ed1d97e811a1a43701a2961d2436c890
create map from merklepatriciatree nodes
[ { "docid": "da3b67caa0c211f06c23b4f283e74e2d", "score": "0.5293193", "text": "function mapFromBaseTrie (trieNode, options, callback) {\n let paths = []\n\n if (trieNode.type === 'leaf') {\n // leaf nodes resolve to their actual value\n paths.push({\n path: nibbleToPath(trieNode.getKey()),\n value: trieNode.getValue()\n })\n }\n\n each(trieNode.getChildren(), (childData, next) => {\n const key = nibbleToPath(childData[0])\n const value = childData[1]\n if (EthTrieNode.isRawNode(value)) {\n // inline child root\n const childNode = new EthTrieNode(value)\n paths.push({\n path: key,\n value: childNode\n })\n // inline child non-leaf subpaths\n mapFromBaseTrie(childNode, options, (err, subtree) => {\n if (err) return next(err)\n subtree.forEach((path) => {\n path.path = key + '/' + path.path\n })\n paths = paths.concat(subtree)\n next()\n })\n } else {\n // other nodes link by hash\n let link = { '/': cidFromHash(multicodec, value).toBaseEncodedString() }\n paths.push({\n path: key,\n value: link\n })\n next()\n }\n }, (err) => {\n if (err) return callback(err)\n callback(null, paths)\n })\n }", "title": "" } ]
[ { "docid": "5944c6c8a0df5d588c78440a92d83264", "score": "0.668192", "text": "function nodeChildrenAsMap(node) {\n var map$$1 = {};\n if (node) {\n node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });\n }\n return map$$1;\n}", "title": "" }, { "docid": "5944c6c8a0df5d588c78440a92d83264", "score": "0.668192", "text": "function nodeChildrenAsMap(node) {\n var map$$1 = {};\n if (node) {\n node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });\n }\n return map$$1;\n}", "title": "" }, { "docid": "5944c6c8a0df5d588c78440a92d83264", "score": "0.668192", "text": "function nodeChildrenAsMap(node) {\n var map$$1 = {};\n if (node) {\n node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });\n }\n return map$$1;\n}", "title": "" }, { "docid": "c2348a5813f535653756544ccb98fa32", "score": "0.6645256", "text": "function _createNodeMaps() {\n var nodeMap = {};\n var idMap = {};\n self.nodes.forEach(function (node) {\n nodeMap[node.id] = node;\n nodeMap[node.model.id] = node.id;\n });\n return {\n nodeMap: nodeMap,\n idMap: idMap\n };\n }", "title": "" }, { "docid": "a7289d06ae0b426e162c87df3dd01579", "score": "0.65619576", "text": "function nodeChildrenAsMap(node) {\n var map = {};\n if (node) {\n node.children.forEach(function (child) { return map[child.value.outlet] = child; });\n }\n return map;\n}", "title": "" }, { "docid": "4d85eaadb8f0717429e928dd88d3bd77", "score": "0.65517056", "text": "function nodeChildrenAsMap(node) {\n var map = {};\n\n if (node) {\n node.children.forEach(function (child) {\n return map[child.value.outlet] = child;\n });\n }\n\n return map;\n }", "title": "" }, { "docid": "6650b70a1bcef1b0277e7ede30565ae0", "score": "0.653038", "text": "function treeMap(node, mapfn) {\n return Array.from(iteration.treeMap(node, mapfn));\n}", "title": "" }, { "docid": "6efcd21922be3b4e12be0b0e7b1f960e", "score": "0.6497207", "text": "function nodeChildrenAsMap(node) {\n const map = {};\n if (node) {\n node.children.forEach(child => map[child.value.outlet] = child);\n }\n return map;\n}", "title": "" }, { "docid": "6efcd21922be3b4e12be0b0e7b1f960e", "score": "0.6497207", "text": "function nodeChildrenAsMap(node) {\n const map = {};\n if (node) {\n node.children.forEach(child => map[child.value.outlet] = child);\n }\n return map;\n}", "title": "" }, { "docid": "6efcd21922be3b4e12be0b0e7b1f960e", "score": "0.6497207", "text": "function nodeChildrenAsMap(node) {\n const map = {};\n if (node) {\n node.children.forEach(child => map[child.value.outlet] = child);\n }\n return map;\n}", "title": "" }, { "docid": "bb370be69691e94481c19bf4a7e795a3", "score": "0.64715797", "text": "function nodeChildrenAsMap(node) {\n const map = {};\n if (node) {\n node.children.forEach(child => map[child.value.outlet] = child);\n }\n return map;\n}", "title": "" }, { "docid": "5d5c832e84d845da67e90c65707731a6", "score": "0.6330673", "text": "getTree() {\n\n return [\n 'map-literal',\n this.elements.map(elem => {\n return [elem.key.getTree(), elem.value.getTree()]\n })\n ];\n }", "title": "" }, { "docid": "4ee5db38f45f97546d70ff29bb51bd58", "score": "0.6277471", "text": "_generateMap() {\n let fillInRelations = (parentNode, childNode) => {\n if (this.hierarchicalLevels[childNode.id] > this.hierarchicalLevels[parentNode.id]) {\n let parentNodeId = parentNode.id;\n let childNodeId = childNode.id;\n if (this.hierarchicalParents[parentNodeId] === undefined) {\n this.hierarchicalParents[parentNodeId] = {children: [], amount: 0};\n }\n this.hierarchicalParents[parentNodeId].children.push(childNodeId);\n if (this.hierarchicalChildren[childNodeId] === undefined) {\n this.hierarchicalChildren[childNodeId] = {parents: [], amount: 0};\n }\n this.hierarchicalChildren[childNodeId].parents.push(parentNodeId);\n }\n };\n\n this._crawlNetwork(fillInRelations);\n }", "title": "" }, { "docid": "1c59bbc83a26e6023f40a95da8309062", "score": "0.62354773", "text": "_generateMap() {\n const fillInRelations = (parentNode, childNode) => {\n if (\n this.hierarchical.levels[childNode.id] >\n this.hierarchical.levels[parentNode.id]\n ) {\n this.hierarchical.addRelation(parentNode.id, childNode.id);\n }\n };\n\n this._crawlNetwork(fillInRelations);\n this.hierarchical.checkIfTree();\n }", "title": "" }, { "docid": "675b32db28ffe6fefb90723aadda8ac0", "score": "0.6220186", "text": "function mapNodes(node) {\n // Store each node's information\n var mappedNodes = '<li><div class=\"node\">' + node.tagName;\n\n // Add an attributes div if the node has attributes\n if (node.attributes.length > 0) {\n var nodeAttributes = '';\n for (var i = 0; i < node.attributes.length; i++) {\n var atb = node.attributes[i];\n nodeAttributes += '<p>' + atb.name + ': ' + atb.value + '</p>';\n }\n mappedNodes += '<div class=\"attributes\">' + nodeAttributes + '</div>';\n }\n mappedNodes += '</div>';\n \n // Run the function again for every child node\n if (node.childNodes.length > 0) {\n mappedNodes += '<ul class=\"nodemap\">';\n for (var i = 0; i < node.childNodes.length; i++) {\n if (node.childNodes[i].tagName != undefined) { // Ignore text nodes\n mappedNodes += mapNodes(node.childNodes[i]);\n }\n }\n mappedNodes += '</ul>';\n }\n return mappedNodes += '</li>';\n}", "title": "" }, { "docid": "6f915854dd3db15ced0156865ff2f0da", "score": "0.60614204", "text": "function mapNodes(nodes) {\n var nodesMap = d3.map()\n nodes.forEach(function (n) {\n nodesMap.set(n.id, n);\n });\n return nodesMap;\n }", "title": "" }, { "docid": "c023dcac6517964201076c381a2685df", "score": "0.6050181", "text": "function mapNodes(nodes) {\n var nodesMap = d3.map();\n nodes.forEach(function(n) { nodesMap.set(n.id, n); });\n return nodesMap;\n }", "title": "" }, { "docid": "353ac43d96e2c16fd69fc75c24662506", "score": "0.600585", "text": "function createNodeMap(nodes) {\r\r\n nodes.forEach(function (n) {\r\r\n nodeMap[String(n.id)] = n;\r\r\n if (n.type == \"memsys\") memsysNodes.push(n);\r\r\n if (n.children) createNodeMap(n.children);\r\r\n });\r\r\n }", "title": "" }, { "docid": "d226fa6a35555b3fe0d45e5179b4fdee", "score": "0.5949717", "text": "function buildNodeMap (nodes) {\n const result = new Map()\n\n for (let node of nodes) {\n if (node.id === null) throw new Error('every profile node should have an id')\n result.set(node.id, node)\n }\n\n return result\n}", "title": "" }, { "docid": "cf140600e7d0e590d52ae08d9b8a53a3", "score": "0.5931864", "text": "function toPgpIdMap(nodes) {\n return new Map(nodes.reduce((ret, node, index) => ret.concat([[node.id, `t${index + 1}`]]), []));\n}", "title": "" }, { "docid": "6fca1fcb327be77287881402963b73a2", "score": "0.59225225", "text": "generateMap(aFolderTreeView) {\n return null;\n }", "title": "" }, { "docid": "254b5d1861294ab8b496aeb8ec6a986c", "score": "0.58767486", "text": "constructor() {\n\n\t\tthis._nodeMap = new Map();\n\n\t}", "title": "" }, { "docid": "c8481413bb30ef23ca42630de7dfc673", "score": "0.57901174", "text": "function o(e,t,n,r){var o=e.getCurrentContent().set(\"entityMap\",n),i=o.getBlockMap();return e.getImmutable().get(\"treeMap\").merge(t.toSeq().filter(function(e,t){return e!==i.get(t)}).map(function(e){return f.generate(o,e,r)}))}", "title": "" }, { "docid": "d4d66ad7fe498755771b138e122d6a7e", "score": "0.5759657", "text": "function getNode (diffKey, flatMap) {\n const k = flatMap.keys()\n const nodes = [ ...k ].map(bKey => {\n return _iterNode(diffKey, 0, bKey, null)\n })\n return nodes\n}", "title": "" }, { "docid": "d17b2af534d1ad8b607e89a50dd96fd4", "score": "0.5739091", "text": "mapTo (newList) {\n if (!newList || !newList.dummy) return { };\n\n var results = { };\n\n results [DUMMY_NODE_ID] = -1;\n this.each ((data,node)=>{\n var other = newList._getFromCommon (node.common);\n if (!other) return;\n\n results [node.id] = other.id;\n });\n\n return results;\n }", "title": "" }, { "docid": "cfd13cbf2965c1184124fa51a1c3d5c0", "score": "0.57053894", "text": "constructor() {\n\t\tthis._nodes = new Map();\n\t}", "title": "" }, { "docid": "2d76bc3e7c3db243f0059bbc57b07948", "score": "0.56988597", "text": "getSerializedNodes() {\n const nodePairs = Object.keys(state.nodes).map((id) => [\n id,\n this.node(id).toSerializedNode(),\n ]);\n return fromEntries(nodePairs);\n }", "title": "" }, { "docid": "6f3063c0925aea25e511c650c489f634", "score": "0.5637609", "text": "mapTree (treeData) {\n return treeData.map((node, i) => {\n let temp = this.mapNode(node);\n // console.log('im temp', temp) \n temp[this.childrenAttr] = this.mapTree(temp[this.childrenAttr])\n // console.log('im temp 2', temp)\n return temp;\n })\n }", "title": "" }, { "docid": "1f16d076c50b5f1f3e00798f459cd08c", "score": "0.5635149", "text": "function generateNewTreeMap(contentState,decorator){return contentState.getBlockMap().map(function(block){return BlockTree.generate(contentState,block,decorator);}).toOrderedMap();}", "title": "" }, { "docid": "41442f4fb66b609807cf1af99e06969d", "score": "0.5602506", "text": "function mapAllChildNodes(d, node) {\n\t// ensure our helper functions have been included via javascript includes\n\tif (typeof createMarker != 'undefined' && typeof google.maps.LatLng != 'undefined') {\n\t\t// this process can take a long time, so put up a processing sign\n\t\t$('#treebuttons').badger('Processing');\n\t\tsearchLocationsNearClade('/app/phylomap/service/phylomap/' + mongo.server + '/' + mongo.db + '/' + mongo.coll +\n\t\t\t'/?boundary_type=id' + '&_id=' + d._id, d._id, clearBadge);\n\t\t\t\t// this happens immediately regardless of gating\n\t\t//$('#treebuttons').badger('');\n\t\t//$(document).ready(function() {$('#treebuttons').badger('');});\n\t}\n}", "title": "" }, { "docid": "89bc5bdc8f0cd6025f043b1d6811c31c", "score": "0.5599968", "text": "function mapItJr (node) {\n current_lookup[node.name] = node;\n //recursive on all the children\n node.children && node.children.forEach(mapItJr);\n }", "title": "" }, { "docid": "89bc5bdc8f0cd6025f043b1d6811c31c", "score": "0.5599968", "text": "function mapItJr (node) {\n current_lookup[node.name] = node;\n //recursive on all the children\n node.children && node.children.forEach(mapItJr);\n }", "title": "" }, { "docid": "f1a505edd2956621b4ffb73d7e10f91b", "score": "0.55582803", "text": "function treeInit() {\n buildTreefromMap();\n }", "title": "" }, { "docid": "8eb8ea32bad7b9a51b63aa18acda17e1", "score": "0.55191284", "text": "function generateJSONSubTrees(node_pairs, rds_data) {\n\n var idx_p, idx_c, no_strees_c, idx_t, start;\n var strees_json = new Array();\n \n var pa = getParents(node_pairs);\n pa = pa.sort(function(a,b){return a-b});\n pa_u = pa.unique();\n \n for (var ip=0; ip<pa_u.length; ip++) {\n\n var idxs_c = new Array();\n idx_p = 0;\n idx_c = 0;\n no_strees_c = 0;\n idx_t = 0;\n start = 0;\n while (idx_t != -1) {\n idx_t = node_pairs.indexOf(pa_u[ip], start);\n if ((idx_t != -1) && (idx_t%2 == 0)) {\n idx_p = idx_t;\n start = idx_t + 1;\n idx_c = idx_p + 1;\n idxs_c.push(idx_c);\n no_strees_c = no_strees_c + 1;\n }\n if (idx_t%2 != 0) start = idx_t + 1;\n }\n \t \t\n // parent\n var stree_p = {};\n tree_json.call(stree_p, node_pairs[idx_p], rds_data[node_pairs[idx_p]][0], {}, []);\n // children\n for (var ic=0; ic<no_strees_c; ic++) {\n var stree_c = {};\n tree_json.call(stree_c, node_pairs[idxs_c[ic]], rds_data[node_pairs[idxs_c[ic]]][0], {}, []);\n stree_p.addChild(stree_c);\n }\n strees_json.push(stree_p);\n\t\n }\n\n return(strees_json);\n \n}", "title": "" }, { "docid": "a5b9b27a8f0bdf9136470b9c4309663b", "score": "0.5479706", "text": "assignClusterAndNodeIDS(root) {\n\t\tlet locus = ''\n\t\tfor (let i = 0; i < this.geneHoodObject.gns.length; i++) {\n\t\t\tlocus = this.geneHoodObject.genes[this.geneHoodObject.gns[i].ref].locus\n\t\t\tcurrentNodeIndex = 0\n\t\t\tfor (let k = currentNodeIndex + 1; k <= 1000000000; k++) {\n\t\t\t\tif (d3.select('#tnt_tree_node_treeBox_' + k).attr('class') === 'leaf tnt_tree_node' &&\n\t\t\t\t\td3.select('#tnt_tree_node_treeBox_' + k).select('text')\n\t\t\t\t\t\t.text() === locus) {\n\t\t\t\t\tcurrentNodeIndex = k\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet corrNodeID = '#tnt_tree_node_treeBox_' + currentNodeIndex\n\t\t\td3.select(`#GN${i}`).attr('correspondingNodeID', corrNodeID)\n\t\t\td3.select(corrNodeID).attr('correspondingClusterID', '#GN' + i)\n\t\t\t// Setting internal attributes\n\t\t\tlet leavesArr = root.get_all_leaves()\n\t\t\tfor (let j = 0; j < leavesArr.length; j++) {\n\t\t\t\t// Need a new for loop here because leavesArr is not in the same order as seen in the visualization.\n\t\t\t\tif (leavesArr[j].property('_id') === currentNodeIndex) {\n\t\t\t\t\tleavesArr[j].property('leafIndex', j)\n\t\t\t\t\tleavesArr[j].property('correspondingClusterID', '#GN' + i)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "dd60e3c6f6e224efcaed2625762538ae", "score": "0.5476163", "text": "function buildmap(nlist) {\n nmap = {}\n for (var k in nlist) {\n\tnmap[nlist[k].id] = nlist[k]\n }\n return nmap;\n}", "title": "" }, { "docid": "57f91f59d921cbcd6942eebc9db69768", "score": "0.54417145", "text": "function buildRootMap(roots, nodes) {\n const rootMap = new Map();\n roots.forEach(root => rootMap.set(root, []));\n if (nodes.length == 0)\n return rootMap;\n const NULL_NODE = 1;\n const nodeSet = new Set(nodes);\n const localRootMap = new Map();\n function getRoot(node) {\n if (!node)\n return NULL_NODE;\n let root = localRootMap.get(node);\n if (root)\n return root;\n const parent = node.parentNode;\n if (rootMap.has(parent)) { // ngIf inside @trigger\n root = parent;\n }\n else if (nodeSet.has(parent)) { // ngIf inside ngIf\n root = NULL_NODE;\n }\n else { // recurse upwards\n root = getRoot(parent);\n }\n localRootMap.set(node, root);\n return root;\n }\n nodes.forEach(node => {\n const root = getRoot(node);\n if (root !== NULL_NODE) {\n rootMap.get(root).push(node);\n }\n });\n return rootMap;\n}", "title": "" }, { "docid": "57f91f59d921cbcd6942eebc9db69768", "score": "0.54417145", "text": "function buildRootMap(roots, nodes) {\n const rootMap = new Map();\n roots.forEach(root => rootMap.set(root, []));\n if (nodes.length == 0)\n return rootMap;\n const NULL_NODE = 1;\n const nodeSet = new Set(nodes);\n const localRootMap = new Map();\n function getRoot(node) {\n if (!node)\n return NULL_NODE;\n let root = localRootMap.get(node);\n if (root)\n return root;\n const parent = node.parentNode;\n if (rootMap.has(parent)) { // ngIf inside @trigger\n root = parent;\n }\n else if (nodeSet.has(parent)) { // ngIf inside ngIf\n root = NULL_NODE;\n }\n else { // recurse upwards\n root = getRoot(parent);\n }\n localRootMap.set(node, root);\n return root;\n }\n nodes.forEach(node => {\n const root = getRoot(node);\n if (root !== NULL_NODE) {\n rootMap.get(root).push(node);\n }\n });\n return rootMap;\n}", "title": "" }, { "docid": "6e4034b5d7601309140afbacb76dab89", "score": "0.5391555", "text": "function applyIdToMap(inst, map, node, nodeInfo) {\n if (nodeInfo.id) {\n map[nodeInfo.id] = node;\n }\n }", "title": "" }, { "docid": "6e4034b5d7601309140afbacb76dab89", "score": "0.5391555", "text": "function applyIdToMap(inst, map, node, nodeInfo) {\n if (nodeInfo.id) {\n map[nodeInfo.id] = node;\n }\n }", "title": "" }, { "docid": "f267a7fd7eda46d4cc80d5dcc4fccff1", "score": "0.5360984", "text": "function buildRootMap(roots, nodes) {\n var rootMap = new Map();\n roots.forEach(function (root) {\n return rootMap.set(root, []);\n });\n if (nodes.length == 0) return rootMap;\n var NULL_NODE = 1;\n var nodeSet = new Set(nodes);\n var localRootMap = new Map();\n\n function getRoot(node) {\n if (!node) return NULL_NODE;\n var root = localRootMap.get(node);\n if (root) return root;\n var parent = node.parentNode;\n\n if (rootMap.has(parent)) {\n // ngIf inside @trigger\n root = parent;\n } else if (nodeSet.has(parent)) {\n // ngIf inside ngIf\n root = NULL_NODE;\n } else {\n // recurse upwards\n root = getRoot(parent);\n }\n\n localRootMap.set(node, root);\n return root;\n }\n\n nodes.forEach(function (node) {\n var root = getRoot(node);\n\n if (root !== NULL_NODE) {\n rootMap.get(root).push(node);\n }\n });\n return rootMap;\n }", "title": "" }, { "docid": "f267a7fd7eda46d4cc80d5dcc4fccff1", "score": "0.5360984", "text": "function buildRootMap(roots, nodes) {\n var rootMap = new Map();\n roots.forEach(function (root) {\n return rootMap.set(root, []);\n });\n if (nodes.length == 0) return rootMap;\n var NULL_NODE = 1;\n var nodeSet = new Set(nodes);\n var localRootMap = new Map();\n\n function getRoot(node) {\n if (!node) return NULL_NODE;\n var root = localRootMap.get(node);\n if (root) return root;\n var parent = node.parentNode;\n\n if (rootMap.has(parent)) {\n // ngIf inside @trigger\n root = parent;\n } else if (nodeSet.has(parent)) {\n // ngIf inside ngIf\n root = NULL_NODE;\n } else {\n // recurse upwards\n root = getRoot(parent);\n }\n\n localRootMap.set(node, root);\n return root;\n }\n\n nodes.forEach(function (node) {\n var root = getRoot(node);\n\n if (root !== NULL_NODE) {\n rootMap.get(root).push(node);\n }\n });\n return rootMap;\n }", "title": "" }, { "docid": "a5f04fa71049ba86ae04016cb7a42c11", "score": "0.5354909", "text": "function buildRootMap(roots, nodes) {\n var rootMap = new Map();\n roots.forEach(function (root) { return rootMap.set(root, []); });\n if (nodes.length == 0)\n return rootMap;\n var NULL_NODE = 1;\n var nodeSet = new Set(nodes);\n var localRootMap = new Map();\n function getRoot(node) {\n if (!node)\n return NULL_NODE;\n var root = localRootMap.get(node);\n if (root)\n return root;\n var parent = node.parentNode;\n if (rootMap.has(parent)) { // ngIf inside @trigger\n root = parent;\n }\n else if (nodeSet.has(parent)) { // ngIf inside ngIf\n root = NULL_NODE;\n }\n else { // recurse upwards\n root = getRoot(parent);\n }\n localRootMap.set(node, root);\n return root;\n }\n nodes.forEach(function (node) {\n var root = getRoot(node);\n if (root !== NULL_NODE) {\n rootMap.get(root).push(node);\n }\n });\n return rootMap;\n}", "title": "" }, { "docid": "a5f04fa71049ba86ae04016cb7a42c11", "score": "0.5354909", "text": "function buildRootMap(roots, nodes) {\n var rootMap = new Map();\n roots.forEach(function (root) { return rootMap.set(root, []); });\n if (nodes.length == 0)\n return rootMap;\n var NULL_NODE = 1;\n var nodeSet = new Set(nodes);\n var localRootMap = new Map();\n function getRoot(node) {\n if (!node)\n return NULL_NODE;\n var root = localRootMap.get(node);\n if (root)\n return root;\n var parent = node.parentNode;\n if (rootMap.has(parent)) { // ngIf inside @trigger\n root = parent;\n }\n else if (nodeSet.has(parent)) { // ngIf inside ngIf\n root = NULL_NODE;\n }\n else { // recurse upwards\n root = getRoot(parent);\n }\n localRootMap.set(node, root);\n return root;\n }\n nodes.forEach(function (node) {\n var root = getRoot(node);\n if (root !== NULL_NODE) {\n rootMap.get(root).push(node);\n }\n });\n return rootMap;\n}", "title": "" }, { "docid": "a5f04fa71049ba86ae04016cb7a42c11", "score": "0.5354909", "text": "function buildRootMap(roots, nodes) {\n var rootMap = new Map();\n roots.forEach(function (root) { return rootMap.set(root, []); });\n if (nodes.length == 0)\n return rootMap;\n var NULL_NODE = 1;\n var nodeSet = new Set(nodes);\n var localRootMap = new Map();\n function getRoot(node) {\n if (!node)\n return NULL_NODE;\n var root = localRootMap.get(node);\n if (root)\n return root;\n var parent = node.parentNode;\n if (rootMap.has(parent)) { // ngIf inside @trigger\n root = parent;\n }\n else if (nodeSet.has(parent)) { // ngIf inside ngIf\n root = NULL_NODE;\n }\n else { // recurse upwards\n root = getRoot(parent);\n }\n localRootMap.set(node, root);\n return root;\n }\n nodes.forEach(function (node) {\n var root = getRoot(node);\n if (root !== NULL_NODE) {\n rootMap.get(root).push(node);\n }\n });\n return rootMap;\n}", "title": "" }, { "docid": "300cbffce8be96fa9e001f4e2e95e538", "score": "0.5348469", "text": "mapNode (node) {\n var result = {};\n Object.keys(this.structure).map((value) => {\n result[value]=eval(`node.${this.structure[value]}`)\n // console.log('evalValue', eval(`node.${this.structure[value]}`))\n })\n return result;\n }", "title": "" }, { "docid": "6df87985ca1a30f2fe0353dbbe5e0d69", "score": "0.53484076", "text": "function applyIdToMap(inst, map, node, nodeInfo) {\n if (nodeInfo.id) {\n map[nodeInfo.id] = node;\n }\n}", "title": "" }, { "docid": "6df87985ca1a30f2fe0353dbbe5e0d69", "score": "0.53484076", "text": "function applyIdToMap(inst, map, node, nodeInfo) {\n if (nodeInfo.id) {\n map[nodeInfo.id] = node;\n }\n}", "title": "" }, { "docid": "6df87985ca1a30f2fe0353dbbe5e0d69", "score": "0.53484076", "text": "function applyIdToMap(inst, map, node, nodeInfo) {\n if (nodeInfo.id) {\n map[nodeInfo.id] = node;\n }\n}", "title": "" }, { "docid": "96574dda7f989dfc8d537f51502587b8", "score": "0.53377247", "text": "function buildTreefromMap() {\n\t\n\t\t//retrieve Knowledge Map\n\t\n\t\t\n\t\n\t\t//instantiate the tree:\n tree = new YAHOO.widget.TreeView(\"treeDiv1\");\n\n for (var i = 0; i < Math.floor((Math.random()*4) + 3); i++) {\n var tmpNode = new YAHOO.widget.TextNode(\"label-\" + i, tree.getRoot(), false);\n // tmpNode.collapse();\n // tmpNode.expand();\n // buildRandomTextBranch(tmpNode);\n buildLargeBranch(tmpNode);\n }\n\n // Expand and collapse happen prior to the actual expand/collapse,\n // and can be used to cancel the operation\n tree.subscribe(\"expand\", function(node) {\n YAHOO.log(node.index + \" was expanded\", \"info\", \"example\");\n // return false; // return false to cancel the expand\n });\n\n tree.subscribe(\"collapse\", function(node) {\n YAHOO.log(node.index + \" was collapsed\", \"info\", \"example\");\n });\n\n // Trees with TextNodes will fire an event for when the label is clicked:\n tree.subscribe(\"labelClick\", function(node) {\n YAHOO.log(node.index + \" label was clicked\", \"info\", \"example\");\n });\n\n\t\t//The tree is not created in the DOM until this method is called:\n tree.draw();\n }", "title": "" }, { "docid": "1f0ce85b5d269e2970f1c61383e34c90", "score": "0.5332848", "text": "function _connectedNodesMap()\r\n{\r\n\tvar map = new Array();\r\n\tvar edges;\r\n\t\r\n\t// if edges merged, traverse over merged edges for a better performance\r\n\tif (_vis.edgesMerged())\r\n\t{\r\n\t\tedges = _vis.mergedEdges();\r\n\t}\r\n\t// else traverse over regular edges\r\n\telse\r\n\t{\r\n\t\tedges = _vis.edges();\r\n\t}\r\n\t\r\n\tvar source;\r\n\tvar target;\r\n\t\r\n\t\r\n\t// for each edge, add the source and target to the map of connected nodes\r\n\tfor (var i=0; i < edges.length; i++)\r\n\t{\r\n\t\tif (edges[i].visible)\r\n\t\t{\r\n\t\t\tsource = _vis.node(edges[i].data.source);\r\n\t\t\ttarget = _vis.node(edges[i].data.target);\r\n\t\t\r\n\t\t\tmap[source.data.id] = source;\r\n\t\t\tmap[target.data.id] = target;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn map;\r\n}", "title": "" }, { "docid": "f1b2bfb1351b92f1c118bf0613d64027", "score": "0.5293596", "text": "function makeTree(nodes) {\n var nodeByGenre = {};\n\n //index nodes by genre in case they are out of order\n nodes.forEach(function(d) {\n nodeByGenre[d.basicGenre] = d;\n });\n\n //Lazily compute children.\n nodes.forEach(function(d) {\n if (d.groupGenre != \"No larger group\") {\n var groupGenre = nodeByGenre[d.groupGenre];\n console.log(d.groupGenre);\n if (groupGenre.children) groupGenre.children.push(d);\n else groupGenre.children = [d];\n }\n });\n\n return {\"name\": \"genres\", \"children\": nodes}\n}", "title": "" }, { "docid": "a9692ced8a0217e45fa60136e9cbe858", "score": "0.52595145", "text": "nodeConfigs (node) {\n const configs = new Set()\n this.dna.updater[node.idx].forEach(updater => {\n if (updater[0].length) { configs.add(this.node[updater[0][0]]) }\n })\n return Array.from(configs)\n }", "title": "" }, { "docid": "154e854d734061756e609adc152673ce", "score": "0.5256533", "text": "function regenerateTreeForNewBlocks(editorState,newBlockMap,newEntityMap,decorator){var contentState=editorState.getCurrentContent().set(\"entityMap\",newEntityMap),prevBlockMap=contentState.getBlockMap();return editorState.getImmutable().get(\"treeMap\").merge(newBlockMap.toSeq().filter(function(block,key){return block!==prevBlockMap.get(key);}).map(function(block){return BlockTree.generate(contentState,block,decorator);}));}", "title": "" }, { "docid": "ce367390f21b779086d813e5c241f77c", "score": "0.52542967", "text": "function createTreeStructure(dataNodeLink) {\n var res = {};\n return res;\n }", "title": "" }, { "docid": "f7a9e818acb87522a9fbe3d04e411cdb", "score": "0.5220325", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set(\"entityMap\", newEntityMap), prevBlockMap = contentState.getBlockMap();\n return editorState.getImmutable().get(\"treeMap\").merge(newBlockMap.toSeq().filter(function(block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function(block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n }", "title": "" }, { "docid": "f7d83dd20e232f3fa9a8a73273721381", "score": "0.51807714", "text": "function nodeKeyFunction(d) {\n return d.id\n}", "title": "" }, { "docid": "9f50103e268f1448cec7c54056b63746", "score": "0.5151354", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function(block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n }", "title": "" }, { "docid": "3583ce92bdf6e0eedc86b64daa20b1d3", "score": "0.5142511", "text": "_mapPeersToMSPid() {\n // TODO: assume 1-1 mapping of mspId to org as the node-sdk makes that assumption\n // otherwise we woukd need to find the channel peer in the network config collection or however SD\n // stores things\n\n const peerMap = new Map();\n const channelPeers = this.channel.getPeers();\n\n // bug in service discovery, peers don't have the associated mspid\n if (channelPeers.length > 0) {\n for (const channelPeer of channelPeers) {\n const mspId = channelPeer.getMspid();\n if (mspId) {\n let peerList = peerMap.get(mspId);\n if (!peerList) {\n peerList = [];\n peerMap.set(mspId, peerList);\n }\n peerList.push(channelPeer);\n }\n }\n }\n if (peerMap.size === 0) {\n throw new Error('no suitable peers associated with mspIds were found');\n }\n return peerMap;\n }", "title": "" }, { "docid": "4af5578579be854c2d82e759eb1ccef2", "score": "0.51422775", "text": "function getTreeData(topologyMap) {\n const treeDataByKind = {\n tidb: [],\n tikv: [],\n pd: [],\n }\n Object.values(topologyMap).forEach((target) => {\n if (!(target.kind in treeDataByKind)) {\n return\n }\n treeDataByKind[target.kind].push({\n title: target.display_name,\n value: target.display_name,\n key: target.display_name,\n })\n })\n const kindTitleMap = {\n tidb: 'TiDB',\n tikv: 'TiKV',\n pd: 'PD',\n }\n return Object.keys(treeDataByKind)\n .filter((kind) => treeDataByKind[kind].length > 0)\n .map((kind) => ({\n title: kindTitleMap[kind],\n value: kind,\n key: kind,\n children: treeDataByKind[kind],\n }))\n}", "title": "" }, { "docid": "ba2dc2fc4828df527298c9b35c553b00", "score": "0.51374805", "text": "function buildMapTree(socWeightedList)\n{\n soclist = socWeightedList;\n\n // making minor group\n var mapTree = {}\n var majorGroupMap = {}\n soclist = soclist.map(socToString);\n for (var majorIndex = 11; majorIndex < 56; majorIndex+=2)\n { // 11 to 55. \n majorGroupMap[majorIndex] = soclist.filter(filterMajor(majorIndex));\n }\n\n for (var majorIndex in majorGroupMap){\n mapTree[majorIndex] = makeMinorGroupMap(majorGroupMap[majorIndex]);\n }\n\n return mapTree;\n}", "title": "" }, { "docid": "fbeb359b4989e169815b04703a1848da", "score": "0.5135822", "text": "function convertToNodesForPgp(pgpIdMap, nodes) {\n return nodes.reduce((ret, node) => {\n ret[pgpIdMap.get(node.id)] = {\n text: node.text\n };\n\n return ret;\n }, {});\n}", "title": "" }, { "docid": "7d3454f34a5d1f5ff2ce0cb650b5e0fd", "score": "0.5135434", "text": "parse( deformers ) {\n\n\t\t\tconst geometryMap = new Map();\n\n\t\t\tif ( 'Geometry' in fbxTree.Objects ) {\n\n\t\t\t\tconst geoNodes = fbxTree.Objects.Geometry;\n\n\t\t\t\tfor ( const nodeID in geoNodes ) {\n\n\t\t\t\t\tconst relationships = connections.get( parseInt( nodeID ) );\n\t\t\t\t\tconst geo = this.parseGeometry( relationships, geoNodes[ nodeID ], deformers );\n\t\t\t\t\tgeometryMap.set( parseInt( nodeID ), geo );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn geometryMap;\n\n\t\t}", "title": "" }, { "docid": "5fc7291a5f52572bd43bc6635121ef25", "score": "0.5132026", "text": "function buildGraph(nodes,edges) {\n const res = nodes.map(dst => [dst,[]])\n const map = new Map(res)\n for(const [src,dst] of edges) {\n map.get(dst).push(src)\n }\n return res\n}", "title": "" }, { "docid": "3393da6433b81d7defb48d9544f6f07d", "score": "0.5125742", "text": "function generateNewTreeMap(contentState, decorator) {\n\t return contentState.getBlockMap().map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }).toOrderedMap();\n\t}", "title": "" }, { "docid": "3393da6433b81d7defb48d9544f6f07d", "score": "0.5125742", "text": "function generateNewTreeMap(contentState, decorator) {\n\t return contentState.getBlockMap().map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }).toOrderedMap();\n\t}", "title": "" }, { "docid": "7cd87affce505b615926aa1d221e8387", "score": "0.5122923", "text": "function generateNewTreeMap(contentState, decorator) {\n\t return contentState.getBlockMap().map(function (block) {\n\t return BlockTree.generate(contentState, block, decorator);\n\t }).toOrderedMap();\n\t}", "title": "" }, { "docid": "e61e6092e7c42b7f3f98716604f0b394", "score": "0.51154834", "text": "makeNodeProps (node) { return { node }; }", "title": "" }, { "docid": "104b5874dd7bdc9482e239cf95ebee6c", "score": "0.5115321", "text": "function computeNodeLinks() {\n const node_dict = new Map()\n nodes.forEach(function (node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n if (!node_dict.has(node.pos)) node_dict.set(node.pos, new Map())\n node_dict.get(node.pos).set(node.name, node)\n });\n links.forEach(function (link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n if (typeof source === \"string\") source = link.source// = node_dict.get(link.pos).get(link.source);\n if (typeof target === \"string\") target = link.target// = node_dict.get(link.pos + 1).get(link.target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "4d3921bf6c0b371069006377ab7f73a3", "score": "0.51128834", "text": "function generateJSONTree(node_pairs, rds_data) {\n \n var strees_json = generateJSONSubTrees(node_pairs, rds_data); \n var tree_json = concatenateJSONSubTrees(strees_json);\n \n return(tree_json);\n \n}", "title": "" }, { "docid": "6a38005ab78f361b7d75c52270854bbd", "score": "0.5108964", "text": "function buildTextMap($node, _localStart, _globalStart){\n var nodeTxt=$node.text();\n var parTxt=$($node.parent()).text();\n if(!_localStart)_localStart=nodeTxt.indexOf(text);\n if(!_globalStart)_globalStart=parTxt.indexOf(nodeTxt) + _localStart;\n return {'text':text, 'textNode':$node, 'localStart':_localStart,\n 'startIndex':_globalStart, 'context':parTxt.substring(_globalStart-15, _globalStart+text.length+15)};\n }", "title": "" }, { "docid": "4316bb39cd4a55019fc5e48c3bee2e3f", "score": "0.5105525", "text": "function treeToJson(node) {\n return node.children.map(c => {return {name:c.name, id:c.id, children:treeToJson(c)}})\n }", "title": "" }, { "docid": "d89d6c2189a61bcfc6c36679f427de42", "score": "0.51053643", "text": "_orderTheChildrenMultipleBlackSingleBlackSingleRedMultipleRedCutVertex(childrens){\n let mapOfElements = new Map();\n childrens.forEach((node) => {\n let sons = node.getNeighbours();\n let currValue = [], currentNode = [node];\n //if have a single son, this node is classifying as single red or single black\n if(sons.length === 1){\n let kindOfSet = \"\";\n (sons[0].isBlack) ? kindOfSet = \"singleBlack\" : (sons[0].isABNode) ? kindOfSet = \"singleRed\" : kindOfSet = \"singleCutV\";\n currValue = mapOfElements.get(kindOfSet);\n mapOfElements.set(kindOfSet, (currValue != undefined) ? currValue.concat(currentNode) : currentNode);\n }\n else { //have multiple son\n let currentKey = \"multipleBlack\";\n let otherSon = [], cutV = [];\n node.getNeighbours().forEach((n) => {\n if(!n.isBlack && n.isABNode)\n currentKey = \"multipleRed\";\n (!n.isABNode) ? cutV.push(n) : otherSon.push(n);\n });\n\n node.children = otherSon.concat(cutV);\n currValue = mapOfElements.get(currentKey);\n mapOfElements.set(currentKey, (currValue != undefined) ? currValue.concat(currentNode) : currentNode);\n }\n });\n let resultingArray = [];\n [\"multipleBlack\", \"singleBlack\", \"singleRed\", \"multipleRed\", \"singleCutV\"].forEach((key) => {\n let currArray = mapOfElements.get(key);\n if(currArray != undefined) resultingArray = resultingArray.concat(currArray);\n });\n return resultingArray;\n }", "title": "" }, { "docid": "4da1b785b1c98ad0556578344e5e73ff", "score": "0.50895596", "text": "static match(map) {\n let direct = Object.create(null);\n\n for (let prop in map) for (let name of prop.split(\" \")) direct[name] = map[prop];\n\n return node => direct[node.name];\n }", "title": "" }, { "docid": "b740229e42cf4a9661857c9b4dffbbf3", "score": "0.50849676", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function(block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n }", "title": "" }, { "docid": "d45950dbe7c02b28fd881cb37ef3dd7b", "score": "0.5076956", "text": "function getNodesOriginal(nodeTree, nodesOriginal) {\n var i;\n var j;\n var adminContributors = [];\n var registeredContributors = [];\n var visibleContributors = [];\n var nodeId = nodeTree.node.id;\n for (i=0; i < nodeTree.node.contributors.length; i++) {\n if (nodeTree.node.contributors[i].is_admin) {\n adminContributors.push(nodeTree.node.contributors[i].id);\n }\n if (nodeTree.node.contributors[i].is_confirmed) {\n registeredContributors.push(nodeTree.node.contributors[i].id);\n }\n if (nodeTree.node.contributors[i].visible) {\n visibleContributors.push(nodeTree.node.contributors[i].id);\n }\n }\n var nodeInstitutions = nodeTree.node.affiliated_institutions || [];\n\n nodeInstitutions = nodeInstitutions.map(function(item) {\n return item.id;\n });\n\n nodesOriginal[nodeId] = {\n isPublic: nodeTree.node.is_public,\n id: nodeTree.node.id,\n title: nodeTree.node.title,\n contributors: nodeTree.node.contributors,\n isAdmin: nodeTree.node.is_admin,\n visibleContributors: visibleContributors,\n adminContributors: adminContributors,\n registeredContributors: registeredContributors,\n institutions: nodeInstitutions,\n changed: false,\n checked: false,\n enabled: true\n };\n\n if (nodeTree.children) {\n for (j in nodeTree.children) {\n nodesOriginal = getNodesOriginal(nodeTree.children[j], nodesOriginal);\n }\n }\n return nodesOriginal;\n}", "title": "" }, { "docid": "8daf1730e9e76d576ff0d66a9b5ed5d9", "score": "0.5072476", "text": "function getDebugJSON(node, startOffset = 0) {\n const nodes = [];\n node.forEach((n, offset) => {\n const from = startOffset + offset;\n const to = from + n.nodeSize;\n const marks = n.marks.map(mark => ({\n type: mark.type.name,\n attrs: { ...mark.attrs },\n }));\n const attrs = { ...n.attrs };\n const content = getDebugJSON(n, from + 1);\n const output = {\n type: n.type.name,\n from,\n to,\n };\n if (Object.keys(attrs).length) {\n output.attrs = attrs;\n }\n if (marks.length) {\n output.marks = marks;\n }\n if (content.length) {\n output.content = content;\n }\n if (n.text) {\n output.text = n.text;\n }\n nodes.push(output);\n });\n return nodes;\n}", "title": "" }, { "docid": "66efdafd4f4b2abc5d010481571e7c5f", "score": "0.50709933", "text": "function getNodesFromIterators(rootNode, [start, end]) {\n\t// Re-extend the target start (1x):\n\tif (!start.count && start.getPrev()) {\n\t\tstart.prev()\n\t}\n\t// NOTE: Do not re-extend the target end\n\tconst atEnd = !end.count\n\t// Get nodes:\n\tconst seenKeys = {}\n\tconst nodes = []\n\twhile (start.currentNode) {\n\t\t// Read the key:\n\t\tlet key = start.currentNode.getAttribute(\"data-node\")\n\t\tif (seenKeys[key]) {\n\t\t\tkey = random.newUUID()\n\t\t\tstart.currentNode.setAttribute(\"data-node\", key)\n\t\t}\n\t\t// Read the data:\n\t\tseenKeys[key] = true\n\t\tconst data = innerText(start.currentNode)\n\t\tnodes.push({ key, data })\n\t\tif (start.currentNode === end.currentNode) {\n\t\t\t// No-op\n\t\t\tbreak\n\t\t}\n\t\tstart.next()\n\t}\n\treturn { nodes, atEnd }\n}", "title": "" }, { "docid": "184c21d86613b12c401a6e2ffa4d367c", "score": "0.5070982", "text": "getAst() {\n\n return {\n type: 'map',\n elements: this.elements.map(elem => {\n return { key: elem.key.getAst(), value: elem.value.getAst() };\n })\n };\n }", "title": "" }, { "docid": "65d2ab2558e2aae299a1805b7a1751e6", "score": "0.5063963", "text": "function get_node_data()\r\n {\r\n data = new Array()\r\n $.each(my_node_data, function(k, v)\r\n {\r\n data.push(v)\r\n })\r\n return data\r\n }", "title": "" }, { "docid": "9bf6a9ffc78744cd9b7ef4dd321a19d6", "score": "0.50627077", "text": "static createMapping () {\n const locationsJsonLD = this._getSierraJsonLD()\n const recapCustomerCodes = this._getRecapJsonLD()\n\n const returnedMap = {}\n\n recapCustomerCodes['@graph'].forEach((recapLocation) => {\n let sierraDeliveryLocations = []\n\n // Some recap locations are have no sierra delivery\n if (recapLocation['nypl:deliverableTo']) {\n const deliverableRecapLocations = jsonldParseUtils.forcetoFlatArray(recapLocation['nypl:deliverableTo']).map((deliverableTo) => deliverableTo['@id'])\n sierraDeliveryLocations = locationsJsonLD['@graph'].filter((sierraLocation) => {\n return (sierraLocation['nypl:recapCustomerCode'] && deliverableRecapLocations.indexOf(sierraLocation['nypl:recapCustomerCode']['@id']) >= 0)\n })\n\n sierraDeliveryLocations = sierraDeliveryLocations.map((sierraLocation) => {\n return jsonldParseUtils.toSierraLocation(sierraLocation)\n })\n }\n\n // This value is if _this_ recap location shows up as the customer code for a sierraLocation.\n const sierraLocation = locationsJsonLD['@graph'].find((sierraLocation) => {\n return sierraLocation['nypl:recapCustomerCode'] && sierraLocation['nypl:recapCustomerCode']['@id'] === recapLocation['@id']\n })\n\n returnedMap[recapLocation['skos:notation']] = {\n label: recapLocation['skos:prefLabel'],\n eddRequestable: jsonldParseUtils._conditional_boolean(recapLocation['nypl:eddRequestable']),\n sierraLocation: sierraLocation ? jsonldParseUtils.toSierraLocation(sierraLocation) : null,\n sierraDeliveryLocations\n }\n })\n\n return returnedMap\n }", "title": "" }, { "docid": "9a934678eaad86826043fb8fd5818bf1", "score": "0.5048765", "text": "function prepareData(rawData) {\n\t\t\t\tmap = {\n\t\t\t\t\tname: \"\",\n\t\t\t\t\tchildren: [],\n\t\t\t\t};\n\t\t\t\tfor (var i = 0; i < rawData.length; i++) {\n\t\t\t\t\tmap.children[i] = {\n\t\t\t\t\t\tkey: i, // TODO is this needed?\n\t\t\t\t\t\tlink: rawData[i].link,\n\t\t\t\t\t\tname: i,\n\t\t\t\t\t\tlabel: rawData[i].label,\n\t\t\t\t\t\tparent: map\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}", "title": "" }, { "docid": "1a22b52c93d068c34ea5ab053e8ce653", "score": "0.50463164", "text": "get children () {\n return new Map()\n }", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.50396514", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "1f233ac6a448be17200d8c7e34db4189", "score": "0.50343317", "text": "function toJSON(node) {\n\tvar obj = {};\n\n\tObject.keys(node).forEach(key => {\n\t\tif (key === 'parent' || key === 'program' || key === 'keys' || key === '__wrapped') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (Array.isArray(node[key])) {\n\t\t\tobj[key] = node[key].map(toJSON);\n\t\t} else if (node[key] && node[key].toJSON) {\n\t\t\tobj[key] = node[key].toJSON();\n\t\t} else {\n\t\t\tobj[key] = node[key];\n\t\t}\n\t});\n\n\treturn obj;\n}", "title": "" }, { "docid": "a0081849fe306d290ebffb78d68b5b8f", "score": "0.5030563", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, decorator) {\n\t var prevBlockMap = editorState.getCurrentContent().getBlockMap();\n\t var prevTreeMap = editorState.getImmutable().get('treeMap');\n\t return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n\t return block !== prevBlockMap.get(key);\n\t }).map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }));\n\t}", "title": "" }, { "docid": "a0081849fe306d290ebffb78d68b5b8f", "score": "0.5030563", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, decorator) {\n\t var prevBlockMap = editorState.getCurrentContent().getBlockMap();\n\t var prevTreeMap = editorState.getImmutable().get('treeMap');\n\t return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n\t return block !== prevBlockMap.get(key);\n\t }).map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }));\n\t}", "title": "" }, { "docid": "a4c1500d6bf929d43be26dcd67b9f827", "score": "0.5029265", "text": "function neighborsP2(tiles,tilesdict,newtiles,newtilesdict,newdup){\n // iterate tiles and fill neighbors of newtiles\n for(let tile of tiles) {\n switch(tile.id[0]){\n\n case 'kite':\n //\n // --------------------------------\n // set kite's children neighbors\n // --------------------------------\n //\n // new kite 1\n //\n // neighbor 0\n if(tile.neighbors[1] != undefined){\n switch(tile.neighbors[1][0]){\n case 'kite':\n setNeighbor(newtilesdict,tile.id,'kite1','kite',0,tile.neighbors[1],'kite2','kite');\n break;\n case 'dart':\n setNeighbor(newtilesdict,tile.id,'kite1','kite',0,tile.neighbors[1],'dart1','dart');\n }\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'kite1','kite',0);\n }\n // neighbor 1\n setNeighbor(newtilesdict,tile.id,'kite1','kite',1,tile.id,'kite2','kite');\n // neighbor 2\n setNeighbor(newtilesdict,tile.id,'kite1','kite',2,tile.id,'dart1','dart');\n // neighbor 3\n if(tile.neighbors[0] != undefined){\n switch(tile.neighbors[0][0]){\n case 'kite':\n setNeighbor(newtilesdict,tile.id,'kite1','kite',3,tile.neighbors[0],'kite2','kite');\n break;\n case 'dart':\n setNeighbor(newtilesdict,tile.id,'kite1','kite',3,tile.neighbors[0],'kite1','kite');\n }\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'kite1','kite',3);\n }\n //\n // new kite 2\n //\n // neighbor 0\n if(tile.neighbors[3] != undefined){\n switch(tile.neighbors[3][0]){\n case 'kite':\n setNeighbor(newtilesdict,tile.id,'kite2','kite',0,tile.neighbors[3],'kite1','kite');\n break;\n case 'dart':\n setNeighbor(newtilesdict,tile.id,'kite2','kite',0,tile.neighbors[3],'kite1','kite');\n }\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'kite2','kite',0);\n }\n // neighbor 1\n //setNeighborMaybeDup(newtilesdict,tile.id,'kite2','kite',1,tile.id,'dart2','dart',newdup);\n setNeighbor(newtilesdict,tile.id,'kite2','kite',1,tile.id,'dart2','dart');\n // neighbor 2\n setNeighbor(newtilesdict,tile.id,'kite2','kite',2,tile.id,'kite1','kite');\n // neighbor 3\n if(tile.neighbors[2] != undefined){\n switch(tile.neighbors[2][0]){\n case 'kite':\n setNeighbor(newtilesdict,tile.id,'kite2','kite',3,tile.neighbors[2],'kite1','kite');\n break;\n case 'dart':\n //setNeighborMaybeDup(newtilesdict,tile.id,'kite2','kite',3,tile.neighbors[2],'dart2','dart',newdup);\n setNeighbor(newtilesdict,tile.id,'kite2','kite',3,tile.neighbors[2],'dart2','dart');\n }\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'kite2','kite',3);\n }\n //\n // new dart 1\n //\n // neighbor 0\n if( tile.neighbors[0] != undefined\n && tile.neighbors[0][0] == 'kite'){\n //setNeighborMaybeDup(newtilesdict,tile.id,'dart1','dart',0,tile.neighbors[0],'dart1','dart',newdup);\n setNeighbor(newtilesdict,tile.id,'dart1','dart',0,tile.neighbors[0],'dart1','dart');\n }\n else if( tile.neighbors[0] != undefined\n && tile.neighbors[0][0] == 'dart'\n && tilesdict.get(id2key(tile.neighbors[0])).neighbors[1] != undefined\n && tilesdict.get(id2key(tile.neighbors[0])).neighbors[1][0] == 'kite'){\n setNeighbor(newtilesdict,tile.id,'dart1','dart',0,tilesdict.get(id2key(tile.neighbors[0])).neighbors[1],'kite1','kite');\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'dart1','dart',0);\n }\n // neighbor 1\n if(tile.neighbors[0] != undefined){\n switch(tile.neighbors[0][0]){\n case 'kite':\n setNeighbor(newtilesdict,tile.id,'dart1','dart',1,tile.neighbors[0],'kite2','kite');\n break;\n case 'dart':\n setNeighbor(newtilesdict,tile.id,'dart1','dart',1,tile.neighbors[0],'kite1','kite');\n }\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'dart1','dart',1);\n }\n // neighbor 2\n setNeighbor(newtilesdict,tile.id,'dart1','dart',2,tile.id,'kite1','kite');\n // neighbor 3\n //setNeighborMaybeDup(newtilesdict,tile.id,'dart1','dart',3,tile.id,'dart2','dart',newdup);\n setNeighbor(newtilesdict,tile.id,'dart1','dart',3,tile.id,'dart2','dart');\n //\n // new dart 2\n //\n // maybe dup\n if(!isDup(newdup,tile.id,'dart2','dart')){\n //neighbor 0\n setNeighbor(newtilesdict,tile.id,'dart2','dart',0,tile.id,'dart1','dart');\n //neighbor 1\n setNeighbor(newtilesdict,tile.id,'dart2','dart',1,tile.id,'kite2','kite');\n //neighbor 2\n if(tile.neighbors[3] != undefined){\n switch(tile.neighbors[3][0]){\n case 'kite':\n setNeighbor(newtilesdict,tile.id,'dart2','dart',2,tile.neighbors[3],'kite1','kite');\n break;\n case 'dart':\n setNeighbor(newtilesdict,tile.id,'dart2','dart',2,tile.neighbors[3],'kite1','kite');\n }\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'dart2','dart',2);\n }\n //neighbor 3\n if( tile.neighbors[3] != undefined\n && tile.neighbors[3][0] == 'dart'\n && tilesdict.get(id2key(tile.neighbors[3])).neighbors[2] != undefined\n && tilesdict.get(id2key(tile.neighbors[3])).neighbors[2][0] == 'kite'){\n setNeighbor(newtilesdict,tile.id,'dart2','dart',3,tilesdict.get(id2key(tile.neighbors[3])).neighbors[2],'kite2','kite');\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'dart2','dart',3);\n }\n }\n //\n // done\n //\n break;\n\n case 'dart':\n //\n // --------------------------------\n // set dart's children neighbors\n // --------------------------------\n //\n // new kite 1\n //\n // neighbor 0\n if(tile.neighbors[0] != undefined){\n switch(tile.neighbors[0][0]){\n case 'kite':\n setNeighbor(newtilesdict,tile.id,'kite1','kite',0,tile.neighbors[0],'kite1','kite');\n break;\n case 'dart':\n setNeighbor(newtilesdict,tile.id,'kite1','kite',0,tile.neighbors[0],'kite1','kite');\n }\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'kite1','kite',0);\n }\n // neighbor 1\n //setNeighborMaybeDup(newtilesdict,tile.id,'kite1','kite',1,tile.id,'dart1','dart',newdup);\n setNeighbor(newtilesdict,tile.id,'kite1','kite',1,tile.id,'dart1','dart');\n // neighbor 2\n //setNeighborMaybeDup(newtilesdict,tile.id,'kite1','kite',2,tile.id,'dart2','dart',newdup);\n setNeighbor(newtilesdict,tile.id,'kite1','kite',2,tile.id,'dart2','dart');\n // neighbor 3\n if(tile.neighbors[3] != undefined){\n switch(tile.neighbors[3][0]){\n case 'kite':\n setNeighbor(newtilesdict,tile.id,'kite1','kite',3,tile.neighbors[3],'kite2','kite');\n break;\n case 'dart':\n setNeighbor(newtilesdict,tile.id,'kite1','kite',3,tile.neighbors[3],'kite1','kite');\n }\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'kite1','kite',3);\n }\n //\n // new dart 1\n //\n // maybe dup\n if(!isDup(newdup,tile.id,'dart1','dart')){\n // neighbor 0\n if( tile.neighbors[1] != undefined\n && tile.neighbors[1][0] == 'kite'){\n setNeighbor(newtilesdict,tile.id,'dart1','dart',0,tile.neighbors[1],'kite1','kite');\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'dart1','dart',0);\n }\n // neighbor 1\n setNeighbor(newtilesdict,tile.id,'dart1','dart',1,tile.id,'kite1','kite');\n // neighbor 2\n if(tile.neighbors[0] != undefined){\n switch(tile.neighbors[0][0]){\n case 'kite':\n setNeighbor(newtilesdict,tile.id,'dart1','dart',2,tile.neighbors[0],'kite1','kite');\n break;\n case 'dart':\n setNeighbor(newtilesdict,tile.id,'dart1','dart',2,tile.neighbors[0],'kite1','kite');\n }\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'dart1','dart',2);\n }\n // neighbor 3\n if( tile.neighbors[0] != undefined\n && tile.neighbors[0][0] == 'dart'\n && tilesdict.get(id2key(tile.neighbors[0])).neighbors[2] != undefined\n && tilesdict.get(id2key(tile.neighbors[0])).neighbors[2][0] == 'kite'){\n setNeighbor(newtilesdict,tile.id,'dart1','dart',3,tilesdict.get(id2key(tile.neighbors[0])).neighbors[2],'kite2','kite');\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'dart1','dart',3);\n }\n }\n //\n // new dart 2\n //\n // maybe dup\n if(!isDup(newdup,tile.id,'dart2','dart')){\n // neighbor 0\n setNeighborUndefined(newtilesdict,tile.id,'dart2','dart',0);\n // neighbor 1\n setNeighborUndefined(newtilesdict,tile.id,'dart2','dart',1);\n // neighbor 2\n setNeighbor(newtilesdict,tile.id,'dart2','dart',2,tile.id,'kite1','kite');\n // neighbor 3\n if( tile.neighbors[2] != undefined\n && tile.neighbors[2][0] == 'kite'){\n setNeighbor(newtilesdict,tile.id,'dart2','dart',3,tile.neighbors[2],'kite2','kite');\n }\n else{\n setNeighborUndefined(newtilesdict,tile.id,'dart2','dart',3);\n }\n }\n //\n // done\n //\n break;\n\n default:\n // all tiles should be kite or dart\n console.log(\"caution: undefined tile type for neighborsP2, id=\"+tile.id);\n }\n }\n\n // neighbors modified by side effect in tilesdict, nothing to return\n return;\n}", "title": "" }, { "docid": "18ecc0fab61363fba48a950a5c8d19c9", "score": "0.5027306", "text": "function doIterationWithMap(list){\n\t\t\t\tvar duppedNode;\n\t\t\t\tvar visitedMap = {};\n\t\t\t\t\n\t\t\t\tvar iter = list;\n\t\t\t\twhile(iter && !duppedNode){\n\t\t\t\t\tif(!visitedMap[iter.item]){\n\t\t\t\t\t\tvisitedMap[iter.item] = iter.item;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tduppedNode = iter;\n\t\t\t\t\t}\n\t\t\t\t\titer = iter.next;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn duppedNode;\n\t\t\t}", "title": "" } ]
569b7461aa1d79df40277982ff022bc8
mouse out animation effect (opacity transition)
[ { "docid": "781fcfd065a43c5115fb084601871a38", "score": "0.0", "text": "function nicetextmouseout() {\n if (event.target.id == \"1correct\") {\n document.getElementById(\"1correct\").style.color= \"#5E6973\";\n } else if (event.target.id == \"2correct\") {\n document.getElementById(\"2correct\").style.color= \"#5E6973\";\n } else if (event.target.id == \"3correct\") {\n document.getElementById(\"3correct\").style.color= \"#5E6973\";\n } else if (event.target.id == \"4correct\") {\n document.getElementById(\"4correct\").style.color= \"#5E6973\";\n }\n}", "title": "" } ]
[ { "docid": "f1c1ffa606092ba42f5bfe089eec5cc4", "score": "0.7105408", "text": "function mouseLeave(e){\n e.target.style.opacity = '1';\n}", "title": "" }, { "docid": "555967dd2f865a7f52ee7e039cd494f6", "score": "0.70617205", "text": "function mouseOut() {\n d3.selectAll(\".continent\")\n .attr(\"opacity\", 1);\n d3.select(this)\n .transition()\n .duration(100)\n }", "title": "" }, { "docid": "95034704804a249082a30543f9cb3cc8", "score": "0.70212", "text": "function onMouseout(d) {\n text.transition()\n .duration(3000)\n .style(\"opacity\", 0);\n}", "title": "" }, { "docid": "06ee73df50dad696016b6143df47d5c6", "score": "0.69567627", "text": "function mouseout() {\n d3.selectAll(\".active\").classed(\"active\", false);\n //hiveInfo.style(\"opacity\", 1e-6);\n //hiveInfo.attr(\"x\", \"0px\").attr(\"y\", \"0px\");\n textInfo.text(\"| | |\");\n }", "title": "" }, { "docid": "3af426d1a069f0429be9bde151cba44b", "score": "0.6885628", "text": "function end(e){\n\te.target.style.opacity = ''; // Restores the opacity of the element\n\t\t\t\t\n}", "title": "" }, { "docid": "e4bf14edffa195c5579c44ffa9f511f0", "score": "0.67885584", "text": "function rollOut() {\n\t$(this).removeClass('hover');\n}", "title": "" }, { "docid": "4d75c32605bf94e0bace25ab4060954d", "score": "0.67476964", "text": "function mouseLeaveButton() {\n //console.log('leave');\n $(this).fadeTo('fast', 1);\n}", "title": "" }, { "docid": "8b14bd3d97ae94b532e9fb4f420ece91", "score": "0.6732124", "text": "function mouseout() {\n focus.style(\"opacity\", 0)\n focusText.style(\"opacity\", 0)\n }", "title": "" }, { "docid": "07aa8642c008eb9e266f5e2b7ebd94dc", "score": "0.66979223", "text": "function fadeout () { fade_direction = OUT; }", "title": "" }, { "docid": "b8976bc9280a615330adb8587c6ab869", "score": "0.6632463", "text": "function leave() {\n $card.addClass(settings.hoverOutClass + \" \" + settings.hoverClass);\n $card.css({\n perspective: settings.perspective + \"px\",\n transformStyle: \"preserve-3d\",\n transform: \"rotateX(0) rotateY(0)\"\n });\n setTimeout(function () {\n $card.removeClass(settings.hoverOutClass + \" \" + settings.hoverClass);\n currentX = currentY = 0;\n }, 1000);\n } // Mouseenter event binding", "title": "" }, { "docid": "70fab716805348febf81035633090ed2", "score": "0.65525943", "text": "function mouseEnter(e){\n e.target.style.opacity = '0.7';\n}", "title": "" }, { "docid": "4c2e7af00cbb78f93b11a8637b2db82a", "score": "0.6547899", "text": "function handleMouseOut(out_event) {\n\tvar outed_square = out_event.target\n\touted_square.classList.remove(\"hover\")\n}", "title": "" }, { "docid": "c1bfde2cb976440184469a4e79cbdfc0", "score": "0.65399414", "text": "exitElements() {\n this.itemg.exit().transition(this.transition).style(\"opacity\", 0).remove();\n }", "title": "" }, { "docid": "c1bfde2cb976440184469a4e79cbdfc0", "score": "0.65399414", "text": "exitElements() {\n this.itemg.exit().transition(this.transition).style(\"opacity\", 0).remove();\n }", "title": "" }, { "docid": "c1bfde2cb976440184469a4e79cbdfc0", "score": "0.65399414", "text": "exitElements() {\n this.itemg.exit().transition(this.transition).style(\"opacity\", 0).remove();\n }", "title": "" }, { "docid": "e6505edfb0abdc1b9f775fa6202a16e8", "score": "0.65393394", "text": "function handleMouseOut() {\n allSparkles.forEach(sparkle => {\n sparkle.dim();\n sparkle.setEndState();\n });\n }", "title": "" }, { "docid": "9e22757e2fa168fc6c76d4e424b0297d", "score": "0.6531731", "text": "function MouseoutChangeBg(event){\n let e = event.currentTarget;\n e.classList.remove('hover');\n}", "title": "" }, { "docid": "70d0d52cd8dd82bb4b519fd19ea5c1a5", "score": "0.64753443", "text": "function handleMouseOut() {\n projectStore.stopDrawing();\n projectStore.turnOffSquareHighlighting();\n updateCanvas();\n}", "title": "" }, { "docid": "591cddd217e149ac14814247d1072b1e", "score": "0.64684767", "text": "function tooltipout(d){\n\tdiv.transition() \n .duration(500) \n .style(\"opacity\", 0);\t\n}", "title": "" }, { "docid": "0c31b8f7fbe38649eadb525dc1de8c60", "score": "0.6448176", "text": "function leave(){\n\t\t\t\tvar w = $this.innerWidth();\n\t\t\t\t$this.stop().animate({\n\t\t\t\t\t'zIndex': '1'\n\t\t\t\t},500);\n\t\t\t\t$card.addClass(settings.hoverOutClass+\" \"+settings.hoverClass);\n\t\t\t\t$card.css({\n\t\t\t\t\ttransform : \"perspective(\"+w*3+\"px) rotateX(0) rotateY(0) translateX(0) translateY(0) translateZ(0) scale(1, 1)\"\n\t\t\t\t});\n\t\t\t\t$shadow.css({\n\t\t\t\t\ttransform : \"perspective(\"+w*3+\"px) rotateY(0) rotateX(0) translateX(0) translateY(0) translateZ(-150px)\"\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tsetTimeout( function(){\n\t\t\t\t\t$card.removeClass(settings.hoverOutClass+\" \"+settings.hoverClass);\n\t\t\t\t}, 500 );\n\t\t\t}", "title": "" }, { "docid": "fc06b0f378a05953439872ca953818f6", "score": "0.6446827", "text": "function mouseoutFunction(event) {\n GS.triggerEvent(event.target.parentNode, evt.mouseout);\n event.target.parentNode.classList.remove('hover');\n }", "title": "" }, { "docid": "067aabf8c7dfffea9a5841e487625bb6", "score": "0.6442846", "text": "function _onMouseOut() {\n var _this = $(this);\n _cleanup(_this);\n }", "title": "" }, { "docid": "00e5f3e844dc3cad6a6566d1d94f3e18", "score": "0.6439805", "text": "function fadeOut() {\n console.log(\"fadeout\");\n transitionPlane.emit('fadeOut');\n}", "title": "" }, { "docid": "62862da79c0bddf1fe454683196f2afc", "score": "0.64383847", "text": "function onTransitionEnd()\n {\n if (jOverlay.css(\"opacity\") == \"0\")\n jOverlay.hide();\n }", "title": "" }, { "docid": "2ed2ea616780acb4f1bff9d89a7c6c20", "score": "0.6420729", "text": "function leave(){\n\t\t\t\t$card.addClass(settings.hoverOutClass+\" \"+settings.hoverClass);\n\t\t\t\t$card.css({\n\t\t\t\t\tperspective : settings.perspective+\"px\",\n\t\t\t\t\ttransformStyle : \"preserve-3d\",\n\t\t\t\t\ttransform : \"rotateX(0) rotateY(0)\"\n\t\t\t\t});\n\t\t\t\tsetTimeout( function(){\n\t\t\t\t\t$card.removeClass(settings.hoverOutClass+\" \"+settings.hoverClass);\n\t\t\t\t\tcurrentX = currentY = 0;\n\t\t\t\t}, 1000 );\n\t\t\t}", "title": "" }, { "docid": "2ed2ea616780acb4f1bff9d89a7c6c20", "score": "0.6420729", "text": "function leave(){\n\t\t\t\t$card.addClass(settings.hoverOutClass+\" \"+settings.hoverClass);\n\t\t\t\t$card.css({\n\t\t\t\t\tperspective : settings.perspective+\"px\",\n\t\t\t\t\ttransformStyle : \"preserve-3d\",\n\t\t\t\t\ttransform : \"rotateX(0) rotateY(0)\"\n\t\t\t\t});\n\t\t\t\tsetTimeout( function(){\n\t\t\t\t\t$card.removeClass(settings.hoverOutClass+\" \"+settings.hoverClass);\n\t\t\t\t\tcurrentX = currentY = 0;\n\t\t\t\t}, 1000 );\n\t\t\t}", "title": "" }, { "docid": "5bfe9dca78217420e2257f1734e73183", "score": "0.6413465", "text": "function fadeOut (){\n frodo.style = \"opacity:0; transition:opacity .25s ease-in-out \";\n }", "title": "" }, { "docid": "be3619dbeee313d9a75e19c96a87d48d", "score": "0.6380938", "text": "function mouseOut(event) {\n const button = event.currentTarget;\n button.style.backgroundColor = \"#cecece\";\n}", "title": "" }, { "docid": "a38d95f5247ae5f4b8dadf1c05922752", "score": "0.6379401", "text": "function mouseOutWard(e) {\n //\tReset hover state.\n e.feature.setProperty('state', 'normal');\n}", "title": "" }, { "docid": "b4334edbf8fb6be9116eab20fd7e4b35", "score": "0.6372487", "text": "function onMouseOut() {\n\tif (ballPosition.z < 60) {\n\t\tballPosition.z += 2;\n\t\tonMouseOut();\n\t}\n}", "title": "" }, { "docid": "d466fa79650dd9ba6c252fa210a9c497", "score": "0.63671035", "text": "function fadeOut (el) {\n el.style.transition = el.style.webkitTransition = 'opacity .25s ease-out';\n if (el.style.webkitTransition) {\n el.style.opacity = 0;\n } else {\n el.style.visibility = 'hidden';\n }\n }", "title": "" }, { "docid": "7cc400845a26e2a54b69311be8739352", "score": "0.6359606", "text": "function inspectorMouseOut(e) {\n // Remove outline from element:\n e.target.style.outline = \"\"\n }", "title": "" }, { "docid": "9e0057f9158aaaa3e7450630f7a8e4d6", "score": "0.63551545", "text": "function mouseOut() {\n alert('No estás sobre mi');\n}", "title": "" }, { "docid": "7e67582f1962c4dc5d1fbdae8c7f6843", "score": "0.6338526", "text": "fadeOut() {\n this._renderer.fadeOutRipple(this);\n }", "title": "" }, { "docid": "7e67582f1962c4dc5d1fbdae8c7f6843", "score": "0.6338526", "text": "fadeOut() {\n this._renderer.fadeOutRipple(this);\n }", "title": "" }, { "docid": "7e67582f1962c4dc5d1fbdae8c7f6843", "score": "0.6338526", "text": "fadeOut() {\n this._renderer.fadeOutRipple(this);\n }", "title": "" }, { "docid": "7e67582f1962c4dc5d1fbdae8c7f6843", "score": "0.6338526", "text": "fadeOut() {\n this._renderer.fadeOutRipple(this);\n }", "title": "" }, { "docid": "7e67582f1962c4dc5d1fbdae8c7f6843", "score": "0.6338526", "text": "fadeOut() {\n this._renderer.fadeOutRipple(this);\n }", "title": "" }, { "docid": "7ae66542933971ae8a43a76e36f5a289", "score": "0.633667", "text": "mouseLeave() {\n this.stopPlaying();\n }", "title": "" }, { "docid": "9b79d2a8fed252eb7093a31e9d5eb2fb", "score": "0.63204557", "text": "function mouseOut() {\n divForTooltip.style(\"opacity\", 0);\n}", "title": "" }, { "docid": "c978d5786c9e929264dbc4e766c6d585", "score": "0.6307985", "text": "function linkMouseOut() {\n\t\t//Bring everything back to normal\n\t\tsvg.selectAll(\".node\")\n\t\t\t.transition().duration(200)\n\t\t\t.style(\"opacity\", 1);\n\t\tsvg.selectAll(\".link\")\n\t\t\t.transition().duration(200)\n\t\t\t.style(\"opacity\", 1);\n\t\tsvg.selectAll(\".link\").selectAll(\".link-path\")\n\t\t\t.transition().duration(200)\n\t\t \t.style(\"opacity\", function(d) { return middle(d) ? middleLinkOpacity : linkOpacity; });\n\t}//linkMouseOut", "title": "" }, { "docid": "63ddfca9ffe5566379ec933abca54f46", "score": "0.62675804", "text": "function mouseOut() {\n drawingNodes.style(\"stroke-opacity\", 1);\n drawingNodes.style(\"fill-opacity\", 1);\n drawingLinks.style(\"opacity\", 0.01);\n drawingLinks.style(\"stroke\", \"#615\");\n }", "title": "" }, { "docid": "545878d45b1c5380e8c762cb4fcf2c97", "score": "0.62571037", "text": "function issuesMouseout(e) {\n var ID = e.target.id;\n if (!(e.target.classList.contains(\"PRESSED\"))) {\n if (ID == 'headphone') {\n document.getElementById(\"circle\").style.opacity = \"0\";\n } else if (ID == \"volume\") {\n document.getElementById(\"circleDos\").style.opacity = \"0\";\n } else if (ID == \"screen\") {\n document.getElementById(\"iPhRep\").src = \"http://i.imgur.com/URpk0b5.png\";\n } else if (ID == \"charger\") {\n document.getElementById(\"circleSiete\").style.opacity = \"0\";\n } else if (ID == \"camera\") {\n document.getElementById(\"circleSeis\").style.opacity = \"0\";\n } else if (ID == \"home\") {\n document.getElementById(\"circleQuatro\").style.opacity = \"0\";\n } else if (ID == \"lock\") {\n document.getElementById(\"circleTres\").style.opacity = \"0\";\n }\n }\n}", "title": "" }, { "docid": "025582ab1f44cdf1567cc9b2a407612d", "score": "0.6228379", "text": "function fadeOut(el) {\n el.classList.add(\"fade-up-out\")\n setTimeout(() => {\n el.style.opacity = 0\n el.classList.remove(\"fade-up-out\")\n el.style.pointerEvents = \"none\"\n }, FADEDURATION)\n}", "title": "" }, { "docid": "0259038d84c0145c15dfaf9c925b4d25", "score": "0.62268776", "text": "function mouseout(d) {\n tooltip.transition()\n .duration(500)\n .style(\"opacity\", 0);\n }", "title": "" }, { "docid": "a259e3e6c9d15068fb64bb2146bcb58c", "score": "0.6221258", "text": "mouseLeave(event) {}", "title": "" }, { "docid": "747e254650052e0294a223230bfb62db", "score": "0.6216849", "text": "function mouseOutListener(e) {\n clearMasks();\n}", "title": "" }, { "docid": "3151a9c0c2733921c51ef95da3222d83", "score": "0.6195956", "text": "function actionMouseHoverOut() {\n if (\n this.classList.contains(\"xCross-hover\") ||\n this.classList.contains(\"oCircle-hover\")\n ) {\n this.classList.remove(\"xCross-hover\", \"oCircle-hover\");\n }\n}", "title": "" }, { "docid": "5e50a47eacc36788aaf6bb24aeff5bac", "score": "0.6195808", "text": "function hoverOut() {\n if (!isActivePage) {\n $(\".main-view\").css({\n \"transform\": \"perspective(0) rotateY(0)\"\n });\n }\n }", "title": "" }, { "docid": "45ecca781981394545e8c56ae795f638", "score": "0.61744547", "text": "function handleMouseOut(data) {\n\t overlay.style('display', 'none');\n\t verticalMarker.classed('bc-is-active', false);\n\t verticalMarkerContainer.attr('transform', 'translate(9999, 0)');\n\t\n\t dispatcher.call('customMouseOut', this, data);\n\t }", "title": "" }, { "docid": "988100d09c6064ace9a170532c830869", "score": "0.6171497", "text": "function handleMouseOut(d, i) {\n d3.select(this).attr('style', '#FFFFFF');\n d3.selectAll('.hover').remove();\n }", "title": "" }, { "docid": "e2d22de3230f83c368a3fc6850e48fad", "score": "0.6170872", "text": "out() {\r\n this.isIn = false;\r\n\r\n // fence animation\r\n gsap.killTweensOf(this.fence.mesh.position);\r\n gsap.to(this.fence.mesh.position, {\r\n duration: 0.35,\r\n z: - this.fence.depth,\r\n ease: \"back.out(4)\" // FIXME: test back distance\r\n })\r\n\r\n // key animation\r\n if (this.hasKey) {\r\n gsap.killTweensOf(this.key.container.position);\r\n gsap.killTweensOf(this.key.icon.material);\r\n gsap.killTweensOf(this.key.enter.material);\r\n gsap.to(this.key.container.position, {\r\n duration: 0.35,\r\n z: this.key.hiddenZ,\r\n ease: \"back.out(4)\", // FIXME: test back distance\r\n delay: 0.1\r\n })\r\n gsap.to(this.key.icon.material, {\r\n duration: 0.35,\r\n opacity: 0,\r\n ease: \"back.out(4)\", // FIXME: test back distance\r\n delay: 0.1\r\n })\r\n gsap.to(this.key.enter.material, {\r\n duration: 0.35,\r\n opacity: 0,\r\n ease: \"back.out(4)\", // FIXME: test back distance\r\n delay: 0.1\r\n })\r\n }\r\n\r\n // change cursor to click // FIXME: check if cursor is in the box or not\r\n if (!this.config.touch) {\r\n this.renderer.domElement.classList.remove('has-cursor-pointer');\r\n }\r\n\r\n // trigger the out event\r\n this.trigger('out');\r\n }", "title": "" }, { "docid": "08f5ffca7e3cde63d5c1184370b0d07c", "score": "0.61555606", "text": "function handleMouseOut() {\n d3.select(this)\n .attr('r', 5)\n .classed('mouseover', false);\n }", "title": "" }, { "docid": "0b2f09c0f3d473e1c6652f3f49efca33", "score": "0.6149748", "text": "game_over() {\n $(this.canvas).fadeOut();\n this.$ui.fadeOut();\n this.trigger('dead');\n }", "title": "" }, { "docid": "9e64c471c99e76ddc565315e9fc4d059", "score": "0.6136705", "text": "function remove(e){\ne.target.style.opacity = \"0\";\n}", "title": "" }, { "docid": "97c1dc41337666b79a29da89b9862a7a", "score": "0.61271393", "text": "function cardMouseOut() {\n this.classList.remove('text-white', 'card-mouse-over');\n\n}", "title": "" }, { "docid": "84dac03dfd82e899cf3d118dceead692", "score": "0.6121175", "text": "function transitionOutTooltip(ctx) {\n\tctx.worldData.tooltip.classList.remove(\"fade-in-fast\");\n\tctx.worldData.tooltip.classList.add(\"fade-out-fast\");\n\n\tctx.tooltipName.classList.remove(\"fade-in-fast-delayed\");\n\tctx.tooltipName.classList.add(\"fade-out-fast-delayed\");\n\n\tif (ctx.worldData.Utils) {\n\t\tctx.worldData.Utils.hideElementId(ctx.tooltipName);\n\t} else {\n\t\tconsole.error(\"[Sumerian Concierge] Please make sure that Utils.js is loaded before MainScript.js.\")\n\t}\n\n\tif (ctx.tooltip && ctx.tooltip.isVisible) {\n\t\tctx.worldData.tooltipEntity.hide();\n\t}\n}", "title": "" }, { "docid": "ae2492b4740cd70fbd452b6d90439bca", "score": "0.6115665", "text": "tipMouseout() {\n let vis = this;\n\n vis.tooltip.transition()\n .duration(300) // ms\n .style(\"opacity\", 0); // don't care about position!\n }", "title": "" }, { "docid": "f8f5d794190796f2f74a9a1d933a770d", "score": "0.6105552", "text": "function doMouseout(e) {\n // console.log(e.type);\n dragging = false;\n ctx.closePath();\n}", "title": "" }, { "docid": "e3ad807fc856701e02b1e626afbc0978", "score": "0.6099726", "text": "exitElements() {\n this.linesgroup.exit().transition(this.transition).style(\"opacity\", 0).remove();\n }", "title": "" }, { "docid": "e3ad807fc856701e02b1e626afbc0978", "score": "0.6099726", "text": "exitElements() {\n this.linesgroup.exit().transition(this.transition).style(\"opacity\", 0).remove();\n }", "title": "" }, { "docid": "ac7b17ba2a414db654f6cc76a45a8364", "score": "0.609139", "text": "leave(e) {\n if (e) {\n let eventType = e.type === 'focusout' ? 'focus' : 'hover';\n this.get('inState').set(eventType, false);\n }\n\n if (this.get('inState.in')) {\n return;\n }\n\n cancel(this.timer);\n\n this.set('hoverState', 'out');\n\n if (!this.get('hasDelayHide')) {\n return this.hide();\n }\n\n this.timer = later(this, function() {\n if (this.get('hoverState') === 'out') {\n this.hide();\n }\n }, this.get('delayHide'));\n }", "title": "" }, { "docid": "ee32df2a4bac088a4dd5a19f4bfde6b8", "score": "0.6090759", "text": "handleMouseOut() {\n this.setState({ hover: false });\n }", "title": "" }, { "docid": "c84d7c4413210415a36c453b27da0952", "score": "0.6068232", "text": "function onStateMouseOut(e){\n states.resetStyle(e.target);\n var stateName = e.target.feature.properties.name;\n}", "title": "" }, { "docid": "d7d11d0e4e308ede6c96959ab905fd55", "score": "0.60643256", "text": "function handleMouseOut(data) {\n\t overlay.style('display', 'none');\n\t verticalMarkerLine.classed('bc-is-active', false);\n\t verticalMarkerContainer.attr('transform', 'translate(9999, 0)');\n\t\n\t dispatcher.call('customMouseOut', this, data);\n\t }", "title": "" }, { "docid": "6cfee00212b7e21d4cd00a946b57c6a6", "score": "0.60630256", "text": "function mouseout() {\n showFocus()\n }", "title": "" }, { "docid": "23e2ea40deeeaf3f18fa13e29234c006", "score": "0.6053585", "text": "function onMouseOut(d, i) {\n // use the text label class to remove label on mouseout\n d3.select(this)\n .transition() // adds animation\n .duration(250)\n .style(\"fill\", \"red\")\n .attr('width', x.bandwidth())\n .attr('x', x(d.hymn))\n .attr(\"y\", y(d.count))\n .attr(\"height\", height - y(d.count));\n\n d3.selectAll('.val')\n .remove()\n}", "title": "" }, { "docid": "e1b5bb8d430da7840dfe7b342805ba58", "score": "0.60489726", "text": "function mouseout(){ if(this.style.length > 1) this.style.removeProperty(\"display\"); else this.removeAttribute(\"style\"); }", "title": "" }, { "docid": "9d498ee84a97f8898c7905a72b900bb8", "score": "0.60427076", "text": "onMouseOut() {\n const point = this, chart = point.series.chart;\n point.firePointEvent('mouseOut');\n if (!point.series.options.inactiveOtherPoints) {\n (chart.hoverPoints || []).forEach(function (p) {\n p.setState();\n });\n }\n chart.hoverPoints = chart.hoverPoint = null;\n }", "title": "" }, { "docid": "4768219402564eb72b1366162e77e0ef", "score": "0.6035268", "text": "function mouseOut()\n{\n$(\".Thing\").css(\"background-color\", \"red\");\n}", "title": "" }, { "docid": "78500cdd622a21b6b732fbbeaa8fb735", "score": "0.60332495", "text": "function theMouseout() {\n console.log(this)\n this.style.stroke = \"none\"\n}", "title": "" }, { "docid": "842a3ec979caeebd161dcce6a028d6fc", "score": "0.6030675", "text": "function mouseleave() {\n // Hide the breadcrumb trail\n breadcrumbs.style('visibility', 'hidden');\n\n gMiddleText.selectAll('*').remove();\n\n // Deactivate all segments during transition.\n arcs.selectAll('path').on('mouseenter', null);\n\n // Transition each segment to full opacity and then reactivate it.\n arcs\n .selectAll('path')\n .transition()\n .duration(200)\n .style('opacity', 1)\n .style('stroke', null)\n .style('stroke-width', null)\n .each('end', function end() {\n d3.select(this).on('mouseenter', mouseenter);\n });\n }", "title": "" }, { "docid": "a13338ca2703d5f65728a4f5d64e545b", "score": "0.6015462", "text": "function fadeOut($this){\n var transtime = 'opacity '+(difficulty.time/600)+'s';\n $this.css({\n transition : transtime,\n opacity : 0,\n });\n //detect when circle is opacity 0 then removes it from screen and does circlesRemaining--\n if(juggleToggle){\n var opacity = setInterval(\n function(){\n var currentOp = parseFloat($this.css('opacity'));\n if(currentOp == 0){\n console.log(\"gone\");\n clearInterval(opacity);\n currCirclesRemaining--;\n $this.css('display', \"none\");\n }\n }, 100\n );\n }\n}", "title": "" }, { "docid": "98d584d7b89073c8c9d0c075a47150dd", "score": "0.6012462", "text": "exitElements() {\n this.wordgroup.exit().transition(this.transition).style(\"opacity\", 0).remove();\n }", "title": "" }, { "docid": "a68afc2914786a9293a5678722743ddc", "score": "0.60086423", "text": "leave(event) {\n this.hover = false;\n this.isDirty = true;\n this.release(event);\n return this.onOut(event);\n }", "title": "" }, { "docid": "805766561ca56744251f542a0d9d8f29", "score": "0.6003696", "text": "function nodeMouseOut(d) {\n\t\t//Bring everything back to normal\n\t\tsvg.selectAll(\".node\").style(\"opacity\", 1);\n\t\tsvg.selectAll(\".link\").style(\"opacity\", 1);\n\t\tsvg.selectAll(\".link\").selectAll(\".link-path\")\n\t\t\t.style(\"opacity\", function(d) { return middle(d) ? middleLinkOpacity : linkOpacity; });\n\t}//nodeMouseOut", "title": "" }, { "docid": "c63b4d4a870aa127529332a699dea9fc", "score": "0.5986239", "text": "fadeOut(element) { let op = 1; // initial opacity\n let timer = setInterval(function () {\n if (op <= 0.1){\n clearInterval(timer);\n element.style.display = \"none\";\n }\n element.style.opacity = op;\n element.style.filter = \"alpha(opacity=\" + op * 100 + \")\";\n op -= op * 0.1;\n }, 3);\n }", "title": "" }, { "docid": "beb68af043c852dc43b4c299f27f56e0", "score": "0.5984475", "text": "function hoverOut(e) {\r\n const hover = document.getElementById(\"hover\").children;\r\n\r\n for (let i = 0; i < hover.length; i++) {\r\n if (body.classList.contains(\"dark\")) {\r\n hover[i].classList.remove(\"dark-hover\");\r\n } else {\r\n hover[i].classList.remove(\"light-hover\");\r\n }\r\n }\r\n}", "title": "" }, { "docid": "eaa68402b923ed6cee347d9088566731", "score": "0.5983053", "text": "function mouseOver() {\n d3.selectAll(\".continent\")\n .attr(\"opacity\", .2);\n d3.select(this)\n .transition()\n .duration(1000)\n }", "title": "" }, { "docid": "f3e034bbe1c67e194dd1502d5901c8ca", "score": "0.5973862", "text": "function ScreenPauseFadeOut() {\n ScreenPause(_myState);\n $(\"#canvas\").animate({\n opacity: 0.5,\n height: \"500px\",\n width: \"785px\",\n });\n}", "title": "" }, { "docid": "d112e7daaeecac121509b1fc7c79ce03", "score": "0.59716797", "text": "function navOpacity(event) {\n setTimeout( () => {\n $('nav').fadeOut('slow')\n }, 300\n )\n}", "title": "" }, { "docid": "ff21255d8480f27f92c6b4211ba30cfd", "score": "0.5971549", "text": "function hoverZoomOut(){\n $(this).next(menu).css('display','block');\n $('.zoomed').remove();\n }", "title": "" }, { "docid": "fb6310dfc86bf0e8a6982624830f7869", "score": "0.5971436", "text": "function fadeOut(speed) {\n d3.select(this)\n .transition()\n .duration(speed / 8)\n .delay(speed - (speed / 8) * 2)\n .style('opacity', 0);\n }", "title": "" }, { "docid": "8de93768bb6f0d2dc0a97d1a65d6ecc7", "score": "0.5967797", "text": "function mouseoutev(e){ \n\n e.stopPropagation() ;\n e.preventDefault() ;\n\tc.drawImage(img, 0, 0); // clear canvas when mouse out\n}", "title": "" }, { "docid": "b8bc7624c520f8163501591a572d18b9", "score": "0.5962339", "text": "function removeFadeOut(event) {\r\n var element = event.target;\r\n // console.log(element);\r\n if ( element.scrollHeight - element.scrollTop === element.clientHeight )\r\n {\r\n cacheDom.effect1.classList.remove('fade-out-text');\r\n }\r\n else { cacheDom.effect1.classList.add('fade-out-text');\r\n }\r\n }", "title": "" }, { "docid": "6011a0a22d1b7cbd4ed47c9476d5cef5", "score": "0.59485465", "text": "didTransitionOut (clone) {\n clone.remove();\n }", "title": "" }, { "docid": "80320607e0ad2f5e0835074bbc3e6e1d", "score": "0.59484017", "text": "function fadeOut(opacity) {\n return function(d, i) {\n svg.selectAll(\"path.chord\")\n .filter(function(d) {\n return d.source.index !== i && d.target.index !== i;\n })\n .transition()\n .style(\"opacity\", opacity);\n };\n\n }", "title": "" }, { "docid": "43d689dac95caf5c5e97ef493915db1c", "score": "0.5946095", "text": "function crystalHoverIn(event) {\n $(\"img\").not(event.target).css(\"opacity\", \".5\");\n}", "title": "" }, { "docid": "71dc8d1d02c4b25f393288e85e5b62d3", "score": "0.5942752", "text": "function onMouseOutWebGL() {\n\twebGLActive = false;\n}", "title": "" }, { "docid": "f5d9b5689efc1313817e216957d81108", "score": "0.5942349", "text": "mouseLeave(evt) {\n this._hideContent();\n }", "title": "" }, { "docid": "8370e8adc58754d1346e7196a4b94411", "score": "0.5936945", "text": "function fadeOut(el){\n el.style.opacity = 1;\n\n (function fade() {\n if ((el.style.opacity -= .1) < 0) {\n el.style.display = 'none';\n } else {\n requestAnimationFrame(fade);\n }\n })();\n}", "title": "" }, { "docid": "d8c4c5dbb13422baacc3c186e2fa8f87", "score": "0.5935685", "text": "function lineClicked(event){\n fadeOut(event.target, 1);\n}", "title": "" }, { "docid": "98bf7f64d31d8ef1f80c6f38455c5733", "score": "0.5934734", "text": "function afterFadeOut(el) {\n el.style.display = 'none'; // after close and before open, the display should be none\n el.removeEventListener(cc.transitionEnd, this.afterTransition);\n this.afterTransition = null;\n }", "title": "" }, { "docid": "1d089db28ebca1c72262560525fcbb31", "score": "0.5933484", "text": "_out() {\n\t\tif (this._tooltip !== null) {\n\t\t\tthis._tooltip.classList.remove('visible');\n\n\t\t\tthis._tooltip.addEventListener('transitionend', _ => {\n\t\t\t\tif (this._tooltip === null) return;\n\t\t\t\tdocument.body.removeChild(this._tooltip);\n\t\t\t\tthis._tooltip = null;\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "a4d0e8e99878a8e880c677a859c44efc", "score": "0.5926951", "text": "on_mouse_leave() {\n this.$emit('hoverchange')\n }", "title": "" }, { "docid": "386929eb3b41e3d611d84f2d4330a13a", "score": "0.59227324", "text": "gamepadHoverOut() {\n }", "title": "" }, { "docid": "4afdc6ae3a4528ebba3287a06482c0a2", "score": "0.5921593", "text": "function handleMouseOut(d, i) {\n d3.select(this).style('opacity', 0.65);\n tooltip.style('display', 'none');\n }", "title": "" }, { "docid": "ca9a6a97146a535ea9a6b17edf26f74e", "score": "0.5906563", "text": "function OnMouseExit() {\n\tthisGUITexture.texture = defaultTexture;\n\tmouseOver = false;\n}", "title": "" }, { "docid": "1bf594248ce74e8af09e9efa79e5955c", "score": "0.5902202", "text": "function animateOut() {\n $.activity_indicator.hide();\n\n var animation = Ti.UI.createAnimation({\n transform: Ti.UI.create2DMatrix({ scale: 0.7 }),\n opacity: 0,\n duration: 1000 });\n\n animation.addEventListener('complete', _callback);\n $.window.animate(animation);\n }", "title": "" }, { "docid": "25722c1f64b4f95a3d8e25aad609c3a5", "score": "0.5901305", "text": "onMouseOut(){\n for(let callback of privateProperties[this.id].onMouseOut){\n callback.call(this.Entity);\n }\n }", "title": "" }, { "docid": "43e12e79da8ec0cbccf1b7a34ba9bd03", "score": "0.5893031", "text": "function onTransitionOutComplete(el) {\n var idx = getObjIndexByID(el.getAttribute('id')),\n boxObj = _children[idx];\n\n boxObj.streams.forEach(function (stream) {\n stream.dispose();\n });\n\n Draggable.get('#' + boxObj.id).disable();\n\n _mountPoint.removeChild(el);\n\n _children[idx] = null;\n _children.splice(idx, 1);\n\n checkModalStatus();\n }", "title": "" } ]
b35dfdf7937b7f50641c792a11f350db
Creates rendered dom trees for the "render" factory.
[ { "docid": "7ae41007245e3675e062c7dc5afb6001", "score": "0.64220613", "text": "function domRenderFactory(resolver, spec, wire) {\n\t\tvar parentRef, options;\n\n\t\toptions = spec.render;\n\n\t\tdomReady(function() {\n\n\t\t\tvar futureTemplate, futureMixin, futureRoot, futureCss;\n\n\t\t\t// get args from spec\n\t\t\tfutureTemplate = options.template ? wire(options.template) : '';\n\t\t\tif (options.mixin) {\n\t\t\t\tfutureMixin = wire(options.mixin);\n\t\t\t}\n\t\t\tif (options.at) {\n\t\t\t\tfutureRoot = wire(options.at);\n\t\t\t}\n\t\t\tif (options.css) {\n\t\t\t\tfutureCss = wire(options.css);\n\t\t\t}\n\n\t\t\twhen.all([futureTemplate, futureMixin, futureRoot, futureCss], function (args) {\n\t\t\t\treturn render.apply(undef, args);\n\t\t\t}).then(resolver.resolve, resolver.reject);\n\n\t\t});\n\t}", "title": "" } ]
[ { "docid": "9248251e2b2d282264e1ac895a4b276e", "score": "0.6828691", "text": "function render () {\n tree = view(state)\n target = vdom.create(tree)\n return target\n }", "title": "" }, { "docid": "3b04d5a022f1beb6910fd4e575c6fd58", "score": "0.66204256", "text": "_render() {\n // Remove old content\n this.sRoot.replaceChildren();\n\n // Apply style\n let styleElement = this.constructor.#templates.querySelector(\"style\").cloneNode(true);\n this.sRoot.appendChild(styleElement);\n\n // Render container\n let containerElement = document.createElement(\"container\");\n containerElement.classList.add(\"container\");\n containerElement.append(...this.childNodes);\n this.sRoot.appendChild(containerElement);\n\n\n // Adapt to current viewport size\n this._updateDisplayMode();\n }", "title": "" }, { "docid": "8fc76c892a444feea83474e45762358b", "score": "0.647689", "text": "render(nodeOrFactory) {\n let node;\n if (typeof nodeOrFactory === 'function')\n node = nodeOrFactory(this);\n else\n node = nodeOrFactory;\n return {\n target: node,\n on(host) {\n host.appendChild(node);\n return node;\n },\n before(ref) {\n if (ref.parentNode)\n ref.parentNode.insertBefore(node, ref);\n return node;\n },\n after(ref) {\n if (ref.parentNode)\n ref.parentNode.insertBefore(node, ref.nextSibling);\n return node;\n }\n };\n }", "title": "" }, { "docid": "d3dc114ecd32f427deafede39e37cabe", "score": "0.6389026", "text": "createRenderRoot() {\n\t\treturn this;\n\t}", "title": "" }, { "docid": "df27c233869c4007b7fe48f8e2043c6f", "score": "0.63781106", "text": "render(data) {\n if (!this._rendered) {\n if (this.template) {\n if (data) {\n this.data = data;\n }\n let options = this._options,\n parentChildren = this._parentChildren,\n decoder = new Decoder(this.template),\n template = decoder.render(this.data);\n if (this.el) {\n let parent = this.el.parentNode;\n if (parent) {\n parent.replaceChild(template.fragment, this.el);\n }\n if (this.elGroup && this.elGroup.get(this.el)) {\n this.elGroup.delete(this.el);\n this.el = template.fragment;\n this.elGroup.set(template.fragment, this);\n }\n } else {\n this.el = template.fragment;\n }\n\n\n this.root = new dom.Element(template.fragment, {\n name: 'root',\n data: {}\n });\n\n this.children = applyElement(template.children, options);\n applyParent(this, parentChildren, this.data);\n this.bindings = setBinders(this.children, true);\n\n if (this.data) {\n this.applyBinders(this.data, this);\n }\n\n setRoutes(this.children, this.context);\n addChildren(this, this.root);\n this.rendered(...this._arguments);\n this._rendered = true;\n } else {\n let HTMLelement = document.createElement('div');\n this.root = new dom.Element(HTMLelement, {\n name: 'root',\n data: {}\n });\n if (this.el) {\n let parent = this.el.parentNode;\n if (parent) {\n parent.replaceChild(HTMLelement, this.el);\n }\n }\n this.el = HTMLelement;\n this.children = {};\n addChildren(this, this.root);\n\n this.rendered(...this._arguments);\n this._rendered = true;\n }\n }\n }", "title": "" }, { "docid": "c106250e3148ac3f932642debc784b19", "score": "0.6325751", "text": "render(data) {\n //not sure what to do with render yet\n const newVdom = this.create(data); \n this.node = renderVDOM(newVdom, this.vdom, this.node);\n this.addStyle();\n this.vdom= newVdom;\n return this.node;\n }", "title": "" }, { "docid": "b564a3c0a68de9756fe606357a1dc031", "score": "0.63192004", "text": "createRenderRoot() {\n return this\n }", "title": "" }, { "docid": "810afcd3a8ee295295f1ebd49d72abb9", "score": "0.6315425", "text": "function render() {\n return domElement;\n }", "title": "" }, { "docid": "67db67a0a8decc18e168cb9c68ed7096", "score": "0.6309342", "text": "createRenderRoot() {\n return this;\n }", "title": "" }, { "docid": "32b33ac5deb354c5d905cc783fa42ab4", "score": "0.62965566", "text": "createRenderRoot() {\n return this;\n }", "title": "" }, { "docid": "3aa60196717bcd1598c905b38a75bd45", "score": "0.62581193", "text": "render() {\r\n this.logger.startEmpty()\r\n \r\n const element = this.pageModule.createElement();\r\n\r\n element.ready(this.onReady.bind(this));\r\n\r\n this.rootDom.empty();\r\n this.rootDom.append(element);\r\n }", "title": "" }, { "docid": "2099eb7d0545b5c883141c13cc95a9ae", "score": "0.61412984", "text": "_render() {\r\n let tmpl = `<div class=\"md-nav-wrapper\">\r\n <nav class=\"md-nav\">\r\n <div class=\"md-nav-header\">\r\n <span><i class=\"far fa-laugh-wink\"></i></span>\r\n <div class=\"md-nav-btn\" id=\"js-hide-nav-btn\"><i class=\"fas fa-angle-left\"></i></div>\r\n </div>\r\n <div id=\"md-nav-tree\">${this._listTemplate(this.tree)}</div>\r\n </nav></div>\r\n <div class=\"md-nav-btn\" id=\"js-show-nav-btn\"><i class=\"fas fa-angle-right\"></i></div>`\r\n\r\n $(\"body\").append(tmpl);\r\n\r\n this._fit()\r\n }", "title": "" }, { "docid": "0099c70d1f612f692b6229f2de914058", "score": "0.61151254", "text": "render() {\n if (!this.preRenderCheck()) {\n return ``;\n }\n this.beforeRender();\n const tpl = this.template() || this.html``;\n this.renderTemplate(tpl, this.root);\n this.buildStylesheets();\n if (this.styles) {\n if (!this.selector('style')) {\n this.root.appendChild(this.styles);\n }\n }\n setTimeout(() => {\n if (!this.rendered) {\n this.onFirstRender();\n this.rendered = true;\n }\n this.onRender();\n this.dispatch('rendered');\n }, 200); // allow for 100ms in store update\n }", "title": "" }, { "docid": "92cfd1d43a9e61f796077cb8338fcafe", "score": "0.61110646", "text": "render() {\n let containerFactory = createFactory(this.props.children.type);\n\n return containerFactory({\n params: this.props.params,\n location: this.props.location\n })\n }", "title": "" }, { "docid": "1eba017eff259f824db27159f0a023ff", "score": "0.60308945", "text": "function render() {\n // calling hbs.compile\n var compiled = this.compile.apply(this, arguments)\n return createRenderer(compiled)\n}", "title": "" }, { "docid": "4ac6033c782a3e175f47cbf6c6f3e612", "score": "0.6023678", "text": "renderDOM() {\n return new Promise(resolve => {\n let vnode = this.render();\n // Split up the array/element cases so type inference chooses the right\n // signature.\n if (Array.isArray(vnode)) {\n react_dom__WEBPACK_IMPORTED_MODULE_4__[\"render\"](vnode, this.node, resolve);\n }\n else {\n react_dom__WEBPACK_IMPORTED_MODULE_4__[\"render\"](vnode, this.node, resolve);\n }\n });\n }", "title": "" }, { "docid": "7e96f58024e16e33fb985eea73ce3389", "score": "0.6010551", "text": "render(data) {\n if (!this._rendered) {\n if (this.template) {\n if (data) {\n this.data = data;\n }\n let options = this._options,\n parentChildren = this._parentChildren,\n decoder = new Decoder(this.template),\n template = decoder.render(this.data);\n if (this.el) {\n let parent = this.el.parentNode;\n if (parent) {\n parent.replaceChild(template.fragment, this.el);\n }\n if (this.elGroup && this.elGroup.get(this.el)) {\n this.elGroup.delete(this.el);\n this.el = template.fragment;\n this.elGroup.set(template.fragment, this);\n }\n } else {\n this.el = template.fragment;\n }\n\n\n this.root = new dom.Element(template.fragment, {\n name: 'root',\n data: {}\n });\n\n this.children = applyElement(template.children, options);\n applyParent(this, parentChildren, this.data);\n this.bindings = setBinders(this.children, true);\n\n if (this.data) {\n this.applyBinders(this.data, this);\n }\n\n setRoutes(this.children, this.context);\n addChildren(this, this.root);\n this.rendered(...this._arguments);\n this._rendered = true;\n }\n }\n }", "title": "" }, { "docid": "a6888e63618fdacc073a82ec4ccee458", "score": "0.6008588", "text": "render () {\n\t\tvar c;\n\t\tfor (var i=0; i<this.viewableTemplates; ++i) {\n\t\t\tc = this.containers[i];\n\t\t\tif ( c.firstChild ) c.removeChild(c.firstChild);\n\t\t\tc.appendChild(this.dataset[i+this.offset]);\n\t\t}\n\t}", "title": "" }, { "docid": "b0159e3fb441aa7fab247b443ade7b09", "score": "0.6005264", "text": "createDom() {\n this.decorateInternal(this.dom_.createElement(goog.dom.TagName.DIV));\n }", "title": "" }, { "docid": "ff8cb0b5c12f01987985735b210fb2e4", "score": "0.59899044", "text": "function render() {\n // avoid memory leak by cloning arguments\n var len = arguments.length;\n var args = Array(len);\n while (len--) args[len] = arguments[len];\n\n var compiled = this.compile.apply(this, args);\n return createRenderer(compiled);\n}", "title": "" }, { "docid": "9708486634a3e62c88ea7b68d5b747f1", "score": "0.59851927", "text": "function render() {\n // make sure we have a clean slate\n var root = $(rootTemplate);\n\n // append list of categories\n root.append(buildList());\n\n self.html(root);\n }", "title": "" }, { "docid": "34caa579d7f7d2d33fdd6e31fd6c55b5", "score": "0.5948228", "text": "function createDomElements() {\n\t\t\treturn $(container).append(html);\n\t\t}", "title": "" }, { "docid": "1fec10a33274d6d45526d4686cbbf193", "score": "0.5946756", "text": "render() {\n if (this.root) {\n const rootElement = document.querySelector(this.root);\n if (rootElement) {\n rootElement.innerHTML = this.template();\n }\n } else {\n this._renderRequested();\n }\n }", "title": "" }, { "docid": "9903ac3acd595ea7efa0613ee755789a", "score": "0.5934354", "text": "rebuildDom( webAppPage = null, // If undefined - all web-pages will be printed, or only specified webPage\n withTmpl = true, // If false - webPages will be printed skipping templates\n level = 0, // initial indentation\n tabulation = 2) {\n\n function stringifyNodeBeginning(node, level, tabulation) {\n if (node.type === undefined) {\n return nodeHandlers.stringifyNodeBeginning(node, level, tabulation);\n } else if (node.type === 'tmpl') {\n return ' '.repeat(level*tabulation) + '<iframe src=\"./template-' + node.tmpl.name + '.html\">No template.</iframe>\\n' +\n ' '.repeat(level*tabulation) + '<iframeChilds>\\n';\n }\n }\n\n function stringifyNodeEnding(node, level, tabulation) {\n if (node.type === undefined) {\n return nodeHandlers.stringifyNodeEnding(node, level, tabulation);\n } else if (node.type === 'tmpl') {\n return ' '.repeat(level*tabulation) + '</iframeChilds>\\n';\n }\n }\n\n let queue = undefined;\n if (webAppPage !== null) queue = [webAppPage];\n else queue = this.webAppPageList.slice();\n\n let doms = [];\n let processedTmplNames = [];\n while (queue.length > 0) {\n let webPage = queue.splice(0, 1)[0];\n if (webPage.type === 'template') {\n if (withTmpl && processedTmplNames.indexOf(webPage.name) === -1)\n processedTmplNames.push(webPage.name);\n else\n continue;\n }\n let domRoot = webPage.type === 'webPage' ? webPage.domRoot : (webPage.type === 'template' ? webPage.tmplRoot : undefined);\n\n let dom = '';\n let stack = [];\n for (let {node, levelChange} of utils.yieldTreeNodes(domRoot, NodeProcessing.getYieldNodeChilds('tmpl'), 't')) {\n\n if (node.type === 'tmpl')\n queue.push(node.tmpl);\n\n if (levelChange === 1) {\n stack.push(node);\n dom += stringifyNodeBeginning(node, level, tabulation);\n level += 1;\n } else if (levelChange < 0) {\n for (let i = 0; i < -levelChange; i++) {\n level -= 1;\n dom += stringifyNodeEnding(stack[stack.length -1], level, tabulation);\n stack.pop();\n }\n }\n if (levelChange <= 0) {\n dom += stringifyNodeEnding(stack[stack.length -1], level -1, tabulation);\n stack.pop();\n dom += stringifyNodeBeginning(node, level -1, tabulation);\n stack.push(node);\n }\n }\n\n for (let i = stack.length -1; i >= 0; i--) {\n level -= 1;\n dom += stringifyNodeEnding(stack[stack.length -1], level, tabulation);\n stack.pop();\n }\n\n doms.push({\n name: webPage.type + '-' + webPage.name + '.html',\n type: 'webPage',\n dom: dom\n });\n }\n \n return doms;\n }", "title": "" }, { "docid": "d5633276a874cbd0a928291892f7ecb7", "score": "0.5924704", "text": "render() {\n let ret = []\n for (let part in this.body) {\n ret.push(document.createComment(part));\n ret.push(this.body[part].buildElement());\n }\n return ret;\n }", "title": "" }, { "docid": "a33ca57c8233bb8c2e162c44dc66974d", "score": "0.58993644", "text": "buildRenderDom(nodeArray, parent = null){\n return nodeArray.filter((item) =>{\n if (item.type === 'tag' && item.name === 'Module') {\n let name = item.attribs.name.trim();\n if (!name) {\n throw new Error('Module has no name.');\n }\n if (this.modules[name] !== undefined) {\n throw new Error('Module with the name ' + name + ' is already defined.');\n }\n this.modules[name] = new Module(item, () => this);\n return false;\n }\n return true;\n }).map((item) =>{\n if (this.modules[item.name] !== undefined) {\n return new ModuleNode(this.modules[item.name], item, parent, () => this);\n }\n return new Node(item, parent, () => this);\n });\n }", "title": "" }, { "docid": "05f1bdab5899ea9f0f3df8b25519cfd9", "score": "0.58945954", "text": "function createRender() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$render = options.render,\n render = _options$render === undefined ? _enzyme.render : _options$render;\n\n var theme = (0, _theme2.default)();\n var jss = (0, _jss.create)((0, _jssPresetDefault2.default)());\n var styleManager = (0, _jssThemeReactor.createStyleManager)({ jss: jss, theme: theme });\n var renderWithContext = function renderWithContext(node) {\n return render(_react2.default.createElement(\n _MuiThemeProvider2.default,\n { styleManager: styleManager },\n node\n ));\n };\n\n renderWithContext.propTypes = process.env.NODE_ENV !== \"production\" ? babelPluginFlowReactPropTypes_proptype_Element === require('prop-types').any ? {} : babelPluginFlowReactPropTypes_proptype_Element : {};\n renderWithContext.cleanUp = function () {\n styleManager.reset();\n };\n\n return renderWithContext;\n}", "title": "" }, { "docid": "08347753268018d01c017d0747e80c78", "score": "0.58685064", "text": "function _hydrateAndRenderExternalTemplates() {\n const header = new Header(\n './../../../templates/includes/header.jsr'\n );\n const footer = new Footer(\n './../../../templates/includes/footer.jsr'\n );\n const breadcrumb = new BreadCrumb(\n ['Hub', 'Physiques', 'Electricité'], \n ['../../../index.html', '', 'electricity.html'],\n ['before-icon-hub', 'before-icon-physics', ''],\n './../../../templates/includes/breadcrumb.jsr'\n );\n\n const headerTemplate = new Template(\n header.templateName,\n header.parentBlock,\n header.data\n );\n\n const footerTemplate = new Template(\n footer.templateName,\n footer.parentBlock,\n footer.data\n );\n\n const breadcrumbTemplate = new Template(\n breadcrumb.templateName,\n breadcrumb.parentBlock,\n breadcrumb.data\n );\n\n const render = new RenderExternalTemplate();\n render.render(headerTemplate);\n render.render(footerTemplate);\n render.render(breadcrumbTemplate);\n}", "title": "" }, { "docid": "b21d84aab1d49888c18727829becb1fd", "score": "0.5864615", "text": "function _hydrateAndRenderExternalTemplates() {\n const header = new Header(\n './../../../templates/includes/header.jsr'\n );\n const footer = new Footer(\n './../../../templates/includes/footer.jsr'\n );\n const breadcrumb = new BreadCrumb(\n ['Hub', 'Mathématiques', 'PPCM'], \n ['../../../index.html', '', 'lcm.html'],\n ['before-icon-hub', 'before-icon-mathematics', ''],\n './../../../templates/includes/breadcrumb.jsr',\n );\n\n const headerTemplate = new Template(\n header.templateName,\n header.parentBlock,\n header.data\n );\n\n const footerTemplate = new Template(\n footer.templateName,\n footer.parentBlock,\n footer.data\n );\n\n const breadcrumbTemplate = new Template(\n breadcrumb.templateName,\n breadcrumb.parentBlock,\n breadcrumb.data\n );\n\n const render = new RenderExternalTemplate();\n render.render(headerTemplate);\n render.render(footerTemplate);\n render.render(breadcrumbTemplate);\n}", "title": "" }, { "docid": "c487ff70640b49546b1bed4f6ad93d0d", "score": "0.5851056", "text": "render(){\n\t\tthis.domElement = $(\"<div>\");\n\t\tthis.domElement.addClass(this.domElementClass);\n\t\tthis.domElement.on('click',this.handleClick);\n\t\tthis.domElement.css(\"background-color\", this.availableColors[this.currentColorIndex]);\n\t\treturn this.domElement;\n\t}", "title": "" }, { "docid": "7af4b90b8a645a0f68e1a547668f1b6c", "score": "0.58477265", "text": "function render(){\n //will remove all wxisting todos in the todoTarget <div>\n $todosList.empty();\n //define a var that contains all the todos\n //and each todo has been formated for html output\n var todosHtml = getAllTodosHtml(allTodos);\n //appending todos with html output to the view\n $todosList.append(todosHtml);\n}", "title": "" }, { "docid": "7299046e2ee42fb9f56a309366dfaac8", "score": "0.5839178", "text": "function render() {\n var createNodes = __webpack_require__(1646);\n var createClusters = __webpack_require__(1643);\n var createEdgeLabels = __webpack_require__(1644);\n var createEdgePaths = __webpack_require__(1645);\n var positionNodes = __webpack_require__(1654);\n var positionEdgeLabels = __webpack_require__(1653);\n var positionClusters = __webpack_require__(1652);\n var shapes = __webpack_require__(1656);\n var arrows = __webpack_require__(1642);\n\n var fn = function(svg, g) {\n preProcessGraph(g);\n\n var outputGroup = createOrSelectGroup(svg, \"output\");\n var clustersGroup = createOrSelectGroup(outputGroup, \"clusters\");\n var edgePathsGroup = createOrSelectGroup(outputGroup, \"edgePaths\");\n var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, \"edgeLabels\"), g);\n var nodes = createNodes(createOrSelectGroup(outputGroup, \"nodes\"), g, shapes);\n\n layout(g);\n\n positionNodes(nodes, g);\n positionEdgeLabels(edgeLabels, g);\n createEdgePaths(edgePathsGroup, g, arrows);\n\n var clusters = createClusters(clustersGroup, g);\n positionClusters(clusters, g);\n\n postProcessGraph(g);\n };\n\n fn.createNodes = function(value) {\n if (!arguments.length) return createNodes;\n createNodes = value;\n return fn;\n };\n\n fn.createClusters = function(value) {\n if (!arguments.length) return createClusters;\n createClusters = value;\n return fn;\n };\n\n fn.createEdgeLabels = function(value) {\n if (!arguments.length) return createEdgeLabels;\n createEdgeLabels = value;\n return fn;\n };\n\n fn.createEdgePaths = function(value) {\n if (!arguments.length) return createEdgePaths;\n createEdgePaths = value;\n return fn;\n };\n\n fn.shapes = function(value) {\n if (!arguments.length) return shapes;\n shapes = value;\n return fn;\n };\n\n fn.arrows = function(value) {\n if (!arguments.length) return arrows;\n arrows = value;\n return fn;\n };\n\n return fn;\n}", "title": "" }, { "docid": "1878cac93d4e58c92c78e660f22c3eee", "score": "0.582332", "text": "function createRenders(){\r\n var i;\r\n var j;\r\n for (i = 0; i < 2;i++){\r\n for (j = 0; j <7;j++){\r\n renders[i][j] = {\r\n layer: rendered_layers[i][j],\r\n field: variable_choices[i][j],\r\n basemap: map.basemap,\r\n classificationMethod: \"natural-breaks\", // -------------- keep this for normal layers\r\n numClasses: 5,\r\n legendOptions: {\r\n title: field_labels[j]\r\n }\r\n };\r\n }\r\n }\r\n}", "title": "" }, { "docid": "2c19848a5a55724a75bc7af88844c405", "score": "0.582111", "text": "function renderElements(obj){\n\n //select the list of folders and documents\n var ulfd = document.querySelector('ul.filedoc-list');\n\n\n //remove all child elements\n while(document.querySelector('li.fs') ){\n ulfd.removeChild(document.querySelector('li.fs'));\n }\n\n\n //for all objects set them to unrenderesd\n for(var prop in obj){\n if(obj[prop]){\n obj[prop].isRendered=false;\n\n }\n }\n\n //for each item in the object\n for(var prop in obj){\n //check if type document\n if(DataDocument.prototype.isPrototypeOf(obj[prop])){\n\n //check if it has been rendered already\n if(obj[prop].isRendered===false){\n\n //create element and set rendered to true\n createElement('li', ulfd, 'fs document ' +prop, obj[prop].id||'', 'Document');\n obj[prop].isRendered=true;\n }\n\n\n }\n\n //check if folder type\n if(DataFolder.prototype.isPrototypeOf(obj[prop])){\n //check if its already rendered\n if(obj[prop].isRendered===false){\n //create element\n createElement('li', ulfd, 'fs folder '+ prop, obj[prop].id||'', 'Folder');\n //check if it has children\n obj[prop].childrenIds.length>0? obj=renderChildren(obj, obj[prop].childrenIds, 10) : '';\n //set rendered to true\n obj[prop].isRendered=true;\n }\n\n }\n\n }\n return obj;\n }", "title": "" }, { "docid": "19e0a8933ede99714d4b54b6a534eef1", "score": "0.5801429", "text": "render() {\n this._renderObjects();\n }", "title": "" }, { "docid": "f933afbb068aee51490f2ddf05bef2ef", "score": "0.57923174", "text": "function render() {\n var createNodes = __webpack_require__(\"a88c\");\n var createClusters = __webpack_require__(\"a0782\");\n var createEdgeLabels = __webpack_require__(\"052e\");\n var createEdgePaths = __webpack_require__(\"5794\");\n var positionNodes = __webpack_require__(\"e0ff\");\n var positionEdgeLabels = __webpack_require__(\"115e\");\n var positionClusters = __webpack_require__(\"9534\");\n var shapes = __webpack_require__(\"66d4\");\n var arrows = __webpack_require__(\"c90d\");\n\n var fn = function(svg, g) {\n preProcessGraph(g);\n\n var outputGroup = createOrSelectGroup(svg, \"output\");\n var clustersGroup = createOrSelectGroup(outputGroup, \"clusters\");\n var edgePathsGroup = createOrSelectGroup(outputGroup, \"edgePaths\");\n var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, \"edgeLabels\"), g);\n var nodes = createNodes(createOrSelectGroup(outputGroup, \"nodes\"), g, shapes);\n\n layout(g);\n\n positionNodes(nodes, g);\n positionEdgeLabels(edgeLabels, g);\n createEdgePaths(edgePathsGroup, g, arrows);\n\n var clusters = createClusters(clustersGroup, g);\n positionClusters(clusters, g);\n\n postProcessGraph(g);\n };\n\n fn.createNodes = function(value) {\n if (!arguments.length) return createNodes;\n createNodes = value;\n return fn;\n };\n\n fn.createClusters = function(value) {\n if (!arguments.length) return createClusters;\n createClusters = value;\n return fn;\n };\n\n fn.createEdgeLabels = function(value) {\n if (!arguments.length) return createEdgeLabels;\n createEdgeLabels = value;\n return fn;\n };\n\n fn.createEdgePaths = function(value) {\n if (!arguments.length) return createEdgePaths;\n createEdgePaths = value;\n return fn;\n };\n\n fn.shapes = function(value) {\n if (!arguments.length) return shapes;\n shapes = value;\n return fn;\n };\n\n fn.arrows = function(value) {\n if (!arguments.length) return arrows;\n arrows = value;\n return fn;\n };\n\n return fn;\n}", "title": "" }, { "docid": "066d7b64c077e706ac68e2fd6c898189", "score": "0.5787572", "text": "render(){\n this.inheritState();\n return Node.renderArray(this.children);\n }", "title": "" }, { "docid": "66e87760dde1508ec62aebebe7955019", "score": "0.5770471", "text": "_render() {\n const table = this.getElement('table');\n const initialClassName = table.className;\n domAddClassNames(table, className('table'), className('tbody'));\n\n const fh = domCreate('div');\n\n domAddClassNames(fh, className('container'));\n domWrap(table, fh);\n\n const tbodyWrapper = domWrap(table, 'div');\n domAddClassNames(tbodyWrapper, className('tbody-wrapper'));\n\n const colGroup = domFind('colgroup', table);\n const colGroupClone = domClone(colGroup);\n const thead = domFind('thead', table);\n const thTable = domCreate('table');\n\n domAddClassNames(thTable, initialClassName, className('table'), className('thead'));\n\n domPrepend(fh, thTable);\n thTable.appendChild(colGroupClone);\n thTable.appendChild(thead);\n\n const theadWrapper = domWrap(thTable, 'div');\n domAddClassNames(theadWrapper, className('thead-wrapper'));\n\n this._el.container = fh;\n this._el.tbodyWrapper = tbodyWrapper;\n this._el.theadWrapper = theadWrapper;\n\n domBind(window, 'resize', this._handleResize);\n\n setTimeout(this._setTheadPadding, 20);\n }", "title": "" }, { "docid": "d7aa6989cc19b8a714c6ccd6f816b194", "score": "0.5765013", "text": "function createRenderer() {\n wrapperElement = document.createElement('div');\n wrapperElement.style.zIndex = zIndexes.VISUALIZER;\n wrapperElement.classList.add('experiment-visualizer');\n wrapperElement.classList.add('experiment-visualizer--' + pid);\n viewportElement.appendChild(wrapperElement);\n\n wrapperElement.style.top = '0px';\n wrapperElement.style.left = '0px';\n\n canvas = document.createElement('canvas');\n\n resize();\n }", "title": "" }, { "docid": "8a91060a9bba947548bf3a8f51d5821b", "score": "0.57436526", "text": "_create() {\n this.element.addClass(this.options.classes.root);\n this._createDefinition();\n this.cluesRegistry = this._createClueRegistry();\n this._construct();\n this._createCluesLists();\n this._addEventsListeners();\n //use or create model\n //create markup from model\n //assign events\n }", "title": "" }, { "docid": "2159fc17c85f99b260e6579c9165829f", "score": "0.5739778", "text": "render() {\n // Default components just need to scope a piece of DOM from constructor\n this.setElement();\n setTimeout(() => this.onRender(), 0);\n }", "title": "" }, { "docid": "afde40addb00551fa54904f5f23c9103", "score": "0.5738257", "text": "render () {\n\t\tgithub.render();\n\t\tcommit.render();\n\t\tplayer.render();\t\n\t\tcat.render();\t\n\t\t\t\n\t}", "title": "" }, { "docid": "536c992a6159e3690c3e800c5f720594", "score": "0.57310903", "text": "function createRender() {\n var options1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (!warnedOnce) {\n warnedOnce = true;\n console.warn(['Material-UI: the test utils are deprecated, they are no longer present in v5.', 'The helpers were designed to work with enzyme.', 'However, the tests of the core components were moved to react-testing-library.'].join('\\n'));\n }\n\n var _options1$render = options1.render,\n render = _options1$render === void 0 ? _enzyme.render : _options1$render,\n other1 = (0, _objectWithoutProperties2.default)(options1, [\"render\"]);\n\n var renderWithContext = function renderWithContext(node) {\n var options2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return render( /*#__PURE__*/React.createElement(_RenderMode.RenderContext, null, node), (0, _extends2.default)({}, other1, options2));\n };\n\n return renderWithContext;\n}", "title": "" }, { "docid": "1054ca63e7edfc1f1103eda89550daf9", "score": "0.57104445", "text": "function DOMRenderer(){_classCallCheck(this,DOMRenderer);var _this=_possibleConstructorReturn(this,(DOMRenderer.__proto__||Object.getPrototypeOf(DOMRenderer)).call(this));_this.tiles=null;_this.container=null;// to deal with css top / left precision issues, we need to position\n// the layer container relative to the current viewport within some\n// pixel threshold to prevent rendering issues.\n_this.offset={x:0,y:0};_this.drawTimeout=null;_this.eraseTimeout=null;return _this;}", "title": "" }, { "docid": "e7ae8192c399ed2a6967a861289d80a0", "score": "0.5700192", "text": "render() {\n const self = this;\n const data = this.get('data');\n if (!data) {\n throw new Error('data must be defined first');\n }\n this.clear();\n this.emit('beforerender');\n const autoPaint = this.get('autoPaint');\n this.setAutoPaint(false);\n Util.each(data.nodes, node => {\n self.add(NODE, node);\n });\n Util.each(data.edges, edge => {\n self.add(EDGE, edge);\n });\n if (self.get('fitView')) {\n self.get('viewController')._fitView();\n }\n self.paint();\n self.setAutoPaint(autoPaint);\n self.emit('afterrender');\n }", "title": "" }, { "docid": "a10004e245d027225a23f946756b8b33", "score": "0.5693585", "text": "render() {\n this.renderModule(this.program.topLevelModule, this.container);\n\n this.renderModeSpecific();\n\n }", "title": "" }, { "docid": "6dbac5398a2e6d3ce1a00524cf9e2522", "score": "0.5679842", "text": "createRenderer() {\n this.renderer = new Renderer({ creator: this });\n }", "title": "" }, { "docid": "53e642c6ef0806dff8af53da5952ff5d", "score": "0.5678567", "text": "render (vdom, parent) {\n return _render(vdom, parent, this)\n }", "title": "" }, { "docid": "eef4d15e926a566412d8233702f482ba", "score": "0.5673844", "text": "function RenderableDOMElement() {}", "title": "" }, { "docid": "b58ab5c98e003cd4d7ce5e55f34a9e61", "score": "0.5666768", "text": "function render() {\n for (let i=0; i<devNames.length; i++) {\n let memberDiv = document.createElement('div');\n memberDiv.className = 'memberDiv';\n teamMembersSection.appendChild(memberDiv);\n\n let memberImage = document.createElement('img');\n memberImage.src = TeamMembers.all[i].image;\n memberDiv.appendChild(memberImage);\n\n let memberDiv1 = document.createElement('div1');\n memberDiv1.className = 'memberDiv1';\n memberDiv.appendChild(memberDiv1);\n\n let memberName = document.createElement('h2');\n memberName.textContent =TeamMembers.all[i].name;\n memberDiv1.appendChild(memberName);\n\n let memberMajor = document.createElement('p');\n memberMajor.textContent = TeamMembers.all[i].major;\n memberDiv1.appendChild(memberMajor);\n\n let memberFacts = document.createElement('p');\n memberFacts.textContent = TeamMembers.all[i].facts;\n memberDiv1.appendChild(memberFacts);\n\n let memberGHA = document.createElement('a');\n memberGHA.href = TeamMembers.all[i].gitHubAcc;\n memberDiv1.appendChild(memberGHA);\n\n let memberGHButton = document.createElement('button');\n memberGHButton.textContent = 'GitHub';\n memberGHA.appendChild(memberGHButton);\n }\n\n}", "title": "" }, { "docid": "5140cb21558e2698e105f1594e6faa96", "score": "0.5658124", "text": "function renderTree() {\n var root = h.render(component) || h('span');\n root.properties = root.properties || {};\n root.properties['data-mounter'] = name || '';\n return root;\n }", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.56558806", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.56558806", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.56558806", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.56558806", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.56558806", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.56558806", "text": "render() {}", "title": "" }, { "docid": "e1c19bad75b325aeb8d0137c084f526f", "score": "0.5638454", "text": "function render() {\n // Clear all children\n document.getElementById('list-wrapper').innerHTML = null;\n // Counting for seq. number and incomplete lists.\n let seq = 1;\n let countLeft = 0;\n\n // Render all lists and also attach toggleList and deleteList function.\n for (i in store.lists) {\n const list = store.lists[i];\n \n // If list isn't done yet, countLeft++\n if (!list.isDone) countLeft++;\n\n // Filter logics\n // Active filter but list is done -> skip\n if (store.filter === 'active' && list.isDone) continue;\n // Done filter but list isn't done -> skip\n else if (store.filter === 'done' && !list.isDone) continue;\n\n // Render List\n const listDOM = createListDOM(list, seq);\n document.getElementById('list-wrapper').appendChild(listDOM);\n }\n\n // Render count label e.g. \"You have 7 todos left!\"\n const countDOM = createCountDOM(countLeft);\n document.getElementById('list-wrapper').appendChild(countDOM);\n}", "title": "" }, { "docid": "f76ba64281535dd04f94a397c3b64566", "score": "0.5629481", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n\t var flatChildren = flattenTopLevelChildren(children);\n\t var topFrame = {\n\t type: null,\n\t // Assume all trees start in the HTML namespace (not totally true, but\n\t // this is what we did historically)\n\t domNamespace: Namespaces.html,\n\t children: flatChildren,\n\t childIndex: 0,\n\t context: emptyObject,\n\t footer: ''\n\t };\n\n\t {\n\t topFrame.debugElementStack = [];\n\t }\n\n\t this.threadID = allocThreadID();\n\t this.stack = [topFrame];\n\t this.exhausted = false;\n\t this.currentSelectValue = null;\n\t this.previousWasTextNode = false;\n\t this.makeStaticMarkup = makeStaticMarkup;\n\t this.suspenseDepth = 0; // Context (new API)\n\n\t this.contextIndex = -1;\n\t this.contextStack = [];\n\t this.contextValueStack = [];\n\n\t {\n\t this.contextProviderStack = [];\n\t }\n\t }", "title": "" }, { "docid": "b3db7d3550966a3ae60a7a323e7f6bc1", "score": "0.5629127", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n\n {\n topFrame.debugElementStack = [];\n }\n\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = [];\n\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "b3db7d3550966a3ae60a7a323e7f6bc1", "score": "0.5629127", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n\n {\n topFrame.debugElementStack = [];\n }\n\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = [];\n\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "b3db7d3550966a3ae60a7a323e7f6bc1", "score": "0.5629127", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n\n {\n topFrame.debugElementStack = [];\n }\n\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = [];\n\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "b3db7d3550966a3ae60a7a323e7f6bc1", "score": "0.5629127", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n\n {\n topFrame.debugElementStack = [];\n }\n\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = [];\n\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "b3db7d3550966a3ae60a7a323e7f6bc1", "score": "0.5629127", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n\n {\n topFrame.debugElementStack = [];\n }\n\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = [];\n\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "b3db7d3550966a3ae60a7a323e7f6bc1", "score": "0.5629127", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n\n {\n topFrame.debugElementStack = [];\n }\n\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = [];\n\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "b3db7d3550966a3ae60a7a323e7f6bc1", "score": "0.5629127", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n\n {\n topFrame.debugElementStack = [];\n }\n\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = [];\n\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "b3db7d3550966a3ae60a7a323e7f6bc1", "score": "0.5629127", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n\n {\n topFrame.debugElementStack = [];\n }\n\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = [];\n\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "3c01910fbf82d5156b1614ce1ac77192", "score": "0.5626737", "text": "create(html){\n //we can't use document.createDocumentFragment(); because it doesn't have .innerHTML\n var div = document.createElement('div');\n div.innerHTML = html;\n return new LightDom (div.childNodes);\n }", "title": "" }, { "docid": "02aa6f43f70ac7d556ea92e36d67453d", "score": "0.5619141", "text": "function renderDOM($, dom, options) {\n if (!dom && $._root && $._root.children) {\n dom = $._root.children;\n }\n options = options|| dom.options || $._options;\n return domSerializer(dom, options);\n}", "title": "" }, { "docid": "fcaf004a94b94d4810bef1d96e141fae", "score": "0.561323", "text": "render() {\n this.html = '';\n this.createElements().show().setupListeners();\n }", "title": "" }, { "docid": "f42e962de74fdf06c9481aeda89d113c", "score": "0.5596583", "text": "_render() {\n\t\t\tif (this._template && this.renderer) {\n\t\t\t\tthis.renderer(this._template.apply(this, this.getTemplateArgs()), this.element);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6cf7c7fa023d6bfc6fc81d1fcb2ba8e3", "score": "0.55911094", "text": "init() {\n\t\tdocument.getElementById('main').innerHTML = this.render();\n\t\tthis.afterRender();\n\t}", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.5588472", "text": "render() { }", "title": "" }, { "docid": "17032f33f3a7cb0a98637fd65d5b82d3", "score": "0.55820936", "text": "generateRootElement() {\n const div = document.createElement('div');\n // add IE prefix class due to dynamic injecting elements\n if (this.base.dxp.is.ie()) {\n div.classList.add(CSS_CLASS.IE_PREFIX);\n }\n div.classList.add(TREE_JS_CLASS.TREE);\n return div;\n }", "title": "" }, { "docid": "7fc055a9e3266f1ccaef59735ba2551f", "score": "0.5576478", "text": "function _createRenderMime() {\n var transformers = [\n new renderers.JavascriptRenderer(),\n new renderers.MarkdownRenderer(),\n // new renderers.HTMLRenderer(),\n // NOTE: The HTMLRenderer doesn't work with current Safari versions -- inline JS scripts\n // don't load. This simple implementation works around it by using jQuery to add the\n // HTML to the DOM; this does run inline scripts.\n {\n mimetypes: ['text/html'],\n render: function(mimetype, data) {\n var widget = new PhWidget.Widget();\n widget.onAfterAttach = function() {\n $(widget.node).html(data);\n };\n return widget;\n }\n },\n new renderers.ImageRenderer(),\n new renderers.SVGRenderer(),\n new renderers.LatexRenderer(),\n new renderers.TextRenderer()\n ];\n var mimeMap = {};\n var order = [];\n transformers.forEach(function(t) {\n t.mimetypes.forEach(function(m) {\n order.push(m);\n mimeMap[m] = t;\n });\n });\n return new RenderMime(mimeMap, order);\n }", "title": "" }, { "docid": "927bfd2be006e3842080d567a3558e1f", "score": "0.55721205", "text": "function renderEngine(options) {\n\n var that = {};\n\t\t\n\t\tthat.render = function(options) {\n\t\t\t\n\t\t};\n\n\t\tthat.unrender = function(options) {\n\t\t\t\n\t\t};\n\n return that;\n }", "title": "" }, { "docid": "b1e2ce412cdd0aa57c566eb3abb013a6", "score": "0.55676603", "text": "function _hydrateAndRenderBodyTemplate() {\n const electricity = new Electricity();\n const template = new Template(\n electricity.templateName, \n electricity.parentBlock,\n electricity.data, \n );\n\n const render = new RenderLocalTemplate();\n render.render(template);\n}", "title": "" }, { "docid": "1698af9375e9876221051b474ef16474", "score": "0.5567488", "text": "function render() {\n renderEntities();\n }", "title": "" }, { "docid": "22dff2fae72e7ea0e32bf9fc3fab1642", "score": "0.5565763", "text": "function render(){\n console.log(\"OK: Tree rendered\")\n\n window.onresize = function() {\n if(window.location.pathname == '/' || (window.location.pathname == '/home' && $rootScope.viewhome)){\n render();\n }\n };\n\n if($rootScope.home){\n scope.leftTreeWidth = ((window.innerWidth * 80/100 - 70) * 65/100 - margin.right - margin.left - 3);\n scope.leftTreeHeight = window.innerHeight - 270 - 50 - margin.top - margin.bottom;\n } else{\n scope.leftTreeWidth = (window.innerWidth - 70) * 65/100 - margin.right - margin.left - 3;\n scope.leftTreeHeight = window.innerHeight - 50 - margin.top - margin.bottom;\n }\n\n leftTreeSvg.selectAll(\"*\").remove();\n\n scope.root = $rootScope.nodes;\n scope.root.x0 = scope.leftTreeHeight / 2;\n scope.root.y0 = 0;\n\n scope.leftTree = d3.layout.tree()\n .separation(function(a,b){\n if(a.parent != b.parent || b.children ){\n return 2\n } else{\n return 1\n }\n })\n .size([scope.leftTreeHeight, scope.leftTreeWidth])\n\n scope.leftTreeDiagonal = d3.svg.diagonal().projection(function(d) { return [d.y, d.x]; });\n\n if($rootScope.foldedNodes == undefined){\n nodeService.collapseAll($rootScope.nodes)\n } else{\n nodeService.collapseSelectively($rootScope.nodes);\n }\n\n // When we render, the nodeEnd, foldedNodes, activeNodes have already been set ( all that has to do with cookies)\n // So we just need to color the active nodes and find the proper breadcrumb to display\n nodeService.colorActiveNodes($rootScope.nodes)\n nodeService.findBreadCrumb()\n\n update(scope.root, 1);\n }", "title": "" }, { "docid": "da6760e9ca028a20670d108847ce640e", "score": "0.5561075", "text": "render() {\n this.createViewsControllers();\n this.todoListView.render(this.taskControllers);\n \n this.attachDeleteBtns();\n }", "title": "" }, { "docid": "defb31daaf8da859f31e65b4b9865b7d", "score": "0.5555694", "text": "function createDom(entities, room) {\n\t\tvar roomEntities;\n\t\tswitch (room) {\n\t\t case \"living_room\":\n\t\t \troomEntities = living_roomEntities;\n\t\t break; \n\t\t case \"dinning_room\":\n\t\t \troomEntities = dinning_roomEntities;\n\t\t break; \n\t\t case \"terrace\":\n\t\t \troomEntities = terraceEntities;\n\t\t break; \n\t\t case \"heaters\":\n\t\t \troomEntities = heatersEntities;\n\t\t break;\n\t\t}\n\t\t\n\t\tvar domString = \"\";\n\t\tfor (var i=0;i<roomEntities.length;i++) {\n\t\t\tvar element = roomEntities[i];\n\t\t\tvar a = findWithAttr(entities, \"entity_id\", element);\n\t\t\t\n\t\t\tif (a != -1) {\n\t\t\t\tdomString = domString + createListItem(entities[a], ViewMetadata[element]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$('#entity-list').html(domString);\n\t\t$('#entity-list-title').html(TIZEN_L10N[room]);\n\t}", "title": "" }, { "docid": "a914e996a1fe7c5336baaf3af46cd319", "score": "0.55456066", "text": "render(objects){\n objects.forEach((obj) => obj.render(this.ctx));\n }", "title": "" }, { "docid": "db53fd91086b9cf6f9f747e358cdb02a", "score": "0.554031", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup) {\n _classCallCheck(this, ReactDOMServerRenderer);\n\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n {\n topFrame.debugElementStack = [];\n }\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = [];\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "417940a0b67c289606039bcf168c9152", "score": "0.55375814", "text": "function render() {\n\t\tinternalRender();\n\t}", "title": "" }, { "docid": "c29371ea6d417ccdfb35cad1fa00ae71", "score": "0.5526898", "text": "render() {\n const inputClasses = {\n focused: this._isFocused,\n 'input-wrapper': true\n };\n const iconClasses = {\n focused: this._isFocused && !!this._selectedItemState,\n 'search-icon': true\n };\n const dropdownClasses = {\n dropdown: true,\n visible: this._isDropdownVisible\n };\n return (this.renderTemplate('default', { teams: this.items }) ||\n lit_element__WEBPACK_IMPORTED_MODULE_0__[\"html\"] `\n <div class=\"root\" @blur=${this.lostFocus} dir=${this.direction}>\n <div class=${Object(lit_html_directives_class_map__WEBPACK_IMPORTED_MODULE_1__[\"classMap\"])(inputClasses)} @click=${this.gainedFocus}>\n ${this.renderSelected()}\n <div class=\"search-wrapper\">${this.renderSearchIcon()} ${this.renderInput()}</div>\n </div>\n ${this.renderCloseButton()}\n <div class=${Object(lit_html_directives_class_map__WEBPACK_IMPORTED_MODULE_1__[\"classMap\"])(dropdownClasses)}>${this.renderDropdown()}</div>\n </div>\n `);\n }", "title": "" }, { "docid": "68a04d6f9feaed08ccbb38fa9e20ba4e", "score": "0.5525705", "text": "function initRenderMenu(){\n // gets the main div\n var renderMenu = d3.select(\"#renderMenu\");\n\n // creates the add prop button\n // addProperty(renderMenu);\n // creates the pallet\n addSpeedColorPallet(renderMenu);\n addDwellTimeColorPallet(renderMenu);\n // creates the bus selector\n // renderFunctionSelector(renderMenu);\n }", "title": "" }, { "docid": "151fe558bafc80cf16359234e5a3d7a0", "score": "0.552491", "text": "render(data) {\n // @debug\n render_debug(`Render Component: ${this.constructor.name}`, true);\n data = data || (this.record && this.record.summarize())\n const jdom = this.preprocess(this.compose(data), data);\n if (jdom === undefined) {\n //> If the developer accidentally forgets to return the JDOM value from\n // compose, instead of leading to a cryptic DOM API error, show a more\n // friendly warning.\n throw new Error(this.constructor.name + '.compose() returned undefined.');\n }\n try {\n this.node = render(this.node, this.jdom, jdom);\n } catch (e) {\n /* istanbul ignore next: haven't found a reproducible error case that triggers this */\n console.error('rendering error.', e);\n }\n return this.jdom = jdom;\n }", "title": "" }, { "docid": "fd624d84c72bedb69af491262a97d003", "score": "0.55216783", "text": "function render(self) {\n var container = isDOMElement(self.node) ? self.node : document.getElementById(self.node);\n var leaves = [], click ,clicko ,clickFolder, clickBackground;\n var a =0 ;\n var renderLeaf = function (item,a) {\n\n //console.log('----------'+ a);\n\n var leaf = document.createElement('div');\n var content = document.createElement('div');\n var text = document.createElement('span');\n var tinyText = document.createElement('span');\n //var expando = document.createElement('div');\n var expando = document.createElement('md-icon');\n\n let frag = document.createRange().createContextualFragment('<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?><svg height=\"15\" width=\"15\" ><polygon points=\"0,0 0,12 12,6\" class=\"interchange\" ></polygon></svg>');\n var iconFolder = document.createRange().createContextualFragment('<img alt=\"Smiley face\" class=\"file-expando filee\" style=\"float:left\">');\n var iconFolder2 = document.createElement('img');\n let iconFile = document.createRange().createContextualFragment('<img src=\"./img/fileIcon.png\" alt=\"Smiley face\" class=\"tree-leaf-text\" style=\"float:left\">');\n\n\n\n\n\n leaf.setAttribute('class', 'tree-leaf');\n content.setAttribute('class', 'tree-leaf-content');\n content.setAttribute('data-item', JSON.stringify(item));\n text.setAttribute('class', 'tree-leaf-text');\n tinyText.setAttribute('class', 'tree-leaf-text');\n text.textContent = item.name;\n\n // console.log(item.name);\n\n //--------------------------------------------\n var space = document.createElement('span');\n space.innerHTML= '&nbsp ';\n space.classList.add('indent');\n var space2 = document.createElement('span');\n space2.innerHTML= ' &nbsp ';\n space2.classList.add('indent');\n var space3 = document.createElement('span');\n space3.innerHTML= ' &nbsp ';\n space3.classList.add('indent');\n // content.insertAdjacentElement(\"afterbegin\", space);//('beforebegin','space');\n // content.insertBefore(space, content.firstChild);\n //leaf.insertAdjacentElement(\"afterbegin\", space);//('beforebegin','space');\n //leaf.insertBefore(space, content.firstChild);\n //-------------------------------------------------\n\n if (a == 1){\n content.appendChild(space);\n }\n if (a == 2){\n content.appendChild(space);\n content.appendChild(space2);\n }\n if (a == 3){\n content.appendChild(space);\n content.appendChild(space2);\n content.appendChild(space3);\n }\n\n expando.setAttribute('class', 'tree-expando ' + (item.expanded ? 'expanded' : ''));\n // expando.textContent = item.expanded ? '-' : '+';\n\n content.appendChild(expando);\n\n\n expando.appendChild(frag);\n content.appendChild(iconFolder2);\n //text.append(iconFolder);\n content.appendChild(text);\n //text.appendChild(tinyText);\n //\n\n leaf.appendChild(content);\n\n let thefold = expando.querySelector('.interchange');\n thefold.classList.add(\"forpla\") ;\n\n\n if (item.children && item.children.length > 0) {\n var children = document.createElement('div');\n children.setAttribute('class', 'tree-child-leaves');\n //the space\n // children.insertAdjacentElement(\"afterbegin\", space);//('beforebegin','space');\n // children.insertBefore(space, children.firstChild);\n //\n // children.appendChild(space);\n a++;\n forEach(item.children, function (child) {\n //new stuff ===================================\n // var space = document.createElement('span');\n // space.classList.add('indent');\n // children.appendChild(space);\n\n var childLeaf = renderLeaf(child ,a);\n //syntax for the folder\n iconFolder2.setAttribute('src', './img/folderIcon.svg');\n iconFolder2.setAttribute('class', 'file-expando');\n // text.appendChild(tinyText);\n //\n // var space = document.createElement('div');\n // space.innerHTML= '-------------';\n // space.classList.add('indent');\n // children.appendChild(space);\n\n children.appendChild(childLeaf);\n\n //childLeaf.insertAdjacentElement(\"afterbegin\", space);//('beforebegin','space');\n //childLeaf.insertBefore(space, childLeaf.firstChild);\n //\n\n\n });\n\n if (!item.expanded) {\n children.classList.add('hidden');\n }\n leaf.appendChild(children);\n } else {\n expando.classList.add('hidden');\n //text.appendChild(iconFile);\n iconFolder2.setAttribute('src', './img/fileicon.svg');\n iconFolder2.setAttribute('class', 'tree-leaf-text filo');\n\n\n }\n return leaf;\n };\n\n forEach(self.data, function (item) {\n //var a;\n //a++;\n leaves.push(renderLeaf.call(self, item ,a));\n });\n container.innerHTML = leaves.map(function (leaf) {\n return leaf.outerHTML;\n }).join('');\n\n\n\n\n\n\n\n click = function (e) {\n\n var parent = (e.target || e.currentTarget);\n\n var data = JSON.parse(parent.getAttribute('data-item'));\n\n if(data == null){\n\n parent = (e.target || e.currentTarget).parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));\n if(data == null){\n parent = (e.target || e.currentTarget).parentNode.parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));;\n if(data == null){\n parent = (e.target || e.currentTarget).parentNode.parentNode.parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));\n if(data == null){\n parent = (e.target || e.currentTarget).parentNode.parentNode.parentNode.parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));\n }\n }\n }\n }\n\n //var parent = (e.target || e.currentTarget).parentNode.parentNode.parentNode;\n\n\n // console.log('+++++++++ Parent +++++++++++++');\n // console.log(parent);\n // //var data = JSON.parse(parent.getAttribute('data-item'));\n // console.log(\" The data =============\");\n // console.log(data);\n\n\n\n var leaves = parent.querySelector('.tree-child-leaves');\n // console.log('-----------Click Expando');\n // console.log(self);\n\n if (leaves) {\n if (leaves.classList.contains('hidden')) {\n self.expand(parent, leaves);\n } else {\n self.collapse(parent, leaves);\n }\n }\n else {\n\n emit(self, 'select2', {\n target: e,\n data: data\n //parento :parent\n });\n }\n };\n //Jono add folder click\n\n clicko = function (e) {\n //var parent = (e.target || e.currentTarget).previousSibling.parentNode;\n // console.log(parent);\n //var data = JSON.parse(parent.getAttribute('data-item'));\n var parent = (e.target || e.currentTarget);\n\n var data = JSON.parse(parent.getAttribute('data-item'));\n\n if(data == null){\n\n parent = (e.target || e.currentTarget).parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));\n if(data == null){\n parent = (e.target || e.currentTarget).parentNode.parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));;\n if(data == null){\n parent = (e.target || e.currentTarget).parentNode.parentNode.parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));\n if(data == null){\n parent = (e.target || e.currentTarget).parentNode.parentNode.parentNode.parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));\n }\n }\n }\n }\n\n var leaves = parent.querySelector('.tree-child-leaves');\n\n // console.log('-----------Clicko Name');\n // console.log(self);\n if (leaves) {\n if (leaves.classList.contains('hidden')) {\n self.expand(parent, leaves);\n } else {\n self.collapse(parent, leaves);\n // console.log(\"epitorum run my funct\");\n }\n } else {\n emit(self, 'select2', {\n target: e,\n data: data\n //parento :parent\n });\n }\n };\n\n\n\n clickFolder = function (e) {\n var parent = (e.target || e.currentTarget).parentNode;\n // console.log(parent);\n var data = JSON.parse(parent.getAttribute('data-item'));\n var leaves = parent.parentNode.querySelector('.tree-child-leaves');\n\n // console.log('-----------ClickFolder Name');\n // console.log(self);\n if (leaves) {\n if (leaves.classList.contains('hidden')) {\n self.expand(parent, leaves);\n } else {\n self.collapse(parent, leaves);\n // console.log(\"epitorum run my funct\");\n }\n } else {\n emit(self, 'select2', {\n target: e,\n data: data,\n parento :parent\n });\n }\n };\n\n clickBackground= function (e) {\n var parent = (e.target || e.currentTarget);\n\n var data = JSON.parse(parent.getAttribute('data-item'));\n\n if(data == null){\n\n parent = (e.target || e.currentTarget).parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));\n if(data == null){\n parent = (e.target || e.currentTarget).parentNode.parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));;\n if(data == null){\n parent = (e.target || e.currentTarget).parentNode.parentNode.parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));\n if(data == null){\n parent = (e.target || e.currentTarget).parentNode.parentNode.parentNode.parentNode;\n data = JSON.parse(parent.getAttribute('data-item'));\n }\n }\n }\n }\n\n // console.log('=====Parent========');\n // console.log(parent);\n\n var leaves = parent.parentNode.querySelector('.tree-child-leaves');\n // console.log('-----------ClickBackground ');\n // console.log(leaves);\n\n if (leaves) {\n if (leaves.classList.contains('hidden')) {\n self.expand(parent, leaves);\n } else {\n self.collapse(parent, leaves);\n\n }\n } else {\n emit(self, 'select2', {\n target: e,\n data: data,\n parento :parent\n });\n }\n };\n\n\n forEach(container.querySelectorAll('.tree-leaf-text'), function (node) {\n node.onclick = clicko;\n // console.log(node.previousSibling);\n });\n forEach(container.querySelectorAll('.tree-expando'), function (node) {\n node.onclick = click;\n // node.onclick = clickBackground;\n });\n\n forEach(container.querySelectorAll('.file-expando'), function (node) {\n node.onclick = clickFolder;\n });\n forEach(container.querySelectorAll('.tree-leaf-content'), function (node) {\n node.onclick = clickBackground;\n });\n\n }", "title": "" }, { "docid": "7a7be83ba01b785268098d75e5d105ac", "score": "0.5521077", "text": "function render() {\n var divHtml = $('#' + divId);\n divHtml.empty();\n var restUrl = getUrlRest();\n getItems(restUrl).then(function (items) {\n var htmlItems = \"\";\n getAllItemsViewsAfterTransformation(items).map(function (item) { htmlItems += injectInformation(template, item); });\n divHtml.append(htmlItems);\n });\n}", "title": "" }, { "docid": "710e68b187aecd75b752a2648c95c3e2", "score": "0.55197257", "text": "function renderEverything() {\n renderPepperonni()\n renderMushrooms()\n renderGreenPeppers()\n renderWhiteSauce()\n renderGlutenFreeCrust()\n\n renderButtons()\n renderPrice()\n}", "title": "" }, { "docid": "2e885be44094f723ca859a1bd82d7382", "score": "0.5519217", "text": "renderTree() {\n\t\t//append svg element\n\t\tlet svg = d3.select(\"body\").append(\"svg\")\n\t\t\t.attr(\"width\", 1200)\n\t\t\t.attr(\"height\", 1200);\n\n\t\t//get array of children\n\t\tlet children = [];\n\t\tfor (let i = 1; i < this.nodes.length; i++) {\n\t\t\tchildren.push(this.nodes[i]);\n\t\t}\n\n\t\t//append edges\n\t\tlet edge = svg.selectAll(\"line\")\n\t\t\t.data(children)\n\t\t\t.enter().append(\"line\")\n\t\t\t.attr(\"x1\", d => d.level * 200 + 50)\n\t\t\t.attr(\"y1\", d => d.position * 120 + 50)\n\t\t\t.attr(\"x2\", d => d.parentNode.level * 200 + 50)\n\t\t\t.attr(\"y2\", d => d.parentNode.position * 120 + 50);\n\n\t\t//append circles\n\t\tlet circle = svg.selectAll(\"circle\")\n\t\t\t.data(this.nodes)\n\t\t\t.enter().append(\"circle\")\n\t\t\t.attr(\"cx\", d => d.level * 200 + 50)\n\t\t\t.attr(\"cy\", d => d.position * 120 + 50)\n\t\t\t.attr(\"r\", 50);\n\n\t\t//append texts\n\t\tlet text = svg.selectAll(\"text\")\n\t\t\t.data(this.nodes)\n\t\t\t.enter().append(\"text\")\n\t\t\t.attr(\"x\", d => d.level * 200 + 50)\n\t\t\t.attr(\"y\", d => d.position * 120 + 50)\n\t\t\t.classed(\"label\", true)\n\t\t\t.text(d => d.name.toUpperCase());\n\t}", "title": "" }, { "docid": "177ba2c8fa3bee5e19c9edb53f837c79", "score": "0.55184954", "text": "function ReactDOMServerRenderer(children, makeStaticMarkup, options) {\n var flatChildren = flattenTopLevelChildren(children);\n var topFrame = {\n type: null,\n // Assume all trees start in the HTML namespace (not totally true, but\n // this is what we did historically)\n domNamespace: Namespaces.html,\n children: flatChildren,\n childIndex: 0,\n context: emptyObject,\n footer: ''\n };\n\n {\n topFrame.debugElementStack = [];\n }\n\n this.threadID = allocThreadID();\n this.stack = [topFrame];\n this.exhausted = false;\n this.currentSelectValue = null;\n this.previousWasTextNode = false;\n this.makeStaticMarkup = makeStaticMarkup;\n this.suspenseDepth = 0; // Context (new API)\n\n this.contextIndex = -1;\n this.contextStack = [];\n this.contextValueStack = []; // useOpaqueIdentifier ID\n\n this.uniqueID = 0;\n this.identifierPrefix = options && options.identifierPrefix || '';\n\n {\n this.contextProviderStack = [];\n }\n }", "title": "" }, { "docid": "7a88e39e345a9753c27b203ec15f5ae6", "score": "0.55072266", "text": "function createRenderer(compiled) {\n return function*(context) {\n // create a safe copy of the context\n // so that all each layer has its own generator helpers queue\n context = Object.create(context || null);\n\n context[Q] = context[Q] || [];\n // execution index;\n context[Q].index = context[Q].index || 0;\n\n var args = Array.prototype.slice.call(arguments);\n args[0] = context;\n\n var out = compiled.apply(null, args);\n\n return yield replace.call(context, context[Q], out);\n };\n}", "title": "" }, { "docid": "458e2c5391d25fdce4343167c4b3002e", "score": "0.55048954", "text": "function render () {\n }", "title": "" }, { "docid": "69f4ca407a3629b9c90c59819fc5f9c3", "score": "0.5504571", "text": "function renderWidgets(managerFactory, element = document.documentElement) {\n let tags = element.querySelectorAll('script[type=\"application/vnd.jupyter.widget-state+json\"]');\n for (let i = 0; i != tags.length; ++i) {\n renderManager(element, JSON.parse(tags[i].innerHTML), managerFactory);\n }\n}", "title": "" }, { "docid": "8e125400a94e9f856d865ebd30b0ff24", "score": "0.5501703", "text": "static render(context, tree, position = [0,0], size = 1){\n for (var i = 0; i < tree.length; i++) {\n var rotation = i * (Math.PI/2) + Math.PI / 4;\n var length = Math.SQRT2 * size / 2;\n var x = position[0] + Math.sin(rotation) * length;\n var y = position[1] + Math.cos(rotation) * length;\n if (Array.isArray(tree[i])) {\n this.render(context,tree[i],[x,y],length / Math.SQRT2);\n } else {\n Geonym.drawCircle(context,\n [x,y],\n 0.90*(length / Math.SQRT2),\n Geonym.niceColor()\n );\n }\n }\n }", "title": "" }, { "docid": "c7712a38a45e5cdab07e9942db353b66", "score": "0.5499914", "text": "function setNodeTemplate() {\n var canvas = new ej2_react_diagrams_2.StackPanel();\n canvas.children = [];\n canvas.style.strokeWidth = 0;\n canvas.style.fill = \"#e6e0eb\";\n canvas.children.push(getTextElement(\"Events\", \"#a6a1e0\"));\n canvas.children.push(getTextElement(\"Emails\", \"#db8ec9\"));\n canvas.children.push(getTextElement(\"Calls\", \"#db8ec9\"));\n canvas.children.push(getTextElement(\"Smart Contents\", \"#db8ec9\"));\n return canvas;\n}", "title": "" }, { "docid": "c9db8ad561add7fb71bb490ffde3a570", "score": "0.54958856", "text": "function render() {\n renderPrizes();\n renderUsers();\n}", "title": "" }, { "docid": "0e321733002f8cf46016bc59619e4ab3", "score": "0.549518", "text": "renderTrees () {\n for (const tree of config.trees) {\n const treeToAdd = new TreeSprite({ \n game: this.game,\n location: { x: tree.x, y: tree.y },\n scale: tree.scale,\n });\n this.game.layerManager.layers.get('environmentLayer').add(treeToAdd);\n }\n }", "title": "" }, { "docid": "7d3f9ba092db09a5035bdf38fc542316", "score": "0.5494904", "text": "function Dom(data){\n this.data = data;\n var that = this;\n\n // Function to create new dom element\n this.createdom = function(type){\n var dom = document.createElement(type);\n return dom;\n }\n // Function to add class to the dom element specified via arguments\n this.addclass = function(dom,classname){\n dom.setAttribute('class', classname);\n }\n // Add style to specified dom element\n this.addstyle = function(dom, stylename, value){\n dom.style[stylename] = value;\n }\n // Append one dom element to another\n this.addchild = function(parent, child){\n parent.appendChild(child);\n }\n // To apply all styles specified to a dom element\n // And for all children\n this.iterateobj = function(parentdom, obj){\n var dom;\n // get all keys of data given as a array\n var kees = Object.keys(obj);\n // Go through every key\n kees.forEach(function(item){\n // if key is 'tagName', create dom element\n if (item == 'tagName'){\n dom = that.createdom(obj[item]);\n // Append it to its parent dom element\n that.addchild(parentdom, dom);\n }else if(item == 'className'){\n // add class to the new created dom element\n that.addclass(dom, obj[item]);\n }else if(item == 'styles'){\n // Apply styles to the newly created dom element recursively\n // Initial context is maintained so that the parent and child doms\n // are still clear\n that.iterateobj(dom, obj[item]);\n }else if(item == 'children'){\n // For every child object under children key, repeat the same process\n // recursively.Passing the newly created created dom element as a\n // parent\n obj[item].forEach(function(child){\n that.iterateobj(dom, child);\n });\n }else{\n // For styling\n that.addstyle(parentdom, item, obj[item]);\n }\n });\n }\n\n // initialisation\n this.init = function(){\n this.iterateobj(mainWrap, data[0]);\n }\n}", "title": "" } ]
a44d7873c8267148c25b71a9fcda6d0a
Support: IE >= 9
[ { "docid": "c9c698ddd795e6496fb5ad9958163614", "score": "0.0", "text": "function fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && manipulation_rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}", "title": "" } ]
[ { "docid": "a43ee635bcf81c989757652aa1fb1015", "score": "0.70616937", "text": "function __NotSupportedByMozilla(){if(!browser.ie){alert(\"This feature is currently not supported !\");return true;}else{return false;}}", "title": "" }, { "docid": "5df9aad6e7457fa71ca6319795bcc677", "score": "0.69641113", "text": "function isInternetExplorer(){if(\"undefined\"==typeof navigator)return!1;var rv=-1,ua=navigator.userAgent;if(\"Microsoft Internet Explorer\"===navigator.appName){var re=new RegExp(\"MSIE ([0-9]{1,}[.0-9]{0,})\");null!=re.exec(ua)&&(rv=parseFloat(RegExp.$1))}else if(ua.indexOf(\"Trident\")>-1){var re=new RegExp(\"rv:([0-9]{2,2}[.0-9]{0,})\");null!==re.exec(ua)&&(rv=parseFloat(RegExp.$1))}return rv>=8}", "title": "" }, { "docid": "5d71c9789e86b9006d03b78ecaf18f36", "score": "0.6944816", "text": "function checkIE8Browser() { \r\n if( dojo.isIE && dojo.isIE <= 8 ){\r\n \t correctBrowser = true\r\n }\r\n }", "title": "" }, { "docid": "0bfe8911378bdeba28a82c24120d502c", "score": "0.6701825", "text": "function is_IE_8_or_9() {\n\tvar val = which_IE();\n\tif (val == false) return false; // Non IE Browsers\n\tif (val < 10) return true;\n\treturn false;\n}", "title": "" }, { "docid": "fe2a7146f7895ce1f9b3c4edaf1f296a", "score": "0.66161203", "text": "function ieFix(){}", "title": "" }, { "docid": "26d439175564f7cb3970dbe7fa2f80a8", "score": "0.6572787", "text": "function isIE8() {\n return $('html').hasClass('lt-ie9');\n}", "title": "" }, { "docid": "f5b95713cfc0ecb2d125197fdfa9d69f", "score": "0.6538035", "text": "function isIE()\n{\n return getBrowserCore() == \"Trident\";\n}", "title": "" }, { "docid": "89405f052915cfda15b4635b3f50954f", "score": "0.6510429", "text": "function CheckInternetExplorer(){\r\n var rv = -1; //to prevent fails the pointer should be null\r\n if (navigator.appName == 'Microsoft Internet Explorer'){\r\n var ua = navigator.userAgent;\r\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\r\n if (re.exec(ua) != null)\r\n rv = parseFloat( RegExp.$1 );\r\n if(rv > -1){\r\n switch(rv){\r\n case 8.0:\r\n return true\r\n break;\r\n case 7.0: \r\n return true;\r\n break;\r\n case 6.0: \r\n return true;\r\n break;\r\n default:\r\n return false\r\n //\"Default\";\r\n break; \r\n }\r\n }\r\n }\r\n \r\n}", "title": "" }, { "docid": "03b1fc3924b877da57676cc5f05c8a27", "score": "0.64741814", "text": "function isIE() {\r\n var myNav = navigator.userAgent.toLowerCase();\r\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\r\n}", "title": "" }, { "docid": "aff1f4253be041fa0ab719f589965c65", "score": "0.64285624", "text": "function msieversion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) { \n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n if (ieVersion === 9) {$('body').addClass('no-js ie' + ieVersion);}\n return ieVersion;\n }\n else { return false; }\n }", "title": "" }, { "docid": "92a12cef0145089aa4257564f010347c", "score": "0.6425462", "text": "function isIE() { return ((navigator.appName == 'Microsoft Internet Explorer') || ((navigator.appName == 'Netscape') && (new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\").exec(navigator.userAgent) != null))); }", "title": "" }, { "docid": "ca950a2e15357941c0291fb75ce7c3ad", "score": "0.63959235", "text": "function isIEVersion9() {\n var bIsIE9 = false; // Return value assumes not IE 9.\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null) {\n bIsIE9 = (parseFloat(RegExp.$1) == 9);\n }\n }\n return bIsIE9;\n }", "title": "" }, { "docid": "81dc7357df696dfad761f14181de3bfc", "score": "0.6385071", "text": "function isIE() {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "title": "" }, { "docid": "81dc7357df696dfad761f14181de3bfc", "score": "0.6385071", "text": "function isIE() {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "title": "" }, { "docid": "8ea445ff67cabd7bc827f8891c79be95", "score": "0.63663405", "text": "function onError(err){\n console.log(\"Your browser isn't smart enough to use this feature. What are you using, IE 7??\", err);\n}", "title": "" }, { "docid": "66a3b8bca4663953bc91d7ceab92ca50", "score": "0.63591963", "text": "function IsIE() {\r\n return window.navigator.userAgent.contains('Trident');\r\n}", "title": "" }, { "docid": "d481128e9927fabdc757ef30b648e0cd", "score": "0.635608", "text": "function msieversion() {\n\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) // If Internet Explorer, return version number\n {\n // pop up a modal box saying for better experience I recommend to use chrome or firefox or safari\n }\n\n\n return false;\n}", "title": "" }, { "docid": "29b1ebe4670d87e7bd76e7e11c7c011d", "score": "0.6340006", "text": "function isBrowserIE() {\n\t if (window.navigator && window.navigator.userAgent) {\n\t var ua = window.navigator.userAgent;\n\t\n\t return ua.indexOf('Trident/7.0') > 0 || ua.indexOf('Trident/6.0') > 0;\n\t }\n\t\n\t return false;\n\t}", "title": "" }, { "docid": "4343bb12eb387edcbd48a6b83824129c", "score": "0.6330292", "text": "function iecompattest() {\r\n\treturn (document.compatMode && document.compatMode != \"BackCompat\") ? document.documentElement : document.body;\r\n}", "title": "" }, { "docid": "7b440057a682abfddad42545da6a01e3", "score": "0.6321999", "text": "function isIE () {\r\n var myNav = navigator.userAgent.toLowerCase();\r\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1], 10) : false;\r\n }", "title": "" }, { "docid": "1450b434f1ab9cb044bbd8c71805bd24", "score": "0.6318825", "text": "function isIE () {\n\t var myNav = navigator.userAgent.toLowerCase();\n\t return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n\t}", "title": "" }, { "docid": "c4c2b6da09f26341b3dfd075a86296d7", "score": "0.63060784", "text": "function isIE() {\n\t\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t\t}", "title": "" }, { "docid": "636b8f88a840bae1e0cf5d2e57110279", "score": "0.6298311", "text": "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n }", "title": "" }, { "docid": "bfc103d2c3c0c59390b875d7da8b7830", "score": "0.6279699", "text": "function isIE() {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : 0;\n }", "title": "" }, { "docid": "06ed5c76a5c14b70d663949e9f98bb31", "score": "0.6261745", "text": "function hasIframeFocusIssue() {\n return isIE();\n }", "title": "" }, { "docid": "ed95ba61ce526f33548e53e8a172e551", "score": "0.6261437", "text": "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1], 10) : false;\n }", "title": "" }, { "docid": "3d97d203fd2ce1d2630e68c750031071", "score": "0.6257591", "text": "function isIe11() {\r\n var isIE11 = ( !!navigator.userAgent.match(/Trident\\/7\\./)) ? true : false\r\n return isIE11\r\n}", "title": "" }, { "docid": "e0762e1ecd116ae198a748c6fe3bde04", "score": "0.6233818", "text": "function isOlderIE() {\n\treturn (navigator.userAgent.indexOf('MSIE')!==-1 || navigator.appVersion.indexOf('Trident/') > -1);\n}", "title": "" }, { "docid": "58bedcac18d225e4442255b6eebd4a50", "score": "0.6232729", "text": "function estMSIE() {\n\treturn (navigator.appName.indexOf(\"Microsoft\") != -1);\n}", "title": "" }, { "docid": "4af340a2cb403591ecceb623b0b8613d", "score": "0.62260723", "text": "function msieversion() {\r\n\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf(\"MSIE \");\r\n\r\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\r\n $('html').addClass('client-ie');\r\n $('input[class^=switch]').each(function(){\r\n $(this).wrap('<div class=\"switch-wrap\"></div>').after('<span class=\"switch-indicator\"></span>');\r\n });\r\n } else // If another browser, return 0\r\n {\r\n $('html').removeClass('client-ie');\r\n }\r\n\r\n return false;\r\n }", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.6221327", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.6221327", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.6221327", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.6221327", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.6221327", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.6221327", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.6221327", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "54a7760d8a55b6ce4b6b4ae366675e75", "score": "0.6218864", "text": "function isIE() {\n return typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n }", "title": "" }, { "docid": "4dc5bbfe94d949918ef21a5fc6bde8a2", "score": "0.62158006", "text": "function browserIsIE() {\n return !!navigator.appName.match(/Microsoft Internet Explorer/);\n}", "title": "" }, { "docid": "846403bb75fb83f87bbdda84f711dff3", "score": "0.620821", "text": "function isIE() {\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n var msie = ua.indexOf(\"MSIE \"); // IE 10 or older\n var trident = ua.indexOf(\"Trident/\"); //IE 11\n var edge = ua.indexOf(\"Edge/\"); //IE 11\n\n return msie > 0 || trident > 0 || edge > 0;\n }", "title": "" }, { "docid": "22b50fe2a731f4b0f4955933deca9b16", "score": "0.6198699", "text": "function isIE(){\n\t\treturn false || !!document.documentMode;\n\t}", "title": "" }, { "docid": "63c7e8a668529b4b7a2aff8e8e14eda7", "score": "0.61930126", "text": "function isIE() {\n ua = navigator.userAgent;\n /* MSIE used to detect old browsers and Trident used to newer ones*/\n //var is_ie = ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n var is_ie=ua.indexOf(\"MSIE \") > -1;\n return is_ie; \n}", "title": "" }, { "docid": "7562a4800794a73827bd7bf2c3b467c8", "score": "0.61879313", "text": "function isIE() {\n var retVal = false;\n retVal = (window.ActiveXObject) || (navigator.appVersion.indexOf(\"MSIE\")!=-1);\n return retVal;\n}", "title": "" }, { "docid": "fad49fff71f634486d932eef48926e29", "score": "0.6165155", "text": "function isIE() {\n\tlet ua = window.navigator.userAgent;\n\tif (ua.indexOf(\"MSIE \") > 0 || ua.indexOf(\"Trident/\") > 0)\n\t\treturn true;\n\treturn false;\n}", "title": "" }, { "docid": "870ac99f568cd0c93ddc92d50948609f", "score": "0.61563253", "text": "function isIE() {\n var agent = navigator.userAgent.toLowerCase();\n return agent.indexOf(\"msie\") !== -1 || agent.indexOf(\"trident\") !== -1 || agent.indexOf(\" edge/\") !== -1;\n }", "title": "" }, { "docid": "4545d33b89fb0d7548b12e583c5412fc", "score": "0.61511284", "text": "function IsInternetExplorer () {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) { // If Internet Explorer, return true\n return true;\n } else { // If another browser, return false\n return false;\n }\n}", "title": "" }, { "docid": "7cc5eabecd3a38c2c2d6f66781b87d97", "score": "0.6150657", "text": "function _isIE() {\n\treturn (_detectIeVersion() != 0)\n}", "title": "" }, { "docid": "2211943686f3e395bbdbf68cbe3b3e6a", "score": "0.6122164", "text": "function isInternetExplorer() {\n\t if (typeof navigator === 'undefined') {\n\t return false;\n\t }\n\t\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "2211943686f3e395bbdbf68cbe3b3e6a", "score": "0.6122164", "text": "function isInternetExplorer() {\n\t if (typeof navigator === 'undefined') {\n\t return false;\n\t }\n\t\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "2211943686f3e395bbdbf68cbe3b3e6a", "score": "0.6122164", "text": "function isInternetExplorer() {\n\t if (typeof navigator === 'undefined') {\n\t return false;\n\t }\n\t\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "2211943686f3e395bbdbf68cbe3b3e6a", "score": "0.6122164", "text": "function isInternetExplorer() {\n\t if (typeof navigator === 'undefined') {\n\t return false;\n\t }\n\t\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "29e90197bbc985530e681ae3258894cf", "score": "0.6111208", "text": "function isIE11()\n{\n var isIE11 = !!navigator.userAgent.match(/Trident.*rv[ :]*11\\./)\n return isIE11;\n}", "title": "" }, { "docid": "3b41239e5ac0048f03b93e5a2edd9e2b", "score": "0.6108994", "text": "function msieversion() {\r\n var ua=window.navigator.userAgent\r\n var msie=ua.indexOf ( \"MSIE \" )\r\n if ( msie > 0 ) return parseInt ( ua.substring ( msie+5, ua.indexOf ( \".\", msie ) ) )\r\n else return 0 \r\n}", "title": "" }, { "docid": "db0c5a2bdfbed138f370337a6f3b5651", "score": "0.61031157", "text": "function isIE8() {\n\t\t\n\t\tif( $('html').hasClass('ie8') ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "951f864ebe395192b857a94790986288", "score": "0.61004215", "text": "function ShowIEAlert() {\n if (isIE()) {\n alert(\"User is using IE\");\n }\n }", "title": "" }, { "docid": "1e1c32c43e67823bd614116fbe7dbbb7", "score": "0.6091512", "text": "function isBadIE () {\n var myNav = navigator.userAgent.toLowerCase();\n if (myNav.indexOf('msie') == -1) return false;\n ieversion = parseInt(myNav.split('msie')[1]);\n return (ieversion<10);\n}", "title": "" }, { "docid": "b3b07e9c194753ae816e13eff21d6a88", "score": "0.60849035", "text": "function isIE() {\n\t\tvar b = document.getElementById(\"alertmin\");\n\t\tvar bb = document.getElementById(\"alertbtn\");\n\t\tb.style.visibility = \"hidden\";\n\t\tbb.style.display = \"none\";\n\t\tb.style.top = \"-10000px\";\n\t\tb.style.float = \"none\";\n\t\tb.style.marginBottom = \"0\";\n\t\tb.style.padding = \"0\";\n\t\tdocument.getElementById(\"mintext\").style.display = \"none\";\n\t\tvar ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n\t\tvar msie = ua.indexOf('MSIE '); // IE 10 or older\n\t\tvar trident = ua.indexOf('Trident/'); //IE 11\n\t\treturn (msie > 0 || trident > 0);\n\t\t}", "title": "" }, { "docid": "dcf92074428790a87fc56bb66b43a0f8", "score": "0.60604364", "text": "function isIE() {\n return false || !!document.documentMode;\n}", "title": "" }, { "docid": "cc857f92585a55780d86bef0b0b8ba34", "score": "0.6032713", "text": "function supportsModernPaste() {\n return !isIE();\n }", "title": "" }, { "docid": "31787dd955e2fb171b7995c3c65e4c12", "score": "0.6010892", "text": "function ieOutdated() {\n\tif(!document.addEventListener){\n\t\t$('html').addClass('outdated-browser');\n\t}\n}", "title": "" }, { "docid": "db0b7d51d6cf3bb6baa882ee7fda736c", "score": "0.6010779", "text": "function fixIESelectBug() {\r\n\t\tvar ua = window.navigator.userAgent;\r\n\t\tvar msie = ua.indexOf(\"MSIE \");\r\n\t\tif (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\r\n\t\t\t$('div.login-container div.login-box div.login-content div.login-form-row select.form-control').css('background-image', 'none');\r\n\t\t};\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "59ef13cc0617fe1f7b45f9f59a305863", "score": "0.6000642", "text": "isInternetExplorer() {\n return (/*@cc_on!@*/false || !!document.documentMode);\n }", "title": "" }, { "docid": "cf2b72805bf61ad6989dccab77aa9300", "score": "0.5999492", "text": "function D(){if(Atalasoft.Utils.Browser.Explorer){var t=parseInt(Atalasoft.Utils.Browser.Version,10);t>=10&&12>t&&q.node&&q.node.parentNode&&q.node.parentNode.insertBefore(q.node,q.node)}}", "title": "" }, { "docid": "dfcb1ce4adb5669e5738b9f8e38e2b87", "score": "0.59988284", "text": "function IsIE7OrLater()\r\n{\r\n if(UserAgent.indexOf('msie 7') >= 0){return true;}\r\n else if(UserAgent.indexOf('msie')>0){return true;}\r\n else {return false;}\r\n}", "title": "" }, { "docid": "053dc7d1eca8ef5d81348c783f9b73c4", "score": "0.5982235", "text": "function isInternetExplorer() {\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "053dc7d1eca8ef5d81348c783f9b73c4", "score": "0.5982235", "text": "function isInternetExplorer() {\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "053dc7d1eca8ef5d81348c783f9b73c4", "score": "0.5982235", "text": "function isInternetExplorer() {\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "034e269fb7343eeb3accb3a0046b9a24", "score": "0.59791404", "text": "function detectIE() {\n\t\t var ua = window.navigator.userAgent;\n\t\t\tvar os = window.navigator.appVersion;\n\n\t\t\t// If Windows 7\n\t\t\tif ( (os.indexOf(\"Windows NT 7.0\") != -1) || (os.indexOf(\"Windows NT 6.1\") != -1) ) {\n\n\t\t\t\t// If Internet Explorer 11\n\t\t\t\tif(ua.indexOf('MSIE ') != -1 || ua.indexOf('Trident/') != -1){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t return false;\n\t\t}", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.59620595", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.59620595", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "96e958246db35c44ca026c8238033bd7", "score": "0.5961593", "text": "function utilities_isIE() {\r\n var rv = false;\r\n if (navigator.appName == 'Microsoft Internet Explorer')\r\n {\r\n var ua = navigator.userAgent;\r\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\r\n if (re.exec(ua) != null)\r\n rv = parseFloat(RegExp.$1);\r\n }\r\n return rv;\r\n}", "title": "" }, { "docid": "d5b8036f2ee38375133a744c24d423aa", "score": "0.5952424", "text": "function isIE() {\n\t\tvar ua = navigator.userAgent;\n\t\t/* MSIE used to detect old browsers and Trident used to newer ones*/\n\t\tvar is_ie = ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n\n\t\treturn is_ie; \n\t}", "title": "" }, { "docid": "fa06f9593fdb0669d89517f52cfa9b0f", "score": "0.5914992", "text": "static browser_is_supported() {\n if (\"Microsoft Internet Explorer\" === window.navigator.appName) {\n return document.documentMode >= 8;\n }\n if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "0ca58141c1ee4691016d7bed8b99ea86", "score": "0.5856073", "text": "function fixIE(objSelect, _width) {\r\n if ($.browser.msie && ($.browser.version == \"7.0\" || $.browser.version == \"6.0\")) {\r\n \r\n var liWidth = 0;\r\n objSelect.parent().find('li').each(function() {\r\n liWidth = $(this).width() > liWidth ? $(this).width() : liWidth;\r\n });\r\n\r\n liWidth = liWidth > _width ? liWidth : _width;\r\n objSelect.parent().find('.list-wrapper').width(liWidth);\r\n\r\n if ($.browser.version == \"6.0\") {\r\n objSelect.parent().find('li').each(function() {\r\n $(this).width(liWidth);\r\n });\r\n }\r\n \r\n }\r\n}", "title": "" }, { "docid": "e092864126c2914f80770eeb2a481e31", "score": "0.5846804", "text": "function browserdetect(){var A=navigator.userAgent.toLowerCase();this.isIE=A.indexOf(\"msie\")>-1;this.ieVer=this.isIE?/msie\\s(\\d\\.\\d)/.exec(A)[1]:0;this.isMoz=A.indexOf(\"firefox\")!=-1;this.isSafari=A.indexOf(\"safari\")!=-1;this.quirksMode=this.isIE&&(!document.compatMode||document.compatMode.indexOf(\"BackCompat\")>-1);this.isOp=window.opera?true:false;this.isWebKit=A.indexOf(\"webkit\")!=-1;if(this.isIE){this.get_style=function(D,F){if(!(F in D.currentStyle)){return\"\"}var C=/^([\\d.]+)(\\w*)/.exec(D.currentStyle[F]);if(!C){return D.currentStyle[F]}if(C[1]==0){return\"0\"}if(C[2]&&C[2]!==\"px\"){var B=D.style.left;var E=D.runtimeStyle.left;D.runtimeStyle.left=D.currentStyle.left;D.style.left=C[1]+C[2];C[0]=D.style.pixelLeft;D.style.left=B;D.runtimeStyle.left=E}return C[0]}}else{if(this.isSafari){this.get_style=function(D,E){var C,B=false;E=E.replace(/([a-z])([A-Z])/g,\"$1-$2\").toLowerCase();if(D.style.display==\"none\"){D.style.display=\"\";B=true}C=document.defaultView.getComputedStyle(D,\"\").getPropertyValue(E);if(B){D.style.display=\"none\"}return C}}else{this.get_style=function(B,C){C=C.replace(/([a-z])([A-Z])/g,\"$1-$2\").toLowerCase();return document.defaultView.getComputedStyle(B,\"\").getPropertyValue(C)}}}}", "title": "" }, { "docid": "eef19352d929cfd23cb55bc6a3283d01", "score": "0.58437693", "text": "function detectIE() {\r\n var ua = window.navigator.userAgent;\r\n\r\n var msie = ua.indexOf('MSIE ');\r\n if (msie > 0) {\r\n // IE 10 or older => return version number\r\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n }\r\n\r\n var trident = ua.indexOf('Trident/');\r\n if (trident > 0) {\r\n // IE 11 => return version number\r\n var rv = ua.indexOf('rv:');\r\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n }\r\n\r\n var edge = ua.indexOf('Edge/');\r\n if (edge > 0) {\r\n // IE 12 => return version number\r\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\r\n }\r\n\r\n // other browser\r\n return false;\r\n} // end detectIE()", "title": "" }, { "docid": "a27a261f63ba68bbdb845b4910768cda", "score": "0.58127594", "text": "function needsLayeringShim() {\n return isIE && (isWinXP || isWinVista || isWin7);\n}", "title": "" }, { "docid": "182cae3d0e50f1f7b1f454d598d122f3", "score": "0.581131", "text": "function needsLayeringShim() {\n return isIE && (isWinXP || isWinVista || isWin7);\n }", "title": "" }, { "docid": "3e129e1eda930974d2c735e52466d26e", "score": "0.57947415", "text": "function is-ie()\r\n{\r\n if (/*@cc_on!@*/false)\r\n {\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "d4ec52cff3eee81be36aa8c1a37894ac", "score": "0.5785101", "text": "function msIeVersion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n // If Internet Explorer, return version number\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n return parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n // If another browser, return 0\n }\n else {\n return 0;\n }\n}", "title": "" }, { "docid": "ada49a88eb5795d06e09f5982fbbcbec", "score": "0.5776387", "text": "function msieversion() {\n\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) // If Internet Explorer, return version number\n {\n return true\n }\n else // If another browser, return 0\n {\n return false\n }\n}", "title": "" }, { "docid": "2f65a8cc00a940c8295aa345e226b365", "score": "0.5767462", "text": "function msieversion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) \n {\n let $container = $('.page-header-hero__image--img'),\n imgUrl = $container.find('img').prop('src');\n console.log(imgUrl);\n if (imgUrl) {\n $container.css('backgroundImage', 'url(' + imgUrl + ')').addClass('compat-object-fit');\n $container.find('img').hide(); \n } \n }\n else \n {\n return;\n }\n }", "title": "" }, { "docid": "2f9d03021b4d1db01bf3bb67a9b54fdc", "score": "0.57669437", "text": "function msieversion() {\n var ua = window.navigator.userAgent;\n var msieV = ua.indexOf(\"MSIE \");\n if (msieV > 0) {\n // If Internet Explorer, return version number\n return parseInt(ua.substring(msieV + 5, ua.indexOf(\".\", msieV)));\n } else {\n // If another browser, return 0\n return false;\n }\n }", "title": "" }, { "docid": "7279c3a1322b176d9d821f27300f3721", "score": "0.5766757", "text": "function hasLiDeletingProblem() {\n return isIE();\n }", "title": "" }, { "docid": "c9abf995680acc9944bb777f65b807ad", "score": "0.5761615", "text": "function isIe678 () {\n\t\tvar IE = eval('\"v\"==\"\\v\"');\n\t\treturn \tIE;\n\t}", "title": "" }, { "docid": "8593958a1642d664661becd8596c33e4", "score": "0.5752458", "text": "function Unsupported(){\r\n\t\tvar objUA = window.navigator.userAgent;\r\n\t\t//If IE 11\r\n\t\tif( objUA.indexOf('Trident') > 0 && objUA.indexOf('MSIE') < 0 ){\r\n\t\t\t//If windows 7 then title keyboard focus is unsupported\r\n\t\t\tif(objUA.indexOf('NT 6.1') > 0){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t//If windows 8+ title keyboard focus is supported\r\n\t\t\telse {\r\n\t\t\t return false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//If not IE title keyboard focus is unsupported\r\n\t\telse {\r\n\t\treturn true;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "f80cf1cc2b37aa990027346b6c08ef85", "score": "0.5751977", "text": "detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "ebc02327eea96be27f03caf0dd6cbb35", "score": "0.57431227", "text": "checkIfIEOrEdge () {\n let isIEOrEdge = false\n if (/MSIE 10/i.test(navigator.userAgent)) {\n // This is internet explorer 10\n isIEOrEdge = true;\n }\n\n if (/MSIE 9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent)) {\n // This is internet explorer 9 or 11\n isIEOrEdge = true;\n }\n\n if (/Edge\\/\\d./i.test(navigator.userAgent)){\n // This is Microsoft Edge\n isIEOrEdge = true;\n }\n return isIEOrEdge\n }", "title": "" }, { "docid": "469e02aa48b38260d32caede39284def", "score": "0.57409817", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n\n\n var msie11 = ua.indexOf('rv:11');\n if (msie11 > 0) {\n // IE 10 or older => return version number\n return parseInt( ua.substring(msie11+3, ua.indexOf('.', msie11)+2), 10 );\n }\n\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {// IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {// Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }// other browser\n return false;\n}", "title": "" }, { "docid": "c3999707bc0d944ed550612d5ba8f4da", "score": "0.57268304", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n //return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n return 10;\n }\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n //return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n return 11;\n }\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n //return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n return 12;\n }\n // other browser\n return false;\n}", "title": "" }, { "docid": "7547e91d0b60e8402406c3da4deaf4d6", "score": "0.5718446", "text": "function isOldIE() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var navigator = typeof window !== 'undefined' ? window.navigator || {} : {};\n var userAgent = opts.userAgent || navigator.userAgent || ''; // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n\n var isMSIE = userAgent.indexOf('MSIE ') !== -1;\n var isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}", "title": "" }, { "docid": "e058feac0fe621879dc61654e97d1c64", "score": "0.57164735", "text": "static browser_is_supported() {\n if ('Microsoft Internet Explorer' === window.navigator.appName) {\n return document.documentMode >= 8;\n }\n if (\n /iP(od|hone)/i.test(window.navigator.userAgent) ||\n /IEMobile/i.test(window.navigator.userAgent) ||\n /Windows Phone/i.test(window.navigator.userAgent) ||\n /BlackBerry/i.test(window.navigator.userAgent) ||\n /BB10/i.test(window.navigator.userAgent) ||\n /Android.*Mobile/i.test(window.navigator.userAgent)\n ) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "0dbd2ca6d1d45fc07166b5207036fdf9", "score": "0.57074946", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n var trident = ua.indexOf('Trident/');\n\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n if (trident > 0) {\n // IE 11 (or newer) => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "6a9e88f8cae2474c9814bb7ccbf673cb", "score": "0.5691555", "text": "function browserCheck() {\n\t\tvar ver = 0; // Browser Version\n\t\tif(navigator.appName.charAt(0) == \"M\"){\n\t\t\tver = getInternetVersion(\"MSIE\");\n\t\t\tif (ver < \"9\"){\n\t\t\t\t$('body').prepend(\n\t\t\t\t\t'<div id=\"version\"><p>고객님께서는 현재 Explorer 구형버전으로 접속 중이십니다. 이 사이트는 Explorer 최신버전에 최적화 되어 있습니다. <a href=\"http://windows.microsoft.com/ko-kr/internet-explorer/download-ie\" target=\"_blank\">Explorer 업그레이드 하기</a></p> <button type=\"button\" class=\"versionClose\">X</button></div>'\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a256bcb9e5e3f8b2c3a82cdf1f595ffc", "score": "0.5684385", "text": "function clickIE4(){\r\n if (event.button==2){\r\n alert(message);\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "097c1ae378631f01dfe227b561fbb710", "score": "0.5675674", "text": "function isOldIE() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var navigator = _globals__WEBPACK_IMPORTED_MODULE_0__[\"window\"].navigator || {};\n var userAgent = opts.userAgent || navigator.userAgent || ''; // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n\n var isMSIE = userAgent.indexOf('MSIE ') !== -1;\n var isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}", "title": "" }, { "docid": "c09079abafba362bbfb8c374e0096c0c", "score": "0.5668153", "text": "function applyIEVersionToHTML() {\n\tvar ieVer = getIEVersion();\n\tif (ieVer > -1) {\n\t\t// determine what to add - bottom out at 6\n\t\tvar ieClass = \"ie\" + Math.max(Math.floor(ieVer), 6);\n\t\t// versions < 9 get the \"oldie\" look\n\t\tif (ieVer < 9)\n\t\t\tieClass += \" oldie\";\n\n\t\t// now add it to the html tag\n\t\tdocument.getElementsByTagName(\"html\")[0].className += \" \" + ieClass;\n\t}\n}", "title": "" }, { "docid": "bb0e69ee3547a0dc9949b2c3018d05b5", "score": "0.565243", "text": "function isLessThan8() {\n return (ieVersion > 0 && ieVersion <= 8) ? true : false;\n }", "title": "" }, { "docid": "b5db8aac4eb4a58bc2cabf9265b4ba48", "score": "0.5644196", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "36b9675658526f02f179aaeb4b93d59d", "score": "0.56371987", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var isIE = false;\n var ieVersion = '';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n // return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\n ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n isIE = true;\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n // return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\n ieVersion = parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n isIE = true;\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n // return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\n ieVersion = parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n isIE = true;\n }\n\n // other browser\n // return false;\n\n if(isIE)\n {\n $('html').addClass('is-ie');\n $('html').addClass('ie-version-'+ieVersion);\n }\n }", "title": "" }, { "docid": "2bf55754d809eb568b6c81727adc1e53", "score": "0.563338", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" } ]
c6a1bc0f39c4c2ecae4abd5ab58b1b96
HTMLStyleElement needs fixing Will be empty if link: true option is not set, because it is only for use together with insertRule API.
[ { "docid": "d50e4ed97a666d5883d11548c827bcdf", "score": "0.0", "text": "function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false;\n this.cssRules = [];\n // There is no sheet when the renderer is used from a standalone StyleRule.\n if (sheet) registry.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }", "title": "" } ]
[ { "docid": "4e4b6fdedf7f108ad9e49fd9e41a7a25", "score": "0.59738714", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }", "title": "" }, { "docid": "7e16e6ac6d890fe685d86d85efaf9eaa", "score": "0.59188735", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }", "title": "" }, { "docid": "27979523723b66fcd0b73450aa242dbc", "score": "0.590305", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "ab7ca0d10508dd4481625e4acf69a36b", "score": "0.5893513", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "ab7ca0d10508dd4481625e4acf69a36b", "score": "0.5893513", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "ab7ca0d10508dd4481625e4acf69a36b", "score": "0.5893513", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "ab7ca0d10508dd4481625e4acf69a36b", "score": "0.5893513", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "12ad12891ea7ec4ee03cda9ac7953ff7", "score": "0.5865541", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0, _instanceOf.isHTMLElement)(element) || !(0, _getNodeName.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "eee152934a404989bc1d0e67b2f82573", "score": "0.5822709", "text": "function patchStyle(n, o) {\n\tvar ns = (n.attrs || emptyObj).style;\n\tvar os = o ? (o.attrs || emptyObj).style : null;\n\n\t// replace or remove in full\n\tif (ns == null || isVal(ns))\n\t\t{ n.el.style.cssText = ns; }\n\telse {\n\t\tfor (var nn in ns) {\n\t\t\tvar nv = ns[nn];\n\n\t\t\tif (isStreamStub(nv))\n\t\t\t\t{ nv = hookStreamStub(nv, getVm(n)); }\n\n\t\t\tif (os == null || nv != null && nv !== os[nn])\n\t\t\t\t{ n.el.style[nn] = autoPx(nn, nv); }\n\t\t}\n\n\t\t// clean old\n\t\tif (os) {\n\t\t\tfor (var on in os) {\n\t\t\t\tif (ns[on] == null)\n\t\t\t\t\t{ n.el.style[on] = \"\"; }\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5e85973b1d70a0ce7d1a141024619822", "score": "0.57981426", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__dom_utils_instanceOf_js__[\"b\" /* isHTMLElement */])(element) || !Object(__WEBPACK_IMPORTED_MODULE_0__dom_utils_getNodeName_js__[\"a\" /* default */])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "30d102fb5469eb7ac19257be9c4e6537", "score": "0.57949257", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "30d102fb5469eb7ac19257be9c4e6537", "score": "0.57949257", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "30d102fb5469eb7ac19257be9c4e6537", "score": "0.57949257", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "5e956b1590a9594d1a3e1c6c1ebd56c0", "score": "0.57877237", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "7bfd079822a31dd1d1e42023a099c834", "score": "0.5781633", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "7bfd079822a31dd1d1e42023a099c834", "score": "0.5781633", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "1a4e488545d7c2c439c57c58c9448492", "score": "0.57740474", "text": "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "edd1823f135aaf7b31ed7a0aaecfaaee", "score": "0.56948674", "text": "function applyStyles$1(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "title": "" }, { "docid": "46c4991e8ba0d562a024574fb3cfb5f1", "score": "0.56800514", "text": "function updateOrCreateSelectorInStyleSheet(htmlStyleElement, newStyle) {\r\n if (newStyle.constructor.name === 'Style') {\r\n let selector = newStyle.name;\r\n let styles = getAllStyles(htmlStyleElement);\r\n let found = false;\r\n for (let i = 0; i < styles.length; i++) {\r\n let style = styles[i];\r\n if (style.name.trim() === selector) {\r\n found = true;\r\n style.styleElements = newStyle.styleElements;\r\n }\r\n }\r\n if (!found) {\r\n styles.push(newStyle);\r\n }\r\n\r\n htmlStyleElement.innerHTML = '';\r\n injectStyleSheets(htmlStyleElement, styles);\r\n return true;\r\n } else {\r\n throw new Error('Invalid style object supplied');\r\n }\r\n}", "title": "" }, { "docid": "aeda00779ecf05ebe4b0458eb783da88", "score": "0.5630101", "text": "get styleSheet(){return void 0===this._styleSheet&&(supportsAdoptingStyleSheets?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}", "title": "" }, { "docid": "50608a57bd240372a8cdcdec5fd7172a", "score": "0.5618417", "text": "style(element, styleObj) {\n // bump out if no style object is in element\n if (typeof element === \"string\" || !element.style) {\n return;\n }\n\n // create variable in scope for stylesheet\n let styleSheet,\n keys = [];\n\n //check if there is already a stylesheet\n try {\n styleSheet = document.querySelector(\"#CurlyJS_styles\").sheet;\n } catch {\n // create and access style sheet\n styleSheet = curly.createNewStyleSheet()\n\n //add rules from style object\n for (var selector in styleObj) {\n curly.addToStyleSheet(selector, styleObj[selector], styleSheet);\n }\n }\n\n // if selector was not already created for this element, make one\n if (!element.CSSselector) {\n element.CSSselector = curly.createCSSSelector(element);\n }\n\n // push all selectors into an array\n for (var key in styleSheet.cssRules) {\n keys.push(styleSheet.cssRules[key].selectorText);\n }\n\n // if selector is not already in style sheet proceed.\n if (!keys.includes(element.CSSselector)) {\n curly.addToStyleSheet(element.CSSselector, element.style, styleSheet);\n\n if (element.style.psudo) {\n // loop through psudo elements if they are present\n for (var psudo in element.style.psudo) {\n curly.addToStyleSheet(\n element.CSSselector + psudo,\n element.style.psudo[psudo],\n styleSheet\n );\n }\n }\n } else {\n curly.updateStyleSheet(element.CSSselector, element.style, styleSheet);\n if (element.style.psudo) {\n for (var psudo in element.style.psudo) {\n curly.updateStyleSheet(\n element.CSSselector + psudo,\n element.style.psudo[psudo],\n styleSheet\n );\n }\n }\n }\n }", "title": "" }, { "docid": "28c9a2fed8eea7fa825cc593e5f7d3d7", "score": "0.5617877", "text": "function editSelectorInStyleSheet(htmlStyleElement, newStyle) {\r\n if (newStyle.constructor.name === 'Style') {\r\n let selector = newStyle.name;\r\n let styles = getAllStyles(htmlStyleElement);\r\n let found = false;\r\n for (let i = 0; i < styles.length; i++) {\r\n let style = styles[i];\r\n if (style.name.trim() === selector) {\r\n found = true;\r\n for (let k = 0; k < newStyle.styleElements.length; k++) {\r\n let elem = newStyle.styleElements[k];\r\n style.addStyleElement(elem.attr, elem.value, false);\r\n }\r\n break;\r\n }\r\n }\r\n if (!found) {\r\n styles.push(newStyle);\r\n }\r\n\r\n htmlStyleElement.innerHTML = '';\r\n injectStyleSheets(htmlStyleElement, styles);\r\n return true;\r\n } else {\r\n throw new Error('Invalid style object supplied');\r\n }\r\n}", "title": "" }, { "docid": "ae455cec697f8db760cff3522002cf0f", "score": "0.56114936", "text": "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n }", "title": "" }, { "docid": "e9efa3d33ec96833631a2a97ee8a9739", "score": "0.55920756", "text": "function removeFromElement( element ) {\n\t\tvar def = this._.definition,\n\t\t\tattributes = def.attributes,\n\t\t\tstyles = def.styles,\n\t\t\toverrides = getOverrides( this )[ element.getName() ],\n\t\t\t// If the style is only about the element itself, we have to remove the element.\n\t\t\tremoveEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles );\n\n\t\t// Remove definition attributes/style from the elemnt.\n\t\tfor ( var attName in attributes ) {\n\t\t\t// The 'class' element value must match (#1318).\n\t\t\tif ( ( attName == 'class' || this._.definition.fullMatch ) && element.getAttribute( attName ) != normalizeProperty( attName, attributes[ attName ] ) )\n\t\t\t\tcontinue;\n\t\t\tremoveEmpty = element.hasAttribute( attName );\n\t\t\telement.removeAttribute( attName );\n\t\t}\n\n\t\tfor ( var styleName in styles ) {\n\t\t\t// Full match style insist on having fully equivalence. (#5018)\n\t\t\tif ( this._.definition.fullMatch && element.getStyle( styleName ) != normalizeProperty( styleName, styles[ styleName ], true ) )\n\t\t\t\tcontinue;\n\n\t\t\tremoveEmpty = removeEmpty || !!element.getStyle( styleName );\n\t\t\t// ------------------------------------------------------------------------------------\n\t\t\t// ***DYNAMIC DOCUMENTATION CHANGE***\n\t\t\t// What Changed: Add a check if there exist an unerline or strike-through style on the element \n\t\t\t// before removing the style. If exists, don't remove the style and apply the new style.\n\t\t\t// Add three variable:\n\t\t\t// existingStyle: variable to get the existing style applied on element.\n\t\t\t// bIsTextDecorationRemovable: variable to check if existing style is underline and the new style is strike-through\n\t\t\t// or vice-versa. Returns true if above scenario is true.\n\t\t\t// noOfContributions: variable to get the number of ddcontribution in the note\n\t\t\t// Testing Considerations: Add text into the editor, and make sure that bold, italics, and underline \n\t\t\t// formatting can be add and removed. \n\t\t\t// Try this for existing text style as underline and apply strike-through and both will be maintained.\n\t\t\t// Also test for vice-versa.\n\t\t\t// ------------------------------------------------------------------------------------\n\t\t\tvar existingStyle = element.getStyle(styleName);\n\t\t\tvar bIsTextDecorationRemovable = !((existingStyle === \"underline\" && (styles[styleName] === \"line-through\" || styles[styleName] === \"overline\"))\n\t\t\t\t\t\t\t\t\t\t\t\t|| (existingStyle === \"line-through\" && (styles[styleName] === \"underline\" || styles[styleName] === \"overline\"))\n\t\t\t\t\t\t\t\t\t\t\t\t|| (existingStyle === \"overline\" && (styles[styleName] === \"underline\" || styles[styleName] === \"line-through\")));\n\t\t\tif (!CKEDITOR.env.ie || CKEDITOR.env.version > 7) {\n\t\t\t\tvar noOfContributions = document.body.querySelectorAll(\".ddcontribution\").length;\n\t\t\t\tvar bAddending = (noOfContributions > 1);\n\t\t\t\t//Check whether editor is DD editor or any other editor like MPage or auto text editor\n\t\t\t\tif (noOfContributions > 0 && (styleName.toLowerCase() === \"text-decoration\")) {\n\t\t\t\t\t//remove duplicate style if element is read-only and document is not authentiucated\n\t\t\t\t\t//remove duplicate strike-through style if element is read-only and document is authenticated\n\t\t\t\t\t//remove duplicate style for editable element\n\t\t\t\t\tif(bIsTextDecorationRemovable && ((element.isReadOnly() && !bAddending) || (element.isReadOnly() && bAddending) || element.isEditable())) {\n\t\t\t\t\t\telement.removeStyle(styleName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//remove duplictae style of elemnet in editor other than DD editor\n\t\t\t\telse if (styleName.toLowerCase() === \"text-decoration\") {\n\t\t\t\t\tif (bIsTextDecorationRemovable) {\n\t\t\t\t\t\telement.removeStyle(styleName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//remove style other than text-decoration style\n\t\t\t\telse {\n\t\t\t\t\telement.removeStyle(styleName);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\telement.removeStyle(styleName);\n\t\t}\n\n\t\t// Remove overrides, but don't remove the element if it's a block element\n\t\tremoveOverrides( element, overrides, blockElements[ element.getName() ] );\n\n\t\tif ( removeEmpty ) {\n\t\t\tif ( this._.definition.alwaysRemoveElement )\n\t\t\t\tremoveNoAttribsElement( element, 1 );\n\t\t\telse {\n\t\t\t\t!CKEDITOR.dtd.$block[ element.getName() ] || this._.enterMode == CKEDITOR.ENTER_BR && !element.hasAttributes() ? removeNoAttribsElement( element ) : element.renameNode( this._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' );\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7a3035a72d7f267b1ca3a97cd1723c0f", "score": "0.55808496", "text": "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "title": "" }, { "docid": "5d2088bac015cb3fa2b4ce2b9669e720", "score": "0.5569548", "text": "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (_typeof2(value) === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "title": "" }, { "docid": "220c256307acac9617d7586abe380809", "score": "0.5557581", "text": "adoptStyles(){const styles=this.constructor._styles;if(0===styles.length){return}// There are three separate cases here based on Shadow DOM support.\n// (1) shadowRoot polyfilled: use ShadyCSS\n// (2) shadowRoot.adoptedStyleSheets available: use it\n// (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n// rendering\nif(window.ShadyCSS!==void 0&&!window.ShadyCSS.nativeShadow){window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map(s=>s.cssText),this.localName)}else if(supportsAdoptingStyleSheets){this.renderRoot.adoptedStyleSheets=styles.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet)}else{// This must be done after rendering so the actual style insertion is done\n// in `update`.\nthis._needsShimAdoptedStyleSheets=!0}}", "title": "" }, { "docid": "819e4481845cee1e4b111c8e74d3288e", "score": "0.55476093", "text": "function deleteRelatedStyleRule(uid) {\n var id = 'plotly.js-style-' + uid;\n var style = document.getElementById(id);\n if(style) removeElement(style);\n}", "title": "" }, { "docid": "c743ca594fe490055f801209ca221fab", "score": "0.5532144", "text": "function normalizeStyle(style) {\n if (!style) {\n return null;\n }\n\n if (typeof style === 'string') {\n return style;\n }\n\n if (style.toJS) {\n style = style.toJS();\n }\n\n var layerIndex = style.layers.reduce(function (accum, current) {\n return Object.assign(accum, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, current.id, current));\n }, {});\n style.layers = style.layers.map(function (layer) {\n layer = Object.assign({}, layer); // Breaks style diffing :(\n\n delete layer.interactive;\n var layerRef = layerIndex[layer.ref]; // Style diffing doesn't work with refs so expand them out manually before diffing.\n\n if (layerRef) {\n delete layer.ref;\n\n if (layerRef.type !== undefined) {\n layer.type = layerRef.type;\n }\n\n if (layerRef.source !== undefined) {\n layer.source = layerRef.source;\n }\n\n if (layerRef['source-layer'] !== undefined) {\n layer['source-layer'] = layerRef['source-layer'];\n }\n\n if (layerRef.minzoom !== undefined) {\n layer.minzoom = layerRef.minzoom;\n }\n\n if (layerRef.maxzoom !== undefined) {\n layer.maxzoom = layerRef.maxzoom;\n }\n\n if (layerRef.filter !== undefined) {\n layer.filter = layerRef.filter;\n }\n\n if (layerRef.layout !== undefined) {\n layer.layout = layer.layout || {};\n layer.layout = Object.assign({}, layer.layout, layerRef.layout);\n }\n }\n\n return layer;\n });\n return style;\n}", "title": "" }, { "docid": "c743ca594fe490055f801209ca221fab", "score": "0.5532144", "text": "function normalizeStyle(style) {\n if (!style) {\n return null;\n }\n\n if (typeof style === 'string') {\n return style;\n }\n\n if (style.toJS) {\n style = style.toJS();\n }\n\n var layerIndex = style.layers.reduce(function (accum, current) {\n return Object.assign(accum, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, current.id, current));\n }, {});\n style.layers = style.layers.map(function (layer) {\n layer = Object.assign({}, layer); // Breaks style diffing :(\n\n delete layer.interactive;\n var layerRef = layerIndex[layer.ref]; // Style diffing doesn't work with refs so expand them out manually before diffing.\n\n if (layerRef) {\n delete layer.ref;\n\n if (layerRef.type !== undefined) {\n layer.type = layerRef.type;\n }\n\n if (layerRef.source !== undefined) {\n layer.source = layerRef.source;\n }\n\n if (layerRef['source-layer'] !== undefined) {\n layer['source-layer'] = layerRef['source-layer'];\n }\n\n if (layerRef.minzoom !== undefined) {\n layer.minzoom = layerRef.minzoom;\n }\n\n if (layerRef.maxzoom !== undefined) {\n layer.maxzoom = layerRef.maxzoom;\n }\n\n if (layerRef.filter !== undefined) {\n layer.filter = layerRef.filter;\n }\n\n if (layerRef.layout !== undefined) {\n layer.layout = layer.layout || {};\n layer.layout = Object.assign({}, layer.layout, layerRef.layout);\n }\n }\n\n return layer;\n });\n return style;\n}", "title": "" }, { "docid": "689502c6042fead4fb15a0a19c39cb77", "score": "0.55283284", "text": "function applyStyle(e, style)\n{\n for (let k in style) {\n const v = style[k];\n if (k == \"text\") e.appendChild(document.createTextNode(v));\n else if (k == \"html\") e.innerHTML = v;\n else if (k == \"attributes\") {for (let a in v) e[a] = v[a];}\n else e.style[k] = v;\n }\n}", "title": "" }, { "docid": "d505e670380fa7d1e85cee7b1d7c34b7", "score": "0.55263036", "text": "computeStyle(element, solid){\n\n let selectedCSSRules =\n _.filter(this.css,\n r => { return CSSselect.is(element, r.selectors.join(','))})\n\n let computedStyle = {}\n function setProperty(decl){\n\n if (decl.value == 'inherit' && solid.parent){\n // console.log('inherit', element.parent.style)\n // if (element.)\n // console.log(element, element.parent)\n // computedStyle[decl.property] = element.parent.style[decl.property]\n computedStyle[decl.property] = solid.parent.style[decl.property]\n\n\n } else {\n\n computedStyle[decl.property] = decl.value\n\n }\n }\n\n _.forEach(selectedCSSRules, rule => {\n _.forEach(rule.declarations, decl => {\n setProperty(decl)\n })\n })\n return computedStyle\n }", "title": "" }, { "docid": "5b27c798926ecc359913e9719040bef0", "score": "0.5518982", "text": "function unifyStyle(source, scope)\n\t\t{\n\t\t\tkonflux.iterator(settings.style).each(function(){\n\t\t\t\tvar value = konflux.style.get(source, this.property),\n\t\t\t\t\tdiffer = value !== konflux.style.get(scope, this.property),\n\t\t\t\t\tallow = 'allow' in this && konflux.array.contains(this.allow, source.nodeName.toLowerCase());\n\n\t\t\t\tif (differ && styleMatch(value, this.value) && !allow)\n\t\t\t\t\tscope = scope.appendChild(document.createElement(settings.replace[this.replace]));\n\t\t\t});\n\n\t\t\treturn scope;\n\t\t}", "title": "" }, { "docid": "cc86d2fe217ddb57ceb916f9ff74d972", "score": "0.54944617", "text": "function sanitizeStyle(value){value=String(value).trim();// Make sure it's actually a string.\nif(!value)return'';// Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n// reasoning behind this.\nvar urlMatch=value.match(URL_RE);if(urlMatch&&sanitizeUrl(urlMatch[1])===urlMatch[1]||value.match(SAFE_STYLE_VALUE)&&hasBalancedQuotes(value)){return value;// Safe style values.\n}if(_angular_core.isDevMode()){getDOM().log(\"WARNING: sanitizing unsafe style value \"+value+\" (see http://g.co/ng/security#xss).\");}return'unsafe';}", "title": "" }, { "docid": "63927dcec1e275a7d27b71dcc3ff6975", "score": "0.54891753", "text": "applyStyles(input_element, style) { \n // change the styles, either the style to change or the initial style\n for(const [key, value] of Object.entries(this[style])) {\n input_element.style[key] = value;\n }\n }", "title": "" }, { "docid": "1f9d04551f68b6b9552097b759a0c59c", "score": "0.5480929", "text": "function forceRenderStyles() {\n getTag().textContent = getCss();\n}", "title": "" }, { "docid": "7c78f9d8a92817d8270052c760f36b79", "score": "0.5472501", "text": "function inlineRule(el, rule){\n var computed = window.getComputedStyle(el);\n for(var i = 0; i < rule.style.length; i++){\n var prop = rule.style.item(i);\n var computedVal = computed.getPropertyValue(prop);\n // if element's style attribute doesn't have this property,\n // then set it to the computed value\n if(!el.style.getPropertyValue(prop)){\n el.style.setProperty(prop, computedVal);\n }\n }\n }", "title": "" }, { "docid": "29f4bea26b0e139c5d5262c88f97962a", "score": "0.5462571", "text": "function SafeStyle(){}", "title": "" }, { "docid": "9f55ec0f5abb9683478b280a07ac52c7", "score": "0.54290074", "text": "function removeStyle(element) {\n // console.log(element);\n var j, is_hidden;\n\n // Presentational attributes.\n var attr = [\n 'align',\n 'autofocus',\n 'background',\n 'bgcolor',\n 'border',\n 'cellpadding',\n 'cellspacing',\n 'color',\n 'face',\n 'height',\n 'hspace',\n 'marginheight',\n 'marginwidth',\n 'noshade',\n 'nowrap',\n 'valign',\n 'vspace',\n 'width',\n 'vlink',\n 'alink',\n 'text',\n 'link',\n 'frame',\n 'frameborder',\n 'clear',\n 'scrolling',\n 'style',\n 'class',\n ];\n\n var attr_len = attr.length;\n if (element.nodeName !== '#text') {\n if (element.style) {\n is_hidden = element.style.display === 'none';\n }\n j = attr_len;\n\n while (j--) {\n if (element.removeAttribute) {\n element.removeAttribute(attr[j]);\n }\n }\n\n // Re-hide display:none elements,\n // so they can be toggled via JS.\n if (is_hidden) {\n element.style.display = 'none';\n }\n }\n }", "title": "" }, { "docid": "172cecf9d7bdcf2f048c6b188092c278", "score": "0.5418913", "text": "function updateOrCreateSelectorsInStyleSheet(htmlStyleElement, newStyles) {\r\n if (!isOneDimArray(newStyles)) {\r\n throw new Error('A one dimensional array expected for `newStyles`');\r\n }\r\n let styles = getAllStyles(htmlStyleElement);\r\n for (let i = 0; i < newStyles.length; i++) {\r\n let newStyle = newStyles[i];\r\n if (newStyle.constructor.name === 'Style') {\r\n let selector = newStyle.name;\r\n let found = false;\r\n for (let j = 0; j < styles.length; j++) {\r\n let style = styles[j];\r\n if (style.name.trim() === selector) {\r\n found = true;\r\n style.styleElements = newStyle.styleElements;//update\r\n }\r\n }\r\n if (!found) {\r\n styles.push(newStyle);// create if not found\r\n }\r\n } else {\r\n throw new Error('Invalid style object supplied');\r\n }\r\n }\r\n\r\n htmlStyleElement.innerHTML = '';\r\n injectStyleSheets(htmlStyleElement, styles);\r\n}", "title": "" }, { "docid": "a0b954222c97e48d6da5a81234622ef7", "score": "0.5417905", "text": "function normalizeStyleBinding (bindingStyle) {\nif (Array.isArray(bindingStyle)) {\nreturn toObject(bindingStyle)\n}\nif (typeof bindingStyle === 'string') {\nreturn parseStyleText(bindingStyle)\n}\nreturn bindingStyle\n}", "title": "" }, { "docid": "172587c314241de06c59745b0730de05", "score": "0.5408517", "text": "function patchStyle(el, prev, next) {\n // 如果元素next属性没有值\n var style = el.style; // 获取之前的样式\n if (!next) {\n el.removeAttribute('style'); // 直接删除即可\n }\n else {\n for (var key in next) { // 用新的全量覆盖老的\n style[key] = next[key];\n }\n if (prev) {\n for (var key in prev) { // 看老的有的新的没有 将样式移除\n if (!next[key]) {\n style[key] = '';\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d3482ae36f0c59e0f875546a132291fd", "score": "0.53995067", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it.\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window['ShadyCSS'] !== undefined && !window['ShadyCSS'].nativeShadow) {\n window['ShadyCSS'].ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (css_tag_1.supportsAdoptingStyleSheets) {\n this.renderRoot['adoptedStyleSheets'] =\n styles.map((s) => s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "a8b76c4e247d26c92790ff5b91d335e1", "score": "0.53914404", "text": "function sanitizeStyle(value){value=String(value).trim();// Make sure it's actually a string.\n\tif(!value)return'';// Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n\t// reasoning behind this.\n\tvar urlMatch=value.match(URL_RE);if(urlMatch&&sanitizeUrl(urlMatch[1])===urlMatch[1]||value.match(SAFE_STYLE_VALUE)&&hasBalancedQuotes(value)){return value;// Safe style values.\n\t}if(_angular_core.isDevMode()){getDOM().log(\"WARNING: sanitizing unsafe style value \"+value+\" (see http://g.co/ng/security#xss).\");}return'unsafe';}", "title": "" }, { "docid": "70bf081dabdbdb9c51486bcf824bf44c", "score": "0.5374394", "text": "function _cleanupStyles(target) {\n\t for (var n in this.properties) {\n\t target.style[n] = '';\n\t }\n\t }", "title": "" }, { "docid": "0174d6e35a8a97a373712810b07d28ef", "score": "0.53737795", "text": "function styleObj() {\n this.name = \"\";\n this.rules = \"\";\n}", "title": "" }, { "docid": "dfbe1b9b08fa63038cb0b6e6ee686f83", "score": "0.5373193", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n\n if (styles.length === 0) {\n return;\n } // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n\n\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map(s => s.cssText), this.localName);\n } else if (_cssTag.supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets = styles.map(s => s instanceof CSSStyleSheet ? s : s.styleSheet);\n } else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "400ebf7bccb4bc5d80cc0591a9ac12bf", "score": "0.5369372", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it.\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (_lib_css_tag_js__WEBPACK_IMPORTED_MODULE_4__[\"supportsAdoptingStyleSheets\"]) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "400ebf7bccb4bc5d80cc0591a9ac12bf", "score": "0.5369372", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it.\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (_lib_css_tag_js__WEBPACK_IMPORTED_MODULE_4__[\"supportsAdoptingStyleSheets\"]) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "611587b0c1497482d4dde3eed9947f32", "score": "0.53434086", "text": "function revertStyle(affectedElement) {\n if (affectedElement.protectionObserver) {\n affectedElement.protectionObserver.disconnect();\n }\n affectedElement.node.style.cssText = affectedElement.originalStyle;\n }", "title": "" }, { "docid": "611587b0c1497482d4dde3eed9947f32", "score": "0.53434086", "text": "function revertStyle(affectedElement) {\n if (affectedElement.protectionObserver) {\n affectedElement.protectionObserver.disconnect();\n }\n affectedElement.node.style.cssText = affectedElement.originalStyle;\n }", "title": "" }, { "docid": "632ce895da257759c1ebb99920ff9caa", "score": "0.53421026", "text": "function updateStyle(element, oldStyle, newStyle) {\n var elemStyle = element.style;\n var name;\n for (name in oldStyle) {\n if (!(name in newStyle)) {\n elemStyle[name] = '';\n }\n }\n for (name in newStyle) {\n if (oldStyle[name] !== newStyle[name]) {\n elemStyle[name] = newStyle[name];\n }\n }\n }", "title": "" }, { "docid": "632ce895da257759c1ebb99920ff9caa", "score": "0.53421026", "text": "function updateStyle(element, oldStyle, newStyle) {\n var elemStyle = element.style;\n var name;\n for (name in oldStyle) {\n if (!(name in newStyle)) {\n elemStyle[name] = '';\n }\n }\n for (name in newStyle) {\n if (oldStyle[name] !== newStyle[name]) {\n elemStyle[name] = newStyle[name];\n }\n }\n }", "title": "" }, { "docid": "4199efabf19f182a34d8305153d33c22", "score": "0.5340578", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it.\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "e311a4f652b37d08477f777f86b70fc5", "score": "0.5328507", "text": "function fillNewStyle() {\n if (oldStyle.styleName === \"\") {\n } else if (!newStyle.flag) {\n setNewStyle({\n styleName: oldStyle.styleName,\n styleImage: oldStyle.styleImage,\n styleVisible: oldStyle.styleVisible,\n flag: true,\n });\n }\n }", "title": "" }, { "docid": "acdb8591515a577e7dae00012132f0b9", "score": "0.5326165", "text": "function inlineStyle(elStyle){\n //console.log('elStyle', elStyle)\n var doc = elStyle.ownerDocument;\n var rules = elStyle.sheet.cssRules;\n if(!rules){\n console.error('stylesheet rules cannot be read from ', elStyle.href);\n return;\n }\n\n arrayFrom(rules)\n // only STYLE_RULEs, and no pseudo selectors or starting stars\n // see: https://developer.mozilla.org/en-US/docs/Web/API/CSSRule#Type_constants\n .filter(function(r){\n return r.type == 1 &&\n // no pseudo selectors\n !(/:/.test(r.selectorText)) &&\n // no starting stars (universal selector)\n !(/^\\*/.test(r.selectorText));\n })\n .forEach(function(rule){\n arrayFrom(doc.querySelectorAll(rule.selectorText))\n .forEach(function(el){\n inlineRule(el, rule);\n })\n })\n }", "title": "" }, { "docid": "083bba32aaf9d1f157b2b5bac5265916", "score": "0.53205353", "text": "function _cleanupStyles(target) {\n for (var n in this.properties) {\n target.style[n] = '';\n }\n }", "title": "" }, { "docid": "1d021b1c55d6ae16dc22a8ff3fd1bacd", "score": "0.5312925", "text": "function isStyleRule(rule) {\n return ((typeof rule.declarations !== 'undefined') &&\n (typeof rule.selectors !== 'undefined') &&\n (rule.selectors[0] !== '@font-face'));\n }", "title": "" }, { "docid": "bbc4abe6fe8cbe5c07342f7ca4aff58b", "score": "0.5301065", "text": "adoptStyles(){const e=this.constructor._uniqueStyles;0===e.length||(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow?supportsAdoptingStyleSheets?this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName));// There are three separate cases here based on Shadow DOM support.\n// (1) shadowRoot polyfilled: use ShadyCSS\n// (2) shadowRoot.adoptedStyleSheets available: use it.\n// (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n// rendering\n}", "title": "" }, { "docid": "f4e0f6bfd888f514e2059e5f8e30c657", "score": "0.5298392", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n\n if (styles.length === 0) {\n return;\n } // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it.\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n\n\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map(s => s.cssText), this.localName);\n } else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets = styles.map(s => s.styleSheet);\n } else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "703b7a0bd22dec0e793606ecfb9ef4e5", "score": "0.5280783", "text": "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n }", "title": "" }, { "docid": "84ed3dc6c4a4e83eadc0ad57ca128b41", "score": "0.5275595", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it.\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "e93a3c81341c98e425c29722c41bcc7e", "score": "0.5270972", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "e93a3c81341c98e425c29722c41bcc7e", "score": "0.5270972", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "e93a3c81341c98e425c29722c41bcc7e", "score": "0.5270972", "text": "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "title": "" }, { "docid": "3a8a3155e8c906731c8ce26925be8d23", "score": "0.5262074", "text": "function cleanupStyles() {\n const styles = document.body.querySelectorAll('[data-cy=injected-style-tag]');\n styles.forEach((styleElement) => {\n if (styleElement.parentElement) {\n styleElement.parentElement.removeChild(styleElement);\n }\n });\n const links = document.body.querySelectorAll('[data-cy=injected-stylesheet]');\n links.forEach((link) => {\n if (link.parentElement) {\n link.parentElement.removeChild(link);\n }\n });\n}", "title": "" }, { "docid": "4ee7d603585710596ad75623cb7c0487", "score": "0.52585536", "text": "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "title": "" }, { "docid": "4ee7d603585710596ad75623cb7c0487", "score": "0.52585536", "text": "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "title": "" }, { "docid": "4ee7d603585710596ad75623cb7c0487", "score": "0.52585536", "text": "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "title": "" }, { "docid": "4ee7d603585710596ad75623cb7c0487", "score": "0.52585536", "text": "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "title": "" }, { "docid": "4ee7d603585710596ad75623cb7c0487", "score": "0.52585536", "text": "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "title": "" }, { "docid": "4ee7d603585710596ad75623cb7c0487", "score": "0.52585536", "text": "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "title": "" }, { "docid": "2658fc9d72bafc218e1ecb2629cfbd97", "score": "0.52399457", "text": "pruneSource(style, before, sheetInverse) {\n const isStyleInlined = super.pruneSource(style, before, sheetInverse);\n const asset = style.$$asset;\n const name = style.$$name;\n\n if (asset) {\n // if external stylesheet would be below minimum size, just inline everything\n const minSize = this.options.minimumExternalSize;\n if (minSize && sheetInverse.length < minSize) {\n // delete the webpack asset:\n delete this.compilation.assets[style.$$assetName];\n return true;\n }\n this.compilation.assets[style.$$assetName] =\n new sources.LineToLineMappedSource(\n sheetInverse,\n style.$$assetName,\n before\n );\n } else {\n this.logger.warn(\n 'pruneSource is enabled, but a style (' +\n name +\n ') has no corresponding Webpack asset.'\n );\n }\n\n return isStyleInlined;\n }", "title": "" }, { "docid": "256ad2afc054ed081f12e02c79edddc9", "score": "0.5227892", "text": "force_style(val) {\n this._force_style = val;\n return this;\n }", "title": "" }, { "docid": "31e9fc5be0dfc695b6a8a5bf2a0de46b", "score": "0.5213307", "text": "function normalizeStyleBinding(bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle);\n }\n if (typeof bindingStyle === \"string\") {\n return parseStyleText(bindingStyle);\n }\n return bindingStyle;\n }", "title": "" }, { "docid": "ee5657539413f24227d8461a2d30e268", "score": "0.52060294", "text": "function replaceOldStyleLinks(doc)\n{\n var head = doc.getElementsByTagName('HEAD')[0];\n var links = head.getElementsByTagName('LINK');\n while (links.length > 0)\n head.removeChild(links[0]);\n var link = doc.createElement('LINK');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('type', 'text/css');\n link.setAttribute('href', 'chrome://celtx/content/scriptdefaults.css');\n head.appendChild(link);\n}", "title": "" }, { "docid": "276739b74d3cb48a945802f6a8f2c813", "score": "0.51964635", "text": "function addForcedStyle(css) {\r\n GM_addStyle(css.replace(/;/g,' !important;'));\r\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.5194084", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "e5d99c77aac8dcb93d429d0964b4f0b6", "score": "0.51871353", "text": "function normalizeStyleBinding(bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n }", "title": "" }, { "docid": "e5d99c77aac8dcb93d429d0964b4f0b6", "score": "0.51871353", "text": "function normalizeStyleBinding(bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n }", "title": "" }, { "docid": "bf7063695e9223a01cbad0ee11e8d3aa", "score": "0.51801157", "text": "function StyleSanitizeFn(){}", "title": "" }, { "docid": "c16763e9584c5273ad372b60accbd6a8", "score": "0.51687026", "text": "function normalizeStyleBinding (bindingStyle) {\r\n if (Array.isArray(bindingStyle)) {\r\n return toObject(bindingStyle)\r\n }\r\n if (typeof bindingStyle === 'string') {\r\n return parseStyleText(bindingStyle)\r\n }\r\n return bindingStyle\r\n}", "title": "" } ]
7ac4d53f70a43a901421dbcb7c475c95
Get an existing WebAcl resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
[ { "docid": "e89d3b6c66405dd2b6a7ff1dee13d4aa", "score": "0.68974495", "text": "static get(name, id, state, opts) {\n return new WebAcl(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" } ]
[ { "docid": "1d6344ea853da990eeeadeda3688d620", "score": "0.5846937", "text": "static get(name, id, state, opts) {\n return new RepositoryPermissionsPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "82aef6382f234be92a68e7938f97cd54", "score": "0.556366", "text": "static get(name, id, state, opts) {\n return new ResolverFirewallRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "ddf95f4f45297126e9e415c7a5ce9e5a", "score": "0.5397145", "text": "static get(name, id, state, opts) {\n return new BucketOwnershipControls(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "97a91302bd531ddfbbb75001fdfbf6be", "score": "0.5155529", "text": "getById(id) {\n return RoleDefinition(this, `getById(${id})`);\n }", "title": "" }, { "docid": "f5126b3c9bf57c3d9f6f981dd17d9433", "score": "0.51300216", "text": "function retrieve(id) {\n return state[id];\n }", "title": "" }, { "docid": "7f1a546a3cf3bb4a9c63501cdba6fe98", "score": "0.50136185", "text": "static get(name, id, state, opts) {\n return new SecurityGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "ef67b85f2a1be7181550820a474521fb", "score": "0.4966605", "text": "static get(name, id, state, opts) {\n return new Route(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "13ed2a02a317d08aff53574f0b30731b", "score": "0.49640986", "text": "function isResourceKnown(state, id) {\n const { cache } = resourceState(state);\n return isResourceKnownInCache(cache, toString(id));\n }", "title": "" }, { "docid": "4d14725e3d6df7c61ff74b550e31ee2d", "score": "0.49550942", "text": "static get(name, id, state, opts) {\n return new RestApi(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "f2a224e781dc92b97ba9b6dddac8f4ba", "score": "0.48725522", "text": "function read(id) {\n return wvy.api.read(id);\n }", "title": "" }, { "docid": "f06482cfe5aa30d2dde4f5396f1fd1c7", "score": "0.48485273", "text": "static get(name, id, state, opts) {\n return new CustomDomainAssociation(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "b661175ec85added2f0dc9491486f83f", "score": "0.48388448", "text": "static get(name, id, state, opts) {\n return new RolePolicyAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "a2ce5d71b14872dccb5725fab04f2a41", "score": "0.4831339", "text": "static get(name, id, state, opts) {\n return new Zone(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "f47de7df8abdcfc1be9fc16da06f28c9", "score": "0.4787064", "text": "static get(name, id, state, opts) {\n return new OrganizationConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "36854ec0f5d1a698a2b0b50b3d8c5d71", "score": "0.4764093", "text": "function getById (name, id) {\n return getAll(name)\n .then(members => {\n return _.filter(members, {'id': id})[0]\n })\n}", "title": "" }, { "docid": "9a032ac4568221fa1b8ac912ca770203", "score": "0.47529477", "text": "getById(id) {\n return RoleAssignment(this).concat(`(${id})`);\n }", "title": "" }, { "docid": "d0eead1756960817d12c6fb2be5f5538", "score": "0.47456726", "text": "readById(id, callback) {\n return roleModel.role.findById(id).then((role) => {\n callback(role);\n });\n }", "title": "" }, { "docid": "fae0142322bd6c41a89814b85ddc6d36", "score": "0.47336477", "text": "__findState(name) {\n return this._states.find(state => state['name'] === name);\n }", "title": "" }, { "docid": "611b3947f699bb54461f7e38f3d9aa7f", "score": "0.46845886", "text": "static get(name, id, state, opts) {\n return new ResolverEndpoint(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "ba363c01184c2ebf65aa655f43264cfa", "score": "0.46828404", "text": "get(browser, id) {\n if (!browser || !browser.currentURI) {\n return null;\n }\n let entry = this._stateByBrowser.get(browser);\n let prePath = browser.currentURI.prePath;\n if (entry && entry[prePath]) {\n let permission = entry[prePath][id];\n return this._get(entry, prePath, id, permission);\n }\n return null;\n }", "title": "" }, { "docid": "05c3b4ee5452f277bf9af1b717a49059", "score": "0.46676248", "text": "static get(name, id, state, opts) {\n return new UsagePlanKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "60e866d4d777e178eb4b0b7f51845a24", "score": "0.4660305", "text": "static get(name, id, opts) {\n return new ProtectedItem(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "1da4a1a29dfe079b92d3f5be9323b65d", "score": "0.46568328", "text": "static get(name, id, opts) {\n return new ServiceEndpointPolicy(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "079fe5dae4a77ea32b196e4b824b6dc7", "score": "0.46136215", "text": "async GetOneAccessory(id) {\n\n\n return await Accessorio.findById(id);\n }", "title": "" }, { "docid": "424160aa278827d1f54f2c766f910b3e", "score": "0.46075225", "text": "static get(name, id, state, opts) {\n return new Service(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "6ff2f85fb775fdaa663fd583369c990f", "score": "0.45866695", "text": "getUser(id) {\n return EnvironmentAccess.get({ id }, this.getLink(\"#manage-access\"));\n }", "title": "" }, { "docid": "03293e90aad1eec97d55535ecdcf20b9", "score": "0.45778623", "text": "static get(name, id, state, opts) {\n return new ConnectionAssociation(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "1d20078aebd1bdb6e85951e73aeee06c", "score": "0.45615155", "text": "function findResourceId(id) {\n return knex('resources')\n .select('*')\n .where({id})\n .limit(1)\n .then(([resource]) => resource);\n }", "title": "" }, { "docid": "148a08af5ca60b162528eafb6f51223d", "score": "0.45448133", "text": "function _getById() {\n\t\tvar id = $scope.searchId;\n\t\t\n\t\tif (id < 0) {\n\t\t\t$scope.error_message = \"Invalid input\";\n\t\t\ttoggleAlert();\n\t\t} else {\n\t\t\t// Get one property\n\t\t\t$http({\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: 'wine/find/' + id\n\t\t\t}).then(function success(response) {\n\t\t\t\t$scope.obj_return_small = response.data;\n\t\t\t}, function error(response) {\n\t\t\t\t$scope.obj_return_small = \"\";\n\t\t\t\t$scope.error_message = response.statusText;\n\t\t\t\ttoggleAlert();\n\t\t\t});\n\t\t\t\n\t\t\t// Get five property\n\t\t\t$http({\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: 'wine/find/' + id + '/bonus'\n\t\t\t}).then(function success(response) {\n\t\t\t\t$scope.obj_return_large = response.data;\n\t\t\t}, function error(response) {\n\t\t\t\t$scope.obj_return_large = \"\";\n\t\t\t\t$scope.error_message = response.statusText;\n\t\t\t\ttoggleAlert();\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "68605d5e975da6ac2b56365089b5338d", "score": "0.4525792", "text": "function findStateByName(name){\n var state;\n for(var i=0; i<states.length; i++){\n if(states[i].name == name){\n state = states[i];\n return state;\n }\n }\n}", "title": "" }, { "docid": "c6902e2ed9062904ebcfd265143b4b49", "score": "0.4491847", "text": "function lookupById(id){\n // console.log(`Lookup by id (${id})`.red);\n return _.findWhere(data, {id:id});\n}", "title": "" }, { "docid": "27a401964844ac546ae4086742f7c4ff", "score": "0.44875398", "text": "static get(name, id, state, opts) {\n return new EventSourceMapping(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "cc3ff8c090762df36fdaf46f9d213233", "score": "0.44830486", "text": "static get(name, id, state, opts) {\n return new Stage(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "cc3ff8c090762df36fdaf46f9d213233", "score": "0.44830486", "text": "static get(name, id, state, opts) {\n return new Stage(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "09e0ecfee50fdc60d6328d764c861748", "score": "0.44743338", "text": "getByName(name) {\n return RoleDefinition(this, `getbyname('${name}')`);\n }", "title": "" }, { "docid": "0ad883f833805038540fae5420ecf7f5", "score": "0.4449339", "text": "static get(name, id, state, opts) {\n return new DefaultRouteTable(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "60cf14b00cad5c85f15b6c7153f2ee5a", "score": "0.44002458", "text": "function getRes(id) {\n if (!id) return data.resources[state.vis.resIdx];\n \n var res = null;\n $map(function (x) { if (x.id === id) res = x; }, data.resources);\n return res;\n}", "title": "" }, { "docid": "a253f74926468506d48000003e7181ed", "score": "0.43874955", "text": "static get(name, id, state, opts) {\n return new CertificateValidation(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "f5225629d7f28ef334705f3923473a8d", "score": "0.43796065", "text": "function getResourceForID(id) {\n return gRDF.GetResource(PREFIX_ITEM_URI + id);\n}", "title": "" }, { "docid": "9c7065ed03b41de2a745f5a391c45a25", "score": "0.43707335", "text": "static get(name, id, state, opts) {\n return new SnapshotCopy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "46dd3713e86161015b8a9c73a2386dcc", "score": "0.43702096", "text": "_getAccessory (params) {\n return this._accessories[params.id]\n }", "title": "" }, { "docid": "d9660f067793c8b29fe15e96a505b494", "score": "0.43201995", "text": "static get(name, id, opts) {\n return new NetworkSecurityGroup(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "8c39d98ef7505bb9dcf9363f91131291", "score": "0.43103653", "text": "function getState(id) {\n\tlet perms = getPerms(id);\n\tif (perms < 9) {\n\t\tthrow 'You don\\'t have permission to access server state';\n\t}\n\treturn {'bookings': bookings, 'bookedTimes': bookedTimes, 'bookingnum': bookingnum, 'bookingpool': bookingpool, 'UserList': UserList};\n}", "title": "" }, { "docid": "52235c9e502021e9f2ab1cac9c7b89b7", "score": "0.42734078", "text": "get(id) {\n const error = ParamsChecker.validateNonEmpty(id);\n if (error) {\n return Promise.reject(error);\n }\n return HttpHelper.get(this._getPath(id));\n }", "title": "" }, { "docid": "60f66fa3578d1fdb22408942ff622b08", "score": "0.42717224", "text": "function getLearningItem(id) {\n // first try to get the data from the local cache, but if not present, grab from server\n return manager.fetchEntityByKey('LearningItem', id, true)\n .then(function (data) {\n common.logger.log('fetched learning item from ' + (data.fromCache ? 'cache' : 'server'), data);\n return data.entity;\n });\n }", "title": "" }, { "docid": "5fa483a74f5efc4b619ffb7872a1959c", "score": "0.42669436", "text": "getById(id) {\n return tag.configure(UserCustomAction(this).concat(`('${id}')`), \"ucas.getById\");\n }", "title": "" }, { "docid": "85c4bd7d46fa9fd1a1a13db63e0567bc", "score": "0.42459378", "text": "getRoles(id) {\n return new Promise((resolve, reject) = {\n setTimeout(() => {\n if (id === 'Ellie') {\n let user = {name: 'Ellie',role: 'admin'};\n resolve(user);\n } else {\n reject(new Error('no access'));\n }\n }, 1000);\n })\n }", "title": "" }, { "docid": "881244338e85df463230fd698590b889", "score": "0.4234419", "text": "async ReadAccount(ctx, id) {\n\t\tlet queryString = {}\n queryString.selector = {}\n\t\tqueryString.selector.docType = \"account\"\n\t\tqueryString.selector.accountID = id\n\t\tconst accountJSON = await this.QuerryAccount(ctx, JSON.stringify(queryString)); // get the asset from chaincode state\n\t\tif (!accountJSON || accountJSON.length === 0) {\n\t\t\tthrow new Error(`Account ${id} does not exist`);\n\t\t}\n\n\t\treturn JSON.parse(accountJSON);\n\t}", "title": "" }, { "docid": "327c3aa13b857823a762c997b6d60de3", "score": "0.42301387", "text": "getById (id) {\n return this.dict[id]\n }", "title": "" }, { "docid": "b210f053befafb317dd7a507c46a8c70", "score": "0.42241856", "text": "function fetch(req, res, next, id) {\n Role.get(id).then((role) => {\n req.role = role;\t\t// eslint-disable-line no-param-reassign\n return next();\n }).error((e) => next(e));\n}", "title": "" }, { "docid": "e3fd01809c69f4001298880da72c4ee5", "score": "0.42201638", "text": "static get(name, id, state, opts) {\n return new Table(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "3bd2adc25482a2b413490765a9e5244f", "score": "0.4215748", "text": "static get(name, id, state) {\n return new Volume(name, state, { id });\n }", "title": "" }, { "docid": "458d217c7fcd8a7ee9ddc4fb226e53e0", "score": "0.42153406", "text": "function getCourseResource(currentCourse, learningGroupIdFilter) {\r\n // if a course is passed in...\r\n if (currentCourse) {\r\n // THEN if the course has an ID\r\n if (+currentCourse.Id) {\r\n // THEN get the specific course\r\n return $resource('_api/web/lists/getbytitle(\\'Courses\\')/items(:courseId)',\r\n { courseId: currentCourse.Id },\r\n {\r\n get: {\r\n method: 'GET',\r\n params: {\r\n '$select': 'Id,Title,LearningGroup/Id,Created,Modified,OData__Comments',\r\n '$expand': 'LearningGroup/Id'\r\n },\r\n headers: {\r\n 'Accept': 'application/json;odata=verbose;'\r\n }\r\n },\r\n post: {\r\n method: 'POST',\r\n headers: {\r\n 'Accept': 'application/json;odata=verbose;',\r\n 'Content-Type': 'application/json;odata=verbose;',\r\n 'X-RequestDigest': spContext.securityValidation,\r\n 'X-HTTP-Method': 'MERGE',\r\n 'If-Match': currentCourse.__metadata.etag\r\n }\r\n },\r\n delete: {\r\n method: 'DELETE',\r\n headers: {\r\n 'Accept': 'application/json;odata=verbose;',\r\n 'Content-Type': 'application/json;odata=verbose;',\r\n 'X-RequestDigest': spContext.securityValidation,\r\n 'If-Match': '*'\r\n }\r\n }\r\n });\r\n } else {\r\n // ELSE creating a course...\r\n return $resource('_api/web/lists/getbytitle(\\'Courses\\')/items',\r\n {},\r\n {\r\n post: {\r\n method: 'POST',\r\n headers: {\r\n 'Accept': 'application/json;odata=verbose;',\r\n 'Content-Type': 'application/json;odata=verbose;',\r\n 'X-RequestDigest': spContext.securityValidation\r\n }\r\n }\r\n });\r\n }\r\n } else {\r\n // ELSE if a learning group ID filter is passed in,\r\n if (learningGroupIdFilter) {\r\n // THEN build the resource filtering for a specific learning group\r\n // ELSE create resource showing all courses\r\n return $resource('_api/web/lists/getbytitle(\\'Courses\\')/items',\r\n {},\r\n {\r\n get: {\r\n method: 'GET',\r\n params: {\r\n '$select': 'LearningGroup/Id,Id,Title,Created,Modified,OData__Comments',\r\n '$expand': 'LearningGroup/Id',\r\n '$filter': 'LearningGroup/Id eq ' + learningGroupIdFilter\r\n },\r\n headers: {\r\n 'Accept': 'application/json;odata=verbose;'\r\n }\r\n }\r\n });\r\n } else {\r\n return $resource('_api/web/lists/getbytitle(\\'Courses\\')/items',\r\n {},\r\n {\r\n get: {\r\n method: 'GET',\r\n headers: {\r\n 'Accept': 'application/json;odata=verbose;'\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }", "title": "" }, { "docid": "ff2ab29c4f638e01e3662f6db6ad71a6", "score": "0.41970643", "text": "function genesisStateById(id) {\n return genesisStates[genesisStates['names'][id]];\n}", "title": "" }, { "docid": "ff2ab29c4f638e01e3662f6db6ad71a6", "score": "0.41970643", "text": "function genesisStateById(id) {\n return genesisStates[genesisStates['names'][id]];\n}", "title": "" }, { "docid": "ac53ecbb958203dee19720d9cfc5d700", "score": "0.41945446", "text": "role(name) {\n\t\tlet id = this.getRoleId(name);\n\n\t\tif(id) {\n\t\t\treturn this.roles[id];\n\t\t}\n\n\t\tthrow 'Role ' + name + ' not found';\n\t}", "title": "" }, { "docid": "81411dfd603c0874a2f4ea89151865b0", "score": "0.41940778", "text": "function getCompanyById(state, id) {\n let theCompany = {};\n state.companies.forEach((company) => {\n if (company.id == id) {\n theCompany = company;\n }\n })\n return theCompany;\n}", "title": "" }, { "docid": "cf02c19eeefe30c630fb0ed3161fc480", "score": "0.41903773", "text": "getRessource(id) {\r\n const url = `${this.ressourcesUrl}/${id}`;\r\n return this.http.get(url).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"tap\"])(_ => this.log(`fetched ressource id=${id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"catchError\"])(this.handleError(`getRessource id=${id}`)));\r\n }", "title": "" }, { "docid": "fc20d3678718d77937965881740ce4c3", "score": "0.41866767", "text": "static get(name, id, state, opts) {\n return new Pipeline(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "f7a93501de7c57d45cfeca436c761b00", "score": "0.41840965", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnTrustAnchor.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_rolesanywhere_CfnTrustAnchorProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnTrustAnchor);\n }\n throw error;\n }\n cdk.requireProperty(props, 'name', this);\n cdk.requireProperty(props, 'source', this);\n this.attrTrustAnchorArn = cdk.Token.asString(this.getAtt('TrustAnchorArn', cdk.ResolutionTypeHint.STRING));\n this.attrTrustAnchorId = cdk.Token.asString(this.getAtt('TrustAnchorId', cdk.ResolutionTypeHint.STRING));\n this.name = props.name;\n this.source = props.source;\n this.enabled = props.enabled;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::RolesAnywhere::TrustAnchor\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "87c958b181791654f22c32300e9f0055", "score": "0.41631374", "text": "function getCardFromId(id) {\n\n var cardTypeShortcode = id.substr(0, 3);\n\n // Card IDs are prefixed with card type shortcodes for ease of search\n var cardTypes = { 'BLA': 'black_cards',\n 'BLU': 'blue_cards',\n 'RED': 'red_cards',\n 'GRE': 'green_cards',\n 'ORA': 'orange_cards'\n };\n\n var type = cardTypes[cardTypeShortcode];\n var cardsArr = CARDS_LIBRARY[type]['cards']; // static library\n var cardsProperties = CARDS_LIBRARY[type]['properties'];\n\n // Search in the right card group\n for (card in cardsArr) {\n var card = cardsArr[card];\n\n // is there a better way to do this?\n card.properties = cardsProperties;\n\n if (card.id == id) {\n return card;\n }\n }\n}", "title": "" }, { "docid": "e3871136a09798514c0e7e66f035b1ab", "score": "0.41611755", "text": "get(id) {\n return withSpeed(this.rules.get(id));\n }", "title": "" }, { "docid": "a5ce2c6c785f0cf48d4cc44640cdf07a", "score": "0.4159941", "text": "static get(name, id, opts) {\n return new Profile(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "d870db3758a64e84c1e44bbb096e56aa", "score": "0.4158769", "text": "static load(id, options, fetchOptions) {\n options = extend({}, { conditions: {} }, options);\n options.conditions[this.definition().key()] = id;\n return this.first(options, fetchOptions);\n }", "title": "" }, { "docid": "30a1eccca69ca287fb6a37c178090cb5", "score": "0.41568816", "text": "function findResource(name) {\n let test = -1;\n name = name.charAt(0).toUpperCase() + name.slice(1);\n for (let i = 0; i < resources.length; i++) {\n if (resources[i].name() === name) {\n test = i;\n }\n }\n if (test === -1) {\n throw new Error(\"Name of the resource not found: \" + name);\n } else {\n return resources[test];\n }\n}", "title": "" }, { "docid": "a126b07129ab23467940eb4cf1a07ed7", "score": "0.41524202", "text": "function getRegionById(id) {\n return _.find(RegionData, {\"LA_id\": id});\n }", "title": "" }, { "docid": "a9278ce57707e1099093653a713fd439", "score": "0.4142649", "text": "function UserSettings_Read(scope, id)\r\n{\r\n\tif(typeof(scope) == 'string')\r\n\t\tscope = UserSettings_Scopes[scope];\r\n\r\n\tif(!scope || !id)\r\n\t\treturn null;\r\n\r\n\tvar readfct = scope.read;\r\n\r\n\tif(!readfct)\r\n\t\treturn null;\r\n\r\n\treturn readfct.call(this, id);\r\n}", "title": "" }, { "docid": "d3a740e993e3a500eaaac808bdbd0301", "score": "0.41307887", "text": "static get(name, id, opts) {\n return new AndroidMAMPolicyByName(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "d8c5447b174008c25ace47d41d6fd0dc", "score": "0.41281396", "text": "authorize(user, resource, optOverride) {\n resource = resource || this.context()._instance || {}\n this._resource = resource\n this.mergeContext({\n _user: Object.assign({ role: opts.defaultRole }, user),\n _opts: Object.assign({}, opts, optOverride),\n _authorize: true\n })\n // This is run AFTER the query has been completely built.\n // In other words, the query already checked create/update/delete access\n // by this point, and the only thing to check now is the read access,\n // IF the resource is specified.\n // Otherwise, we check the read access after the query has been run, on the\n // query results as the resource.\n .runBefore(async (result, query) => {\n if (query.isFind() && !isEmpty(resource)) {\n const readAccess = query._checkAccess('read')\n\n // store the read access so that it can be reused after the query.\n query.mergeContext({ readAccess })\n }\n\n return result\n })\n .runAfter(async (result, query) => {\n // If there's no result objects, we don't need to filter them.\n if (typeof result !== 'object' || !query._shouldCheckAccess)\n return result\n\n const isArray = Array.isArray(result)\n\n let {\n _resource: resource,\n _first: first,\n _opts: opts,\n _user: user,\n _readAccess: readAccess\n } = query.context()\n\n // Set the resource as the result if it's still not set!\n // Note, since the resource needs to be singular, it can only be done\n // when there's only one result -\n // we're trusting that if the query returns an array of results,\n // then you've already filtered it according to the user's read access\n // in the query (instead of relying on the ACL to do it) since it's costly\n // to check every single item in the result array...\n if (isEmpty(resource) && (!isArray || first)) {\n resource = isArray ? result[0] : result\n resource = query.modelClass().fromJson(resource, {\n skipValidation: true\n })\n query.mergeContext({ _resource: resource })\n }\n\n // after create/update operations, the returning result may be the requester\n if (\n (query.isInsert() || query.isUpdate()) &&\n !isArray &&\n opts.userFromResult\n ) {\n // check if the user is changed\n const resultIsUser =\n typeof opts.userFromResult === 'function'\n ? opts.userFromResult(user, result)\n : true\n\n // now we need to re-check read access from the context of the changed user\n if (resultIsUser) {\n // first, override the user and resource context for _checkAccess\n query.mergeContext({ _user: result })\n // then obtain read access\n readAccess = query._checkAccess('read')\n }\n }\n\n readAccess = readAccess || query._checkAccess('read')\n\n // if we're fetching multiple resources, the result will be an array.\n // While access.filter() accepts arrays, we need to invoke any $formatJson()\n // hooks by individually calling toJSON() on individual models since:\n // 1. arrays don't have toJSON() method,\n // 2. objection-visibility doesn't work without calling $formatJson()\n return isArray\n ? result.map(model => model._filterModel(readAccess))\n : result._filterModel(readAccess)\n })\n\n // for chaining\n return this\n }", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.41261107", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.41261107", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.41261107", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.41261107", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.41261107", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.41261107", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.41261107", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.41261107", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.41261107", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "20d93c8f28ac14066b8445492706c0bb", "score": "0.41158473", "text": "static get(id){\n\n if(!DB.hasOwnProperty(this.className())){\n console.error(this.className(), \"cannot be identified because it doesn't have a library entry\");\n return;\n }\n\n if(!new this().hasOwnProperty('id')){\n console.error('Error, object \"'+this.className()+'\" doesn\\'t have an id field');\n return false;\n }\n\n var scan = DB[this.className()];\n for(var i=0; i<scan.length; ++i){\n var asset = scan[i];\n if(asset.id === id){\n return asset;\n }\n }\n\n\t\tconsole.error(\"Search for \", id, \"in\", this.className(), \"yielded no results\");\n return false;\n }", "title": "" }, { "docid": "b25622b49d5db8eb68163776f7146bc0", "score": "0.41077256", "text": "function getViewStateEntry(config, name)\n{\n for (index = 0; index < config.length; index++) {\n if (config[index].name == name) {\n return config[index];\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "2a18fb66b2320417423afa6301e411c6", "score": "0.41072", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, \"filters\", id, true) || identity\n }", "title": "" }, { "docid": "d80235e5b6de0d9274d71745b43b208e", "score": "0.40995887", "text": "function resolveFilter (id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n }", "title": "" }, { "docid": "d80235e5b6de0d9274d71745b43b208e", "score": "0.40995887", "text": "function resolveFilter (id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n }", "title": "" }, { "docid": "d80235e5b6de0d9274d71745b43b208e", "score": "0.40995887", "text": "function resolveFilter (id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n }", "title": "" }, { "docid": "6bab3f729d19f1a9b6ae52586900f9d6", "score": "0.40976956", "text": "function modifyRead(state, id) {\n fetch('/emails/' + id, {\n method: 'PUT',\n body: JSON.stringify({\n read: state\n })\n });\n}", "title": "" }, { "docid": "1805eb8f0a77bd2c5d0a87eb58a19442", "score": "0.40952656", "text": "ls(id){\n return this.props.linkState('user.' + id);\n }", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "53e6827e1ca40974ba0f203bebe19acf", "score": "0.40947837", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n}", "title": "" }, { "docid": "ad0ffcfabf1ed5b929c8ef53b4c15e6f", "score": "0.40927204", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n }", "title": "" }, { "docid": "ad0ffcfabf1ed5b929c8ef53b4c15e6f", "score": "0.40927204", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n }", "title": "" }, { "docid": "ad0ffcfabf1ed5b929c8ef53b4c15e6f", "score": "0.40927204", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity;\n }", "title": "" } ]
1e9defc5ca67773f7f3397f743709dc0
vuerouter v2.8.1 (c) 2017 Evan You
[ { "docid": "298cc68c37f638241f0702a61ad66dd6", "score": "0.0", "text": "function n(t,e){if(!t)throw new Error(\"[vue-router] \"+e)}", "title": "" } ]
[ { "docid": "c1d372e26fd11694f775af2260fb72ff", "score": "0.6342965", "text": "function Vw(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"source.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "7a10fe70bfa3f695fe647cf5de9c90b9", "score": "0.60955673", "text": "function VENDORS()\n{\n\t\n}", "title": "" }, { "docid": "222dd736d339ab7c69fd0417abb71432", "score": "0.60439265", "text": "function Vigenere() {}", "title": "" }, { "docid": "db7e1b0668c63f3244d920e58b041970", "score": "0.59439784", "text": "function qgAzysV_bHje7HMBqh73wBw(){}", "title": "" }, { "docid": "fdf58d1b4574601262d04038dbba1607", "score": "0.593101", "text": "function skdzdrHL2Te9uAFMbXAqvw(){}", "title": "" }, { "docid": "30364dd7df5503895c9b5b2870afcbe3", "score": "0.58888495", "text": "function wb(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "4cd6c6a03165fe5fe7afaa584c25e9d1", "score": "0.58256704", "text": "vampireWithName(name) {\n \n }", "title": "" }, { "docid": "ef7453d311c3f7406ba7d25f483d706f", "score": "0.57850003", "text": "function bN(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "7bdf3f19a966fba21dda2ce3369aae12", "score": "0.57783556", "text": "function __aQHTPPuL1Di4jeIELPbjrw(){}", "title": "" }, { "docid": "4e941517748ee58efdff72f113400b9d", "score": "0.5772376", "text": "function vito() {\n\n}", "title": "" }, { "docid": "a23e45db9a44b71bca23e9bb0e9b5637", "score": "0.5720689", "text": "function Vd(){}", "title": "" }, { "docid": "817ce6ed36283793041491fce9e170c6", "score": "0.5676445", "text": "function uj(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "ec6587fa014637387de2f3fede971873", "score": "0.56645906", "text": "function xS(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"source.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "eb5dfcdc19b271b7138435511a2ac6ae", "score": "0.5647415", "text": "function L1nMQoVjnjetV_aXG4GFkBQ(){}", "title": "" }, { "docid": "c8e8a7fef80e862666b8d2e09aa4552e", "score": "0.5644747", "text": "function ZR(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "c5bf779a43590bcf90de8b59da75b953", "score": "0.5618758", "text": "function SigV4Utils() {}", "title": "" }, { "docid": "c5bf779a43590bcf90de8b59da75b953", "score": "0.5618758", "text": "function SigV4Utils() {}", "title": "" }, { "docid": "1e0aeab2ac22eaa5d8208361f81a78b4", "score": "0.55966425", "text": "function __adNhkYkODD_aby8Cz6QAvuQ(){}", "title": "" }, { "docid": "95a63675104bdd83c85e65dfae222b55", "score": "0.5581094", "text": "function vuser_init()\r\n{\r\n\treturn 0;\r\n}", "title": "" }, { "docid": "38c230130f6410c077af46990d4fb73e", "score": "0.5580057", "text": "function lb(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "51b82234f90fb16d3584f54b2503310b", "score": "0.5579467", "text": "function SigV4Utils(){}", "title": "" }, { "docid": "30d446f332ee7848a0dccb2c8c6d24d9", "score": "0.55699277", "text": "function e$(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "94025760d438a3812a3bcdd3cb24c367", "score": "0.55618566", "text": "function iR(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "f28ed180fd1af05ad6a6a6eef3130ad1", "score": "0.55433774", "text": "function kx(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "0b18eb9479a4336ea7429014440264ed", "score": "0.55389845", "text": "function DP(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "d89e3b488cdb01a9cb6291eb259f7b59", "score": "0.55037224", "text": "function Hj(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "8661d8ca6f7d940bad1eddedd7e5004f", "score": "0.5486168", "text": "function sE(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "2f7496c3f8329bf80843c5eaac975496", "score": "0.54543215", "text": "function cL(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "25d0d5aa95f045624d8cc95237abb7bf", "score": "0.54534453", "text": "static vector() {\n return 'MANUAL';\n }", "title": "" }, { "docid": "bad5d81ebb6071d93897696a201009b6", "score": "0.54452056", "text": "function r(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void r(t._data,e,n);var i=t.__ob__;if(!i)return void(t[e]=n);if(i.convert(e,n),i.dep.notify(),i.vms)for(var a=i.vms.length;a--;){var s=i.vms[a];s._proxy(e),s._digest()}return n}", "title": "" }, { "docid": "bad5d81ebb6071d93897696a201009b6", "score": "0.54452056", "text": "function r(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void r(t._data,e,n);var i=t.__ob__;if(!i)return void(t[e]=n);if(i.convert(e,n),i.dep.notify(),i.vms)for(var a=i.vms.length;a--;){var s=i.vms[a];s._proxy(e),s._digest()}return n}", "title": "" }, { "docid": "01cb973649050d34ea8b4ef187e8eced", "score": "0.5428761", "text": "function VO(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"style.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "adc9620366b2de2f2c742933273a9fdf", "score": "0.5425467", "text": "function vT(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "d9e0240a1a3662919c762537b8e42c1b", "score": "0.53923815", "text": "function mx(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "8e5443820f91572d0f0645f29c9fd8a3", "score": "0.538876", "text": "function Hf(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "73a750f0bf7174043ac43fdfb329b392", "score": "0.5385957", "text": "function Fp3EngineUtils() {}", "title": "" }, { "docid": "b36870915304629d2c44ca9b0c395e24", "score": "0.5382602", "text": "static getVersion() { return 1; }", "title": "" }, { "docid": "f0754b8e59c113e5db66b7be9d68f8a3", "score": "0.5373664", "text": "function _6yZECZP9ozm5xQDaInToeg() {}", "title": "" }, { "docid": "217ae7b560fb0cb3bd90be6196eaf4fd", "score": "0.5369617", "text": "function Wqbb7OcJxzON_b2AVrI6xgg(){}", "title": "" }, { "docid": "6817c9a2a07acaf4fc2a2ad58d54550b", "score": "0.5359211", "text": "ready () {\n new window.Vue({\n el: this.shadowRoot,\n data: {\n dirs: \"resources\",\n extensions: \"prefab,mp3,anim\"\n },\n methods: {\n /** 开始配置 */\n startConfig() {\n let ext = this.extensions;\n let dir = this.dirs;\n exts = ext.split(\",\");\n dirs = dir.split(\",\");\n Editor.log(\"开始向主进程发消息\",exts,dirs);\n Editor.Ipc.sendToMain(\"resmap:query_assets\",{exts,dirs});\n \n }\n }\n })\n }", "title": "" }, { "docid": "b2b962ec6c3bfff5e0bfbb39dac476d6", "score": "0.53591406", "text": "function e36bjRxQJTKxhL2I_aKPoYg(){}", "title": "" }, { "docid": "6b9ced2a750275a57fa83921a50577e0", "score": "0.53405434", "text": "function _2fFEyKdwBjC3MMVY48h7UA(){}", "title": "" }, { "docid": "b60c95fa5c32e2ed681509805f1ac9ad", "score": "0.53312147", "text": "function Yx(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "fde213f1183c4cd834d30845ee9333c4", "score": "0.53234214", "text": "function v() {\n return '?v' + ver\n}", "title": "" }, { "docid": "f4182c7ece22fb7f06f19ca5815df5da", "score": "0.53211546", "text": "function XY27_a3uEfjuPVlzJ1epT7g(){}", "title": "" }, { "docid": "039f16fe838b3863f5edfb35a3ef4ee4", "score": "0.5307483", "text": "function Jc8SGuzqfTWQzxgi2Ip02g(){}", "title": "" }, { "docid": "5d3158adb29f2fbd9212eedd6543f27f", "score": "0.5301755", "text": "function twVillagesFinder()\r\n{\r\n \r\n\r\n}", "title": "" }, { "docid": "f4603fb1d49c9f9c14548c63e0bcd464", "score": "0.5299887", "text": "function DlKQv4vAgzaPrv33odvgUQ(){}", "title": "" }, { "docid": "d16ab539ee0e7c6c57b59d6142c1461d", "score": "0.5272121", "text": "function nVImkL8vuT_aKu2o865pjrQ(){}", "title": "" }, { "docid": "cf357cd91d8c21bc3e148c9f17c87c5c", "score": "0.5268478", "text": "upgrade() {\n // Empty\n }", "title": "" }, { "docid": "09d20cfc7de3c00fe4cc6113395b83c1", "score": "0.52683735", "text": "function mC(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "ca1fe47a73d47c51c8a48b2ab613260b", "score": "0.5264257", "text": "function _34Z38D1h1jWisfyZw_a9KnQ(){}", "title": "" }, { "docid": "e8fd4c49c3841c04152d06335a3a4821", "score": "0.52605456", "text": "function lwiw47520() { return ' { v'; }", "title": "" }, { "docid": "a32399f1dca5101e2a9c56f3035cc1f3", "score": "0.52515316", "text": "function verVegano(){\n var v = p.filtrarVegano();\n p.dibujarSurtido(v);\n}", "title": "" }, { "docid": "c2515383a9ef9ee77e71c17bc2a85635", "score": "0.52450264", "text": "function Dd(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "329095144f34c4adbd7f50eb42d9482d", "score": "0.52417374", "text": "function kM(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "11ace61eba1b814dd7dd8161c9261d5b", "score": "0.5228072", "text": "function lC(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "e1e79edf7ba4a9e2bc229bbd11dc4d10", "score": "0.5225484", "text": "function S(){function e(e){t.Extends(f,e),i(e.jQuery),t._base.name(\"Zambezi\"),n=t._base,a=n.config}function i(e){r=e,o=e}var t=new I(this);this.LocalSVNRevision=\"$Rev: 3172 $\";{var n,a,r,o;t.Override(\"buildHtml\",function(){var e='<div id=\"{{id}}\" class=\"walkme-direction-{{direction}} walkme-player walkme-zambezi walkme-theme-{{theme}} walkme-position-major-{{positionMajor}} walkme-position-minor-{{positionMinor}} {{accessibleClass}}\"></div>',i=n.mustache().to_html(e,{id:n.id(),direction:a().Direction,positionMajor:n.positionMajor(),positionMinor:n.positionMinor(),theme:a().TriangleTheme,accessibleClass:n.accessibleClass()});return i})}e.apply(null,arguments)}", "title": "" }, { "docid": "7af8c3a7eb4f163b08ba9aa3d3c30e4f", "score": "0.52194077", "text": "function I$l(I){const R=new o$1u,{vertex:z,fragment:k,varyings:G}=R;return v$M(z,I),R.include(o$1f),G.add(\"vpos\",\"vec3\"),R.include(s$Y,I),R.include(p$G,I),R.include(a$W,I),I.output!==h$1c.Color&&I.output!==h$1c.Alpha||(c$18(R.vertex,I),R.include(o$H,I),R.include(r$1b,I),I.offsetBackfaces&&R.include(e$H),I.instancedColor&&R.attributes.add(O$O.INSTANCECOLOR,\"vec4\"),G.add(\"vNormalWorld\",\"vec3\"),G.add(\"localvpos\",\"vec3\"),I.hasMultipassTerrain&&G.add(\"depth\",\"float\"),R.include(o$1x,I),R.include(d$1k,I),R.include(i$E,I),R.include(e$F,I),z.uniforms.add(new e$1B(\"externalColor\",(e=>e.externalColor))),G.add(\"vcolorExt\",\"vec4\"),z.code.add(n$1x`\n void main(void) {\n forwardNormalizedVertexColor();\n vcolorExt = externalColor;\n ${I.instancedColor?\"vcolorExt *= instanceColor;\":\"\"}\n vcolorExt *= vvColor();\n vcolorExt *= getSymbolColor();\n forwardColorMixMode();\n\n if (vcolorExt.a < ${n$1x.float(t$14)}) {\n gl_Position = vec4(1e38, 1e38, 1e38, 1.0);\n } else {\n vpos = calculateVPos();\n localvpos = vpos - view[3].xyz;\n vpos = subtractOrigin(vpos);\n vNormalWorld = dpNormal(vvLocalNormal(normalModel()));\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, vpos);\n ${I.offsetBackfaces?\"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);\":\"\"}\n }\n ${I.hasMultipassTerrain?n$1x`depth = (view * vec4(vpos, 1.0)).z;`:\"\"}\n forwardLinearDepth();\n forwardTextureCoordinates();\n }\n `)),I.output===h$1c.Alpha&&(R.include(u$R,I),R.include(s$I,I),R.include(n$1n,I),k.uniforms.add([new o$1w(\"opacity\",(e=>e.opacity)),new o$1w(\"layerOpacity\",(e=>e.layerOpacity))]),I.hasColorTexture&&k.uniforms.add(new f$1s(\"tex\",(e=>e.texture))),k.include(i$C),k.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${I.hasMultipassTerrain?n$1x`terrainDepthTest(gl_FragCoord, depth);`:\"\"}\n ${I.hasColorTexture?n$1x`\n vec4 texColor = texture2D(tex, ${I.hasColorTextureTransform?n$1x`colorUV`:n$1x`vuv0`});\n ${I.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:n$1x`vec4 texColor = vec4(1.0);`}\n ${I.hasVertexColors?n$1x`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:n$1x`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}\n\n gl_FragColor = vec4(opacity_);\n }\n `)),I.output===h$1c.Color&&(R.include(u$R,I),R.include(p$F,I),R.include(n$O,I),R.include(s$I,I),R.include(I.instancedDoublePrecision?h$D:v$B,I),R.include(n$1n,I),c$18(R.fragment,I),o$1v(k),h$A(k),u$B(k),k.uniforms.add([z.uniforms.get(\"localOrigin\"),z.uniforms.get(\"view\"),new e$1E(\"ambient\",(e=>e.ambient)),new e$1E(\"diffuse\",(e=>e.diffuse)),new o$1w(\"opacity\",(e=>e.opacity)),new o$1w(\"layerOpacity\",(e=>e.layerOpacity))]),I.hasColorTexture&&k.uniforms.add(new f$1s(\"tex\",(e=>e.texture))),R.include(x$W,I),R.include(n$S,I),k.include(i$C),R.extensions.add(\"GL_OES_standard_derivatives\"),a$1m(k),k.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${I.hasMultipassTerrain?n$1x`terrainDepthTest(gl_FragCoord, depth);`:\"\"}\n ${I.hasColorTexture?n$1x`\n vec4 texColor = texture2D(tex, ${I.hasColorTextureTransform?n$1x`colorUV`:n$1x`vuv0`});\n ${I.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:n$1x`vec4 texColor = vec4(1.0);`}\n vec3 viewDirection = normalize(vpos - cameraPosition);\n ${I.pbrMode===d$1p.Normal?\"applyPBRFactors();\":\"\"}\n float ssao = evaluateAmbientOcclusionInverse();\n ssao *= getBakedOcclusion();\n\n float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);\n vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\n ${I.receiveShadows?\"float shadow = readShadowMap(vpos, linearDepth);\":I.spherical?\"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);\":\"float shadow = 0.0;\"}\n vec3 matColor = max(ambient, diffuse);\n ${I.hasVertexColors?n$1x`\n vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:n$1x`\n vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}\n ${I.snowCover?n$1x`albedo = mix(albedo, vec3(1), 0.9);`:n$1x``}\n ${n$1x`\n vec3 shadingNormal = normalize(vNormalWorld);\n albedo *= 1.2;\n vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);\n float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);\n float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);\n float treeRadialFalloff = vColor.r;\n float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);\n additionalLight += backLightFactor * mainLightIntensity;`}\n ${I.pbrMode===d$1p.Normal||I.pbrMode===d$1p.Schematic?I.spherical?n$1x`vec3 normalGround = normalize(vpos + localOrigin);`:n$1x`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:n$1x``}\n ${I.pbrMode===d$1p.Normal||I.pbrMode===d$1p.Schematic?n$1x`\n float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];\n ${I.snowCover?n$1x`\n mrr = vec3(0.0, 1.0, 0.04);\n emission = vec3(0.0);`:\"\"}\n\n vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:n$1x`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}\n gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);\n ${I.transparencyPassType===o$V.Color?n$1x`gl_FragColor = premultiplyAlpha(gl_FragColor);`:n$1x``}\n }\n `)),R.include(b$q,I),R}", "title": "" }, { "docid": "0974dddc478cf7874075ed7de2700920", "score": "0.52184045", "text": "function ZN(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5185051", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "5ff4115cd114da0d6b825aef9f82c90f", "score": "0.51815206", "text": "function b(){function e(e){t.Extends(f,e),i(e.jQuery),t._base.name(\"Rhine\"),n=t._base,a=n.config}function i(e){r=e,o=e}var t=new I(this);this.LocalSVNRevision=\"$Rev: 2922 $\";{var n,a,r,o;t.Override(\"buildHtml\",function(){var e='<div id=\"{{id}}\" class=\"walkme-direction-{{direction}} walkme-player walkme-rhine walkme-theme-{{theme}} walkme-position-major-{{positionMajor}} walkme-position-minor-{{positionMinor}}\"></div>',i=n.mustache().to_html(e,{id:n.id(),direction:a().Direction,positionMajor:n.positionMajor(),positionMinor:n.positionMinor(),theme:a().TriangleTheme});return i})}e.apply(null,arguments)}", "title": "" }, { "docid": "64e53730bbbadf2319955d15d121dabb", "score": "0.51792765", "text": "function yDV46UUdQjG8NhHZFaqZ_aw(){}", "title": "" } ]
d97892a90a2c62b49b82f91a8b7f81a0
If we get something that is not a buffer, string, null, or undefined, and we're not in objectMode, then that's an error. Otherwise stream chunks are all considered to be of length=1, and the watermarks determine how many objects to keep in the buffer, rather than how many bytes or characters.
[ { "docid": "c2f7656db71331838201b7275730864f", "score": "0.0", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n // Always throw error if a null is written\n // if we are not in object mode then throw\n // if it is not a buffer, string, or undefined.\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" } ]
[ { "docid": "5d557597615f080b81cf75f5a8dd3868", "score": "0.6623148", "text": "function validChunk(stream,state,chunk,cb){var valid=true;if(!Buffer.isBuffer(chunk)&&typeof chunk!=='string'&&chunk!==null&&chunk!==undefined&&!state.objectMode){var er=new TypeError('Invalid non-string/buffer chunk');stream.emit('error',er);processNextTick(cb,er);valid=false;}return valid;}", "title": "" }, { "docid": "5d557597615f080b81cf75f5a8dd3868", "score": "0.6623148", "text": "function validChunk(stream,state,chunk,cb){var valid=true;if(!Buffer.isBuffer(chunk)&&typeof chunk!=='string'&&chunk!==null&&chunk!==undefined&&!state.objectMode){var er=new TypeError('Invalid non-string/buffer chunk');stream.emit('error',er);processNextTick(cb,er);valid=false;}return valid;}", "title": "" }, { "docid": "5d557597615f080b81cf75f5a8dd3868", "score": "0.6623148", "text": "function validChunk(stream,state,chunk,cb){var valid=true;if(!Buffer.isBuffer(chunk)&&typeof chunk!=='string'&&chunk!==null&&chunk!==undefined&&!state.objectMode){var er=new TypeError('Invalid non-string/buffer chunk');stream.emit('error',er);processNextTick(cb,er);valid=false;}return valid;}", "title": "" }, { "docid": "c3b253bd188fd22efb7e7af88d35456a", "score": "0.6490413", "text": "function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError('May not write null values to stream');}else if(typeof chunk!=='string'&&chunk!==undefined&&!state.objectMode){er=new TypeError('Invalid non-string/buffer chunk');}if(er){stream.emit('error',er);pna.nextTick(cb,er);valid=false;}return valid;}", "title": "" }, { "docid": "c3b253bd188fd22efb7e7af88d35456a", "score": "0.6490413", "text": "function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError('May not write null values to stream');}else if(typeof chunk!=='string'&&chunk!==undefined&&!state.objectMode){er=new TypeError('Invalid non-string/buffer chunk');}if(er){stream.emit('error',er);pna.nextTick(cb,er);valid=false;}return valid;}", "title": "" }, { "docid": "53cf5082c06bdb415384377c30731213", "score": "0.64042455", "text": "function validChunk(stream,state,chunk,cb){var valid=true;if(!util.isBuffer(chunk) && !util.isString(chunk) && !util.isNullOrUndefined(chunk) && !state.objectMode){var er=new TypeError('Invalid non-string/buffer chunk');stream.emit('error',er);process.nextTick(function(){cb(er);});valid = false;}return valid;}", "title": "" }, { "docid": "2f535d6efc2818302e52165cbf2deddf", "score": "0.62348694", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "7087d63495a29a3b405ef9db51ef76c2", "score": "0.6218088", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t\n\t if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "413e02d8b0f7ded78b32770b84d500ed", "score": "0.62071604", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\n\t if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "413e02d8b0f7ded78b32770b84d500ed", "score": "0.62071604", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\n\t if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "413e02d8b0f7ded78b32770b84d500ed", "score": "0.62071604", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\n\t if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "413e02d8b0f7ded78b32770b84d500ed", "score": "0.62071604", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\n\t if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "1d6c662bf0841696f8952146380bf796", "score": "0.6196373", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true\n var er = false\n\n if (chunk === null) {\n er = new TypeError(\n 'May not write null values to stream',\n )\n } else if (\n typeof chunk !== 'string' &&\n chunk !== undefined &&\n !state.objectMode\n ) {\n er = new TypeError(\n 'Invalid non-string/buffer chunk',\n )\n }\n if (er) {\n stream.emit('error', er)\n pna.nextTick(cb, er)\n valid = false\n }\n return valid\n }", "title": "" }, { "docid": "eb222caa3beb3b1eba3b086a0a5b4358", "score": "0.619173", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true\n if (\n !Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode\n ) {\n var er = new TypeError('Invalid non-string/buffer chunk')\n stream.emit('error', er)\n process.nextTick(function() {\n cb(er)\n })\n valid = false\n }\n return valid\n }", "title": "" }, { "docid": "a9b7016b30ca3ad283ee8d22000ed7ca", "score": "0.618576", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "a9b7016b30ca3ad283ee8d22000ed7ca", "score": "0.618576", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "a9b7016b30ca3ad283ee8d22000ed7ca", "score": "0.618576", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "a9b7016b30ca3ad283ee8d22000ed7ca", "score": "0.618576", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "a9b7016b30ca3ad283ee8d22000ed7ca", "score": "0.618576", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "e354187feaec6a9acc7614f1d976f670", "score": "0.61850387", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "5ad8e57dd1c7fef3943cd25ac9ca8a10", "score": "0.6172534", "text": "function validChunk(stream,state,chunk,cb){\nvar valid=true;\nvar er=false;\n\nif(chunk===null){\ner=new TypeError('May not write null values to stream');\n}else if(typeof chunk!=='string'&&chunk!==undefined&&!state.objectMode){\ner=new TypeError('Invalid non-string/buffer chunk');\n}\nif(er){\nstream.emit('error',er);\npna.nextTick(cb,er);\nvalid=false;\n}\nreturn valid;\n}", "title": "" }, { "docid": "d92e47f008ba285f597292fba7cd834d", "score": "0.6168971", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true\n var er = false\n // Always throw error if a null is written\n // if we are not in object mode then throw\n // if it is not a buffer, string, or undefined.\n if (chunk === null) {\n er = new TypeError('May not write null values to stream')\n } else if (\n !Buffer.isBuffer(chunk) &&\n typeof chunk !== 'string' &&\n chunk !== undefined &&\n !state.objectMode\n ) {\n er = new TypeError('Invalid non-string/buffer chunk')\n }\n if (er) {\n stream.emit('error', er)\n processNextTick(cb, er)\n valid = false\n }\n return valid\n }", "title": "" }, { "docid": "3ccabcf224c90f39f1e0508b9b6cd483", "score": "0.61674774", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "3ccabcf224c90f39f1e0508b9b6cd483", "score": "0.61674774", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "3ccabcf224c90f39f1e0508b9b6cd483", "score": "0.61674774", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "3ccabcf224c90f39f1e0508b9b6cd483", "score": "0.61674774", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "3ccabcf224c90f39f1e0508b9b6cd483", "score": "0.61674774", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "c5e5af2915ac8efe4f22a9042a86c05a", "score": "0.61645484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n // Always throw error if a null is written\n // if we are not in object mode then throw\n // if it is not a buffer, string, or undefined.\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n nextTick(cb, er);\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "3e271b7f07807ca7eb618ae6db362f3c", "score": "0.6160945", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n // Always throw error if a null is written\n // if we are not in object mode then throw\n // if it is not a buffer, string, or undefined.\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "6c96c538d9c77a714ef57e36e264eb9a", "score": "0.6160676", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;// Always throw error if a null is written\n// if we are not in object mode then throw\n// if it is not a buffer, string, or undefined.\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "30bdb00d79187c9c89a615d20bb7ae7a", "score": "0.6154382", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n // Always throw error if a null is written\n // if we are not in object mode then throw\n // if it is not a buffer, string, or undefined.\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "ea88174f325293f13c2bfe05a1661bbc", "score": "0.61341864", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "ea88174f325293f13c2bfe05a1661bbc", "score": "0.61341864", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "ea88174f325293f13c2bfe05a1661bbc", "score": "0.61341864", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "ea88174f325293f13c2bfe05a1661bbc", "score": "0.61341864", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "ea88174f325293f13c2bfe05a1661bbc", "score": "0.61341864", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "ea88174f325293f13c2bfe05a1661bbc", "score": "0.61341864", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "ea88174f325293f13c2bfe05a1661bbc", "score": "0.61341864", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "ea88174f325293f13c2bfe05a1661bbc", "score": "0.61341864", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "ea88174f325293f13c2bfe05a1661bbc", "score": "0.61341864", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "cf0b728409052ad41e4afe9446cad36d", "score": "0.6131188", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\n\t if (!(Buffer.isBuffer(chunk)) &&\n\t typeof chunk !== 'string' &&\n\t chunk !== null &&\n\t chunk !== undefined &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "5256c01340d758f708df426835f062da", "score": "0.6114098", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n // Always throw error if a null is written\n // if we are not in object mode then throw\n // if it is not a buffer, string, or undefined.\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n nextTick(cb, er);\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "fdce429b96ef80ea9567789d0078ab00", "score": "0.6113485", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n // Always throw error if a null is written\n // if we are not in object mode then throw\n // if it is not a buffer, string, or undefined.\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n nextTick(cb, er);\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "fdce429b96ef80ea9567789d0078ab00", "score": "0.6113485", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n // Always throw error if a null is written\n // if we are not in object mode then throw\n // if it is not a buffer, string, or undefined.\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n nextTick(cb, er);\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "cae27fd619e3855326f2608b44d5323d", "score": "0.61096615", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true\n if (\n !util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode\n ) {\n var er = new TypeError('Invalid non-string/buffer chunk')\n stream.emit('error', er)\n process.nextTick(function() {\n cb(er)\n })\n valid = false\n }\n return valid\n }", "title": "" }, { "docid": "60a2af6de3fdcec1b53ef939dee74882", "score": "0.61073804", "text": "function isBuffer(obj){return obj!=null&&(!!obj._isBuffer||isFastBuffer(obj)||isSlowBuffer(obj));}", "title": "" }, { "docid": "60a2af6de3fdcec1b53ef939dee74882", "score": "0.61073804", "text": "function isBuffer(obj){return obj!=null&&(!!obj._isBuffer||isFastBuffer(obj)||isSlowBuffer(obj));}", "title": "" }, { "docid": "d82f7a2a7d6b6682783a3da9b5717917", "score": "0.609934", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t nextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "d82f7a2a7d6b6682783a3da9b5717917", "score": "0.609934", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t // Always throw error if a null is written\n\t // if we are not in object mode then throw\n\t // if it is not a buffer, string, or undefined.\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t nextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "7e6dd718db602d3a4bab9a27f2a8266a", "score": "0.60802484", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!Buffer.isBuffer(chunk) &&\n\t 'string' !== typeof chunk &&\n\t chunk !== null &&\n\t chunk !== undefined &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "7e6dd718db602d3a4bab9a27f2a8266a", "score": "0.60802484", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!Buffer.isBuffer(chunk) &&\n\t 'string' !== typeof chunk &&\n\t chunk !== null &&\n\t chunk !== undefined &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "7e6dd718db602d3a4bab9a27f2a8266a", "score": "0.60802484", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!Buffer.isBuffer(chunk) &&\n\t 'string' !== typeof chunk &&\n\t chunk !== null &&\n\t chunk !== undefined &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "7e6dd718db602d3a4bab9a27f2a8266a", "score": "0.60802484", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!Buffer.isBuffer(chunk) &&\n\t 'string' !== typeof chunk &&\n\t chunk !== null &&\n\t chunk !== undefined &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "7e6dd718db602d3a4bab9a27f2a8266a", "score": "0.60802484", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!Buffer.isBuffer(chunk) &&\n\t 'string' !== typeof chunk &&\n\t chunk !== null &&\n\t chunk !== undefined &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "7e6dd718db602d3a4bab9a27f2a8266a", "score": "0.60802484", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!Buffer.isBuffer(chunk) &&\n\t 'string' !== typeof chunk &&\n\t chunk !== null &&\n\t chunk !== undefined &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "7e6dd718db602d3a4bab9a27f2a8266a", "score": "0.60802484", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!Buffer.isBuffer(chunk) &&\n\t 'string' !== typeof chunk &&\n\t chunk !== null &&\n\t chunk !== undefined &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.60372716", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.60372716", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.60372716", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.60372716", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.60372716", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.60372716", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.60372716", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.60372716", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.60372716", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "12788055984d7491791e22c2f043a825", "score": "0.60351497", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "84f211404ebb75a1f040c3b2fea0fd52", "score": "0.6012909", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t pna.nextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "cb9c43deefa6f65e42f07a5f58857ab9", "score": "0.60102814", "text": "function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n\t if (!isBuf) {\n\t var newChunk = decodeChunk(state, chunk, encoding);\n\t if (chunk !== newChunk) {\n\t isBuf = true;\n\t encoding = 'buffer';\n\t chunk = newChunk;\n\t }\n\t }\n\t var len = state.objectMode ? 1 : chunk.length;\n\t\n\t state.length += len;\n\t\n\t var ret = state.length < state.highWaterMark;\n\t // we must ensure that previous needDrain will not be reset to false.\n\t if (!ret) state.needDrain = true;\n\t\n\t if (state.writing || state.corked) {\n\t var last = state.lastBufferedRequest;\n\t state.lastBufferedRequest = {\n\t chunk: chunk,\n\t encoding: encoding,\n\t isBuf: isBuf,\n\t callback: cb,\n\t next: null\n\t };\n\t if (last) {\n\t last.next = state.lastBufferedRequest;\n\t } else {\n\t state.bufferedRequest = state.lastBufferedRequest;\n\t }\n\t state.bufferedRequestCount += 1;\n\t } else {\n\t doWrite(stream, state, false, len, chunk, encoding, cb);\n\t }\n\t\n\t return ret;\n\t}", "title": "" }, { "docid": "cb9c43deefa6f65e42f07a5f58857ab9", "score": "0.60102814", "text": "function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n\t if (!isBuf) {\n\t var newChunk = decodeChunk(state, chunk, encoding);\n\t if (chunk !== newChunk) {\n\t isBuf = true;\n\t encoding = 'buffer';\n\t chunk = newChunk;\n\t }\n\t }\n\t var len = state.objectMode ? 1 : chunk.length;\n\t\n\t state.length += len;\n\t\n\t var ret = state.length < state.highWaterMark;\n\t // we must ensure that previous needDrain will not be reset to false.\n\t if (!ret) state.needDrain = true;\n\t\n\t if (state.writing || state.corked) {\n\t var last = state.lastBufferedRequest;\n\t state.lastBufferedRequest = {\n\t chunk: chunk,\n\t encoding: encoding,\n\t isBuf: isBuf,\n\t callback: cb,\n\t next: null\n\t };\n\t if (last) {\n\t last.next = state.lastBufferedRequest;\n\t } else {\n\t state.bufferedRequest = state.lastBufferedRequest;\n\t }\n\t state.bufferedRequestCount += 1;\n\t } else {\n\t doWrite(stream, state, false, len, chunk, encoding, cb);\n\t }\n\t\n\t return ret;\n\t}", "title": "" }, { "docid": "cb9c43deefa6f65e42f07a5f58857ab9", "score": "0.60102814", "text": "function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n\t if (!isBuf) {\n\t var newChunk = decodeChunk(state, chunk, encoding);\n\t if (chunk !== newChunk) {\n\t isBuf = true;\n\t encoding = 'buffer';\n\t chunk = newChunk;\n\t }\n\t }\n\t var len = state.objectMode ? 1 : chunk.length;\n\t\n\t state.length += len;\n\t\n\t var ret = state.length < state.highWaterMark;\n\t // we must ensure that previous needDrain will not be reset to false.\n\t if (!ret) state.needDrain = true;\n\t\n\t if (state.writing || state.corked) {\n\t var last = state.lastBufferedRequest;\n\t state.lastBufferedRequest = {\n\t chunk: chunk,\n\t encoding: encoding,\n\t isBuf: isBuf,\n\t callback: cb,\n\t next: null\n\t };\n\t if (last) {\n\t last.next = state.lastBufferedRequest;\n\t } else {\n\t state.bufferedRequest = state.lastBufferedRequest;\n\t }\n\t state.bufferedRequestCount += 1;\n\t } else {\n\t doWrite(stream, state, false, len, chunk, encoding, cb);\n\t }\n\t\n\t return ret;\n\t}", "title": "" }, { "docid": "cb9c43deefa6f65e42f07a5f58857ab9", "score": "0.60102814", "text": "function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n\t if (!isBuf) {\n\t var newChunk = decodeChunk(state, chunk, encoding);\n\t if (chunk !== newChunk) {\n\t isBuf = true;\n\t encoding = 'buffer';\n\t chunk = newChunk;\n\t }\n\t }\n\t var len = state.objectMode ? 1 : chunk.length;\n\t\n\t state.length += len;\n\t\n\t var ret = state.length < state.highWaterMark;\n\t // we must ensure that previous needDrain will not be reset to false.\n\t if (!ret) state.needDrain = true;\n\t\n\t if (state.writing || state.corked) {\n\t var last = state.lastBufferedRequest;\n\t state.lastBufferedRequest = {\n\t chunk: chunk,\n\t encoding: encoding,\n\t isBuf: isBuf,\n\t callback: cb,\n\t next: null\n\t };\n\t if (last) {\n\t last.next = state.lastBufferedRequest;\n\t } else {\n\t state.bufferedRequest = state.lastBufferedRequest;\n\t }\n\t state.bufferedRequestCount += 1;\n\t } else {\n\t doWrite(stream, state, false, len, chunk, encoding, cb);\n\t }\n\t\n\t return ret;\n\t}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "1f6ad1bdcc85a003da25bb0c6ec6585c", "score": "0.600924", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" } ]
a17c8560f648dc24b877f5df93d58643
ENTERTAIN SELECTS USE LATER MAYBE
[ { "docid": "02b8835d4f59cbcea71b0cc9d01fd424", "score": "0.0", "text": "function generateEntertainSelect() {\n for (i = 0; i < categoriesforFun.length; i++) {\n var optionID = \"entertainType\" + categoriesforFun[i];\n var options = document.createElement(\"OPTION\");\n options.id = optionID;\n\n options.innerHTML = categoriesforFun[i];\n entertainSelects.append(options);\n }\n document.getElementById('dropdownentertainselect').onchange = function () {\n entertainChoice = this.value;\n searchFunSelected = true;\n buttonEnableDisable();\n }\n }", "title": "" } ]
[ { "docid": "406d97c9b4e8e862e1d402e79fde31e7", "score": "0.57197654", "text": "select(sql, params) {\n const deferred = q.defer();\n // eslint-disable-next-line consistent-return\n this.db.all(sql, params, (err, rows) => {\n if (err) {\n return deferred.reject(err.message);\n }\n deferred.resolve(rows);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "b78683a30053bc488b794b6ed70c0660", "score": "0.5549521", "text": "select(sql, values = {}) {\n return this.query(sql, values).then(results => results.rows)\n }", "title": "" }, { "docid": "e2e5fa98c536b03a29d1e1b24bed1c58", "score": "0.5234798", "text": "async selectEspecific(query) {\n const data = await new Promise((resolve, reject) => {\n db.all(`SELECT * FROM ${this.tableName} WHERE ${query};`, (err, rows) => {\n if (err) {\n reject(err);\n }\n\n resolve(rows);\n });\n });\n\n return data[0];\n }", "title": "" }, { "docid": "988bfb0cd3a854dcf33800de08ec8a85", "score": "0.4999406", "text": "function selectUniqueTuple(query,cb) {\n \n db.findOne(query,cb);\n \n}", "title": "" }, { "docid": "1c3898cf15162a812ac6e3b4e9cd7e4d", "score": "0.49944967", "text": "select() {}", "title": "" }, { "docid": "43720d4ad16837443206471943a08860", "score": "0.49788854", "text": "_query(connection, obj) {\n if (!obj.sql) throw new Error('The query is empty');\n\n const options = { autoCommit: false };\n if (obj.method === 'select') {\n options.resultSet = true;\n }\n return connection\n .executeAsync(obj.sql, obj.bindings, options)\n .then(async function (response) {\n // Flatten outBinds\n let outBinds = flatten(response.outBinds);\n obj.response = response.rows || [];\n obj.rowsAffected = response.rows\n ? response.rows.rowsAffected\n : response.rowsAffected;\n\n //added for outBind parameter\n if (obj.method === 'raw' && outBinds.length > 0) {\n return {\n response: outBinds,\n };\n }\n\n if (obj.method === 'update') {\n const modifiedRowsCount = obj.rowsAffected.length || obj.rowsAffected;\n const updatedObjOutBinding = [];\n const updatedOutBinds = [];\n const updateOutBinds = (i) =>\n function (value, index) {\n const OutBindsOffset = index * modifiedRowsCount;\n updatedOutBinds.push(outBinds[i + OutBindsOffset]);\n };\n\n for (let i = 0; i < modifiedRowsCount; i++) {\n updatedObjOutBinding.push(obj.outBinding[0]);\n each(obj.outBinding[0], updateOutBinds(i));\n }\n outBinds = updatedOutBinds;\n obj.outBinding = updatedObjOutBinding;\n }\n\n if (!obj.returning && outBinds.length === 0) {\n if (!connection.isTransaction) {\n await connection.commitAsync();\n }\n return obj;\n }\n const rowIds = [];\n let offset = 0;\n\n for (let line = 0; line < obj.outBinding.length; line++) {\n const ret = obj.outBinding[line];\n\n offset =\n offset +\n (obj.outBinding[line - 1] ? obj.outBinding[line - 1].length : 0);\n\n for (let index = 0; index < ret.length; index++) {\n const out = ret[index];\n\n await new Promise(function (bindResolver, bindRejecter) {\n if (out instanceof BlobHelper) {\n const blob = outBinds[index + offset];\n if (out.returning) {\n obj.response[line] = obj.response[line] || {};\n obj.response[line][out.columnName] = out.value;\n }\n blob.on('error', function (err) {\n bindRejecter(err);\n });\n blob.on('finish', function () {\n bindResolver();\n });\n blob.write(out.value);\n blob.end();\n } else if (obj.outBinding[line][index] === 'ROWID') {\n rowIds.push(outBinds[index + offset]);\n bindResolver();\n } else {\n obj.response[line] = obj.response[line] || {};\n obj.response[line][out] = outBinds[index + offset];\n bindResolver();\n }\n });\n }\n }\n if (connection.isTransaction) {\n return obj;\n }\n await connection.commitAsync();\n if (obj.returningSql) {\n const response = await connection.executeAsync(\n obj.returningSql(),\n rowIds,\n { resultSet: true }\n );\n obj.response = response.rows;\n }\n return obj;\n });\n }", "title": "" }, { "docid": "75dc23a2bb4386cb786c0e5b603c802c", "score": "0.4965879", "text": "async _processRows(rows, expandNestedCursors) {\n\n // transform any nested cursors into user facing objects\n for (const i of this._impl.nestedCursorIndices) {\n for (let j = 0; j < rows.length; j++) {\n const val = rows[j][i];\n if (val) {\n const resultSet = new ResultSet();\n resultSet._setup(this._connection, val);\n this._impl.metaData[i].metaData = val.metaData;\n if (expandNestedCursors) {\n rows[j][i] = await resultSet._getAllRows();\n } else {\n rows[j][i] = resultSet;\n }\n }\n }\n }\n\n // transform any LOBs into user facing objects\n for (const i of this._impl.lobIndices) {\n for (let j = 0; j < rows.length; j++) {\n const val = rows[j][i];\n if (val) {\n const lob = rows[j][i] = new Lob();\n lob._setup(val, true);\n }\n }\n }\n\n // transform any database objects into user facing objects\n for (const i of this._impl.dbObjectIndices) {\n const dbObjectClass = this._impl.metaData[i].dbTypeClass;\n for (let j = 0; j < rows.length; j++) {\n const val = rows[j][i];\n if (val) {\n const obj = rows[j][i] = Object.create(dbObjectClass.prototype);\n obj._impl = val;\n if (this._impl.dbObjectAsPojo) {\n rows[j][i] = obj._toPojo();\n } else if (obj.isCollection) {\n rows[j][i] = new Proxy(obj, BaseDbObject._collectionProxyHandler);\n }\n }\n }\n }\n\n // run any conversion functions, if applicable\n // NOTE: we mark the connection as no longer in progress before making\n // calls to the converter function; this is needed to allow calls against\n // the database (like getting LOB data) to succeed, as this code is running\n // in the middle of a call to connection.execute() or resultSet.getRows()\n for (const i of this._impl.converterIndices) {\n const fn = this._impl.metaData[i].converter;\n this._connection._impl._inProgress = false;\n try {\n for (let j = 0; j < rows.length; j++) {\n let result = fn(rows[j][i]);\n if (result instanceof Promise) {\n result = await result;\n }\n rows[j][i] = result;\n }\n } finally {\n this._connection._impl._inProgress = true;\n }\n }\n\n // create objects, if desired\n if (this._impl.outFormat === constants.OUT_FORMAT_OBJECT) {\n for (let i = 0; i < rows.length; i++) {\n const origRow = rows[i];\n const newRow = rows[i] = {};\n const metaData = this._impl.metaData;\n for (let j = 0; j < metaData.length; j++) {\n newRow[metaData[j].name] = origRow[j];\n }\n }\n }\n\n }", "title": "" }, { "docid": "18031dcc345ee1cc6f64a818ca6bb058", "score": "0.49401712", "text": "queryAll() {\n\t\tvar promise = new Promise((resolve, reject) => { // LIMIT 0, 500\n\t\t\tthis.db.all(\"SELECT _id, title, category, modified FROM markdown WHERE category is NULL ORDER BY title\", function(err, row) {\n\t\t\t\tif (err) {\n\t\t\t\t\treject(err)\n\t\t\t\t} else {\n\t\t\t\t\tresolve(row)\n\t\t\t\t}\n\t\t\t})\n\n\t\t})\n\t\treturn promise;\n\t}", "title": "" }, { "docid": "46f3c94e9c9c421777e685a15f5194ed", "score": "0.488387", "text": "query(originalSql, values = {}) {\n return new Promise((res, rej) => {\n\n // Apply Middleware\n let finalSql = this.applyMiddlewareOnBeforeQuery(originalSql, values)\n\n // Bind dynamic values to SQL\n finalSql = this.queryBindValues(finalSql, values).trim()\n\n this.connection.query(finalSql, (err, results, fields) => {\n if (err) {\n rej({err, sql: finalSql})\n } else {\n\n // Apply Middleware\n results = this.applyMiddlewareOnResults(originalSql, results)\n\n // If sql is SELECT\n if (this.isSelect(finalSql)) {\n\n // Results is the rows\n res({ rows: results, fields, sql: finalSql})\n\n } else {\n res({ ...results, sql: finalSql })\n }\n\n }\n })\n })\n }", "title": "" }, { "docid": "fcdcac9681402533b29f4fdb8b830759", "score": "0.48790526", "text": "selectById() {\n var stmt = ['select * from', this.tablename, 'where id = ?'].join(' ');\n stmt = this.addOrderCmd(stmt);\n return Model.execute(stmt, this.fValues['id']).then(result => {\n if (result instanceof Array && result.length == 1) {\n return Promise.resolve(result[0]);\n }\n else\n return Promise.resolve(null);\n })\n .catch(err => Promise.reject(err));\n }", "title": "" }, { "docid": "3f53ead5610a16da1ebf6941877a1a92", "score": "0.4869102", "text": "select(category, query) {\n return new PostgresCursor(this, { category }).select(query);\n }", "title": "" }, { "docid": "2ca71b23f6387bc69ca9d82673a524a5", "score": "0.48556134", "text": "findAll() {\n return this.knex.select(this.selectableProps)\n .from(this.tableName)\n .limit(10) // defalut limit should be changed.\n .timeout(this.timeout, {cancle: true});\n }", "title": "" }, { "docid": "6e87529f5e8020053d8d968302c1f1c0", "score": "0.48492402", "text": "someByFunction(fn) {\n const rows = this.db\n .prepare(`SELECT key, value FROM '${this.name}' WHERE path = '::NULL::';`)\n .all();\n return rows\n .map((row) => [row.key, this.parseData(row.value)])\n .some(([key, value], _, array) => fn(value, key, array));\n }", "title": "" }, { "docid": "8e3eabffd9f9b85c998e4d5093ea0350", "score": "0.48398662", "text": "function selectAllActiveAlerts() {\n let queryText = `SELECT alerts.id, alerts.name AS alert, station_id, route_id, direction, when_to_alert, phone, stations.name AS station, routes.name AS route FROM alerts \n JOIN stops ON alerts.stop_id = stops.id\n JOIN person ON alerts.user_id = person.id\n JOIN stations ON stops.station_id = stations.identifier\n JOIN routes ON alerts.route = routes.id\n WHERE active=true;`;\n pool.query(queryText)\n .then(response => {\n activeAlerts = response.rows;\n }).catch(err => {\n console.log({err});\n })\n}", "title": "" }, { "docid": "79428c352e50531f5c281e24d40f7f36", "score": "0.48296604", "text": "async getAllBenevoles() {\n var temp = null;\n const client = await this.pool.connect();\n await client\n .query(\"SELECT * FROM Users WHERE status = 'B' OR status = 'A'\")\n .then(res => {\n temp = res.rows;\n })\n .catch(err => {\n temp = err.stack;\n console.log(err.stack);\n });\n client.release();\n return temp;\n }", "title": "" }, { "docid": "3092c9b83422c5167462e28d52780322", "score": "0.48229444", "text": "_executeQuery(db, sql) {\n return new Promise((resolve, reject) => {\n db.all(sql, [], (err, rows) => {\n if (err) {\n //db.close();\n resolve({\n success: false,\n error: err.message\n });\n }\n //db.close();\n resolve({\n success: true,\n rows\n }); \n });\n });\n }", "title": "" }, { "docid": "cfea27d917c233c39d7a42f4e7481374", "score": "0.4811582", "text": "static async rewriteSelect(query, logicalName) {\n if (query.select) {\n const entityAttributes = await this.getEntityAttributes(logicalName),\n clone = query.select.slice();\n for (const attribute of clone) {\n const entityAttribute = entityAttributes[attribute],\n AttributeType = entityAttribute && entityAttribute.AttributeType;\n if (AttributeType === \"Lookup\") {\n const entityMetadata = await Metadata.getEntityDefinitions(entityAttribute.Targets[0]),\n index = query.select.indexOf(attribute);\n query.select.splice(index, 1);\n if (!query.expand) {\n query.expand = [];\n }\n query.expand.push({\n attribute: attribute,\n select: [entityMetadata.PrimaryIdAttribute, entityMetadata.PrimaryNameAttribute]\n });\n } else if (!AttributeType) {\n throw(`Unexisting select field found: ${attribute}`);\n }\n }\n }\n }", "title": "" }, { "docid": "098e9d4a41b8b5a3951397f2170b78e4", "score": "0.48046064", "text": "enterSelect_only_statement(ctx) {\n\t}", "title": "" }, { "docid": "bb71ede74376c58e6acbae061ea72cde", "score": "0.4784317", "text": "selectAll(table = this.table, columns = '*') {\n // const query = 'SELECT ?? FROM ??';\n const query = 'SELECT id, burger_name, devoured FROM burgers';\n \n return new Promise((resolve, reject) => {\n // this.conn.query(query, [columns, table], (error, result) => {\n this.conn.query(query, (error, result) => {\n if (error) reject(error);\n resolve(result);\n });\n });\n }", "title": "" }, { "docid": "e33c75fb5708056e1cd4319b946939f6", "score": "0.47839537", "text": "select() {\n // basic select all statement\n let stmt = ['select * from', this.tablename].join(' ');\n // add where clause\n let wclause = [];\n let wValues = [];\n for (let f in this.whereArr) {\n if (f in this.likeArr) {\n wclause.push(f + \" like ?\");\n // apply wildcards\n if (this.likeArr[f])\n wValues.push('%' + this.whereArr[f] + '%');\n else // NO wildcards\n wValues.push(this.whereArr[f]);\n }\n else if (this.whereArr[f] && this.whereArr[f].hasOwnProperty(\"in\")) {\n // in clause\n // check if array was provided as the value:\n if (this.whereArr[f][\"in\"].constructor != Array) {\n let error = \"wrong value for in clause\";\n return Promise.reject(error);\n }\n if (this.whereArr[f][\"in\"].length > 0) {\n let placeholders = Array(this.whereArr[f][\"in\"].length).fill('?');\n wclause.push(f + \" in (\" + placeholders + \")\");\n for (let key in this.whereArr[f][\"in\"])\n wValues.push(this.whereArr[f][\"in\"][key]);\n }\n }\n else {\n wclause.push(f + \" = ?\");\n wValues.push(this.whereArr[f]);\n }\n }\n if (wclause.length > 0)\n stmt = stmt + ' where ' + wclause.join(' and ');\n stmt = this.addOrderCmd(stmt);\n return Model.execute(stmt, wValues);\n }", "title": "" }, { "docid": "0764587f149cc59c6f8c7f27cf2c22d6", "score": "0.4770095", "text": "function dbRunSELECT(sql, params) {\r\n return new Promise(function (resolve, reject) {\r\n logger.trace(\"dbRunSELECT():\\n\" + sql + (params ? (\"\\n\" + JSON.stringify(params, null, 4)) : \"\"));\r\n\r\n db.all(sql, params, function (err, rows) {\r\n if (err) {\r\n reject(err);\r\n } else {\r\n resolve(rows);\r\n }\r\n })\r\n })\r\n}", "title": "" }, { "docid": "dc9f2e8df6418d9d95644244df4b8894", "score": "0.47657865", "text": "_isSelectQuery() {\n return includes(['pluck', 'first', 'select'], this._method);\n }", "title": "" }, { "docid": "08e486b4049beb3e2226da1c30e9cdda", "score": "0.475999", "text": "async function query() {\n const criteria = {};\n try {\n const collection = await dbService.getCollection('toy');\n var toys = await collection.find(criteria).toArray();\n toys = toys.map(toy => {\n toy.createdAt = ObjectId(toy._id).getTimestamp();\n return toy;\n })\n return toys;\n\n } catch (err) {\n console.log('cannot find toys');\n throw err;\n }\n}", "title": "" }, { "docid": "12944806cc9ef08337631447f8d995e8", "score": "0.47550583", "text": "function getSQLData(sqls, cb) { \n //console.log(\"sqls :\"+sqls);\n var resultsets;\n dbconnection.getConnection(function(err, connection) {\n connection.query(sqls, function(err, res1){\n connection.release(); \n if(res1.length >0){\n resultsets=res1;\n }else{\n resultsets={};\n }\n cb(resultsets); //callback if all queries are processed\n });\n }); \n }", "title": "" }, { "docid": "4b219f72cf8b5ee72d55353ef9c9aea2", "score": "0.47500876", "text": "select(storeName, filter) {\n this.checkSupport();\n\n let res = [];\n\n return this.dbPromise.then(db => {\n let trans = db.transaction(storeName, 'readonly');\n let store = trans.objectStore(storeName);\n\n return store.openCursor();\n }).then(function loadItems(cursor) {\n if (!cursor) {\n return;\n }\n\n if (filter(cursor.value)) {\n res.push(cursor.value);\n }\n\n return cursor.continue().then(loadItems);\n }).then(() => res);\n }", "title": "" }, { "docid": "db454983e08e7fb8f960b29c0178a4a7", "score": "0.4748446", "text": "async select(database, table, where, columns, orders, limit=20, offset=0) {\n const db = this.app.mysql.get(database)\n const rows = await db.select(table, {\n where: where, columns: columns, orders: orders, limit: limit, offset: offset, \n })\n const count = await db.count(table, where)\n return { rows, count }\n }", "title": "" }, { "docid": "c163c6ee58d27eb8670e31b4f21f5219", "score": "0.47463098", "text": "function subquerySS() {\r\n if (dataset) {\r\n return this.select('D2.idCombo_Design as comboId', 'idSample', 'bliss', 'loewe', 'hsa', 'zip', 'comboscore', 'sampleName', 'drugNameA', 'drugNameB', 'tissue', 'idSource as sourceId', 'idDrugA', 'idDrugB', 'idCellosaurus', 'sex', 'age', 'disease', 'origin', 'atCodeDrugA', 'idDrugBankA', 'idPubChemDrugA', 'atCodeDrugB', 'idDrugBankB', 'idPubChemDrugB', 'smilesDrugA', 'inchikeyDrugA', 'smilesDrugB', 'inchikeyDrugB')\r\n .from(subqueryD2)\r\n .join('Synergy_Score', 'D2.idCombo_Design', '=', 'Synergy_Score.idCombo_Design')\r\n .where({ idSource: dataset })\r\n .as('SS');\r\n }\r\n return this.select('D2.idCombo_Design as comboId', 'idSample', 'bliss', 'loewe', 'hsa', 'zip', 'comboscore', 'sampleName', 'drugNameA', 'drugNameB', 'tissue', 'idSource as sourceId', 'idDrugA', 'idDrugB', 'idCellosaurus', 'sex', 'age', 'disease', 'origin', 'atCodeDrugA', 'idDrugBankA', 'idPubChemDrugA', 'atCodeDrugB', 'idDrugBankB', 'idPubChemDrugB', 'smilesDrugA', 'inchikeyDrugA', 'smilesDrugB', 'inchikeyDrugB')\r\n .from(subqueryD2)\r\n .join('Synergy_Score', 'D2.idCombo_Design', '=', 'Synergy_Score.idCombo_Design')\r\n .as('SS');\r\n }", "title": "" }, { "docid": "fcc6db35591adb7b143474f8e03b416b", "score": "0.47392908", "text": "function makeSqlRequest(res) {\n let sqlRequest = new sql.Request(); //sqlRequest: oggetto che serve a eseguire le query\n let q = 'SELECT DISTINCT TOP (100) [GEOM].STAsText() FROM [Katmai].[dbo].[interventiMilano]';\n //eseguo la query e aspetto il risultato nella callback\n sqlRequest.query(q, (err, result) => {sendQueryResults(err,result,res)}); \n}", "title": "" }, { "docid": "d0425a0a620a12a96f4ed646be7b50fb", "score": "0.47353527", "text": "_executeSelect(query, paramsGetter, doc, docInfo, executionOptions, cacheItem) {\n const options = DocInfoAdapter.adaptAllOptions(executionOptions, true);\n\n return this._client.execute(query, paramsGetter(doc, docInfo, this.info), options)\n .then(rs => {\n if (cacheItem.resultAdapter === null) {\n cacheItem.resultAdapter = ResultMapper.getSelectAdapter(this.info, rs);\n }\n return new Result(rs, this.info, cacheItem.resultAdapter);\n });\n }", "title": "" }, { "docid": "434cd38472eb2c1ab39b7a37d01b6e72", "score": "0.47268453", "text": "static async getAllPayGradeLevel(){\n const payGrade=await pool4.query(`\n select paygrade_level from pay_grade `)\n return payGrade.rows;\n}", "title": "" }, { "docid": "82b2ce1ba9e064c28bee998a677c0d37", "score": "0.47241393", "text": "static items(id) {\n return db.any(`SELECT I.id as id, S.id as store_id, I.item as item, I.quantity as quantity, I.comments as comments, I.checked as checked from items as I\n INNER JOIN stores as S \n ON I.store_id = S.id\n where S.id = $1`, [id])\n\n \n\n\n //and transform them to review objects\n .then((arrayOfItems) => {\n //convert each array element into a Review instance\n const arrayOfItemsInstances = [];\n //manually mapping\n arrayOfItems.forEach((data) => {\n // console.log(\"Data Item from SQL__________________-\");\n // console.log(data);\n const itemsInstance = new Item (data.id, data.store_id, data.item, data.quantity, data.comments, data.checked);\n arrayOfItemsInstances.push(itemsInstance);\n });\n // console.log(arrayOfItemsInstances);\n if (arrayOfItems) {\n\n return arrayOfItemsInstances;\n }\n else {\n const dummy = new Item (999,999,'create list item below',\"\",0);\n arrayOfItemsInstances.push(dummy);\n return arrayOfItemsInstances;\n }\n });\n //what happens when there are NO results??\n}", "title": "" }, { "docid": "0fb14faf35089ab762e5e18a94cc3ebb", "score": "0.47159725", "text": "function findSome(currentCounter, callback) {\n availableDateModel.find({}, callback).where('id').gt(currentCounter).limit(50).sort({ id: 1 });\n}", "title": "" }, { "docid": "37e9345384324467cd1eddcb8b2373be", "score": "0.4711369", "text": "function selectResult()\n{\n _selectResult(this);\n}", "title": "" }, { "docid": "f51dca161b518cfc429d6a63a58e8cea", "score": "0.4704816", "text": "then(callback) {\n return this.executeQuery().then(callback);\n }", "title": "" }, { "docid": "ad88b7dd78ba9a20118f1b448eaa59ff", "score": "0.46913067", "text": "correctedShowAll(id){\n return db.many(`\n SELECT *\n FROM reference\n JOIN articles ON article_id=id\n WHERE user_id = $1\n `, id);\n }", "title": "" }, { "docid": "390852c45beaf9aee929876d58e51de8", "score": "0.46892878", "text": "function getNewNY(req, res) {\n\n connection.then((con) => {\n const sql = `WITH Temp AS (select books.*\n from books\n inner join nytimesseller\n on books.isbn = nytimesseller.isbn\n where nytimesseller.rank_last_week = 0 \n and nytimesseller.rank != 0 \n and books.publication_date is not null\n order by books.publication_date DESC) \n SELECT DISTINCT(Temp.isbn) as isbn, Temp.title, Temp.img_url, Temp.description, Temp.url, Temp.publisher, Temp.publication_place, Temp.publication_date, Temp.rating, Temp.num_pages, Temp.lang\n FROM Temp\n WHERE ROWNUM<=19`;\n con.execute(sql).then((response) => {\n console.log(response);\n res.json(response);\n })\n });\n}", "title": "" }, { "docid": "e8b323628bd9df59480028be2493327f", "score": "0.468592", "text": "findAll(){\n return db.many(`\n SELECT *\n FROM cats\n ORDER BY id\n `);\n }", "title": "" }, { "docid": "003e2c0af9faef5b129ab601595177d4", "score": "0.4672079", "text": "_retrieveMulti(keys) {\n if (!keys.length) {\n return Object(of[\"a\" /* of */])([]);\n }\n\n const queryCall = this.hasSubscriptions ? this._rpcCore.state.subscribeStorage : this._rpcCore.state.queryStorageAt;\n return Object(combineLatest[\"a\" /* combineLatest */])(arrayChunk(keys, PAGE_SIZE_V).map(keys => queryCall(keys))).pipe(Object(operators_map[\"a\" /* map */])(flatten_arrayFlatten));\n }", "title": "" }, { "docid": "70fcddebbcd46b6ffceaee1add6f2176", "score": "0.46622908", "text": "function SingleSelectWhere(tableName : String, itemToSelect : String, wCol : String, wPar : String, wValue : String){ // Selects a single Item\n var query : String;\n query = \"SELECT \" + itemToSelect + \" FROM \" + tableName + \" WHERE \" + wCol + wPar + wValue;\t\n dbcmd = dbcon.CreateCommand();\n dbcmd.CommandText = query; \n reader = dbcmd.ExecuteReader();\n var readArray = new Array();\n while(reader.Read()){ \n readArray.Push(reader.GetString(0)); // Fill array with all matches\n }\n return readArray; // return matches\n }", "title": "" }, { "docid": "b2b1135f344f045f6ba496ae2669a29f", "score": "0.46592027", "text": "function getStudentSpecific(res, db, context, complete){\n var sql = `SELECT student.student_id, student.first_name, student.last_name, \n enrollment_type.type, student.enrollment_qtr, student.enrollment_year FROM student LEFT JOIN \n enrollment_type ON enrollment_type.enrollment_id = student.enrollment_type \n WHERE student.student_id = ?`;\n var inserts = [context.student_id];\n db.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.students = results;\n complete();\n });\n }", "title": "" }, { "docid": "4b3d49959dc2d3c3acb551d4f74e6d6f", "score": "0.46582723", "text": "function selectExercises(query, cb) {\n const sqlAll = 'SELECT * FROM leftjoin WHERE userId = $userId';\n const sqlFrom =\n 'SELECT * FROM leftjoin WHERE userId = $userId AND date >= $from';\n const sqlTo = 'SELECT * FROM leftjoin WHERE userId = $userId AND date <= $to';\n const sqlFromTo =\n 'SELECT * FROM leftjoin WHERE userId = $userId AND date BETWEEN $from AND $to';\n const sqlLimit = ' LIMIT $limit';\n\n const values = {};\n let sql = '';\n\n // Create values obj for db query and choose sql statement\n values.$userId = query.userId;\n if (query.from && query.to) {\n sql = sqlFromTo;\n values.$from = query.from;\n values.$to = query.to;\n } else if (query.from) {\n sql = sqlFrom;\n values.$from = query.from;\n } else if (query.to) {\n sql = sqlTo;\n values.$to = query.to;\n } else {\n sql = sqlAll;\n }\n\n // Append limit to end of sql if present in query\n if (query.limit) {\n values.$limit = query.limit;\n sql = sql.concat(sqlLimit);\n }\n\n db.all(sql, values, (err, rows) => {\n if (err) throw err;\n const userEx = {\n _id: rows[0].userId,\n username: rows[0].name,\n count: rows.length,\n log: rows.map(el => {\n return {\n description: el.description,\n duration: el.duration,\n date: el.date\n };\n })\n };\n cb(userEx);\n });\n}", "title": "" }, { "docid": "bc6864e1e1f4ea1d01933d6824df5177", "score": "0.46571288", "text": "async function find(context) {\n let query = baseQuery;\n const binds = {};\n \n if (context.id) {\n binds.emp_id = context.id;\n \n query = ` \nSelect table1.YR_qtr as \"qtr\", table1.E_score as \"own_avg\", table2.notE_score as \"all_avg\"\nFrom\n(SELECT YR_qtr, round(avg(ins_score),2) as E_score\nFROM\n(SELECT CONCAT(YR,QTR)as YR_qtr, ins_score\nFROM\n(SELECT CONCAT('Q',TO_CHAR(To_date(ins_activity_date), 'Q')) AS QTR, ins_score, CONCAT(TO_CHAR(To_date(ins_activity_date), 'YY'),' ') AS YR\nFROM inspection\nwhere emp_ID = :emp_id))\nGROUP by YR_qtr)table1\ninner join \n(SELECT YR_qtr, round(avg(ins_score),2) as notE_score\nFROM\n(SELECT CONCAT(YR,QTR)as YR_qtr, ins_score\nFROM\n(SELECT CONCAT('Q',TO_CHAR(To_date(ins_activity_date), 'Q')) AS QTR, ins_score, CONCAT(TO_CHAR(To_date(ins_activity_date), 'YY'),' ') AS YR\nFROM inspection\nwhere emp_ID <> :emp_id))\nGROUP by YR_qtr)table2 on table2.YR_qtr = table1.YR_qtr\norder by table1.YR_qtr\n`;\n\t\n }\n \n const result = await database.simpleExecute(query, binds);\n \n return result.rows;\n}", "title": "" }, { "docid": "adb413d7d14a9b05ba0a69983b644f9c", "score": "0.46566445", "text": "first() {\n\treturn this.length <= 1 ? this : select([this[0]], this);\n}", "title": "" }, { "docid": "fd8972f5d61381c0559c152d8fe1042d", "score": "0.4647698", "text": "getTransactions(primeid, dateFrom, dateTo, all_txn, aCallback) {\r\n var sqlStmt;\r\n if (dateFrom.length > 0 && dateTo.length > 0) {\r\n sqlStmt = \"Select tl.name as transaction_name, t.amount, t.service_fee_paid, \" +\r\n \"t.amount_net, tl.txn_form_date as transaction_date, t.summary, \" +\r\n \"tt.category, tt.subcategory, tt.line_item, \" +\r\n \"t.entity_id as transaction_id, t.bank_transaction_ref, tl.link_id \" +\r\n \"from banc_db.transaction t, banc_db.transaction_link tl, banc_db.transaction_type tt where \" +\r\n \"tl.entity2_id = t.entity_id and t.transaction_type_id=tt.type_id and tl.entity1_id =\" + primeid.toString() +\r\n \" and tl.txn_form_date between \" + dateFrom + \" and \" + dateTo + \";\";\r\n } else {\r\n sqlStmt = \"Select tl.name as transaction_name, t.amount, t.service_fee_paid, \" +\r\n \"t.amount_net, tl.txn_form_date as transaction_date, t.summary, \" +\r\n \"tt.category, tt.subcategory, tt.line_item, \" +\r\n \"t.entity_id as transaction_id, t.bank_transaction_ref, tl.link_id \" +\r\n \"from banc_db.transaction t, banc_db.transaction_link tl, banc_db.transaction_type tt where \" +\r\n \"tl.entity2_id = t.entity_id and t.transaction_type_id=tt.type_id and tl.entity1_id =\" + primeid.toString() + \";\";\r\n }\r\n console.log(sqlStmt);\r\n const useDb = new aSimplePgClient(this.config, this.verbose);\r\n const aPromise = useDb.callQuery(sqlStmt, null)\r\n .then(result => {\r\n aCallback(result);\r\n useDb.close();\r\n return;\r\n });\r\n }", "title": "" }, { "docid": "62694b3fc595a8a76cc90345fb1258d8", "score": "0.4641774", "text": "loadItems(index, rows, query, model){\n return new Promise((resolve, reject) => {\n setTimeout(()=>{\n console.log(index, index+rows);\n var data=models[model]['data'];\n var obj={\n items:[],\n totalRecords:0\n }\n if(query===false){\n obj.items=data.slice(index, index+rows);\n obj.totalRecords=data.length;\n\n }else{\n var filtered=[];\n var q;\n for(var i = 0; i < query.length; i++){\n q=query[i];\n console.log(q);\n console.log(data);\n data=data.filter((row)=>{\n\n if(q.value===''){\n return true;\n }else{\n if(q.operator===''){\n return row[q.field].toLowerCase().indexOf(q.value) >-1;\n }else if(q.operator === '==='){\n return row[q.field] === q.value;\n }else if(q.operator === '>='){\n return row[q.field] >= q.value;\n }else if(q.operator === '<='){\n return row[q.field] <= q.value;\n }\n }\n });\n }\n obj.items=data.slice(index, index+rows);\n obj.totalRecords=data.length;\n }\n resolve(obj);\n }, 500);\n });\n }", "title": "" }, { "docid": "7ed54c52e18b1aa2e2a2bded2abf1b6d", "score": "0.4628886", "text": "function getStudent_ClassFilter(res, db, context, complete){\n var sql = `SELECT student.first_name, student.last_name, student_class.class_id, class.class_name \n FROM student \n LEFT JOIN student_class ON student_class.student_id = student.student_id\n LEFT JOIN class ON class.class_id = student_class.class_id\n WHERE student_class.class_id = ?`;\n var inserts = [context.class_id];\n db.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.student_classes = results;\n complete();\n });\n }", "title": "" }, { "docid": "5f3058915901d82f3e05d4afb268bf84", "score": "0.46233493", "text": "function getById(id) {\n let query = db\n\n .select('animals.id', 'animals.name', 'species.id as species_id', 'species.species', 'shelters.id as shelter_id', 'shelters.shelter', \n 'animal_status.id as animal_status_id', 'animal_status.animal_status', 'shelter_locations.id as shelter_location_id', \n 'shelter_locations.nickname', 'pictures.img_id', 'pictures.img_url')\n\n .from('animals')\n .leftJoin('species', 'animals.species_id' , 'species.id')\n .leftJoin('shelters', 'animals.shelter_id', 'shelters.id')\n .leftJoin('animal_status', 'animals.animal_status_id', 'animal_status.id')\n .leftJoin('shelter_locations', 'animals.shelter_location_id', 'shelter_locations.id')\n .leftJoin('pictures', 'animals.profile_img_id', 'pictures.img_id')\n\n if(id) {\n query.where('animals.id', id).first();\n const promises = [query, getAnimalMetaById(id), getNotesByAnimalId(id), getAnimalFollowsById(id)]\n\n return Promise.all(promises).then(results => {\n let [animal, meta, notes, followers] = results;\n if(animal) {\n animal.meta = meta;\n animal.notes = notes;\n animal.followers = followers;\n //animal.meta = animalToBody(animal.meta);\n \n return animal\n } else {\n return null;\n }\n })\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "3f8f9ff9b69593afd434feb78eba453c", "score": "0.46227714", "text": "async function query(sql){\n const p = await pool();\n p.on('error',err=>{\n console.log('pool-error:', err);\n p.close();\n })\n const result = await request(p).query(sql);\n p.close();\n return result && result.recordsets? result.recordsets: {};;\n}", "title": "" }, { "docid": "9ba298bce6cc8a5cdb1883e856902116", "score": "0.46111944", "text": "function select(table, key, ids) {\n if(ids.length === 0)\n return Promise.resolve([]);\n return knex.raw('select * from '+table +\n ' where '+key+' in ('+ ids.join(',') + ')')\n .then(function (resp) {\n return resp.rows;\n });\n }", "title": "" }, { "docid": "34d43cc9d5c7e79e11bc9c3fba1c725e", "score": "0.46083432", "text": "function viewLowInv() {\n var query = server.openDB().query(\n \"SELECT * FROM products WHERE quantity < 5\",\n function(err, res) {\n if (err) throw err;\n\n for(let i = 0; i < res.length; i++) {\n res[i].price = res[i].price.toFixed(2);\n }\n\n console.table(res);\n exit();\n }\n );\n //console.log(query.sql);\n query\n}", "title": "" }, { "docid": "5efc237acadbe987ced7c7e8409d22ee", "score": "0.46022797", "text": "function getAnimalMetaById(id) {\n console.log(id)\n let meta = db\n .select('animal_meta.id', 'animal_meta.animal_id', 'breeds.id as breed_id','breeds.breed', 'animal_meta.is_mixed', 'ages.id as age_id', 'ages.age', 'size.id as size_id', 'size.size', 'animal_meta.health', 'animal_meta.color', 'coat_length.id as coat_length_id', 'coat_length.coat_length', 'animal_meta.is_male', 'animal_meta.is_house_trained', 'animal_meta.is_neutered_spayed', 'animal_meta.is_good_with_kids', 'animal_meta.is_good_with_dogs', 'animal_meta.is_good_with_cats', 'animal_meta.is_vaccinated', 'animal_meta.description')\n .from('animal_meta')\n .innerJoin('breeds', 'animal_meta.breed_id', 'breeds.id')\n .innerJoin('ages', 'animal_meta.age_id', 'ages.id')\n .innerJoin('size', 'animal_meta.size_id', 'size.id')\n .innerJoin('coat_length', 'animal_meta.coat_length_id', 'coat_length.id')\n .where('animal_meta.animal_id', id)\n .first()\n return meta;\n}", "title": "" }, { "docid": "8d7eece3070b534033f25b7c32a9e0c6", "score": "0.459915", "text": "queryWholeList(){\n }", "title": "" }, { "docid": "6d7b5af8895ca863f4f6575817c1137f", "score": "0.45930222", "text": "async getOrders() {\n const productsSql = `\n select * from orders_product \n where order_id in (select order_id from orders)\n order by created desc\n `;\n\n // create order products map\n const products = await this.db.query(productsSql, {});\n const reducer = (acc, product) => {\n const { order_id } = product;\n acc[order_id] = acc[order_id] ? acc[order_id] : [];\n acc[order_id].push(product);\n return acc;\n }\n const orderProducts = products.reduce(reducer, {});\n console.log(orderProducts)\n\n const orders = await this.db.find('orders', { sortBy: { key: 'created', order: 'desc'} });\n\n return orders.map(order => ({ \n ...order, \n products: orderProducts[order.order_id] \n }));\n \n }", "title": "" }, { "docid": "647e202302f4974dd92cac0245d199f9", "score": "0.459105", "text": "function queryBeersDB(tx) {\r\n tx.executeSql('SELECT * FROM beers WHERE id IN ' + BEERPKS, [], queryBeersSuccess, errorCB);\r\n}", "title": "" }, { "docid": "86e26b7fe46db816a7a0ac68a7c7b57a", "score": "0.45887947", "text": "get_model_rows() {\n\n // Still seems like the tables have been put together wrong.\n\n // incrementor rows...\n var incrementors = this.incrementors;\n var tables = this.tables;\n var res = [];\n\n each(incrementors, (incrementor) => {\n var incrementor_db_records = incrementor.get_all_db_records_bin();\n each(incrementor_db_records, (incrementor_db_record) => {\n res.push(incrementor_db_record);\n });\n });\n // Tables should be in order.Not sure why it's not.\n // Could look into the ordering of tables here.\n //console.log('this.table_names', this.table_names);\n\n each(tables, (table) => {\n //console.log('get_model_rows table.name', table.name);\n var table_all_db_records = table.get_all_db_records_bin();\n each(table_all_db_records, (table_db_record) => {\n res.push(table_db_record);\n });\n });\n //throw 'stop';\n return res;\n }", "title": "" }, { "docid": "e82c3010aea14b0c1b92ec5bac4f6734", "score": "0.45854655", "text": "minId(tableName){\n\n return global.db.con().then(con => {\n\n // @todo Colocar verificação de tabelas, para impedir que a função seja usada\n // por sql injection, apesar de ser uma função interna\n\n return new Promise((resolve, reject) => {\n\n return con.readQueryWithoutLogs(\"SELECT MIN(id) as id FROM \" + tableName + \" LIMIT 1\").then(row => {\n\n resolve(row.id);\n\n }).catch(e => {\n\n resolve(false);\n\n });\n\n });\n\n });\n\n }", "title": "" }, { "docid": "d6af99f612856103ed282537198cc221", "score": "0.45806593", "text": "prepareOne(query) {\n return query;\n }", "title": "" }, { "docid": "66d6b6594f7b389b5746838b8caa16a1", "score": "0.45806417", "text": "static rawAll(sql, params) {\n return DB.all(sql, params)\n }", "title": "" }, { "docid": "dc9a9872dd791deec907eaaa412b7cb5", "score": "0.4572265", "text": "all(query) {\n var deferred = q.defer();\n var rtn = [];\n this.find(query, (v, next, end) => {\n rtn.push(v);\n next();\n }).then(() => {\n deferred.resolve(rtn);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "bda838ee10f05ddb8fbde8a6c8390f91", "score": "0.45647314", "text": "function promisedQuery(sql) { \r\n // console.log('query: ', sql);\r\n return new Promise ((resolve, reject) => {\r\n connection.query(sql, function(err, rows) {\r\n if ( err ) {\r\n console.log('error: ', err);\r\n return reject( err );\r\n }\r\n // console.log('success');\r\n resolve( rows );\r\n })\r\n });\r\n }", "title": "" }, { "docid": "861b3ec568ebbb19d49ce6ac3e9b0113", "score": "0.4564643", "text": "fetchall(body){\n return new Promise((resolve, reject)=>{\n\n const data = JSON.parse(body);\n let docClient = new AWS.DynamoDB.DocumentClient();\n let fromdate = new Date(new Date().setDate(new Date().getDate()-31));\n let todate = new Date();\n\n var params = {\n TableName: this.tableName,\n ProjectionExpression: \"#dt, #c, #n, #ispur, endpoint\",\n FilterExpression: \"#c = :companyValue and #dt BETWEEN :date1 AND :date2\",\n ExpressionAttributeNames: {\n \"#dt\": \"date\",\n \"#c\": \"company\",\n \"#n\": \"name\",\n \"#ispur\": \"ispurchased\"\n },\n ExpressionAttributeValues: {\n \":companyValue\": data.company,\n \":date1\": fromdate.toISOString(),\n \":date2\": todate.toISOString()\n }\n };\n docClient.scan(params, (err, data) => {\n if (err){ reject(err); }else{ resolve(data.Items); }\n });\n });\n }", "title": "" }, { "docid": "1072b9616bfd7f05e194740e02076535", "score": "0.4555804", "text": "static async all(sql, params) {\n return new Promise((resolve, reject) => {\n Connection.db.all(sql, params, function complete(error, rows) {\n if (error) {\n reject(error);\n } else {\n resolve(rows);\n }\n });\n });\n }", "title": "" }, { "docid": "c3cfb00bf2d1b17ef59a283df2d3e997", "score": "0.4554602", "text": "select() {\n let sql = this.with();\n\n const statements = components.map((component) => this[component](this));\n sql += compact(statements).join(' ');\n return sql;\n }", "title": "" }, { "docid": "ae6b06a4876b3a126bd5e97d96b881aa", "score": "0.45540544", "text": "function select(params, ...otherFields) {\n const fields = params && params.query && params.query.$select;\n if (Array.isArray(fields) && otherFields.length) {\n fields.push(...otherFields);\n }\n const convert = (result) => {\n if (!Array.isArray(fields)) {\n return result;\n }\n return commons_1._.pick(result, ...fields);\n };\n return (result) => {\n if (Array.isArray(result)) {\n return result.map(convert);\n }\n return convert(result);\n };\n}", "title": "" }, { "docid": "36aa8cb21a60a0777a3e7a396adf2652", "score": "0.45477295", "text": "static async best() {\n const results = await db.query(\n `SELECT id, \n first_name AS \"firstName\", \n last_name AS \"lastName\", \n phone, \n notes\n FROM customers\n JOIN\n (\n SELECT \n customer_id , COUNT(*) AS count \n FROM reservations \n GROUP BY customer_id \n ORDER BY COUNT(*) DESC \n LIMIT 10\n ) AS res_count\n ON \n id = customer_id\n ORDER BY count DESC`\n );\n return results.rows.map(c => new Customer(c));\n }", "title": "" }, { "docid": "72e09f916379639e72d16c0e29ae5928", "score": "0.4534517", "text": "async first(){\n let model = null;\n const self = this;\n if(this.query instanceof DocumentReference){\n const snap = await this.query.get();\n if(snap.exists){\n model = new self.model_class(snap).at(this.model.tableParams);\n }\n }else{ \n await this.query.limit(1).get()\n .then(snap=>{\n snap.forEach(async el=>{\n model = new self.model_class(el).at(this.model.tableParams);\n });\n });\n }\n \n return model;\n }", "title": "" }, { "docid": "058b87bd02a6756081a10d6dc87a6ce5", "score": "0.45333728", "text": "function getAllListings(req, res, next){\n\n db.tx(t => {\n\n return t.batch([\n // TOTAL TRADES IN DATABASE\n t.any('SELECT COUNT(*) AS browse_stats FROM listings WHERE completed = FALSE AND accepted = FALSE'),\n // SELECT ALL TRADES\n t.any(`SELECT listings.title, listings.id, COALESCE(to_char(date_created, 'Dy Mon DD at HH12:MI:SSam'), '') AS date_created, listings.brand, listings.category, listings.size, listings.whatsize, listings.condition, listings.cash, users.city, users.state, users.username, images.image1 FROM listings\n INNER JOIN images ON listings.id = images.id \n INNER JOIN users ON listings.userid = users.userid \n WHERE accepted = FALSE AND completed = FALSE ORDER BY listings.date_created DESC`),\n ]);\n })\n .then(data => {\n\n // FILTER OUT DUPLICATE BRAND NAMES SO THE DROP DOWN ONLY SHOWS THE BRAND NAME ONCE\n let brands = data[1].map((item) => { return item.brand })\n .filter((item, index, arr) => { return arr.indexOf(item) === index; });\n\n // FILTER OUT DUPLICATE CATEGORY NAMES SO THE DROP DOWN ONLY SHOWS THE CATEGORY NAME ONCE\n let categories = data[1].map((item) => { return item.category })\n .filter((item, index, arr) => { return arr.indexOf(item) === index; });\n\n // TOTAL NUMBER OF TRADES\n let browseStats = data[0][0].browse_stats;\n\n // ALL TRADES\n let trades = data[1];\n\n res.render('Browse', { \n title: \"Browse\", \n category: '', \n brand: '', \n query: '',\n filterStats: 0, \n browseStats, trades, brands, categories });\n\n }).catch(e => { console.log(e); });\n}", "title": "" }, { "docid": "e9e5c94ba5ebb49b06a5ba82eeb6a115", "score": "0.45324704", "text": "listrequestedplayers(team_id){\n return this.knex.select().from('requests').where('team_id',team_id)\n .then((players)=>{\n return players;\n })\n .catch(err=>console.log(err));\n }", "title": "" }, { "docid": "8c5c894d2bbf4c5df2018b3c2b273731", "score": "0.45321628", "text": "select() {\n \n this.link.getConnection ((err, conn) => {\n if (err) throw err;\n\n conn.query(\"SELECT * FROM categories\", ((err, result) => {\n if (err) throw err;\n //console.log(result);\n }));\n });\n return this.select;\n }", "title": "" }, { "docid": "55d7e48b98dbfea5a862194a6c9a0e3d", "score": "0.4531344", "text": "async function getLowInventory(columns) {\n //Get all Products from the Database\n let response = await new Promise((resolve, reject) => {\n db.query(`SELECT ${columns} FROM products WHERE stock_quantity <= 5`, (e, r) => {\n if (e) {\n reject(e)\n } else {\n resolve(r)\n }\n })\n })\n //return promise\n return response\n}", "title": "" }, { "docid": "24513dafb15df411a7bc1e9f33d4b355", "score": "0.4523477", "text": "selectAll(table){\n const queryString = \"SELECT * FROM ??\";\n return this.connection.query(queryString, [table])\n }", "title": "" }, { "docid": "ca3f9b693983a66f705fd7d3faee8c8b", "score": "0.45226386", "text": "trussById2(name, week, number, plantNum) {\n try {\n return new Promise((resolve) => {\n this.initDB2().then((db) => {\n db.transaction((tx) => {\n //need to add plant name, plant row and plant week\n tx.executeSql('SELECT * FROM TrussDetails WHERE plantName = ? AND plantWeek = ? AND trussNumber = ? AND plantNumber = ?', [number, week, name, plantNum]).then(([tx, results]) => {\n console.log(results);\n if (results.rows.length > 0) {\n let row = results.rows.item(0);\n resolve(row);\n }\n });\n }).then((result) => {\n this.closeDatabase(db);\n }).catch((err) => {\n console.log(err);\n });\n }).catch((err) => {\n console.log(err);\n });\n }).catch((err) => {\n console.log(err);\n });\n }\n catch (err_1) {\n console.log(err_1);\n }\n }", "title": "" }, { "docid": "779802ce916fceb92863ca08f8e84b96", "score": "0.45219204", "text": "static async query(conn, transform) {\n\t\tif (!transform) transform = (q => q);\n\n\t\tvar result = await transform(r.table(this.table)).run(conn);\n\t\tresult = await result.toArray();\n\n\t\treturn result.map( record => new this(conn, record) );\n\t}", "title": "" }, { "docid": "43e12f6546790ca3a0ffd139a5d0e8ff", "score": "0.45196575", "text": "function fallbackRenderTableSelector(rows,columns,column){// Have all values matched as numbers?\nif(column.checkedAnyValues&&column.possiblyNumber){return renderNumberSelector(rows,columns,column);}// Have all values been literals?\nif(column.possiblyLiteral){return renderLiteralSelector(rows,columns,column);}return null;}// Render a selector for a given row.", "title": "" }, { "docid": "8c36d718f2c214a83832f25aba32e19d", "score": "0.45189196", "text": "function getItems(callback){\n\tdb.query('SELECT * FROM items WHERE removedat IS NULL')\n .then( res => {\n \tconsole.log(res.rows);\n callback(res.rows);\n \t })\n .catch(err => {console.error(e.stack)});\n}", "title": "" }, { "docid": "007b85c8d87a1c1e5c9a37a2bb7d2aba", "score": "0.45155", "text": "async function selectEmployeesByTeamId(teamId) {\n const results = await query(`select * from employee where team_id = ${teamId}`)\n //console.log(rows)\n return results\n}", "title": "" }, { "docid": "40c18d5e24b9a172009b17e7c1844366", "score": "0.45100415", "text": "fetchAll() {\n const sql = 'SELECT r.id, r.title, r.salary, d.name AS department FROM role r LEFT JOIN department d ON d.id = r.department_id';\n return this.db.query(sql)\n .then(([rows, junk]) => {\n return rows;\n });\n }", "title": "" }, { "docid": "9f4708dd26889e31c845925b73515a0c", "score": "0.45095932", "text": "function selectQuery(sparqlQuery, raw,cache_id) {\n var props=[\n 'subject',\n 'predicate',\n 'object',\n 'has_observable_name',\n 'has_risk_element_name',\n 'has_measurement_type_name',\n 'has_risk_factor_association_type',\n 'has_risk_factor_source',\n 'has_risk_factor_target',\n 'has_source_risk_element_name',\n 'has_target_risk_element_name',\n 'has_citation_pubmed_identifier'\n ];\n if( cache_id ) { \n // USE CACHE\n return cacheQuery(sparqlQuery,null,cache_id).then(function(res) {\n if (raw) return res;\n // console.log(res.data);\n var results = RdfFormatter.groupByProp(res.data, props, null, 'value');\n if (results.data.length > 0) return RdfFormatter.mappings(results);\n else return [];\n });\n } else {\n return apiQuery(sparqlQuery).then(function(res) {\n \n console.log(\"=========NO CACHE===================\");\n \n // console.log(\"Sparql Query: \",sparqlQuery);\n console.log(\"Raw: \",res.data);\n if (raw) return res;\n var results = RdfFormatter.groupByProp(res.data, props, null, 'value');\n console.log(\"groupByProp: \",results);\n if (results.data.length > 0) {\n var MappedResults = RdfFormatter.mappings(results);\n console.log(\"MappedResults: \",results);\n return MappedResults\n } else return [];\n \n \n console.log(\"===========NO CACHE===============\");\n \n });\n } \n }", "title": "" }, { "docid": "eaf0e8039f936b6ff93b4fd154af22a3", "score": "0.45062774", "text": "function selectQueryDateStory(indexTrip)\n{\n sql = \"SELECT distinct(date) \\n\\\n FROM STORY \\n\\\n WHERE idTrip = \"+indexTrip+\" \\n\\\n ORDER BY date\";\n\n dbShell.transaction(\n function(tx)\n { \n tx.executeSql(sql, [],renderListStories,errorCBSelect);\n },\n errorCB\n );\n \n}", "title": "" }, { "docid": "dd46427eb4a32329bcc93bb91b90c4e6", "score": "0.45055833", "text": "countRows(table,db,where='',inserts=[]){\n return new Promise((res,rej)=>{\n db.query('SELECT COUNT(*) FROM ??'+where,[table].concat(inserts),(error, results, fields)=>{\n if (error) rej(error);\n res(results[0][\"COUNT(*)\"]);\n });\n });\n }", "title": "" }, { "docid": "e8cd60261d244795d033e6df06025bfc", "score": "0.4502011", "text": "async function getrecentactivity(userData) {\n let query = `SELECT\n r.groupid,\n r.fromid,\n r.transactionid,\n r.time,\n r.money,\n r.action,\n r.recurring,\n r.category,\n r.groupname,\n r.transactionname,\n a.actionname,\n ur.username,\n c.categoryurl,\n c.categoryname,\n rc.recurringname\nFROM\n recent r\nLEFT JOIN action a \n ON a.id = r.action\nLEFT JOIN \n users ur ON ur.id = r.fromid\nLEFT JOIN \n category c ON c.id = r.category\nLEFT JOIN \n recurringrecent rc ON rc.id = r.recurring\nWHERE\n r.fromid = '${userData.id}' AND (\n r.groupid IS NULL OR (\n r.groupid IS NOT NULL AND r.transactionid IS NULL AND r.action = 3\n )\n )\nUNION\nSELECT\n r.groupid,\n r.fromid,\n r.transactionid,\n r.time,\n r.money,\n r.action,\n r.recurring,\n r.category,\n r.groupname,\n r.transactionname,\n a.actionname,\n ur.username,\n c.categoryurl,\n c.categoryname,\n rc.recurringname\nFROM\n usergrouptable u\nLEFT JOIN\n recent r ON r.groupid = u.groupid\nINNER JOIN \n users ur ON ur.id = r.fromid\nLEFT JOIN action a \n ON a.id = r.action\nLEFT JOIN \n category c ON c.id = r.category\nLEFT JOIN \n recurringrecent rc ON rc.id = r.recurring\nWHERE\n u.userid = '${userData.id}'`;\n try {\n let recentData = await promisedData(query);\n recentsort = recentData.sort(function (a, b) { return new Date(b.time) - new Date(a.time); })\n console.log(recentData);\n return recentData;\n } catch (error) {\n console.log(error);\n return error;\n }\n\n}", "title": "" }, { "docid": "e328574304ca688daa26bf7b20a6b8cb", "score": "0.4498651", "text": "function dbSelectCallback(err, allRowData) {\n if (err) {\n console.log(\"SELECT Error: \", err);\n } else {\n\n returnData = {};\n returnData[\"tags\"] = [];\n returnData[\"locations\"] = [];\n\n // Make sure that we are only sending distict tags and locations. \n for (var i = 0; i < allRowData.length; i++) {\n\n var entryTags = allRowData[i].tags.split(\",\");\n var entryLocation = allRowData[i].location;\n\n for (var j = 0; j < givenTags.length; j++) {\n var givenTag = givenTags[j];\n\n if (givenTag.length === 0) {\n continue;\n }\n\n /* Song and dance to push distinct tags */\n for (var tagIndex = 0; tagIndex < entryTags.length; tagIndex++) {\n if ((entryTags[tagIndex].length > 0) && (returnData[\"tags\"].indexOf(entryTags[tagIndex]) === -1) &&\n (entryTags[tagIndex].toString().toLowerCase()).startsWith(givenTag.toString().toLowerCase()) &&\n ((entryTags[tagIndex].toString().toLowerCase()) !== (givenTag.toString().toLowerCase()))) {\n returnData[\"tags\"].push(entryTags[tagIndex]);\n }\n }\n\n if ((entryLocation.length > 0) && (returnData[\"locations\"].indexOf(entryLocation) === -1) &&\n (entryLocation.toString().toLowerCase()).startsWith(givenTag.toString().toLowerCase())) {\n returnData[\"locations\"].push(entryLocation);\n }\n }\n }\n\n // Sort the arrays\n returnData[\"tags\"].sort();\n returnData[\"locations\"].sort();\n // Send the response as a JSON string.\n response.write(JSON.stringify(returnData));\n response.end();\n }\n }", "title": "" }, { "docid": "4cb867854f1675ec9502617e83bbcffe", "score": "0.4497894", "text": "executeQuery() {\n let cmd = '';\n if (this.action === 'SELECT') {\n cmd = this.getSelectCmd();\n } else if (this.action === 'UPDATE') {\n cmd = this.getUpdateCmd();\n } else if (this.action === 'DELETE') {\n cmd = this.getDeleteCmd();\n } else if (this.action === 'FINDONE') {\n cmd = this.getSelectCmd();\n return this.pool.queryAsync(cmd).then(list => list[0] || null);\n }\n this.clear();\n return this.pool.queryAsync(cmd);\n }", "title": "" }, { "docid": "e82cb24d3711cb9b8e477eb3e62e6b74", "score": "0.4495687", "text": "static async selectAll()\n {\n const { rows } = await pool.query(\n 'SELECT * FROM history_trivia'\n );\n return rows.map((row) => new historyTrivia(row));\n }", "title": "" }, { "docid": "ddcad9e4a1c22668962d5c639d529095", "score": "0.4491861", "text": "select() {\n let sql = this.with();\n\n const statements = components.map(component =>\n this[component](this)\n );\n sql += compact(statements).join(' ');\n return sql;\n }", "title": "" }, { "docid": "e244b9658849d53b497fcd391aa18d7a", "score": "0.44912246", "text": "function selectRowWithArray(idArray, handler){\n\tif(idArray === null){\n\t\tdb.transaction( function (transaction) { transaction.executeSql( \"SELECT * FROM Cust3\", [], handler, trans_error); } );\n\t}else{\n\t\tvar selector = \"WHERE compId = \";\n\t\tfor(var i=0; i < idArray.length; i++){\n\t\t\tif(i ===0){\n\t\t\t\tselector += idArray[i];\n\t\t\t}else{\n\t\t\t\tselector += \" OR compId = \" + idArray[i];\n\t\t\t}\n\t\t}\n\t\tdb.transaction( function (transaction) { transaction.executeSql( \"SELECT * FROM Cust3 \" + selector, [], handler, trans_error); } );\n\t}\n}", "title": "" }, { "docid": "884f1280fd0651914f72435af726343f", "score": "0.4489156", "text": "anySelected() {\n return !this.selectedRows?.length;\n }", "title": "" }, { "docid": "73376a0769848ebe12cd9ba4db84f1b2", "score": "0.4489068", "text": "_execQuery (query, callback) {\n const queryParams = this._queryParams\n let queryResult = query.sort({ _id: -1 })\n\n if (queryParams && queryParams.select) {\n queryResult = queryResult.select(queryParams.select)\n }\n\n if (queryParams && queryParams.populate) {\n queryResult = queryResult.populate(queryParams.populate)\n }\n\n return queryResult.exec(callback)\n }", "title": "" }, { "docid": "2392f6beb26a7602ccc50d5cf6992540", "score": "0.44885433", "text": "fetch()\n {\n return new Promise((resolve, reject) => {\n this.params.$_limit = Math.min(config.rowsPerChunk, this.limit);\n this.statement.all(this.params, (err, rows) => {\n if (err) {\n return reject(err);\n }\n this.cache = rows || [];\n this.params.$_offset += this.cache.length;\n resolve(this);\n });\n });\n }", "title": "" }, { "docid": "b172a0b9d761c3a1ac2d7966e8cce919", "score": "0.44872302", "text": "function internaliseResult(err, rows, fields, sqlQuery, tableName, uuid, callback, cacheCallback) {\n 'use strict';\n\n var jsonResult = {};\n\n jsonResult.resultFromCache = false;\n\n jsonResult.sql = sqlQuery;\n if (err !== undefined && err !== null && err) {\n jsonResult.result = err.message;\n }\n else {\n jsonResult.result = {};\n }\n jsonResult.rows = [];\n if (rows !== undefined && rows !== null) {\n if (rows.length > 0) {\n if (rows[0].length > 0) {\n for(var i = 0; i < rows[0].length; i++) {\n jsonResult.rows.push(rows[0][i]);\n }\n }\n }\n }\n\n if (cacheCallback !== undefined && cacheCallback !== null && typeof(cacheCallback) === 'function') {\n cacheCallback(err, tableName, uuid, sqlQuery, jsonResult);\n }\n if (callback !== undefined && callback !== null && typeof(callback) === 'function') {\n return callback(err, tableName, uuid, sqlQuery, jsonResult);\n }\n}", "title": "" }, { "docid": "63068046fb41848687f67b10df97f46c", "score": "0.44868958", "text": "static where(params){\n try{\n const rows = db.query(`SELECT * FROM ${this.table} WHERE ${params}`)\n return rows.map(row => this.prototype.constructor(row))\n } catch(err){\n console.log(err)\n }\n \n }", "title": "" }, { "docid": "6a021737ef944db502b7da8c6c574f66", "score": "0.44667998", "text": "function findDups(key,table) {\n var keyCols = key.join(', ');\n var q1=`\n select c.*\n from (\n select ${keyCols},count(*) as keyCount\n from ${table} t\n group by ${keyCols}) c\n where c.keyCount > 1`\n\n var q2=`\n select t.*\n from ${table} t natural join (${q1}) dk`;\n\n return q2;\n}", "title": "" }, { "docid": "632291b6b5e7dcf606a5613c0244df33", "score": "0.44657275", "text": "function queryDrinksDB(tx) {\r\n tx.executeSql('SELECT * FROM drinks WHERE id IN ' + DRINKPKS, [], queryDrinksSuccess, errorCB);\r\n}", "title": "" }, { "docid": "78d520ba1fa17377576341bc69d2e34b", "score": "0.44632685", "text": "function getBooksReadRec(req, res) {\n\n const email = req.params.email;\n\n connection.then((con) => {\n // console.log(con);\n const sql = `\n WITH BookTemp AS\n (\n SELECT isbn, rating FROM Books\n ),\n BookAuthorUC AS\n (\n SELECT BookAuthor.authorid, bmain.isbn\n FROM MemberChoices uc\n INNER JOIN BookTemp bmain\n ON bmain.isbn = uc.isbn\n INNER JOIN BookAuthor\n ON bmain.isbn = BookAuthor.isbn\n WHERE uc.email = '${email}'\n AND uc.readflag = 1\n ),\n BooksSuggested AS \n (\n SELECT distinct bma.isbn, bma.rating, BookAuthor.authorid\n FROM BookTemp bma\n INNER JOIN BookAuthor\n ON bma.isbn= BookAuthor.isbn\n INNER JOIN BookCategory bCat\n ON bCat.isbn = bma.isbn\n WHERE bma.isbn NOT IN \n (\n SELECT isbn FROM BookAuthorUC\n )\n AND bCat.categoryId IN\n (\n SELECT BookCategory.categoryId\n FROM BookTemp\n INNER JOIN BookCategory\n ON BookTemp.isbn = BookCategory.isbn\n INNER JOIN BookAuthorUC \n ON BookTemp.isbn = BookAuthorUC.isbn\n )\n ),\n isbn_temp AS \n (\n SELECT bs.isbn\n FROM BooksSuggested bs\n WHERE bs.authorid NOT IN \n (\n SELECT bauc.authorid\n FROM BookAuthorUC bauc\n )\n ORDER BY bs.rating DESC\n )\n SELECT distinct books.isbn, books.title, books.img_url, books.description, books.url, books.publisher, books.publication_place, books.publication_date, books.rating, books.num_pages, books.lang, books.ages\n FROM isbn_temp INNER JOIN Books\n ON books.isbn = isbn_temp.isbn\n where rownum <= 20\n `;\n con.execute(sql).then((response) => {\n console.log(response);\n res.json(response);\n })\n });\n}", "title": "" }, { "docid": "52b200b51d41d02b1571d9b6ac5b8bd3", "score": "0.44621858", "text": "function fetchProductIdDistinct() {\n return simpleQuery('SELECT DISTINCT productid FROM inventory');\n}", "title": "" }, { "docid": "af89fdb80c4430f410af9708ad56049f", "score": "0.44607648", "text": "function select(options = {}, callback) {\n try {\n let sql = \"\";\n let columns = \"\";\n let from = \"\";\n let joins = \"\";\n let conditions = \"\";\n let groupBy = \"\";\n let orderBy = \"\";\n let limit = \"\";\n\n let select = \"SELECT \";\n // console.log('INSIDE MAPPER',options.joins);\n\n\n if (options.columns) {\n columns = \" \" + options.columns;\n } else {\n columns = \" *\";\n }\n if (options.from) {\n from = \" FROM \" + options.from;\n }\n if (options.joins) {\n options.joins.forEach(join => {\n joins += \" \" + join.type + \" JOIN \" + join.table + \" ON \" + join.on;\n });\n }\n if (options.conditions) {\n conditions = \" WHERE \" + options.conditions;\n } else {\n conditions = \" WHERE 1 = 1 \";\n }\n console.log('step-1');\n if (options.IN) {\n let arr = options.IN.list\n conditions += \" AND \" + options.IN.attribute + \" IN (\"\n for (i = 0; i < arr.length - 1; i++) {\n conditions += arr[i] + \",\"\n }\n conditions += arr[i] + \") \"\n }\n if (options.req) {\n // console.log('step-2');\n let req = options.req;\n // console.log(\"Req.query.filter------\", req.query.filter);\n\n if (req.query.search) {\n // console.log('step-3');\n // req.query.search = (req.query.search).toLowerCase();\n console.log(\"search options---> \", req.query.searchOptions);\n const tAlias = req.query.searchOptions.tAlias ? req.query.searchOptions.tAlias : \"\";\n const exactMatch = req.query.searchOptions.exactMatch ? req.query.searchOptions.exactMatch : false;\n\n if (req.query.filter) {\n let arr = req.query.filter.split(',');\n conditions += ` AND (`;\n let delim = \"\";\n arr.forEach(ar => {\n console.log(\"exactMatch ===> \", exactMatch);\n if (exactMatch || exactMatch == 'true') {\n conditions += delim + (tAlias ? tAlias + '.' : tAlias) + `${ar} = '${req.query.search}'`;\n } else {\n conditions += delim + (tAlias ? tAlias + '.' : tAlias) + `${ar} ILIKE '%${req.query.search}%'`;\n }\n delim = \" OR \";\n });\n conditions += `)`;\n }\n // else{\n // conditions += ` AND (ev.title LIKE '%` + req.query.search + `%')`;\n // }\n }\n\n console.log(\"Body -----------> \", req.body);\n if (req.body && req.body.advanceSearch) {\n if ((req.body.advanceSearch && typeof (req.body.advanceSearch) == 'string')) {\n rTrim(req.body.advanceSearch, \"'\");\n rTrim(req.body.advanceSearch, '\"');\n console.log(\"advancesearch after trim----\", req.body.advanceSearch[0]);\n }\n // advanceSearch format := [{key:\"subscription_type\",value:[\"paid\",\"free\"]},{key:\"level\",value:[\"easy\",\"moderate\",\"difficult\"]}];\n if (req.body.advanceSearch[0]) {\n req.body.advanceSearch.forEach(as => {\n if (as.value && as.value.length > 0) {\n if (as.operator == \"bool\") {\n if (as.value == \"s\") {\n as.value = 1;\n } else {\n as.value = 0;\n }\n conditions += \" AND (\" + as.key + \" = \" + as.value + \")\";\n } else if (as.operator == \"range\") {\n if (as.value[0 > as.value[1]]) {\n console.log(\"Wrong Range in Advance Search\");\n } else {\n conditions += \" AND (\" + as.key + \">=\" + as.value[0] + \" AND \" + as.key + \"<=\" + as.value[1] + \")\";\n }\n } else {\n conditions += \" AND (\" + as.key + \" LIKE '%\" + as.value.toString().replace(',', \"%' || \" + as.key + \" LIKE '%\") + \"%')\";\n }\n }\n })\n }\n }\n }\n\n if (options.groupBy) {\n groupBy += \" GROUP BY (\" + options.groupBy.by + \") \";\n }\n if (options.orderBy) {\n orderBy += \" ORDER BY\";\n if (options.orderBy[0]) {\n let delim = \" \";\n options.orderBy.forEach(o => {\n orderBy += delim + o.by + \" \" + o.order;\n delim = \", \";\n })\n } else {\n let o = options.orderBy;\n orderBy += \" \" + o.by + \" \" + o.order;\n }\n }\n if (options.limit) {\n if (options.limit.limit && options.limit.limit > 0) {\n // let start = 0;\n if (options.limit.start) {\n start = options.limit.start;\n }\n\n limit = \" LIMIT \" + options.limit.limit + \" \" + \"OFFSET\" + \" \" + options.limit.start;\n }\n }\n console.log(\"above fcnt and cnt\");\n if (!options.id && options.groupBy) {\n console.log(\"IN CNT FCNT CONITION\");\n sql += select + \" COUNT(*) as fcnt \" + \"from (\" + select + rTrim(columns) + from + joins + conditions + groupBy + \") as sq ; \";\n sql += select + \" COUNT(*) as cnt \" + \"from (\" + select + rTrim(columns) + from + joins + groupBy + \") as sq ; \";\n } else if (!options.id) {\n console.log(\"IN CNT FCNT CONITION\");\n sql += select + \" COUNT(*) as fcnt \" + from + joins + conditions + \"; \";\n sql += select + \" COUNT(*) as cnt \" + from + joins + \"; \";\n }\n sql += select + rTrim(columns) + from + joins + conditions + groupBy + orderBy + limit;\n\n console.log('-------------------------QUERY -------------------------------------------------------', sql);\n\n executeQuery(sql, function (err, data) {\n // console.log(\"in select of sql mapper\", data);\n if (err) {\n return callback(_error(err));\n } else {\n // console.log(\"IN SELECT QUERY\",data);\n return callback(null, data);\n }\n });\n } catch (error) {\n return callback(_error(error));\n }\n}", "title": "" }, { "docid": "2e70d064142b47381822a8caf29b3010", "score": "0.44598988", "text": "static async getTopCustomers() {\n console.log(\"IN THE TOP CUSTOMER FUNCTION\");\n const results = await db.query(\n `SELECT customers.id, customers.first_name, customers.last_name, count(reservations.customer_id) as COUNT \n FROM customers \n JOIN reservations ON customers.id=reservations.customer_id \n GROUP BY (customers.id, customers.first_name, customers.last_name) \n ORDER BY COUNT DESC\n LIMIT 10;\n `);\n console.log(\"results method are ---->\", results);\n const customers = await Promise.all(results.rows.map(c => Customer.get(c.id)));\n return await customers;\n }", "title": "" }, { "docid": "c73b5080be95fbbab835417e0dc41ca8", "score": "0.44594172", "text": "refreshFilteredRowSelections() {\n let tmpFilteredArray = [];\n const filteredDataset = this._dataView.getFilteredItems() || [];\n if (Array.isArray(this._selectedRowDataContextIds)) {\n const selectedFilteredRowDataContextIds = [...this._selectedRowDataContextIds]; // take a fresh copy of all selections before filtering the row ids\n tmpFilteredArray = selectedFilteredRowDataContextIds.filter((selectedRowId) => {\n return filteredDataset.findIndex((item) => item[this.datasetIdPropName] === selectedRowId) > -1;\n });\n this._selectedFilteredRowDataContextIds = tmpFilteredArray;\n }\n return tmpFilteredArray;\n }", "title": "" }, { "docid": "0dbe8abe09bbb94357fbcfa15491fcc2", "score": "0.4456641", "text": "function select() {\r\n // @todo: Implement selection if needed\r\n \t}", "title": "" }, { "docid": "e59b13179a1fb97fe931b22629e7bae3", "score": "0.44534323", "text": "executeQuery(queryContext) {\n return new Promise((resolve, reject) => {\n\n this.connection.query(queryContext.sql, queryContext.values, (err, data) => {\n if (err && err.code === 'ER_DUP_ENTRY') err = new RelatedError.DuplicateKeyError(err);\n\n if (err) reject(err);\n else {\n if (queryContext.ast) resolve(data);\n else if (type.object(data)) {\n // not an select\n if (data.affectedRows !== undefined) {\n // insert\n resolve(data.insertId || null);\n }\n else resolve(data);\n }\n else resolve(data);\n }\n });\n });\n }", "title": "" }, { "docid": "35240ac75729708f6d5c3dbc29a529ac", "score": "0.44494897", "text": "function qry_all(db,query, params) {\n return new Promise((resolve, reject)=> {\n db.all(query, params, (err, rows)=>{\n if(err) reject(\"Read error: \" + err.message)\n else resolve(rows);\n }) \n }) \n }", "title": "" } ]
1aa5799eeb36502f6cc6fb8563971cf1
Open an error dialog
[ { "docid": "f779dff61785cd4299b855d5e5dfd6c0", "score": "0.7047454", "text": "openErrorDialog(title, message) {\n return __awaiter(this, void 0, void 0, function* () {\n const dialogData = new ErrorDialogData(title, message);\n const dialogRef = this.dialog.open(ErrorDialogComponent);\n dialogRef.componentInstance.data = dialogData;\n return new DialogResult(DialogButton.OK);\n });\n }", "title": "" } ]
[ { "docid": "16573ebf1b8505bb3b87ae391ec4f984", "score": "0.7618246", "text": "function open_error_dialog() {\n\t$(\"#dialog_confirm\").html('Your input is too short.');\n\n\t// Define the Dialog and its properties.\n\t$(\"#dialog_confirm\").dialog({\n\t\tresizable : false,\n\t\tmodal : true,\n\t\ttitle : \"Tips\",\n\t\theight : 200,\n\t\twidth : 400,\n\t\tbuttons : {\n\t\t\t\"OK\" : function() {\n\t\t\t\t$(this).dialog('close');\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.7591748", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.7591748", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.7591748", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.7591748", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.7591748", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.7591748", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "6dc6da04fc2ecc9564930fb33270a8c5", "score": "0.7419152", "text": "function openError(message) {\n $scope.errorMessage = message;\n ngDialog.open({\n /*jshint multistr: true */\n template: '\\\n <h3 style=\"color: #F44336\">ERROR</h3>\\\n <p>{{errorMessage}}</p>\\\n <div class=\"ngdialog-buttons\">\\\n <button type=\"button\" class=\"ngdialog-button ngdialog-button-secondary\" ng-click=\"closeThisDialog(0)\">Ok</button>\\\n </div>',\n plain: true,\n scope: $scope\n })\n }", "title": "" }, { "docid": "b1c900e480ec344ee3bd22d2e8a65d54", "score": "0.7324494", "text": "function showErrorDialog(boundary,errorInfo){return true;}", "title": "" }, { "docid": "b1c900e480ec344ee3bd22d2e8a65d54", "score": "0.7324494", "text": "function showErrorDialog(boundary,errorInfo){return true;}", "title": "" }, { "docid": "b1c900e480ec344ee3bd22d2e8a65d54", "score": "0.7324494", "text": "function showErrorDialog(boundary,errorInfo){return true;}", "title": "" }, { "docid": "24313d9b0372c7b297a90f7c60215f9f", "score": "0.72413343", "text": "_error(err) {\n this._loading(false);\n if (!err.message) return;\n\n\n this.refs['popup'].getWrappedInstance().show(err.message);\n }", "title": "" }, { "docid": "a56bd6531b362162545d80d3687d97ff", "score": "0.7210729", "text": "function showError(title, message) {\n Dialogs.showModalDialog(\n Dialogs.DIALOG_ID_ERROR,\n title,\n message\n );\n }", "title": "" }, { "docid": "ecac81ca6e279af166412d7c5284e898", "score": "0.7156459", "text": "function launchGenericError(){\n\tpopup(s_message['connection_error'],messageBoxType.ERROR,'','',1);\n}", "title": "" }, { "docid": "54dc949a0fd2199f996653f30259b9b9", "score": "0.71244586", "text": "handleOpenErrorModal() {\n this.showTheErrorModal(true);\n }", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "2eb35053912077fabdcbdfbfc84fa206", "score": "0.70703393", "text": "function showErrorDialog(capturedError) {\n return true;\n}", "title": "" }, { "docid": "9749adb0cd79c56bd31c52620ae22748", "score": "0.70229006", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n }", "title": "" }, { "docid": "9749adb0cd79c56bd31c52620ae22748", "score": "0.70229006", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n }", "title": "" }, { "docid": "9749adb0cd79c56bd31c52620ae22748", "score": "0.70229006", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n }", "title": "" }, { "docid": "9749adb0cd79c56bd31c52620ae22748", "score": "0.70229006", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n }", "title": "" }, { "docid": "456cf0dc73755985caea67217df16070", "score": "0.7011615", "text": "function showErrorDialog(capturedError) {\n\t return true;\n\t}", "title": "" }, { "docid": "ba51935fab2ec4f1a098ef9ea4424f6e", "score": "0.6991574", "text": "function showErrorDialog(capturedError) {\n return true;\n }", "title": "" }, { "docid": "ba51935fab2ec4f1a098ef9ea4424f6e", "score": "0.6991574", "text": "function showErrorDialog(capturedError) {\n return true;\n }", "title": "" }, { "docid": "ba51935fab2ec4f1a098ef9ea4424f6e", "score": "0.6991574", "text": "function showErrorDialog(capturedError) {\n return true;\n }", "title": "" }, { "docid": "ba51935fab2ec4f1a098ef9ea4424f6e", "score": "0.6991574", "text": "function showErrorDialog(capturedError) {\n return true;\n }", "title": "" }, { "docid": "ba51935fab2ec4f1a098ef9ea4424f6e", "score": "0.6991574", "text": "function showErrorDialog(capturedError) {\n return true;\n }", "title": "" }, { "docid": "ba51935fab2ec4f1a098ef9ea4424f6e", "score": "0.6991574", "text": "function showErrorDialog(capturedError) {\n return true;\n }", "title": "" }, { "docid": "ba51935fab2ec4f1a098ef9ea4424f6e", "score": "0.6991574", "text": "function showErrorDialog(capturedError) {\n return true;\n }", "title": "" }, { "docid": "ba51935fab2ec4f1a098ef9ea4424f6e", "score": "0.6991574", "text": "function showErrorDialog(capturedError) {\n return true;\n }", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "bc4f6d8c3c654a755fdbb6b1a8477507", "score": "0.6934807", "text": "function showErrorDialog(boundary, errorInfo) {\n return true;\n}", "title": "" }, { "docid": "3dac0535d541938f3bb316cd64c5bcd6", "score": "0.6928714", "text": "function dlgError(ev, title, error) {\n if (title == undefined || title == \"\") {\n title = \"Error\";\n }\n\n var msg = \"\";\n try {\n msg = error.data.Message || error.data\n }\n catch (err) {\n msg = error;\n }\n console.log(msg);\n $mdDialog.show(\n $mdDialog.alert()\n .parent(angular.element(document.querySelector('#popupContainer')))\n .clickOutsideToClose(true)\n .title(title)\n .textContent(msg)\n .ariaLabel('')\n .ok('OK')\n .targetEvent(ev)\n );\n }", "title": "" }, { "docid": "7f78b291f422aa674646577c2092234b", "score": "0.6853488", "text": "function showErrorMessage( title, message ){\n NSApplication.sharedApplication().displayDialog_withTitle( message, title );\n}", "title": "" }, { "docid": "458c12241df07327fdad2981716c8885", "score": "0.68490267", "text": "function owError(name) { //start overwrite error dialog handler\n\t\t$(\"#owDialog\").dialog('open');\n\t\t$(\"#saveVariable\").text(name);\n\t} //end overwrite error dialog handler", "title": "" }, { "docid": "b7f5f19bf90fcb5a84346b0b288b78bf", "score": "0.6816259", "text": "function showError(errorMessage = DEFAULT_ERROR_MESSAGE, errorDetail = DEFAULT_ERROR_DETAILS){\n dialog.showErrorBox(errorMessage, errorDetail)\n}", "title": "" }, { "docid": "a946e52a8c8bea5e092a5a943fe92136", "score": "0.6814267", "text": "function showErrorDialog(msg){\n var error_info = \"Error details:<br><br>\";\n if(!msg){\n error_info += \"[none]\";\n }else{\n error_info += msg;\n }\n\n $(ERROR_DIALOG_MESSAGE_BODY_SELECTOR).html(error_info);\n $(ERROR_DIALOG_SELECTOR).fadeIn(600);\n}", "title": "" } ]
6a12c397c011c32848186911f23d54c1
Event handler which will be automatically set on anchor tags with the "readmore" class inside of an enclosing element with the class "readmorecontext".
[ { "docid": "5c62b8ca2ab21461a75d3770111e1a5b", "score": "0.7584911", "text": "function readMore(event) {\r\n\tevent.preventDefault();\r\n var readmoreContext = _walkUpToReadmoreContext(event.target);\r\n if (!readmoreContext) {\r\n \tconsole.log('Error: readmore class used without an enclosing readmore-context')\r\n \treturn;\r\n }\r\n //Change visibility of all descendants with class .readmore\r\n var readmores = readmoreContext.querySelectorAll('.readmore');\r\n for (var i = 0; i < readmores.length; i++) {\r\n switch (readmores[i].tagName) {\r\n case 'A':\r\n \t readmores[i].style.display = 'none';\r\n \t break;\r\n \tcase 'SPAN':\r\n \t readmores[i].style.display = 'inline';\r\n \t break;\r\n \tdefault:\r\n \t readmores[i].style.display = 'block';\r\n }\r\n }\r\n //Display the .readless link(s)\r\n var readlesses = readmoreContext.querySelectorAll('a.readless');\r\n for (var i = 0; i < readlesses.length; i++) {\r\n readlesses[i].style.display = 'inline';\r\n }\r\n}", "title": "" } ]
[ { "docid": "d5e49e89f1b8d2cb34e8fc012655b7e2", "score": "0.7212882", "text": "function openReadMore(e){\t\n\t\t$(this).parent(\".desc\").addClass(\"more\");\n\t\t$(this).hide();\n\t}", "title": "" }, { "docid": "893dcbae3f03c531ab6f269d2f5f797f", "score": "0.676613", "text": "function readLess(event) {\r\n\tevent.preventDefault();\r\n var readmoreContext = _walkUpToReadmoreContext(event.target);\r\n if (!readmoreContext) {\r\n \tconsole.log('Error: readless class used without an enclosing readmore-context')\r\n \treturn;\r\n }\r\n //Change visibility of all descendants with class .readmore\r\n var readmores = readmoreContext.querySelectorAll('.readmore');\r\n for (var i = 0; i < readmores.length; i++) {\r\n \t//Hide the readmore link\r\n switch (readmores[i].tagName) {\r\n case 'A':\r\n \t readmores[i].style.display = 'inline';\r\n \t break;\r\n \tcase 'SPAN':\r\n \t readmores[i].style.display = 'none';\r\n \t break;\r\n \tdefault:\r\n \t readmores[i].style.display = 'none';\r\n }\r\n }\r\n //Hide the .readless link(s)\r\n var readlesses = readmoreContext.querySelectorAll('a.readless');\r\n for (var i = 0; i < readlesses.length; i++) {\r\n readlesses[i].style.display = 'none';\r\n }\r\n}", "title": "" }, { "docid": "a608ecc6bf0d6d92f852904914b6dd17", "score": "0.6726344", "text": "onLearnMoreLinkClicked(event) {\n showTextOverlay(this.learnMoreContent_);\n event.stopPropagation();\n }", "title": "" }, { "docid": "9e068cc77cce753dcb9c66bea58f302c", "score": "0.6574105", "text": "function showMoreContent() {\n\t$('.js_read_more').click(function(e){\n\t\te.preventDefault();\t\n\t\t$(this).parent().find($('.read_more_content')).slideToggle();\n\t\t$(this).toggleClass('active');\n\t});\n}", "title": "" }, { "docid": "fc85f041f90c89c0f0cae5def26c3386", "score": "0.6527713", "text": "function initReadMore()\n{\n $(document).on('click', '.expand-wrapper', function(){\n $('.expand').toggle(300);\n })\n}", "title": "" }, { "docid": "912fddf9df07db8e4384c28c6c3ba623", "score": "0.65107465", "text": "function seeReadMore() {\n\tjQuery(\"#show-this-on-click\").slideDown();\n\tjQuery(\".readmore\").hide();\n\tjQuery(\".readless\").show();\n}", "title": "" }, { "docid": "f8bf5cf8cfd61383b9385ee587132d6c", "score": "0.6275131", "text": "function _walkUpToReadmoreContext(element) {\r\n\tvar readmoreContext = element;\r\n while (readmoreContext && !readmoreContext.classList.contains('readmore-context')) {\r\n \treadmoreContext = readmoreContext.parentElement;\r\n }\r\n return readmoreContext;\r\n}", "title": "" }, { "docid": "42b87ad84a618a71cd8a947214815f5d", "score": "0.6100839", "text": "function setLearnMoreLinks() {\n $(\".learn-more-drop-content\").hide();\n $(\".learn-more-drop\").click(function () {\n \n $(this).next(\".learn-more-drop-content\").toggle();\n return false;\n });\n}", "title": "" }, { "docid": "3e9da2f21b541038063a89092d13f059", "score": "0.6096428", "text": "function ReadMoreToggle(readmore) {\n this.readmore = readmore;\n this.registerEvt(this.readmore);\n}", "title": "" }, { "docid": "915e34f06581cb2ac3c8dfa76c621fd7", "score": "0.6028016", "text": "function setMoreLinks() {\n\t$('.ac_results .products .footer a.showMoreLink').unbind('click').bind('click', function (e) {\n\t\te.preventDefault();\n\t\tGoToSearchResult(this, 'producten');\n\t});\n\t$('.ac_results .combinations .footer a.showMoreLink').unbind('click').bind('click', function (e) {\n\t\te.preventDefault();\n\t\tGoToSearchResult(this, 'combinaties');\n\t});\n\t$('.ac_results .information .footer a.showMoreLink').unbind('click').bind('click', function (e) {\n\t\te.preventDefault();\n\t\tGoToSearchResult(this, 'overigen');\n\t});\n}", "title": "" }, { "docid": "daeb39e45f624e6110e76bb87943b80f", "score": "0.6011833", "text": "function showMoreContent() {\n\t\n\t$('.js_readmore_block .text').each(function(){\n\t\tif($(this).innerHeight()<=\"30\"){\n\t\t$(this).parent().parent().find('.btn_read_more').css('display','none');\n\t\t$(this).parent().parent().find('.text_holder').css('height','auto');\n\t\t}\n\t})\n\t\n\t$('.js_read_more').click(function(e){\n\t\te.preventDefault();\t\n\t\te.stopPropagation();\n\t\tif($(this).hasClass('active')){\n\t\t\t$(this).parent().find('.text_holder').animate({height: \"35px\"}, 500)\n\t\t\t$(this).removeClass('active');\n\t\t}\n\t\telse {\n\t\t\tvar height = $(this).parent().find('.text').innerHeight();\n\t\t\t$(this).parent().find('.text_holder').animate({height: height+\"px\"}, 500)\n\t\t\t$(this).addClass('active');\n\t\t}\n\t\t\n\t});\n\t\n}", "title": "" }, { "docid": "f037a2da092d211fa9ba6182c0445a78", "score": "0.6008768", "text": "function handleShowMore() {\n $readMoreButton.removeClass(cssClass.hide);\n $descriptionText.addClass(cssClass.contracted);\n setTimeout(function() {\n $textContainer.removeClass(cssClass.innerHeight);\n }, 550);\n }", "title": "" }, { "docid": "4f4f01ba01a407810d5c66a852704b6e", "score": "0.5975743", "text": "function navExpandHandler(ev) {\n\t\t\tif (ev.target === moreEl) {\n\t\t\t\tpopulateMoreList(contentFilter.getHiddenItems());\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a749447086e046465124d05c3b7ef17c", "score": "0.5842985", "text": "function AddReadMore(tag_id, char_limit, text)\n{\n // Only update when the text changes. We strip the ' ... Read more'/' ... Read less' parts (14 characters)\n var original_text = $(\"#\" + tag_id).text();\n if (original_text.substring(0, original_text.length - 14) == text)\n return;\n\n if (text.length > char_limit)\n {\n var first_part = text.substring(0, char_limit);\n var second_part = text.substring(char_limit, text.length);\n var new_html = first_part + \"<span id='\" + tag_id + \"_second_part' class='hidden'>\" + second_part + \"</span> \" +\n \"<span onclick=\\\"$('#\" + tag_id + \"_second_part').toggle(); \" +\n \" $(this).text($(this).text() == '... Read more' ? '... Read less' : '... Read more');\\\" \" +\n \" class='clickable'>... Read more</span>\";\n }\n else\n {\n var new_html = text;\n }\n\n $(\"#\" + tag_id).html(new_html);\n}", "title": "" }, { "docid": "ade82e37aceb07ca15a301c2812933fc", "score": "0.58119345", "text": "function readMore() {\r\n\t\tif (isBreakpoint('xs')) {\r\n\t\t\t$('#intro .ourPresenceHiddenOnMobile').hide();\r\n\t\t\t$('#intro .readMore').show();\r\n\t\t\t$('#intro .readLess').hide();\r\n\r\n\t\t\t$('#intro .readMore a').on('click', function () {\r\n\t\t\t\t$('#intro .ourPresenceHiddenOnMobile').slideDown(function() {\r\n\t\t\t\t\tsidebarResize();\r\n\t\t\t\t});\r\n\t\t\t\t$('#intro .readMore').hide();\r\n\t\t\t\t$('#intro .readLess').show();\r\n\t\t\t});\r\n\r\n\t\t\t$('#intro .readLess a').on('click', function () {\r\n\t\t\t\t$('#intro .ourPresenceHiddenOnMobile').slideUp(function() {\r\n\t\t\t\t\tsidebarResize();\r\n\t\t\t\t});\r\n\t\t\t\t$('#intro .readMore').show();\r\n\t\t\t\t$('#intro .readLess').hide();\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t$('#intro .ourPresenceHiddenOnMobile').show();\r\n\t\t\t$('#intro .readMore').hide();\r\n\t\t\t$('#intro .readLess').hide();\r\n\t\t\t$('#intro .readMore a').off('click');\r\n\t\t\t$('#intro .readLess a').off('click');\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "69505eb566cc8fa4aef333a2149998ab", "score": "0.5807766", "text": "function expandAnime(e) {\n if ($(e).siblings(\".anime-description\").hasClass(\"less\")) {\n $(e).siblings(\".anime-description\").removeClass(\"less\");\n $(e).text(\"Read less\");\n } else {\n $(e).siblings(\".anime-description\").addClass(\"less\");\n $(e).text(\"Read more\");\n }\n}", "title": "" }, { "docid": "df91fef7352cd91b2fd5f4afadaf81a3", "score": "0.5804574", "text": "function changeLink(){\r\n $(\"a.more\").click(function () {\r\n var more = $(this).attr(\"moretext\");\r\n if (typeof more !== typeof undefined && more !== false) {\r\n $(this).text(function(i, text){\r\n return text === \"show less\" ? more : \"show less\";\r\n })\r\n }\r\n });\r\n}", "title": "" }, { "docid": "029079d23aee9080794b944a6a37cf95", "score": "0.5658311", "text": "function readMoreSetup() {\n if ($('.page-landing').length > 0) {\n if ($(window).width() > screen_md_min) {\n var rheight = $('.col-md-6.col-right').height();\n if ($('.col-md-6.col-left .text-wrapper').height() > rheight) {\n $('.lp2-show-more').remove();\n if ((rheight - 30) > 0) {\n $('.col-md-6.col-left .text-wrapper').css({\n 'height': rheight - 30,\n 'overflow': 'hidden'\n });\n $('.col-md-6.col-left .text-wrapper').after('<div class=\"lp2-show-more\"><a href=\"#\" class=\"closed more-link\">MORE</a></div>');\n }\n $('.lp2-show-more a').click(function (e) {\n e.preventDefault();\n if ($(this).hasClass('closed')) {\n $('.col-md-6.col-left .text-wrapper').css({\n 'height': '',\n 'overflow': ''\n });\n $(this).removeClass('closed')\n $(this).text('HIDE');\n }\n else {\n if ((rheight - 30) > 0) {\n $('.col-md-6.col-left .text-wrapper').css({\n 'height': rheight - 30,\n 'overflow': 'hidden'\n });\n $(this).addClass('closed')\n $(this).text('MORE');\n }\n }\n });\n }\n }\n else {\n $('.col-md-6.col-left .text-wrapper').css({\n 'height': '',\n 'overflow': ''\n });\n $('.lp2-show-more').remove();\n }\n\n if ($('.col a.more-link').length > 0) {\n $('.mask').remove();\n $('.col a.more-link').each(function () {\n $(this).parent().after('<div class=\"mask\"></div>');\n });\n }\n }\n }", "title": "" }, { "docid": "977e7fec9df7ca44c89ccd5b343d81ef", "score": "0.5656797", "text": "function animateLearnMore() {\n const learnMoreOffsetHeight = document.getElementById('more-info').offsetTop\n if (window.pageYOffset + window.innerHeight <= learnMoreOffsetHeight) { return }\n const buttons = document.querySelectorAll('.learn-more-link a')\n const animations = ['animated', 'bounceIn', 'slow']\n learnMoreAnimated = true\n buttons.forEach(button => button.classList.add(...animations))\n }", "title": "" }, { "docid": "977e7fec9df7ca44c89ccd5b343d81ef", "score": "0.5656797", "text": "function animateLearnMore() {\n const learnMoreOffsetHeight = document.getElementById('more-info').offsetTop\n if (window.pageYOffset + window.innerHeight <= learnMoreOffsetHeight) { return }\n const buttons = document.querySelectorAll('.learn-more-link a')\n const animations = ['animated', 'bounceIn', 'slow']\n learnMoreAnimated = true\n buttons.forEach(button => button.classList.add(...animations))\n }", "title": "" }, { "docid": "715dee5442acbfd10570324e8281f02e", "score": "0.56524324", "text": "function displayMoreDetails(moreDetails) {\n // console.log(moreDetails);\n\n moreDetails.click(function(evt) {\n \n var parentElement = (evt.target).parentElement;\n var desc = $(parentElement).children('.more-details').text();\n var target = $(parentElement).children('p');\n\n // console.log($(parentElement).children('i'));\n\n if (desc === \"Show more\") {\n target.slideToggle();\n $(parentElement).children('.more-details').text(\"Show less\");\n $(parentElement).children('i').toggleClass('fa-angle-down').addClass('fa-angle-up');\n } else {\n target.slideToggle();\n $(parentElement).children('.more-details').text(\"Show more\");\n $(parentElement).children('i').toggleClass('fa-angle-up').addClass('fa-angle-down');\n }\n });\n\n }", "title": "" }, { "docid": "4fb5529ff1d42fe51734858c608f16b5", "score": "0.5623412", "text": "function setupArticlesLoadMore() {\n var articlesButton = \".loadMoreArticles\"; \n var numberOfArticles = \".numberOfArticles\";\n\n $(articlesButton).click(function(e) {\n //Prevent Link Default Action\n e.preventDefault();\n\n //Get Current Number Chosen\n var count = $(numberOfArticles).val();\n\n //Load More Articles\n loadArticles(articlesIndex, count);\n });\n}", "title": "" }, { "docid": "d211365f985d4815874500a98c4faf44", "score": "0.5599811", "text": "function createReadMore(link) {\n var aTag = document.createElement('a');\n aTag.href = link;\n aTag.target = '_blank';\n aTag.text = 'Read More';\n return aTag; \n}", "title": "" }, { "docid": "8342b5675f8719eca1678f113400a595", "score": "0.5573641", "text": "function moreLessToggle() {\n var toggleLink = $(\"a.mlt\"); \t\t\t\t\t// The element doing the toggling & put it in memory\n var toggleTarget = $(\"h2.seo\"); \t\t\t\t// The element affected by the toggle & put it in memory\n var toggledClass = \"long\"; \t\t\t\t\t// The class being toggled\n\t\t\n var moreAbout = (propertyValues.moreAbout+\" \" + catDesc + \" \\u2192\"); \t// Copy for more\n var lessAbout = (propertyValues.lessAbout+\" \"+ catDesc + \" \\u2190\"); \t// Copy for less\n\t\t\n // By default, the toggleLink text says \"Back to top\", so let's overwrite it as needed\n if (toggleTarget.hasClass(toggledClass)) {\n toggleLink.text(lessAbout);\n } else {\n toggleLink.text(moreAbout);\n }\n\t\n toggleLink.click(function(){ \t\t\t\t\t\t\t\t\t\t// Target the element on click\n toggleTarget.toggleClass(toggledClass); \t\t\t\t\t\t\t// Apply the class as needed\n $(this).text($(this).text() == moreAbout ? lessAbout : moreAbout); // Change out the text as needed\n return false; \t\t\t\t\t\t\t\t\t\t\t\t\t// Override the anchor value\n });\n}", "title": "" }, { "docid": "b9a389662ee6f01dac91b56617f9f194", "score": "0.55647707", "text": "function activateMoreLessLink(container) {\n $(container).find(\".perc-moreLink, .perc-lessLink\").on(\"click\",function(){\n $(container).find('.perc-more-list, .perc-moreLink, .perc-lessLink').toggle().toggleClass('perc-visible perc-hidden');\n });\n }", "title": "" }, { "docid": "160faaff74249c78ecec3cf762c1133c", "score": "0.55007", "text": "function MarkAsRead() {\n\n /**\n * Setup the module\n */\n this.initialize = function (markAsReadOnNext) {\n // Add the \"Mark All as Read\" link\n var markAllAsReadLink = $('<li><a href=\"http://reddit.com\">mark all as read</a></li>').appendTo('.tabmenu');\n $(markAllAsReadLink).on('click', function (e) {\n e.preventDefault();\n this.markAllRead(e);\n }.bind(this));\n\n // Add mark as read checkmarks to all individual links\n $('.content .sitetable a.title').each(function (i, link) {\n var checkmark = $('<button class=\"burro-mark-as-read\">&#10004;</button>').prependTo($(link).parent());\n $(checkmark).on('click', this.onClickCheckmark.bind(this));\n }.bind(this));\n\n // Mark all as read on click \"next\" link at bottom of page\n if (markAsReadOnNext) {\n $('.nav-buttons a[rel~=\"next\"]').first().on('click', this.markAllRead.bind(this));\n }\n };\n\n this.markAllRead = function (e) {\n $('.content .sitetable a.title').each(function (i, link) {\n var url = $(link).attr('href');\n this.markAsRead(url);\n }.bind(this));\n };\n\n /**\n * Convert a relative url to an absolute url\n *\n * @param string url The url\n *\n * @return string\n */\n this.relativeToAbsolute = function (url) {\n if (url.match(/^\\//)) {\n url = window.location.origin + url;\n }\n return url;\n };\n\n /**\n * Triggered when we click a \"mark as read\" checkmark\n *\n * @param object event The event\n */\n this.onClickCheckmark = function (event) {\n var url = $(event.target).parent().find('a.title').first().attr('href');\n url = this.relativeToAbsolute(url);\n this.toggleRead(url);\n };\n\n /**\n * Toggle the read status for the selected url\n *\n * @param string url The url\n */\n this.toggleRead = function (url) {\n chrome.runtime.sendMessage({\n module: \"mark_as_read\",\n action: \"toggle\",\n params: {\n url: this.relativeToAbsolute(url)\n }\n });\n };\n\n /**\n * Mark the selected url as read\n *\n * @param string url The url\n */\n this.markAsRead = function (url) {\n chrome.runtime.sendMessage({\n module: \"mark_as_read\",\n action: \"add\",\n params: {\n url: this.relativeToAbsolute(url)\n }\n });\n };\n}", "title": "" }, { "docid": "52ebbeedb6655d3210279f03e7ea1d66", "score": "0.5478917", "text": "function seeLearnMore() {\n\tjQuery(\"#learnmoretext\").slideToggle();\n\tjQuery(\".learnmore\").hide();\n}", "title": "" }, { "docid": "22097b68b51ce285cd6684763c61103d", "score": "0.54760575", "text": "function createReadMore(element) {\n var $elem = $(element),\n readMoreInstance = new ReadMore();\n\n readMoreInstance.init($elem, isNarrow());\n elements.push(readMoreInstance);\n }", "title": "" }, { "docid": "c8074ffa81ba49292836ad7becb6041c", "score": "0.54756516", "text": "function faqInit() {\r\n $(\"#faq_content\").find(\".title\").click(function(){\r\n $(\"#faq_content\").find(\".on\").removeClass(\"on\");\r\n $(\"#faq_content\").find(\".content\").hide();\r\n var el = $(this);\r\n el.addClass(\"on\");\r\n el.next().show();\r\n });\r\n}", "title": "" }, { "docid": "000e78037350ca643f600f33414c87f5", "score": "0.54658353", "text": "function seeLess(){\n\tjQuery(\"#show-this-on-click\").slideUp();\n\tjQuery(\".readless\").hide();\n\tjQuery(\".readmore\").show();\n}", "title": "" }, { "docid": "c7e3d10fbef20cc249f18f30248ba9d2", "score": "0.5454587", "text": "function dtmMore(){\n\tdtmVars('link name', 'tickets more');\n\tdtmTrack('link click');\n}", "title": "" }, { "docid": "666feec36253d7c498b1ce784bf95034", "score": "0.5451029", "text": "function btnHndlr_LearnMore() {\n $('.card-footer').on('click', '.card-button', event => {\n event.preventDefault();\n let targetID = $(event.target).parents('.card').attr('id');\n renderDetailsView(targetID);\n });\n}", "title": "" }, { "docid": "782b2be88c0dab5dc3b9d517d4bcd585", "score": "0.54376763", "text": "function moreLessToggleNew() {\n\tvar catDesc = $(\"#intro h1\").text(),\t\t\t\t\t\t\t\t\t\t// Category description duh overwrite page level\n\ttoggleLink = $(\"a.moreLT\"), \t\t\t\t\t\t\t\t\t\t\t// The element doing the toggling & put it in memory\n toggleTarget = $(\"h2.seo\"), \t\t\t\t\t\t\t\t\t\t\t// The element affected by the toggle & put it in memory\n toggledClass = \"long\", \t\t\t\t\t\t\t\t\t\t\t\t// The class being toggled\n moreAbout = (propertyValues.moreAbout+\" \"+ catDesc), \t\t\t\t\t// Copy for more\n lessAbout = (propertyValues.lessAbout+\" \"+ catDesc); \t\t\t\t\t// Copy for less\n\t//toggleLink.text(moreAbout);\n // By default, the toggleLink class is \"moreSeo\", so change it as \"lessSeo\"\n /*if (toggleTarget.hasClass(toggledClass)) {\n toggleLink.addClass('lessSeo');\t\t\t\n } else {\n toggleLink.removeClass('lessSeo');\n }\n\t*/\n toggleLink.click(function(){ \t\t\t\t\t\t\t\t\t// Target the element on click\n toggleTarget.toggleClass(toggledClass); \t\t\t\t\t\t\t// Apply the class as needed\n\t\t\t \n if (toggleTarget.hasClass(toggledClass)) {\t\t\t\t\t\t\t// Apply the class as needed\n toggleLink.addClass('lessSeo');\n } else {\n toggleLink.removeClass('lessSeo');\n }\n $(this).text($(this).text() == moreAbout ? lessAbout : moreAbout); // Change out the text as needed\n return false; \t\t\t\t\t\t\t\t\t\t\t\t\t// Override the anchor value\n });\n}", "title": "" }, { "docid": "85070d7ad8c5ee9ce6b7d8115ba4af93", "score": "0.54314107", "text": "function readMoreText() {\n $readMoreJS.init({\n target: '.details-Overview', // Selector of the element the plugin applies to (any CSS selector, eg: '#', '.'). Default: ''\n numOfWords: 40, // Number of words to initially display (any number). Default: 50\n toggle: true, // If true, user can toggle between 'read more' and 'read less'. Default: true\n moreLink: 'Read more', // The text of 'Read more' link. Default: 'read more ...'\n lessLink: 'Read less' // The text of 'Read less' link. Default: 'read less'\n });\n}", "title": "" }, { "docid": "45859f114bb3d7cb5bac740c8e42a443", "score": "0.5416447", "text": "function openMore(selectedContent) {\n\t\t$(selectedContent + ' a').click(function () {\n\t\t\t$(selectedContent + ' ul').toggleClass('open');\n\t\t\t$(selectedContent + ' a').toggleClass('close');\n\t\t});\n\t}", "title": "" }, { "docid": "95c0873d1aba7cf4db30009aba2c8ec0", "score": "0.5411977", "text": "open_faq(el) {\n // Add the open class to the element\n $(el).addClass('open');\n }", "title": "" }, { "docid": "0a06184610ec68553ea52142f17a9163", "score": "0.5338308", "text": "function qodeBlogHeadlines() {\n \"use strict\";\n\n if($j('.blog_headlines').length) {\n var $this = $j('.blog_headlines');\n\n var showTitles = function () {\n $this.bigtext({\n childSelector: '> article > h2',\n\t minfontsize: 20\n });\n\n $this.find('h2').appear(function () {\n $j(this).addClass('show');\n }, {accX: 0, accY: -100});\n };\n showTitles();\n\n if( $this.hasClass('blog_infinite_scroll')){\n $this.infinitescroll({\n navSelector : '.blog_infinite_scroll_button span',\n nextSelector : '.blog_infinite_scroll_button span a',\n itemSelector : 'article',\n loading: {\n finishedMsg: finished_text,\n msgText : loading_text\n }\n },\n function() {\n showTitles();\n }\n );\n }else if($this.hasClass('blog_load_more')){\n var i = 1;\n $j('.blog_load_more_button a').off('click tap').on('click tap', function(e) {\n e.preventDefault();\n\n var link = $j(this).attr('href');\n var $content = '.blog_load_more';\n var $anchor = '.blog_load_more_button a';\n var $next_href = $j($anchor).attr('href');\n $j.get(link+'', function(data){\n var $new_content = $j($content, data).wrapInner('').html();\n $next_href = $j($anchor, data).attr('href');\n $this.append( $j( $new_content) );\n\n showTitles();\n\n if($j('.blog_load_more_button span').attr('rel') > i) {\n $j('.blog_load_more_button a').attr('href', $next_href); // Change the next URL\n } else {\n $j('.blog_load_more_button').remove();\n }\n });\n i++;\n });\n\n }\n }\n}", "title": "" }, { "docid": "6dce1182fc392974a6a72f98bde4d4f1", "score": "0.5329949", "text": "function readMore() {\r\n\t var dots = document.getElementById(\"dots\");\r\n\t var moreText = document.getElementById(\"more\");\r\n\t var btnText = document.getElementById(\"readMoreBtn\");\r\n\r\n\t if (dots.style.display === \"none\") {\r\n\t dots.style.display = \"inline\";\r\n\t btnText.innerHTML = \"Read more\";\r\n\t moreText.style.display = \"none\";\r\n\t } else {\r\n\t dots.style.display = \"none\";\r\n\t btnText.innerHTML = \"Read less\";\r\n\t moreText.style.display = \"inline\";\r\n\t }\r\n\t}", "title": "" }, { "docid": "8d0038deeef34a30fddda48d5033d372", "score": "0.5328182", "text": "function clickSeeMore() {\n found = true\n while(found == true) {\n var seeMore = document.evaluate('//div[text()=\\'See More\\']', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n if(seeMore) {\n window.scroll(0,findPos(seeMore)-200);\n seeMore.click();\n } else {\n found = false;\n }\n }\n}", "title": "" }, { "docid": "50ee8824bb7dd337fc5f27449ff06058", "score": "0.5311877", "text": "expandingLinks() {\n\t\tconst panel = $('.expanding-two-column-list');\n\t\tconst list = panel.find('.expanding-list');\n\t\tconst displayCount = list.data('default-showing');\n\n\t\tconst showItems = () => {\n\t\t\tfor (var i = displayCount; i < list.find('li').length; i++) {\n\t\t\t\t$(list.find('li')[i]).addClass('hide');\n\t\t\t}\n\t\t};\n\t\tshowItems();\n\n\t\t$('.read-more.list.more').on('click', () => {\n\t\t\tpanel.addClass('expanded');\n\t\t\t$(list.find('li')).removeClass('hide');\n\t\t});\n\n\t\t$('.read-more.list.less').on('click', () => {\n\t\t\tpanel.removeClass('expanded');\n\t\t\tshowItems();\n\t\t});\n\n\n\t}", "title": "" }, { "docid": "c7fec7a62cf43c022f012fad5f5770ca", "score": "0.5307654", "text": "function handleArticleClick(e, id) {\n let dataset = e.target.dataset;\n let category = dataset['category'];\n let url = dataset['url'];\n handleReadArticleProcess(category, url);\n removeSpan(id);\n window.open(url, '_blank');\n}", "title": "" }, { "docid": "da99e93a79830e8a697428531a7340be", "score": "0.529508", "text": "function expandDescription(entireDescriptionContent) {\n var showLessLinkHtml = '<a id=\"description_less\" href=\"#\" class=\"brand-link\">Less</a>';\n HtmlUtils.setHtml('.course-description', HtmlUtils.HTML(entireDescriptionContent + showLessLinkHtml));\n $('#description_less').click(function(event) {\n event.preventDefault();\n truncateDescription(entireDescriptionContent); // eslint-disable-line no-use-before-define\n });\n }", "title": "" }, { "docid": "c22f08161821a0e84d03f40ea9a7f72b", "score": "0.52829653", "text": "function handleArticleLinkClick(e, link) {\n e.preventDefault();\n if (link.hasAttribute(\"href\") && link.attributes.href.value.length) {\n var parentArticleWrap = e.target.closest(dotb + '__single-article-wrap');\n parentArticleWrap.querySelector(dotb + '__article-wrap--content').style.opacity = \"0.3\";\n parentArticleWrap.querySelector(dotb + '__article-wrap--content').style.pointerEvents = \"none\";\n fetchAndRenderArticle(link.attributes.href.value);\n }\n }", "title": "" }, { "docid": "033ded6b8fd18fdee4a7f477ae13fe4b", "score": "0.52829427", "text": "function addMoreLink() { /*[1]*/\n\t\ts.resultsList.append('<li><a id=\"wc-submit-search-b\"><span class=\"wc-link-title\">See more results...</span></a></li>'); \n\t\t$('#wc-submit-search-b').click(function (event) { /*[2]*/\n\t\t\t$('#wc-search-form').submit();\n\t\t\tevent.preventDefault();\n\t\t});\n\t}", "title": "" }, { "docid": "5f8ef2aadd966476ad37bad932f8cb99", "score": "0.5273473", "text": "function loadMoreText() {\n \n var blogArray = document.querySelectorAll(\".read_more_btn\");\n\n blogArray.forEach((item, index) => {\n item.addEventListener('click', () => {\n // console.log(index)\n var readMoreBtn = document.getElementById(\"id_read_more_btn_\" + `${index}`);\n readMoreBtn.style.display = \"none\";\n var dots = document.getElementsByClassName(\"three_dots\")[`${index}`];\n dots.style.display = \"none\";\n var showMoreText = document.getElementById(\"more_blog_text_\" + `${index}`);\n showMoreText.style.display = \"block\";\n\n })\n });\n\n\n // var readMoreBtn = document.getElementById(\"id_read_more_btn_\"+1);\n // readMoreBtn.style.display = \"none\";\n // var dots = document.getElementsByClassName(\"three_dots\")[1];\n // dots.style.display = \"none\";\n // var showMoreText = document.getElementById(\"more_blog_text_1\");\n // showMoreText.style.display = \"block\";\n}", "title": "" }, { "docid": "08293e1b75ad22dda9c2925651624ad7", "score": "0.5268269", "text": "function bindRefs() {\n // First unbind to avoid multiple calls after clicking on reference\n $('.intref, .extref').unbind();\n $('.intref, .extref').bind('click', function(e) {\n // Don't register as click in parent elements\n e.stopPropagation();\n \n var about = $(e.target).attr('about');\n if (about) {\n loadReferenceContent(about);\n }\n else {\n alert('Deze link werkt niet');\n }\n });\n}", "title": "" }, { "docid": "ae1bc4ab6a3e4ee13f786b32b1ade41d", "score": "0.5237824", "text": "function wp_manga_scroll_on_click(){\n\t\tif($('body').hasClass('click-to-scroll')){\n\t\t\t$('.manga-reading-list-style .chapter-type-manga .reading-content').on('click', function(){\n\t\t\t\t$('html, body').animate({scrollTop: $(document).scrollTop() + 500 }, 200);\n\t\t\t});\n\t\t\t\n\t\t\t$('.chapter-type-text .reading-content').on('click', function(){\n\t\t\t\t$('html, body').animate({scrollTop: $(document).scrollTop() + 500 }, 1000);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "613b040dbdb61eeb02478abb035e0f6b", "score": "0.5231914", "text": "function readMoreLess(){\n if($('#eventDescriptionID').hasClass('clampDescription')){ unClampDescription() }\n else { clampDescription() }\n}", "title": "" }, { "docid": "7fc5ff7b46e7446a819f81ac662843a1", "score": "0.5223638", "text": "function addClickListener(element, ref, ev) {\n const anchorRef = element.querySelector('a').getAttribute(ref);\n element.addEventListener(ev, function () {\n scrollToAction(anchorRef);\n });\n element.addEventListener(ev, function () {\n lastClickedClassAdd(element);\n });\n}", "title": "" }, { "docid": "bf896deb6512e406c5a0d06fa621a15c", "score": "0.52213115", "text": "function setupExpandClicks() {\n\t\t\n\t\t$('.more .reveal').slideToggle(0);\n\t\n\t\t$('.explanation .more .trigger').click(function(){\n\t\t\tvar r = $(this).parent().find('.reveal');\n\t\t\tif ( r.css('display') == 'none') {\n\t\t\t\t$(this).html('less...'); \n\t\t\t} else {\n\t\t\t\t$(this).html('more...')\n\t\t\t}\n\t\t\tr.slideToggle();\n\t\t});\n\t\n\t\t$('.notes .more .trigger').click(function() {\n\t\t\tvar r = $(this).parent().find('.reveal');\n\t\t\tif ( r.css('display') == 'none') {\n\t\t\t\t$(this).html('Click to hide data sources and methodology'); \n\t\t\t} else {\n\t\t\t\t$(this).html('Click to show data sources and methodology')\n\t\t\t}\n\t\t\tr.slideToggle();\n\t\t});\n\t}", "title": "" }, { "docid": "4704a7d32526fc865505fefc1d65b54f", "score": "0.5192679", "text": "function onShowMoreClick() {\n onShowMoreText(false);\n\n setParaText(setTextValue(paraText.length));\n }", "title": "" }, { "docid": "2372b3c8d99ed228e6b57e14a4721a67", "score": "0.51838315", "text": "function onLoadMore() {\n util.ajaxloader.show();\n remainingArticles = totalArticles - endRange;\n startRange = endRange + 1;\n\n if (remainingArticles <= pagination) {\n endRange = endRange + remainingArticles;\n $loadMoreBtn.addClass(cssClass.hidden);\n } else {\n endRange = endRange + pagination;\n }\n getData(startRange, endRange, 'clicked');\n }", "title": "" }, { "docid": "5a9b6a661db28fb76a6f0d5060dd5ed0", "score": "0.51831007", "text": "function createOnClick() {\n $('#learn-more').on('click', function() {\n mixpanel.track('DEMO | Demo complete learn more Button Click');\n })\n }", "title": "" }, { "docid": "06c2b2e0bdfa46db7bf9ae64ca947d87", "score": "0.5155119", "text": "handleClick(e) {\n var moreInfo = e.target.id +'bio';\n $('#'+moreInfo).toggle();\n }", "title": "" }, { "docid": "05b62c6923721a633f0ec30e1c470778", "score": "0.5147881", "text": "_init_event() {\n // Using the jquery each function go through our array\n // each returns, the index (idx), and the el (element)\n $(this.$items).each((idx, el) => {\n // Using jquery selector on el add a click event - using the third argument (child element) of the click function\n $(el).on('click', '.question', (e) => {\n // Prevent the default functionality\n e.preventDefault();\n\n // Use a new function and pass in el (the element)\n this.toggle_faq(el);\n });\n });\n }", "title": "" }, { "docid": "b48352b08d199dc752fe857ff0f541f6", "score": "0.51442474", "text": "function bind_click_to_main_links(){\n $('.dm_main_link').click( function(){\n var resource = $('span',this).attr('title');\n loadMK(resource); \n });\n}", "title": "" }, { "docid": "89467d27b4f13ee0d3d79a6907181371", "score": "0.5143887", "text": "function arrClick() {\n\t$('.items div.has-more') .find('div.more-arr') .click(function() {\n\t\t$('span.close') .show();\n\t\t$('#actions') .hide();\n\t\t$('.news-pagination') .hide();\n\t\t$('div#more-container') .empty() .prepend($itemContents) .fadeIn('normal');\n\t\t$('div#more-container .scroll-fix') .css('height', '500px');\n\t\t$('div#more-container .scrollable-news-parag') .css('height', '460px') .addClass('scroll-pane');\n\t\t$('div#more-container div.item-info') .css('height', '500px');\n\t\t$('div#more-container div.more-arr') .hide();\n\t\t$('div.mail-tooltip') .remove();\n\t\temailTooltip();\n\t\t// re-initialize plugins for the newly emplemented data.\n\t\tif (navigator.appName != 'Microsoft Internet Explorer') {\n\t\tCufon.replace('h4');\n\t\t}\n\t\t$('.scroll-pane').show().jScrollPane({reinitialiseOnImageLoad:true, scrollbarMargin:15});\n\t\t$('a.lightbox').lightBox({overlayBgColor: '#1a1b1d'});\n\t\t\n\t});\n\t}", "title": "" }, { "docid": "e7e363b2df8ab1eceab884496806ed48", "score": "0.5143082", "text": "function linkHighlight() {\r\n\t\t\tvar $this = $(this);\r\n\t\t\t\r\n\t\t\tshowLoader(function() {\r\n\t\t\t\tif($('body').hasClass('real-accessability-linkHighlight')) {\r\n\t\t\t\t\t$('body').removeClass('real-accessability-linkHighlight');\r\n\t\t\t\t\t$this.removeClass('clicked');\r\n\t\t\t\t\tobj.linkHighlight = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$('body').addClass('real-accessability-linkHighlight');\t\r\n\t\t\t\t\t$this.addClass('clicked');\r\n\t\t\t\t\tobj.linkHighlight = true;\r\n\t\t\t\t}\t\r\n\t\t\t});\t\t\r\n\t\t}", "title": "" }, { "docid": "2307717bbaaaea80041ffd06dea183c9", "score": "0.51325536", "text": "function createLinks(e){\n const aArray = ul.getElementsByTagName('a');\n for(let i = 0; i<aArray.length; i++){\n aArray[i].className = '';\n }\n e.target.className = 'active';\n showPage(searchResult, e.target.textContent);\n}", "title": "" }, { "docid": "710121ca09cc6e03b5377bc4ecc7c56e", "score": "0.51301116", "text": "function showMoreInfo() {\n toggleHideDisplay(this.parentElement.querySelector('.additional-info')) \n}", "title": "" }, { "docid": "3840560cabf1ef4c38b5447b1dc613e1", "score": "0.5125934", "text": "function toggleLinkDetails( e ) {\n e.preventDefault();\n e.stopPropagation();\n var el = $( this );\n if ( el.hasClass( 'expand' ) ) {\n $( '#' + this.id + '-d' ).slideDown();\n el.removeClass( 'expand' ).addClass( 'collapse' );\n }\n else {\n $( '#' + this.id + '-d' ).slideUp();\n el.removeClass( 'collapse' ).addClass( 'expand' );\n }\n }", "title": "" }, { "docid": "7c3ee7b38969ccb6c1914693623fe6b4", "score": "0.51236856", "text": "function callAddMoreContent(){\n addMoreContent(events, \"searchResult\");\n}", "title": "" }, { "docid": "efbdaf64365fa81adae571ab8ff11a05", "score": "0.5123253", "text": "function showMoreContent() {\n\t\n\t$('.comments_block_2 .comment_text_block_2 .inner').each(function(){\n\t\tif($(this).innerHeight()<=\"50\"){\n\t\t$(this).parent().parent().find('.btn_comment_more').css('display','none');\n\t\t$(this).parent(),find('.comment_text_block_2').css('height','auto');\n\t\t}\n\t})\n\t\n\t$('.js_show_more_comment').click(function(e){\n\t\te.preventDefault();\t\n\t\te.stopPropagation();\n\t\tif($(this).hasClass('active')){\n\t\t\t$(this).parent().find('.comment_text_block_2').animate({height: \"50px\"}, 500)\n\t\t\t$(this).removeClass('active');\n\t\t}\n\t\telse {\n\t\t\tvar height = $(this).parent().find('.inner').innerHeight();\n\t\t\t$(this).parent().find('.comment_text_block_2').animate({height: height+\"px\"}, 500)\n\t\t\t$(this).addClass('active');\n\t\t}\n\t\t\n\t\t\n\t});\n\t\n}", "title": "" }, { "docid": "d18b6c46c82fc6cbea0035c7c9ad9950", "score": "0.51061285", "text": "toggleShowMore() {}", "title": "" }, { "docid": "90e835fdaa80863db966220ebd304edc", "score": "0.5090315", "text": "function selectContent() {\r\n // PREVENT DEFAULT BEHAVIOUR OF A LINK TAG\r\n // GET THE VALUE OF href ATTRIBUTE OF THE CLICKED LINK\r\n // CALL THE FUNCTION loadContent PROVIDING THE href\r\n // VALUE OF THE CLICKED LINK AS THE VALUE FOR THE PARAMETER\r\n // OF loadContent FUNCTION.\r\n // CLOSE YOUR FUNCTION selectContent HERE\r\n}", "title": "" }, { "docid": "7a3d4cc4717be8404d044a02b6eb3571", "score": "0.508962", "text": "function tagClickHandler(event) {\n\n /* prevent default action for this event */\n event.preventDefault();\n\n /* make new constant named \"clickedElement\" and give it the value of \"this\" */\n const clickedElement = this;\n // console.log('Link was clicked!');\n\n /* make a new constant \"href\" and read the attribute \"href\" of the clicked element */\n const href = clickedElement.getAttribute('href');\n\n\n /* make a new constant \"tag\" and extract tag from the \"href\" constant */\n const tag = href.replace('#tag-', ''); // zamienia tekst #tag- na punsty ciag znakow\n\n /* find all tag links with class active */\n const activeTagLinks = clickedElement.querySelectorAll('a.active[href^=\"#tag-\"]');\n\n\n /* START LOOP: for each active tag link */\n for (let activeTagLink of activeTagLinks) {\n\n /* remove class active */\n activeTagLink.classList.remove('active');\n\n /* END LOOP: for each active tag link */\n }\n /* find all tag links with \"href\" attribute equal to the \"href\" constant */\n const hrefTagLinks = document.querySelectorAll('a[href=\"' + href + '\"]');\n\n /* START LOOP: for each found tag link */\n for (let hrefTagLink of hrefTagLinks) {\n\n /* add class active */\n hrefTagLink.classList.add('active');\n\n /* END LOOP: for each found tag link */\n }\n /* execute function \"generateTitleLinks\" with article selector as argument */\n generateTitleLinks('[data-tags~=\"' + tag + '\"]');\n}", "title": "" }, { "docid": "e53fb87e772f74e109895e05d9c0d253", "score": "0.5088708", "text": "function setMoreElClass(remainingItems) {\n\t\t\tif (!moreEl) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tif (remainingItems === 0) {\n\t\t\t\tmoreEl.classList.add('o-hierarchical-nav__more--all');\n\t\t\t\tmoreEl.classList.remove('o-hierarchical-nav__more--some');\n\t\t\t} else {\n\t\t\t\tmoreEl.classList.add('o-hierarchical-nav__more--some');\n\t\t\t\tmoreEl.classList.remove('o-hierarchical-nav__more--all');\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "45ef027a27881344f623c34cdbbb6fe3", "score": "0.5088257", "text": "function initSeeMoreButton() {\n // posts.forEach(w => console.log(w))\n posts.splice(0, 6);\n $('.p-see-more-btn').click(function () {\n var next = posts.splice(0, 6);\n for (var i = 0; i < next.length; i++) {\n $('.posts-container').append(generatePostElement(next[i]));\n }\n if (posts.length === 0) {\n $('.p-see-more-btn').remove();\n }\n initSupportPostListener();\n });\n }", "title": "" }, { "docid": "4afa41dfe8364316ed970653ad4cb99a", "score": "0.50873345", "text": "function shouldBookExpand(book, contentDiv) {\n if (book.description.length > 250) {\n let slicedDescription = book.description.slice(0, 251)\n let descriptionDiv = helper.createElement('div', ['description-div']) \n let read = helper.createElement('span', ['read-more'], {'textContent': 'Read More...', 'data-expand': false })\n read.style.color = 'blue'\n read.style.marginLeft = '5px'\n read.style.cursor = 'pointer'\n let description = helper.createElement('span', ['description'], {'textContent': 'Description ' + slicedDescription})\n read.addEventListener('click', function(e) {\n if (e.target['data-expand']) {\n e.target['data-expand'] = false\n description.textContent = 'Description: ' + slicedDescription\n e.target.textContent = 'Read More...'\n }\n else {\n e.target['data-expand'] = true\n description.textContent = 'Description: ' + book.description\n e.target.textContent = 'Read Less...'\n }\n })\n descriptionDiv.appendChild(description)\n descriptionDiv.appendChild(read)\n contentDiv.appendChild(descriptionDiv)\n }\n else {\n let description = helper.createElement('div', ['description'], {'textContent': 'Description: ' + book.description}) \n contentDiv.appendChild(description)\n }\n}", "title": "" }, { "docid": "a3d4da3418fab74255009b33a40c0eff", "score": "0.5076275", "text": "function _bindEvents() {\n\t\t$doc.on( 'click', 'a', _menuSomething );\n\t}", "title": "" }, { "docid": "c51f21e742be26419105a6e1dc3f6f86", "score": "0.5075952", "text": "function setMore(){\nfor(var i=0;i<nodes.length;i++){\nnodes[i].outerHTML += '<span id=\"showMore'+i+'\" class=\"transition-opacity\">...<a onclick=\"javascript:more('+i+','+nodes[i].offsetHeight+')\">+</a></span>';\nnodes[i].style.height=0;\nnodes[i].style.display='none';\n}\n}", "title": "" }, { "docid": "3256ee437dd1ecda045c4e1bddac364c", "score": "0.507064", "text": "function loadMoreNews() {\r\n getNewsArticles(vm.currentPage, vm.pageSize, vm.keyword);\r\n vm.currentPage = vm.currentPage + 1;\r\n }", "title": "" }, { "docid": "aed92fbb09a7d73890b5296bc284bfd2", "score": "0.50697386", "text": "function toggleClass(item) {\n $(item).each(function (i) {\n $(this).on(\"click\", function (e) {\n e.preventDefault();\n $(\".more\").eq(i).toggleClass(\"more-active\");\n $(\".prodWrapper\").eq(i).toggleClass(\"prodWrapper-active\");\n });\n });\n }", "title": "" }, { "docid": "02e06a749c2c5ecf7c6158a3ec2a4cdc", "score": "0.5069431", "text": "function showMoreInfo(event)\n{\n $(this).closest('#tour-panel').find('.hidden-text').slideToggle();\n}", "title": "" }, { "docid": "95686cb6618bceaeaa67ca12d63869f5", "score": "0.5068463", "text": "function loadMoreDone(response) {\n if (response.html)\n _content.append(response.html);\n\n if (!response.hasNext)\n $('.pager.more,.pager-more', _element).addClass('hidden');\n }", "title": "" }, { "docid": "9567e0df4c24140f61a838372070bbcb", "score": "0.5066511", "text": "function recMeMore() {\n\t$('.alsolike').on('click',function(e) {\n\t\tvar moreLikes = $('.morelike').val();\n\t\tif (moreLikes !== '') {\n\t\t\t$('#grid-section').fadeOut();\n\t\t\t$('.thumbs, .portfolio-content').empty();\n\t\t\t$('#load-section').fadeIn();\n\t\t\t//Send the query to Tastekid!\n\t\t\tgetTastedive(userLikes, moreLikes);\n\t\t\tsetTimeout(function() {\n\t\t\t\t$('#load-section').fadeOut('fast', function() {\n\t\t\t\t\t$('#grid-section').show();\n\t\t\t\t});\n\t\t\t}, 4600);\n\t\t\t$('.morelike').val('');\n\t\t}\n\t\te.preventDefault();\n\t})\n}", "title": "" }, { "docid": "929973f0a1294db2cd78c8a6b40241b6", "score": "0.5062103", "text": "function addClickOnMore() {\n $(\".more\").click(evt => {\n evt.stopPropagation();\n removeAllClicked();\n let toggleNode = null;\n if ($(evt.target).hasClass(\"dropdown\")) {\n toggleNode = evt.target;\n } else if ($(evt.target).parents(\".dropdown\")[0]) {\n toggleNode = $(evt.target).parents(\".dropdown\")[0];\n } else {\n toggleNode = $(evt.target).children(\".dropdown\")[0];\n }\n if ($(evt.target).parents(\".model\")[0]) {\n addModelClicked($(evt.target).parents(\".model\")[0]);\n } else if ($(evt.target).parents(\".project_header\")[0]) {\n addProjectClicked($(evt.target).parents(\".project_header\")[0]);\n }\n $(toggleNode).dropdown(\"toggle\");\n });\n}", "title": "" }, { "docid": "53459c3a57481a0db401a8773f19eaab", "score": "0.5054364", "text": "function LoadMore(count,item,more) {\n\t\tlist_count = $(item).size();\n\t\titems = count;\n\t\t$(item + ':lt(' + items + ')').slideDown();\n\t\t$(more).click(function () {\n\t\t\tconsole.log(\"more clicked\")\n\t\t\titems = (items + count <= list_count) ? items + count : list_count;\n\t\t\t$(item + ':lt(' + items + ')').slideDown('fast');\n\n\n\t\t});\n\t}", "title": "" }, { "docid": "7553bfcca24817589e7365e68a68651a", "score": "0.50452346", "text": "function listenAboutMe() {\n $(\".about\").on(\"click\", event => {\n $(\".explanation-text\").removeClass(\"hidden\");\n $(\".about\").addClass(\"hidden\");\n });\n}", "title": "" }, { "docid": "9044b59e1445e9b5042dc7c32041f07d", "score": "0.5042011", "text": "function toggleLink( $link, state )\n {\n state = state || HIDE;\n\n var $first = $children.eq(0).prev(),\n $parent;\n\n // Hiding\n if ( state == HIDE )\n {\n\n // find the element that gets the \"more\" link\n if ( $first.length < 1 )\n {\n $first = $string.closest( EXCLUDE_SELECTOR );\n }\n\n // if no element, use the parent\n if ( $first.length < 1 )\n {\n $first = $this;\n }\n\n // no matching kids or set to auto_display, don’t bother\n if ( ! auto_display &&\n $children.length )\n {\n\n // existing link\n if ( $link != UNDEFINED )\n {\n $link.text( MORE )\n // swap the class\n .addClass( REVEAL )\n .removeClass( HIDE );\n\n // relocate to the previous child?\n if ( embed )\n {\n $first.append(\n $more_link\n .prepend( $ellipsis.clone() )\n );\n }\n }\n\n // non-existant link (first run?)\n else if ( ! has_link )\n {\n $more_link = $reveal.clone();\n\n // embed it in the previous child?\n if ( embed )\n {\n $more_link = $more_link.find('a')\n .wrap('<span class=\"' + MORE_LINK + '\"/>')\n .parent()\n .prepend( $ellipsis.clone() );\n $first.append( $more_link );\n }\n else\n {\n $this.closest(':not(ol,ul,dl)')\n .append( $more_link );\n }\n }\n else\n {\n $link = $more_link.find('a')\n .addClass( REVEAL );\n\n // swap out \"All\" for \"More\"\n $link.html( $link.html().replace( ALL, MORE ) );\n }\n\n // set up the reveal\n $more_link.on( tap_evt, A, toggle );\n }\n }\n\n // Showing\n else if ( state == SHOW &&\n $link )\n {\n // swap the class\n $link.removeClass( REVEAL );\n\n // collapsible?\n if ( collapsible )\n {\n $link.text( 'Less' )\n .addClass( HIDE );\n\n // relocate to the last child?\n if ( embed )\n {\n $children.last()\n .append( $more_link );\n\n $more_link.find( ELLIPSIS_SELECTOR )\n .remove();\n }\n }\n\n // it’s been fun but you work here is done\n else if ( ! has_link )\n {\n $parent = $link.parent();\n if ( $parent.is( MORE_SELECTOR ) )\n {\n $parent.remove();\n }\n else\n {\n $link.remove();\n }\n }\n\n // Existing link\n else\n {\n // swap out \"More\" for \"All\"\n $link.html( $link.html().replace( MORE, ALL ) );\n\n $more_link.off( tap_evt, A, toggle );\n }\n }\n }", "title": "" }, { "docid": "1a41d946393994066d25332b89576edf", "score": "0.5021226", "text": "function e(n,o){this.$body=t(document.body),this.$scrollElement=t(t(n).is(document.body)?window:n),this.options=t.extend({},e.DEFAULTS,o),this.selector=(this.options.target||\"\")+\" .nav li > a\",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on(\"scroll.bs.scrollspy\",t.proxy(this.process,this)),this.refresh(),this.process()}", "title": "" }, { "docid": "84f2eaf7e039579b3ca154723119caca", "score": "0.50202394", "text": "function e(n,i){this.$body=t(document.body),this.$scrollElement=t(n).is(document.body)?t(window):t(n),this.options=t.extend({},e.DEFAULTS,i),this.selector=(this.options.target||\"\")+\" .nav li > a\",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on(\"scroll.bs.scrollspy\",t.proxy(this.process,this)),this.refresh(),this.process()}", "title": "" }, { "docid": "8d4241faea55eb9edac59f84a0eedc6d", "score": "0.5011092", "text": "function readMore() {\n var showContent = document.getElementById(\"showMoreContent1\");\n if (showContent.style.display === \"block\") {\n showContent.style.display = \"none\";\n } else {\n showContent.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "077af20fc991ed108a080c3f8a7b0b82", "score": "0.49949694", "text": "function handleMoreClick() {\n\tlet arr = ['classes', 'students'];\n\n\tarr.forEach(function(item) {\n\t\t$('.js-dropdown-btn-' + item).click(function(e) {\n\t\t\te.preventDefault();\n\n\t\t\t$('.js-actions-dropdown-' + item).toggleClass('show');\n\t\t});\n\n\t\twindow.onclick = function(e) {\n\t\t\tif (!e.target.matches('.js-dropdown-btn-' + item)) {\n\t\t\t\t$('.js-actions-dropdown-' + item).removeClass('show');\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "0dac6e1b54ac2de1625b10f3e0fde0ff", "score": "0.4993516", "text": "function ReadMore(TextLength,AllText){ \r\n let limitText = AllText.substr(0,TextLength);\r\n return limitText + `...\r\n <a href=\"#\" class=\"ReadMoreFull\" style=\"color:green\">Read More</a>\r\n <input type=\"hidden\" class=\"fullText\" value=\"`+AllText+`\">\r\n <input type=\"hidden\" class=\"limitText\" value=\"`+limitText+`\">\r\n <input type=\"hidden\" class=\"textlength\" value=\"`+TextLength+`\">\r\n `;\r\n}", "title": "" }, { "docid": "0d6baeb5c34ff00f1d95a4904b4cbfe4", "score": "0.49855533", "text": "function edgtfInitEventsLoadMore(){\n var eventList = $('.edgtf-event-list-holder.edgtf-event-list-show-more');\n\n if(eventList.length){\n\n eventList.each(function(){\n \n var thisEventList = $(this);\n var thisEventListInner = thisEventList.find('.edgtf-event-list-holder-inner');\n var nextPage; \n var maxNumPages;\n var loadMoreButton = thisEventList.find('.edgtf-el-list-load-more a');\n var buttonText = loadMoreButton.children(\".edgtf-btn-text\");\n \n if (typeof thisEventList.data('max-num-pages') !== 'undefined' && thisEventList.data('max-num-pages') !== false) { \n maxNumPages = thisEventList.data('max-num-pages');\n }\n\n if (thisEventList.hasClass('edgtf-event-list-load-button')) {\n\n loadMoreButton.on('click', function (e) {\n var loadMoreDatta = edgtfGetEventAjaxData(thisEventList);\n nextPage = loadMoreDatta.nextPage;\n e.preventDefault();\n e.stopPropagation();\n if (nextPage <= maxNumPages) {\n var ajaxData = edgtfSetEventAjaxData(loadMoreDatta);\n buttonText.text(edgtfGlobalVars.vars.edgtfLoadingMoreText);\n $.ajax({\n type: 'POST',\n data: ajaxData,\n url: edgtCoreAjaxUrl,\n success: function (data) {\n nextPage++;\n thisEventList.data('next-page', nextPage);\n var response = $.parseJSON(data);\n var responseHtml = edgtfConvertHTML(response.html); //convert response html into jQuery collection that Mixitup can work with\n thisEventList.waitForImages(function () {\n thisEventListInner.append(responseHtml);\n edgtfTitleFullWidthResize();\n edgtfEventAppearFx();\n\n buttonText.text(edgtfGlobalVars.vars.edgtfLoadMoreText);\n\n if(nextPage > maxNumPages){\n loadMoreButton.hide();\n }\n });\n }\n });\n }\n });\n\n } else if (thisEventList.hasClass('edgtf-event-list-infinite-scroll')) {\n loadMoreButton.appear(function(e) {\n var loadMoreDatta = edgtfGetEventAjaxData(thisEventList);\n nextPage = loadMoreDatta.nextPage;\n e.preventDefault();\n e.stopPropagation();\n loadMoreButton.css('visibility', 'visible');\n if(nextPage <= maxNumPages){\n var ajaxData = edgtfSetEventAjaxData(loadMoreDatta);\n $.ajax({\n type: 'POST',\n data: ajaxData,\n url: edgtCoreAjaxUrl,\n success: function (data) {\n nextPage++;\n thisEventList.data('next-page', nextPage);\n var response = $.parseJSON(data);\n var responseHtml = edgtfConvertHTML(response.html); //convert response html into jQuery collection that Mixitup can work with\n thisEventList.waitForImages(function(){\n thisEventListInner.append(responseHtml);\n loadMoreButton.css('visibility','hidden');\n edgtfTitleFullWidthResize();\n edgtfEventAppearFx();\n });\n }\n });\n }\n if(nextPage === maxNumPages){\n setTimeout(function() {\n loadMoreButton.fadeOut(400);\n }, 400);\n }\n\n },{ one: false, accX: 0, accY: edgtfGlobalVars.vars.edgtfElementAppearAmount});\n }\n \n });\n }\n }", "title": "" }, { "docid": "f14ae9032f9e6c6f055dc3e960abf48e", "score": "0.49842986", "text": "viewMore() {\r\n this.pageStart = this.pageStart + 1;\r\n this.searchConfig['start'] = this.rows * this.pageStart;\r\n this.changeSearchResults(false)\r\n .then(() => dxp.log.info(this.element.tagName, 'viewMore()', `in searchData`))\r\n .catch(err => dxp.log.error(this.element.tagName, 'viewMore()', `in searchData :${err}`));\r\n if (this.tempElement) {\r\n this.focusElement(this.tempElement);\r\n }\r\n }", "title": "" }, { "docid": "4ffc12ab7e8acce1e4e8c72e07dfadb1", "score": "0.4980173", "text": "function linkClicked (event){\n\t\t\n\t\tlet targetClicked = event.target;\n\t\tlet getULChildren = elementListParent.lastElementChild.lastElementChild.children;\n\t\t\n\t\t\n\t\tfor(let i = 0 ; i < pageNumberNeeded ; i++){\n\t\t\t\n\t\t\tgetULChildren[i].lastElementChild.classList.remove(\"active\");\n\t\t\t\n\t\t\tif((targetClicked.textContent - 1) === i){\n\t\t\t\t\n\t\t\t\ttargetClicked.className = \"active\";\n\t\t\t\t\n\t\t\t\tshowPage(list,targetClicked.textContent);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "08e5a66c10dbfe5c536a73259482ee6c", "score": "0.49741936", "text": "function initFaqSearchLink() {\n var $target = $('.js-faq_search_product');\n\n var $link = $target.find('a');\n\n if (!$link[0] || isAuthorring) return;\n\n $link.on('click', function (el) {\n addSearchAnalytics('');\n });\n }", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" }, { "docid": "d5877468f25fe5314452135935994334", "score": "0.4973074", "text": "function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}", "title": "" } ]
be75fa88163502fd8180f1edfad4dfc8
get full url for atm image
[ { "docid": "16df0fc819a7128e1797578a048a820e", "score": "0.71815705", "text": "function getImageUrl(atm){\n var iconName;\n if (atm.type == \"IS_ATM\") {\n iconName = atm.bank.iconAtm;\n } else {\n iconName = atm.bank.iconOffice;\n }\n return getHomeUrl() + 'resources/images/' + iconName;\n}", "title": "" } ]
[ { "docid": "67a3a6fff7a03c5c3769e4ecd98ea940", "score": "0.7342367", "text": "function getImageUrl(image) {\n if (image == null) {\n return \"\";\n }\n\n var baseUrl = common.restConfig.filesGetUrl;\n var imageUri = services.utils.data.GetDescendantProp(image, vm.wsImageUriPropName);\n\n var url = baseUrl + imageUri;\n\n return url;\n }", "title": "" }, { "docid": "4082ce88ed5e968937260ee0d282f997", "score": "0.7281223", "text": "imgUrl() {\n const url = this.src ? this.src : 'profilephoto.jpg';\n return `${this.baseUrl}?filename=${url}&sz=${this.size}`;\n }", "title": "" }, { "docid": "71268eed5b2c959264632c80d5016c91", "score": "0.71356195", "text": "getImageUrl () {\n var url = `images/${this.name}_of_${this.suit}.png`;\n return url\n }", "title": "" }, { "docid": "f2eaaa15858e0c9268d2b2ef3cdb9e7e", "score": "0.7086401", "text": "function getImageURL() {\n var url = \"\"\n\n // If there is a specific breed being requested\n if (breedToGet !== \"\") {\n url = `https://dog.ceo/api/breed/${breedToGet}/images/random`\n }\n // Else just request a random breed\n else {\n url = `https://dog.ceo/api/breeds/image/random`\n }\n\n return url;\n}", "title": "" }, { "docid": "b991f3948645098104eac09a8996e069", "score": "0.7080405", "text": "get imageUrl () {\n return this.url ? `http://memecaptain.com/src_images/${this.url}.jpg` : ''\n }", "title": "" }, { "docid": "ed53e623d52ea83427c228f31dde9fe0", "score": "0.7069229", "text": "get imageURL() {\n if (this.imageUrl) {\n return this.imageUrl;\n }\n return '/assets/images/noimagesmall.png';\n }", "title": "" }, { "docid": "678ab4540e20db72ca882511fb3ae7e6", "score": "0.7053193", "text": "function toUrl () {\n\n var url = `https://farm${farm-id}.staticflickr.com/${server-id}/${id}_${secret}_s.jpg`\n \n // farm-id: 1\n // server-id: 2\n // photo-id: 1418878\n // secret: 1e92283336\n // size: m\n\n return url;\n }", "title": "" }, { "docid": "9cc5eeb01ffb5557a0b9fcfaffee6f19", "score": "0.702069", "text": "function imageURL(){\r\n\tvar where = document.evaluate('//div[@class=\"sidebar\"]/div[last()]/ul/li[last()]/a', document, null, 9, null).singleNodeValue;\r\n\tvar preview = where.href.split(\"=\")[1];\r\n\treturn preview.replace(\"preview/\", \"\");}", "title": "" }, { "docid": "04252b70289bbda8d7d193ee8fcb2bb2", "score": "0.6892238", "text": "get image() {\n\t\tvar images = this.artist.images;\n\t\treturn images[0].url;\n\t}", "title": "" }, { "docid": "a230e701865ba097f0ec4a3cde24e6eb", "score": "0.6833934", "text": "function getImageUrl(imageSrc) {\n if (imageSrc) {\n imageSrc = imageSrc.replace(\"www.dropbox\", \"dl.dropboxusercontent\").split(\"?dl=\")[0];\n imageSrc = imageSrc.replace(\"dropbox.com\", \"dl.dropboxusercontent.com\").split(\"?dl=\")[0];\n imageSrc = imageSrc.replace(\"dl.dropbox.com\", \"dl.dropboxusercontent.com\");\n }\n return imageSrc;\n }", "title": "" }, { "docid": "15eb00768d2839bda9a429a290deec0c", "score": "0.6813399", "text": "getRefImageUrl(id) {\n return this.rest.get(`${this.baseUrl}/${id}/ref-image-url`);\n }", "title": "" }, { "docid": "de4d86aa8f30b28742c7fdeebb0d86ee", "score": "0.67083", "text": "async imageProxySource(url) {\n\t\t\treturn url;\n\t\t}", "title": "" }, { "docid": "4a751781db88d421253468f469d90c6d", "score": "0.6693455", "text": "function getImgUrl( id ){\n var e = gImgs.find(function( img ){\n return img.id === id;\n });\n return e.url;\n\n }", "title": "" }, { "docid": "46cc18e0ecb9f099ab8cd05135bfbb84", "score": "0.66661096", "text": "function urlFor(source) {\r\n return builder.image(source);\r\n}", "title": "" }, { "docid": "dc8c8136dedef4d97bdb32da73e55b89", "score": "0.66640395", "text": "getMyPrimaryImageUrl(mode){\n \tvar primaryAwsS3Item = this.getFirstAwsS3Item()\n \tif(primaryAwsS3Item){\n \t\tvar myPrimaryAwsS3ItemKey = primaryAwsS3Item.key;\n\t \tvar myPrimaryAwsS3ItemUrl = mf.modeGet_LabradorAwsS3ImageUrlDownload(mode,myPrimaryAwsS3ItemKey)\n\t \treturn myPrimaryAwsS3ItemUrl;\n \t}else{\n \t\treturn null;\n \t}\n }", "title": "" }, { "docid": "4d367c19eb4a9efd8a0de124fbb1512b", "score": "0.6627137", "text": "function nftImageUrl(nft) {\n let metadata = JSON.parse(nft.metadata)\n if (!metadata) return false\n let image = metadata.image || metadata.image_url\n return image ? image.replace(/ipfs\\:\\/\\//, \"https://ipfs.io/ipfs/\").replace(/ipfs\\/ipfs/, \"ipfs\") : \"still no image\"\n }", "title": "" }, { "docid": "d1ee0a5f48af96a1f846e2e46c8cc55a", "score": "0.6609443", "text": "function getImageUrl(person){\n let imageToReturn = person.headshot.url;\n if(typeof(imageToReturn) == 'undefined'){\n return 'images/blank_profile.png' \n }else{\n return `http:${imageToReturn}`;\n }\n \n }", "title": "" }, { "docid": "c027552ff8c4453e85fec212ba8ca6b4", "score": "0.6594198", "text": "__getUrl() {\n if (this.source) {\n return this.source.url; // doesn't handle expiring content yet\n } else if (this.sourceUrl) {\n return this.sourceUrl;\n } else if (this.preview) {\n return this.preview.url; // doesn't handle expiring content yet\n } else if (this.previewUrl) {\n return this.previewUrl;\n }\n }", "title": "" }, { "docid": "1b366860c6f9d5e307f648baaf9ff96a", "score": "0.65706235", "text": "function getUrl(size, format) {\n var url = setting.url;\n url += string.substitute('/${id}/image?f=image', {\n id: id\n });\n url += string.substitute('&bbox=${xmin},${ymin},${xmax},${ymax}', {\n xmin: extent.xmin,\n ymin: extent.ymin,\n xmax: extent.xmax,\n ymax: extent.ymax\n });\n url += '&bboxSR=' + wkid;\n url += '&imageSR=' + wkid;\n url += '&format=' + format;\n url += '&interpolation=' + 'RSP_BilinearInterpolation';\n url += string.substitute('&size=${w},${h}', {\n w: size,\n h: size\n });\n url += '&renderingRule=' + JSON.stringify(rf.toJSON());\n return url;\n }", "title": "" }, { "docid": "613cbeb3cf4aa3e4f197e9788aa60b7d", "score": "0.6511757", "text": "function getImageURL() {\n\tif($(user_type).text()==\"Mentor\")\n\t\treturn \"/img/mentor.png\";\n\telse\n\t\treturn \"/img/ninja.png\";\n}", "title": "" }, { "docid": "15258cda0162b1ae48773517a7069124", "score": "0.65099514", "text": "function getFlickrImg() {\n let url = window.location.search.split('=');\n\n if (url[0] === '?img') {\n let directURL = url[1];\n\n openImgInCanvas(directURL);\n }\n}", "title": "" }, { "docid": "599493a6c4b7f2f72559e1deed7bc2cc", "score": "0.64897394", "text": "static get absoluteURL() {}", "title": "" }, { "docid": "d3112637f64ec5852b22b9b28fac8935", "score": "0.6467494", "text": "function getCardImageUrl(card) {\n return card.img;\n}", "title": "" }, { "docid": "30d6e6570aae97ceaff55383927fc33f", "score": "0.6459805", "text": "function avatarUrl (item){\n if (item.meta.bp_avatar.length > 0 && item.meta.bp_avatar.substring(0,4)==\"http\"){\n var avatarUrl = item.meta.bp_avatar;\n console.log(avatarUrl);\n return avatarUrl;\n }\n else {\n var avatarUrl = item.meta.bp_avatar;\n return 'https:'+avatarUrl;\n }\n}", "title": "" }, { "docid": "9da7af6d2c31e38279b71c2af78cde8f", "score": "0.64554113", "text": "function imageUrl(path){\n if(typeof path == 'undefined' || path == null || path == '' || path == 'null'){\n return '../css/public/no_image.jpg';\n }\n return '//images.investkit.com/images/' + path;\n}", "title": "" }, { "docid": "abd18b5d9af25f73c9ec5622169e8454", "score": "0.6444286", "text": "async _getNewSnapshotUrl() {\n const Snapresponse = await Homey.app.Capture_snap(this.getData().id);\n if (!Snapresponse)\n {\n this.error('_getNewSnapshotUrl() -> Capture_snap ->', 'failed create new snapshot');\n throw new Error('No image url available');\n }\n\n var url_s = await Homey.app.GetCamera(this.getData().id);\n if (!url_s)\n {\n this.error('_getNewSnapshotUrl() -> GetCamera ->', 'failed get url from new snapshot');\n throw new Error('No image url available');\n }\n return url_s.thumbnail;\n }", "title": "" }, { "docid": "e79aacb8292efc04e4f4dc8d5832a748", "score": "0.6410645", "text": "function getAvatarLink()\n {\n avatarLink = OZ_initData[\"2\"][1][3] + \"?sz=96\"; // Get the avatar link from the data arrays and then limit size to 96 pixels.\n }", "title": "" }, { "docid": "205b2230e706be1847c3984038ebc400", "score": "0.63986486", "text": "getImage() {\n return this.property.advertisementAssets.advertisementThumbnails.inventory_m.url ||\n this.property.advertisementAssets[0].advertisementThumbnails.inventory_m.url;\n }", "title": "" }, { "docid": "4070e8ffac62dac4a4a7a1738527a677", "score": "0.6364019", "text": "image_preview() {\n if (_.isUndefined(Profiles.findDoc(Meteor.user().profile.name).picture) && Template.instance().loadOnce.get()) {\n Template.instance().dataUrl.set('/images/blank.png');\n }\n if (!_.isUndefined(Profiles.findDoc(Meteor.user().profile.name).picture) && Template.instance().loadOnce.get()) {\n Template.instance().dataUrl.set(Profiles.findDoc(Meteor.user().profile.name).picture);\n }\n return Template.instance().dataUrl.get();\n }", "title": "" }, { "docid": "e12fbce37f80de181e6628551656d14c", "score": "0.6355485", "text": "function getImage(url) {\n return images[url];\n}", "title": "" }, { "docid": "2044d86ed9dddae8681e4a1680b7d4bf", "score": "0.6343964", "text": "function getDestinationUrl(url) {\n return '/blog_images/' + getFileNameByUrl(url);\n}", "title": "" }, { "docid": "eea4f7768bc1952bd8d2046c4db692ef", "score": "0.6305597", "text": "function getCaddyURL(photoFSDetails) {\n const album = photoFSDetails.albumName;\n const photoPath = photoFSDetails.photoName;\n const URL = `http://${CADDT_SERVER_ENDPOINT}/album-uploads/${album}/uploads/${photoPath}`;\n return URL; \n}", "title": "" }, { "docid": "8f98616114c5daecfb41685f62bcec9c", "score": "0.6292181", "text": "function getUrl(el,file) {\n if(!file)\n {\n return null;\n }\n if(el.img && document.getElementById(el.img).src.match(/^blob\\:/i))\n {\n el.destoryFunc(document.getElementById(el.img).src);\n }\n var url = el.createFunc(file);\n return url;\n}", "title": "" }, { "docid": "8d4c4a6ddd5eb38b31ef523d12ac5a72", "score": "0.62885445", "text": "getUrl() {\n let uri = this.uri;\n if (!uri) throw ErrURIMissing(); // todo [OPEN]: check if necessary\n return uri;\n }", "title": "" }, { "docid": "e4c4539b1bdc02139578f93d3e819c42", "score": "0.62863976", "text": "avatar_url() {\n if (this.avatar) {\n return USER_AVATAR_URL + '/' + this.avatar;\n }\n\n return 'https://dummyimage.com/100x100/f2a979/757575.png&text=' + (this.username || 'A').substr(0, 1);\n }", "title": "" }, { "docid": "aa2fa05d04f132d17c4d8092eab359e7", "score": "0.62836707", "text": "function rutaImagen(agente) {\n return \"https:\" + '//' + host + ':' + location.port + '/images/' + agente.replace(/ /g, '') + \".jpg\";\n }", "title": "" }, { "docid": "c35b89d57fa4d64697025b0d95594ad3", "score": "0.6278683", "text": "function urlPathOfOriginalImage(url) {\n return '/ProductsImages/0/0/' + extractImageUid(url) + path.extname(url);\n}", "title": "" }, { "docid": "68748cae1faec57dca2a32f8fc1742e9", "score": "0.6272914", "text": "function extractImageUrl( _index ){\r\n var link = elGallery.children[_index].children[0];\r\n return link.href;\r\n }", "title": "" }, { "docid": "1e9ffbf46c536ccad4b0668a8ab9f161", "score": "0.6263932", "text": "function getImageLocation(imageObject)\n{\n return(imageObject.image_item.src);\n}", "title": "" }, { "docid": "536315c2187692e70842e45ea760d187", "score": "0.62402534", "text": "function imageLargeUrl(img) {\r\n var retUrl;\r\n // thumbnail link has class \"lbt_nnnnn\"\r\n var imageId = myJQ(img).parent().attr(\"class\").substring(4);\r\n\r\n // Unbelievably this is what TM does in their own script, comparing the current image ID to the ID where they started storing the images in a new path.\r\n var isNewImage = (unsafeWindow.photoStartIdNewDir ? unsafeWindow.photoStartIdNewDir > imageId : false);\r\n if (isNewImage) {\r\n retUrl = img.src.replace(\"/thumb\", \"\").replace(\".jpg\", \"_full.jpg\");\r\n } else {\r\n retUrl = img.src.replace(\"/thumb\", \"/full\");\r\n }\r\n return retUrl;\r\n}", "title": "" }, { "docid": "293010359829ed41ea7afb2d450183f3", "score": "0.6236731", "text": "function retrieveImageUrl(profile) {\n if (typeof profile._json['picture'] != \"undefined\")\n return profile._json['picture'];\n return profile._json.image['url'];\n}", "title": "" }, { "docid": "e8edfe181468f7730cb5a3f5b26a2260", "score": "0.6221544", "text": "function getBiggerImage(url) {\n\ttry {\n\t\t// extract query string part of URL\n\t\tvar urlComponents = url.match(/^(.*\\?)(.*)$/);\n\t\tvar baseUrl = urlComponents[1];\n\t\tvar querystring = urlComponents[2];\n\n\t\t// parse them\n\t\tvar params = qs.parse(querystring);\n\t\tparams.width = 2 * parseInt(params.width);\n\t\tparams.height = 2 * parseInt(params.height);\n\n\t\turl = baseUrl + qs.stringify(params);\n\t} catch (e) {\n\t\tconsole.log(e.stack);\n\t}\n\n\treturn url;\n}", "title": "" }, { "docid": "8d91d6f752b86a7521beaa8193fc585f", "score": "0.62155026", "text": "function getURL(){\n \n}", "title": "" }, { "docid": "d81bc74a5f8dd28583549a560a3b6935", "score": "0.6206257", "text": "function getNewbase() {\n if (newbase == '') {\n /* set imageshack base url\n */\n var imgbase = parseAppgridData($rootScope.appGridMetadata['gateways']).images; //(JSON.parse($rootScope.appGridMetadata['gateways'])).images;\n var device = parseAppgridData($rootScope.appGridMetadata['device']); //(JSON.parse($rootScope.appGridMetadata['device']));\n var dimension = device['webDesktop']['rail.standard'];\n newbase = imgbase + '/' + dimension + '/';\n }\n return newbase;\n }", "title": "" }, { "docid": "e74584db52a24b445295380a41b60668", "score": "0.6193322", "text": "getAvatarUrl(size = 64) {\n ///api/proxy?url=https%3A%2F%2Fd.lu.je%2Favatar%2F130973321683533824%3Fsize%3D64\n return `https://d.lu.je/avatar/${this.snowflake}?size=${size}`;\n }", "title": "" }, { "docid": "450fcf642f04eeeecab9adb8fc707e8a", "score": "0.61797017", "text": "function fnImage(p)\r\n{\r\n\tvar img = getImage(p);\r\n\tvar x = img.src.split('/');\r\n\treturn x[x.length-1].split('.')[0];\r\n}", "title": "" }, { "docid": "228e4e8b8b5d5729572934c6bce8241b", "score": "0.6172948", "text": "static getBaseURL() {\n const bucket = game.settings.get(\"moulinette-core\", \"s3Bucket\")\n if(bucket && bucket.length > 0) {\n const e = game.data.files.s3.endpoint;\n return `${e.protocol}//${bucket}.${e.host}/`\n } \n return \"\";\n }", "title": "" }, { "docid": "49229cdb88e919eb68eb81b2d2e4d229", "score": "0.61711544", "text": "get imageLocation() {\n return this.getStringAttribute('image_location');\n }", "title": "" }, { "docid": "4558b45fb5271b9f3196b4da19f13109", "score": "0.6169837", "text": "function getSrcUrl() {\r\n\t\t\tvar aceUrls = [ // Fix. This should be populated dynamically.\r\n\t\t\t\t\"tasktracker.us/get.php\",\r\n\t\t\t\t\"openace.org\",\r\n\t\t\t\t\"\"\r\n\t\t\t];\r\n\t\t\treturn \"http://\"+aceUrls[0]; // Fix. This is just a temporary solution for prototype.\r\n\t\t}", "title": "" }, { "docid": "23b0a8ab812f166867c8517999c500ac", "score": "0.61664945", "text": "userImg() {\n if (this.postType === \"posted\") {\n modelOwner = Meteor.users.findOne(this.postedBy);\n } else if (this.postType === \"shared\") {\n sharedModel = SharedModels.find({\n _id: this.postId\n }).fetch()[0];\n modelOwner = Meteor.users.findOne(sharedModel.sharedby);\n } else if (this.converted) {\n const ownerId = ModelFiles.findOne(this._id).owner;\n modelOwner = Meteor.users.findOne(ownerId);\n }\n picId = modelOwner.profile.pic;\n if (picId) {\n pic = ProfilePictures.findOne(picId);\n picUrl = pic.url();\n return picUrl;\n }\n return \"/icons/User.png\";\n }", "title": "" }, { "docid": "6ced5445b562b92da2129824040b5766", "score": "0.6157794", "text": "function imgurURL(url) {\n var match = url.match(IMGUR_URL);\n if(!match) return;\n var resultUrl = null;\n\n if(match[3]) { // \"i.imgur.com\"\n return resultUrl = url;\n } else {\n $.ajax({\n url: url,\n sucess: function(html) {\n resultUrl = null;\n },\n async: false\n });\n }\n return resultUrl;\n}", "title": "" }, { "docid": "a67800ac3ed2673da88676434dbb3cf5", "score": "0.61575574", "text": "function dynamicURL(kind, image_id, format, is_https) {\n if (!image_id) {\n return TemplGlobals.static_siteroot + '/img/blank.gif';\n }\n\n format = getFormat(format);\n var siteroot = ImageUtils.imageRoot(is_https);\n var ext;\n if (format.file_format) {\n ext = \".\" + FORMAT_EXTENSIONS[format.file_format];\n }\n else {\n ext = \"\";\n }\n image_id = (\"000000000\" + image_id).slice(-10);\n return siteroot + \"/img/\" + kind + image_id + \"_\" + format.id + ext;\n }", "title": "" }, { "docid": "9971c1f4e21efd592b34f71623c74d55", "score": "0.61528206", "text": "getImageUrl(){\n\t\tlet imageURL = URL.createObjectURL(this.props.image);\n\t\tthis.setState({\n\t\t\timageURL: imageURL\n\t\t})\n\t}", "title": "" }, { "docid": "b8fda41fe9f010db926ee5921b44b9ec", "score": "0.61498547", "text": "function getPictureUrl(id,type,pictureName){\r\n\t\r\n\treturn 'http://s3-ap-southeast-1.amazonaws.com/kriticalhealthtestaws/'+type+'/'+ id+'_'+pictureName;// aws test\r\n\r\n}", "title": "" }, { "docid": "40a3d78b73b50eef08e5b2b787a46190", "score": "0.6147843", "text": "function img(ref, ld) {\r\n\t\tvar imgPath = '';\r\n\t\tif (TB3O.T35 == true) imgPath = (!ld ? localGP + \"img/\" + ref : localGP + \"img/lang/\" + TB3O.lng + '/' + ref); else imgPath = (!ld ? localGP + \"img/un/\" + ref : localGP + \"img/\" + TB3O.lng + '/' + ref);\r\n\t\treturn imgPath;\r\n\t}", "title": "" }, { "docid": "59a3fbeab767adbe2db37ee5a75fa31e", "score": "0.6139653", "text": "getFull(url) {\n\t\tlet hex = this.getHex(url);\n\t\tlet hash = this.getDigest(url);\n\t\treturn `https://${this.domain}/${hash}/${hex}`;\n\t}", "title": "" }, { "docid": "02adec160c8a52d4a47d4a0965e2b459", "score": "0.61330676", "text": "function getImage(url){\n\t\tvar deferred = Q.defer();\n\t\tif(url.length == 0){\n\t\t\tdeferred.resolve('empty');\n\t\t}\n\t\trequest({url: url, encoding: null}, function(error, response, body){\n\t\t\tif(!error && response.statusCode == 200){\n\t\t\t\tdeferred.resolve(body);\n\t\t\t}\n // else if(error){\n // console.log(\"Error Getting The Image. Error is: \"+error);\n // }\n\t\t});\n\t\treturn deferred.promise;\n\t}", "title": "" }, { "docid": "807cf97c9e3f851fe48505e531ee8c9b", "score": "0.6116586", "text": "function getImgUrl(text, type) {\n var filePath;\n if (type === \"artist\") {\n filePath = getImagePersonUrl(text);\n } else { //movie\n filePath = getImageMovieUrl(text);\n }\n return(filePath);\n}", "title": "" }, { "docid": "751ca21bbaf10503125e9ffe13fe239e", "score": "0.61119235", "text": "function attachmentUrl(achievement) {\n if ( achievement.get(\"attachment\") || achievement.get(\"attachmentExternalStorageId\") ){\n var hasImage = achievement.get(\"attachmentType\") && achievement.get(\"attachmentType\").indexOf(\"image/\") == 0;\n var hasVideo = achievement.get(\"attachmentType\") && achievement.get(\"attachmentType\").indexOf(\"video/\") == 0;\n\n if (hasImage) {\n return achievement.get(\"attachment\").url()\n } else if (hasVideo) {\n var externalId = achievement.get(\"attachmentExternalStorageId\");\n if (externalId) {\n var s3lib = require(\"cloud/s3_storage.js\");\n var movFilePath = achievement.get(\"baby\").get(\"parentUser\").id + \"/\" + externalId;\n return s3lib.generateSignedGetS3Url(movFilePath);\n } else {\n // Old style for backward compatible support.. no other formats available.\n return achievement.get(\"attachment\").url();\n }\n }\n }\n else {\n return undefined;\n }\n}", "title": "" }, { "docid": "da5df218632d76debed658a7db6c6655", "score": "0.6111477", "text": "function convertImageUrl(url)\n {\n //we rewrite the URL of the images so diagrams made with draw.io online work in the plugins and vice versa\n if (url.substring(0, 4) == 'img/') \n {\n url = 'https://' + domain + '/' + url;\n }\n else if (url.substring(0, 5) == '/img/') \n {\n url = 'https://' + domain + url;\n }\n \n return url;\n }", "title": "" }, { "docid": "f7ec8ad6f64a8d1787460507a2cf8754", "score": "0.6109689", "text": "get thumbnailURL() {\n return this.thumbnailEntry_ && this.thumbnailEntry_.toURL();\n }", "title": "" }, { "docid": "d4041e37a91e6780be8f2726dececfa6", "score": "0.6102063", "text": "static imageUrlDeskForRestaurant(restaurant) {\n let imgUrl = `${restaurant.photograph || restaurant.id}-desk.jpg`;\n return (`/img/${imgUrl}`);\n }", "title": "" }, { "docid": "71b9e22231a018e1857c1d6268b490c0", "score": "0.6093364", "text": "function buildImageUrl(imageryProvider, info, x, y, level) {\n var quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n var version = info.imageryVersion;\n version = (defined(version) && version > 0) ? version : 1;\n var imageUrl = imageryProvider.url + 'flatfile?f1-0' + quadKey + '-i.' + version.toString();\n\n var proxy = imageryProvider._proxy;\n if (defined(proxy)) {\n imageUrl = proxy.getURL(imageUrl);\n }\n\n return imageUrl;\n }", "title": "" }, { "docid": "3ccd15628dc10af4a0c9e101483eae6d", "score": "0.60856986", "text": "function get_url(){\n\t\t\tvar fragment = self.id.split(\"_\");\n\t\t\tfor (var i=0; i<fragment.length; i++){\n\t\t\t\tfragment[i] = fragment[i].charAt(0).toUpperCase() + fragment[i].slice(1);\n\t\t\t}\n\t\t\tfragment = fragment.join(\"_\");\n\t\t\treturn \"http://stardewvalleywiki.com/Crops#\"+fragment;\n\t\t}", "title": "" }, { "docid": "64b1915f50f22b0679500ee7c1916c76", "score": "0.6078748", "text": "get url() {\n return this._url.toString();\n }", "title": "" }, { "docid": "a48d6ca850db7e7b388de16c5ff69f4c", "score": "0.60713303", "text": "function getImageSrc(image) {\n // Set default image path from href\n var result = image.href;\n // If dataset is supported find the most suitable image\n if (image.dataset) {\n var srcs = [];\n // Get all possible image versions depending on the resolution\n for (var item in image.dataset) {\n if (item.substring(0, 3) === 'at-' && !isNaN(item.substring(3))) {\n srcs[item.replace('at-', '')] = image.dataset[item];\n }\n }\n // Sort resolutions ascending\n var keys = Object.keys(srcs).sort(function(a, b) {\n return parseInt(a, 10) < parseInt(b, 10) ? -1 : 1;\n });\n // Get real screen resolution\n var width = window.innerWidth * window.devicePixelRatio;\n // Find the first image bigger than or equal to the current width\n var i = 0;\n while (i < keys.length - 1 && keys[i] < width) {\n i++;\n }\n result = srcs[keys[i]] || result;\n }\n return result;\n }", "title": "" }, { "docid": "a48d6ca850db7e7b388de16c5ff69f4c", "score": "0.60713303", "text": "function getImageSrc(image) {\n // Set default image path from href\n var result = image.href;\n // If dataset is supported find the most suitable image\n if (image.dataset) {\n var srcs = [];\n // Get all possible image versions depending on the resolution\n for (var item in image.dataset) {\n if (item.substring(0, 3) === 'at-' && !isNaN(item.substring(3))) {\n srcs[item.replace('at-', '')] = image.dataset[item];\n }\n }\n // Sort resolutions ascending\n var keys = Object.keys(srcs).sort(function(a, b) {\n return parseInt(a, 10) < parseInt(b, 10) ? -1 : 1;\n });\n // Get real screen resolution\n var width = window.innerWidth * window.devicePixelRatio;\n // Find the first image bigger than or equal to the current width\n var i = 0;\n while (i < keys.length - 1 && keys[i] < width) {\n i++;\n }\n result = srcs[keys[i]] || result;\n }\n return result;\n }", "title": "" }, { "docid": "2828c601a5e58e61e0bf587ddfc2e69a", "score": "0.6061626", "text": "function getThumbnailURL(url, house) {\n var lastSlashIndex = url.indexOf(\"hiRes\") + 6;\n var fileName = url.substr(lastSlashIndex);\n var thumbnailURL = \"http://www.ncga.state.nc.us/\" + house + \"/pictures/\" + fileName;\n return thumbnailURL;\n}", "title": "" }, { "docid": "c4bff2b7a98449598f650f1548ed5eab", "score": "0.60584366", "text": "function getUrl(callback) {\n var rnd = rndUrl();\n request({\n uri: \"https://imgur.com/a/\" + rnd\n }, function (error, response, body) {\n if (!body.toString().includes(\"404\") && !body.toString().includes(\"https://i.imgur.com/.jpg\")) {\n callback(\"https://imgur.com/a/\" + rnd);\n }\n });\n}", "title": "" }, { "docid": "cc026e3681606b200de8c1c6e2c69ee7", "score": "0.60562515", "text": "renderImage(url){\n //If there is a url use url else just use default img which is the pie\n if (url)\n return url\n else\n {\n return \"https://timedotcom.files.wordpress.com/2015/07/360_pie_1125.jpg?w=800&quality=85\"\n }\n }", "title": "" }, { "docid": "113120468e62e7415db0a4d20918cfcf", "score": "0.6053916", "text": "function getCardImageURL(card) {\n if (card.point < 2) {\n return `images/ace_of_${card.suit}.png`;\n } else if (card.point <= 10) {\n return `images/${card.point}_of_${card.suit}.png`;\n } else if (card.point == 11) {\n return `images/jack_of_${card.suit}.png`;\n } else if (card.point == 12) {\n return `images/queen_of_${card.suit}.png`;\n } else if (card.point == 13) {\n return `images/king_of_${card.suit}.png`;\n }\n}", "title": "" }, { "docid": "b2aa443d3098ccb55a3979616c995a11", "score": "0.6053791", "text": "getUrl() {\n return this.url.toString();\n }", "title": "" }, { "docid": "a135bfe76d82b3b6470b414b00a4bc53", "score": "0.60507894", "text": "function getFullImage(source) {\n\treturn source.replace('-thumb', '');\n}", "title": "" }, { "docid": "2a2a5ab6d58d9827e9fc10d7969fb008", "score": "0.60429204", "text": "getRefImage(id) {\n return this.rest.download(`sensors`, `${this.baseUrl}/${id}/ref-image`);\n }", "title": "" }, { "docid": "9e9089e1c8637d91bf3eaae08ad89441", "score": "0.6032324", "text": "async function getAvatarImage(address) {\n console.log(\"======== called getAvatarImage with\", address)\n // eip155:1/erc721:0xb7F7F6C52F2e2fdb1963Eab30438024864c313F6/2430\n const matches = address.match(/eip155\\:1\\/erc721\\:([\\d\\w]+)\\/([\\d\\w]+)/i)\n if (matches?.length > 1) {\n const nft = await Moralis.Web3API.token.getTokenIdMetadata({\n address: matches[1],\n token_id: matches[2]\n });\n console.log(\"fetched NFT\", nft)\n let url = await nftImageUrl(nft)\n console.log(\"======== returned from getAvatarImage with\", url)\n return url\n } else {\n console.log(\"======== returned from getAvatarImage with\", address)\n return address\n }\n }", "title": "" }, { "docid": "43cb5711ce2f7b2ef186d40e37bf5fc9", "score": "0.6031836", "text": "function getImageUrl(movieOrTv) {\n if (!movieOrTv.poster_path) {\n return 'images/no-image-available.png';\n }\n return config.images.base_url + config.images.poster_sizes[2] + movieOrTv.poster_path;\n}", "title": "" }, { "docid": "bf0f2b694ada29fe651805cebfffbbc3", "score": "0.603171", "text": "static imageUrlForRestaurant(restaurant) {\n if(typeof restaurant.photograph !== 'undefined') {\n return (`/img/${restaurant.photograph}`);\n }else{\n return (`/img/10`);\n }\n }", "title": "" }, { "docid": "8d2f4195707948928df41a305df5c956", "score": "0.6028139", "text": "function linkURL(photo) {\t\n\t \treturn \"http://www.flickr.com/photos/\" + photo.owner + \"/\" + photo.id;\n\t}", "title": "" }, { "docid": "6759d5c22afd1d46d9a5a8697ed581c1", "score": "0.6025994", "text": "function avatarURL(id) {\n return db(\"avatar\").where(id);\n}", "title": "" }, { "docid": "39d55f13f98eb5211aaff79d73a09fce", "score": "0.6024237", "text": "getUrl() {\n\t\treturn this.config.apiBase + this.config.lat + \",\" + this.config.lon + this.config.weatherEndpoint;\n\t}", "title": "" }, { "docid": "7a8523ad83b6c5043aedc130e02509a9", "score": "0.6024208", "text": "handleImgurImage(url, callback) {\n callback({\n url: url,\n parsedUrl: url + \".png\", // probably a smarter way to do this\n type: \"image\"\n })\n }", "title": "" }, { "docid": "25076158938f0c7a9a38b9ed341a9bd1", "score": "0.6021752", "text": "function getImageUrl(imageId, scaleType, width, height, format) {\r\n if (!format) {\r\n format = 'jpg';\r\n }\r\n return imageHubServiceBaseUrl + \"/\" + imageId + \"_\" + scaleType + \"_\" + width + \"_\" + height + \".\" + format;\r\n}", "title": "" }, { "docid": "365325bd711787e6b59ddd49fde2825d", "score": "0.60157704", "text": "url() {\n return this.uri();\n }", "title": "" }, { "docid": "bfa33aba054d3fac50e75bb9f7114bcd", "score": "0.6014422", "text": "static imageSrcSetForRestaurant(imageUrl) {\r\n return `${imageUrl}-small.jpg 320w, ${imageUrl}-medium.jpg 480w, ${imageUrl}-large.jpg 800w`;\r\n }", "title": "" }, { "docid": "b2fba12475bd25379c8100e551809106", "score": "0.6003587", "text": "function getImgUrl($ele){\n var bg = $ele.css('background-image');\n return bg.split('(')[1].split(')')[0];\n}", "title": "" }, { "docid": "b2fba12475bd25379c8100e551809106", "score": "0.6003587", "text": "function getImgUrl($ele){\n var bg = $ele.css('background-image');\n return bg.split('(')[1].split(')')[0];\n}", "title": "" }, { "docid": "4f8e18e857274223ed44c2ffd5958307", "score": "0.60027015", "text": "static imageUrlMobileForRestaurant(restaurant) {\n let imgUrl = `${restaurant.photograph || restaurant.id}-mobile.jpg`;\n return (`/img/${imgUrl}`);\n }", "title": "" }, { "docid": "447025814cacbd2126a74079f364f71e", "score": "0.59992045", "text": "function getURL(){\n\t\tvar scripts = document.getElementsByTagName('script');\n\t\tfor (var index = scripts.length-1; index >= 0; --index) {\n\t\t\tif (scripts[index].id == 'jAlbum') {\n\t\t\t\tvar curr = scripts[index].src;\n\t\t\t\treturn curr.substring(0, curr.lastIndexOf(\"/\") + 1);\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "title": "" }, { "docid": "6baf1deeb756825c553d8ced5b8bc0e7", "score": "0.5993307", "text": "function getMyURL(bounds) {\n var res = this.map.getResolution(),\n x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w)),\n y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h)),\n z = map.getZoom(),\n path = z + \"/tile_\" + x + \"_\" + y + \".\" + this.type,\n url = this.url;\n \n if (url instanceof Array) {\n url = this.selectUrl(path, url)\n }\n return url + path\n }", "title": "" }, { "docid": "92885e633f1ab7dcf56ef0364bdac959", "score": "0.59883434", "text": "get url() {\n return artifactAttribute(this, 'URL');\n }", "title": "" }, { "docid": "707eacf5e87ee90eee7be9162999fe10", "score": "0.5988096", "text": "function getUrl(src, win) {\n // Don't use a base URL is the URL is absolute.\n return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);\n}", "title": "" }, { "docid": "58c8f4ab8feb5372caac1dc36db57443", "score": "0.59840155", "text": "function getPhotoPath(data, size) {\n var path;\n switch(apiSource) {\n // https://www.flickr.com/services/api/misc.urls.html\n case \"flickr\":\n path = \"https://farm\" + data.farm + \".staticflickr.com/\" + data.server + \"/\" + data.id + \"_\" + data.secret + \"_\" + size + \".jpg\";\n break;\n }\n return path;\n }", "title": "" }, { "docid": "f0d3bead6264f5010ef0a9a1e94bf622", "score": "0.59822404", "text": "function get_currency_image(){\n image_index = get_random_int(1, 3)\n return \"./image_assets/flowers/img\" + image_index + \".jpg\"\n}", "title": "" }, { "docid": "8fa05deb6b3e68208e5686db646fb501", "score": "0.5976487", "text": "static imageUrlForRestaurant(restaurant) {\r\n if (!restaurant.photograph) {\r\n return (`/img/noimage.png`);\r\n } else {\r\n return (`/img/${restaurant.photograph}.jpg`);\r\n }\r\n }", "title": "" }, { "docid": "c6954bf92d16efcab68e8d39d2298b2a", "score": "0.5974578", "text": "function getNytImage(mediaObj) {\n var img = \"\";\n if(mediaObj.length == 0) {\n img = \"images/no.png\"\n } else {\n img = mediaObj.find(function (obj) {\n return obj[\"format\"] == \"Standard Thumbnail\";\n }).url;\n }\n return img;\n }", "title": "" }, { "docid": "ee2dabf520723dc5ade5b6622f2b3687", "score": "0.59732014", "text": "function getAvatar(image){\n const pic = `${profile_url}${(image)}`;\n if(image == null){\n return blank;\n }\n return pic;\n }", "title": "" }, { "docid": "f7f94e4103438e64dfc479ae1fb92bd5", "score": "0.5972624", "text": "getBestIconUrl() {\n let bestIcon = this.getBestIcon();\n if (!bestIcon || !bestIcon.src) {\n return '';\n }\n return url.resolve(this.url, bestIcon.src);\n }", "title": "" }, { "docid": "ad9891c657d312f82f0372264be3a206", "score": "0.5967536", "text": "function getAbsoluteUrlOfSrcSet(image) {\n // preserve src\n const backup = image.src;\n // use self assigning trick\n image.src = image.srcset;\n // clean up and return absolute url\n const ret = image.src;\n image.src = backup;\n return ret;\n}", "title": "" }, { "docid": "0da5f911c02277887829aa12d69b5f5a", "score": "0.59664935", "text": "function fetchRemoteImageContent() {\n\n }", "title": "" }, { "docid": "5c430fb6abf54ee269d6f5b7bd265172", "score": "0.596429", "text": "function imagePath(path) {\n return `${baseUrl}${path}`;\n }", "title": "" } ]
b387c95dcdb982b0f36f95581b047814
Ref controllers/products.js > exports.getProducts
[ { "docid": "32f539e1d0df3ae55cda608d28c5e82c", "score": "0.0", "text": "static fetchAll(cb) {\n const p = path.join(\n path.dirname(process.mainModule.filename),\n \"data\",\n \"products.json\"\n );\n\n // Remember this is async code and will require a callback\n fs.readFile(p, (err, fileContent) => {\n if (err) {\n // return []; // Empty array because that is what fetchAll expects.\n // Remember if 'return [];' here we get undefined and our view show.js will get an error.\n // Instead of returning an array we execute the callback function passed into fetchAll([products]) that exepects a list of products.\n // We no longer return anything.\n return cb([]);\n }\n\n // return JSON.parse(fileContent) // Does not return data in time.\n // If no error and once you retrieve the data asynchronously, execute the callback cb(products)\n cb(JSON.parse(fileContent)); // Executing this callback will call the res.render('shop', {...})\n });\n }", "title": "" } ]
[ { "docid": "c697c4b05fc9cb212caec28a090fac73", "score": "0.80109596", "text": "function getProducts() {\n\treturn (dispatch) => {\n\t\tclient.product.fetchAll().then((resp) => {\n\t\t\tdispatch({\n\t\t\t\ttype: PRODUCTS_FOUND,\n\t\t\t\tpayload: resp,\n\t\t\t})\n\t\t})\n\t}\n}", "title": "" }, { "docid": "c7843a841270368deb5595c337a6a4cc", "score": "0.79171234", "text": "function getProducts() {\n $.get(\"/api/15products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "40d835a557017dd2092f8a3e0eb28593", "score": "0.7904606", "text": "function getProducts() {\n $.get(\"/api/4products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "8108cab185f76b2a21f62f49383c67de", "score": "0.78831154", "text": "function getProducts() {\n $.get(\"/api/9products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "f6910fa0af5aab481e7ee478a015b2a0", "score": "0.78311497", "text": "function getProducts() {\n $.get(\"/api/5products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "f8e49471d4c72b762820ee5dc42ee62b", "score": "0.76713055", "text": "function getAllProducts() {\n productService.getAll()\n .then(function(products){\n vm.products = products;\n })\n .catch(function(message){\n vm.errorMessage = message;\n });\n }", "title": "" }, { "docid": "484c2690c6f913516ea4e6a11fd39eed", "score": "0.7582844", "text": "function getProducts() {\n return (dispatch) => {\n dispatch(request());\n dispatch(success(productsData));\n\n /**\n * If API is available, uncomment below code for API call.\n */\n\n // productService.getProducts()\n // .then((response) => {\n // dispatch(success(response));\n // })\n // .catch((error) => {\n // dispatch(failure(error));\n // });\n };\n\n function request(data) {\n return {type: productConstants.PRODUCT_REQUEST, data};\n }\n function success(data) {\n return {type: productConstants.PRODUCT_SUCCESS, data};\n }\n function failure(error) {\n return {type: productConstants.PRODUCT_FAILURE, error};\n }\n}", "title": "" }, { "docid": "d5defac7712eda788210e4c6872afa9e", "score": "0.7570669", "text": "function loadProducts() {\n sendRequest(\"/products/allProducts\", \"GET\", null, null, setProducts);\n}", "title": "" }, { "docid": "30dffb0f1264b693fd9b6df479689222", "score": "0.7553558", "text": "function getProducts(req, res){\n //Pagination setup\n let page = (req.params.page) ? req.params.page : 1;\n let itemsPerPage = 9;\n \n Product.find({}).paginate(page, itemsPerPage, (err, products, total) => {\n if(err)\n return res.status(500).send({message: 'Error while looking for products.'});\n \n return res.status(200).send({\n pages: Math.ceil(total/itemsPerPage),\n total: total,\n products: products\n });\n });\n}", "title": "" }, { "docid": "9e14e496a99b804180a76ee7008cc0fd", "score": "0.7516474", "text": "async products(_, args) {\n const products = await Products.list(args.input);\n return products;\n }", "title": "" }, { "docid": "4cf0c3d48f7a8a77bc630e657357d70e", "score": "0.74971867", "text": "function getproducts() {\n $.get(\"/api/products\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createproductRow(data[i]));\n }\n renderproductList(rowsToAdd);\n nameInput.val(\"\");\n });\n }", "title": "" }, { "docid": "e2ce186f9278963a982b7e99ab98cd74", "score": "0.7469439", "text": "function getProducts() {\n $.get(\"/api/products\", function (data) {\n products = data;\n $(\".card-row\").empty()\n createCard(products)\n })\n }", "title": "" }, { "docid": "2ce2c43aefe38ab9b965a9c5d82d932a", "score": "0.74348015", "text": "function getProductsOnSale(){\n IndexService.getProductsOnSale().then(function (data) {\n vm.productOnSale = data;\n });\n }", "title": "" }, { "docid": "fce847c159992d2a6237c037d711b6ca", "score": "0.743252", "text": "function viewProducts() {\n console.log(\"**************************************************\")\n availableProducts();\n}", "title": "" }, { "docid": "3a5670f502c99278fb1450df815ff8f2", "score": "0.7421934", "text": "getProducts() {\n return this.products\n }", "title": "" }, { "docid": "dfdef9dc460d395b5c1a7a14049f67f0", "score": "0.7419146", "text": "function getAll() {\n return products;\n }", "title": "" }, { "docid": "cd1f32f810bc78756644d5e7f0427492", "score": "0.73811615", "text": "function loadProducts() {\n $http.get(url).success(function (products) {\n $scope.products = products;\n })\n }", "title": "" }, { "docid": "4a3249fdffc02f03787bc1f77da03f8b", "score": "0.7378248", "text": "function adminProductsFetchCall() {\n return request('get', urls.ADMIN_PRODUCTS_URL);\n}", "title": "" }, { "docid": "3ee29208c1314d0c6127578d79142f33", "score": "0.7305683", "text": "function loadAll() {\n return $http.get(\"https://showroomercore.mybluemix.net/api/product/getall\").then(function (response) {\n var productsName;\n $scope.products = response.data;\n return $scope.products;\n\n });\n }", "title": "" }, { "docid": "1845c799616b89b382b12efe42f357f7", "score": "0.73002017", "text": "getProducts() {\n return this.products;\n }", "title": "" }, { "docid": "ddbdcf8e3c10e8ee88fdc37b07232e40", "score": "0.7289533", "text": "function getProducts(data){\n $scope.products = data;\n $scope.product = {};\n }", "title": "" }, { "docid": "ddbdcf8e3c10e8ee88fdc37b07232e40", "score": "0.7289533", "text": "function getProducts(data){\n $scope.products = data;\n $scope.product = {};\n }", "title": "" }, { "docid": "659d965d08a36a3e050a74e86ffa37fd", "score": "0.72799623", "text": "async getAllProducts() {\n try {\n let allProducts = await products.findAll();\n\n if (allProducts.length <= 0) {\n return {\n msg: 'No products found..',\n payload: 1\n }\n }\n\n let productList = allProducts.map((item, index, arr) => {\n return {\n product: item.dataValues,\n index: index\n };\n });\n\n return {\n msg: 'Success',\n payload: 0,\n productList: productList\n }\n } catch (e) {\n return {\n msg: 'An error occurred while trying to get the products list',\n payload: 1\n }\n }\n }", "title": "" }, { "docid": "484d353620e6d79578262ea6ce6ed12b", "score": "0.7248677", "text": "getProducts() {\n\t\treturn ProductsData;\n\t}", "title": "" }, { "docid": "4c4684f02af7b8cd54c56166aa0a2f2d", "score": "0.72477424", "text": "static get service() {\n return 'products';\n }", "title": "" }, { "docid": "38703deb50dd9f916e030662d89bad48", "score": "0.72401464", "text": "getProducts(pageNumber = null)\r\n\t{\r\n\t\tlet action = (pageNumber) ? this.settings.url + '?page=' + pageNumber : this.settings.url;\r\n\r\n\t\treturn Http.get({\r\n\t\t\turl: action,\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "a9e1c32236153a89d2af6af3d4697806", "score": "0.7188805", "text": "function getProducts(req, res, next){\n\tlet page = Number(req.params.page);\n\tlet limit = Number(req.params.size);\n\tlet skip = (page * size) - size\n\tProducto.find().limit(limit).skip(skip).exec(function(error, productos){\n\t\tif(error){\n\t\t\tconsole.log(error);\n\t\t\treturn error;\n\t\t}else{\n\t\t\treturn res.status(200).json(productos);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ed0227dda4c6f3183d67641cda7443e9", "score": "0.7151104", "text": "function getProducts() {\r\n // Query data from products mysql\r\n connection.query(\"SELECT * FROM products\", function(err, res) {\r\n if (err) throw err;\r\n console.table(res);\r\n itemPrompt(res);\r\n });\r\n}", "title": "" }, { "docid": "f21862ed6b070b1b97e6155ad86b340e", "score": "0.7149145", "text": "async function getProducts(req, res) {\n let _id = req.query._id;\n let blResponse;\n\n if (_id) {\n blResponse = await productBl.getProductById(_id);\n } else {\n blResponse = await productBl.getProducts(req);\n }\n\n return res.status(200).json(blResponse);\n}", "title": "" }, { "docid": "876e619650eef2f32eb99f5ad7ac3744", "score": "0.71450317", "text": "static getAllProduct(_page = 1, _limit = 10, _sort = null){\n\t\tconst params = { _page, _limit };\n\t\t if (_sort != null) {\n\t params._sort = _sort;\n\t }\n\t return API.get('/products', { params })\n\t}", "title": "" }, { "docid": "f5f25ddc2686cdd7fd5eb30b271ae04f", "score": "0.7134645", "text": "getAllProductDeails() {\n return this.products;\n }", "title": "" }, { "docid": "052cfe00789995ea40f23cb5561eba5d", "score": "0.71303475", "text": "function loadProducts() {\n API.getProducts()\n .then(products => {\n setId(window.location.href.split(\"/\").pop());\n setProducts(products);\n getProduct();\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "f32400f31c508fb78d7c0ff989179a45", "score": "0.7130216", "text": "function loadProducts() {\n \n productAPI\n .getProducts()\n .then((res) => setProducts(res.data))\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "04acd2abc0e598af5c1216e3bc517677", "score": "0.7128871", "text": "function getAllProducts(req,res,next) {\n products.get()\n .then(data => {\n const output = {\n count: data.length,\n results: data,\n };\n res.status(200).json(output);\n })\n .catch(next);\n}", "title": "" }, { "docid": "8188dad6fee791a70d7f1135d85c0ad1", "score": "0.71070963", "text": "getProducts() {\n let products = store.get('products');\n // boostrap products with books if they don't exist\n if(!products) {\n store.save('products', books);\n products = books;\n } \n return products;\n }", "title": "" }, { "docid": "9bcba38a5c155d1b0e77a7b8c8ec8fb2", "score": "0.71021193", "text": "function getAllActiveProducts() {\n let url = `${baseApiUrl}products/getActiveProducts`;\n fetch(url).then(response => response.json()).\n then(data => {\n if (data.status === 200) {\n products = data.data;\n printProducts(products);\n }\n })\n}", "title": "" }, { "docid": "81d5d55709e52b992d437c9c0bbdd1f2", "score": "0.7092604", "text": "viewProducts() {\n\t\tconnection.query('SELECT * FROM products', (err, res) => {\n\t\t\tif (err) throw err;\n\t\t\tconsole.table(res);\n\t\t\tpromptObj.continuePrompt();\n\t\t});\t\n\t}", "title": "" }, { "docid": "aea303d630f97ab1a2fae59ce700a100", "score": "0.70528823", "text": "function getProducts(req, res) {\r\n res.writeHead(200,{\"Content-Type\" : \"application/json\"});\r\n let productData=JSON.stringify(products);\r\n res.end(productData);\r\n}", "title": "" }, { "docid": "ded1b7bf1b895f0367c72cdb65339761", "score": "0.70487684", "text": "getProuducts(req, res) {\n console.log(Products);\n return res.json(Products);\n }", "title": "" }, { "docid": "834e11f459d0d13d88c736f75cd9f9b4", "score": "0.7036336", "text": "async getProducts() {\n await axios_1.default.get(process.env.SERVER + '/api/rest/v1/products/1111111171', {\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer ' + this.accessToken,\n },\n }).then((response) => {\n console.log(response.data);\n }).catch(error => console.log(error));\n }", "title": "" }, { "docid": "03d4c0bb1332506013938f6cc08e46f6", "score": "0.7026537", "text": "function getProductById (id) {\n\n}", "title": "" }, { "docid": "b256530515365daf8eeb8a70f2131154", "score": "0.7022163", "text": "function getProducts(arr) {\n\n}", "title": "" }, { "docid": "0fa52e8abee3a412199d2e1ece7c0544", "score": "0.7019662", "text": "getProductList(requestConfig, successCallback, errorCallback) {\n const config = requestConfig;\n config.url = `${globals.getRestUrl('getProducts')}`;\n this.get(config, successCallback, errorCallback);\n }", "title": "" }, { "docid": "f9818b2b424e6689b23e2de834b79937", "score": "0.7011957", "text": "getProducts(products) {\n\t\tthis.renderProducts(products);\n\t\t// SAVE PRODUCTS TO STORAGE\n\t\tStorage.SetItem(\"products\", products);\n\t}", "title": "" }, { "docid": "9e7de47cde7d3ee4c78f68711c58d6af", "score": "0.69835955", "text": "function GetProducts() {\n\t\t$('#receivedProd').empty();\n\t\tvar url = '../api/Products/GetProducts';\n\t\t$.ajax({\n\t\t\turl : url,\n\t\t\ttype : 'GET',\n\t\t\tdataType : \"JSON\",\n\t\t\tsuccess : function(data) {\n\t\t\t\t\n\t\t\t\tvar jsonObj = JSON.strin\n\t\t\t\t$('#productsMenu').append(result);\n\t\t\t}\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "7e5e613c98ab49078730e4e4066ca12c", "score": "0.69828206", "text": "productList(){\n return apiServer.get(`/posts/productList/`);\n }", "title": "" }, { "docid": "abd8884466f23e696a5fcd7489312604", "score": "0.6981056", "text": "function getMyProducts(status) {\n\t // TODO: add status check.\n\t if (status !== undefined) {\n\t return $http.post('/api/product/getMy', { status: status });\n\t }\n\t return $http.post('/api/product/getMy');\n\t }", "title": "" }, { "docid": "cdd7e911ad08d5d7a1647c5a56119b4e", "score": "0.69767433", "text": "function displayProducts(){\r\n let param = window.location.search.substr(1);\r\n param = param.split('=')\r\n if(param[0] == 'type')\r\n displayProductsByType(param[1])\r\n if(param[0] == 'name')\r\n displayProductsByName(param[1])\r\n}", "title": "" }, { "docid": "9a34a6794b972b11e1d07975dd8a9aa6", "score": "0.6975797", "text": "function index(req, res) {\n return Product.find().exec()\n .then(respondWithResult(res))\n .catch(handleError(res));\n}", "title": "" }, { "docid": "d10e4d8b11dc1d06c0e088064d4fb74d", "score": "0.6971141", "text": "function viewProducts() {\n console.log('\\n # ALL PRODUCTS FOR SALE #\\n');\n // query all products in the database and show results to user\n bamazonDb.query('SELECT * FROM products;', (err, result) => {\n if(err) throw err;\n console.table(result);\n showMenu(); // return user to selection menu\n });\n}", "title": "" }, { "docid": "eee75a4b1f04203db670bf92d7efec26", "score": "0.6957412", "text": "function loadProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\t\tconsole.table(res);\n\t\tpromptCustomerForItem(res);\n\t});\n}", "title": "" }, { "docid": "8a31ec96f6697def2d54d46b9f88ef9d", "score": "0.6946953", "text": "function getProducts() {\n var urlExt = location.search.split('filter=')[1];\n var url= \"../api/productList.php?filter=\"+urlExt;\n xhr(\n {\n \"method\": \"GET\",\n \"url\": url\n }\n );\n}", "title": "" }, { "docid": "5beb69b53c3b053bd6fae67d08fb18d5", "score": "0.6941539", "text": "function loadProducts() {\n $http.get(\"http://localhost:3000\").success(function (offerings) {\n app.offerings = offerings;\n });\n }", "title": "" }, { "docid": "373d8608eec094886f23e8be5276950d", "score": "0.69409513", "text": "function readProducts() {\n // Display all products in the store\n console.log(\"\\nSelecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n // Sell function\n sellToUser();\n });\n\n }", "title": "" }, { "docid": "612b50a56ff0d54dc7bb8ba99dfc9f76", "score": "0.6931602", "text": "function viewProducts () {\n\n // Create a SQL select query to grab all the rows from the products table\n connection.query(\n 'SELECT * FROM products',\n function (err, res) {\n if (err) throw err;\n\n // Display the products in a nice table format\n console.table(res);\n\n // Display the main menu\n mainMenu();\n }\n );\n}", "title": "" }, { "docid": "5ba4d14de8999808e84e4e7b2428807d", "score": "0.69302166", "text": "function viewProducts() {\n // Fetch all available products from the database and handle the response with a callback\n database.fetchProducts(products => {\n // Generate a table and console.log it\n generateFullTable(products);\n // Show the main menu\n mainMenu();\n });\n}", "title": "" }, { "docid": "d5b4ffdd86084cfab353c987186dc48b", "score": "0.69299245", "text": "function GetAllProducts() {\r\n debugger;\r\n var getData = prodService.getProducts();\r\n debugger;\r\n getData.then(function (prod) {\r\n $scope.products = prod.data; \r\n }, function () {\r\n alert('Error in getting records');\r\n });\r\n }", "title": "" }, { "docid": "b56fcc0ed3fd03b3683dd470552d2e60", "score": "0.6877387", "text": "function getProduct() {\n $.get(\"/api/products\", function (data) {\n product = data;\n\n //console.log(\"product := \" + product); //Contains an aray of objects\n\n newProduct = JSON.stringify(product);\n\n console.log(\"newproduct := \" + newProduct);\n\n finalProduct = JSON.parse(newProduct);\n console.log('data', data)\n\n initializeRows(data);\n\n });\n }", "title": "" }, { "docid": "8cbb4b7380e9e29d41a3efe140808b6b", "score": "0.68753475", "text": "async function getProducts() {\n\t\ttry {\n\t\t\t// Store all tags in : tags\n\t\t\tconst tags = await Tag.find()\n\t\t\t\t.then()\n\t\t\t\t.catch((dbError) => next(dbError));\n\t\t\t// Store all sneakers from the database in : sneakers\n\t\t\tconst sneakers = await Sneaker.find()\n\t\t\t\t.then()\n\t\t\t\t.catch((dbError) => next(dbError));\n\n\t\t\t// Render the products page with all sneakers !\n\t\t\tres.render('products', {\n\t\t\t\ttags,\n\t\t\t\tsneakers,\n\t\t\t\tscripts: ['filter.js'],\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tnext(error);\n\t\t}\n\t}", "title": "" }, { "docid": "8856780cea5a67e876035b3229d16ea0", "score": "0.68679017", "text": "function getProductsOnSale() {\n var url = appConfig.baseUrl+'server/index.php';\n var deferred = $q.defer();\n $http({\n method: 'GET',\n url: url,\n params: {action: 'getProductsOnSale'}\n }).success(function (data) {\n deferred.resolve(data);\n }).error(function (data, status) {\n deferred.reject(status);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "14236e27284d326a8f7c3808bb92f35a", "score": "0.6858223", "text": "function getAllProducts(){\n $.ajax({\n url:\"/products.json\",\n contentType:\"application/json\",\n type:\"get\",\n success: function(result,textStatus,error){\n console.log(result);\n console.log(textStatus);\n console.log(error);\n products_list=$(\"#products-list\");\n products_list.empty();\n result.forEach(\n function(v,i,c_ary){\n productPane(v,products_list);\n });\n $(\"#products-list-title\").text(\"Products\")\n },\n error: function(xhr,textStatus,error){\n //TODO error handling\n console.log(error);\n }\n });\n }", "title": "" }, { "docid": "09d86c4d397020ee52c4ace44a774505", "score": "0.68531144", "text": "getAllProducts() {\n return __awaiter(this, void 0, void 0, function* () {\n // try/catch\n // data = await Product.find()\n const products = mongo_data_1.data.map((productEntity) => mapper_1.ProductMap.toDomain(productEntity));\n return shared_1.Result.ok(products);\n });\n }", "title": "" }, { "docid": "a0e675e40aaebd1882c5027ea8ff233d", "score": "0.68530613", "text": "function getProd(){\n \n return dispatch => {\n axios.get(\"./products\").then(resp => {\n dispatch({\n type: GET_PROD,\n payload: resp.data\n })\n}, [])\n}\n}", "title": "" }, { "docid": "7605410138e63cfece9cfb5a433d9508", "score": "0.685094", "text": "function viewProducts() {\n // query database and return back the list of products available for the customer to purchase \n connection.query(\"SELECT * FROM bamazon_db.products\", function (err, res) {\n if (err) throw err;\n\n // display all of the items available for sale - include ids, names, and prices of products for sale\n console.log(\"\\n==============================< COMPLETE PRODUCT LISTING >==============================\");\n console.log(\"-------------------< Includes all products with quantity of 0 or more >-------------------\");\n\n for (var i = 0; i < res.length; i++) {\n console.log(\"Product-ID: \" + res[i].item_id + \" --- \" + res[i].product_name + \" --- Price --- \" + res[i].price + \" --- Qty --- \" + res[i].stock_quantity);\n } // end for loop\n console.log(\"============================< END COMPLETE PRODUCT LISTING >==============================\\n\");\n managerFunctions();\n }); // end display query\n} // end viewProducts()", "title": "" }, { "docid": "072c67aea64f05596c1bf4ff63e7cac8", "score": "0.6848827", "text": "function getAllProductos(req, res, next) {\n productos_1.default.find(function (err, productos) {\n if (err) {\n res.status(500).json({ err: err });\n }\n console.log(productos);\n res.status(200).json({ productos: productos });\n });\n}", "title": "" }, { "docid": "216dcdf1a74cc43db64dc9cf87ee3ec6", "score": "0.68402785", "text": "function viewProducts() {\n\n \tconnection.query(\"SELECT * FROM `products`\", function (err, results, fields) {\n\n \t\tif (err) throw err;\n\t\t\n\t\tconsole.log(\"\");\n\t\tconsole.log(\" ID Product Name Quantity Price \".yellow);\n\t\tconsole.log(\"----------------------------------------------------------\");\n\t\t\n\t\t// loop through the results from the select query on the products table\n\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\tconsole.log(formatTableData(results[i].item_id, results[i].product_name, results[i].stock_quantity, results[i].price));\n\t\t}\n\n\t\tconsole.log(\"----------------------------------------------------------\");\n\t\tconsole.log(\"\");\n\t\tmainMenuPrompt();\n\n\t});\n\n }", "title": "" }, { "docid": "6829f8c4a2ae318a83dbc42e52375543", "score": "0.6837637", "text": "function viewProducts() {\n connection.query('SELECT * FROM products', function (err, res) {\n if (err) throw err;\n console.table(res);\n selectActivity();\n });\n}", "title": "" }, { "docid": "6b04e0bf761073601d92b365468d026e", "score": "0.68271077", "text": "static getProducts() {\n const products = JSON.parse(localStorage.getItem('products'))\n return products;\n }", "title": "" }, { "docid": "c9d91e877092caa5bd38c22ff11bf2cc", "score": "0.6806256", "text": "function ProductListCtrl(productResource){\n var vm = this;\n\n //call the query methos of the product resource and assign the data to model\n // productResource.query(function(data){\n // vm.products = data;\n // });\n\n productResource.query(function (data){//the query method sends a request to the URL we defined in the $resoruce function. \n // the parameter is a callbacl function that is called upon recieving a successful HTTP response.\n \n vm.products = data; //the response (data) JSON Data returned form the Query. the resulting data is simply assigned to the products as part of the model.\n });\n//We have two modules created\n//how do we tell our main module about this ? \n//Yes through Dependency we need to inject it in the app.js \n\n //The controller calls the Query method of the $resource Object, which in return send a get request to the URL and return a JSON Array containing a list of Products\n \n // vm.products = [\n // {\n // \"productId\": 1,\n // \"productName\": \"Leaf Rake\",\n // \"productCode\": \"GDN-0011\",\n // \"releaseDate\": \"March 19, 2016\",\n // \"description\": \"Leaf rake with 48-inch wooden handle.\",\n // \"price\": 19.95,\n // \"starRating\": 3.2,\n // \"imageUrl\": \"http://openclipart.org/image/300px/svg_to_png/26215/Anonymous_Leaf_Rake.png\"\n // },\n // {\n // \"productId\": 2,\n // \"productName\": \"Garden Cart\",\n // \"productCode\": \"GDN-0023\",\n // \"releaseDate\": \"March 18, 2016\",\n // \"description\": \"15 gallon capacity rolling garden cart\",\n // \"price\": 32.99,\n // \"starRating\": 4.2,\n // \"imageUrl\": \"http://openclipart.org/image/300px/svg_to_png/58471/garden_cart.png\"\n // },\n // {\n // \"productId\": 5,\n // \"productName\": \"Hammer\",\n // \"productCode\": \"TBX-0048\",\n // \"releaseDate\": \"May 21, 2016\",\n // \"description\": \"Curved claw steel hammer\",\n // \"price\": 8.9,\n // \"starRating\": 4.8,\n // \"imageUrl\": \"http://openclipart.org/image/300px/svg_to_png/73/rejon_Hammer.png\"\n // },\n // {\n // \"productId\": 8,\n // \"productName\": \"Saw\",\n // \"productCode\": \"TBX-0022\",\n // \"releaseDate\": \"May 15, 2016\",\n // \"description\": \"15-inch steel blade hand saw\",\n // \"price\": 11.55,\n // \"starRating\": 3.7,\n // \"imageUrl\": \"http://openclipart.org/image/300px/svg_to_png/27070/egore911_saw.png\"\n // },\n // {\n // \"productId\": 10,\n // \"productName\": \"Video Game Controller\",\n // \"productCode\": \"GMG-0042\",\n // \"releaseDate\": \"October 15, 2015\",\n // \"description\": \"Standard two-button video game controller\",\n // \"price\": 35.95,\n // \"starRating\": 4.6,\n // \"imageUrl\": \"http://openclipart.org/image/300px/svg_to_png/120337/xbox-controller_01.png\"\n // } ];\n\n vm.showImage = false;\n \n vm.toggleImage = function(){\n vm.showImage = !vm.showImage; \n }\n \n }", "title": "" }, { "docid": "c97966ffad63295df79ac65143a02e20", "score": "0.6796736", "text": "async function getTypeProducts(req, res) {\n const id = req.params.id;\n let allRecords = await dataModules.Product.getTypeProducts(id);\n res.status(200).json(allRecords);\n}", "title": "" }, { "docid": "c1301152487788f690c5847283c5ff37", "score": "0.67961234", "text": "async function getProductFromOrder(req, res) {\n const id = req.params.id;\n let allRecords = await dataModules.Order.getProductFromOrder(\n id,\n dataModules.OrderDetails,\n dataModules.Product,\n dataModules.Color,\n dataModules.Size,\n dataModules.Image\n );\n res.status(200).json(allRecords);\n}", "title": "" }, { "docid": "de2f76c956d79b5d9d5bcc06db60d3a7", "score": "0.6775832", "text": "function getProducts() {\n\treturn db.query(\"SELECT * FROM departments\")\n\t\t.then(function(rows) {\n\t\t\treturn rows[0];\n\t\t})\n\t .catch(function(err) {\n\t console.log(err);\n\t });\n}", "title": "" }, { "docid": "168b943b51dc3417fcef1458d25f2660", "score": "0.6773715", "text": "function getProducts() {\n return new Promise((resolve, reject) => {\n newProducts.find({})\n .then(result => resolve(result))\n .catch(error => reject(error))\n })\n}", "title": "" }, { "docid": "b7173b9611d6d1f6815a15d2da36ef05", "score": "0.6769642", "text": "async function getProductFromCart(req, res) {\n const id = req.params.id;\n let allRecords = await dataModules.Cart.getProductFromCart(\n id,\n dataModules.Product,\n dataModules.Color,\n dataModules.Size\n );\n res.status(200).json(allRecords);\n}", "title": "" }, { "docid": "74fa4ac146eaff0266fe5033da26276d", "score": "0.6768448", "text": "get products(){\n return this.data.slice(this.currentPageMin, this.currentPageMax);\n }", "title": "" }, { "docid": "d05c38990eaccefcd231a4f41fdb134b", "score": "0.6741236", "text": "async getProducts(){\n const response = await fetch('https://shielded-wildwood-82973.herokuapp.com/products.json');\n if(!response.ok){\n return null;\n }\n const json = await response.json();\n return json;\n }", "title": "" }, { "docid": "164d2aefc119f3311ad6ffef510ebbd0", "score": "0.6736816", "text": "function viewAllProducts() {\n connection.query(\n \"SELECT * FROM products\",\n function(err, res) {\n if (err) throw err;\n console.table(res);\n mainMenu();\n }\n )\n}", "title": "" }, { "docid": "379b182e2a0a7e410df7d1b997d1f2ff", "score": "0.67339295", "text": "function obtenerProductos() {\n if(verificarSesion){\n ajaxConnector(\n \"GET\",\n \"product/all\",\n undefined,\n armarTablaProductos,\n errorHandler\n );\n }\n}", "title": "" }, { "docid": "97cb422d7a567dd1beeced75bf7bb124", "score": "0.67304564", "text": "async function get(req, res, next) {\n try {\n logger.info(\"ProductController->Get Product Starts\")\n \n const context = {};\n\n //If Get Product by id\n if (req.params.id) {\n context.id = parseInt(req.params.id);\n }\n const rows = await db_product.get(context);\n res.status(200).send({ result: rows });\n logger.info(\"ProductController->Get Product Ends\")\n } catch (err) {\n logger.info(\"ProductController->Get Product Failed\")\n next(err);\n }\n}", "title": "" }, { "docid": "f4bf95f01a42c94df0700aa20d115145", "score": "0.67221874", "text": "function retrieveProducts() {\n if(localStorage.getItem('products')) {\n var storedProducts = localStorage.getItem('products');\n var parsedProducts = JSON.parse(storedProducts);\n Product.productArray = parsedProducts;\n } else {\n instantiateProducts();\n }\n}", "title": "" }, { "docid": "25cc7e25c1cbb70c589a6b223e9d82e3", "score": "0.67198694", "text": "getProducts() {\n return this.state.products;\n }", "title": "" }, { "docid": "2adc65a4c6945597b87b442cb794c908", "score": "0.6712412", "text": "function fetchProduct(id) {\n \n}", "title": "" }, { "docid": "93eb0afacbd5eb7f4ee90458bdc4baba", "score": "0.67115206", "text": "function viewProducts() {\n connection.query('SELECT * FROM products', function (error, results1) {\n if (error) throw error;\n // console.log(results1);\n // Display the available products with their ID #s\n for (let i = 0; i < results1.length; i++) {\n console.log(results1[i].item_id + \" - \" + results1[i].product_name + \" - \" + results1[i].department_name + \" - \" + results1[i].price + \" - \" + results1[i].stock_quantity)\n };\n promptManager();\n })\n}", "title": "" }, { "docid": "7f86a1b0981cf1fe717249e330290590", "score": "0.67104936", "text": "function findAll() {\r\n\t$.ajax({\r\n\t\ttype : 'GET',\r\n\t\turl : productsBaseURL,\r\n\t\tdataType : \"json\", // data type of response\r\n\t\tsuccess : renderProductList\r\n\t});\r\n}", "title": "" }, { "docid": "2e462f19a62d01c300055fcfeed5d267", "score": "0.6699649", "text": "function loadProducts() {\n // Query database to return all entries\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if(err) throw err;\n\n // Display all items in console\n console.table(res);\n\n // Call function to prompt user to purchase an item\n promptToPurchase();\n });\n}", "title": "" }, { "docid": "f56546abaced2b34582b3522247fd531", "score": "0.66871643", "text": "async function getAllProducts(req, res) {\n try {\n const response = await ProductsService.getAllProducts();\n\n if (!response.ok) {\n return res.status(404).send(response);\n }\n\n return res.render(\"search\", {\n products: response.products,\n });\n } catch (error) {\n return res.status(500).send(error);\n }\n}", "title": "" }, { "docid": "61d3d555a25a65910ea54ccbebee239d", "score": "0.6681058", "text": "function getProducts() {\n let potentialProducts = localStorage.getItem('productstorage');\n if(potentialProducts) {\n let parsedProducts = JSON.parse(potentialProducts);\n allProducts = parsedProducts;\n }\n}", "title": "" }, { "docid": "be7b982e284cc55dbe2e0f2a9563f192", "score": "0.6678294", "text": "function viewProducts(){\n // Query Made To Database\n connection.query(\"SELECT * FROM products\", function(err, res) {\n console.log(\"\\n-----------------------------------\");\n // All Products Are Listed\n for (var i = 0; i < res.length; i++) {\n console.log(\"Product_ID: \" + res[i].item_id + \" | Product_Name: \" + res[i].product_name + \" | Price: \" + res[i].price.toFixed(2) + \" | Quantity: \" + res[i].stock_quantity + \" | \" );\n }\n console.log(\"\\n-----------------------------------\");\n // Prompted To Choose Another Function\n managing();\n });\n}", "title": "" }, { "docid": "a5146241549f9ffce65a5113a03eb889", "score": "0.6670043", "text": "function listProducts() {\n\tconnection.query('SELECT ItemID, ProductName, Price, StockQuantity FROM products', function(err, rows, fields) {\n\t\tif(err) throw err;\n\t\tconsole.log('Available products for sale:');\n\t\tshowSelectedProducts(rows);\n\t});\n\tconnection.end();\n}", "title": "" }, { "docid": "b35e5dbc10d3758c4a61e227e8e625b4", "score": "0.6666842", "text": "function readProducts() {\n\tconnection.query(\"SELECT item_id, product_name, price FROM products\", function(err, res){if (err) throw err;\n\t\t // Log all results of the SELECT statement\n\t\t console.table(res);\n\t\t getData();\n \t\t});\n}", "title": "" }, { "docid": "557afdaebdd95e4aa74fdadd3c95b4ba", "score": "0.6658019", "text": "function getUpdatedProductList() {\n dataService.getProductsFromApi()\n .then(function(data) {\n $scope.productList = data;\n });\n }", "title": "" }, { "docid": "513d3654a5f4a1be26d6e5ec1a1abbde", "score": "0.6657366", "text": "function getStoreProducts(id,name){\n $.ajax({\n url:\"/stores/\"+id+\"/products.json\",\n contentType:\"application/json\",\n type:\"get\",\n success: function(result,textStatus,error){\n console.log(result);\n console.log(textStatus);\n console.log(error);\n products_list=$(\"#products-list\");\n products_list.empty();\n result.forEach(\n function(v,i,c_ary){\n store_product_container=$(\"<div></div>\",{\"class\":\"store-product-container\"});\n productPane(v,store_product_container);\n store_product_container.append($(\"<p></p>\",{\"class\":\"store-product-stock\"}).text(\"stock:\"+v[\"stock\"]));\n products_list.append(store_product_container);\n $(\"#products-list-title\").text(\"Products in \"+name)\n });\n },\n error: function(xhr,textStatus,error){\n //TODO error handling\n console.log(error);\n }\n });\n }", "title": "" }, { "docid": "cced2c81acf27e10be15932ca0e1b0c5", "score": "0.6653799", "text": "async function getProducts () {\n // Initialize product service\n const productService = new ProductService();\n\n // Fetch all products from the api recursively\n const products = await productService.fetchProducts(URLS.PRODUCT_API_URL);\n\n // Filter products so we only have air conditioners\n const airConditioners = productService.filterProducts(products, 'category', 'Air Conditioners');\n\n // calculate individual cubic weight of each product\n const airconditionersWithWeight = productService.calculateCubicWeight(airConditioners);\n \n // get the total average cubic weight of all products\n const averageCubicWeight = totalAverageCubicWeight(airconditionersWithWeight).toFixed(2);\n \n return { products: airconditionersWithWeight, averageCubicWeight }\n}", "title": "" }, { "docid": "fdd717698087e3cc5b7303174a0205bd", "score": "0.6651816", "text": "function getproducts() {\n\n\tconnection.query(\n\t\"SELECT * FROM products\",\n\t function(err, results) {\n if (err) throw err;\n else {\n \t\n \t\tconsole.log('\\nProducts available for sale.\\n\\n');\n \t\tuniversal.createtable(results);\n \t\n \t}\n\n customerprompt(results);\n\n});\n\n}", "title": "" }, { "docid": "34c35218fff8fbcd29c8cea1ba0e203b", "score": "0.6650394", "text": "function getAll(req, res) {\n console.log(req.query.page);\n productService.getAll(req.query.page)\n .then(function (products) {\n res.send(products);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "title": "" }, { "docid": "6ce3e387853f644085c8a303ba8f5266", "score": "0.664839", "text": "async getProducts() {\n this.loading = true;\n try {\n const { search, sort: sort_direction, sort_field, page} = this.productOptions;\n const {data: items , ...pagination} = await productService.list({\n search, \n sort_direction, \n sort_field,\n page,\n });\n\n this.pagination.props = pagination;\n this.products.props = {\n ...this.products.props,\n items,\n };\n } catch (e) {\n if (e.response && e.response.status === 404) {\n this.products.error = e.response.data;\n this.pagination.props = this.freshPagination().props;\n }\n } finally {\n this.loading = false;\n }\n }", "title": "" }, { "docid": "8666ff333b152979a56e9ed8ac1ed910", "score": "0.66462463", "text": "function getAllproduct() {\n return fetch(\"https://oc-p5-api.herokuapp.com/api/cameras\")\n .then(function (httpBodyResponse) {\n return httpBodyResponse.json()\n })\n .then(function (products) {\n return products\n })\n .catch(function (error) {\n alert(error)\n })\n}", "title": "" }, { "docid": "18f7451c70cbf22674e533981bc805e2", "score": "0.6642846", "text": "function getAllProducts(status) {\n\t // TODO: add status check.\n\t if (status !== undefined) {\n\t return $http.post('/api/product/getAll', { status: status });\n\t }\n\t return $http.post('/api/product/getAll');\n\t }", "title": "" }, { "docid": "49b6807ee05c0618e23a4f676723d060", "score": "0.6638552", "text": "async products(req, res) {\n const result = await UserModel.getAllProducts();\n const category_filter_result = await UserModel.getUniqueCategory(req, res);\n\n res.render(\"../views/user/index\", { products: result, category: '', filter: category_filter_result });\n }", "title": "" }, { "docid": "84f5f0d3a172058e2f5ee0442db4c62c", "score": "0.6617628", "text": "find(req, res) {\n Product.find()\n .then(products => res.ok(products))\n .catch( err => res.serverError(err) );\n }", "title": "" }, { "docid": "0055b22d9134adf34b0352fcdc0a9e12", "score": "0.6616052", "text": "getProducts() {\r\n return this.firestore.collection('products');\r\n }", "title": "" } ]
c566e35d2a8aeb81491b8acb0cb7018b
this function takes care of displaying whichever nodes are currently in state (the nodes that have been registered to the backend)
[ { "docid": "b43974e2548d625eab16930cad7212e2", "score": "0.0", "text": "function RenderMap(props) {\n return <Container fluid className={props.active.length < props.threshold ? 'unauthorized' : ''} style={{ width: \"95%\" }}>\n <Row style={{width: 'auto'}}>\n <RenderIcon icon={<GiLockedFortress />} label={'Auth Node'} />\n </Row>\n <Row style={{width: 'auto'}}>\n {props.active && props.active.map((nodeType, i) => {\n switch(nodeType){\n case 'face':\n return <RenderIcon key={i} icon={<GiCyborgFace />} label={'Face ID'} />\n case 'web':\n return <RenderIcon key={i} icon={<FaGlobe />} label={'Web ID'} />\n case 'other':\n return <RenderIcon key={i} icon={<FaServer />} label={'Unknown Node'} />\n case 'voice':\n return <RenderIcon key={i} icon={<GiSpeaker />} label={'Speech ID'} />\n case 'qr':\n return <RenderIcon key={i} icon={<FaBarcode />} label={'QR Scan ID'} />\n }\n })}\n </Row>\n </Container>\n\n}", "title": "" } ]
[ { "docid": "9bd28c58282b46c3c99607d838f61004", "score": "0.6952115", "text": "function showAllNodes() {\n if (d3.event.stopPropagation) {\n d3.event.stopPropagation();\n }\n force.resume();\n //Put them back to opacity=1\n node\n .style(\"stroke-opacity\", 1)\n .style(\"fill-opacity\", 1)\n .classed(\"activeNode\", true)\n .classed(\"clickedNode\", false)\n .classed(\"baseNode\", false);\n link.style(\"stroke-opacity\", 0.6);\n d3.selectAll(\"g.cell\").classed(\"active\", false); // Clear faculty/entry filters\n allShowing = true;\n facultySelected = false;\n nodeHighlighted = false;\n pinnedTooltip.style(\"opacity\", 0);\n }", "title": "" }, { "docid": "7058d1e105b1efebcbff183b017e9fe9", "score": "0.66845036", "text": "function showNodes(){\n d3.select('#node_'+influenceData.masterNodeID)\n .classed('masterNode', true) \n .transition().duration(0)\n .style('fill', 'var(--color-main-dark)')\n d3.selectAll('path.link, path.linkBackground')\n .transition().duration(100)\n .style('opacity', 0) \n } // end showNodes()", "title": "" }, { "docid": "f0f470f4535d29449f7f084b5cc5250b", "score": "0.6268968", "text": "function RefreshState(newNOW){\n\n pr(\"\\t\\t\\tin RefreshState newNOW:_\"+newNOW+\"_.\")\n\n\tif (newNOW!=\"\") {\n\t PAST = NOW;\n\t NOW = newNOW;\n\t\t\n\t\t// if(NOW==\"a\" || NOW==\"A\" || NOW==\"AaBb\") {\n\t\t// \t$(\"#category-A\").show();\n\t\t// }\n\t\t// if(NOW==\"b\" || NOW==\"B\" || NOW==\"AaBb\") {\n\t\t// \t$(\"#category-B\").show();\n\t\t// }\n\t}\n\n $(\"#category-A\").hide();\n $(\"#category-B\").hide(); \n // i=0; for(var s in selections) { i++; break;}\n // if(is_empty(selections) || i==0) LevelButtonDisable(true);\n // else LevelButtonDisable(false);\n\n //complete graphs case\n // sels=getNodeIDs(selections).length\n if(NOW==\"A\" || NOW==\"a\") {\n \t// N : number of nodes\n \t// k : number of ( selected nodes + their neighbors )\n \t// s : number of selections\n var N=( Object.keys(Nodes).filter(function(n){return Nodes[n].type==catSoc}) ).length\n var k=Object.keys(getNeighs(Object.keys(selections),nodes1)).length\n var s=Object.keys(selections).length\n pr(\"in social N: \"+N+\" - k: \"+k+\" - s: \"+s)\n if(NOW==\"A\"){\n if( (s==0 || k>=(N-1)) ) {\n LevelButtonDisable(true);\n } else LevelButtonDisable(false);\n if(s==N) LevelButtonDisable(false);\n }\n\n if(NOW==\"a\") {\n LevelButtonDisable(false);\n }\n\n $(\"#semLoader\").hide();\n $(\"#category-A\").show();\n $(\"#colorGraph\").show();\n \n }\n if(NOW==\"B\" || NOW==\"b\") {\n var N=( Object.keys(Nodes).filter(function(n){return Nodes[n].type==catSem}) ).length\n var k=Object.keys(getNeighs(Object.keys(selections),nodes2)).length\n var s=Object.keys(selections).length\n pr(\"in semantic N: \"+N+\" - k: \"+k+\" - s: \"+s)\n if(NOW==\"B\") {\n if( (s==0 || k>=(N-1)) ) {\n LevelButtonDisable(true);\n } else LevelButtonDisable(false);\n if(s==N) LevelButtonDisable(false);\n }\n\n if(NOW==\"b\") {\n LevelButtonDisable(false);\n }\n if ( semanticConverged ) {\n $(\"#semLoader\").hide();\n $(\"#category-B\").show();\n $.doTimeout(30,function (){\n EdgeWeightFilter(\"#sliderBEdgeWeight\", \"label\" , \"nodes2\", \"weight\");\n NodeWeightFilter ( \"#sliderBNodeWeight\" , \"NGram\", \"type\" , \"size\");\n \n });\n } else {\n $(\"#semLoader\").css('visibility', 'visible');\n $(\"#semLoader\").show();\n }\n\n }\n if(NOW==\"AaBb\"){\n LevelButtonDisable(true);\n $(\"#category-A\").show();\n $(\"#category-B\").show();\n }\n\n partialGraph.draw();\n\n}", "title": "" }, { "docid": "96197d21d8197690421cde662b6426c7", "score": "0.6253055", "text": "function onInfoPanelPropertiesChanged() {\r\n const originalNodesElement = document.getElementById('original-nodes')\r\n originalNodesElement.innerText = `${aggregationHelper ? aggregationHelper.visibleNodes : 0} / ${\r\n originalGraph.nodes.size\r\n }`\r\n const originalEdgesElement = document.getElementById('original-edges')\r\n originalEdgesElement.innerText = `${aggregationHelper ? aggregationHelper.visibleEdges : 0} / ${\r\n originalGraph.edges.size\r\n }`\r\n const currentItem = graphComponent.currentItem\r\n const nodeLabel = currentItem instanceof ILabelOwner ? currentItem.labels.firstOrDefault() : null\r\n const nodeName = nodeLabel ? nodeLabel.text.replace('\\n', ' ') : ''\r\n const currentItemElement = document.getElementById('current-item')\r\n// currentItemElement.innerText = nodeName\r\n\n//alex3\n var is_name_change=(currentItemElement.innerText == nodeName) ? false : true;\n\n currentItemElement.innerText = nodeName;\r\n\n var is_name_change=(currentItemElement.innerText == nodeName);\n \n console.log(is_name_change);\n\n //console.log(sgi_);\n var sgi=sga[SampleGraphNum.value-1];\n var nodes_=sgi.nodes;\n console.log(nodes_);\n\n document.getElementById(\"txt1\").innerHTML = \"\";\n document.getElementById(\"txt2\").innerHTML = \"\";\n document.getElementById(\"txt1\").style.display = 'none';\n document.getElementById(\"txt2\").style.display = 'none';\n\n\n //alex3\n //ci=currentItem;\n\n currentItemElement.style.display = nodeName !== '' ? 'block' : 'none'\r\n\r\n let aggregate = null\r\n if (aggregationHelper && graphComponent.currentItem instanceof INode) {\r\n aggregate = aggregationHelper.getAggregateForNode(graphComponent.currentItem)\r\n } \n\n// if (!aggregationHelper && graphComponent.currentItem instanceof INode) {\r\n\tvar tag_ = currentItem instanceof ILabelOwner ? currentItem.tag : null;\n\n\t//var tag_=currentItem instanceof INode ? currentItem.tag : null;\n if (tag_!=null) \n\t{\n\t if (tag_.hasOwnProperty('id'))\n\t { \n\t\tconsole.log(tag_.id);\n\n//\t var txtsi=txts_a[SampleGraphNum.value-1];\n//\t\tconsole.log(txtsi);\n\t\t//var nodes_=sgi.nodes;\n\n\t //var sgi_=sgi;\n\t\t//var e=nodes_.find(test_tag,tag_.id);\n\t\tvar e=nodes_.find(x => x.id === tag_.id);\n//\t console.log(e);\n\t\tif (e.txt1!=null && nodeName!=\"\" && is_name_change)\n\t\t{\n//\t\t if (e.hasOwnProperty('txt1')\n//\t\t {\n//\t\t alert(e.txt1);\n\t\t\tif (e.txt1!=\"\"){\n\t\t\tdocument.getElementById(\"txt1\").innerHTML = \"<hr>\"+e.txt1;\n\t\t\tdocument.getElementById(\"txt1\").style.display = 'block';\n\t\t\t}\n\t\t\t \n//\t\t }\n//\t\t if (e.hasOwnProperty('txt2')\n//\t\t {\n\t\t\t if (e.txt2!=\"\"){\n\t\t\t document.getElementById(\"txt2\").innerHTML = \"<hr>\"+e.txt2+\"<hr>\";\n\t\t\t document.getElementById(\"txt2\").style.display = 'block';\n\t\t\t }\n//\t\t }\n\t\t}\n\t\telse \n\t\t{\n//\t\t \t document.getElementById(\"txt1\").style.display = 'none';\n//\t\t \t document.getElementById(\"txt2\").style.display = 'none';\n\t\t}\n\t } else {\n//\t\t \t document.getElementById(\"txt1\").style.display = 'none';\n//\t\t \t document.getElementById(\"txt2\").style.display = 'none';\n\t }\n\t} else {\n//\t \t document.getElementById(\"txt1\").style.display = 'none';\n//\t \t document.getElementById(\"txt2\").style.display = 'none';\n//\t\t document.getElementById(\"txt1\").innerHTML = \"\";\n//\t\t document.getElementById(\"txt2\").innerHTML = \"\";\n\n\t}\n\t\n\n \n //var a2 = sgi.map(a => a.id);\n\n// var sgi_=sgi;\n// console.log(sgi_);\n\n\n\t \n\t\n //}\n\n//alex3\n // console.log(aggregate);\n\n const descendantCountElement = document.getElementById('descendant-count')\r\n descendantCountElement.innerText = aggregate ? aggregate.descendantCount.toString() : '0'\r\n const descendantWeightSumElement = document.getElementById('descendant-weight-sum')\r\n if (aggregate) {\r\n const descendantWeightSum =\r\n Math.round((aggregate.descendantWeightSum + Number.EPSILON) * 100) / 100\r\n descendantWeightSumElement.innerText = descendantWeightSum.toString()\r\n } else {\r\n descendantWeightSumElement.innerText = '0'\r\n }\r\n\r\n // enable switching to filtered view only if there are some real edges in the graph\r\n // otherwise the graph in filtered view will be empty\r\n switchViewButton.disabled = graphComponent.graph.nodes.every(node =>\r\n aggregationHelper.aggregateGraph.isAggregationItem(node)\r\n )\r\n}", "title": "" }, { "docid": "5acaeafe9b774bffa92b6fc29c313b29", "score": "0.6203328", "text": "function _toggleNodeLabels()\r\n{\r\n\t// update visibility of labels \r\n\t\r\n\t_nodeLabelsVisible = !_nodeLabelsVisible;\r\n\t_vis.nodeLabelsVisible(_nodeLabelsVisible);\r\n\t\r\n\t// update check icon of the corresponding menu item\r\n\t\r\n\tvar item = $(\"#show_node_labels\");\r\n\t\r\n\tif (_nodeLabelsVisible)\r\n\t{\r\n\t\titem.addClass(CHECKED_CLASS);\r\n\t}\r\n\telse\r\n\t{\r\n\t\titem.removeClass(CHECKED_CLASS);\r\n\t}\r\n}", "title": "" }, { "docid": "1891625307dcfa2d2115f239b466fe8e", "score": "0.61857426", "text": "display() {\n if (this.nodes[this.idRoot] != null) {\n this.nodes[this.idRoot].display();\n }\n }", "title": "" }, { "docid": "de4f68880612b9806c0cdabfb520c470", "score": "0.61690557", "text": "updateStates () {\n if (this.node) {\n this.checkLock();\n this.checkRoot();\n this.updateQuery();\n this.updateInfoText();\n }\n }", "title": "" }, { "docid": "4ea51524eb820607a349c59c5a4ff996", "score": "0.6168009", "text": "display() {\n this.nodes[this.idRoot].display();\n }", "title": "" }, { "docid": "181f627539eae13a00169c5242f09a68", "score": "0.61454445", "text": "function updateNodesStates(tis) {\n g.nodes().forEach((nodeId) => {\n const node = g.node(nodeId);\n const { elem } = node;\n const taskId = nodeId;\n\n if (elem) {\n const classes = `node enter ${getNodeState(nodeId, tis)}`;\n elem.setAttribute(\"class\", classes);\n elem.setAttribute(\"data-toggle\", \"tooltip\");\n\n elem.onmouseover = (evt) => {\n let tt;\n if (taskId in tis) {\n tt = tiTooltip(tis[taskId], tasks[taskId]);\n } else if (node.children) {\n tt = groupTooltip(node, tis);\n } else if (taskId in tasks) {\n tt = taskNoInstanceTooltip(taskId, tasks[taskId]);\n elem.setAttribute(\"class\", `${classes} not-allowed`);\n }\n if (tt) taskTip.show(tt, evt.target); // taskTip is defined in graph.html\n };\n elem.onmouseout = taskTip.hide;\n elem.onclick = taskTip.hide;\n }\n });\n}", "title": "" }, { "docid": "2ddcc64a6e8c826ac2ecc1d8c770437a", "score": "0.6134388", "text": "_renderNodes() {\n this.state.scale = 1000 / this.state.jobs.length;\n this.state.nodeRadius = this.state.scale / 10;\n\n this._drawGrid();\n this._getTopNodes();\n if (this.state.topJobs.length > 0)\n this._drawChildNodes(this.state.topJobs, canvas.width / 2, 0, canvas.width);\n else\n this._drawChildNodes(this.state.jobs, canvas.width / 2, 0, canvas.width);\n this._drawLines();\n\n circles = this.state.nodes;\n }", "title": "" }, { "docid": "757cbab3d6fda8bf46361ca1d75b0730", "score": "0.6117093", "text": "function ToggleNodeLabels() {\n var updateJson = [];\n for (k in GraphObj.Nodes) {\n var n = GraphObj.Nodes[k];\n var lab = n.Id;\n if (PageStateObj.StandardsLabel == GraphLabels.NGSS) {\n lab = n.NGSSCode;\n if (lab == 'NULL') {\n lab = BLANK_STD_LABLE\n }\n \n }\n var nodeUpdate = { id: n.Id, label: lab };\n updateJson[updateJson.length] = nodeUpdate;\n }\n VISJS_NODES.update(updateJson)\n}", "title": "" }, { "docid": "4673184760229f2b4ff7cddd4283f196", "score": "0.60852444", "text": "function updateStatus(newNodes) {\n this.forceLayout.nodes().forEach(function (node, index) {\n newNodes.forEach(function (j) {\n if (node.id == j.id)\n node.status = j.status\n })\n });\n const nodes = this.forceLayout.nodes()\n const sel = this.vis.select('.nodeContainer').selectAll('.node');\n\n //update status\n sel.each(function (d) {\n const node = d3.select(this);\n node.append(\"circle\")\n .attr(\"r\", function (d) {\n if (d.type == 2)\n return 0;\n return 20\n })\n .style('fill', d => d.status == true ? (d.type == 1 ? \"blue\" : \"white\") : \"red\")\n .transition().duration(750).ease('elastic')\n\n node.append(\"rect\")\n .attr(\"width\", function (d) {\n if (d.type != 2)\n return 0;\n return 40\n })\n .attr(\"height\", function (d) {\n if (d.type != 2)\n return 0;\n return 40\n })\n .style('fill', d => d.status == true ? (d.type == 2 ? \"green\" : \"white\") : \"red\")\n .transition().duration(750).ease('elastic')\n node.append('text')\n .text(node => node.number)\n .attr('font-size', 8)\n .attr('dx', -6)\n .attr('dy', 4)\n node.append('text')\n .text(node => node.type == 1 ? \"\" + node.pattern : '')\n .attr('font-size', 8)\n .attr('fill', 'black')\n .attr('dx', 25)\n .attr('dy', 4)\n })\n this._redraw()\n}", "title": "" }, { "docid": "9939f57f7c5837fd6601bc014f68777f", "score": "0.6070718", "text": "function connectedNodes(clickedOn, firstClick, nodeClicked) {\n\n // console.log('>>>>>>>>>>>>> 2222.4444444');\n var tipName = clickedOn.name;\n if (lookupTable[clickedOn.name]) {\n tipName = lookupTable[clickedOn.name].name;\n if (lookupTable[clickedOn.name].weight > 0) {\n var fmtNum = (\"\" + lookupTable[clickedOn.name].weight).replace(/(\\d{1,3})(?=(\\d{3})+(?:$|\\.))/g, \"$1,\");\n // tipName = tipName + ':' + lookupTable[clickedOn.name].weight;\n tipName = tipName + ':' + fmtNum;\n }\n }\n\n nodeHighlighted = true;\n d3.selectAll(\"g.cell\").classed(\"active\", false); // Clear faculty/entry filters\n if (d3.select(nodeClicked).classed(\"baseNode\")) { // Base node was clicked, show all\n showAllNodes();\n return;\n }\n force.stop(); // Stop moving\n tooltip.style(\"opacity\", 0); // Clear unpinned tooltip (because it is the same as the pinned)\n pinnedTooltip.transition()\n .duration(200)\n .style(\"opacity\", 0.9);\n pinnedTooltip.html(tipName) // Pin tooltip with name of clicked on node\n .style(\"right\", \"20px\")\n .style(\"top\", \"20px\");\n node.each(function(d) { // Allow for clicking back on previous baseNodes\n d3.select(this).classed(\"baseNode\", false);\n });\n d3.select(nodeClicked).classed(\"baseNode\", true);\n node.classed(\"activeNode\", function(o) {\n return neighboring(clickedOn, o) | neighboring(o, clickedOn) ? true : false;\n })\n node.style(\"stroke-opacity\", function(o) {\n return (neighboring(clickedOn, o) | neighboring(o, clickedOn)) ? 1 : 0.1;\n });\n node.style(\"fill-opacity\", function(o) {\n return (neighboring(clickedOn, o) | neighboring(o, clickedOn)) ? 1 : 0.1;\n });\n link.style(\"stroke-opacity\", function(o) {\n return clickedOn.index == o.source.index | clickedOn.index == o.target.index ? 0.6 : 0.1;\n });\n d3.select(\"activeNode\").moveToFront(); // Brings activeNode nodes to front\n allShowing = false;\n facultySelected = false;\n }", "title": "" }, { "docid": "4b7bb4379afcd6945a9643315834ed4f", "score": "0.598508", "text": "render() {\n const { activeTrailsInformation } = this.props;\n this.renderGraph(this.props);\n return (\n <div className='graph'>\n { activeTrailsInformation && <p className='help-text'> {\n activeTrailsInformation.queryNodes.length < 2 \n ? \"Select two nodes\"\n : \"Click on a node to mark it as observed\"\n } </p> }\n \n </div>\n );\n }", "title": "" }, { "docid": "20a0fd962b14ada9496b0f3fe0d37731", "score": "0.5872931", "text": "showNode(node)\n {\n //show node\n this.visiabilty = true;\n //show its children\n for (const n of node.children) {\n n.visiabilty = true; \n if(n.children.length > 0)\n {\n this.showNode(n);\n }\n }\n }", "title": "" }, { "docid": "91c670e2ac506291cfa31414dc537faa", "score": "0.5844036", "text": "function refresh_nodes() {\n var items = [];\n for ( var i = 0; i < nodes.length; i++ ) {\n var n = nodes[ i ];\n var s = n.generate_host_list_entry();\n items.push( s );\n }\n \n $( \"#nodes\" ).html( '' );\n \n var ul = $( \"<ul/>\", {\n \"class\": \"node-list\"\n } ).appendTo( \"#nodes\" );\n \n for ( var i = 0; i < items.length; i++ ) {\n ul.append( items[ i ] );\n }\n \n apply_filters();\n sort_lists();\n update_counts();\n \n}", "title": "" }, { "docid": "3c28382d64b06b2adaf4ea1a262a1f13", "score": "0.58102965", "text": "display() {\n let data;\n for (let node of this.nodes) {\n if (node.getparentID() == 0) {\n data = this.displayTree(node.getparentID());\n break;\n }\n }\n return data;\n }", "title": "" }, { "docid": "a8d52f9930207168e379022728e713e0", "score": "0.58043885", "text": "function ticked(){\n updateLinks();\n updateNodes();\n updateLabels();\n }", "title": "" }, { "docid": "63fef562fa9125455139a95974f64e0d", "score": "0.5785368", "text": "function getStateVariables(){\n var nodesBox = document.getElementById('nodes');\n\n var nodesSelected = getSelectedOptions(nodesBox);\n\n if(nodesSelected == 0)\n {\n var stateVariablesBox = document.getElementById('state-variables');\n\n // TODO: Better way to reset box?\n stateVariablesBox.innerHTML = '';\n }\n else\n {\n socket.emit('getStateVariables', nodesSelected);\n }\n}", "title": "" }, { "docid": "4500b1f3b0dabf860006017558c4e496", "score": "0.57850134", "text": "activeNodes() {\n return _.filter(this.graph.nodes, this.nodeActiveFn);\n }", "title": "" }, { "docid": "735284bd83dd25a2cf3880e5d602b7db", "score": "0.5784332", "text": "handleNodeSelectionState(node) {\n const nodesArray = (node && node._children) ? node._children.toArray() : [];\n if (nodesArray.length) {\n if (nodesArray.every(n => this.nodesToBeSelected.has(n))) {\n this.nodesToBeSelected.add(node);\n this.nodesToBeIndeterminate.delete(node);\n }\n else if (nodesArray.some(n => this.nodesToBeSelected.has(n) || this.nodesToBeIndeterminate.has(n))) {\n this.nodesToBeIndeterminate.add(node);\n this.nodesToBeSelected.delete(node);\n }\n else {\n this.nodesToBeIndeterminate.delete(node);\n this.nodesToBeSelected.delete(node);\n }\n }\n else {\n // if the children of the node has been deleted and the node was selected do not change its state\n if (this.isNodeSelected(node)) {\n this.nodesToBeSelected.add(node);\n }\n else {\n this.nodesToBeSelected.delete(node);\n }\n this.nodesToBeIndeterminate.delete(node);\n }\n }", "title": "" }, { "docid": "99628e50473ac29b6dc351513f823e96", "score": "0.5770617", "text": "function connectedNodes() {\n if (toggle == 0) {\n // reduce the opacity of all but the neighbouring nodes\n var clicked_node = d3.select(this).node().__data__;\n var marked_nodes = [];\n graph.links.forEach(function (current_link) {\n if (current_link.source.id == clicked_node.id && current_link.isCluster && current_link.target != clicked_node) {\n marked_nodes.push(current_link.target);\n } else if (current_link.target.id == clicked_node.id && current_link.isCluster && current_link.source != clicked_node) {\n marked_nodes.push(current_link.source);\n }\n });\n\n node.style(\"opacity\", function (o) {\n return (neighboring(clicked_node, o) || neighboring(o, clicked_node)) && !marked_nodes.includes(o) ? 1 : 0.1;\n });\n\n var marked_links = [];\n var first_hidden_nodes = [];\n // mark every link between the clicked one and real nodes\n // also find the first hidden node(s) linked to the clicked one\n for (var key in linkedByIndex) {\n var index_comma = key.indexOf(\",\");\n var link_source = key.substr(0, index_comma);\n var link_target = key.substr(index_comma + 1, key.length);\n if (link_source != link_target) {\n if (link_source == clicked_node.index) {\n // link between real nodes\n if (isNaN(id_from_index[link_target])) {\n marked_links.push({ source: link_source, target: link_target });\n }\n // link between real and hidden nodes\n if (!isNaN(id_from_index[link_target])) {\n marked_links.push({ source: link_source, target: link_target });\n first_hidden_nodes.push(link_target);\n }\n } else if (link_target == clicked_node.index) {\n // link between real nodes\n if (isNaN(id_from_index[link_source])) {\n marked_links.push({ source: link_source, target: link_target });\n }\n // link between real and hidden nodes\n if (!isNaN(id_from_index[link_source])) {\n marked_links.push({ source: link_source, target: link_target });\n first_hidden_nodes.push(link_source);\n }\n }\n }\n }\n // mark every link between the first hidden node(s) and the second hidden node(s)\n var second_hidden_nodes = [];\n for (key in linkedByIndex) {\n link_source = key.substr(0, key.indexOf(\",\"));\n link_target = key.substr(key.indexOf(\",\") + 1, key.length);\n if (link_source != link_target) {\n if (first_hidden_nodes.includes(link_source) && !isNaN(id_from_index[link_target])) {\n marked_links.push({ source: link_source, target: link_target });\n second_hidden_nodes.push(link_target)\n }\n if (first_hidden_nodes.includes(link_target) && !isNaN(id_from_index[link_source])) {\n marked_links.push({ source: link_source, target: link_target });\n second_hidden_nodes.push(link_source)\n }\n }\n }\n // mark every link between the second hidden node(s) and the non-hidden node(s)\n for (key in linkedByIndex) {\n link_source = key.substr(0, key.indexOf(\",\"));\n link_target = key.substr(key.indexOf(\",\") + 1, key.length);\n if (link_source != link_target) {\n if (second_hidden_nodes.includes(link_source) && isNaN(id_from_index[link_target])) {\n marked_links.push({ source: link_source, target: link_target });\n }\n if (second_hidden_nodes.includes(link_target) && isNaN(id_from_index[link_source])) {\n marked_links.push({ source: link_source, target: link_target });\n }\n }\n }\n // set the opacity 1 to the marked nodes, 0.1 to the others\n link.style(\"opacity\", function (current_link) {\n for (var i = 0; i < marked_links.length; i++) {\n var marked_link = marked_links[i];\n if (current_link.source.index == marked_link.source && current_link.target.index == marked_link.target) {\n return 1;\n }\n }\n return 0.1;\n });\n // the highlight is on\n toggle = 1;\n } else {\n // put them back to opacity = 1\n node.style(\"opacity\", 1);\n link.style(\"opacity\", 1);\n // the highlight is back to off\n toggle = 0;\n }\n }", "title": "" }, { "docid": "cf3b6645448d31338d7028f1dd684879", "score": "0.57654315", "text": "function showGameState() {\n d3.selectAll(\"text\").each(function(d, i) {\n d3.select(this).style(\"display\", \"none\");\n });\n\n let grids = activeBoard.grids;\n let pieces = activeBoard.pieces;\n //drawText(grids);\n //drawText(pieces);\n}", "title": "" }, { "docid": "8da0e7ded56c530dbb59ef3949bd4af2", "score": "0.575436", "text": "function updateUI() {\n var _this = this;\n\n if (!('vis' in state)) state['vis'] = ['network'];\n\n if ((window.innerWidth > 0 ? window.innerWidth : screen.width) < 768) {\n // Only static image\n if (siteType && siteType == 'detail') {\n d3.select('#svg-container').style('background-image', \"url(\".concat(jspath, \"/assets/images/mobile_snap_detail_\").concat(state.vis[0], \"@2x.jpg)\"));\n } else {\n d3.select('#svg-container').style('background-image', \"url(\".concat(jspath, \"/assets/images/mobile_snap_explore_\").concat(state.vis[0], \"@2x.jpg)\"));\n }\n } else {\n d3.select('#svg-container').style('background-image', \"none\"); // change vis if necessary\n\n if (cVis != state.vis[0]) {\n cVis = state.vis[0]; // remove current vis\n\n d3.selectAll('#svg-container *').remove(); // clean classes\n\n d3.selectAll('#svg-container').classed('network', false).classed('map', false).classed('matrix', false).classed('bipartite', false).classed(state.vis[0], true); // add new vis\n\n switch (state.vis[0]) {\n case 'network':\n // NETWORK DONE!\n updateTypeFilter(true);\n updateTaxFilter(true);\n var taxLimit = false;\n\n for (var key in nodes) {\n if (key == siteID) taxLimit = nodes[key].taxonomy;\n }\n\n network = networkOverallThematic(d3.select('#svg-container'), nodes, taxonomy, siteType == 'detail' ? siteID : false, function (selection) {\n state.taxonomy = selection;\n dispatcher.call('action', _this, createURL());\n }, siteType == 'detail' ? taxLimit : false, siteType == 'detail' ? true : false);\n break;\n\n case 'map':\n updateTypeFilter(false);\n updateTaxFilter(true);\n Promise.all([jspath + '/cache/' + jsppath + 'geo_network_nodes.json', jspath + '/cache/' + jsppath + 'taxonomy.json'].map(function (d) {\n return d3.json(d, {\n headers: {\n 'Authorization': 'Basic ' + btoa('iass:amama2017')\n }\n });\n })).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n geoNodes = _ref2[0],\n _taxonomy = _ref2[1];\n\n map = mapCluster(d3.select('#svg-container'), geoNodes, _taxonomy, function (selection) {\n console.log(state.taxonomy, selection);\n\n if (state.taxonomy[0] == selection[0]) {\n state.taxonomy = [];\n } else {\n state.taxonomy = selection;\n }\n\n dispatcher.call('action', _this, createURL());\n });\n updateUI();\n })[\"catch\"](function (e) {\n throw e;\n });\n break;\n\n case 'matrix':\n updateTypeFilter(true);\n updateTaxFilter(false);\n Promise.all([jspath + '/cache/' + jsppath + '' + fullFile, jspath + '/cache/' + jsppath + 'taxonomy.json'].map(function (d) {\n return d3.json(d, {\n headers: {\n 'Authorization': 'Basic ' + btoa('iass:amama2017')\n }\n });\n })).then(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n _nodes = _ref4[0],\n _taxonomy = _ref4[1];\n\n matrix = matrixRect(d3.select('#svg-container'), _nodes, _taxonomy, function (selection) {\n state.taxonomy = selection;\n dispatcher.call('action', _this, createURL());\n });\n updateUI();\n })[\"catch\"](function (e) {\n throw e;\n });\n break;\n\n case 'radial':\n updateTypeFilter(false);\n updateTaxFilter(false);\n Promise.all([jspath + '/cache/' + fullFile, jspath + '/cache/taxonomy.json'].map(function (d) {\n return d3.json(d, {\n headers: {\n 'Authorization': 'Basic ' + btoa('iass:amama2017')\n }\n });\n })).then(function (_ref5) {\n var _ref6 = _slicedToArray(_ref5, 2),\n _nodes = _ref6[0],\n _taxonomy = _ref6[1];\n\n rings(d3.select('#svg-container'), _nodes, _taxonomy, siteID);\n })[\"catch\"](function (e) {\n throw e;\n });\n break;\n\n case 'flow':\n updateTypeFilter(false);\n updateTaxFilter(false);\n Promise.all([jspath + '/cache/' + jsppath + '' + fullFile, jspath + '/cache/' + jsppath + 'taxonomy.json'].map(function (d) {\n return d3.json(d, {\n headers: {\n 'Authorization': 'Basic ' + btoa('iass:amama2017')\n }\n });\n })).then(function (_ref7) {\n var _ref8 = _slicedToArray(_ref7, 2),\n _nodes = _ref8[0],\n _taxonomy = _ref8[1];\n\n flow(d3.select('#svg-container'), _nodes, _taxonomy);\n })[\"catch\"](function (e) {\n throw e;\n });\n break;\n\n case 'bipartite':\n // BIPARTITE DONE!\n updateTypeFilter(true);\n updateTaxFilter(false);\n\n if (state.type.length == 0) {\n biPartiteType = false;\n _hibipart = false;\n Promise.all([jspath + '/cache/' + jsppath + 'cat_nodes_clean_min.csv', jspath + '/cache/' + jsppath + 'cat_edges_all_grouped_min.csv'].map(function (d) {\n return d3.csv(d, {\n headers: {\n 'Authorization': 'Basic ' + btoa('iass:amama2017')\n }\n });\n })).then(function (_ref9) {\n var _ref10 = _slicedToArray(_ref9, 2),\n nodes = _ref10[0],\n edges = _ref10[1];\n\n setupBiPartite(nodes, edges);\n })[\"catch\"](function (e) {\n throw e;\n });\n } else {\n biPartiteType = state.type[0];\n _hibipart = false;\n Promise.all([jspath + '/cache/' + jsppath + 'cat_nodes_clean_min-' + state.type[0] + '.csv', jspath + '/cache/' + jsppath + 'cat_edges_all_grouped_min-' + state.type[0] + '.csv'].map(function (d) {\n return d3.csv(d, {\n headers: {\n 'Authorization': 'Basic ' + btoa('iass:amama2017')\n }\n });\n })).then(function (_ref11) {\n var _ref12 = _slicedToArray(_ref11, 2),\n nodes = _ref12[0],\n edges = _ref12[1];\n\n setupBiPartite(nodes, edges);\n })[\"catch\"](function (e) {\n throw e;\n });\n }\n\n break;\n }\n }\n }\n\n d3.selectAll('#vis-nav a').classed('active', false);\n d3.select(\"#vis-nav .\".concat(state.vis[0], \" a\")).classed('active', true);\n var cSel = listFunc.selection;\n d3.selectAll(\"#type-nav a\").classed('active', false);\n\n if ((window.innerWidth > 0 ? window.innerWidth : screen.width) < 768) {\n cSel.type = state.type.length == 0 ? [] : [state.type[0]];\n } else {\n if (state.type.length == 0) {\n if (state.vis[0] == 'network') {\n if (network.filterType.length > 0) {\n network.resetSelection();\n network.resetFilter(true);\n }\n } else if (state.vis[0] == 'matrix' && matrix) {\n matrix.filter = 'all';\n }\n\n if (state.vis[0] == 'bipartite') {\n if (biPartiteType != false) {\n biPartiteType = false;\n _hibipart = false;\n d3.selectAll('#svg-container *').remove();\n Promise.all([jspath + '/cache/' + jsppath + 'cat_nodes_clean_min.csv', jspath + '/cache/' + jsppath + 'cat_edges_all_grouped_min.csv'].map(function (d) {\n return d3.csv(d, {\n headers: {\n 'Authorization': 'Basic ' + btoa('iass:amama2017')\n }\n });\n })).then(function (_ref13) {\n var _ref14 = _slicedToArray(_ref13, 2),\n nodes = _ref14[0],\n edges = _ref14[1];\n\n setupBiPartite(nodes, edges);\n })[\"catch\"](function (e) {\n throw e;\n });\n }\n }\n\n cSel.type = [];\n } else {\n if (state.vis[0] == 'network') {\n if (network.filterType[0] != state.type[0]) {\n network.resetSelection();\n network.resetFilter(false);\n network.applyFilter('type', state.type[0], true);\n }\n } else if (state.vis[0] == 'matrix' && matrix) {\n matrix.filter = state.type[0];\n }\n\n if (state.vis[0] == 'bipartite') {\n if (biPartiteType != state.type[0]) {\n biPartiteType = state.type[0];\n _hibipart = false;\n d3.selectAll('#svg-container *').remove();\n Promise.all([jspath + '/cache/' + jsppath + 'cat_nodes_clean_min-' + state.type[0] + '.csv', jspath + '/cache/' + jsppath + 'cat_edges_all_grouped_min-' + state.type[0] + '.csv'].map(function (d) {\n return d3.csv(d, {\n headers: {\n 'Authorization': 'Basic ' + btoa('iass:amama2017')\n }\n });\n })).then(function (_ref15) {\n var _ref16 = _slicedToArray(_ref15, 2),\n nodes = _ref16[0],\n edges = _ref16[1];\n\n setupBiPartite(nodes, edges);\n })[\"catch\"](function (e) {\n throw e;\n });\n }\n }\n\n cSel.type = [state.type[0]];\n }\n }\n\n if ((window.innerWidth > 0 ? window.innerWidth : screen.width) < 768) {\n cSel.taxonomy = state.taxonomy.length == 0 ? [] : state.taxonomy;\n } else {\n if (state.taxonomy.length == 0) {\n if (state.vis[0] == 'network') {\n network.resetSelection();\n network.updateSelection();\n } else if (state.vis[0] == 'matrix' && matrix) {\n matrix.selection = [];\n matrix.updateSelection();\n } else if (state.vis[0] == 'map' && map) {\n map.selection = [];\n map.updateSelection();\n }\n\n if (state.vis[0] == 'bipartite' && _hibipart) {\n if (_hibipart.getArcFilters().length >= 0) {\n _hibipart.reset();\n\n _hibipartVis.linkModules();\n\n _hibipartVis.update();\n }\n }\n\n cSel.taxonomy = [];\n } else {\n if (state.vis[0] == 'network') {\n network.selection = state.taxonomy;\n network.updateSelection();\n } else if (state.vis[0] == 'matrix' && matrix) {\n matrix.selection = state.taxonomy;\n matrix.updateSelection();\n } else if (state.vis[0] == 'map' && map) {\n map.selection = state.taxonomy;\n map.updateSelection();\n }\n\n if (state.vis[0] == 'bipartite' && _hibipart) {\n _hibipart.reset();\n\n state.taxonomy.forEach(function (tax) {\n _hibipart.filter(+tax);\n });\n\n _hibipartVis.linkModules();\n\n _hibipartVis.update();\n }\n\n cSel.taxonomy = state.taxonomy;\n }\n }\n\n if (state.type.length > 0) d3.select(\"#type-nav .\".concat(state.type[0], \" a\")).classed('active', true);\n listFunc.selection = cSel;\n listFunc.visType = state.vis[0];\n}", "title": "" }, { "docid": "853532805a9632fb1841838adb17ee77", "score": "0.57518435", "text": "updateViewObjects(state){\n //Node\n if (!this.viewObjects[\"main\"]\n || (!this.labelObjects[state.iconLabel] && this[state.nodeLabel])\n ){ this.createViewObjects(state); }\n\n //TODO move code to reposition dependent nodes here?\n\n copyCoords(this.viewObjects[\"main\"].position, this);\n\n //Labels\n if (this.labelObjects[state.nodeLabel]){\n this.viewObjects['label'] = this.labelObjects[state.nodeLabel];\n this.viewObjects[\"label\"].visible = state.showNodeLabel;\n copyCoords(this.viewObjects[\"label\"].position, this.viewObjects[\"main\"].position);\n this.viewObjects[\"label\"].position.addScalar(15);\n } else {\n delete this.viewObjects['label'];\n }\n }", "title": "" }, { "docid": "cce28614860b3470be02148e23c353d4", "score": "0.57435817", "text": "function displaySelection(pathArray) {\n\n var links = d3.selectAll(\".link\");\n var nodes = d3.selectAll(\".node\");\n\n hideLinks(links);\n nodes.style(\"opacity\", 0.2);\n\n if (!pathArray.length) {\n nodes.filter(function(d, i) {\n return (d.ueid === currentSelection[0].ueid || d.ueid === currentSelection[1].ueid);\n }).style(\"opacity\", \"1\");\n }\n\n pathArray.forEach(function(path) {\n for (var k = 0; k < path.length; k++) {\n if (k != path.length - 1) {\n displayLinks(links.filter(function(d, i) {\n return (d.source === path[k] && d.target === path[k + 1] && currentFilters.includes(d.linktype));\n }).style(\"opacity\", \"1\"));\n }\n\n nodes.filter(function(d, i) {\n return (d.ueid === path[k].ueid && checkNodeDisplay(d, currentFilters));\n }).style(\"opacity\", \"1\");\n }\n })\n}", "title": "" }, { "docid": "bf52b59b642c4a3cfd1569eb150f04f0", "score": "0.5700764", "text": "_onOnlineStateChange() {\n let btns = this.app.getContainer().getElementsByTagName(\"button\");\n let onlineState = (navigator.onLine !== false);\n let display = (onlineState ? \"block\" : \"none\");\n for(let element of btns) {\n if(element.classList.contains(\"item-map\") || element.id === \"all-items-map\") {\n element.style.display = display;\n }\n }\n }", "title": "" }, { "docid": "55311f65be30aea220e606eac767fcf0", "score": "0.56875026", "text": "function getNodes(state) {\r\n return Object.values(state.history.present.nodes) || [];\r\n}", "title": "" }, { "docid": "4d91f4ae4495fea804b3191465039703", "score": "0.5674822", "text": "function showReservations(){\n $(\"#nodegrid\").html(\"\");\n $(\"#res_table\").html(\"\");\n\n // POPULATE NODE GRID\n\n var newcol = '<div class=\"col\" style=\"padding: 0\">' +\n ' <div class=\"list-group\" ';\n for (var i = 0; i < rackWidth; i++) {\n $('#nodegrid').append(newcol + 'id=\"col' + i + '\"></div></div>');\n }\n var grid = '<div draggable=\"true\" tabIndex=\"-1\" style=\"opacity: 1; width:100%; padding: 12px; padding-left: 0px; padding-right: 0px; cursor: pointer;\" ';\n for (var i = startNode; i <= endNode; i++) {\n col = (i - 1) % rackWidth;\n var classes = ' class=\"list-group-item list-group-item-action node up available unselected\" ';\n $(\"#col\" + col).append(grid + classes + ' id=\"' + i +'\">' + i + '</div>');\n }\n\n // mark all nodes that are down\n for (var i = 0; i < reservations[0].Nodes.length; i++) {\n getObjFromNodeIndex(reservations[0].Nodes[i]).removeClass(\"up\");\n getObjFromNodeIndex(reservations[0].Nodes[i]).addClass(\"down\");\n }\n\n // mark all nodes that are reserved\n for (var j = 1; j < reservations.length; j++) {\n for (var i = 0; i < reservations[j].Nodes.length; i++) {\n getObjFromNodeIndex(reservations[j].Nodes[i]).removeClass(\"available\");\n getObjFromNodeIndex(reservations[j].Nodes[i]).addClass(\"reserved\");\n }\n }\n\n // select/deselect node on click\n $(\".node\").click(function(event) {\n deselectTable();\n toggle($(this));\n });\n\n // node hover to cause:\n // reservations that have this reservation to hover\n // color of node to hover in the key\n $(\".node\").hover(function() {\n var node = getNodeIndexFromObj($(this));\n for (var i = 0; i < reservations.length; i++) {\n if (reservations[i].Nodes.includes(node)) {\n getObjFromResIndex(i).addClass(\"hover\");\n };\n }\n if ($(this).hasClass(\"available\")) {\n $(\".key.available.headtext\").addClass(\"hover\");\n }\n if ($(this).hasClass(\"reserved\")) {\n $(\".key.reserved.headtext\").addClass(\"hover\");\n }\n if ($(this).hasClass(\"up\")) {\n $(\".key.up.headtext\").addClass(\"hover\");\n }\n if ($(this).hasClass(\"down\")) {\n $(\".key.down.headtext\").addClass(\"hover\");\n }\n if ($(this).hasClass(\"available\")) {\n if ($(this).hasClass(\"up\")) {\n $(\".key.available.up\").addClass(\"hover\");\n } else {\n $(\".key.available.down\").addClass(\"hover\");\n }\n } else if ($(this).hasClass(\"reserved\")) {\n if ($(this).hasClass(\"up\")) {\n $(\".key.reserved.up\").addClass(\"hover\");\n } else {\n $(\".key.reserved.down\").addClass(\"hover\");\n }\n }\n });\n\n // remove res and key hover on exit\n $(\".node\").mouseleave(function() {\n $(\".res, .key\").removeClass(\"hover\");\n });\n\n\n\n // NODE DRAGGING\n // (see global variables)\n\n // record drag information when it begins\n for (var i = 0; i < nodes.length; i++) {\n nodes[i].addEventListener(\"dragstart\", function(event) {\n deselectTable();\n firstDragNode = $(event.target);\n maxDragNode = getNodeIndexFromObj(firstDragNode);\n minDragNode = maxDragNode;\n extremeMax = maxDragNode;\n extremeMin = maxDragNode;\n lastDrag = maxDragNode;\n if ($(event.target).hasClass(\"active\")) {\n selectOn = false;\n } else {\n selectOn = true;\n }\n toggle($(event.target));\n // roundabout way to prevent \"ghost\" element during drag\n var crt = this.cloneNode(true);\n crt.style.display = \"none\";\n document.body.appendChild(crt);\n event.dataTransfer.setDragImage(crt, 0, 0);\n event.dataTransfer.setData('text/plain', '');\n }, false);\n }\n\n // toggle nodes when drag passes over\n $(\".node\").on(\"dragover\", function(event) {\n if (firstDragNode === -1) return;\n var fromIndex = getNodeIndexFromObj(firstDragNode);\n var toIndex = getNodeIndexFromObj($(event.target));\n // behavior is different based on whether node dragged\n // was already selected\n // if node dragged was unselected:\n // selection from drag can be reversed by going back the other way\n // selection under drag that is reversed is lost, no memory\n if (selectOn) {\n // decrease drag selection if drag returns towards first node\n if (toIndex > minDragNode && toIndex < maxDragNode) {\n if (toIndex < fromIndex) {\n selectNodes(minDragNode, toIndex, !selectOn);\n minDragNode = toIndex;\n }\n if (toIndex > fromIndex) {\n selectNodes(maxDragNode, toIndex, !selectOn);\n maxDragNode = toIndex;\n }\n } else {\n selectNodes(fromIndex, toIndex, selectOn);\n }\n // detect when drag passes over first node in the other direction\n // to deselect all nodes in original direction\n if (toIndex < fromIndex && lastDrag >= fromIndex) {\n maxDragNode = fromIndex;\n if (extremeMax !== fromIndex) {\n selectNodes(extremeMax, fromIndex + 1, !selectOn);\n }\n }\n if (toIndex > fromIndex && lastDrag <= fromIndex) {\n minDragNode = fromIndex;\n if (extremeMin !== fromIndex) {\n selectNodes(extremeMin, fromIndex - 1, !selectOn);\n }\n }\n // update dragging globals\n maxDragNode = Math.max(toIndex, maxDragNode);\n minDragNode = Math.min(toIndex, minDragNode);\n extremeMax = Math.max(extremeMax, maxDragNode);\n extremeMin = Math.min(extremeMin, minDragNode);\n if (toIndex != firstDragNode) {\n lastDrag = toIndex;\n }\n event.preventDefault();\n // if node dragged was selected:\n // deselect all nodes that drag passes over, and\n // drag cannot be undone\n } else {\n selectNodes(fromIndex, toIndex, false);\n }\n });\n\n // on the end of the drag\n $(\".node\").on(\"dragend\", function(event) {\n firstDragNode = -1;\n })\n\n\n\n // POPULATE RESERVATION TABLE\n\n var tr1 = '<tr class=\"res clickable mdl ';\n var tr2 = '</tr>';\n var td1 = '<td class=\"mdl\">';\n var tdcurrent = '<td class=\"mdl current\">';\n var td2 = '</td>';\n for (var i = 1; i < reservations.length; i++) {\n var current = new Date();\n var datetd;\n if (reservations[i].StartInt <= 0) {\n datetd = tdcurrent;\n } else {\n datetd = td1;\n }\n $(\"#res_table\").append(\n tr1 + classes + 'id=\"res' + i + '\">' +\n td1 + reservations[i].Name + td2 +\n td1 + reservations[i].Owner + td2 +\n datetd + dateToString(reservations[i].StartInt) + td2 +\n td1 + dateToString(reservations[i].StartInt + reservations[i].EndInt) + td2 +\n td1 + reservations[i].Nodes.length + td2 +\n tr2\n );\n }\n\n // reservation selection on click\n $(\".res\").click(function() {\n deselectGrid();\n toggle($(this));\n });\n\n // when hovering over a reservation:\n // hover the nodes belonging to the reservation, and\n // hover the type of nodes in the key\n $(\".res\").hover(function() {\n // remove shadows from all nodes temporarily to create contrast\n $(\".node\").addClass(\"light\");\n $(\"#nodegridcard\").addClass(\"light\");\n var resNodes = reservations[getResIndexFromObj($(this))].Nodes;\n var up = false;\n var down = false;\n for (var i = 0; i < resNodes.length; i++) {\n // key hover\n if (reservations[0].Nodes.includes(resNodes[i])) {\n down = true;\n } else {\n up = true;\n }\n $(\".key.reserved.headtext\").addClass(\"hover\");\n if (down) {\n $(\".key.down.headtext\").addClass(\"hover\");\n $(\".key.reserved.down\").addClass(\"hover\");\n }\n if (up) {\n $(\".key.up.headtext\").addClass(\"hover\");\n $(\".key.reserved.up\").addClass(\"hover\");\n }\n // node hover\n getObjFromNodeIndex(resNodes[i]).removeClass(\"light\");\n }\n });\n\n // remove hover of nodes and key when res hover ends\n $(\".res\").mouseleave(function() {\n $(\"#nodegridcard\").removeClass(\"light\");\n $(\".key\").removeClass(\"hover\");\n $(\".node\").removeClass(\"light\");\n });\n}", "title": "" }, { "docid": "c51d2b51392e0b86180a337873b2a2d5", "score": "0.5663924", "text": "function updateState(){\n\t$.get(\"../aiolos\",{'action':'status'},renderGraph,'json');\n}", "title": "" }, { "docid": "a1879bb1c7ba0b1c52073a82ea521bcf", "score": "0.5658604", "text": "function labelUpdate() {\n var current_state = node.select(\"text\").attr(\"display\");\n node.select(\"text\")\n .transition()\n .attr(\"display\",\n function () {\n if (current_state == 'block') {\n return \"none\"\n } else {\n return \"block\"\n }\n })\n }", "title": "" }, { "docid": "28ec8387db5c47d3d9ed8b76edfd4512", "score": "0.56494933", "text": "function updateNodes() {\n var node = nodesG.selectAll('circle.node')\n .data(curNodesData, function(d) {\n return d.id;\n });\n node.enter().append('circle')\n .attr('class', 'node')\n .attr('cx', function(d) {return d.x})\n .attr('cy', function(d) {return d.y})\n .attr('r', function(d) {return d.radius})\n .style('fill', function(d) {return nodeColors(d.artist)})\n .style('stroke', function(d) {return strokeFor(d)})\n .style('stroke-width', 1.0);\n node.on('mouseover', showDetails)\n .on('mouseout', hideDetails);\n node.exit().remove();\n }", "title": "" }, { "docid": "1a11a882f2b71965f1496f0614f29028", "score": "0.5639313", "text": "function highlightGraphNode( node, on ) {\n //if( d3.event.shiftKey ) on = false; // for debugging\n\n // If we are to activate a movie, and there's already one active,\n // first switch that one off\n if( on && activeMovie !== undefined ) {\n console.log(\"..clear: \",activeMovie);\n highlightGraphNode( nodeArray[activeMovie], false );\n console.log(\"..cleared: \",activeMovie); \n }\n\n console.log(\"SHOWNODE \"+node.index+\" [\"+node.label + \"]: \" + on);\n console.log(\" ..object [\"+node + \"]: \" + on);\n // locate the SVG nodes: circle & label group\n circle = d3.select( '#c' + node.index );\n label = d3.select( '#l' + node.index );\n console.log(\" ..DOM: \",label);\n\n // activate/deactivate the node itself\n console.log(\" ..box CLASS BEFORE:\", label.attr(\"class\"));\n console.log(\" ..circle\",circle.attr('id'),\"BEFORE:\",circle.attr(\"class\"));\n circle.classed( 'main', on );\n label.classed( 'on', on || currentZoom >= SHOW_THRESHOLD );\n label.selectAll('text')\n .classed( 'main', on );\n console.log(\" ..circle\",circle.attr('id'),\"AFTER:\",circle.attr(\"class\"));\n console.log(\" ..box AFTER:\",label.attr(\"class\"));\n console.log(\" ..label=\",label);\n\n // activate all siblings\n console.log(\" ..SIBLINGS [\"+on+\"]: \"+node.links);\n Object(node.links).forEach( function(id) {\n d3.select(\"#c\"+id).classed( 'sibling', on );\n label = d3.select('#l'+id);\n label.classed( 'on', on || currentZoom >= SHOW_THRESHOLD );\n label.selectAll('text.nlabel')\n .classed( 'sibling', on );\n });\n\n // set the value for the current active movie\n activeMovie = on ? node.index : undefined;\n console.log(\"SHOWNODE finished: \"+node.index+\" = \"+on );\n }", "title": "" }, { "docid": "4aee594a44e9fa33d0144c704528a740", "score": "0.5636777", "text": "async function printNodesList(identity) {\n var group = undefined;\n try {\n group = await drandjs.fetchGroup(identity);\n } catch (e) {\n console.error(\"printNodesList coult not fetch group from \",identity,\":\",e);\n return;\n }\n nodesListDiv.innerHTML=\"\";\n for(var i = 0; i < group.nodes.length; i++) {\n let addr = group.nodes[i].address;\n let host = addr.split(\":\")[0];\n let port = addr.split(\":\")[1];\n // when not present, assume not TLS\n // gRPC or golang/json doesn't put TLS field when false...\n let tls = group.nodes[i].TLS || false;\n\n let line = document.createElement(\"tr\");\n let statusCol = document.createElement(\"td\");\n // run them in parallel\n isUp(addr, tls).then((rand) => {\n statusCol.innerHTML = '<td> &nbsp;&nbsp;&nbsp; ✔️ </td>';\n statusCol.style.color= \"transparent\";\n statusCol.style.textShadow= \"0 0 0 green\";\n console.log(addr,\" is up\");\n }).catch(() => {\n statusCol.innerHTML = '<td> &nbsp;&nbsp;&nbsp; 🚫 </td>';\n });\n \n line.appendChild(statusCol);\n\n let addrCol = document.createElement(\"td\");\n addrCol.innerHTML = '<td>' + host + '</td>';\n addrCol.onmouseover = function() { addrCol.style.textDecoration = \"underline\"; };\n addrCol.onmouseout = function() {addrCol.style.textDecoration = \"none\";};\n addrCol.onclick = function() {\n window.identity = {Address: addr, TLS: tls};\n refresh();\n };\n line.appendChild(addrCol);\n\n let portCol = document.createElement(\"td\");\n portCol.innerHTML = '<td>' +port+'</td>';\n line.appendChild(portCol);\n\n let tlsCol = document.createElement(\"td\");\n tlsCol.innerHTML = '<td> non tls </td>';\n if (tls) {\n tlsCol.innerHTML = '<td> tls </td>';\n }\n line.appendChild(tlsCol);\n\n var loc = locationMap.get(host);\n if (loc == undefined) { //did not fill map loc yet\n function handleResponse(json) {\n locationMap.set(host, json.country_code2);\n refresh();\n }\n getLoc(host, handleResponse);\n }\n loc = locationMap.get(host);\n if (loc == undefined) {\n loc = \" \";\n }\n let countryCol = document.createElement(\"td\");\n countryCol.innerHTML = '<td>' + loc + '</td>';\n line.appendChild(countryCol);\n\n let linkCol = document.createElement(\"td\");\n linkCol.innerHTML = '<td><a title=\"https://' + addr + '/api/public\" href=\"https://' + addr + '/api/public\"><i class=\"fas fa-external-link-alt\"></i></a></td>';\n linkCol.style.textAlign=\"center\";\n line.appendChild(linkCol);\n\n if (addr == window.identity.Address) {\n line.style.fontWeight=\"bold\";\n }\n nodesListDiv.appendChild(line);\n }\n}", "title": "" }, { "docid": "936b7e37e33e7ba2b4623c807e6faace", "score": "0.56356794", "text": "function RefreshTime() {\n\n nx.each(topologyUpdateData.nodes, function(nodeData) {\n var node = topo.getLayer(\"nodes\")._MynodeDictionary.getItem(nodeData.id);\n //var node = topo.getNode(nodeData.id);\n if (typeof node !== \"undefined\") {\n node._data.status=nodeData.status;\n if ( typeof topo.getNode(nodeData.id) !== \"undefined\" ) {\n // update the nodeSet if its in the current scene\n topo.getNode(nodeData.id).status(nodeData.status);\n node._data.status=nodeData.status;\n }\n } else {\n console.log(\"undefined node\",nodeData.id)\n }\n });\n \n nx.each(topologyUpdateData.nodeSet, function(nodeData) {\n var node = topo.getLayer(\"nodes\")._MynodeDictionary.getItem(nodeData.id);\n if (typeof node !== \"undefined\") {\n node._data.status=nodeData.status;\n if ( typeof topo.getNode(nodeData.id) !== \"undefined\" ) {\n // update the nodeSet if its in the current scene\n topo.getNode(nodeData.id).status(nodeData.status);\n node._data.status=nodeData.status;\n }\n } else {\n console.log(\"undefined node\",nodeData.id)\n }\n });\n \n nx.each(topologyUpdateData.links, function(linkData) {\n var link = topo.getLayer(\"links\")._MylinkDictionary.getItem(linkData.id);\n if (typeof link !== \"undefined\") {\n link._data.status=linkData.status;\n if ( typeof topo.getLink(linkData.id) !== \"undefined\" ) {\n // update the link if its in the current scene\n topo.getLink(linkData.id).status(linkData.status);\n topo.getLink(linkData.id).update();\n } else {\n console.log(\"link is not in the current scene\");\n }\n } else {\n console.log(\"undefined link:\",linkData.id)\n }\n \n });\n \n var linkSetLayer = topo.getLayer(\"linkSet\");\n linkSetLayer._linkSetDictionary.each(function(item, linkKey) {\n var linkset = topo.getLinkSetByLinkKey(linkKey);\n linkset.update();\n });\n \n}", "title": "" }, { "docid": "0fed2ca1329d64a13b80e6d69074be6e", "score": "0.56279486", "text": "function checkNodeDisplay(node, currentFilters) {\n var flag = false;\n\n for (var i = 0; i < node.dependances.length && flag == false; i++) {\n if (currentFilters.includes(node.dependances[i][0])) {\n flag = true;\n }\n }\n\n return flag;\n}", "title": "" }, { "docid": "b419f6d0f21a6de78ba402f0a5a9c42e", "score": "0.56217957", "text": "updateViewObjects(state){\n //Node\n if (!this.viewObjects[\"main\"] ||\n (!this.skipLabel && !this.labels[state.labels[this.constructor.name]] && this[state.labels[this.constructor.name]])){\n this.createViewObjects(state);\n }\n\n switch(this.type){\n case NODE_TYPES.FIXED: {\n //Replace node coordinates with given ones\n copyCoords(this, this.layout);\n break;\n }\n case NODE_TYPES.CONTROL: {\n //Redefine position of the control node\n let controlNodes = state.graphData.nodes.filter(node => (this.controlNodes || []).includes(node.id));\n if (controlNodes){\n let middle = new THREE.Vector3(0, 0, 0);\n controlNodes.forEach(p => {middle.x += p.x; middle.y += p.y; middle.z += p.z});\n middle = middle.multiplyScalar(1.0 / (controlNodes.length || 1));\n copyCoords(this, middle.clone().multiplyScalar(2)); //double the distance from center\n }\n break;\n }\n }\n copyCoords(this.viewObjects[\"main\"].position, this);\n\n this.updateLabels(state.labels[this.constructor.name], state.showLabels[this.constructor.name],\n this.viewObjects[\"main\"].position.clone().addScalar(5 + this.val * state.nodeRelSize));\n }", "title": "" }, { "docid": "c85ade47483460419be2a907a910afdf", "score": "0.56072843", "text": "function showConnections(node) {\r\n var diagram = node.diagram;\r\n diagram.startTransaction(\"highlight\");\r\n // remove any previous highlighting\r\n diagram.clearHighlighteds();\r\n // for each Link coming out of the Node, set Link.isHighlighted\r\n node.findLinksOutOf().each(function(l) { l.isHighlighted = true; });\r\n // for each Node destination for the Node, set Node.isHighlighted\r\n node.findNodesOutOf().each(function(n) { n.isHighlighted = true; });\r\n\r\n // TODO: \r\n\r\n console.log(node.data);\r\n if ( node.data.relationship !== undefined ) {\r\n for ( var i in node.data.relationship ) {\r\n var item = node.data.relationship[i];\r\n var node1 = diagram.findNodeForKey(item);\r\n node1.isHighlighted = true;\r\n }\r\n }\r\n \r\n\r\n diagram.commitTransaction(\"highlight\");\r\n }", "title": "" }, { "docid": "86653a4ad973328a5f80ddd68f21ba73", "score": "0.5601533", "text": "function handleChangeStatus() {\n // console.log(statusChildren);\n Array.from(statusChildren).forEach(e => e.classList.toggle('active-tile'))\n // statusChildren.forEach(e => e.classList.toggle('active-tile'));\n}", "title": "" }, { "docid": "09d3b3e0a7f78e33e8d08e4d6e51f95d", "score": "0.5590479", "text": "nodesInList () {\n return this.accessibleFrom (this.dummy);\n }", "title": "" }, { "docid": "315830e5c8ec6cdc637d538718e4de0d", "score": "0.5582227", "text": "ensureVisibility() {\n this.nodeVisible = true;\n }", "title": "" }, { "docid": "16d6e0fc5fd3b43ef4a37cabda648647", "score": "0.5575858", "text": "createViewObjects(state) {\n //Nodes\n if (!this.viewObjects[\"main\"]) {\n let geometry = new THREE.SphereGeometry(Math.cbrt(this.val || 1) * state.nodeRelSize,\n state.nodeResolution, state.nodeResolution);\n if (!this.material){\n this.material = state.materialRepo.createMeshLambertMaterial({color: this.color});\n }\n let obj = new THREE.Mesh(geometry, this.material);\n // Attach node data\n obj.__data = this;\n this.viewObjects[\"main\"] = obj;\n }\n\n //Labels\n this.labelObjects = this.labelObjects || {};\n\n if (!this.labelObjects[state.nodeLabel] && this[state.nodeLabel]) {\n this.labelObjects[state.nodeLabel] = new SpriteText2D(this[state.nodeLabel], state.fontParams);\n }\n\n if (this.labelObjects[state.nodeLabel]){\n this.viewObjects[\"label\"] = this.labelObjects[state.nodeLabel];\n } else {\n delete this.viewObjects[\"label\"];\n }\n }", "title": "" }, { "docid": "f416c62872b78b1a8d1d62616f00c604", "score": "0.55737156", "text": "function ticked(){\n\t\t\t\t// a. Update / render links \n\t\t\t\tif (settings.linkType === 'taperedLinks'){\t\t\t\t// FOR TAPERED CURVED PATH LINKS\n\t\t\t\t\tlinks.attr(\"d\", d => taperedLinks(d))\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tlinkBackgrounds.attr(\"d\", d => taperedLinks(d))\t\t\n\t\t\t\t} else \t{\t\t\t\t\t\t\t\t\t\t\t\t// FOR STRAIGHT OR CURVED LINKS USING LINE PATH GENERATOR\n\t\t\t\t links.classed(\"stroke\", 'true')\n\t\t\t\t\t\t.attr(\"marker-mid\", \"url(#arrow)\")\n\t\t\t\t\t\t.attr(\"d\", d => settings.linkType === 'straightLinks' ? straightLinks(d) : curvedLinks(d) )\t\t\t\n\t\t\t\t linkBackgrounds.classed(\"stroke\", 'true')\n\t\t\t\t\t\t.attr(\"marker-mid\", \"url(#arrow)\")\n\t\t\t\t\t\t.attr(\"d\", d => settings.linkType === 'straightLinks' ? straightLinks(d) : curvedLinks(d) )\t\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\n if(settings.nodePosition !== 'fixed'){\n // b. Update / render labels and node positions (including backgrounds)\n labels\n .attr(\"transform\", (d,i) => (settings.labelSize === 'fixed') ? 'translate('+d.x+' , '+d.y+') scale(1)' : 'translate('+d.x+' , '+d.y+') scale('+ visData.nodeRadiusArray[i] / visData.textRadiusArray[i] * settings.labelScale +')' ) // Labels moved as offset to enable text wrapping function\n nodeImages\n .attr(\"transform\", (d,i) => 'translate('+d.x+' , '+d.y+') scale(1)' )\n nodeBackgrounds\n .attr(\"cx\", d => d.x)\n .attr(\"cy\", d => d.y) \n nodes\n .attr(\"cx\", d => d.x)\n .attr(\"cy\", d => d.y)\n\n // c. Update control buttons with node position with 'up' on top and 'down' on bottom. '+/-' labels are adjusted to center of each button\n nodeControlsUp // move buttons with nodes\n .attr(\"cx\", d => d.x)\n .attr(\"cy\", (d, i) => d.y - visData.nodeRadiusArray[i]) \n nodeControlsUpLabels \n .attr(\"transform\", (d, i) => 'translate('+(d.x - 1.5 * settings.controlButtonRadius *0.3)+' , '+ (d.y - visData.nodeRadiusArray[i] + 1.5 * settings.controlButtonRadius * 0.3) +')')\n nodeControlsDown\n .attr(\"cx\", d => d.x)\n .attr(\"cy\", (d, i) => d.y + visData.nodeRadiusArray[i]) \n nodeControlsDownLabels\n .attr(\"transform\", (d, i) => 'translate('+(d.x - 1.5 * settings.controlButtonRadius * 0.275)+' , '+ (d.y + visData.nodeRadiusArray[i] + 1.5 * settings.controlButtonRadius * 0.3) +')')\n\n } else if (settings.nodePosition === 'fixed'){\n labels\n .attr(\"transform\", (d,i) => (settings.labelSize === 'fixed') ? 'translate('+(d.customX * width)+' , '+(d.customY * height)+') scale('+settings.labelScale+')' : 'translate('+d.x+' , '+d.y+') scale('+ visData.nodeRadiusArray[i] / visData.textRadiusArray[i] * settings.labelScale +')' ) // Labels moved as offset to enable text wrapping function\n nodeImages\n .attr(\"transform\", (d,i) => 'translate('+d.x+' , '+d.y+') scale(1)' )\n .attr(\"transform\", (d,i) => 'translate('+(d.customX * width)+' , '+(d.customY * height)+') scale(1)' )\n \n nodeBackgrounds\n .attr(\"cx\", d => d.customX * width)\n .attr(\"cy\", d => d.customY * height) \n nodes\n .attr(\"cx\", d => d.customX * width)\n .attr(\"cy\", d => d.customY * height)\n // c. Update control buttons with node position with 'up' on top and 'down' on bottom. '+/-' labels are adjusted to center of each button\n nodeControlsUp // move buttons with nodes\n .attr(\"cx\", d => (d.customX * width))\n .attr(\"cy\", (d, i) => (d.customY * height) - visData.nodeRadiusArray[i]) \n nodeControlsUpLabels \n .attr(\"transform\", (d, i) => 'translate('+((d.customX * width)- 1.5 * settings.controlButtonRadius *0.3)+' , '+ ((d.customY * height) - visData.nodeRadiusArray[i] + 1.5 * settings.controlButtonRadius * 0.3) +')')\n nodeControlsDown\n .attr(\"cx\", d => (d.customX * width))\n .attr(\"cy\", (d, i) => (d.customY * height) + visData.nodeRadiusArray[i]) \n nodeControlsDownLabels\n .attr(\"transform\", (d, i) => 'translate('+((d.customX * width) - 1.5 * settings.controlButtonRadius * 0.275)+' , '+ ((d.customY * height) + visData.nodeRadiusArray[i] + 1.5 * settings.controlButtonRadius * 0.3) +')')\n }\n\t\t\t} // end ticked()", "title": "" }, { "docid": "0c75624598768e057144f9c2e2f459f4", "score": "0.5565783", "text": "function getNodes(){\n var algorithmRunBox = document.getElementById('algorithm-runs');\n\n var runsSelected = getSelectedOptions(algorithmRunBox);\n\n if(runsSelected == 0)\n {\n var nodesBox = document.getElementById('nodes');\n\n // TODO: Better way to reset box?\n nodesBox.innerHTML = '';\n }\n else\n {\n socket.emit('getNodes', runsSelected);\n }\n}", "title": "" }, { "docid": "1fc9c58663dc924241ed73a8ab546ee2", "score": "0.5563361", "text": "function UpdatePageStateFromDropdowns() {\n\n //update from the display type dropdown. \n var displayType = document.getElementById(\"displayType\");\n var displayTypeValue = displayType.options[displayType.selectedIndex].value;\n PageStateObj.StandardsLabel = displayTypeValue;\n\n //update the depth from its dropdown. \n var depthDrop = document.getElementById(\"networkDepth\");\n var depthDropVal = depthDrop.options[depthDrop.selectedIndex].value;\n PageStateObj.Depth = depthDropVal;\n\n //update the view frop the dropdown. \n var viewDrop = document.getElementById(\"graphView\");\n var viewDropVal = viewDrop.options[viewDrop.selectedIndex].value;\n PageStateObj.View = viewDropVal;\n\n //update the category from the dropdown. \n var categoryDrop = document.getElementById(\"categoryStandardsList\");\n if (categoryDrop.options[categoryDrop.selectedIndex]) {\n var categoryDropVal = categoryDrop.options[categoryDrop.selectedIndex].value;\n PageStateObj.Category = categoryDropVal;\n }\n else {\n PageStateObj.Category = 0;\n }\n\n\n //update the current node lable type\n var dispTypeDrop = document.getElementById(\"displayType\");\n var dispTypeDropVal = dispTypeDrop.options[dispTypeDrop.selectedIndex].value;\n PageStateObj.StandardsLabel = dispTypeDropVal;\n \n\n //update the gradeband from their dropdowns. \n var lowgradeDrop = document.getElementById(\"lowgrade\");\n var lowgradeDropVal = lowgradeDrop.options[lowgradeDrop.selectedIndex].value;\n PageStateObj.Lowgrade = lowgradeDropVal;\n var highgradeDrop = document.getElementById(\"highgrade\");\n var highgradeDropVal = highgradeDrop.options[highgradeDrop.selectedIndex].value;\n PageStateObj.Highgrade = highgradeDropVal;\n\n //update the layout from its dropdown\n var layoutDrop = document.getElementById(\"layoutOptions\");\n var layoutDropVal = layoutDrop.options[layoutDrop.selectedIndex].value;\n PageStateObj.layout = layoutDropVal;\n\n //update the search value from the search bar \n var searchBarVal = document.getElementById(\"searchBar\").value;\n PageStateObj.searchString = searchBarVal;\n}", "title": "" }, { "docid": "b90dc78000e579bdf308f08293507953", "score": "0.5559725", "text": "_onStatusChanged(session) {\n if (this.isDisposed) {\n return;\n }\n let status = session.status;\n this.toggleClass(TOOLBAR_IDLE_CLASS, status === 'idle');\n this.toggleClass(TOOLBAR_BUSY_CLASS, status !== 'idle');\n let title = 'Kernel ' + status[0].toUpperCase() + status.slice(1);\n this.node.title = title;\n }", "title": "" }, { "docid": "9bc1469b71348f8749a574a23e812796", "score": "0.5558865", "text": "function stateDisplayInfo(d) {\r\n\r\n d3.select(\"#statenode-id\").text(d.id);\r\n d3.select(\"#statenode-info\").text(extractDetails(d.details));\r\n d3.select(\"#statenode-stats\").text(extractStats(d.stats));\r\n d3.select(\"#num-players-state\").text(d.user_ids.length);\r\n if (d.user_ids.length <= userIDLengthLimit)\r\n d3.select(\"#players-state\").text(d.user_ids);\r\n else d3.select(\"#players-state\").text(d.user_ids.slice(0, userIDLengthLimit) + \",....\");\r\n}", "title": "" }, { "docid": "67e281dfd346f2904d570762f907b31b", "score": "0.55534285", "text": "function handleNeighbors(currNode, on) {\n var currIndex = currNode.attr(\"index\");\n var neighborIndexes;\n if ( currIndex in linkedByIndex ) {\n neighborIndexes = linkedByIndex[currIndex];\n }\n else {\n return;\n }\n\n for(var j = 0; j < neighborIndexes.length; j++) {\n var neighbor = vis.selectAll(\"g.node\").filter(function(d, i) {\n return i == neighborIndexes[j]\n });\n\n if( on ) {\n neighbor.select(\"text\").attr(\"visibility\", \"visible\");\n neighbor.select(\"text\").attr(\"opacity\", 0.3);\n neighbor.select(\"circle\").style(\"stroke-width\",1);\n } else {\n if (neighbor.attr(\"clicked\") == \"false\") {\n neighbor.select(\"text\").attr(\"visibility\", \"hidden\");\n neighbor.select(\"text\").attr(\"opacity\", 1.0);\n neighbor.select(\"circle\").style(\"stroke-width\",0);\n } else {\n neighbor.select(\"text\").attr(\"visibility\", \"visible\");\n neighbor.select(\"text\").attr(\"opacity\", 1.0);\n neighbor.select(\"circle\").style(\"stroke-width\",2);\n }\n }\n }\n }", "title": "" }, { "docid": "32b9658bacfa33f005c487188e86ed22", "score": "0.5552339", "text": "function treeUpdate() {\r\n\t\tif(historyManager.get(\"currentContext\") != \"root\" && historyManager.get(\"currentContext\") != \"systems\")\r\n\t\t{\r\n\t\t\t//=========== this function is used to show/hide tree_title and tree_update button in case of module_dependency plugin ======================\r\n\t\t\t//this function will be called on DEPENDENCY_LOADED notification\r\n\t\t\tif(historyManager.get(\"currentPlugin\").id == \"module_dependency\")\r\n\t\t\t{\r\n\t\t\t\t$('.tree_title,.tree_update').removeClass('hide');\r\n\t\t\t\tvar height = g.contentHeight() - $(\".tab_wraper\").height() - $('.tree_title').height() - $('.tree_update').height() - 25;\r\n\t\t\t\t$('.tree_content').height(height);\r\n\t\t\t\t$('.jstree-container-ul.jstree-children.jstree-striped').css('height',height);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$('.tree_title,.tree_update').addClass('hide');\r\n\t\t\t\tvar height = g.contentHeight();\r\n\t\t\t\t$('.tree_content').height(height);\r\n\t\t\t\t$('.jstree-container-ul.jstree-children.jstree-striped').css('height', height);\r\n\t\t\t}\r\n\t\t\tvar selected_snap \t= historyManager.get('selectedSnapshots');\r\n\t\t\tif(selected_snap.length > 0)\r\n\t\t\t{\r\n\t\t\t\ttree_project_id \t= historyManager.get('currentSubSystem');\r\n\t\t\t\ttree_snaphsot_id\t= selected_snap[0].id;\r\n\t\t\t\tif(($('.tree-panel-container .navigate_tree').attr('data-subsystem_id') != historyManager.get('currentSubSystem')) ||\r\n\t\t\t\t\t($('.tree-panel-container .navigate_tree').attr('data-snapshot_id') != tree_snaphsot_id) ||\r\n\t\t\t\t\t($('.tree-panel-container .navigate_tree').attr('data-name') != historyManager.get('currentSubSystemName')))\r\n\t\t\t\t\tloadTreeStructure();\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($('#tree-icon-container').hasClass('active'))\r\n\t\t\t\t\t\topenTree();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "94bb8bf05f0fd7a398d5ce6b56a7ec2d", "score": "0.5549382", "text": "function clustertree_set_tree_state(instanceid, uniqueid, usingdropdown) {\n\tvar cluster_param_tree = clustertree_get_container_element_by_id('php_report_body_' + instanceid, 'cluster_param_tree_' + instanceid + '_' + uniqueid);\n\n\tif (!usingdropdown) {\n\t\tcluster_param_tree.style.display = '';\n\t} else {\n\t cluster_param_tree.style.display = 'none';\n\t}\n}", "title": "" }, { "docid": "170bd41f1dfe52d3eba95d429e8331f6", "score": "0.55481595", "text": "function showTypeStrains() {\n$('#colorkey').removeClass('hidden');\n$('#anicolorscheme').addClass('hidden');\n$('#singleani').addClass('hidden');\n$('#tscolorscheme').removeClass('hidden');\ntree.label().color(function(node) {\n return strainTypeNodes(node);\n});\ntree.update_nodes();\nsetSvg();\n}", "title": "" }, { "docid": "fd158be81ecb071af4ee95147771a794", "score": "0.55426854", "text": "function showNodesForIncrease(animationDuration, animationDelay, colour = true){\n let opacity = 1\n // i. Show (on slight delay) other increased nodes\n if(influenceData.multiPositiveNodeIDX.length > 0){\n d3.selectAll(influenceData.nodePositiveSelection) \n .transition().duration(animationDuration).delay(animationDelay * 1/4)\n .style('fill', colour ? 'var(--color-positive-light)' : null)\n .style('opacity', opacity)\n d3.selectAll(influenceData.labelPositiveSelection)\n .transition().duration(animationDuration).delay(animationDelay * 1/4)\n .style('opacity', opacity)\n }\n // ii. On (further) slight delay, highlight the decreased nodes \n if(influenceData.multiNegativeNodeIDX.length > 0){\n d3.selectAll(influenceData.nodeNegativeSelection) \n .transition().duration(animationDuration).delay(animationDelay * 5/4)\n .style('fill', colour ? 'var(--color-negative-light)' : null)\n .style('opacity', opacity);\n d3.selectAll(influenceData.labelNegativeSelection) \n .transition().duration(animationDuration).delay(animationDelay * 5/4)\n .style('opacity', opacity); \n } \n // iii. On (further) slight delay, highlight the mixed nodes \n if(influenceData.multiMixedNodeIDX.length > 0){\n d3.selectAll(influenceData.nodeMixedSelection) \n .transition().duration(animationDuration).delay(animationDelay * 9/4)\n .style('fill', colour ? 'var(--color-neutral-light)' : null)\n .style('opacity', opacity); \n d3.selectAll(influenceData.labelMixedSelection) \n .transition().duration(animationDuration).delay(animationDelay * 9/4)\n .style('opacity', opacity); \n }\n } // end showNodesForIncrease()", "title": "" }, { "docid": "964d8e0f529049991ed4b8d8fee5c04c", "score": "0.553907", "text": "function displayNextNode() {\n if(!finishedTyping) {\n setTimeout(displayNextNode, 100); \n } else {\n fadeOutButtons();\n nodeId = currentSceneNode.requiredItemScene;\n finishedTyping = false;\n loadScene(sceneId, nodeId);\n }\n}", "title": "" }, { "docid": "50a596e90e48c4d2f7c7ede975337f3d", "score": "0.55385786", "text": "function toggleNodesList() {\n $log.debug( \"toggleNodesList() \");\n $mdSidenav('left').toggle();\n }", "title": "" }, { "docid": "76e72fa33f69f537dd65da50e9349171", "score": "0.5527645", "text": "get nodes() {\n return selectedNodes;\n }", "title": "" }, { "docid": "e9832a48575392c977b22238792c8df3", "score": "0.552731", "text": "function colourNodesByDirection(duration = 1000){\n let opacity = 1,\n keys = Object.keys(visData.nodeDirectionObject)\n d3.selectAll('.label')\n // .transition().duration(0)\n .style('fill', null)\n d3.selectAll('.nodeControl, .nodeControlLabels')\n // .transition().duration(duration)\n .style('opacity', 0)\n d3.selectAll('.node, .label')\n .transition().duration(duration)\n .style('opacity', opacity)\n\n for(let i = 0; i < keys.length; i++){\n let direction = visData.nodeDirectionObject[keys[i]]['direction']\n if(direction > 0){\n d3.select('#'+keys[i]).style('fill', 'var(--color-positive-light)')\n } else if (direction === 0){\n d3.select('#'+keys[i]).style('fill', 'var(--color-neutral-light)')\n } else if (direction < 0){\n d3.select('#'+keys[i]).style('fill', 'var(--color-negative-light)')\n }\n }\n\n // For the original \"MasterNode\" copied to visData.nodesAnalysedByLoopMasterNodeID; keep node and button in view\n d3.select('#node_'+visData.nodesAnalysedByLoopMasterNodeID)\n .style('fill', 'var(--color-main-dark)')\n d3.select('#label_'+visData.nodesAnalysedByLoopMasterNodeID)\n .style('fill', '#fff')\n\n if(visData.nodeDirectionObject['node_'+visData.nodesAnalysedByLoopMasterNodeID]['direction'] === 1){\n d3.selectAll('#nodeControlUp_'+visData.nodesAnalysedByLoopMasterNodeID+', #nodeControlUpLabel_'+visData.nodesAnalysedByLoopMasterNodeID)\n .transition().duration(0)\n .style('opacity', 1)\n } else {\n d3.selectAll('#nodeControlDown_'+visData.nodesAnalysedByLoopMasterNodeID+' , #nodeControlDownLabel_'+visData.nodesAnalysedByLoopMasterNodeID)\n .transition().duration(0)\n .style('opacity', 1) \n }\n }", "title": "" }, { "docid": "46cfa03cf29cc18f6fe787fcd2ea03a5", "score": "0.5508848", "text": "function showNodeForm() {\n $('body').removeClass('awecontent-active').find('.js-awecontent-wrapper').removeClass('awecontent-wrapper');\n $('.awecontent-body-wrapper').children().show();\n // fix for toolbar\n $('#toolbar, #admin-menu').show();\n }", "title": "" }, { "docid": "1475a9afbf1a24ddb06ab362b93c666f", "score": "0.550854", "text": "_getTopNodes() {\n var self = this;\n this.state.jobs.map(function(job) {\n var isChild = false;\n self.state.jobs.map(function(refJob) {\n refJob.dependencies.map(function(dep) {\n if (job.ref === dep.ref)\n isChild = true;\n });\n });\n if (!isChild)\n self.state.topJobs.push(job);\n });\n }", "title": "" }, { "docid": "b55ae9fdd62573a9c07df11f8f7d60ee", "score": "0.5506963", "text": "syncNodes() {\n this.setState({\n data: this.tree.nodes()\n });\n }", "title": "" }, { "docid": "0ed57d1f320e0f6f0a3b593d5c300c94", "score": "0.55031955", "text": "ensureInvisibility() {\n this.nodeVisible = false;\n }", "title": "" }, { "docid": "f36242e2a20dd5dd57f623af9938a6dc", "score": "0.5485469", "text": "function showAll() {\n\t\t$(\".online\").fadeIn();\n\t\t$(\".offline\").fadeIn();\n\t\t$(\".inactive\").fadeIn();\n\t}", "title": "" }, { "docid": "add5414c3c5111f44d26ce3e5bf402ac", "score": "0.54852515", "text": "function displayClusterStatus() {\n memberDetailsRefreshFlag = 0;\n if (!(document.getElementById(\"clusterStatusIcon\") == null)) {\n if (numTotalSeverAlerts > 0) { // Severe\n $('#clusterStatusText').html(\"Severe\");\n $(\"#clusterStatusIcon\").addClass(\"severeStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"errorStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"errorStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"warningStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"warningStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"normalStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"normalStatus\");\n\n } else if (numTotalErrorAlerts > 0) { // Error\n $('#clusterStatusText').html(\"Error\");\n $(\"#clusterStatusIcon\").addClass(\"errorStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"severeStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"severeStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"warningStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"warningStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"normalStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"normalStatus\");\n } else if (numTotalWarningAlerts > 0) { // Warning\n $('#clusterStatusText').html(\"Warning\");\n $(\"#clusterStatusIcon\").addClass(\"warningStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"severeStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"severeStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"errorStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"errorStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"normalStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"normalStatus\");\n } else { // Normal\n $('#clusterStatusText').html(\"Normal\");\n $(\"#clusterStatusIcon\").addClass(\"normalStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"severeStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"severeStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"errorStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"errorStatus\");\n if ($(\"#clusterStatusIcon\").hasClass(\"warningStatus\"))\n $(\"#clusterStatusIcon\").removeClass(\"warningStatus\");\n }\n\n // updating r graph\n if (flagActiveTab == \"MEM_R_GRAPH_DEF\") {\n var postData = {};\n var qp = {};\n postData[\"ClusterMembersRGraph\"] = qp;\n var data = {\n \"pulseData\" : this.toJSONObj(postData)\n };\n $.post(\"pulseUpdate\", data, function(data) {\n updateRGraphFlags();\n clusteRGraph.loadJSON(data.clustor);\n clusteRGraph.compute('end');\n if (vMode != 8)\n refreshNodeAccAlerts();\n clusteRGraph.refresh();\n }).error(repsonseErrorHandler);\n }\n // updating tree map\n if (flagActiveTab == \"MEM_TREE_MAP_DEF\") {\n var postData = {};\n var qp = {};\n postData[\"ClusterMembers\"] = qp;\n var data = {\n \"pulseData\" : this.toJSONObj(postData)\n };\n\n $.post(\"pulseUpdate\", data, function(data) {\n var members = data.members;\n memberCount = members.length;\n var childerensVal = [];\n\n for ( var i = 0; i < members.length; i++) {\n var color = \"#a0c44a\";\n for ( var j = 0; j < warningAlerts.length; j++) {\n if (members[i].name == warningAlerts[j].memberName) {\n color = '#ebbf0f';\n break;\n }\n }\n for ( var j = 0; j < errorAlerts.length; j++) {\n if (members[i].name == errorAlerts[j].memberName) {\n color = '#de5a25';\n break;\n }\n }\n for ( var j = 0; j < severAlerts.length; j++) {\n if (members[i].name == severAlerts[j].memberName) {\n color = '#b82811';\n break;\n }\n }\n var heapSize = members[i].currentHeapUsage;\n if (heapSize == 0)\n heapSize = 1;\n var name = \"\";\n name = members[i].name;\n var id = \"\";\n id = members[i].memberId;\n var dataVal = {\n \"name\" : name,\n \"id\" : id,\n \"$color\" : color,\n \"$area\" : heapSize,\n \"cpuUsage\" : members[i].cpuUsage,\n \"heapUsage\" : members[i].currentHeapUsage,\n \"loadAvg\" : members[i].loadAvg,\n \"threads\" : members[i].threads,\n \"sockets\" : members[i].sockets,\n \"initial\" : false\n };\n var childrenVal = {\n \"children\" : [],\n \"data\" : dataVal,\n \"id\" : id,\n \"name\" : name\n };\n childerensVal[i] = childrenVal;\n }\n var json = {\n \"children\" : childerensVal,\n \"data\" : {},\n \"id\" : \"root\",\n \"name\" : \"Members\"\n };\n clusterMemberTreeMap.loadJSON(json);\n clusterMemberTreeMap.refresh();\n }).error(repsonseErrorHandler);\n }\n }\n}", "title": "" }, { "docid": "93a644b30d53bf5bf362b208bec0aa0e", "score": "0.54785895", "text": "function hideButtons(){\n\t\t\t\td3.selectAll('.nodeControl')\n\t\t\t\t\t.classed('hidden', true)\t\t\t\t\t\t// Hide from DOM \n\t\t\t\t\t.transition().duration(0)\t\t\t\t\t\t\n\t\t\t\t\t\t.style('opacity', 0)\t\t\t\t\t\t// Set to zero opacity\n\t\t\t} // end hideButtons()", "title": "" }, { "docid": "5e362b3b5298d5d46853743ebdd66773", "score": "0.5477096", "text": "function mouse_in_node(n,i) {\n\n var remainingNodes=[],\n nextNodes=[];\n\n var stroke_opacity = n.alpha;\n var stroke_color = n.color;\n var visibility = 'visible';\n var node_stroke_width = 5;\n var image_opacity = 0;\n\n d3.select(this).select(\"rect\").style(\"stroke-width\", node_stroke_width)\n\n // Update the opacity of the snapshots bar\n for (i = 0; i < nodeNumber; i++) {\n if ( (i != n.id % nodeNumber) & !(selected_nodes.has(i)) & !(selected_nodes.has(i + nodeNumber))) {\n image_opacity = 0.2;\n } else {\n image_opacity = 1;\n }\n d3.select(\"#snapshots_images-\" + i).style(\"opacity\", image_opacity)\n }\n\n d3.select(\"#node_infos-\" + n.id).style(\"visibility\", visibility)\n\n update_top_elements(n);\n\n // Update of the video, if the slider is checked\n if (document.querySelector(\"input[name=checkbox2]\").checked == true) {\n var top_vid = document.getElementById(\"top_video\")\n\n top_vid.play();\n top_vid.pause();\n top_vid.currentTime = n.starting_time;\n top_vid.play();\n }\n\n // If the graph is expanded\n if (sankey.zoomed()) {\n\n var traverse = [{\n linkType : \"sourceLinks\",\n nodeType : \"target\"\n },{\n linkType : \"targetLinks\",\n nodeType : \"source\"\n }];\n\n traverse.forEach(function(step){\n var node_class = step.nodeType\n n[step.linkType].forEach(function(link) {\n remainingNodes.push(link[step.nodeType]);\n highlight_link(link.id, stroke_opacity, stroke_color, visibility, node_class);\n });\n\n while (remainingNodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n node[step.linkType].forEach(function(link) {\n nextNodes.push(link[step.nodeType]);\n highlight_link(link.id, stroke_opacity, stroke_color, visibility, node_class);\n });\n });\n remainingNodes = nextNodes;\n }\n });\n }\n }", "title": "" }, { "docid": "5133ba307f858492a1f64aaded220c77", "score": "0.54752684", "text": "function renderAll() {\n chart.each(render);\n list.each(render);\n d3.select(\"#active\").text(formatNumber(all.value()));\n }", "title": "" }, { "docid": "91967178eebface71e6a2dbd1558ca07", "score": "0.5472575", "text": "createViewObjects(state) {\n //Nodes\n if (!this.viewObjects[\"main\"]) {\n let geometry = new THREE.SphereGeometry(this.val * state.nodeRelSize,\n state.nodeResolution, state.nodeResolution);\n if (!this.material){\n this.material = state.materialRepo.createMeshLambertMaterial({\n color: this.color,\n polygonOffsetFactor: -100 //Draw nodes in front of lyphs\n });\n }\n let obj = new THREE.Mesh(geometry, this.material);\n // Attach node data\n obj.__data = this;\n this.viewObjects[\"main\"] = obj;\n }\n\n //Labels\n this.createLabels(state.labels[this.constructor.name], state.fontParams);\n }", "title": "" }, { "docid": "f0f41e228ba1b3b9b48952f096789754", "score": "0.54651624", "text": "function showTree() {\n g.select(\"#map_layer\")\n .classed(\"no_click\",true)\n .transition()\n .duration(0)\n .style(\"opacity\",0)\n g.select(\"#zoom_layer\")\n .classed(\"no_click\",true)\n .transition()\n .duration(0)\n .style(\"opacity\",0)\n g.select(\"#tree_layer\")\n .classed(\"no_click\",false)\n .transition()\n .duration(500)\n .style(\"opacity\",1)\n // Add a click event to the main SVG. Typically when\n // the user clicks a node, all other nodes become \n // hidden and links not connected to the clicked node\n // become hidden. When the user clicks the main SVG\n // instead, this indicates they wish to return the \n // visualization to its default state with all nodes\n // and links visible. This click callback function \n // performs this change to the visualization.\n vis.on(\"click\",function(){\n // The equalToEventTarget() and d3 filter() functions \n // are used to determine if the user's click event was \n // inside or outside \"nodeEnter,\" which is a selection \n // of all the groups corresponding to nodes for the \n // force layout. If the user's click event was outside \n // \"nodeEnter\", perform the following\n var outside = nodeEnter.filter(equalToEventTarget).empty();\n if(outside){\n // Set the opacity of all links to 1\n d3.selectAll(\"path.link\")\n .transition()\n .duration(0)\n .style(\"opacity\",1.0);\n // Set the opacity of all nodes to 1\n d3.selectAll(\"g.node\")\n .transition()\n .duration(0)\n .style(\"opacity\",1.0);\n }\n // Set the visibility in the tooltip for the \"Tree\"\n // visualization to hidden\n tooltipTree.style(\"visibility\",\"hidden\");\n })\n }", "title": "" }, { "docid": "29e51cf782ad9c916b448a36964747e5", "score": "0.5461537", "text": "function renderGraph(state){\n\tif(!graph){\n\t\t// init\n\t\tgraph = new Graph();\n\t\tgraph.edgeFactory.template.style.directed = true;\n\t layout = new Graph.Layout.Circle(graph);\n\t renderer = new Graph.Renderer.Raphael('graph', graph, width, height);\n\t renderer.r.image(\"images/garbage.png\", width - icon_size*1.2, height - icon_size*1.2, icon_size, icon_size);\n\t \n\t // override omouseup for dragging actions\n\t var d = document.getElementById('graph');\n\t var super_onmouseup = d.onmouseup;\n\t d.onmouseup = function () {\n\t \tif(renderer.isDrag){\n\t\t\t\tvar componentId = renderer.isDrag.set[0].node.id;\n\t\t\t\tvar node = layout.graph.nodes[componentId];\n\t\t\t\t\n\t \t\tvar offset = $('#graph').offset();\n\t \t\tvar test = renderer.isDrag;\n\t \t\tvar x = renderer.isDrag.dx - offset.left;\n\t \t\tvar y = renderer.isDrag.dy;\n\t \t\tlog(\"X \"+x+\" Y \"+y+\" W \"+width+\" H \"+height);\n\t \t\tvar target = inFramework(x,y);\n\t \t\tif(target){\n\t \t\t\tif(target!=node.framework){\n\t \t\t\t\t// migrate component\n\t \t\t\t\tmigrateComponent(componentId, target);\n\t \t\t\t} else {\n\t \t\t\t\t// select component\n\t \t\t\t\tselectComponent(componentId);\n\t \t\t\t}\n\t \t\t} else if(x > width-icon_size && y > height-icon_size){ \n\t \t\t\t// trash\n\t \t\t\tstopComponent(componentId);\n\t \t\t} else {\n\t \t\t\t// let component stay within framework boundaries\n\t \t\t\tselectComponent(componentId);\n\t \t\t\trenderer.draw();\n\t \t\t}\n\t \t} else if(renderer.isSelected){\n\t \t\t// select framework\n\t \t\tvar framework = renderer.isSelected.set[0].node.id;\n\t \t\tselectFramework(framework);\n\t \t} \n\t \tsuper_onmouseup();\n\t };\n\t}\n\t// check whether changes occured\n\tvar changed = false;\n\t\n\t// filter removed nodes/components\n\tvar toRemove = [];\n\tfor(var n in graph.nodes ){\n\t\tvar node = graph.nodes[n];\n\t\tif(!inState(node, state)){\n\t\t\ttoRemove.push(node);\n\t\t}\n\t}\n\tfor(var n=0, len=toRemove.length; n < len; n++){\n\t\tvar node = toRemove[n];\n\t\tgraph.removeNode(node.id);\n\t\tchanged = true;\n\t}\n\n\tfor(var i in state.nodes){\n\t\tvar node = state.nodes[i];\n\t\tvar frameworkId = node.id;\n\t\tif(graph.nodes[frameworkId]==undefined)\n\t\t\tchanged = true;\n\t\tgraph.addNode(frameworkId, {label: node.name,\n\t\t\trender : drawNode,\n\t\t\ticon: getNodeIcon(node)});\n\t}\n\tfor(var i in state.components){\n\t\tvar component = state.components[i];\n\t\tvar id = component.componentId+\"-\"+component.version+\"-\"+component.frameworkId;\n\t\tif(graph.nodes[id]==undefined)\n\t\t\tchanged = true;\n\t\tgraph.addNode(id, {framework : component.frameworkId, \n\t\t\t\t\t\t\tlabel : component.name,\n\t\t\t\t\t\t\trender : drawComponent});\n\t}\n\tfor(var i in state.links){\n\t\tvar link = state.links[i];\n\t\tvar id = link.from+\"-\"+link.to;\n\t\tif(graph.edges[id]==undefined){\n\t\t\tgraph.addEdge(link.from, link.to);\n\t\t\tchanged = true;\n\t\t}\n\t}\n\n\tif(changed){\n\t\tlayout.layout();\n\t\trenderer.draw();\n\t}\n}", "title": "" }, { "docid": "f02275975ff483ea3ae2631f30338e91", "score": "0.5454683", "text": "function changestate(){\n let stateplot=d3.select('#state_selected').node().value;\n buildplot(stateurl,stateplot)}", "title": "" }, { "docid": "b8294e7a20af7e1c7692c02d85997eb8", "score": "0.54480386", "text": "updateDisplayNodes() {\n if (this.state.category === ''){\n return;\n } else {\n for (var name in SkillDB){\n if(this.state.username === name) {\n continue;\n }\n if (SkillDB[name][this.state.category].includes(this.state.categoryFilter)) {\n this.setState({\n displayNodes: this.state.displayNodes.concat(name)\n })\n }\n\n }\n }\n \n }", "title": "" }, { "docid": "31f496eea405ba254ab9694e09d86216", "score": "0.54447633", "text": "function infoSelectedNode() {\n var canvasOffset = $(\"#networkDesigner\").offset();\n $(\"#infoBox\").show();\n $(\"#infoBox\").css(\"left\", canvasOffset.left+layerWidth/2+layerSelected*layerWidth+nodeRadius+8);\n $(\"#infoBox\").css(\"top\", canvasOffset.top+nodeSelected*nodeRadius*3+10); \n \n if ( network!=null && networkTrained ) {\n newLayerSelected = layerSelected;\n // Account for empty layers\n for ( i=1; i<nodes.length-1 && i<layerSelected; i++ ) {\n if ( nodes[i]==0 )\n newLayerSelected--;\n }\n\n var data = network.layers[newLayerSelected].nodes[nodeSelected];\n\n dataFound = false;\n var infoHTML = '<ul class=\"infoNode\">';\n if ( data.bias != null ) {\n dataFound = true;\n infoHTML += '<li>Bias: '+data.bias.toFixed(5)+'</li>';\n }\n \n if ( data.weights != null ) {\n dataFound = true;\n infoHTML += '<li><a href=\"#\" onclick=\"toggleInfoWeights();\">Weights</a> (click to show)';\n infoHTML += '<ol class=\"weights\">';\n $.each(data.weights, function(index, value){\n infoHTML += '<li>'+value.toFixed(5)+'</li>';\n });\n infoHTML += '</ol></li>'; \n }\n \n if ( data.error != null ) {\n dataFound = true;\n infoHTML += '<li>Error: '+data.error.toFixed(4)+'</li>';\n }\n \n if ( !dataFound )\n infoHTML += '<li>No data available for this node</li>';\n \n infoHTML += '</ul>';\n\n $(\"#infoBox\").html(infoHTML);\n $(\".weights\").hide(); \n } else {\n $(\"#infoBox\").css(\"top\", canvasOffset.top+nodeSelected*nodeRadius*3+nodeRadius-5); \n $(\"#infoBox\").html(\"Train network first\");\n }\n}", "title": "" }, { "docid": "3ffb1bc6e4199014740c8d8d38516f85", "score": "0.5433036", "text": "function showState() {\n ann.setOverride(true);\n mill.showState();\n displayStore(sto.rack.length + 1, sto.rack);\n displayCardReader(cr.nextCardNumber, cr.cards);\n ann.setOverride(false);\n }", "title": "" }, { "docid": "3914e46e68a88071bb920fc6ab44eec9", "score": "0.5425982", "text": "function renderAll() {\r\n chart.each(render);\r\n list.each(render);\r\n d3.select(\"#active\").text(formatNumber(all.value()));\r\n }", "title": "" }, { "docid": "57e57f257fb7c4593dd15c7816459a5a", "score": "0.5423874", "text": "get hasNodes () {\n\t\treturn this.size !== 0\n\t}", "title": "" }, { "docid": "cf5e22f8838fd24bfcfd5943270e0a67", "score": "0.54197764", "text": "function toggleDisplayOfTasks() {\n\tvar e_li = $(this).parent();\n\t$('ul:first', e_li).toggle();\n\tif ($('.nodeStatus:first', e_li).attr('src').indexOf(\"open\") >= 0) {\n\t\t$('.nodeStatus:first', e_li).attr('src', \"images/node_closed.png\")\n\t\t$(e_li).find(\".actionbuttons\").toggle();\n\t} else {\n\t\t$('.nodeStatus:first', e_li).attr('src', \"images/node_open.png\")\n\t\t$(e_li).find(\".actionbuttons\").toggle();\n\t}\n}", "title": "" }, { "docid": "653861a9173bf216a175d2bafc7031a7", "score": "0.5416346", "text": "function inState(node, state){\n\tfor(var i in state.nodes){\n\t\tvar frameworkId = state.nodes[i];\n\t\tif(node.id == frameworkId)\n\t\t\treturn true;\n\t}\n\tfor(var i in state.components){\n\t\tvar component = state.components[i];\t\n\t\tvar id = component.componentId+\"-\"+component.version+\"-\"+component.frameworkId;\n\t\tif(node.id == id)\n\t\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "891ce96aecd90299a9d05581d66a4173", "score": "0.54124385", "text": "function displayChildren() {\n containerComb.selectAll(\"g.node\").each(function (d, i) {\n if (d.depth + 1 == number && !d.children) {\n d.children = d._children;\n d._children = null;\n } else if (d.depth == number) {\n d._children = d.children;\n d.children = null;\n }\n });\n }", "title": "" }, { "docid": "59faa0af54a91d19f75288a7f4d858ab", "score": "0.54036134", "text": "drawChart () {\n let self = this;\n \n //console.log('GalaxyChart.drawNodes:', self.nodeSelection.size());\n \n // Draw the nodes\n self.nodeHandler.drawNodes(self.nodeSelection, self);\n \n // Draw the drop nodes\n self.nodeHandler.drawNodes(self.dropSelection, self);\n \n // Draw the highlighted nodes\n if (self.highlightedNode) {\n self.nodeHandler.drawNodes(self.highlightSelection, self);\n }\n \n // Draw the links\n self.linkHandler.drawLinks(self.linkSelection, self);\n }", "title": "" }, { "docid": "049c362de3af73fbf5652eb0e91f7dab", "score": "0.53995043", "text": "display() {\n let current = this.head;\n let i = 0;\n while (current) {\n console.log(\"Node \" + i + \": \" + current.val);\n current = current.next;\n i++\n }\n }", "title": "" }, { "docid": "8fd6e4f2a88f102a0dcfbe41eb62b637", "score": "0.5391553", "text": "show(){\n this.showNameAndPriority();\n \n // Draw a line\n line(100, this.y, width, this.y);\n\n // show a liste of state for this task\n this.states.forEach(state => {\n state.show()\n });\n }", "title": "" }, { "docid": "0b5fd40d4e5f3fb37562ef9ae0e4f797", "score": "0.5391204", "text": "renderTree() {\n\t\td3.select(\"body\")\n\t\t .append(\"svg\")\n\t\t .attr(\"width\", 1200)\n\t\t .attr(\"height\", 1200);\n\t\tvar svgElement = d3.select(\"svg\");\n\t\tsvgElement.selectAll(\"line\").data(this.nodeList).enter()\n\t\t\t\t .append(\"line\")\n\t\t\t\t .attr(\"x1\", function(node, i){return (node.level+1)*100})\n\t\t\t\t .attr(\"y1\", function(node, i){return (node.position+1)*75})\n\t\t\t\t .attr(\"x2\", function(node, i){\n\t\t\t\t \treturn node.parentNode ? (node.parentNode.level+1)*100 : (node.level+1)*100 ;\n\t\t\t\t })\n\t\t\t\t .attr(\"y2\", function(node, i){\n\t\t\t\t \treturn node.parentNode ? (node.parentNode.position+1)*75 : (node.position+1)*75 ;\n\t\t\t\t });\n\n\t\tsvgElement.selectAll(\"circle\").data(this.nodeList).enter()\n\t\t\t\t .append(\"circle\")\n\t\t\t\t .attr(\"cx\", function(node, i){return (node.level+1)*100})\n\t\t\t\t .attr(\"cy\", function(node, i){return (node.position+1)*75})\n\t\t\t\t .attr(\"r\", 30);\n\n\t\tsvgElement.selectAll(\"text\").data(this.nodeList).enter()\n\t\t\t\t .append(\"text\")\n\t\t\t\t .attr(\"class\", \"label\")\n\t\t\t\t .attr(\"dx\", function(node, i){return (node.level+1)*100})\n\t\t\t\t .attr(\"dy\", function(node, i){return (node.position+1)*75})\n\t\t\t\t .text(function(node, i){return node.name});\n\t\t\n\t}", "title": "" }, { "docid": "d46828668569e2896707e00cb8c3b30e", "score": "0.538815", "text": "function renderAll() {\n chart.each(render);\n list.each(render);\n d3.select('#active_top').text(formatNumber(all.value()));\n d3.select('#active').text(formatNumber(all.value()));\n plotPoints(coord.top(Infinity));\n sorttable.makeSortable(document.getElementById('flight-list'));\n }", "title": "" }, { "docid": "6e97b8ea1d66b807f9e08742e8810aa2", "score": "0.5382724", "text": "function onShowNodeBtnClicked(event)\n\t{\n\t\tvar nodeIndex = event.currentTarget.dataset.showNode;\n\t\tvar node = this.data.categories[this.showingCategoryIndex].nodes[nodeIndex];\n\n\t\tthis.showingNodeIndex = nodeIndex;\n\t\tthis.renderContentView(node);\n\t}", "title": "" }, { "docid": "c97b605fe751888b36b1a51b6df75c6d", "score": "0.5369559", "text": "setVisibility() {\n let notMarkedOpacity = 0.3;\n // set node visibility\n this.graph.nodes.forEach(node => {\n let opacity = (node.marked) ? 1.0 : notMarkedOpacity;\n let visibility = node.visible ? \"inherit\" : \"hidden\";\n let domNodeFrame = this.elementInfo.domNodeFrame(node);\n domNodeFrame.style.opacity = opacity;\n domNodeFrame.style.visibility = visibility;\n });\n\n // set relation visibility\n this.graph.relations.forEach((relation, i) => {\n let domPath = this.elementInfo.domPath(relation);\n domPath.style.visibility = relation.visible ? \"inherit\" : \"hidden\";\n domPath.style.opacity = (relation.source.marked === true && relation.target.marked === true) ? 1.0 : notMarkedOpacity;\n });\n }", "title": "" }, { "docid": "f26329a934ca281840f60bc569c98491", "score": "0.5368131", "text": "paintNodes() {\n super.paintNodes();\n if (this.rectangleGrowing) this.paintRect();\n if (this.rectangleInProgress) this.paintRect();\n }", "title": "" }, { "docid": "6317a4a802abee7623cb94be4895c54e", "score": "0.536343", "text": "showSceneGraph() {\n let output = \"SceneGraph for this viewport:\";\n output += \"\\n \\n\";\n output += this.rootNode.Name;\n console.log(output + \" => ROOTNODE\" + this.createSceneGraph(this.rootNode));\n }", "title": "" }, { "docid": "a9614786735d5b77005ff84704b8facf", "score": "0.53543097", "text": "getNodes() {\r\n return nodes;\r\n }", "title": "" }, { "docid": "06deda250445010ea8e862c2a5c1b70a", "score": "0.53490466", "text": "activateSet(nodes) {\n nodes.forEach((nId) => {\n const gNode = TTDataAccess.fastFind(this.dataAccess.graph, nId, (x) => x[0])\n this.state.active.set(gNode[kNodeDepthSlot] * this.dataAccess.matrixHeight + gNode[kNodeVerticalSlot], 1)\n })\n\n for (let i = 0; i < this.state.heads.length; ++i) {\n if (!this.isHead(this.state.heads[i])) {\n this.state.heads.splice(i, 1)\n i--\n }\n }\n nodes.forEach((v) => {\n if (this.isHead(v)) {\n this.state.heads.push(v)\n }\n })\n\n console.debug(\"Heads\", this.state.heads)\n console.debug(\"ABM\", this.state.active)\n this.dirty = true\n\n this._saveToLocalStorage()\n }", "title": "" }, { "docid": "e577dabfa91e4bdde96ee8a8fba1a26f", "score": "0.534476", "text": "checknodes(){\r\n // Get list of dead nodes\r\n console.log(\"Checking nodes ...\")\r\n console.log(this.alivelist);\r\n\tvar deadnodes = [];\r\n for(let node in this.alivelist){ \r\n if(!this.alivelist[node]){\r\n console.log(`${node} is dead`);\r\n deadnodes.push(node);\r\n }\r\n }\r\n\r\n // do something to deadnodes' lost information\r\n this.reduplicate(deadnodes);\r\n\r\n // Reset state of alive list and send heartbeat request to all nodes\r\n Object.keys(this.alivelist).forEach(v => this.alivelist[v] = false);\r\n this.pubsub.publish('heartbeat', {sender: \"master\", message: \"Check status\"});\r\n\r\n // Validate in 4 seconds\r\n setTimeout(() => {this.checknodes()}, 4000);\r\n }", "title": "" }, { "docid": "d49186f9a472a72cad35a8dd219f0806", "score": "0.533621", "text": "display() {\n let graph = '';\n this.nodes.forEach(node => {\n graph += `${node} -> ${this.edges[node].map(n => n.node).join(', ')} \\n`;\n });\n console.log(graph);\n }", "title": "" }, { "docid": "203674301aac1e19df7dc68f01e982e7", "score": "0.53345233", "text": "QueryNodesInView()\r\n\t{\t\r\n\t\t//v podstate inverzni trasformace oproti vykresleni grafu\r\n\t\tlet realViewWindowPositionLeftBorder = this.viewWindowPositionX;\r\n\r\n\t\trealViewWindowPositionLeftBorder = realViewWindowPositionLeftBorder-this.translationTwoX;\r\n\t\trealViewWindowPositionLeftBorder = realViewWindowPositionLeftBorder/this.scaleOne;\r\n\t\trealViewWindowPositionLeftBorder = realViewWindowPositionLeftBorder-this.translationOneX;\r\n\t\t\r\n\t\tlet realViewWindowPositionTopBorder = this.viewWindowPositionY;\r\n\r\n\t\trealViewWindowPositionTopBorder = realViewWindowPositionTopBorder-this.translationTwoY;\r\n\t\trealViewWindowPositionTopBorder = realViewWindowPositionTopBorder/this.scaleOne;\r\n\t\trealViewWindowPositionTopBorder = realViewWindowPositionTopBorder-this.translationOneY;\r\n\t\t\r\n\t\tlet realScale = this.viewWindowScale/this.scaleOne;\r\n\t\t\r\n\t\tlet realViewWindowPositionRightBorder = realViewWindowPositionLeftBorder+this.viewWindowWidth/this.scaleOne;\r\n\t\tlet realViewWindowPositionBottomBorder = realViewWindowPositionTopBorder+this.viewWindowHeight/this.scaleOne;\r\n\t\t\r\n\t\trealViewWindowPositionLeftBorder -= this.biggestRadius;\r\n\t\trealViewWindowPositionTopBorder -= this.biggestRadius;\r\n\t\trealViewWindowPositionRightBorder += this.biggestRadius;\r\n\t\trealViewWindowPositionBottomBorder += this.biggestRadius;\r\n\t\t\r\n\t\tthis.nodesInView = this.nodesQuadTree.Query(realViewWindowPositionLeftBorder, realViewWindowPositionRightBorder, realViewWindowPositionTopBorder, realViewWindowPositionBottomBorder);\r\n\t}", "title": "" }, { "docid": "4088ae139378f5292128ce93e9b061d0", "score": "0.53279036", "text": "showConnections() {\n\n }", "title": "" }, { "docid": "5cf2aaadc58bf51b9a52a63f8c958781", "score": "0.53271335", "text": "function showAllThreads() {\n // expand all threads\n expandThreadNode(commentTree);\n var toggleButton = document.getElementById(\"thread0\");\n toggleButton.innerHTML = \"-\";\n}", "title": "" }, { "docid": "2cfb9536bf2689b73740784dcd158d5f", "score": "0.5321255", "text": "parse_data(d) {\n d.forEach(element => {\n if (element === '') {\n return;\n }\n // If a new node is being registered,\n // add it to the node visual and log a message\n if (element.includes(\"Node registered\")) {\n let nodeType = element.split(': ')[1].trim()\n console.log(\"REGISTERED \" + nodeType)\n this.setState(prevState => ({\n nodes: [...prevState.nodes, nodeType],\n msgs: [...prevState.msgs, 'REGISTERED NEW NODE TYPE: ' + nodeType]\n }))\n return;\n }\n\n // If a share submission is detected\n if (element.includes(\"has submitted\")) {\n let usr = element.split(' ')[0].trim();\n\n\n // increment the given users share if they exist\n if (this.state[usr]){\n this.setState(prevState => ({\n msgs: [...prevState.msgs, usr + ' SUBMITTED A SHARE'],\n [usr]: prevState[usr] + 1,\n }))\n }\n\n // Create the user and give them one share in the visual\n else {\n this.setState(prevState => ({\n msgs: [...prevState.msgs, usr + ' SUBMITTED A SHARE'],\n usrs: [...prevState.usrs, usr],\n [usr]: 1\n }))\n }\n\n return;\n }\n\n // If a user has been authorized\n if (element.includes(\"is Authorized\")) {\n var who = element.substring(\n element.indexOf(\"(\") + 1,\n element.indexOf(\")\")\n );\n\n // create a message that they have been authorized\n this.setState(prevState => ({\n msgs: [...prevState.msgs, who + ' HAS BEEN AUTHORIZED']\n }))\n return;\n }\n\n // Log out this simple message\n if (element === 'Looking for updates') {\n console.log('LOOKING')\n this.setState(prevState => ({\n msgs: [...prevState.msgs, 'LOOKING FOR UPDATES']\n }))\n return;\n }\n\n // Log out this simple message\n if (element === 'Sending New Share to other Auth Nodes') {\n console.log(\"UPDATING OTHER AUTHS\")\n this.setState(prevState => ({\n msgs: [...prevState.msgs, \"UPDATING OTHER AUTHS\"]\n }))\n }\n\n // Log out this simple message\n if (element === 'Recieved Share from Client Node') {\n console.log(\"RECEIVED\")\n this.setState(prevState => ({\n msgs: [...prevState.msgs, \"RECEIVED SHARE FROM A CLIENT\"]\n }))\n return;\n }\n\n // Log out this simple message\n if (element === 'Sending Update to Client Node') {\n console.log(\"SENDING UPDATES\")\n this.setState(prevState => ({\n msgs: [...prevState.msgs, \"SENDING UPTDATE TO CLIENT NODES\"]\n }))\n return;\n }\n\n // Log out this simple message\n if (element === \"Got Share\") {\n console.log(\"RECEIVED2\")\n this.setState(prevState => ({\n msgs: [...prevState.msgs, \"ALTERNATIVE SHARE RECEIVED\"]\n }))\n return\n }\n\n // If message doesn't match any of the previous \n // patterns, log it out too \n this.setState(prevState => ({\n msgs: [...prevState.msgs, \"MESSAGE: \" + element]\n }))\n });\n }", "title": "" }, { "docid": "dde033bd86dc2dc651ba657d43005eb6", "score": "0.5319277", "text": "nodeAttrsToState() {\n const nodenames = getNodeNamesFromNetwork(this.props.network);\n const\n node_centers = {},\n node_corners = {};\n\n for (const name of nodenames) {\n var node = this.myRefs[name].current;\n\n // node.center and node.corners are set in Node.render()\n node_centers[name] = node.center;\n node_corners[name] = node.corners;\n }\n\n this.setState({\n first_pass_complete: true,\n node_centers,\n node_corners,\n });\n }", "title": "" }, { "docid": "7e48658368cc91fcae09370c31af45fe", "score": "0.53163725", "text": "function changeName() {\n // makes an array of selected nodes. Only want first, hence selectedNode[0]\n var selectedNode = network.getSelectedNodes();\n if (selectedNode.length > 0) {\n var newName = document.getElementById(\"nodeName\").value; // retrieves the name from the input box\n nodes.update({id: selectedNode[0], label: newName}); // updates the data set\n var errorDisplayed = document.getElementById(\"noNodeSelected\").style.display;\n if (errorDisplayed == \"block\") {\n document.getElementById(\"noNodeSelected\").style.display = \"none\";\n }\n } else {\n var errorDisplayed = document.getElementById(\"noNodeSelected\").style.display;\n if (errorDisplayed == \"none\") {\n document.getElementById(\"noNodeSelected\").style.display = \"block\";\n }\n }\n}", "title": "" }, { "docid": "91cf006426abea99bc2da648fc0a7d59", "score": "0.5314977", "text": "function initializeDisplay() {\n\n link = inner.append(\"g\")\n .selectAll(\"line\")\n .data(graph.links)\n .enter()\n .append(\"line\")\n .attr(\"class\", function(d) {\n return d[typename] + \" link \" + \" \" +\n d[\"source_dept\"].replace(/\\s+/g, '') + \" \" +\n d[\"target_dept\"].replace(/\\s+/g, '');\n })\n .attr(\"stroke-width\", function(d) {\n return link_size*d.articlesbycouple;\n })\n .style(\"stroke\", linkcolor)\n .on(\"click\", function(d) {\n SelectDeselect(selected_nodes, selected_links, this, true);\n return show_tooltip_link(d, div2, true);\n })\n .on(\"mouseover\", function(d) {\n d3.select(this).style(\"stroke\", selected_color);\n return show_tooltip_link(d, div2, false);\n })\n .on(\"mouseout\", function(d) {\n if (!selected_links.includes(this)) {\n d3.select(this).style(\"stroke\", linkcolor);\n }\n return hide_tooltip(div2);\n });\n\n\n node = inner.append(\"g\")\n .attr(\"class\", \"nodes\")\n .selectAll(\".node\")\n .data(graph.nodes)\n .enter().append(\"g\")\n .style(\"stroke\", \"white\").style(\"stroke-width\", node_border_size)\n .attr(\"class\", function(d) {\n return d[typename].replace(/\\s+/g, '') + \" node \" + d[colorname].replace(/\\s+/g, '');\n })\n .on(\"mouseover\", function(d) {\n d3.select(this).style(\"stroke-width\", selected_size).style(\"stroke\", selected_color);\n return show_tooltip_node(d, div, false);\n })\n .on(\"click\", function(d) {\n SelectDeselect(selected_links, selected_nodes, this, false)\n return show_tooltip_node(d, div, true);\n })\n .on(\"mouseout\", function(d) {\n if (!selected_nodes.includes(this)) {\n d3.select(this).style(\"stroke-width\", node_border_size).style(\"stroke\", linkcolor);\n }\n hide_tooltip(div);\n })\n .call(d3.drag()\n .on(\"start\", dragstarted)\n .on(\"drag\", dragged)\n .on(\"end\", dragended));\n\n for (var i = 0; i < Math.min(uniquetype.length, d3symbols.length); i++) {\n d3.selectAll(\".\" + uniquetype[i]).append(\"path\")\n .attr(\"d\", d3.symbol().type(d3symbols[i]).size(function(d) {\n if (scaletype == \"linear\") {\n return node_size * d.Number_of_articles;\n } else if (scaletype == \"log\") {\n return node_size * Math.log(d.Number_of_articles + 2);\n }\n }))\n .attr(\"class\", \"vertices\" + i);\n }\n\n for (var i = 0; i < uniquecolor.length; i++) {\n d3.selectAll(\".\" + uniquecolor[i]).style(\"fill\", \"#\" + mycolors[i]);\n }\n\n}", "title": "" }, { "docid": "f2c5c155f2e714011f977c966cb88d87", "score": "0.5304304", "text": "function getNodeInfo(d) {\n\t\t \tif (activatedNode) {\n\t\t \t\tcurrentNode = d; //Used in dragended function to push new node\n\t\t \t}\n\t\t }", "title": "" }, { "docid": "dd570e06c75b3371c4c2277da0228e42", "score": "0.5297093", "text": "function toggledisplay() {\n\t\tvar cknode = document.getElementById(\"tognode\").checked;\n\t\tvar ckweight = document.getElementById(\"togweight\").checked;\n\t\tvar ckedge = document.getElementById(\"togedge\").checked;\n\n\t\tif (cknode)\n\t\t\tsizetoggle = true; \n\t\telse\n\t\t\tsizetoggle = false;\n\n\t\tif (ckweight)\n\t\t\tweighttoggle = true;\n\t\telse\n\t\t\tweighttoggle = false;\n\n\t\tif (ckedge)\n\t\t\tedgetoggle = true;\n\t\telse\n\t\t\tedgetoggle = false;\n\t\t\n\t\tif (edgetoggle) {\n\t\t\td3.selectAll(\"line\")\n\t\t\t\t.style(\"display\", null);\n\t\t}\n\t\telse {\n\t\t\td3.selectAll(\"line\")\n\t\t\t\t.style(\"display\", \"none\");\n\t\t}\n\n\t\tif (weighttoggle) {\n\t\t\td3.selectAll(\"line\")\n\t\t\t\t.style(\"stroke-width\", function(d) { return Math.sqrt(d.edgeweight); });\n\t\t}\n\t\telse{\n\t\t\td3.selectAll(\"line\")\n\t\t\t\t.style(\"stroke-width\", 1);\t\t\n\t\t}\n\n\t\tif (sizetoggle) {\n\t\t\td3.selectAll(\"circle\")\n\t\t\t\t.attr(\"r\", function(d) { return nsize(d.seedcount); });\n\t\t}\n\t\telse {\n\t\t\td3.selectAll(\"circle\")\n\t\t\t\t.attr(\"r\", 3);\n\t\t}\t \t\t\n\t}", "title": "" }, { "docid": "155280a01741d0c62759cbab3a60e807", "score": "0.5292116", "text": "display() {\n if (this.top !== null) {\n let currNode = this.top;\n while (currNode !== null) {\n console.log(currNode.data);\n currNode = currNode.next;\n }\n }\n }", "title": "" }, { "docid": "8e6a9141e8bbf1df6e734a66aae229d7", "score": "0.5291046", "text": "function display(query) {\n state = (query.State && query.State !== \"all\")\n ? dom.datum()[query.State][query.Court]\n : null\n ;\n textbox.html(state ? state.description : content)\n var phase = dom.select(\"#locus\").selectAll(\"div\")\n .data(state ? state.values : [], identikey)\n ;\n // Enter Selection is unnecessary\n // Update Selection\n phase.each(function(p) {\n var li = d3.select(this).selectAll(\"li\")\n .data(p.values, identikey)\n ;\n // Enter selection is unnecessary here as well\n li\n .attr(\"class\", function(d) {\n return slugify(d.key === \"Elections\"\n ? d.values[0].Type\n : d.key\n );\n })\n .classed(\"process\", true)\n ;\n li.select(\"span\")\n .classed(\"hilite\", true)\n .html(function(d) {\n if(d.values.length > 1) // assumes multiple election types\n return d.values\n .map(function(v) { return v.Type.split(' ')[0]; })\n .join(\", \")\n + \" \" + d.values[0].Process\n ;\n var ret = reference[\n d.values[0].Body\n || d.values[0].Type\n || d.values[0].Process\n ]\n ;\n return ret\n ? ret.Title\n : d.values[0].Type || d.values[0].Process\n ;\n })\n ;\n // Exit selection - clear out unused rows\n li.exit()\n .attr(\"class\", \"process\")\n .select(\"span\")\n .classed(\"hilite\", false)\n .html(identikey)\n ;\n })\n ;\n // Exit selection - clear out all rows\n phase.exit().each(function() {\n d3.select(this).selectAll(\"li\")\n .attr(\"class\", \"process\")\n .select(\"span\")\n .classed(\"hilite\", false)\n .html(identikey)\n ;\n })\n ;\n } // display()", "title": "" } ]
c74897037e709d4ee579a727a8df14fa
We depend on components having unique IDs
[ { "docid": "9674ec52d58306874db4274760ab8da1", "score": "0.55213773", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n} // $FlowFixMe", "title": "" } ]
[ { "docid": "a0e76c9655002e9894d32ef301ed6079", "score": "0.64277357", "text": "static getNextId() {\n return Component.nextId++;\n }", "title": "" }, { "docid": "f4dec12819e72419d5e7e8d392214144", "score": "0.63743424", "text": "static addToActiveComponents(component) {\n Component.active.push(component.id);\n }", "title": "" }, { "docid": "b0ef7ca85fa580bed42f439c732fedbb", "score": "0.63262737", "text": "_assignComponentElementIds () {\n this._assignToggleIds()\n this._assignChildMenuIds()\n }", "title": "" }, { "docid": "e6189bf5cc4561036f49422db34f84a7", "score": "0.62727547", "text": "function getUniqueID() {\n if (window.flareID === undefined) {\n window.flareID = 0;\n }\n window.flareID = window.flareID + 1;\n return \"flare-component-\" + window.flareID.toString();\n }", "title": "" }, { "docid": "e6189bf5cc4561036f49422db34f84a7", "score": "0.62727547", "text": "function getUniqueID() {\n if (window.flareID === undefined) {\n window.flareID = 0;\n }\n window.flareID = window.flareID + 1;\n return \"flare-component-\" + window.flareID.toString();\n }", "title": "" }, { "docid": "05e582cd5844e8469df519395c7bd355", "score": "0.6135387", "text": "function getComponentId(componentDef) {\n let hash = 0;\n // We cannot rely solely on the component selector as the same selector can be used in different\n // modules.\n //\n // `componentDef.style` is not used, due to it causing inconsistencies. Ex: when server\n // component styles has no sourcemaps and browsers do.\n //\n // Example:\n // https://github.com/angular/components/blob/d9f82c8f95309e77a6d82fd574c65871e91354c2/src/material/core/option/option.ts#L248\n // https://github.com/angular/components/blob/285f46dc2b4c5b127d356cb7c4714b221f03ce50/src/material/legacy-core/option/option.ts#L32\n const hashSelectors = [\n componentDef.selectors,\n componentDef.ngContentSelectors,\n componentDef.hostVars,\n componentDef.hostAttrs,\n componentDef.consts,\n componentDef.vars,\n componentDef.decls,\n componentDef.encapsulation,\n componentDef.standalone,\n componentDef.signals,\n componentDef.exportAs,\n JSON.stringify(componentDef.inputs),\n JSON.stringify(componentDef.outputs),\n // We cannot use 'componentDef.type.name' as the name of the symbol will change and will not\n // match in the server and browser bundles.\n Object.getOwnPropertyNames(componentDef.type.prototype),\n !!componentDef.contentQueries,\n !!componentDef.viewQuery,\n ].join('|');\n for (const char of hashSelectors) {\n hash = Math.imul(31, hash) + char.charCodeAt(0) << 0;\n }\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n const compId = 'c' + hash;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (GENERATED_COMP_IDS.has(compId)) {\n const previousCompDefType = GENERATED_COMP_IDS.get(compId);\n if (previousCompDefType !== componentDef.type) {\n console.warn(formatRuntimeError(-912 /* RuntimeErrorCode.COMPONENT_ID_COLLISION */, `Component ID generation collision detected. Components '${previousCompDefType.name}' and '${componentDef.type.name}' with selector '${stringifyCSSSelectorList(componentDef\n .selectors)}' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID.`));\n }\n }\n else {\n GENERATED_COMP_IDS.set(compId, componentDef.type);\n }\n }\n return compId;\n}", "title": "" }, { "docid": "7952f6f888a6a7a7ff3ed7a6b0045648", "score": "0.6045976", "text": "registerComponent(component) {\n // check if that component is already registered\n const registered = this.vues.filter((comp) => comp.name === component.name);\n if (registered.length > 0) {\n registered[0].ids.push(component.ids[0]);\n } else {\n this.vues.push(component);\n }\n }", "title": "" }, { "docid": "c624d6fb5bc41ee6eeaced0af68ac389", "score": "0.6032081", "text": "function useSlotId() {\n let [id, setId] = (0, _react.useState)(useId());\n (0, _react.useLayoutEffect)(() => {\n let setCurr = $f8b5fdd96fb429d7102983f777c41307$var$map.get(id);\n\n if (setCurr && !document.getElementById(id)) {\n setId(null);\n }\n }, [id]);\n return id;\n}", "title": "" }, { "docid": "3149740a40c64fe3053ea5def7cb80f4", "score": "0.60267407", "text": "get componentId() {\n\t\treturn this._componentId;\n\t}", "title": "" }, { "docid": "6411bc243c59fd7c72baaf6d0566f801", "score": "0.60207015", "text": "updateComponentId(id, updateScopeOnly = false) {\n const newIdString = id.toString();\n const similarIds = this.findSimilarIds(id, true);\n\n if (!similarIds.length) {\n _logger().default.debug(`bit-map: no need to update ${newIdString}`);\n\n return id;\n }\n\n if (similarIds.length > 1) {\n throw new (_showDoctorError().default)(`Your ${_constants().BIT_MAP} file has more than one version of ${id.toStringWithoutScopeAndVersion()} and they\n are authored or imported. This scenario is not supported`);\n }\n\n const oldId = similarIds[0];\n const oldIdStr = oldId.toString();\n const newId = updateScopeOnly ? oldId.changeScope(id.scope) : id;\n\n if (newId.isEqual(oldId)) {\n _logger().default.debug(`bit-map: no need to update ${oldIdStr}`);\n\n return oldId;\n }\n\n _logger().default.debug(`BitMap: updating an older component ${oldIdStr} with a newer component ${newId.toString()}`);\n\n const componentMap = this.getComponent(oldId);\n\n if (componentMap.origin === _constants().COMPONENT_ORIGINS.NESTED) {\n throw new Error('updateComponentId should not manipulate Nested components');\n }\n\n if (this.workspaceLane && !updateScopeOnly) {\n // this code is executed when snapping/tagging and user is on a lane.\n // change the version only on the lane, not on .bitmap\n this.workspaceLane.addEntry(newId);\n componentMap.defaultVersion = componentMap.defaultVersion || oldId.version;\n }\n\n this._removeFromComponentsArray(oldId);\n\n this.setComponent(newId, componentMap);\n this.markAsChanged();\n this.updatedIds[oldIdStr] = componentMap;\n return newId;\n }", "title": "" }, { "docid": "d75a4b5a71d848290824193dec066049", "score": "0.591675", "text": "$_elementId() { \n \treturn key => this.component.id ? (this.component.id + ( key || '' )) : null \n }", "title": "" }, { "docid": "addd18b00f6f97fc7ed21b638646e3fa", "score": "0.57957435", "text": "getComponentForOid(oid) {\n const oids = this.oids;\n return oid && oids && oids[oid];\n }", "title": "" }, { "docid": "b128325fbed0664939c80adaa3c96a95", "score": "0.5768607", "text": "getUniqueId() {\n const candidateIds = _.range(this.store.panelState.length + 1);\n const currentIds = this.store.edgeIdList();\n return _.difference(candidateIds, currentIds).sort()[0];\n }", "title": "" }, { "docid": "a4a033e0d958b59cefc3ac46fa3a0226", "score": "0.5745613", "text": "function TestComponent(id){\r\n this.id = id;\r\n}", "title": "" }, { "docid": "ba633268a38f2302cc7dcb0da5ff99c0", "score": "0.57414097", "text": "static doUpdate(componentId, content) {\n // TODO: implement this by listening for DOM mutation events instead (don't scan every time)\n var components = Component.scan();\n var instances = components.get(componentId)\n\n switch (instances) {\n case undefined:\n console.warn(\"[Presto] Ignoring request to update unknown componentId: \" + componentId);\n break;\n default:\n for (var instanceId of components.get(componentId)) {\n var decorated = `<div class=\"presto-component-instance\" id=\"${instanceId}\">` + content + '</div>'\n var targetNode = $(`div.presto-component-instance#${instanceId}`)[0];\n morphdom(targetNode, decorated);\n }\n }\n }", "title": "" }, { "docid": "dfe4996b030a4bfede3fb45bad3dd91e", "score": "0.5691072", "text": "addComponents(){\r\n\r\n\t\tlet argument;\r\n\r\n\t\tfor (let i = 0; i < arguments.length; ++i){\r\n\t\t\tconsole.log(1);\r\n\t\t\tif(!(arguments[i] instanceof Component)) throw \"Entity: addComponent(): InvalidArgumentsException\";\r\n\r\n\t\t\tthis.components[arguments[i].identification] = arguments[i];\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "807f4515a0344c31e391541f4c2aba3f", "score": "0.5679895", "text": "function getIdFromComponentAndSetDataForFormDataChangeValidate() {\r\n arrayIdForFormDataChangeValidation = getIdFromComponentForFormDataChangeValidation();\r\n mapForFormDataChangeValidation = setDataForFormDataChangeValidation(arrayIdForFormDataChangeValidation);\r\n}", "title": "" }, { "docid": "e205e89609268b87517f246ca9f0df49", "score": "0.5663423", "text": "function generateNextComponentTypeId() {\n\tvar assignId = this._nextComponentTypeId;\n\tthis._nextComponentTypeId++;\n\treturn assignId;\n}", "title": "" }, { "docid": "e49a6b324c1deb013eb5bd3992ea3689", "score": "0.56526035", "text": "generateDivId() {\n let uuid = this.uuid();\n return uuid.replace(/-/g, '');\n }", "title": "" }, { "docid": "315be0ca8ce4a3366902d9efa8c21fed", "score": "0.5644828", "text": "modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n component = util.clone(component);\n component.value = (component.value === id ? '_:a' : '_:z');\n return component;\n }", "title": "" }, { "docid": "315be0ca8ce4a3366902d9efa8c21fed", "score": "0.5644828", "text": "modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n component = util.clone(component);\n component.value = (component.value === id ? '_:a' : '_:z');\n return component;\n }", "title": "" }, { "docid": "315be0ca8ce4a3366902d9efa8c21fed", "score": "0.5644828", "text": "modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n component = util.clone(component);\n component.value = (component.value === id ? '_:a' : '_:z');\n return component;\n }", "title": "" }, { "docid": "315be0ca8ce4a3366902d9efa8c21fed", "score": "0.5644828", "text": "modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n component = util.clone(component);\n component.value = (component.value === id ? '_:a' : '_:z');\n return component;\n }", "title": "" }, { "docid": "2bf35c87ba8ae4554ba0525ef0097fd9", "score": "0.5611448", "text": "function mapGeneratorIdToComponent(\n deviceId: string,\n generatorId: number | string,\n key: number\n): * {\n /* */\n const id = parseInt(generatorId, 10);\n switch (id) {\n case 3:\n return (<CoilControl key={key} deviceId={deviceId} />);\n case 5:\n return (<DriveBot key={key} deviceId={deviceId} />);\n default:\n console.log('mapGeneratorIdToComponent', generatorId);\n return '';\n }\n}", "title": "" }, { "docid": "e87435fd32075fb169b6b736a69e698f", "score": "0.5602225", "text": "itemIdsInContextJurisdictionForComponent(component) {\n let itemIds = [];\n for(let handler of this.handlersForArea(component.area)) {\n if(handler.contextRequestHandler) {\n var itemInContext = handler.contextRequestHandler(component);\n if(itemInContext) {\n itemIds.push(itemInContext.uuid);\n }\n }\n }\n\n return itemIds;\n }", "title": "" }, { "docid": "f8f3c6e3b624356a86b0ae57af64b05b", "score": "0.5589641", "text": "getUniqueId() {\n const candidateIds = _.range(this.store.panelState.length + 1);\n const currentIds = this.store.nodeIdList();\n return _.difference(candidateIds, currentIds).sort((a, b) => a - b)[0];\n }", "title": "" }, { "docid": "076ef3cfbaf2042917718ff7eb2e6504", "score": "0.557675", "text": "modifyFirstDegreeComponent(id, component, key) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n component = util.clone(component);\n if(key === 'name') {\n component.value = '_:g';\n } else {\n component.value = (component.value === id ? '_:a' : '_:z');\n }\n return component;\n }", "title": "" }, { "docid": "076ef3cfbaf2042917718ff7eb2e6504", "score": "0.557675", "text": "modifyFirstDegreeComponent(id, component, key) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n component = util.clone(component);\n if(key === 'name') {\n component.value = '_:g';\n } else {\n component.value = (component.value === id ? '_:a' : '_:z');\n }\n return component;\n }", "title": "" }, { "docid": "076ef3cfbaf2042917718ff7eb2e6504", "score": "0.557675", "text": "modifyFirstDegreeComponent(id, component, key) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n component = util.clone(component);\n if(key === 'name') {\n component.value = '_:g';\n } else {\n component.value = (component.value === id ? '_:a' : '_:z');\n }\n return component;\n }", "title": "" }, { "docid": "076ef3cfbaf2042917718ff7eb2e6504", "score": "0.557675", "text": "modifyFirstDegreeComponent(id, component, key) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n component = util.clone(component);\n if(key === 'name') {\n component.value = '_:g';\n } else {\n component.value = (component.value === id ? '_:a' : '_:z');\n }\n return component;\n }", "title": "" }, { "docid": "a57ba4b1ca5a4821049f63192bfc2043", "score": "0.55710626", "text": "function defineId() {\n _id = _dom.mainInput.id;\n if (!_id) {\n _id = (\"i\" + Math.round(Math.random() * 100000));\n _dom.mainInput.id = _id;\n }\n }", "title": "" }, { "docid": "b08c1d7a5db1af756ce90652d1314b13", "score": "0.555436", "text": "function generateId(_ComponentStyle: Function, _displayName: string, parentComponentId: string) {\n const displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n const nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n const componentId = `${displayName}-${_ComponentStyle.generateName(displayName + nr)}`;\n\n return parentComponentId ? `${parentComponentId}-${componentId}` : componentId;\n}", "title": "" }, { "docid": "115f65daffbd13be6d385b1d3688bb9a", "score": "0.5543666", "text": "function filterComponents() {\n vm.addModel.componentIds = [];\n setComponentDataSource();\n }", "title": "" }, { "docid": "e961c227598c4f20c1b7c430a5a93acc", "score": "0.5528063", "text": "function reAddComponents(components) {\n _.each(components, function(n) {\n var id = n.id;\n var feature = featureEngine.findFeature($(n).attr('wiggi-wiz-feature-name'));\n if (_.contains(mutationHandler.removedNodes, id)) {\n if (feature.reAddNode) {\n feature.reAddNode($(n));\n }\n mutationHandler.nodeReAdded(id);\n }\n });\n }", "title": "" }, { "docid": "39896a19a6d5d8d5bc04dc7d68820a59", "score": "0.55090344", "text": "function replaceIdsAlreadyInLayout(state, layoutToInsert) {\n console.log(`replaceIdsAlreadyInLayout(element: ${layoutToInsert.id}, elementType: ${layoutToInsert.type})`)\n\n // Create a hash of all the element IDs already in use\n let ids = getCurrentlyUsedIds(state)\n // console.log(`ids=`, ids)\n\n // Recursively look at every element and it's children,\n // replacing element Ids that are already used.\n let recurse = (element) => {\n // console.log(` - check element ${element.id}`)\n let initialId = element.id\n while (ids[element.id]) {\n element.id = Math.floor(Math.random() * 10000000000)\n console.log(` replacing id of element ${initialId} (${element.type}) -> ${element.id}`)\n }\n if (element.children) {\n element.children.forEach(child => recurse(child))\n }\n }\n\n // Check, from the top down.\n recurse(layoutToInsert)\n}", "title": "" }, { "docid": "055054ec8a2d998b809528e2feaa9d40", "score": "0.5500017", "text": "function getUniqueId () {\n return UNIQUE_ID++\n}", "title": "" }, { "docid": "281521cd63afcd7e23f2ea9568961dbd", "score": "0.5496988", "text": "update(){\r\n\t\t\r\n\t\tfor(let componentIdentification in this.components)\r\n\t\t\tthis.components[componentIdentification].update();\r\n\t}", "title": "" }, { "docid": "0ab9e6507f453406acd6e1fc7669055b", "score": "0.54944587", "text": "getUniqueId (prefix) {\n\t\tif ( !this._uniqueIdIndex ) {\n\t\t\tthis._uniqueIdIndex = 0;\n\t\t}\n\t\tif (this._reactInternalInstance && this._reactInternalInstance._rootNodeID) {\n\t\t\tprefix = (prefix || \"\") + this._reactInternalInstance._rootNodeID + \"_\";\n\t\t}\n\t\treturn prefix + this._uniqueIdIndex++;\n\t}", "title": "" }, { "docid": "adec94b55c05c1a365fe9e7bdbcb7829", "score": "0.5491497", "text": "getComponent(bitId, {\n ignoreVersion = false,\n ignoreScopeAndVersion = false\n } = {}) {\n const existingBitId = this.getBitId(bitId, {\n ignoreVersion,\n ignoreScopeAndVersion\n });\n return this.components.find(c => c.id.isEqual(existingBitId));\n }", "title": "" }, { "docid": "728368427f2748ae83905c339d4d8784", "score": "0.5491494", "text": "setupId() {\n if (this.elt.hasAttribute('id')) {\n let elt_id = this.elt.getAttribute('id');\n if (elt_id.trim() !== '') {\n this.id = elt_id;\n } else {\n this.elt.setAttribute('id', this.id);\n }\n } else {\n this.elt.setAttribute('id', this.id);\n }\n }", "title": "" }, { "docid": "59ee54986df913719853aaab9c5271df", "score": "0.5489915", "text": "function uniqueId() {\n\treturn \"id-\" + idCounter++;\n}", "title": "" }, { "docid": "700672e93222c6b3d397c53cc8728337", "score": "0.5475101", "text": "function check_unique_ids(graph,c_errors,c_overlays, model_component){\n let feature_root = graph.getModel().getCell(\"feature\"); \n let childs = graph.getModel().getChildVertices(feature_root);\n let names = [];\n let result = \"\";\n\n //navigates through the feature model childs\n for (let i = 0; i < childs.length; i++) {\n let label = childs[i].getAttribute(\"label\");\n if (names.indexOf(label) > -1) {\n result+=\"Duplicated feature ID - \" + label + \"\\n\";\n let overlay = new mxCellOverlay(new mxImage('images/MX/error.gif', 16, 16), 'Overlay tooltip', 'right', 'top');\n graph.addCellOverlay(childs[i], overlay);\n c_errors.push(childs[i]);\n c_overlays.push(overlay);\n }else{\n names.push(label);\n }\n }\n\n if(result!=\"\"){\n alert(result);\n }else{\n alert(\"No errors found\");\n }\n return result;\n }", "title": "" }, { "docid": "6b30d25885ac544f082ddba46b2a807f", "score": "0.54556", "text": "function createElIds () {\n // squares on the board\n for (var i = 0; i < COLUMNS.length; i++) {\n for (var j = 1; j <= 8; j++) {\n var square = COLUMNS[i] + j\r\n squareElsIds[square] = square + '-' + uuid()\n }\r\n }\r\n\r\n // spare pieces\n var pieces = 'KQRNBP'.split('')\n for (i = 0; i < pieces.length; i++) {\n var whitePiece = 'w' + pieces[i]\r\n var blackPiece = 'b' + pieces[i]\r\n sparePiecesElsIds[whitePiece] = whitePiece + '-' + uuid()\n sparePiecesElsIds[blackPiece] = blackPiece + '-' + uuid()\n }\r\n }", "title": "" }, { "docid": "4943c6f3f16fdb5710b1a195f182e029", "score": "0.544588", "text": "function genComponent(componentName, el, state) {\n\t var children = el.inlineTemplate ? null : genChildren(el, state, true);\n\t return \"_c(\".concat(componentName, \",\").concat(genData(el, state)).concat(children ? \",\".concat(children) : '', \")\");\n\t}", "title": "" }, { "docid": "3857a8bcd173bda300fbb55e0c7e2cdd", "score": "0.54347533", "text": "function updateIDs(hs) {\n for (var i = 0; i < hs.getRowHeader().length; i++) {\n hs.getSourceData()[i].id = i + 1\n }\n //hs.render()\n}", "title": "" }, { "docid": "bdd5292a8c6a23c363186ea2a7f5cd70", "score": "0.54135144", "text": "get _id() {\n if (!this.__id) {\n this.__id = `ui5wc_${++autoId}`;\n }\n\n return this.__id;\n }", "title": "" }, { "docid": "c59f4a4798173150525e66ec030470d6", "score": "0.5413208", "text": "_initId() {\n this._id = Model.baseId;\n Model.baseId += 1;\n }", "title": "" }, { "docid": "13ed37a7da819b44949d2d9ff8cd166d", "score": "0.539307", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n\t var displayName = typeof _displayName !== 'string' ? 'sc' : escape$1(_displayName);\n\n\t /**\n\t * This ensures uniqueness if two components happen to share\n\t * the same displayName.\n\t */\n\t var nr = (identifiers[displayName] || 0) + 1;\n\t identifiers[displayName] = nr;\n\n\t var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n\t return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n\t}", "title": "" }, { "docid": "03138ffc61852e3307ebcba6961d421f", "score": "0.5387177", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n }", "title": "" }, { "docid": "9683632dc7799e4cd066b4b465db362a", "score": "0.53753644", "text": "_id() {\n return this._chip.id(this._bus);\n }", "title": "" }, { "docid": "b1d40f3d485f7dacff2b688e90472375", "score": "0.5370668", "text": "function addUniqueClass(component) {\n if (component.attributes['style-identifier'] === undefined) {\n component.attributes['style-identifier'] = generateId();\n }\n component.addClass(component.attributes['style-identifier']);\n }", "title": "" }, { "docid": "5389a86b8931ebeee2d6ddd3464586a2", "score": "0.5363328", "text": "static setActiveComponent(component) {\n Component.active = [component.id];\n Edge.activeEdges = [];\n }", "title": "" }, { "docid": "759dcf2fa21737211060806e2c4839ae", "score": "0.53601635", "text": "GetComponents() {}", "title": "" }, { "docid": "759dcf2fa21737211060806e2c4839ae", "score": "0.53601635", "text": "GetComponents() {}", "title": "" }, { "docid": "759dcf2fa21737211060806e2c4839ae", "score": "0.53601635", "text": "GetComponents() {}", "title": "" }, { "docid": "759dcf2fa21737211060806e2c4839ae", "score": "0.53601635", "text": "GetComponents() {}", "title": "" }, { "docid": "759dcf2fa21737211060806e2c4839ae", "score": "0.53601635", "text": "GetComponents() {}", "title": "" }, { "docid": "759dcf2fa21737211060806e2c4839ae", "score": "0.53601635", "text": "GetComponents() {}", "title": "" }, { "docid": "759dcf2fa21737211060806e2c4839ae", "score": "0.53601635", "text": "GetComponents() {}", "title": "" }, { "docid": "1fcb5f03bbcc29fe56b6de97689c3740", "score": "0.5353881", "text": "function useId(idFromProps) {\n /*\n * If this instance isn't part of the initial render, we don't have to do the\n * double render/patch-up dance. We can just generate the ID and return it.\n */\n var initialId = idFromProps || (serverHandoffComplete ? genId() : null);\n\n var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useState\"])(initialId),\n id = _React$useState[0],\n setId = _React$useState[1];\n\n Object(_reach_utils__WEBPACK_IMPORTED_MODULE_1__[\"useIsomorphicLayoutEffect\"])(function () {\n if (id === null) {\n /*\n * Patch the ID after render. We do this in `useLayoutEffect` to avoid any\n * rendering flicker, though it'll make the first render slower (unlikely\n * to matter, but you're welcome to measure your app and let us know if\n * it's a problem).\n */\n setId(genId());\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, []);\n Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(function () {\n if (serverHandoffComplete === false) {\n /*\n * Flag all future uses of `useId` to skip the update dance. This is in\n * `useEffect` because it goes after `useLayoutEffect`, ensuring we don't\n * accidentally bail out of the patch-up dance prematurely.\n */\n serverHandoffComplete = true;\n }\n }, []);\n return id != null ? String(id) : undefined;\n}", "title": "" }, { "docid": "d89e0581554f122ce33b6cb00c7ea1b9", "score": "0.53526604", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n }", "title": "" }, { "docid": "d89e0581554f122ce33b6cb00c7ea1b9", "score": "0.53526604", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n }", "title": "" }, { "docid": "d89e0581554f122ce33b6cb00c7ea1b9", "score": "0.53526604", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n }", "title": "" }, { "docid": "d89e0581554f122ce33b6cb00c7ea1b9", "score": "0.53526604", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n }", "title": "" }, { "docid": "6d04f1d890cdfeed58b8597978761e81", "score": "0.5349696", "text": "generateId() {\n const newId = `ev-${EventManager.nextId}`;\n EventManager.nextId++;\n return newId;\n }", "title": "" }, { "docid": "0ad161aebaf4ca29ef3794ecdbacf3a8", "score": "0.53496516", "text": "_setSourceIds() {\n this.getSourceElements().forEach((source) => {\n source.id = this.id + source.type.split('/')[1];\n });\n }", "title": "" }, { "docid": "467a1f4f5494c884591939b676e85586", "score": "0.53433394", "text": "render() {\n return <div id={this.props.container} />;\n }", "title": "" }, { "docid": "ff353667b54457341508aedc671b8df0", "score": "0.5343125", "text": "function set_id (component_reference, idname)\n {\n component_reference.style.idName = idname;\n }", "title": "" }, { "docid": "448ce7c60ae2cb06587107964ef6b4a3", "score": "0.5342372", "text": "componentDidMount() {\n let randomId;\n\n // to fetch a random product, uncomment this\n //randomId = this.randomProductId();\n\n // to fetch a complete product for demonstration purposes\n // uncomment this for IDs: PERF001, PERF002, PERF003, PERF004\n randomId = 'PERF00' + Math.floor(1 + Math.random() * 4);\n\n this.fetchProduct(randomId);\n\n // Below is a list of product IDs that look partiticularly good\n // EF4974, BD7633, EE8862, FY0728, G27707, EE7161, FX8003, EH0249, FV3743; EH0249;\n // this.fetchProduct('FV3642'); // FV3743\n }", "title": "" }, { "docid": "ca2937c003ddd3e5feddd01c9da3a59e", "score": "0.5338989", "text": "function cacheComponents() {\n }", "title": "" }, { "docid": "c2e65d469de49bd6f2f2ddd7d50512a7", "score": "0.53273636", "text": "onProcessRawComponents(rawComponents) {\n\n // Process the raw data and store it inside _components.\n rawComponents.forEach(function(component) {\n var componentID = component.id;\n\n _components[componentID] = {\n id: componentID,\n name: component.name,\n html: component.html,\n css: component.css,\n js: component.js,\n docs: component.docs\n };\n }, this);\n\n // Assign the current active component. In the app, we want to know which component is being active so we can assign the \"is-active\" class as well as display data that belong to only that component.\n if(!_currentComponentID) {\n // Process _components object and convert it into an array then assign the first index / element to be active.\n var sortedList = this.getSortedList();\n _currentComponentID = sortedList[0].id;\n }\n\n // Emit change event to re-render the View\n this.trigger();\n }", "title": "" }, { "docid": "5bd4db1269da551792a6c602d8e5e670", "score": "0.531806", "text": "function computeID(container, value) {\n return container.id + \"$$$$double-list-select$$$$\" + value;\n }", "title": "" }, { "docid": "0f83427eae483cf5421c0d697f8cca32", "score": "0.5309669", "text": "drawComponents() {\r\n let me = this;\r\n this.moduleController.activeModule.components.forEach((component) => {\r\n let location = me.selectionController.getScreenCoords(component.bounds);\r\n component.paint(me.graphics, location);\r\n\r\n // draw components connectors\r\n component.connectors.forEach((connector) => {\r\n let connLocScreen = me.selectionController.getScreenCoords(connector.bounds);\r\n connector.paint(me.graphics, connLocScreen);\r\n });\r\n \r\n });\r\n }", "title": "" }, { "docid": "b5aa80c643dd8c7235e1c03142494add", "score": "0.53055626", "text": "updateChartId() {\n var currentTime = new Date().getTime().toString();\n var randomInt = this.getRandomInt(0, currentTime);\n this.chartId = `div_${randomInt}`;\n }", "title": "" }, { "docid": "a3920f3833d48430c48cfc89a0916560", "score": "0.5303341", "text": "_assignToggleIds () {\n this.childMenuToggleButtons.forEach(toggle => {\n Component.setAttributeIfNotSpecified(toggle, this.toggleAttribute, Component.generateUniqueId())\n })\n }", "title": "" }, { "docid": "5917ec39d635cb23f1e7a12414774adf", "score": "0.5301493", "text": "modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n /* Note: A mistake in the URDNA2015 spec that made its way into\n implementations (and therefore must stay to avoid interop breakage)\n resulted in an assigned canonical ID, if available for\n `component.value`, not being used in place of `_:a`/`_:z`, so\n we don't use it here. */\n return {\n termType: 'BlankNode',\n value: component.value === id ? '_:a' : '_:z'\n };\n }", "title": "" }, { "docid": "5917ec39d635cb23f1e7a12414774adf", "score": "0.5301493", "text": "modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n /* Note: A mistake in the URDNA2015 spec that made its way into\n implementations (and therefore must stay to avoid interop breakage)\n resulted in an assigned canonical ID, if available for\n `component.value`, not being used in place of `_:a`/`_:z`, so\n we don't use it here. */\n return {\n termType: 'BlankNode',\n value: component.value === id ? '_:a' : '_:z'\n };\n }", "title": "" }, { "docid": "5917ec39d635cb23f1e7a12414774adf", "score": "0.5301493", "text": "modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n /* Note: A mistake in the URDNA2015 spec that made its way into\n implementations (and therefore must stay to avoid interop breakage)\n resulted in an assigned canonical ID, if available for\n `component.value`, not being used in place of `_:a`/`_:z`, so\n we don't use it here. */\n return {\n termType: 'BlankNode',\n value: component.value === id ? '_:a' : '_:z'\n };\n }", "title": "" }, { "docid": "d223393ff50a5f26b1ba749343369245", "score": "0.5301204", "text": "function getCurrentlyUsedIds(state) {\n // console.log(`getCurrentlyUsedIds()`)\n // Recursive through the layout hierarchy, remembering the ids\n let hash = [ ] // id -> true\n let recurse = (element) => {\n // console.log(` - ${element.id}`)\n hash[element.id] = true\n if (element.children) {\n element.children.forEach(child => recurse(child))\n }\n }\n recurse(state.layout)\n return hash\n}", "title": "" }, { "docid": "96e8bbafaa88deff3173803e2ad36e96", "score": "0.530084", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\".concat(componentName, \",\").concat(genData(el, state)).concat(children ? \",\".concat(children) : '', \")\");\n}", "title": "" }, { "docid": "aec42164860217145c0bdce835a20bf8", "score": "0.52980405", "text": "function genComponent (componentName, el) {\r\n\t var children = el.inlineTemplate ? null : genChildren(el, true);\r\n\t return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\r\n\t}", "title": "" }, { "docid": "6e2ee4a157e91b63ffed4db0f30cafce", "score": "0.5297357", "text": "function useId(prefix, providedId) {\n // getId should only be called once since it updates the global constant for the next ID value.\n // (While an extra update isn't likely to cause problems in practice, it's better to avoid it.)\n var ref = react__WEBPACK_IMPORTED_MODULE_0__[\"useRef\"](providedId);\n if (!ref.current) {\n ref.current = Object(_uifabric_utilities_lib_getId__WEBPACK_IMPORTED_MODULE_1__[\"getId\"])(prefix);\n }\n return ref.current;\n}", "title": "" }, { "docid": "915bc807743298df4968a361b1fc4502", "score": "0.52829725", "text": "handleClick(id, model) {\n model.addSymbol(id);\n ReactDOM.render(<Component size = {model.getSize()} controller = {this} model = {model}/>, document.getElementById('content'));\n }", "title": "" }, { "docid": "1a8f9742dce298867a76871b65563fc7", "score": "0.5280333", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n}", "title": "" }, { "docid": "1a8f9742dce298867a76871b65563fc7", "score": "0.5280333", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n}", "title": "" }, { "docid": "1a8f9742dce298867a76871b65563fc7", "score": "0.5280333", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n}", "title": "" }, { "docid": "1a8f9742dce298867a76871b65563fc7", "score": "0.5280333", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n}", "title": "" }, { "docid": "7d5385cd6ba1bba085e6aed536bf529b", "score": "0.527123", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = \"string\" != typeof _displayName ? \"sc\" : escape(_displayName), nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n var componentId = displayName + \"-\" + _ComponentStyle.generateName(displayName + nr);\n return parentComponentId ? parentComponentId + \"-\" + componentId : componentId;\n }", "title": "" }, { "docid": "88f9a9ac418566bfc657b8653117124f", "score": "0.5270621", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}", "title": "" }, { "docid": "88f9a9ac418566bfc657b8653117124f", "score": "0.5270621", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}", "title": "" }, { "docid": "88f9a9ac418566bfc657b8653117124f", "score": "0.5270621", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}", "title": "" }, { "docid": "88f9a9ac418566bfc657b8653117124f", "score": "0.5270621", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}", "title": "" }, { "docid": "88f9a9ac418566bfc657b8653117124f", "score": "0.5270621", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}", "title": "" }, { "docid": "88f9a9ac418566bfc657b8653117124f", "score": "0.5270621", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}", "title": "" }, { "docid": "88f9a9ac418566bfc657b8653117124f", "score": "0.5270621", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}", "title": "" }, { "docid": "88f9a9ac418566bfc657b8653117124f", "score": "0.5270621", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}", "title": "" }, { "docid": "88f9a9ac418566bfc657b8653117124f", "score": "0.5270621", "text": "function generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}", "title": "" } ]
bf1d5f1fdae69597bc5a97bcfeef5de6
Does the supplied node implement the CSS class?
[ { "docid": "c9118569d1a15f1ff2b39512c0d813fc", "score": "0.6146617", "text": "function _hasClass(a_node, clazz) {\n return a_node.className.match(_classRegex(clazz));\n }", "title": "" } ]
[ { "docid": "a312892d0468946a6027b3a302ad5568", "score": "0.67465436", "text": "function HasClass(node, class_name)\r\n{\r\n\tvar classes = (node && node.className) ? node.className.split(\" \") : [];\r\n\tfor (var i = 0; i < classes.length; i++)\r\n\t\tif (classes[i] == class_name)\r\n\t\t\treturn true;\r\n\treturn false;\r\n}", "title": "" }, { "docid": "046b12ef84e2073ff09eea7107f024f5", "score": "0.66718024", "text": "function is(node) {\n return !!node && browser_1.SelectableTreeNode.is(node) && 'iconClass' in node;\n }", "title": "" }, { "docid": "71b3d2b8ef061fe91a43db3dd6c8a07c", "score": "0.6488548", "text": "function hasClass(node, className) {\r\n\t\tvar result = false;\r\n\t\tif (node.classList) {\r\n\t\t\tif(node.classList.contains(className)) {\r\n\t\t\t\tresult = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "title": "" }, { "docid": "8c6335db50643f49f3a4e361e32e6bcc", "score": "0.64586055", "text": "function isMatchingCssSelector(node, css) {\n if (css.id.match(/^\\./)) {\n // Check to see if we match the class\n return (node.className && member(node.className.split(/\\s+/),\n css.id.substring(1)));\n } else {\n return (node.id && node.id === css.id);\n }\n }", "title": "" }, { "docid": "8c6335db50643f49f3a4e361e32e6bcc", "score": "0.64586055", "text": "function isMatchingCssSelector(node, css) {\n if (css.id.match(/^\\./)) {\n // Check to see if we match the class\n return (node.className && member(node.className.split(/\\s+/),\n css.id.substring(1)));\n } else {\n return (node.id && node.id === css.id);\n }\n }", "title": "" }, { "docid": "8c6335db50643f49f3a4e361e32e6bcc", "score": "0.64586055", "text": "function isMatchingCssSelector(node, css) {\n if (css.id.match(/^\\./)) {\n // Check to see if we match the class\n return (node.className && member(node.className.split(/\\s+/),\n css.id.substring(1)));\n } else {\n return (node.id && node.id === css.id);\n }\n }", "title": "" }, { "docid": "8c6335db50643f49f3a4e361e32e6bcc", "score": "0.64586055", "text": "function isMatchingCssSelector(node, css) {\n if (css.id.match(/^\\./)) {\n // Check to see if we match the class\n return (node.className && member(node.className.split(/\\s+/),\n css.id.substring(1)));\n } else {\n return (node.id && node.id === css.id);\n }\n }", "title": "" }, { "docid": "fcf9632ef5e2519fa10a39672f38faba", "score": "0.64579374", "text": "function hasClass(node, className) {\n if (node.className) {\n return node.className.match(\n new RegExp('(\\\\s|^)' + className + '(\\\\s|$)'));\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "6413d4cd7f7c31b4979da1e6d6d20fac", "score": "0.6378617", "text": "function nodeHasBinings ( node ) { \r\n\treturn node.getAttribute ? node.getAttribute(\"data-class\") : false;\r\n}", "title": "" }, { "docid": "ad1cd50240c3d790a080081688c3abed", "score": "0.6370919", "text": "function isNode(node) {\n return node instanceof Node;\n }", "title": "" }, { "docid": "f58a07adec705c5e529e5a428724ad79", "score": "0.63551724", "text": "function hasClass(node, className) {\n if (node.className) {\n \tvar classes = getClassList(node);\n \tif (classes) return (indexOf(className, classes) >= 0);\n \treturn false;\n }\n}", "title": "" }, { "docid": "28c86ac6496191ca54c15cc034ad9a2a", "score": "0.6337925", "text": "function add_class(node, class_name) {\n if (node.classList.contains(class_name)) {\n return false;\n } else {\n node.classList.add(class_name);\n }\n}", "title": "" }, { "docid": "770bb3c6f990c71be8a6354efa6e7589", "score": "0.61929417", "text": "function hasClass(element, cls) {\n return element.classList.contains(cls);\n}", "title": "" }, { "docid": "8f962959a65ccf52f64f19e754df5946", "score": "0.6192462", "text": "function _isNode(o){\n\t\treturn (\n\t\t\ttypeof Node === 'object' ? o instanceof Node :\n\t\t\to && typeof o === 'object' && typeof o.nodeType === 'number' && typeof o.nodeName === 'string'\n\t\t);\n\t}", "title": "" }, { "docid": "ba2708f868189e85b86a160580b05a3a", "score": "0.6141519", "text": "function Ct(e){return Ns(e)&&3==e.nodeType}", "title": "" }, { "docid": "2e818e64c2c66129c06e0aa1ca218579", "score": "0.61190563", "text": "function isNode(input) {\n return isObject(input) && /^(1|3|11)$/.test(input.nodeType);\n}", "title": "" }, { "docid": "68f1197f6730cc93eed91079cb3c5d41", "score": "0.6031931", "text": "function isNode(o) {\n return (\n typeof Node === \"object\" ? o instanceof Node :\n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName === \"string\"\n );\n }", "title": "" }, { "docid": "68f1197f6730cc93eed91079cb3c5d41", "score": "0.6031931", "text": "function isNode(o) {\n return (\n typeof Node === \"object\" ? o instanceof Node :\n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName === \"string\"\n );\n }", "title": "" }, { "docid": "074fbc6dd50ff3233d5e2d234a791c78", "score": "0.6005236", "text": "function hasClass(e,t){return e.className&&new RegExp(\"(\\\\s|^)\"+t+\"(\\\\s|$)\").test(e.className)}", "title": "" }, { "docid": "4e0bb773820c3fc7b0913d3534adb861", "score": "0.60036033", "text": "function isNode(o) {\n return (\n typeof Node === \"object\" ? o instanceof Node :\n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName === \"string\"\n );\n}", "title": "" }, { "docid": "aa22fbcd272988d281ae73deb2bc977b", "score": "0.60011923", "text": "static isNode(o) {\n return (\n typeof Node === \"object\" ? o instanceof Node :\n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName === \"string\"\n );\n }", "title": "" }, { "docid": "82c7c66670012bad0d78d2c16e41a25a", "score": "0.5988697", "text": "function isNode(o) {\n return (\n typeof Node === \"object\" ? o instanceof Node :\n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName === \"string\"\n );\n }", "title": "" }, { "docid": "237b8f7852368836986a545f5fb4ed49", "score": "0.5988401", "text": "function isNode(o) {\n return (\n typeof Node === 'object' ? o instanceof Node\n : o && typeof o === 'object' && typeof o.nodeType === 'number' && typeof o.nodeName === 'string'\n );\n}", "title": "" }, { "docid": "2de71fa413686b4bbda4878248c741d8", "score": "0.59852475", "text": "function isElement(node) {\n return node.nodeType === 1;\n}", "title": "" }, { "docid": "0c24e5bfd91c50d4f87408550c397ec6", "score": "0.5983403", "text": "function hasClass(ele, cls) {\n return !!ele.className.match(new RegExp('(\\\\s|^)' + cls + '(\\\\s|$)'));\n}", "title": "" }, { "docid": "0d24f1b127e35d1f70c85d1c73a213e5", "score": "0.5980868", "text": "function isNode(o) {\n return (\n typeof Node === 'object' ? o instanceof Node :\n o && typeof o === 'object' && typeof o.nodeType === 'number' && typeof o.nodeName === 'string'\n );\n }", "title": "" }, { "docid": "95e6fb198f58add1681c8c779830c346", "score": "0.5980745", "text": "function isNode(o) {\n return (\n typeof Node === \"object\" ? o instanceof Node :\n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName === \"string\"\n );\n}", "title": "" }, { "docid": "5cb46847a7f2cc5ffe482efc41622221", "score": "0.59656674", "text": "function containsClass(targetNode, cClass) {\r\n\tif ((cClass == \"\") || (/\\s/.test(cClass))) return null;\r\n\tvar classList = getClassList(targetNode);\r\n\treturn (classList !== null) ? (classList.indexOf(cClass) != -1) : null;\r\n}", "title": "" }, { "docid": "5cb46847a7f2cc5ffe482efc41622221", "score": "0.59656674", "text": "function containsClass(targetNode, cClass) {\r\n\tif ((cClass == \"\") || (/\\s/.test(cClass))) return null;\r\n\tvar classList = getClassList(targetNode);\r\n\treturn (classList !== null) ? (classList.indexOf(cClass) != -1) : null;\r\n}", "title": "" }, { "docid": "72aab735fad08d444cb94af31a85f6f8", "score": "0.5946515", "text": "function hasClass(elm, cls) {\n var classes = elm.className.split(' ');\n for (var i = 0; i < classes.length; i++) {\n if (classes[i].toLowerCase() === cls.toLowerCase()) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "72aab735fad08d444cb94af31a85f6f8", "score": "0.5946515", "text": "function hasClass(elm, cls) {\n var classes = elm.className.split(' ');\n for (var i = 0; i < classes.length; i++) {\n if (classes[i].toLowerCase() === cls.toLowerCase()) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "65d3a041b769d4e96310cba08266fee7", "score": "0.59439874", "text": "function tryClassifyNode(node){if(ts.isJSDoc(node)){return true;}if(ts.nodeIsMissing(node)){return true;}var classifiedElementName=tryClassifyJsxElementName(node);if(!ts.isToken(node)&&node.kind!==11/* JsxText */&&classifiedElementName===undefined){return false;}var tokenStart=node.kind===11/* JsxText */?node.pos:classifyLeadingTriviaAndGetTokenStart(node);var tokenWidth=node.end-tokenStart;ts.Debug.assert(tokenWidth>=0);if(tokenWidth>0){var type=classifiedElementName||classifyTokenType(node.kind,node);if(type){pushClassification(tokenStart,tokenWidth,type);}}return true;}", "title": "" }, { "docid": "0a9a8de7944cc72fa6ebf899f868a8c8", "score": "0.59430563", "text": "function isNode(value)\n\t{\n\t\treturn value != null && typeof value === 'object' && typeof value.nodeType === 'number' &&\n\t\t\ttypeof value.nodeName === 'string' && typeof value.getAttribute === 'function';\n\t}", "title": "" }, { "docid": "36b4ede7f2de90f2d79814a9b18552b8", "score": "0.59166586", "text": "function hasClass (element, cls) {\n return (element.className.match(new RegExp('(\\\\s|^)'+ cls +'(\\\\s|$)')) !== null);\n}", "title": "" }, { "docid": "fbe25afa18ea47164752d6fb98a03dde", "score": "0.59160775", "text": "function hasClass(node, // @param Node:\r\n klass) { // @param JointString: \"class1 class2 ...\"\r\n // @return Boolean: true = has className\r\n var m, ary, cn = node.className;\r\n\r\n if (!klass || !cn) { return false; }\r\n\r\n ary = splitSpace(klass);\r\n if (ary.length > 1) {\r\n m = cn.match(_multiclass(ary));\r\n return m && m.length >= ary.length;\r\n }\r\n return (\" \" + cn + \" \").indexOf(\" \" + ary[0] + \" \") >= 0;\r\n}", "title": "" }, { "docid": "f9d23cbab025d653e4f81968bac5590b", "score": "0.5915921", "text": "function kindNode(node) {\n\t return node.getKind() == 1 /* NODE */;\n\t}", "title": "" }, { "docid": "716af97d9e3d3dc30d0cb8a68ca735be", "score": "0.5906393", "text": "function hasClass(ele,cls) {\n return ele.className.match(new RegExp('(\\\\s|^)'+cls+'(\\\\s|$)'));\n}", "title": "" }, { "docid": "25ac0e80a70d74bdceca2f3a8a6efd8a", "score": "0.58952403", "text": "function hasClass(elm, className) {\n return elm && elm.classList.contains(className);\n}", "title": "" }, { "docid": "1a9db6bd4fc94b189d018ec23a264f94", "score": "0.58944046", "text": "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "title": "" }, { "docid": "1a9db6bd4fc94b189d018ec23a264f94", "score": "0.58944046", "text": "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "title": "" }, { "docid": "9d07dbecde39318fabdd219a384c4190", "score": "0.5887521", "text": "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "title": "" }, { "docid": "2c9f23634829eb55a249cec705be1771", "score": "0.5884691", "text": "function hasClass(element, cls) {\n var r = new RegExp('\\\\b' + cls + '\\\\b');\n return r.test(element.className);\n }", "title": "" }, { "docid": "dbbafa9671bbd11f02afb7963f32c5c1", "score": "0.58821225", "text": "function hasClass( ele, class_name ) {\n\treturn ele.className.match( new RegExp( '(\\\\s|^)' + class_name + '(\\\\s|$)' ) );\n}", "title": "" }, { "docid": "79e5929c9f0628eba70d203ddb763415", "score": "0.58728135", "text": "function hasClass(ele,cls) {\n\treturn ele.className.match(new RegExp('(\\\\s|^)'+cls+'(\\\\s|$)'));\n}", "title": "" }, { "docid": "79e5929c9f0628eba70d203ddb763415", "score": "0.58728135", "text": "function hasClass(ele,cls) {\n\treturn ele.className.match(new RegExp('(\\\\s|^)'+cls+'(\\\\s|$)'));\n}", "title": "" }, { "docid": "a084fc37c0a0f653a8b0fd990b14ce25", "score": "0.58632606", "text": "function hasClass(element, name) {\n return element.classList.contains(name);\n}", "title": "" }, { "docid": "b47b104d47305063411eca4d97c33abe", "score": "0.5853913", "text": "function hasClass(ele,cls) {\n return ele.className.match(new RegExp('(\\\\s|^)'+cls+'(\\\\s|$)'));\n}", "title": "" }, { "docid": "a24069e6b707f93bfabf2f04fc89f774", "score": "0.5851295", "text": "hasClass(element, cls) {\n\t\treturn (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n\t}", "title": "" }, { "docid": "c9787de41c84f49fa318ff9108d9cb06", "score": "0.5845829", "text": "function treeHasClass(elm, className, stopAtElm) {\n while(elm != null && elm != stopAtElm) {\n if(elm.classList.contains(className)) {\n return true;\n }\n elm = elm.parentNode;\n }\n return false;\n }", "title": "" }, { "docid": "c2803a1daa9390266a41b057aa9962f3", "score": "0.58359456", "text": "function hasClass(tagName, cls) {\n\tvar element = document.getElementsByTagName(tagName)[0];\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "title": "" }, { "docid": "6bb094d6b9b027fbc15584d668e43be2", "score": "0.582851", "text": "function hasClass(element, className) {\n console.log(\"in hasClass\");\n return element.classList.contains(className);\n}", "title": "" }, { "docid": "43b12805c54d82464242491ba10a70e3", "score": "0.58232856", "text": "function hasClass($elem, className) {\n return $elem.classList.contains(className);\n}", "title": "" }, { "docid": "9eddfb04e22c3773aad454ed31d4c910", "score": "0.5815598", "text": "function isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "title": "" }, { "docid": "9eddfb04e22c3773aad454ed31d4c910", "score": "0.5815598", "text": "function isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "title": "" }, { "docid": "13721c98381a374aa6cce72185fcc910", "score": "0.58064973", "text": "function hasClass(element, class_name){\n\tvar classExpression = new RegExp(\" \" + class_name + \" \");\n return classExpression.test(\" \" + element.className + \" \");\n}", "title": "" }, { "docid": "244a22ed7e38d37b70ef1cba0a8614c6", "score": "0.5804436", "text": "function conteClass(element, nomClass) {\n return (' ' + element.classList + ' ').indexOf(' ' + nomClass + ' ') > -1;\n}", "title": "" }, { "docid": "d6ab7a660d33a85b1d772c5d688a8a00", "score": "0.5799566", "text": "function isElement$1(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "title": "" }, { "docid": "abe47a80fdf8d3d82605639dce9b0c4a", "score": "0.57951504", "text": "function isClass(c) {\n return typeof c === 'function' || // Standard\n c.prototype && c.prototype.constructor === c; // HTMLElement in WebKit\n}", "title": "" }, { "docid": "75cde0f78e6f5c632169660b0fd4d8f4", "score": "0.5782672", "text": "hasClass(className) { return (this.attrs.classes[className] === true); }", "title": "" }, { "docid": "6a2f7a5a159ea7bdf46496b3e61a474f", "score": "0.5779813", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "6a2f7a5a159ea7bdf46496b3e61a474f", "score": "0.5779813", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "6a2f7a5a159ea7bdf46496b3e61a474f", "score": "0.5779813", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "6a2f7a5a159ea7bdf46496b3e61a474f", "score": "0.5779813", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "6a2f7a5a159ea7bdf46496b3e61a474f", "score": "0.5779813", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "0c0172972bfe942f4819a1c8faf7ad43", "score": "0.57775915", "text": "function isHtmlNode(node) {\r\n var ns;\r\n return typeof (ns = node.namespaceURI) == UNDEF || (ns === null || ns == \"http://www.w3.org/1999/xhtml\");\r\n }", "title": "" }, { "docid": "5249dae96c3c54578a23c24fe9f210a5", "score": "0.5775531", "text": "function chkClass(element, elementClass){\n return element.className&&new RegExp(\"(?:^|\\\\s)\"+elementClass+\"(\\\\s|$)\").test(element.className);\n }", "title": "" }, { "docid": "f0a6f834b667aaa2b3c562def2e8d4e6", "score": "0.5771291", "text": "function isCssVisible(node) {\n var display = node.css('display');\n return !node.hasClass('ng-hide') && display != 'none';\n}", "title": "" }, { "docid": "7d3271603b4a6d6024bbdb39103a7633", "score": "0.57712567", "text": "function isRed(node) {\n if (node === null) return false;\n return node.color === RED;\n}", "title": "" }, { "docid": "bdb95239dd92000a7c1165fbe0d84aff", "score": "0.57662874", "text": "function conteClass(element, nomClass) {\n return (' ' + element.classList + ' ').indexOf(' ' + nomClass + ' ') > -1;\n }", "title": "" }, { "docid": "bdb95239dd92000a7c1165fbe0d84aff", "score": "0.57662874", "text": "function conteClass(element, nomClass) {\n return (' ' + element.classList + ' ').indexOf(' ' + nomClass + ' ') > -1;\n }", "title": "" }, { "docid": "ea0c05a39e28a18e535aed1f60f7e6c2", "score": "0.5755274", "text": "function hasSomeParentTheClass(el, cls) {\n if ((el) && (el.classList.contains(cls))) {\n return true;\n }\n return el.parentElement && hasSomeParentTheClass(el.parentElement, cls);\n}", "title": "" }, { "docid": "5978d125b9b155f231cef15a65a41699", "score": "0.57523453", "text": "function hasClass(className) {\n return documentElement.className.match(new RegExp(className, 'i'));\n}", "title": "" }, { "docid": "a82eae5251ef47cda5afc6700e310159", "score": "0.5751027", "text": "function hasClass(elt,classname,attrib){\n if (!(elt)) return;\n else if (typeof elt === 'string') {\n if (!(elt=document.getElementById(elt)))\n return;}\n var classinfo=((attrib) ? (elt.getAttribute(attrib)||\"\") :\n (elt.className));\n if ((typeof classinfo !== \"string\")||(classinfo===\"\")) return false;\n else if (classname===true) return true;\n else if (classinfo===classname) return true;\n else if (typeof classname === 'string')\n if (classinfo.indexOf(' ')<0) return false;\n else classname=classpats[classname]||classPat(classname);\n else {}\n if (classinfo.search(classname)>=0) return true;\n else return false;}", "title": "" }, { "docid": "3ae4f6d5da508a70904a0531660c1e4a", "score": "0.57483107", "text": "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "title": "" }, { "docid": "3ae4f6d5da508a70904a0531660c1e4a", "score": "0.57483107", "text": "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "title": "" }, { "docid": "3ae4f6d5da508a70904a0531660c1e4a", "score": "0.57483107", "text": "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "title": "" }, { "docid": "3ae4f6d5da508a70904a0531660c1e4a", "score": "0.57483107", "text": "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "title": "" }, { "docid": "3ae4f6d5da508a70904a0531660c1e4a", "score": "0.57483107", "text": "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "title": "" }, { "docid": "3ae4f6d5da508a70904a0531660c1e4a", "score": "0.57483107", "text": "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "title": "" }, { "docid": "13688f10aa2b7f9a975e996cea2b9fd1", "score": "0.57398015", "text": "isNode(value) {\n return Text.isText(value) || Element.isElement(value) || Editor.isEditor(value);\n }", "title": "" }, { "docid": "0c2fb30ef7d7ab1dedda5f75c7c801a7", "score": "0.57358044", "text": "function hasClass(obj) {\r\n var result = false;\r\n if (obj.getAttributeNode(\"class\") != null) {\r\n result = obj.getAttributeNode(\"class\").value;\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "acc5031f520c7dd869644dd6bcfa5ad1", "score": "0.57234186", "text": "function checkClass(elt, classList) {\n var classes = getCssClasses(elt);\n for (var _i = 0, classes_1 = classes; _i < classes_1.length; _i++) {\n var className = classes_1[_i];\n if (classList[className]) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3fa86f9c1555b09fd3d1d76cb2179300", "score": "0.57183087", "text": "function __action_hasClass(element) {\n // \n let val = false;\n\n if (element.classList.contains(className)) {\n val = true;\n }\n return val;\n }", "title": "" }, { "docid": "ef95f9198c5337929fd530c6f9a00451", "score": "0.5717315", "text": "hasClass(name) {\n\t\treturn this.el.classList.contains(name);\n\t}", "title": "" }, { "docid": "e42ef3a582fc046ca9cb9bc2177ad5a0", "score": "0.5702145", "text": "function hasClass(elem, className) {\r\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\r\n}", "title": "" }, { "docid": "73adb06c637d913bbc06de87d22cc0e6", "score": "0.56998014", "text": "function validNode(node) {\n return node && node.tagName;\n }", "title": "" }, { "docid": "6995d5f0e539d20f5d50b4eb922ed5ae", "score": "0.5697424", "text": "function isNode(obj) {\n return !!((typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? obj instanceof Node : obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string');\n}", "title": "" }, { "docid": "8102c3bc0dce48274705cecce3b4612b", "score": "0.56873673", "text": "function hasClass(obj) {\r\n\t var result = false;\r\n\t if (obj.getAttributeNode(\"class\") != null) {\r\n\t\t\t result = obj.getAttributeNode(\"class\").value;\r\n\t }\r\n\t return result;\r\n}", "title": "" }, { "docid": "c9d614e83b33c9e99e8ac875c30b3c70", "score": "0.5682395", "text": "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "title": "" }, { "docid": "69e5e336a5cd08ff13b0576379ce8791", "score": "0.56781876", "text": "function isText(node) {\n return node.nodeType === 3;\n}", "title": "" }, { "docid": "e01f43cfda589620f9d649166a54a356", "score": "0.56657857", "text": "function isExpanded(node) {\r\n return node.className == \"expanded\";\r\n}", "title": "" }, { "docid": "679221e71d4a041d8e9a74d09a1d348c", "score": "0.566396", "text": "async hasClass(name) {\n await this._stabilize();\n return this.element.classList.contains(name);\n }", "title": "" }, { "docid": "fa3dc127fe845d32037bf2c4dde6c1d8", "score": "0.5643177", "text": "function classChecker (node) {\n\t\t\n\t\t//get list of child nodes, convert from NodeList to Array\n\t\tvar nodeList = Array.prototype.slice.call(node.children);\n\n\t\t//iterate over child nodes (not sure why .filter() isn't working here)\n\t\tnodeList.forEach(function(branch){\n\t\t//test if className is present and pushing to output array if it is\n\t\t\tif(branch.classList.contains(className)){\n\t\t\t\toutput.push(branch);\n\t\t\t}\n\n\t\t//if the node has a child node, recurse (not sure why .hasChildNodes() isn't working here)\n\t\t\tif(branch.children){\n\t\t\t\tclassChecker(branch);\n\t\t\t}\n\t\t});\n\n\t}", "title": "" }, { "docid": "78090943cdb08181ffbba5e708b2585b", "score": "0.5640922", "text": "function hasSomeParentTheClass(element, classname) {\n if(element.className) {\n if (element.className.split(' ').indexOf(classname)>=0) return true;\n }\n return element.parentNode && hasSomeParentTheClass(element.parentNode, classname);\n }", "title": "" }, { "docid": "b98b8f5218b0f1547628bc00f62b3cb2", "score": "0.56311536", "text": "function hasClass(elem, className) {\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n}", "title": "" }, { "docid": "b98b8f5218b0f1547628bc00f62b3cb2", "score": "0.56311536", "text": "function hasClass(elem, className) {\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n}", "title": "" }, { "docid": "b98b8f5218b0f1547628bc00f62b3cb2", "score": "0.56311536", "text": "function hasClass(elem, className) {\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n}", "title": "" }, { "docid": "b853db9173e5d8276d54e06b1909022c", "score": "0.5627639", "text": "function $_class(theNode,theClass){\n\tif(typeof theNode==\"object\"){\n\t\tvar currentNode = theNode;\n\t\tcurrentNode.className=theClass;\n\t}else{\n\t\tvar currentNode = $(theNode);\n\t\tcurrentNode.className=theClass;\t\t\n\t}\n}", "title": "" }, { "docid": "5dffbcd87fb23b047e87b635bd877ff5", "score": "0.5625363", "text": "_isElement(obj) {\r\n return !!(obj && obj.nodeType == 1);\r\n }", "title": "" }, { "docid": "4e0a59dcda221e70ef9bf7d09b3264d7", "score": "0.5618601", "text": "static isNode(obj) {\n\t\treturn obj.type;\n\t}", "title": "" } ]
0c3808f1c9706847d12761eb78ba6415
replace a list of patterns/replacements on a word. if no match is made return the original token.
[ { "docid": "fb31750fff845779149cbb75fb022d3c", "score": "0.64511484", "text": "function replacePatterns(token, replacements, measureThreshold) {\n var result = attemptReplacePatterns(token, replacements, measureThreshold);\n token = result == null ? token : result;\n \n return token;\n}", "title": "" } ]
[ { "docid": "dbc0015b9a6b06ca1e0dda5177d63f67", "score": "0.6339688", "text": "function replacePatterns(token, replacements, measureThreshold) {\n return attemptReplacePatterns(token, replacements, measureThreshold) || token;\n }", "title": "" }, { "docid": "3aec7d571c20c963e77e78794bbf1ba3", "score": "0.61580634", "text": "function step2(token) {\n return replacePatterns(token, [['ational', 'ate'], ['tional', 'tion'], ['enci', 'ence'], ['anci', 'ance'],\n ['izer', 'ize'], ['abli', 'able'], ['alli', 'al'], ['entli', 'ent'], ['eli', 'e'],\n ['ousli', 'ous'], ['ization', 'ize'], ['ation', 'ate'], ['ator', 'ate'],['alism', 'al'],\n ['iveness', 'ive'], ['fulness', 'ful'], ['ousness', 'ous'], ['aliti', 'al'],\n ['iviti', 'ive'], ['biliti', 'ble']], 0);\n}", "title": "" }, { "docid": "3aec7d571c20c963e77e78794bbf1ba3", "score": "0.61580634", "text": "function step2(token) {\n return replacePatterns(token, [['ational', 'ate'], ['tional', 'tion'], ['enci', 'ence'], ['anci', 'ance'],\n ['izer', 'ize'], ['abli', 'able'], ['alli', 'al'], ['entli', 'ent'], ['eli', 'e'],\n ['ousli', 'ous'], ['ization', 'ize'], ['ation', 'ate'], ['ator', 'ate'],['alism', 'al'],\n ['iveness', 'ive'], ['fulness', 'ful'], ['ousness', 'ous'], ['aliti', 'al'],\n ['iviti', 'ive'], ['biliti', 'ble']], 0);\n}", "title": "" }, { "docid": "eaf8354aa703890eda72e6a167c29203", "score": "0.6100108", "text": "function step3(token) {\n return replacePatterns(token, [['icate', 'ic'], ['ative', ''], ['alize', 'al'],\n\t\t\t\t ['iciti', 'ic'], ['ical', 'ic'], ['ful', ''], ['ness', '']], 0); \n}", "title": "" }, { "docid": "eaf8354aa703890eda72e6a167c29203", "score": "0.6100108", "text": "function step3(token) {\n return replacePatterns(token, [['icate', 'ic'], ['ative', ''], ['alize', 'al'],\n\t\t\t\t ['iciti', 'ic'], ['ical', 'ic'], ['ful', ''], ['ness', '']], 0); \n}", "title": "" }, { "docid": "c82e3be7deb36770e23f2d6456e83144", "score": "0.6067381", "text": "function attemptReplace(token, pattern, replacement, callback) {\n var result = null;\n \n if((typeof pattern == 'string') && token.substr(0 - pattern.length) == pattern)\n result = token.replace(new RegExp(pattern + '$'), replacement);\n else if((pattern instanceof RegExp) && token.match(pattern))\n result = token.replace(pattern, replacement);\n \n if(result && callback)\n return callback(result);\n else\n return result;\n }", "title": "" }, { "docid": "2dc0a9c269239f6c77c5e8bee69f94f8", "score": "0.597939", "text": "function step4(token) {\n return replacePatterns(token, [['al', ''], ['ance', ''], ['ence', ''], ['er', ''], \n ['ic', ''], ['able', ''], ['ible', ''], ['ant', ''],\n ['ement', ''], ['ment', ''], ['ent', ''], [/([st])ion/, '$1'], ['ou', ''], ['ism', ''],\n ['ate', ''], ['iti', ''], ['ous', ''], ['ive', ''], \n ['ize', '']], 1);\n}", "title": "" }, { "docid": "2dc0a9c269239f6c77c5e8bee69f94f8", "score": "0.597939", "text": "function step4(token) {\n return replacePatterns(token, [['al', ''], ['ance', ''], ['ence', ''], ['er', ''], \n ['ic', ''], ['able', ''], ['ible', ''], ['ant', ''],\n ['ement', ''], ['ment', ''], ['ent', ''], [/([st])ion/, '$1'], ['ou', ''], ['ism', ''],\n ['ate', ''], ['iti', ''], ['ous', ''], ['ive', ''], \n ['ize', '']], 1);\n}", "title": "" }, { "docid": "bd650e4d3dba7df10cebfce7bb3da626", "score": "0.59553605", "text": "function step2(token) {\n token = replacePatterns(token, [['ational', '', 'ate'], ['tional', '', 'tion'], ['enci', '', 'ence'], ['anci', '', 'ance'],\n ['izer', '', 'ize'], ['abli', '', 'able'], ['bli', '', 'ble'], ['alli', '', 'al'], ['entli', '', 'ent'], ['eli', '', 'e'],\n ['ousli', '', 'ous'], ['ization', '', 'ize'], ['ation', '', 'ate'], ['ator', '', 'ate'],['alism', '', 'al'],\n ['iveness', '', 'ive'], ['fulness', '', 'ful'], ['ousness', '', 'ous'], ['aliti', '', 'al'],\n ['iviti', '', 'ive'], ['biliti', '', 'ble'], ['logi', '', 'log']], 0);\n\n return token;\n }", "title": "" }, { "docid": "08579e3fa6c7ed2ae124a3d305c035ce", "score": "0.5943348", "text": "function replaceWords(input){\n\t\n\tvar wordsForReplacement = [];\n\twordsForReplacement[\"yo\"] = \"tu\";\n\twordsForReplacement[\"tu\"] = \"yo\";\n\twordsForReplacement[\"mi\"] = \"tu\";\n\twordsForReplacement[\"mis\"] = \"tuyos\";\n\twordsForReplacement[\"soy\"] = \"eres\";\n\twordsForReplacement[\"eres\"] = \"soy\";\n\twordsForReplacement[\"fui\"] = \"fueron\";\n\twordsForReplacement[\"yo no\"] = \"tu no\";\n\twordsForReplacement[\"yo tengo\"] = \"tu tienes\";\n\twordsForReplacement[\"yo tendre\"] = \"tu tendras\";\n\twordsForReplacement[\"usted tiene\"] = \"yo tengo\";\n\twordsForReplacement[\"tu tendrás\"] = \"yo tendre\";\n\twordsForReplacement[\"tuyo\"] = \"mio\";\n\twordsForReplacement[\"tuyos\"] = \"mios\";\n\twordsForReplacement[\"mi\"] = \"tu\";\n\t//Added in after testing\n\twordsForReplacement[\"siempre estuvo\"] = \"siempre tuvo\";\n\t\n\t\n\tvar inputSplit = input.split(\" \");\n\n\t//Was having an overrite issue\n\tvar newSplit = [];\n\tfor(var i = 0;i < inputSplit.length;i++){\n\t\tvar currentInputWord = inputSplit[i];\n\t\tif(currentInputWord in wordsForReplacement){\n\t\t\tvar replacementWord = wordsForReplacement[currentInputWord];\n\t\t\tnewSplit[i] = replacementWord;\n\n\t\t\t//I had a dream about my dog.\n\t\t}else{\n\t\t\tnewSplit[i] = currentInputWord;\n\t\t}\n\t}\n\n\tvar updatedMessage = \"\";\n\tfor(var i = 0;i < newSplit.length;i++){\n\t\tvar word = newSplit[i];\n\t\tif(updatedMessage != \"\"){\n\t\t\tupdatedMessage += \" \";\n\t\t}\n\t\tupdatedMessage += word;\n\t}\n\n\treturn updatedMessage;\n}", "title": "" }, { "docid": "102c11ca814d25499e8dc4194c0fa721", "score": "0.58864397", "text": "function replaceAll(phrase,word,replacement){ \r\n while(phrase.indexOf(word) >= 0){\r\n phrase = phrase.replace(word,replacement);\r\n }\r\n return phrase;\r\n}", "title": "" }, { "docid": "d57d1b984346b897a149b99fae31305c", "score": "0.58353126", "text": "function step3(token) {\n return replacePatterns(token, [['icate', '', 'ic'], ['ative', '', ''], ['alize', '', 'al'],\n \t\t\t\t ['iciti', '', 'ic'], ['ical', '', 'ic'], ['ful', '', ''], ['ness', '', '']], 0);\n }", "title": "" }, { "docid": "33856c06b313d13cdffdef2478efbac3", "score": "0.5814576", "text": "function attemptReplacePatterns(token, replacements, measureThreshold) {\n var replacement = token;\n\n for(var i = 0; i < replacements.length; i++) { \n \tif(measureThreshold == null || measure(attemptReplace(token, replacements[i][0], replacements[i][1])) > measureThreshold) {\n \t replacement = attemptReplace(replacement, replacements[i][0], replacements[i][2]) || replacement;\n }\n }\n \n return replacement;\n }", "title": "" }, { "docid": "276a68de6bfc9bc841631b0f6d66c279", "score": "0.5810101", "text": "function attemptReplace(token, pattern, replacement, callback) {\n var result = null;\n \n if((typeof pattern == 'string') && token.substr(0 - pattern.length) == pattern)\n result = token.replace(new RegExp(pattern + '$'), replacement);\n else if((pattern instanceof RegExp) && token.match(pattern))\n result = token.replace(pattern, replacement);\n \n if(result && callback)\n return callback(result);\n else\n return result;\n}", "title": "" }, { "docid": "276a68de6bfc9bc841631b0f6d66c279", "score": "0.5810101", "text": "function attemptReplace(token, pattern, replacement, callback) {\n var result = null;\n \n if((typeof pattern == 'string') && token.substr(0 - pattern.length) == pattern)\n result = token.replace(new RegExp(pattern + '$'), replacement);\n else if((pattern instanceof RegExp) && token.match(pattern))\n result = token.replace(pattern, replacement);\n \n if(result && callback)\n return callback(result);\n else\n return result;\n}", "title": "" }, { "docid": "e3810b18d7bd25e9ec9579f29f3a9942", "score": "0.5740038", "text": "function strawberryVsBananas(speech) {\nspeech = speech.replace(/strawberry/g, \"banana\");\nspeech = speech.replace(/Strawberry/g, \"Banana\");\nspeech = speech.replace(/strawberries/g, \"bananas\");\nspeech = speech.replace(/Strawberries/g, \"Bananas\"); \nreturn speech;\n}", "title": "" }, { "docid": "8826135ac1c78dad5a769179d04dc835", "score": "0.5691265", "text": "function attemptReplacePatterns(token, replacements, measureThreshold) {\n var replacement = null;\n\n for(var i = 0; i < replacements.length; i++) {\n\tif(measureThreshold == null || measure(attemptReplace(token, replacements[i][0], '')) > measureThreshold)\n\t replacement = attemptReplace(token, replacements[i][0], replacements[i][1]);\n\n\tif(replacement)\n\t break;\n }\n \n return replacement;\n}", "title": "" }, { "docid": "8826135ac1c78dad5a769179d04dc835", "score": "0.5691265", "text": "function attemptReplacePatterns(token, replacements, measureThreshold) {\n var replacement = null;\n\n for(var i = 0; i < replacements.length; i++) {\n\tif(measureThreshold == null || measure(attemptReplace(token, replacements[i][0], '')) > measureThreshold)\n\t replacement = attemptReplace(token, replacements[i][0], replacements[i][1]);\n\n\tif(replacement)\n\t break;\n }\n \n return replacement;\n}", "title": "" }, { "docid": "0fb827e2475839a4116729915bce2300", "score": "0.56165767", "text": "function replaceWord(word1, word2, cb) {\n var element = document.createElement('span'); //create an element to embed\n element.className = \"sneakyWord\"; //identify the new element\n\n $(element).attr('data-toggle', 'popover');\n $(element).attr('data-trigger', 'focus');\n $(element).attr('data-container', 'body');\n $(element).attr('data-placement', 'auto top');\n $(element).attr('data-html', 'true');\n $(element).attr('EWord', word1);\n $(element).attr('SWord', word2);\n \n if (highlight == 1) {\n $(element).attr('style', 'color: black; background-color: yellow');\n }\n\n var qString = \"\\\\b\" + word1 + \"\\\\b\"; //'//b' is to omit embedded words (like rather and other for the)\n var findMe = new RegExp(qString, \"g\"); //make regex\n \n var body = document.body;\n findAndReplaceDOMText(body, { //replace\n find: findMe,\n\n replace: word2,\n\n wrap: element\n });\n \n// var qString2 = \"\\\\b\" + word1.charAt(0).toUpperCase() + word1.slice(1) + \"\\\\b\";\n// var findMe2 = new RegExp(qString2, \"g\"); //make regex\n// findAndReplaceDOMText(body, { //replace\n// find: findMe2,\n//\n// replace: word2,\n//\n// wrap: element\n// });\n cb();\n}", "title": "" }, { "docid": "8a2b6d1475c234bde2e1725651dba619", "score": "0.5601851", "text": "function step3$1(token) {\n var r1 = getR1(token);\n\n if (!r1)\n return token;\n\n var r1Match = r1.match(/(leg|eleg|ig|eig|lig|elig|els|lov|elov|slov|hetslov)$/);\n\n if (r1Match) {\n return token.replace(new RegExp(r1Match[1] + '$'), '');\n }\n\n return token;\n }", "title": "" }, { "docid": "1de21bc32e8e1cf344cc7c2f334ad83b", "score": "0.55763435", "text": "function step3(token) {\n var r1 = getR1(token);\n\n if (!r1)\n return token;\n\n var r1Match = r1.match(/(leg|eleg|ig|eig|lig|elig|els|lov|elov|slov|hetslov)$/);\n\n if (r1Match) {\n return token.replace(new RegExp(r1Match[1] + '$'), '');\n }\n\n return token;\n}", "title": "" }, { "docid": "1de21bc32e8e1cf344cc7c2f334ad83b", "score": "0.55763435", "text": "function step3(token) {\n var r1 = getR1(token);\n\n if (!r1)\n return token;\n\n var r1Match = r1.match(/(leg|eleg|ig|eig|lig|elig|els|lov|elov|slov|hetslov)$/);\n\n if (r1Match) {\n return token.replace(new RegExp(r1Match[1] + '$'), '');\n }\n\n return token;\n}", "title": "" }, { "docid": "61b07097d7e2e35baccec0b0996d727a", "score": "0.55544275", "text": "function replaceWords(wordlist, n) {\r\n var index = 0;\r\n index += parseInt(Math.random()*n);\r\n while(index < wordlist.length) {\r\n var replacement = tryGetReplace(wordlist[index]);\r\n //var replacement = wordlist[index].concat(\"ttt\");\r\n if(replacement) {\r\n wordlist[index] = replacement;\r\n index += parseInt(Math.random()*1.5*n);\r\n }\r\n else {\r\n index += 1;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "61b07097d7e2e35baccec0b0996d727a", "score": "0.55544275", "text": "function replaceWords(wordlist, n) {\r\n var index = 0;\r\n index += parseInt(Math.random()*n);\r\n while(index < wordlist.length) {\r\n var replacement = tryGetReplace(wordlist[index]);\r\n //var replacement = wordlist[index].concat(\"ttt\");\r\n if(replacement) {\r\n wordlist[index] = replacement;\r\n index += parseInt(Math.random()*1.5*n);\r\n }\r\n else {\r\n index += 1;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "4ab718e14be051b5c7ecbd9745677e1b", "score": "0.54603267", "text": "function step4(token) {\n return replaceRegex(token, /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/, [1], 1) || \n replaceRegex(token, /^(.+?)(s|t)(ion)$/, [1, 2], 1) ||\n token; \n }", "title": "" }, { "docid": "8a18aa0571564c4d089ae22cd42fd460", "score": "0.5402581", "text": "function multipleReplace(text, wordDict) {\n for (var key in wordDict) {\n text = text.replace(key.split('_').join(' '), wordDict[key]);\n }\n bt.value = text;\n}", "title": "" }, { "docid": "fc393bce7c0eb963b84a10be06af8871", "score": "0.53987247", "text": "function censor() {\n toReplace = {}\n wrapped = (...args) => {\n if (args.length > 1) {\n toReplace[args[0]] = args[1]\n } else {\n phrase = args[0]\n for (k in toReplace) {\n oldPhrase = ''\n while (oldPhrase != phrase) {\n oldPhrase = phrase\n phrase = phrase.replace(k, toReplace[k])\n }\n }\n return phrase\n }\n }\n return wrapped\n}", "title": "" }, { "docid": "569f1d89787b6f1f80ee4b6718d0220b", "score": "0.53608006", "text": "function ApplyRule(inword, r)\n{\n var outword = \"\";\n var t = rul[r].replace('\\u2192', \"/\");\n var thisrule = t.split(\"/\");\n var i = 0;\n\n while (i <= inword.length && inword.charAt(i) != '\\u2023') {\n if (Match(inword, i, thisrule[0], thisrule[2])) {\n\n var tgt = thisrule[0];\n var repl = thisrule[1];\n\n if (thisrule.length > 3) {\n // There's an exception\n var slix = thisrule[3].indexOf('_');\n if (slix != -1) {\n var tgix = gix;\n var tglen = glen;\n var tgcat = gcat;\n\n // How far before _ do we check?\n var brackets = false;\n var precount = 0;\n for (var k = 0; k < slix; k++) {\n switch (thisrule[3].charAt(k)) {\n case '[':\n brackets = true;\n break;\n case ']':\n brackets = false;\n precount++;\n break;\n case '#':\n break;\n default:\n if (!brackets) precount++;\n }\n }\n\n if (gix - precount >= 0 &&\n Match(inword, gix - precount,\n thisrule[0], thisrule[3])) {\n s += rul[r] + \" almost applied to \"\n + inword + \" at \" + i + \"<br>\";\n i++;\n continue;\n }\n gix = tgix;\n glen = tglen;\n gcat = tgcat;\n }\n }\n\n if (printRules) {\n s += rul[r] + \" applies to \"\n + inword + \" at \" + i + \"<br>\";\n }\n outword = inword.substr(0, gix);\n\n if (repl.length > 0) {\n if (repl == \"\\\\\\\\\") {\n var found = inword.substr(gix,glen);\n outword += reverse(found);\n } else if (gcat != -1) {\n outword += CatSub(repl);\n } else {\n outword += repl;\n }\n }\n gix += glen;\n i = outword.length;\n\n if (tgt.length == 0) i++;\n\n outword += inword.substr(gix, inword.length - gix);\n\n inword = outword;\n } else {\n i++;\n }\n }\n\n if (outword != \"\")\n return outword;\n else\n return inword;\n}", "title": "" }, { "docid": "3b6458179cdf2babf3537c8dd4a1fab5", "score": "0.5345564", "text": "function atgCommon_substituteToken(originalString, substitutionString, substitutionToken) {\n var newString = null;\n var regExp = eval(\"/\"+substitutionToken+\"/gi\");\n newString = originalString.replace(regExp, substitutionString);\n return newString;\n}", "title": "" }, { "docid": "261b646a922817d07fd101992110125f", "score": "0.53205085", "text": "function parseWord() {\n skipWhite();\n for (var word = []; /\\w/.exec(cur()); word.push(eat()));\n return word.join(\"\");\n }", "title": "" }, { "docid": "174db62182c57805aebeec80c85aa29f", "score": "0.53021306", "text": "function Transform(inword)\n{\n if (inword.length > 0) {\n // Try out each rule in turn\n for (r = 0; r < nrul; r++) {\n inword = ApplyRule(inword, r);\n }\n }\n\n return inword;\n}", "title": "" }, { "docid": "9b960e35b334c5886d44a05f28f60df5", "score": "0.52690727", "text": "function censor (wordToChange, wordToReplace){\n\n for(i = 0; i < arrayOfWords.length; i++){\n if(arrayOfWords[i] === wordToChange){\n arrayOfWords[i] = wordToReplace;\n return arrayOfWords\n \n }\n }\n console.log(arrayOfWords)\n \n }", "title": "" }, { "docid": "a8afc834cd73df333b1c5ebfcf160ad4", "score": "0.5197326", "text": "replaceSingleKeyWords(combatWords) {\n let outputString = this.outputString;\n combatWords = \"*\";\n this.outputString += combatWords;\n }", "title": "" }, { "docid": "58fcf8e7b8ff4b8820336cc6de79bf5d", "score": "0.5195556", "text": "function highlight_words(word) {\n if(word) {\n var textNodes;\n word = word.replace(/\\W/g, '');\n var str = word.split(\" \");\n $(str).each(function() {\n var term = this;\n var textNodes = $('*').contents().filter(\n function() { return this.nodeType === 3 });\n textNodes.each(function() {\n var content = $(this).text();\n var regex = new RegExp(term, \"gi\");\n content = content.replace(regex,\n '<span class=\"cs-highlight\">' + term + '</span>');\n $(this).replaceWith(content);\n });\n });\n }\n}", "title": "" }, { "docid": "3520922cf7c1f15c9baa7557098acb73", "score": "0.51452667", "text": "replaceKeyWords(combatWords) {\n let outputString = this.outputString;\n combatWords = this.asterisk;\n this.outputString += combatWords;\n }", "title": "" }, { "docid": "16c40dc77493e5c850609cc698b8f07a", "score": "0.51443666", "text": "function aardvark(word) {\n let varadkar = word.nodeValue;\n varadkar = varadkar.replace(/Varadkar/ig, \"Aardvark\");\n word.nodeValue = varadkar;\n}", "title": "" }, { "docid": "0e289011a2e4726bde497306fd695dab", "score": "0.5135905", "text": "function replace(r, replacedPattern, replacement) {\r\n\tvar pattern = new RegExp(replacedPattern, 'g');\r\n\tvar match;\r\n\twhile ((match = pattern.exec(r.toString())) !== null) {\r\n\t\tvar start = match.index;\r\n\t\tvar text = match[0];\r\n\t\tvar end = start + text.length;\r\n\t\tr.del(start, text.length);\r\n\t\tr.insert(start, replacement);\r\n\t}\r\n}", "title": "" }, { "docid": "4465142e2ae9d131782aefa17c9a2bbf", "score": "0.5128495", "text": "function replace_x_with(body, x, y) {\n\tvar re = new RegExp(x, 'g');\n\tvar temp = body;\n\treturn temp.replace(re, y);\n}", "title": "" }, { "docid": "a270c151d006534866eb2244a1915922", "score": "0.5114194", "text": "match(word) {\n if (this.pattern.length == 0)\n return [0];\n if (word.length < this.pattern.length)\n return null;\n let { chars, folded, any, precise, byWord } = this;\n // For single-character queries, only match when they occur right\n // at the start\n if (chars.length == 1) {\n let first = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_1__.codePointAt)(word, 0), firstSize = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_1__.codePointSize)(first);\n let score = firstSize == word.length ? 0 : -100 /* Penalty.NotFull */;\n if (first == chars[0]) ;\n else if (first == folded[0])\n score += -200 /* Penalty.CaseFold */;\n else\n return null;\n return [score, 0, firstSize];\n }\n let direct = word.indexOf(this.pattern);\n if (direct == 0)\n return [word.length == this.pattern.length ? 0 : -100 /* Penalty.NotFull */, 0, this.pattern.length];\n let len = chars.length, anyTo = 0;\n if (direct < 0) {\n for (let i = 0, e = Math.min(word.length, 200); i < e && anyTo < len;) {\n let next = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_1__.codePointAt)(word, i);\n if (next == chars[anyTo] || next == folded[anyTo])\n any[anyTo++] = i;\n i += (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_1__.codePointSize)(next);\n }\n // No match, exit immediately\n if (anyTo < len)\n return null;\n }\n // This tracks the extent of the precise (non-folded, not\n // necessarily adjacent) match\n let preciseTo = 0;\n // Tracks whether there is a match that hits only characters that\n // appear to be starting words. `byWordFolded` is set to true when\n // a case folded character is encountered in such a match\n let byWordTo = 0, byWordFolded = false;\n // If we've found a partial adjacent match, these track its state\n let adjacentTo = 0, adjacentStart = -1, adjacentEnd = -1;\n let hasLower = /[a-z]/.test(word), wordAdjacent = true;\n // Go over the option's text, scanning for the various kinds of matches\n for (let i = 0, e = Math.min(word.length, 200), prevType = 0 /* Tp.NonWord */; i < e && byWordTo < len;) {\n let next = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_1__.codePointAt)(word, i);\n if (direct < 0) {\n if (preciseTo < len && next == chars[preciseTo])\n precise[preciseTo++] = i;\n if (adjacentTo < len) {\n if (next == chars[adjacentTo] || next == folded[adjacentTo]) {\n if (adjacentTo == 0)\n adjacentStart = i;\n adjacentEnd = i + 1;\n adjacentTo++;\n }\n else {\n adjacentTo = 0;\n }\n }\n }\n let ch, type = next < 0xff\n ? (next >= 48 && next <= 57 || next >= 97 && next <= 122 ? 2 /* Tp.Lower */ : next >= 65 && next <= 90 ? 1 /* Tp.Upper */ : 0 /* Tp.NonWord */)\n : ((ch = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_1__.fromCodePoint)(next)) != ch.toLowerCase() ? 1 /* Tp.Upper */ : ch != ch.toUpperCase() ? 2 /* Tp.Lower */ : 0 /* Tp.NonWord */);\n if (!i || type == 1 /* Tp.Upper */ && hasLower || prevType == 0 /* Tp.NonWord */ && type != 0 /* Tp.NonWord */) {\n if (chars[byWordTo] == next || (folded[byWordTo] == next && (byWordFolded = true)))\n byWord[byWordTo++] = i;\n else if (byWord.length)\n wordAdjacent = false;\n }\n prevType = type;\n i += (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_1__.codePointSize)(next);\n }\n if (byWordTo == len && byWord[0] == 0 && wordAdjacent)\n return this.result(-100 /* Penalty.ByWord */ + (byWordFolded ? -200 /* Penalty.CaseFold */ : 0), byWord, word);\n if (adjacentTo == len && adjacentStart == 0)\n return [-200 /* Penalty.CaseFold */ - word.length + (adjacentEnd == word.length ? 0 : -100 /* Penalty.NotFull */), 0, adjacentEnd];\n if (direct > -1)\n return [-700 /* Penalty.NotStart */ - word.length, direct, direct + this.pattern.length];\n if (adjacentTo == len)\n return [-200 /* Penalty.CaseFold */ + -700 /* Penalty.NotStart */ - word.length, adjacentStart, adjacentEnd];\n if (byWordTo == len)\n return this.result(-100 /* Penalty.ByWord */ + (byWordFolded ? -200 /* Penalty.CaseFold */ : 0) + -700 /* Penalty.NotStart */ +\n (wordAdjacent ? 0 : -1100 /* Penalty.Gap */), byWord, word);\n return chars.length == 2 ? null : this.result((any[0] ? -700 /* Penalty.NotStart */ : 0) + -200 /* Penalty.CaseFold */ + -1100 /* Penalty.Gap */, any, word);\n }", "title": "" }, { "docid": "722713e3290e374a7249e213a2b8d316", "score": "0.5111439", "text": "function replacement_leopard(match,k,e,y,b,ard) {\n return leopard_subs[k] + e + leopard_subs[y] + leopard_subs[b] + ard;\n}", "title": "" }, { "docid": "d26184b5546ce8978cb0baa5f6664cf9", "score": "0.51098156", "text": "match(word) {\n if (this.pattern.length == 0)\n return [0];\n if (word.length < this.pattern.length)\n return null;\n let { chars, folded, any, precise, byWord } = this;\n if (chars.length == 1) {\n let first = codePointAt(word, 0), firstSize = codePointSize(first);\n let score2 = firstSize == word.length ? 0 : -100;\n if (first == chars[0])\n ;\n else if (first == folded[0])\n score2 += -200;\n else\n return null;\n return [score2, 0, firstSize];\n }\n let direct = word.indexOf(this.pattern);\n if (direct == 0)\n return [word.length == this.pattern.length ? 0 : -100, 0, this.pattern.length];\n let len = chars.length, anyTo = 0;\n if (direct < 0) {\n for (let i = 0, e = Math.min(word.length, 200); i < e && anyTo < len; ) {\n let next = codePointAt(word, i);\n if (next == chars[anyTo] || next == folded[anyTo])\n any[anyTo++] = i;\n i += codePointSize(next);\n }\n if (anyTo < len)\n return null;\n }\n let preciseTo = 0;\n let byWordTo = 0, byWordFolded = false;\n let adjacentTo = 0, adjacentStart = -1, adjacentEnd = -1;\n let hasLower = /[a-z]/.test(word), wordAdjacent = true;\n for (let i = 0, e = Math.min(word.length, 200), prevType = 0; i < e && byWordTo < len; ) {\n let next = codePointAt(word, i);\n if (direct < 0) {\n if (preciseTo < len && next == chars[preciseTo])\n precise[preciseTo++] = i;\n if (adjacentTo < len) {\n if (next == chars[adjacentTo] || next == folded[adjacentTo]) {\n if (adjacentTo == 0)\n adjacentStart = i;\n adjacentEnd = i + 1;\n adjacentTo++;\n } else {\n adjacentTo = 0;\n }\n }\n }\n let ch, type = next < 255 ? next >= 48 && next <= 57 || next >= 97 && next <= 122 ? 2 : next >= 65 && next <= 90 ? 1 : 0 : (ch = fromCodePoint(next)) != ch.toLowerCase() ? 1 : ch != ch.toUpperCase() ? 2 : 0;\n if (!i || type == 1 && hasLower || prevType == 0 && type != 0) {\n if (chars[byWordTo] == next || folded[byWordTo] == next && (byWordFolded = true))\n byWord[byWordTo++] = i;\n else if (byWord.length)\n wordAdjacent = false;\n }\n prevType = type;\n i += codePointSize(next);\n }\n if (byWordTo == len && byWord[0] == 0 && wordAdjacent)\n return this.result(-100 + (byWordFolded ? -200 : 0), byWord, word);\n if (adjacentTo == len && adjacentStart == 0)\n return [-200 - word.length + (adjacentEnd == word.length ? 0 : -100), 0, adjacentEnd];\n if (direct > -1)\n return [-700 - word.length, direct, direct + this.pattern.length];\n if (adjacentTo == len)\n return [-200 + -700 - word.length, adjacentStart, adjacentEnd];\n if (byWordTo == len)\n return this.result(-100 + (byWordFolded ? -200 : 0) + -700 + (wordAdjacent ? 0 : -1100), byWord, word);\n return chars.length == 2 ? null : this.result((any[0] ? -700 : 0) + -200 + -1100, any, word);\n }", "title": "" }, { "docid": "27d06f1e0902fbcfb765b09154326fb9", "score": "0.51084363", "text": "match(word) {\n if (this.pattern.length == 0)\n return [0];\n if (word.length < this.pattern.length)\n return null;\n let { chars, folded, any, precise, byWord } = this;\n // For single-character queries, only match when they occur right\n // at the start\n if (chars.length == 1) {\n let first = codePointAt(word, 0);\n return first == chars[0] ? [0, 0, codePointSize(first)]\n : first == folded[0] ? [-200 /* Penalty.CaseFold */, 0, codePointSize(first)] : null;\n }\n let direct = word.indexOf(this.pattern);\n if (direct == 0)\n return [0, 0, this.pattern.length];\n let len = chars.length, anyTo = 0;\n if (direct < 0) {\n for (let i = 0, e = Math.min(word.length, 200); i < e && anyTo < len;) {\n let next = codePointAt(word, i);\n if (next == chars[anyTo] || next == folded[anyTo])\n any[anyTo++] = i;\n i += codePointSize(next);\n }\n // No match, exit immediately\n if (anyTo < len)\n return null;\n }\n // This tracks the extent of the precise (non-folded, not\n // necessarily adjacent) match\n let preciseTo = 0;\n // Tracks whether there is a match that hits only characters that\n // appear to be starting words. `byWordFolded` is set to true when\n // a case folded character is encountered in such a match\n let byWordTo = 0, byWordFolded = false;\n // If we've found a partial adjacent match, these track its state\n let adjacentTo = 0, adjacentStart = -1, adjacentEnd = -1;\n let hasLower = /[a-z]/.test(word), wordAdjacent = true;\n // Go over the option's text, scanning for the various kinds of matches\n for (let i = 0, e = Math.min(word.length, 200), prevType = 0 /* Tp.NonWord */; i < e && byWordTo < len;) {\n let next = codePointAt(word, i);\n if (direct < 0) {\n if (preciseTo < len && next == chars[preciseTo])\n precise[preciseTo++] = i;\n if (adjacentTo < len) {\n if (next == chars[adjacentTo] || next == folded[adjacentTo]) {\n if (adjacentTo == 0)\n adjacentStart = i;\n adjacentEnd = i + 1;\n adjacentTo++;\n }\n else {\n adjacentTo = 0;\n }\n }\n }\n let ch, type = next < 0xff\n ? (next >= 48 && next <= 57 || next >= 97 && next <= 122 ? 2 /* Tp.Lower */ : next >= 65 && next <= 90 ? 1 /* Tp.Upper */ : 0 /* Tp.NonWord */)\n : ((ch = fromCodePoint(next)) != ch.toLowerCase() ? 1 /* Tp.Upper */ : ch != ch.toUpperCase() ? 2 /* Tp.Lower */ : 0 /* Tp.NonWord */);\n if (!i || type == 1 /* Tp.Upper */ && hasLower || prevType == 0 /* Tp.NonWord */ && type != 0 /* Tp.NonWord */) {\n if (chars[byWordTo] == next || (folded[byWordTo] == next && (byWordFolded = true)))\n byWord[byWordTo++] = i;\n else if (byWord.length)\n wordAdjacent = false;\n }\n prevType = type;\n i += codePointSize(next);\n }\n if (byWordTo == len && byWord[0] == 0 && wordAdjacent)\n return this.result(-100 /* Penalty.ByWord */ + (byWordFolded ? -200 /* Penalty.CaseFold */ : 0), byWord, word);\n if (adjacentTo == len && adjacentStart == 0)\n return [-200 /* Penalty.CaseFold */ - word.length, 0, adjacentEnd];\n if (direct > -1)\n return [-700 /* Penalty.NotStart */ - word.length, direct, direct + this.pattern.length];\n if (adjacentTo == len)\n return [-200 /* Penalty.CaseFold */ + -700 /* Penalty.NotStart */ - word.length, adjacentStart, adjacentEnd];\n if (byWordTo == len)\n return this.result(-100 /* Penalty.ByWord */ + (byWordFolded ? -200 /* Penalty.CaseFold */ : 0) + -700 /* Penalty.NotStart */ +\n (wordAdjacent ? 0 : -1100 /* Penalty.Gap */), byWord, word);\n return chars.length == 2 ? null : this.result((any[0] ? -700 /* Penalty.NotStart */ : 0) + -200 /* Penalty.CaseFold */ + -1100 /* Penalty.Gap */, any, word);\n }", "title": "" }, { "docid": "2514cdd6e118077d8956ef326589f3ae", "score": "0.51061004", "text": "function replaceWords(candidate, editsList) {\n return candidate.map(function(candidateWord) {\n editsList.forEach(function(item) {\n if (candidateWord[\"word\"] === item[0]) {\n candidateWord[\"word\"] = item[1];\n }\n });\n return candidateWord;\n });\n}", "title": "" }, { "docid": "79f014482795ddd842f3c76d70398c8d", "score": "0.5076555", "text": "function replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n }", "title": "" }, { "docid": "166973efa3031455f7e6b1e016943267", "score": "0.50433856", "text": "function searchReplace(statement, search, replace) {\n var newArgList = [];\n var i;\n\n\n if (statement.type == \"free variable\" || statement.type == \"bound variable\") return statement;\n\n if (statement.name == search.name) return toTerm(replace);\n\n for (i=0; i < statement.argList.length; i++)\n newArgList[i] = searchReplace(statement.argList[i], search, replace);\n\n\n switch (statement.type) {\n case \"term\":\n if (statement.subtype == \"free variable\") return statement;\n if (statement.subtype == \"bound variable\") return statement;\n if (statement.subtype == \"primitive\") return statement;\n if (statement.subtype == \"operator evaluation\") return operatorTerm(statement.operator, newArgList);\n return;\n case \"primitive\":\n if (statement.subtype == \"atomic\") return statement;\n if (statement.subtype == \"predicate\") return predicateSentence(statement.predicate, newArgList);\n return;\n case \"connective\":\n return connectiveSentence(statement.connective, newArgList);\n case \"quantifier\":\n if (statement.subtype == \"for all\") return forAll( newArgList[0], newArgList[1]);\n if (statement.subtype == \"there exists\") return thereExists( newArgList[0], newArgList[1]);\n return;\n }\n}", "title": "" }, { "docid": "ed45dfd7a3a6f1a3259fc85fa0273a9d", "score": "0.50388813", "text": "lemmatization1(tokenList) {\n //Wink-Lemmatizer run: \n for (let i = 0; i < tokenList.length; i++) {\n if (tokenList[i] !== lemmatizer.verb(tokenList[i])) {\n tokenList.splice(i, 1, lemmatizer.verb(tokenList[i]) +'changed');\n }\n else if (tokenList[i] !== lemmatizer.noun(tokenList[i])) {\n tokenList.splice(i, 1, lemmatizer.noun(tokenList[i]) +'changed');\n }\n else if (tokenList[i] !== lemmatizer.adjective(tokenList[i])) {\n tokenList.splice(i, 1, lemmatizer.adjective(tokenList[i]) +'changed');\n }\n };\n\n\n //Porter-Algorithm run: \n for (let i = 0; i < tokenList.length; i++) {\n let verification = dictionary.spellCheck(tokenList[i]); \n let verificationPorter = dictionary.spellCheck(stemmer.stem(tokenList[i])); \n if (!tokenList[i].includes('changed') && verification === true && verificationPorter === true) {\n //Only add words that are properly spelled, properly stemmed from the Porter run and unlabeled: \n tokenList.splice(i, 1, stemmer.stem(tokenList[i]));\n }\n }\n\n //UnLabeling: \n tokenList.forEach((token, i) => {\n if (token.includes('changed')) {\n const reverted = token.substr(0, token.length - 'changed'.length); \n tokenList.splice(i, 1, reverted);\n }\n }); \n \n return tokenList;\n }", "title": "" }, { "docid": "bdfef6fbfbddf2104106794c50b3433a", "score": "0.5028443", "text": "function transformWord(wordObj) {\n if(wordObj.doTransform === false){\n return wordObj.word;\n }else{\n transformFunc = sw.getRandItem(TRANSFORM_FUNCS);\n return transformFunc(wordObj.word);\n }\n }", "title": "" }, { "docid": "2f0627565c52031c5e5391e2aa98f714", "score": "0.5028108", "text": "function step1b(token) { \n if(token.substr(-3) == 'eed') {\n if(measure(token.substr(0, token.length - 3)) > 0)\n return token.replace(/eed$/, 'ee');\n } else {\n var result = attemptReplace(token, /ed|ing$/, '', function(token) { \n if(categorizeGroups(token).indexOf('V') >= 0) {\n var result = attemptReplacePatterns(token, [['at', 'ate'], ['bl', 'ble'], ['iz', 'ize']]);\n\t\tif(result)\n\t\t return result;\n\t\telse {\n\t\t if(endsWithDoublCons(token) && token.match(/[^lsz]$/))\n\t\t\treturn token.replace(/([^aeiou])\\1$/, '$1');\n\n\t\t if(measure(token) == 1 && categorizeChars(token).substr(-3) == 'CVC' && token.match(/[^wxy]$/))\n\t\t\treturn token + 'e'; \n\t\t}\n\n\t\treturn token;\n\t }\n\t \n\t return null;\n\t});\n\t\n\tif(result)\n\t return result;\n }\n\n return token; \n}", "title": "" }, { "docid": "2f0627565c52031c5e5391e2aa98f714", "score": "0.5028108", "text": "function step1b(token) { \n if(token.substr(-3) == 'eed') {\n if(measure(token.substr(0, token.length - 3)) > 0)\n return token.replace(/eed$/, 'ee');\n } else {\n var result = attemptReplace(token, /ed|ing$/, '', function(token) { \n if(categorizeGroups(token).indexOf('V') >= 0) {\n var result = attemptReplacePatterns(token, [['at', 'ate'], ['bl', 'ble'], ['iz', 'ize']]);\n\t\tif(result)\n\t\t return result;\n\t\telse {\n\t\t if(endsWithDoublCons(token) && token.match(/[^lsz]$/))\n\t\t\treturn token.replace(/([^aeiou])\\1$/, '$1');\n\n\t\t if(measure(token) == 1 && categorizeChars(token).substr(-3) == 'CVC' && token.match(/[^wxy]$/))\n\t\t\treturn token + 'e'; \n\t\t}\n\n\t\treturn token;\n\t }\n\t \n\t return null;\n\t});\n\t\n\tif(result)\n\t return result;\n }\n\n return token; \n}", "title": "" }, { "docid": "3f431b071df865f5f915aba2faab9382", "score": "0.50253415", "text": "function allSearchReplace(statement, search, replace)\n{\n if (statement.type == \"free variable\" || statement.type == \"bound variable\") return [statement];\n\n var list = [];\n var newArgList = [];\n var i,j;\n\n if (statement.name == search.name) list.push(toTerm(replace));\n\n for (i=0; i < statement.argList.length; i++)\n newArgList[i] = allSearchReplace(statement.argList[i], search, replace);\n\n switch (statement.type) {\n case \"term\":\n switch (statement.subtype) {\n case \"free variable\":\n case \"bound variable\":\n case \"primitive\":\n list.push(statement);\n break;\n case \"operator evaluation\":\n switch(statement.operator.arity) {\n case 0:\n list = [operatorTerm(statement.operator, [])];\n break;\n case 1:\n for (i=0; i < newArgList[0].length; i++)\n list.push( operatorTerm(statement.operator, [newArgList[0][i]]));\n break;\n case 2:\n for (i=0; i < newArgList[0].length; i++)\n for (j=0; j < newArgList[1].length; j++)\n list.push( operatorTerm( statement.operator, [newArgList[0][i], newArgList[1][j]]));\n break;\n }\n break;\n }\n break;\n case \"primitive\":\n switch(statement.subtype) {\n case \"atomic\":\n list.push(statement);\n break;\n case \"predicate\":\n switch(statement.predicate.arity) {\n case 0:\n list.push(predicateSentence(statement.predicate, []));\n break;\n case 1:\n for (i=0; i < newArgList[0].length; i++)\n list.push( predicateSentence(statement.predicate, [newArgList[0][i]]));\n break;\n case 2:\n for (i=0; i < newArgList[0].length; i++)\n for (j=0; j < newArgList[1].length; j++)\n list.push( predicateSentence( statement.predicate, [newArgList[0][i], newArgList[1][j]]));\n break;\n }\n break;\n }\n break;\n case \"connective\":\n switch(statement.connective.arity) {\n case 0:\n list.push(connectiveSentence(statement.connective, []));\n break;\n case 1:\n for (i=0; i < newArgList[0].length; i++)\n list.push( connectiveSentence(statement.connective, [newArgList[0][i]]));\n break;\n case 2:\n for (i=0; i < newArgList[0].length; i++)\n for (j=0; j < newArgList[1].length; j++)\n list.push( connectiveSentence( statement.connective, [newArgList[0][i], newArgList[1][j]]));\n break;\n }\n break;\n case \"quantifier\":\n switch(statement.subtype) {\n case \"for all\":\n for (i=0; i < newArgList[0].length; i++)\n for (j=0; j < newArgList[1].length; j++)\n list.push( forAll( newArgList[0][i], newArgList[1][j]));\n break;\n case \"there exists\":\n for (i=0; i < newArgList[0].length; i++)\n for (j=0; j < newArgList[1].length; j++)\n list.push( thereExists( newArgList[0][i], newArgList[1][j]));\n break;\n }\n break;\n }\n return list;\n}", "title": "" }, { "docid": "08fe1d4b8519447811b06070e98a8828", "score": "0.5017388", "text": "function replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n}", "title": "" }, { "docid": "08fe1d4b8519447811b06070e98a8828", "score": "0.5017388", "text": "function replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n}", "title": "" }, { "docid": "f9cb3257817a76431a17cfd3766ee4fb", "score": "0.50145787", "text": "function Replacer(ctx, defaultReplacer) {\n return function(match, offset, string) {\n if (ctx[match] !== undefined) {\n return ctx[match];\n } else {\n return defaultReplacer;\n }\n }\n}", "title": "" }, { "docid": "ae821823218f23f400dd4653b7929006", "score": "0.50134706", "text": "static *replace$e(thiz, args, realm) {\n\t\tlet base = yield * thiz.toStringNative();\n\t\tlet realArgs = yield * _g.map(args, function*(v) { return yield * v.toStringNative(); });\n\t\tlet out = String.prototype.replace.apply(base, realArgs);\n\t\treturn realm.fromNative(out);\n\t}", "title": "" }, { "docid": "f383147eea7947caa849588e84224545", "score": "0.5013165", "text": "function process(content, items) {\r\n\t\t\tTools.each(items, function(v) {\r\n\t\t\t\tif (v.constructor == RegExp) {\r\n\t\t\t\t\tcontent = content.replace(v, '');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontent = content.replace(v[0], v[1]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treturn content;\r\n\t\t}", "title": "" }, { "docid": "5a2f01ec9fd41e3f86dc6f1a5f84b238", "score": "0.50097245", "text": "function push_token_action ( word ) {\n if (word.indexOf(RM.config.highlight.StartSel_nospaces) == 0) {\n // beginning of marking\n //log.debug(\"found begin of marking\");\n word = word.replace(new RegExp(RM.config.highlight.StartSel_nospaces, \"g\"), \"\");\n //log.debug(\"word after removal of startsel marking: \", word);\n mark = true;\n }\n if (mark == true && word.indexOf(RM.config.highlight.StopSel_nospaces) > 0) {\n word = word.replace(new RegExp(RM.config.highlight.StopSel_nospaces, \"g\"), \"\");\n //log.debug(\"associating action highlight to word \", word);\n aTokenActionMap.push({token : {type : 'text', text : word}, action : RM.fn_html_highlight});\n mark = false;\n }\n else if (mark === true) {\n //log.debug(\"associating action highlight to word \", word);\n aTokenActionMap.push({token : {type : 'text', text : word}, action : RM.fn_html_highlight});\n }\n else {\n //log.debug(\"associating action none to word \", word);\n aTokenActionMap.push({token : {type : 'text', text : word}, action : null});\n }\n }", "title": "" }, { "docid": "28f6f51c1fc3e0a60a6d5a32e88f7264", "score": "0.4986359", "text": "function pigIt(str){\n //Code here\n return str.replace(/\\b(\\w)(\\w*)\\b/g,\"$2$1ay\");\n }", "title": "" }, { "docid": "6f9b2b4b5aa3634420d5634d9500b15e", "score": "0.4977118", "text": "function replacerandom(placeholder,set,distribution,sentence){\n \tvar found=countfinds(placeholder,sentence);\t\t\t\n \tfor(var i=0;i<found;i++){\n \t\tsentence=replacen(placeholder,randomword(set,distribution),sentence,0);\t\t\t\t\t\n \t}\n \treturn sentence;\n }", "title": "" }, { "docid": "8e343eb8b165494264d4b1665f28e72a", "score": "0.4966407", "text": "function splice(str, token, replacement) {\n\t var i = str.indexOf(token);\n\t return str.substr(0, i) + replacement + str.substr(i + token.length);\n\t}", "title": "" }, { "docid": "b93ff692b905204e8cbcb1109359b9e8", "score": "0.49506676", "text": "emojiConvert(tokens) {\n //Loop through individual tokens: \n tokens.forEach((token, i) => {\n\n //For each token, verify for potential matches in the emoticons object: \n for (let emotion in emoticons) {\n if (emoticons[emotion].includes(token)) {\n //Replace emoji token with the corresponding word\n tokens.splice(i, 1, emotion); \n } \n }\n \n //Convert unicode emojis to short words: \n const unicodeConvert = emojione.toShort(token); \n if (token !== unicodeConvert) {\n tokens.splice(i, 1, unicodeConvert); \n }\n });\n \n return tokens; \n }", "title": "" }, { "docid": "8a72d38fb7668a068e1f1d6e629eea28", "score": "0.4916872", "text": "function splice(str, token, replacement) {\n\t var i = str.indexOf(token);\n\t return str.substr(0, i) + replacement\n\t + str.substr(i + token.length);\n\t}", "title": "" }, { "docid": "8a72d38fb7668a068e1f1d6e629eea28", "score": "0.4916872", "text": "function splice(str, token, replacement) {\n\t var i = str.indexOf(token);\n\t return str.substr(0, i) + replacement\n\t + str.substr(i + token.length);\n\t}", "title": "" }, { "docid": "568ba13f6b98c78e48886e20f679bf01", "score": "0.49141142", "text": "function myFunction() {\n var givenSentence = document.getElementById(\"demo\").innerHTML;\n var replacedSentence = givenSentence.replace(/mistakes/g,\"bugs\");\n\n document.getElementById(\"demo\").innerHTML = replacedSentence;\n}", "title": "" }, { "docid": "821aa7e328a1741bb1f208af4a2fe3bc", "score": "0.49110612", "text": "function strawberryBanana () {\n var str = \"Strawberries are a popular part of spring and summer diets throughout America. Mouths water from coast to coast each spring, when small white blossoms start to appear on strawberry bushes. They announce the impending arrival of the ruby red berries that so many people crave. Ripe strawberries taste sweet and have only a slight hint of tartness. They are also one of the healthiest fruits around. There are countless recipes for the luscious red berry, but many people prefer to eat them fresh and unaccompanied.\";\n var txt = str.replace(/strawberry/i,\"banana\");\n var txt = txt.replace(/strawberries/i,\"bananas\");\nconsole.log(txt)\n}", "title": "" }, { "docid": "d62a0b43a149e461793024a34bc037ad", "score": "0.49012265", "text": "function genReplacer(callback) {\n function makeReplacementNode(fill, matchIndex) {\n var match = matches[matchIndex];\n\n if (!match.stencil) {\n match.stencil = callback(match);\n }\n\n var clone = match.stencil.cloneNode(false);\n clone.setAttribute('data-mce-index', matchIndex);\n\n if (fill) {\n clone.appendChild(dom.doc.createTextNode(fill));\n }\n\n return clone;\n }\n\n return function (range) {\n var before, after, parentNode, startNode = range.startNode,\n endNode = range.endNode, matchIndex = range.matchIndex,\n doc = dom.doc;\n\n if (startNode === endNode) {\n var node = startNode;\n\n parentNode = node.parentNode;\n if (range.startNodeIndex > 0) {\n // Add \"before\" text node (before the match)\n before = doc.createTextNode(node.data.substring(0, range.startNodeIndex));\n parentNode.insertBefore(before, node);\n }\n\n // Create the replacement node:\n var el = makeReplacementNode(range.match, matchIndex);\n parentNode.insertBefore(el, node);\n if (range.endNodeIndex < node.length) {\n // Add \"after\" text node (after the match)\n after = doc.createTextNode(node.data.substring(range.endNodeIndex));\n parentNode.insertBefore(after, node);\n }\n\n node.parentNode.removeChild(node);\n\n return el;\n }\n\n // Replace startNode -> [innerNodes...] -> endNode (in that order)\n before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));\n after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));\n var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);\n var innerEls = [];\n\n for (var i = 0, l = range.innerNodes.length; i < l; ++i) {\n var innerNode = range.innerNodes[i];\n var innerEl = makeReplacementNode(innerNode.data, matchIndex);\n innerNode.parentNode.replaceChild(innerEl, innerNode);\n innerEls.push(innerEl);\n }\n\n var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);\n\n parentNode = startNode.parentNode;\n parentNode.insertBefore(before, startNode);\n parentNode.insertBefore(elA, startNode);\n parentNode.removeChild(startNode);\n\n parentNode = endNode.parentNode;\n parentNode.insertBefore(elB, endNode);\n parentNode.insertBefore(after, endNode);\n parentNode.removeChild(endNode);\n\n return elB;\n };\n }", "title": "" }, { "docid": "c40633870871d4a559f284f4fc8b5cfc", "score": "0.49005178", "text": "function replaceWordsInString(string, dictionary) {\n let convertedString = string.replace(wordsRegex, (match) => {\n let matchLowerCase = match.toLowerCase()\n let replaceBy = dictionary[matchLowerCase]\n if (!replaceBy) {\n return match\n }\n return replaceBy\n })\n return convertedString\n}", "title": "" }, { "docid": "2d9ae00174fbe2145f308b6489e655c6", "score": "0.4894392", "text": "function tokenise(word) {\n return word\n .toLowerCase()\n .replace(/\\W+/g, '');\n}", "title": "" }, { "docid": "9e91fb10b7b0f34ea98179b4ac9162f2", "score": "0.48937893", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement + str.substr(i + token.length);\n}", "title": "" }, { "docid": "888a761761dd175fe3a05e07a2e1014b", "score": "0.48907232", "text": "finalSpellCheck(tokens) {\n //Singularize tokens with ' ' into single word tokens\n let splitTokens = []; \n for (let i in tokens) {\n if (tokens[i].includes(' ')) {\n const splits = tokens[i].split(' '); \n splits.forEach(split => splitTokens.push(split)); \n } else {\n splitTokens.push(tokens[i]); \n }\n }\n\n //SpellCheck all tokens one final time before vectorization: \n const finalTokens = splitTokens.filter(token => {\n return dictionary.spellCheck(token); \n })\n \n return finalTokens; \n }", "title": "" }, { "docid": "35418fbe57fa2ecdd0353c85adf12fea", "score": "0.48872092", "text": "function replaceStraberry() {\r\n var str = document.getElementById(\"text1\").innerHTML; \r\n var edit = str.replace (/strawberry/gi, \"banana\");\r\n var edit = str.replace (/strawberries/gi, \"bananas\");\r\n document.getElementById(\"text1\").innerHTML = edit;\r\n console.log (edit);\r\n}", "title": "" }, { "docid": "70a590f081a0ed879484ac25dee5097e", "score": "0.48846632", "text": "function transformLipps(token) {\n return token.replace(/[bfpv]/g, '1');\n }", "title": "" }, { "docid": "a7c7da2c2baa05d8623ff9caff68be6f", "score": "0.48789844", "text": "function dualWordReduce(t,i,index,arr){\r\n if (arr[index] && arr[index + 1]) {\r\n if (t.every(z => z.word !== `${arr[index]} ${arr[index + 1]}`)) {\r\n t.push({word:`${arr[index]} ${arr[index + 1]}`,times:1});\r\n } else {\r\n const indy = t.findIndex(x => x.word === `${arr[index]} ${arr[index + 1]}`);\r\n ++t[indy].times;\r\n }\r\n }\r\n return t;\r\n }", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "358f0786b59853f16794360c1606185a", "score": "0.48706695", "text": "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement\n + str.substr(i + token.length);\n}", "title": "" }, { "docid": "cf5bfede5deb2ed0ab36e8c5cb48849d", "score": "0.48656484", "text": "function step1b(token) { \n if(token.substr(-3) == 'eed') {\n if(measure(token.substr(0, token.length - 3)) > 0)\n return token.replace(/eed$/, 'ee');\n } else {\n var result = attemptReplace(token, /(ed|ing)$/, '', function(token) {\n if(categorizeGroups(token).indexOf('V') >= 0) {\n result = attemptReplacePatterns(token, [['at', '', 'ate'], ['bl', '', 'ble'], ['iz', '', 'ize']]);\n\n if(result != token) {\n \t\t return result;\n \t\t} else {\n \t\t if(endsWithDoublCons(token) && token.match(/[^lsz]$/)) {\n \t\t\t return token.replace(/([^aeiou])\\1$/, '$1');\n }\n\n \t\t if(measure(token) == 1 && categorizeChars(token).substr(-3) == 'CVC' && token.match(/[^wxy]$/)) {\n \t\t\t return token + 'e';\n }\n \t\t} \n\n \t\treturn token;\n \t }\n \t \n \t return null;\n \t});\n \t\n \tif(result) {\n \t return result;\n }\n }\n\n return token; \n }", "title": "" }, { "docid": "19765884d2beb90e5fdd02c0fa2580dd", "score": "0.48635077", "text": "function highlight_word(searchpara,text)\n{\n if(text)\n {\n var pattern=new RegExp(\"(\" + text + \")\", \"gi\");\n var new_text=searchpara.replace(pattern, \"<span class='highlight'>\" + text + \"</span>\");\n document.getElementById('resultpara').innerHTML=new_text;\n }\n //function to clear the page\n}", "title": "" }, { "docid": "669b25143496631d9930ce076fb7cd43", "score": "0.48453164", "text": "function atgCommon_substituteTokenArray(originalString, substitutionStringArray, substitutionTokenArray) {\n var newString = originalString;\n \n // Loop through the array and update the String accordingly\n for (var i=0; i< substitutionTokenArray.length; i++) {\n newString = atgCommon_substituteToken(newString, substitutionStringArray[i], substitutionTokenArray[i]);\n }\n \n return newString;\n}", "title": "" }, { "docid": "9403b4d3c1f87ba2ebe19a99916efa54", "score": "0.48398513", "text": "function rewriterulesStr(s) {\r\n\r\n\tvar w;\r\n\tfor (w = 0; w < nrew; w++) {\r\n\t\tif (rew[w].length > 2 && find(rew[w], \"|\") != -1) {\r\n\t\t\tvar parse = rew[w].split(\"|\");\r\n\t\t\t// for case insensitivity change to \"gi\"\r\n\t\t\tvar regex = new RegExp(parse[0], \"g\");\r\n\t\t\ts = s.replace(regex, parse[1]);\r\n\t\t}\r\n\t}\r\n\r\n\treturn s;\r\n}", "title": "" }, { "docid": "38986c9c5308f7c4b1836494235060d4", "score": "0.48337817", "text": "function replaceAll(str, term, replacement) {\n return str.replace(new RegExp(escapeRegExp(term), \"g\"), replacement);\n}", "title": "" }, { "docid": "e3b23c312ad8dfadaabdbd5a695ae5f2", "score": "0.48335764", "text": "function tryGetReplace(word) {\r\n if(typeof word != \"string\") {\r\n return false;\r\n }\r\n\r\n var isCapitalized = false;\r\n var start = word.length;\r\n var end = 0;\r\n\r\n for(var i = 0; i < word.length; i++) {\r\n if(word.charCodeAt(i) >= 65 && word.charCodeAt(i) <= 90) {\r\n isCapitalized = true;\r\n start = i;\r\n break;\r\n }\r\n else if(word.charCodeAt(i) >= 97 && word.charCodeAt(i)<= 122) {\r\n start = i;\r\n break;\r\n }\r\n }\r\n\r\n for(var i = word.length; i >= 0; i--) {\r\n if((word.charCodeAt(i) >= 97 && word.charCodeAt(i) <= 122) || (word.charCodeAt(i) >= 65 && word.charCodeAt(i) <= 90)) {\r\n end = i;\r\n break;\r\n }\r\n }\r\n if(end <= start) {\r\n return false;\r\n }\r\n var testedword = word.slice(start,end+1).toLowerCase();\r\n console.log(testedword + \"-Tested Word\");\r\n var firstchars = word.slice(0,start);\r\n var lastchars = word.slice(end+1);\r\n /*\r\n for(var i = 0; i < testedword.length; i++) {\r\n if(testedword.charCodeAt(i) < 65 || testedword.charCodeAt(i) > 90){\r\n return false;\r\n }\r\n }\r\n */\r\n if(isSimple(testedword)) {\r\n var rawreplacement = getSynonym(testedword);\r\n var replacement;\r\n if(isCapitalized) {\r\n replacement = firstchars.concat(rawreplacement.slice(0,1).toUpperCase(),rawreplacement.slice(1),lastchars);\r\n }\r\n else {\r\n replacement = firstchars.concat(rawreplacement,lastchars);\r\n }\r\n return replacement;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "ee9292bfd095534d99a7b6ed38fdffa5", "score": "0.48280358", "text": "function replaceHighlight() {\n var replaceWord = document.getElementById(\"replaceWord\").value;\n var spans = document.querySelectorAll(\"mark\");\n\n var xhrStopWord = new XMLHttpRequest();\n var stopWordArray = [];\n var stopWordUrl = \"config/stopwords.txt\";\n\n // Replace all highlighted with replaceWord\n spans.forEach((span) =>\n span.innerHTML = replaceWord\n );\n\n document.getElementById(\"searchStatReplace\").innerHTML =\n \"Replaced with : <strong id=\\\"searchStatReplaceWord\\\">\"\n + replaceWord + \"</strong>\";\n\n toggleReplaceDisabled(true);\n document.getElementById(\"resetReplace\").disabled = false;\n\n // Reload doc stats after replacement\n xhrStopWord.open(\"GET\", stopWordUrl, true);\n xhrStopWord.send();\n\n xhrStopWord.onreadystatechange = function () {\n if (xhrStopWord.readyState === 4 && xhrStopWord.status === 200) {\n stopWordArray = xhrStopWord.responseText.split(/\\s+/);\n getDocStats(stripTags(document.getElementById(\"fileContent\").innerHTML),\n stopWordArray);\n }\n };\n}", "title": "" }, { "docid": "e3b68ac9eac79656f770cf4ce2dd1b11", "score": "0.48194912", "text": "function mapWords(words) {\n // for every word\n for (var i = 0; i < words.length; i++) { \n // need to replace any extraneous characters like whitespace, punctuation, or backslashes\n var word = words[i].replace(/\\W|_+/g, \"\");\n // need to get words following until run out of non-connectors-->This part is murky\n }\n}", "title": "" }, { "docid": "1d6423d36e96bb40f3b0a7f125e4411d", "score": "0.48172444", "text": "function FixTokens(value) {\n return value.replace(/(\\{[^\\{\\r\\n]+\\})/g, \"$$$1\");\n}", "title": "" }, { "docid": "7648d5c427337ab702865b3f8181ca63", "score": "0.48072177", "text": "function myFunction() {\n var str = document.getElementById(\"demo\").innerHTML;\n var res = str.replace(\"WASTE\", \"reduce\");\n document.getElementById(\"demo\").innerHTML = res;\n}", "title": "" }, { "docid": "046c369ca9c99886e8c5c2242f19c881", "score": "0.479801", "text": "function createReplacements() {\n\t return [\n\t // Remove anything but the contents within the BODY element\n\t [new RegExp(/^[\\s\\S]*<body[^>]*>\\s*|\\s*<\\/body[^>]*>[\\s\\S]*$/g), ''],\n\t\n\t // cleanup comments added by Chrome when pasting html\n\t [new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g), ''],\n\t\n\t // Trailing BR elements\n\t [new RegExp(/<br>$/i), ''],\n\t\n\t // replace two bogus tags that begin pastes from google docs\n\t [new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi), ''],\n\t [new RegExp(/<\\/b>(<br[^>]*>)?$/gi), ''],\n\t\n\t // un-html spaces and newlines inserted by OS X\n\t [new RegExp(/<span class=\"Apple-converted-space\">\\s+<\\/span>/g), ' '],\n\t [new RegExp(/<br class=\"Apple-interchange-newline\">/g), '<br>'],\n\t\n\t // replace google docs italics+bold with a span to be replaced once the html is inserted\n\t [new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi), '<span class=\"replace-with italic bold\">'],\n\t\n\t // replace google docs italics with a span to be replaced once the html is inserted\n\t [new RegExp(/<span[^>]*font-style:italic[^>]*>/gi), '<span class=\"replace-with italic\">'],\n\t\n\t //[replace google docs bolds with a span to be replaced once the html is inserted\n\t [new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi), '<span class=\"replace-with bold\">'],\n\t\n\t // replace manually entered b/i/a tags with real ones\n\t [new RegExp(/&lt;(\\/?)(i|b|a)&gt;/gi), '<$1$2>'],\n\t\n\t // replace manually a tags with real ones, converting smart-quotes from google docs\n\t [new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(((?!&quot;|&rdquo;|&ldquo;|\"|“|”).)*)(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(?:(?!&gt;).)*&gt;/gi), '<a href=\"$1\">'],\n\t\n\t // Newlines between paragraphs in html have no syntactic value,\n\t // but then have a tendency to accidentally become additional paragraphs down the line\n\t [new RegExp(/<\\/p>\\n+/gi), '</p>'],\n\t [new RegExp(/\\n+<p/gi), '<p'],\n\t\n\t // Microsoft Word makes these odd tags, like <o:p></o:p>\n\t [new RegExp(/<\\/?o:[a-z]*>/gi), ''],\n\t\n\t // Microsoft Word adds some special elements around list items\n\t [new RegExp(/<!\\[if !supportLists\\]>(((?!<!).)*)<!\\[endif]\\>/gi), '$1']\n\t ];\n\t }", "title": "" }, { "docid": "653a83c135b4b9320d6b4288648c06d9", "score": "0.47859043", "text": "handleGroupWord(extended) {\n const dataGrouped = extended.reduce((memo, slot, index) => {\n const { text, original, tokens } = slot;\n if (text === '') {\n let previousWord = memo[index - 1];\n let { original: prevOriginal, tokens: prevTokens } = previousWord;\n // append the current original text to the previous one\n prevOriginal = `${prevOriginal} ${original}`;\n // merge tokens\n prevTokens = this.mergeTokens(prevTokens, tokens);\n previousWord = Object.assign(previousWord, {\n original: prevOriginal,\n tokens: prevTokens\n });\n }\n else {\n const word = this.wordFromSlot(slot);\n memo.push(word);\n }\n return memo;\n }, []);\n return dataGrouped;\n }", "title": "" }, { "docid": "d5072a71a0f9babe6bba41838e4bebcb", "score": "0.4770765", "text": "function craft(){\n var str = quote;\n var str = str.replace(/([0-9]|-|\\[|\\]|)/g, '');\n var str = str.replace(/(\\r\\n|\\n|\\r)/gm,' ');\n var find = 'the Lord';\n var re = new RegExp(find, 'g');\n str = str.replace(re, topic);\n var find = 'The Lord';\n var re = new RegExp(find, 'g');\n str = str.replace(re, topic);\n topic = topic.replace(/\\s+/g, '');\n output = str + '\\n' + ' #' + topic;\n console.log(output + '\\n'); \n tweet();\n}", "title": "" }, { "docid": "921051bac16085cbe7718ad11d8df6c2", "score": "0.47582442", "text": "advance(): void {\n if (this.pattern.lastIndex == this.text.length) {\n this.current = null;\n } else {\n const lastIndex = this.pattern.lastIndex;\n const match = this.pattern.exec(this.text);\n if (match == null) throw new ParseError(\n \"unable to tokenize '\" + this.text.slice(lastIndex) + \"'\"\n );\n this.current = match[1];\n }\n }", "title": "" }, { "docid": "9a353946af5b97e794d1e632afadd52c", "score": "0.47533077", "text": "replaceLoop(regexp, replacement, text)\n {\n while (true)\n {\n const text2 = text.replace(regexp, replacement);\n if (text === text2) {\n break;\n } else {\n text = text2;\n }\n }\n return text;\n }", "title": "" }, { "docid": "343a6a9322bf44b2480aea815234403a", "score": "0.47510216", "text": "async function replaceWordsInStringBrowserAsync(string, syllabification = true, stress = true) {\n let convertedString = await replaceAsync(string, wordsRegex, async function (match) {\n if (match.length !== 1) {\n match = match.toLowerCase()\n }\n let replaceBy = await getValueFromBrowserStorage(match)\n if (!replaceBy || replaceBy === undefined) {\n return match\n }\n if (syllabification === false) {\n replaceBy = await replaceAsync(replaceBy, syllabificationRegex, match => '')\n }\n if (stress === false) {\n replaceBy = await replaceAsync(replaceBy, stressRegex, match => '')\n }\n return replaceBy\n })\n return convertedString\n}", "title": "" }, { "docid": "4821d97b22c2b591f2fe490185d1019c", "score": "0.4744154", "text": "function danish(text) {\n return text.replace(/\\b(apple|blueberry|cherry)\\b/, 'danish');\n}", "title": "" } ]
8b189c941d740e4b99be2cf4ad561861
get users from auth0
[ { "docid": "5a1f7bd74bc25f55ce29a8e57ea1ba3a", "score": "0.764754", "text": "async function getUsers() {\n const users = await fetch(`${process.env.AUTH0_HOST}/api/v2/users`,\n {\n method: \"GET\",\n headers: {\n \"Authorization\": \"Bearer \" + process.env.AUTH0_TOKEN,\n \"Content-Type\": \"application/json\"\n }\n })\n const usersJSON = await users.json()\n return usersJSON\n}", "title": "" } ]
[ { "docid": "08e9f93afbb975552a9aa97fbc0c8e2b", "score": "0.7236619", "text": "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "title": "" }, { "docid": "7e8b37c5322f860dd88907f84f35f31c", "score": "0.70478815", "text": "function getUsers() {\n return User.query().$promise.then(function(results) {\n $rootScope.users = results;\n return results;\n }, function(error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "ca7e85c9004538be5e404954d75e9111", "score": "0.7021031", "text": "function getUsers(query) {\n if ($scope.data.ACL.users.length) {\n var args = {\n options: {\n classUid: 'built_io_application_user',\n query: query\n }\n }\n return builtApi.Objects.getAll(args)\n } else\n return $q.reject({});\n }", "title": "" }, { "docid": "9f55b0a9912a6e197511c6e58ba4538f", "score": "0.70149994", "text": "function _getUsers(req,callback) {\n //console.log(req.isAuthenticated());\n UsersService.getUsers(req,callback)\n}", "title": "" }, { "docid": "279c139a362c7ed063b17058e1f95532", "score": "0.6914618", "text": "function getUsers(){\n return users;\n }", "title": "" }, { "docid": "30cdd4aeb645ffa07dde2b091aca63d0", "score": "0.6907942", "text": "getUsers () {\n if (!this.client.users.first()) return new Error('DiscordConnector.getUsers - ERROR: No users cached in connector.');\n else return this.client.users.array(); \n }", "title": "" }, { "docid": "3c086061466991fa4fc5c3d5363e420e", "score": "0.6892224", "text": "static async getAllUsers() {\n let res = await this.request(`users`);\n return res.users;\n }", "title": "" }, { "docid": "6df00173c3900296b44f98fac975744c", "score": "0.68748796", "text": "function getUsers() {\n return User.query().$promise.then(function(results) {\n return results;\n }, function(error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "9ce4241d2a2e142d75825cb768325575", "score": "0.6851521", "text": "function getAllUsers() {\n return users\n}", "title": "" }, { "docid": "f8e3eb21f11307180b503522ef4afddb", "score": "0.68474364", "text": "function getUsers() {\n return new Promise(function(resolve, reject) {\n client.smembersAsync(constants.USERS_KEY)\n .then(function(users) {\n resolve(users);\n })\n .catch(function(err) {\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "7ddc5579c0e11d84caa948f7841ade81", "score": "0.67986214", "text": "async function getUsers()\n{\n try\n {\n var options = {\n headers: {\n 'x-api-key': unstore('api-key')\n }\n };\n\n var response = await axios.get(`${siteConfig.api}/users`, options);\n\n var users = response.data.users;\n\n return users;\n }\n catch (error)\n {\n logError('[ERROR] Failed to load users', error);\n errorToast('Failed to load users');\n return [];\n }\n}", "title": "" }, { "docid": "e2feb6d895cde0df2c9788b9924bc836", "score": "0.67809534", "text": "async getUsers() {\n try {\n const users = await this._user.find()\n if (!users) {\n return []\n }\n return users\n } catch (e) {\n logger.error(`[UserManager - getUsers] Get Users failure: ${e.message}`)\n throw UserManager.parseError(e, 'User')\n }\n }", "title": "" }, { "docid": "1ae40988a127cc65321c8abe3b59a399", "score": "0.6763746", "text": "getUsers() {\n const users = UserRepository.getAll();\n\n if (users.length) return users;\n\n return null;\n }", "title": "" }, { "docid": "703f66d6db1cd683867f3e57daaff8b9", "score": "0.6727307", "text": "function findAllUsers() {\n return fetch(self.url)\n .then(function (response) {\n return response.json();\n });\n }", "title": "" }, { "docid": "7446fe86e037f983612d440192df6f82", "score": "0.6710636", "text": "async getUsers(_, {}, context) {\n try {\n checkUserAuth(context);\n } catch (error) {\n throw new AuthenticationError();\n }\n const users = await User.find();\n return users;\n }", "title": "" }, { "docid": "db9577b550eb3d24002ea9b2400bdc14", "score": "0.6681297", "text": "function usersList() {\n return $http.get('/api/users')\n .then(complete)\n .catch(failed);\n }", "title": "" }, { "docid": "1e6a3c7d85e46bc2f14b0643acd657e3", "score": "0.6654847", "text": "function listUsers() {\n iamClient.listUsers((err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', data);\n });\n}", "title": "" }, { "docid": "589fc83b59fa96d3f6ee06e708815136", "score": "0.66536355", "text": "function getUsers() {\n $http.get(server + \"user/all\").then(function (res) {\n $scope.users = res.data;\n });\n }", "title": "" }, { "docid": "4357d48e8011e59c864e833f9022bfc7", "score": "0.6608103", "text": "async function getUsers() {\n return new Promise(function(resolve, reject) {\n db().collection(appconfig.database.collections.userCollection, function(\n err,\n collection\n ) {\n assert.equal(null, err);\n collection.find({},{username: 1, _id:0}).toArray(function(err, data) {\n if (err || !data) {\n assert.equal(null, err);\n } else {\n resolve(data);\n }\n });\n });\n });\n}", "title": "" }, { "docid": "94403b54f6564475d9b97c7140772efa", "score": "0.6602029", "text": "function getUsers(request, response) {\n\tUser.find({})\n\t\t.then(user => {\n\t\t\tresponse.send(user)\n\t\t\tresponse.end()\n\t\t})\n\t\t.catch(error => {\n\t\t\tresponse.send(error)\n\t\t\tresponse.end()\n\t\t})\n}", "title": "" }, { "docid": "536891f52c353983d9775a7212a3bb2c", "score": "0.6577854", "text": "function getUsers() {\n var q = $q.defer();\n NavService.getUsers(function (result) {\n q.resolve(result['data']);\n })\n return q.promise;\n }", "title": "" }, { "docid": "9c3252c0f7ddccb18a986ff097daca78", "score": "0.65750235", "text": "function getLoggedInUsers() {\r\n Socket.emit('user:getLoggedInUsers',{}, function(users) {\r\n setLoggedInUsers(users.loggedInUsers);\r\n });\r\n }", "title": "" }, { "docid": "e3a63911c007425922ff706c36e53a09", "score": "0.65727425", "text": "function findAllUsers() {\n return fetch(self.url)\n // Request data from the server and await response, then convert the response into a JSON object\n .then(function (response) {\n return response.json()\n })\n }", "title": "" }, { "docid": "24cb86a5f6ec24cdfffa29fbb3406ac1", "score": "0.6550548", "text": "static getUsers() {\n return axios.get(`${baseUrl}/v1/private/users`)\n }", "title": "" }, { "docid": "5dc515acb47a31df655b643e94226b30", "score": "0.65488577", "text": "fetchUsers(callback) {\n const _url = UserConstants.mongo.url + UserConstants.mongo.port;\n client.connect(_url, (err, connection) => {\n connection\n .db(UserConstants.mongo.db)\n .collection(UserConstants.mongo.collections.user)\n .find()\n .toArray((err, response) => {\n callback(error, response);\n });\n });\n }", "title": "" }, { "docid": "61e248325018cde444d51a3c8726ea4b", "score": "0.65332615", "text": "function getUsers(req, res) {\n const users = user_sql_1.default.getUsers();\n users.then((result) => {\n return res.json(result);\n });\n}", "title": "" }, { "docid": "fd25f955dd88a00619a7fb2c55b47877", "score": "0.6531095", "text": "function getUsers() {\n return fetch(`${BASE_URL}/api/v1/users`)\n .then(response => response.json())\n .then(result => {\n result.map(user => user_store.push(user));\n })\n}", "title": "" }, { "docid": "54b82ad76650e8d349971c1cc8ccb141", "score": "0.6503857", "text": "function getUsers(req, res, next) {\n var user = new User();\n user.getAllUsers(function(err, users) {\n if(err) {\n return res.send(400);\n } else {\n return res.send(200, parseUsers(users));\n }\n });\n}", "title": "" }, { "docid": "a94877aa0c1bbdd1460ce8ecc5d6dc5d", "score": "0.650168", "text": "function getUsers() {\n\n\tvar promise = getDatabase().then(\n\t\tfunction handleDatabaseResolve( mongo ) {\n\n\t\t\tvar deferred = Q.defer();\n\n\t\t\tmongo.collection( \"user\" )\n\t\t\t\t.find({})\n\t\t\t\t.toArray( deferred.makeNodeResolver() )\n\t\t\t;\n\n\t\t\treturn( deferred.promise );\n\n\t\t}\n\t);\n\n\treturn( promise );\n\n}", "title": "" }, { "docid": "409ca0090c916f85fd404d81efa86720", "score": "0.649981", "text": "function getAllUsersFromDataStore() {\n myDB.getCollection(apiUsers, function (err, resources) {\n userData = resources;\n console.log(resources);\n });\n return userData;\n }", "title": "" }, { "docid": "a12aafadab3339e66f9f906199a4d5ad", "score": "0.64992666", "text": "function getUsers() {\n userService.getAll( function(response) {\n mac.users = $filter( \"associateFilter\" )( response );\n mac.users = $filter( \"taskFilter\" )( mac.users, mac.today );\n mac.calcWeek( mac.curr );\n }, function() {\n mac.toast(\"Error retrieving all users.\");\n });\n }", "title": "" }, { "docid": "0b00566c84963ab9b55f37e9c3b83cdb", "score": "0.64906645", "text": "function getUsers() {\n\t$.get(\"/api/users\", function(data) {\n\t users = data;\n\t});\n\t}", "title": "" }, { "docid": "a9fd3512fe55287a068f26c18aa1978a", "score": "0.6484413", "text": "function list_users( success, error ){\n return get_user('', success, error);\n }", "title": "" }, { "docid": "9bb0dc8de9f24574d0a05720b8e63337", "score": "0.6483321", "text": "async function getUsers() {\n try {\n const response = await fetch(API_URL);\n const rawData = await response.json();\n const data = rawData.results.map((user, index) => {\n return userFactory(user);\n });\n\n loadedUsers = data;\n foundUsers = data;\n\n enableSearchButton(true);\n loadFavoriteUser();\n renderUsers();\n updateStatics();\n renderStatics();\n } catch (err) {\n console.error(\n \"Erro ao tentar carregar os usuarios da API: \" + API_URL,\n err\n );\n }\n\n printInfo();\n}", "title": "" }, { "docid": "b3b1b9ec76fe3d633879a088e1a8940c", "score": "0.6470684", "text": "async function getUsers() {\n let response, results, users;\n\n response = await fetch(url);\n results = await response.json();\n users = results.results;\n\n return users;\n}", "title": "" }, { "docid": "1dd771f21fa2cb801fd03286237f51e1", "score": "0.6457447", "text": "async getUsers() {\n const uuids = await this.db.all('SELECT uuid FROM users');\n\n const users = [];\n for (const uuid of uuids.map(row => row.uuid)) {\n const user = await this.getUser(uuid); // eslint-disable-line no-await-in-loop\n users.push(user);\n }\n\n return users;\n }", "title": "" }, { "docid": "576745cbf823f2ed3a400581231bcbae", "score": "0.6449731", "text": "function getUsers() {\n return makeSlackApiCall('users.list', { })\n .then(response => {\n if (!response.ok) {\n throw new Error(response.error);\n }\n\n return response.members;\n });\n}", "title": "" }, { "docid": "a75407ed6fbd3eb26e787cfdf5abfeed", "score": "0.64487535", "text": "function gettingUsers() {\n var user = User.resource.query();\n\n user.$promise.then(function (data) {\n //User.setUser(data);\n\n return data;\n });\n\n return user;\n //$http\n // .get('/api/users')\n // .then(function (results) {\n // var msg = '', data = results.data;\n //\n // if (results.status === 200) {\n // msg = 'Users received successfully!';\n // logger.success(msg);\n // return data;\n // } else {\n // msg = 'Users getting failed. ' + data.message;\n // logger.error(msg);\n // }\n //\n // return data;\n // }).catch(function (reason) {\n // var msg = 'Users getting failed. ' + reason.data.description;\n // logger.error(msg);\n //\n // return reason;\n // });\n }", "title": "" }, { "docid": "d4e77e3e025bff8feeab317cf1192170", "score": "0.64463913", "text": "getUsers(req, res, next) {\n UserModel.find({\n }, (err, users) => {\n if (err) {\n return Callbacks.SuccessWithError(err, res);\n }\n // if no users found return an empty array\n const userList = users && users.length > 0 ? users : [];\n return Callbacks.SuccessWithData('Events found successfully!', userList, res);\n });\n }", "title": "" }, { "docid": "40220689d9f8953338cf816f37b1cb60", "score": "0.64414406", "text": "async getAllUsers(){\n const url = 'users';\n return await apiService.get(url);\n }", "title": "" }, { "docid": "c0a9d2cec9a6ae7df28adcae99bc7091", "score": "0.644005", "text": "function getUsers() {\n taskAgeDatalayer.getUsersInFirm()\n .then(function (response) {\n self.allUser = response.data;\n }, function (error) {\n notificationService.error('Users not loaded');\n });\n }", "title": "" }, { "docid": "e67a2589a44d9a405a8107a6901a5a3f", "score": "0.6425563", "text": "function getUsers(res){\n\tUser.find('users',{user_name:1, email:1, location:1},function(err, users){\n\t\t// if there is an error retrieving, send the error. nothing after res.send(err) will execute\n\t\tif (err){\n\t\t\tres.send(err)\n\t\t}else{\n\n\t\t\tres.json(users); // return all users in JSON format\n\t\t}\n\t})\n}", "title": "" }, { "docid": "15c342c0e6eb6927e84a676ec358c588", "score": "0.6411094", "text": "function getallusers() {\n\t\t\t\treturn userstore.getAllUsers()\t\t\t\t\n\t}", "title": "" }, { "docid": "74b6f2990978542372f0901e0777fcb0", "score": "0.6410286", "text": "async getAllUsers(includeDeleted, includeRestricted) {\n try {\n const res = await this.access.users.list({})\n if (res) {\n let out = res.members.filter((user) => {\n return !user.is_bot && user.id !== 'USLACKBOT'\n })\n if (!includeDeleted) {\n out = out.filter((user) => !user.deleted)\n }\n if (!includeRestricted) {\n out = out.filter((user) => !user.is_restricted)\n out = out.filter((user) => !user.is_ultra_restricted)\n out = out.filter((user) => !user.is_ultra_stranger)\n }\n return out\n }\n } catch (err) {\n if (err.code === ErrorCode.PlatformError) {\n console.error(err.data)\n } else {\n console.error(err.message)\n }\n }\n }", "title": "" }, { "docid": "57d2a3ceb555111123fb8370db60f75b", "score": "0.6408979", "text": "function getUsers(req,res){\n var identity_user_id = req.user.sub; //tenemos el id del user logeado, .sub por el id del payload en services/jwt.js\n var page = 1;\n if(req.params.page){ //si se envia la pagina por parametro, se la actualiza\n page = req.params.page;\n }\n var itemsPerPage = 5;\n User.find().sort('_id').paginate( page, itemsPerPage, (err,users,total) => {\n if( err ) return res.status(500).send( {message:'error en la peticion'} )\n if( !users ) return res.status(404).send({message:'no hay usuarios disponibles'});\n followUserIds(identity_user_id).then((value)=>{\n return res.status(200).send({\n users,\n user_following:value.following,\n user_followed:value.followed,\n total,\n pages: Math.ceil(total/itemsPerPage) //redondeo para saber el numero de paginas\n });\n });\n });\n}", "title": "" }, { "docid": "1d9181ee1ca3eb6684d48167ea743f8a", "score": "0.6408243", "text": "function findAllUsers() {\n\t\t\tvar deferred = $q.defer();\n\t\t\t$http.get(\"/api/assignment/user\")\n\t\t\t\t.success(function(response) {\n\t\t\t\t\tdeferred.resolve(response);\n\t\t\t\t});\n\t\t\treturn deferred.promise;\n\t\t}", "title": "" }, { "docid": "09db7b22efe93a063a1e3e78b294a164", "score": "0.6404044", "text": "async getUsers() {\n this.ctx.body = await this.service.userswm.query({});\n }", "title": "" }, { "docid": "f512651bb4c4ed684a88470063b7aa02", "score": "0.6403853", "text": "function getAllUsers(req, res) {\n var currentUser = new RegExp(req.body.username);\n User.getUser(currentUser, (err, data) => {\n if(err){\n throw err;\n }\n res.json(data);\n })\n}", "title": "" }, { "docid": "d1c336cfc6be99d6b08898b68c40b313", "score": "0.64019805", "text": "function getAll() {\n const requestOptions = {\n method: 'GET',\n headers: authHeader()\n };\n\n return fetch(`/users`, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "2ca373292c3fca8c3e4b5556a9a8ddd4", "score": "0.6399443", "text": "function findAllUsers() { \n\t\tuserService\n\t\t.findAllUsers()\n\t\t.then(renderUsers);\n\t}", "title": "" }, { "docid": "9ae1acf1d1d62dfd3b0e9b73735d69fd", "score": "0.63993776", "text": "getUsers() {\n\t\treturn dataService.getUsers();\n\t}", "title": "" }, { "docid": "150da391422c4439e42addb5a369d40a", "score": "0.6396413", "text": "function getUsers() {\n return $http.get(\"assets/dummy/user.dummy.json\");\n }", "title": "" }, { "docid": "8f457a66a0057cdab11c06a977653547", "score": "0.63919806", "text": "function getUsers(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const users = yield typeorm_1.getRepository(User_1.User).find({ relations: [\"address\"] });\n res.json(users);\n });\n}", "title": "" }, { "docid": "621e858ef26751a4c3576b07f4b985f9", "score": "0.6391149", "text": "function getUsuarios(){\n return fetch('https://reqres.in/api/users?page=2');\n }", "title": "" }, { "docid": "d0f15489b8704bee08e25a9b298faa7e", "score": "0.6385434", "text": "async function getUsers(req, res) {\n // Example decode (extract) token to data\n let token = await jwt.verify(req.token, secret)\n // Extracted token\n console.log(token)\n let param = [\n req.query.id ? req.query.id : '',\n req.query.name ? req.query.name : ''\n ]\n // (await)\n let users = await queryUser.selectUsers(param)\n return res.status(200).json({\n message: \"get users\",\n data: users\n })\n}", "title": "" }, { "docid": "6fef787356f7a23862e517b032731427", "score": "0.6379624", "text": "function getUsers(req, res) {\n var username = req.query['username'];\n var password = req.query['password'];\n if (username && password) {\n findUserByCredentials(username, password, res);\n } else if (username) {\n findUserByUsername(username, res);\n } else {\n var errorMessage = {\n message: \"Must provide either a username or both username and password.\"\n };\n res.status(400).json(errorMessage);\n }\n }", "title": "" }, { "docid": "f9357f627007d4351f2fcf33d4d7547a", "score": "0.6379162", "text": "function getUsers(req, res) {\n let query = User.find({});\n query.exec((err, users) => {\n if (err == null) {\n res.json(users);\n }\n else {\n res.send(err);\n }\n });\n}", "title": "" }, { "docid": "0acf6b0699af40e76949a8c35986f114", "score": "0.63685405", "text": "function getUsers(db = connection){\n return db('users').select()\n}", "title": "" }, { "docid": "776c338c3872cea12ccddcc310d942a0", "score": "0.63669354", "text": "function getUsers(req, res){\n var identity_user_id = req.user.sub;\n var page = 1;\n if(req.params.page){\n page = req.params.page;\n }\n var itemsPerPage = 5;\n User.find().sort('_id').paginate(page, itemsPerPage, (err, users, total) =>{\n if(err) return res.status(500).send({message:'Error en la petición'});\n if(!users) return res.status(404).send({message:'No hay usuarios disponibles'});\n\n return res.status(200).send({\n users,\n total,\n pages: Math.ceil(total/itemsPerPage)\n });\n\n });\n}", "title": "" }, { "docid": "08386db28526ec713a6b6700a4e0a213", "score": "0.63555247", "text": "function getUserList() {\r\n\tvar ret = [];\r\n\tfor (var i=0;i<clients.length;i++){\r\n\t\tret.push(clients[i].username);\r\n\t}\r\n\treturn ret;\r\n}", "title": "" }, { "docid": "06f02c6b1422146a9722e8dec059d970", "score": "0.63495797", "text": "function getUsers() {\n // eslint-disable-next-line no-undef\n return db\n .collection(\"users\")\n .get()\n .then(snapshot => {\n let users = [];\n snapshot.docs.forEach(doc => {\n users.push(doc.data());\n });\n return users;\n });\n}", "title": "" }, { "docid": "c2e4869ce6ad1515ae3f70461584d7e9", "score": "0.63450074", "text": "function getTemplateUsers() {\n return axios.get(TEMPLATE_USR_ENDPOINT).then(res => res.data);\n}", "title": "" }, { "docid": "6bfa5d9ee4087e7ae2755ace0ea27ec6", "score": "0.6339668", "text": "function getInitUsers() {\n\t\t\tvar promise = $http({\n\t\t\t\tmethod: \"GET\",\n\t\t\t\turl: \"http://ebola.agency/frontend-task.php?page=1&per_page=20\"\n\t\t\t});\n\t\t\tpromise.then(function (response) {\n\t\t\t\tinitUsers = response.data.data;\n\t\t\t\t console.log(\"coming from http-server\", initUsers);\n\t\t\t\t return initUsers;\n\t\t\t });\n\t\t\treturn promise;\n\t\t}", "title": "" }, { "docid": "ddeb4384b2a9117f0c3b9b4f1dd1d40c", "score": "0.63287365", "text": "async function loadUsers() {\n try {\n const appuser = await getDataAsync(`${BASE_URL}user`);\n displayAppUsers(appuser);\n \n } // catch and log any errors\n catch (err) {\n console.log(err);\n }\n }", "title": "" }, { "docid": "389c216cdce1d560afc23234615125ed", "score": "0.63258696", "text": "function getUsers(req, res) {\n var identity_user_id = req.user.sub; //carga el id del usuario logeado del servicio jwt\n var page = 1;\n if (req.params.page) {\n page = req.params.page;\n }\n var itemsPerPage; //5 usuarios por pagina\n User.find({role_coachee: 'yes'}).sort('institution').paginate(page, itemsPerPage,(err, users, total) => {\n if (err) return res.status(500).send({\n message: 'Error en la peticion'\n });\n\n if (!users) return res.status(404).send({\n message: 'No hay usuarios disponibles'\n });\n\n followUserIds(identity_user_id).then((value) => {\n return res.status(200).send({\n users,\n users_following: value.following,\n users_follow_me: value.followed,\n total,\n pages: Math.ceil(total / itemsPerPage)\n });\n });\n });\n}", "title": "" }, { "docid": "3de19fb2090051996b91393f72127fec", "score": "0.63253343", "text": "function getUsers() {\n mailboxDataService.getAllUsers()\n .then(function (data) {\n self.firmUsers = data.data;\n }, function (error) {\n notificationService.error('Unable to retreive firm users.');\n });\n }", "title": "" }, { "docid": "bd5a96d3e8324465039f5661d6a24932", "score": "0.6323471", "text": "function getAppUsers(req, res) {\n let perfLog = perfLogger.getInstance();\n perfLog.init('Get App Users', {req:filterNodeReq(req)});\n\n processRequest(req, res, function(req, res) {\n appsApi.getAppUsers(req).then(\n function(response) {\n res.send(response);\n logApiSuccess(req, response, perfLog, 'Get App Users');\n },\n function(response) {\n logApiFailure(req, response, perfLog, 'Get App Users');\n\n // client is waiting for a response..make sure one is always returned\n if (response && response.statusCode) {\n res.status(response.statusCode).send(response);\n } else {\n res.status(httpConstants.INTERNAL_SERVER_ERROR).send(response);\n }\n }\n );\n });\n }", "title": "" }, { "docid": "a0ce4721ceb17b6f43396d40a857396e", "score": "0.63220245", "text": "getUsers(){\n //en el modelo User se ejecuta el find sin ninguna condicion...\n User.find({}, (err, users)=>{\n //en caso de haberse presentado un error se ejecuta el error\n if(err) throw err;\n //de lo contrario se retorna un objeto con todos los resultados\n res.send( { allUsers : users } );\n })\n }", "title": "" }, { "docid": "2071c1022c3236530a6ab31e7f023e2e", "score": "0.63190097", "text": "function getChatUsers(req, res) {\n\tvar id = req.query.id;\n\tconsole.log(\"Getting Users of a Chat Room with id \" + id);\n\tchatModel.getChatUsersFromDb(id, function (error, result) {\n\t\tif (error || result == null) {\n\t\t\tres.status(500).json({success:false, data:error});\n\t\t} else {\n\t\t\tvar users = result;\n\t\t\tres.status(200).json(result);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7848e699970c355339e42eb41e346a79", "score": "0.63180214", "text": "function getListUsers(req, res){\n const db = req.mongo.db;\n const ObjectID = req.mongo.ObjectID;\n const dbOperations = new dataAccess.Operations();\n\n return dbOperations.findAll(db, 'user').then(result => {\n return Promise.resolve({listUsers: result});\n }).catch(err => {\n return Promise.reject(err);\n });\n}", "title": "" }, { "docid": "b86fec1ccc6feb15e712edb05c1a90e9", "score": "0.63147664", "text": "function getAllUsers(){\t\n\treturn db.User.find().exec()\n\t.then(function(users){\n\t\tvar successMessage= \"Retrieved \"+ users.length+ \" user(s)\";\n\t\tconsole.log(successMessage);\n\t\treturn bluebird.resolve({ message: successMessage, data: users });\n\t});\n}", "title": "" }, { "docid": "ae056ac7924d78099969e306044de504", "score": "0.63112193", "text": "static seeCurrentUsers() {\n // console.log(users);\n }", "title": "" }, { "docid": "04eae0a97588b52f5dbe6a7bc08edd29", "score": "0.63006836", "text": "async function getUsers() {\n\tlet users = new Set();\n\tlet calls = await getAllFunctionCalls(contractAddress, \"add_IOU\");\n\tcalls.forEach((call) => {\n\t\tusers.add(call.from);\n\t\tusers.add(call.args[0]); // creditor\n\t})\n\treturn Array.from(users);\n}", "title": "" }, { "docid": "d4bbfeeefac0a66f54e9c85efcc76bbc", "score": "0.6300157", "text": "function findAllUsersFromAdmin() {\n var deferred = $q.defer();\n $http.get(\"/api/assignment/admin/user\")\n .success(function (response) {\n deferred.resolve(response);\n });\n return deferred.promise;\n //callback(currentUser);\n }", "title": "" }, { "docid": "e9a5b4d84a816085e40a89ccb4053fea", "score": "0.629988", "text": "getUsers() {\n return this.users.find();\n }", "title": "" }, { "docid": "d388ab47ffe978782801ae3a47354ea4", "score": "0.6297595", "text": "function getUsers() {\n return dataset.users;\n}", "title": "" }, { "docid": "2160a8adcb4c271b403cfb1d815a6f92", "score": "0.629121", "text": "function getUsers() {\n usuariosFactory.listarTodos().then(function (res) {\n $scope.usuarios = res;\n });\n }", "title": "" }, { "docid": "9d4dd9c5a6c8950b130bc012a012e355", "score": "0.6282051", "text": "async users(parent, args, ctx, info) {\n\t\t//1. Check if the user is logged in\n\t\tif (!ctx.request.userId) {\n\t\t\tthrow new Error(\"Not currently logged in\");\n\t\t}\n\t\t\n\t\t//2. Check if the user has 'ADMIN', 'PERMISSIONUPDATE' or permissions \n\t\t// which if true implies the current user can query all users,\n\t\t// if not, an error will be thrown and won't hit the next line\n\t\thasPermission(ctx.request.user, ['ADMIN', 'PERMISSIONUPDATE'])\n\n\t\t//3. Get all the users (assuming they have admin priviledges)\n\t\treturn ctx.db.query.users({}, info);\n\t}", "title": "" }, { "docid": "595615c95f26aa0c57a7750168c82ea7", "score": "0.6278049", "text": "function getAllMyUsers(response,id,key){\n\tif(isLogged(id,key)){\n\t\tvar query = queries.getAllKnownUsers.replace(\"%ID%\",id);\n\t\tresponse_back(response,query);\n\t}else notLogged(response);\n}", "title": "" }, { "docid": "c480f6f9864f17c88cfba57f7929bd66", "score": "0.6276868", "text": "getUsers(limit = 100) {\n // TODO: remove the dependecy on this._$q;\n let defer = this._$q.defer();\n defer.resolve(this.parseUsers(users.slice(0, limit)));\n return defer.promise;\n }", "title": "" }, { "docid": "c425d206669e60a2da68236f0f8bf80f", "score": "0.62718165", "text": "async function findUsers() {\n let userList = await API.getAllProfiles();\n setAllUsers(userList.data.users);\n }", "title": "" }, { "docid": "5f4f7665bd77e3fa5bff83bfc3354981", "score": "0.6265831", "text": "function getUsers() {\n return db('users');\n}", "title": "" }, { "docid": "f07bf7ba0832801297b16453e880dded", "score": "0.6254304", "text": "getAllUsers() {\n var pageNumber = 1;\n var pageCount = 1;\n var response;\n var users = [];\n while (pageNumber <= pageCount) {\n var url = \"https://api.zoom.us/v2/users/?page_size=300&page_number=\" + pageNumber;\n response = this.callAPI(url);\n if (response) {\n pageNumber++;\n pageCount = response.page_count;\n users = users.concat(response.users);\n }\n }\n return users;\n }", "title": "" }, { "docid": "10f4fb9054c4a7f2d17f3f0a2f6c5e1f", "score": "0.6253265", "text": "async function getUsers() {\n debug(`getUsers()`);\n const result = await pool.query('SELECT username, email FROM users;');\n return result.rows;\n}", "title": "" }, { "docid": "3386685f728f84ff38b4293c5c677745", "score": "0.6247485", "text": "function getUsers() {\n let users = '';\n /* With new array make URLs to get offline user's data */\n users = urlUsers + streamersOffline.pop();\n getData(users, showUsers);\n}", "title": "" }, { "docid": "07ea324b7280b5bf60b93820fbda4931", "score": "0.62385935", "text": "getExistingActiveUsers() {\n var self = this;\n this.$http({method: 'get', url: '/users'}).then(function successCallback(response) {\n var users = response.data;\n // self.removeUserWithUsername(user.name, users);\n self.activeUsers = users;\n self.hasDownloadUsers = true;\n const currentUsername = self.Users.getUser().name;\n // Remove current user from list\n users = users.filter(user => user.name != currentUsername);\n // Create a DMChannel for each user\n self.Channels.addDMChannelsForUsers(users);\n });\n }", "title": "" }, { "docid": "b5357f2ec1562a0db2e0ed60f6e5e412", "score": "0.6237112", "text": "function getAllUser() {\n return $http.get(APIURL + 'officer/get-all-user');\n }", "title": "" }, { "docid": "ef82e14fc002a47fb039d5b3455ee690", "score": "0.62361914", "text": "users(parent, args, {db:{users}}, info) {\n \n return users;\n }", "title": "" }, { "docid": "7d90b7304ea068e937edfeac2cc2c90f", "score": "0.62338555", "text": "function getUsers() {\n $.get(\"/api/users\", function(data) {\n users = data;\n initializeRows();\n });\n }", "title": "" }, { "docid": "7a6ea6f6199db4a55eb7acbd7e905a98", "score": "0.6229596", "text": "async getUsers(url) {\n const response = await fetch(url);\n const data = await response.json()\n return data;\n }", "title": "" }, { "docid": "4fb0929f7e3e3311514af81ddc99b13c", "score": "0.62277514", "text": "users() {\n return this.__authDb;\n }", "title": "" }, { "docid": "02e2a153a7ecd97c721021afebba6a27", "score": "0.6226526", "text": "function getList(){\n\n let apiUrl = '/api/users';\n let deferred = $q.defer();\n\n $http({\n 'method': 'GET',\n 'url': apiUrl,\n 'headers': {'Content-Type': 'application/json'}\n }).\n success(function (data, status) {\n deferred.resolve(data);\n }).\n error(function (data, status) {\n deferred.reject(data);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "b67e6a693fdabdcd0d51e548e6a70507", "score": "0.62263066", "text": "function getUsers(req, res) {\n let identity_user_id = req.user.sub;\n let page = 1;\n if (req.params.page) {\n page = req.params.page;\n }\n\n let itemsPerPage = 5;\n User.find()\n .sort(\"_id\")\n .paginate(page, itemsPerPage, (err, users, total) => {\n if (err) return res.status(500).send({ message: \"Error en la petición\" });\n\n if (!users)\n return res.status(404).send({ message: \"No hay usuarios disponibles\" });\n\n followUSerIds(identity_user_id).then((value) => {\n return res.status(200).send({\n users,\n users_following: value.following,\n users_follow_me: value.followed,\n total,\n page: Math.ceil(total / itemsPerPage),\n });\n });\n });\n}", "title": "" }, { "docid": "378f06da9a4499c7aa4ea0a526a160f2", "score": "0.62251854", "text": "function getUserList () {\n return http.get(`/mdocs/users/`)\n}", "title": "" }, { "docid": "2ac3c510776aaf5455059700a7ca2eed", "score": "0.62246096", "text": "users(userIds, options = {}) {\n const ids = Array.isArray(userIds) ? userIds.join(',') : userIds;\n return this.get('users', { ...options, ids });\n }", "title": "" }, { "docid": "a35d28c7da869cdfb9f594cb66330c40", "score": "0.6224587", "text": "function gerAllUsers() {\n\t\t\tvar promise = $http({\n\t\t\t\tmethod: \"GET\",\n\t\t\t\turl: \"http://ebola.agency/frontend-task.php?per_page=100\"\n\t\t\t});\n\t\t\tpromise.then(function (response) {\n\t\t\t\tusers = response.data.data;\n\t\t\t\tconsole.log(\"coming from http-server\", users);\n\t\t\t\treturn users;\n\t\t\t});\n\t\t\treturn promise;\n\t\t}", "title": "" }, { "docid": "b40b73df8ead92b1e71f299d74529307", "score": "0.6222923", "text": "function getUsers(parent, args, context, info) {\n // console.log('context in getUsers \\n', context)\n return context.prisma.users()\n}", "title": "" }, { "docid": "9086041a7c6992376f466bfa853b59e6", "score": "0.6217736", "text": "function getUsers(url){\n return new Promise((resolve, reject)=>{\n fetch(url)\n .then(res=> resolve(res.json()))\n .catch(err=> reject(err))\n })\n}", "title": "" }, { "docid": "19fc3fc3d5cb35710ab0ee50482e5695", "score": "0.6214974", "text": "function getUsers(req, res){\n\n\tUser.find(function(err,users){\n\t\t\n\t\tif(err){\n\t\t\tres.status(500).send({message: 'Error en la peticion'});\n\t\n\t\n\t\t}else{\n res.status(200);\n\t\tres.json(users);\n\t\t}\n });\n\n}", "title": "" }, { "docid": "03ecaef2edef78435e17e3c517c59f84", "score": "0.62132704", "text": "async fetchUsers () {\n const store = this.store\n const users = await store.users.findAll()\n return users ? users : []\n }", "title": "" } ]
266ea630c94ae29500869a6c09c56023
Define the function that lists objects from the source bucket It gets the current `marker` as its argument
[ { "docid": "25d00cf3b047421743379f721ce2fdd3", "score": "0.72393376", "text": "function listObjects(marker) {\n var options = {\n BucketName: sourceBucket,\n Marker: marker,\n MaxKeys: 1000\n };\n s3.ListObjects(options, function(err, data) {\n if (err) throw err;\n var result = data.Body.ListBucketResult;\n var contents = _.isArray(result.Contents) ? result.Contents : [result.Contents]; //AWS sends an array if multiple, and a single object if there was only one result\n _.each(contents, function(item) {\n var objectName = item.Key;\n marker = objectName; //Save the marker\n queue.push(objectName); //Push the object to our queue\n });\n if (result.IsTruncated == 'true') {\n //The result is truncated, i.e. we have to list once more, starting from the new marker\n listObjects(marker);\n } else {\n //Tell our routine that we don't need to wait for more objects from S3\n listObjectsDone = true;\n //Check if we're done (is the queue empty?)\n checkDone();\n }\n });\n}", "title": "" } ]
[ { "docid": "2c9bab9568e016bb4ebc04f86f3c3e67", "score": "0.5917609", "text": "function listFilesFromS3(files, marker, cb){\n // are we paging from a specific point?\n if (marker){\n params.Marker = marker;\n }\n\n s3.listObjects(params, function(err, data) {\n if (err) {\n\n cb(err);\n }\n\n else {\n\n // concat the list of files into our collection\n files = files.concat(data.Contents);\n // are we paging?\n if (data.IsTruncated) {\n let length = data.Contents.length;\n let marker = data.Contents[length-1].Key;\n // recursion!\n loadFilesFromS3(files, marker, cb);\n } else {\n console.log('files loaded')\n cb(undefined, files.map(d=> d.Key));\n }\n }\n });\n}", "title": "" }, { "docid": "d418fc6b65629ea79f9ec2a781f38d5e", "score": "0.5693693", "text": "markersFrom(startMarker, endMarker, callbackFn) {\n let currentMarker = startMarker;\n while (currentMarker) {\n callbackFn(currentMarker);\n\n if (currentMarker === endMarker) {\n currentMarker = null;\n } else if (currentMarker.next) {\n currentMarker = currentMarker.next;\n } else {\n let nextSection = currentMarker.section.next;\n currentMarker = nextSection.markers.head;\n }\n }\n }", "title": "" }, { "docid": "686ed0f0e32feaa550e999a80831f07b", "score": "0.54704064", "text": "listAllBuckets(request) {\n return oci_common_1.paginateRecords(request, req => this.listBuckets(req));\n }", "title": "" }, { "docid": "630f613436f71aefff806848ccc79224", "score": "0.54621005", "text": "function outputListing(s3Params, req, res, next) {\n\t\tdebug('list s3 keys at', s3Params.Prefix);\n\t\ts3.listObjects(s3Params, function(error, data) {\n\t\t\tif(error)\n\t\t\t\tres.status(500).end();\n\t\t\telse {\n\t\t\t\tvar keys = [];\n\t\t\t\tmap(data.Contents, 'Key').forEach(function(key) {\n\t\t\t\t\t// Chop off the prefix path\n\t\t\t\t\tif (key !== s3Params.Prefix) {\n\t\t\t\t\t\tif (isEmpty(s3Params.Prefix)) {\n\t\t\t\t\t\t\tkeys.push(key);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tkeys.push(key.substr(s3Params.Prefix.length));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif(keys.length)\n\t\t\t\t\tres.json(keys);\n\t\t\t\telse\n\t\t\t\t\tnext();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "b00b33470c9507741519ecfe594a5b12", "score": "0.5456892", "text": "async function fetchS3Objects (options, bucket, prefix, filterFunc = () => true) {\n const { s3 } = options.deps;\n const objects = [];\n\n // Limit the results to items in this bucket with a specific prefix\n const params = {\n Bucket: bucket,\n Prefix: prefix\n };\n \n do {\n // Get all of the initial objects\n const response = await s3.listObjectsV2(params).promise();\n\n // Optionally, filter out objects\n const contents = response.Contents.filter(filterFunc);\n objects.push(...contents);\n\n params.ContinuationToken = response.IsTruncated\n ? response.NextContinuationToken\n : null;\n } while (params.ContinuationToken);\n \n return objects;\n}", "title": "" }, { "docid": "d0eac34bba8269d338548b99c52c400a", "score": "0.53785765", "text": "function main(bucketName = 'my-bucket', prefix = 'test', delimiter = '/') {\n // [START storage_list_files_with_prefix]\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The ID of your GCS bucket\n // const bucketName = 'your-unique-bucket-name';\n\n // The directory prefix to search for\n // const prefix = 'myDirectory/';\n\n // The delimiter to use\n // const delimiter = '/';\n\n // Imports the Google Cloud client library\n const {Storage} = require('@google-cloud/storage');\n\n // Creates a client\n const storage = new Storage();\n\n async function listFilesByPrefix() {\n /**\n * This can be used to list all blobs in a \"folder\", e.g. \"public/\".\n *\n * The delimiter argument can be used to restrict the results to only the\n * \"files\" in the given \"folder\". Without the delimiter, the entire tree under\n * the prefix is returned. For example, given these blobs:\n *\n * /a/1.txt\n * /a/b/2.txt\n *\n * If you just specify prefix = 'a/', you'll get back:\n *\n * /a/1.txt\n * /a/b/2.txt\n *\n * However, if you specify prefix='a/' and delimiter='/', you'll get back:\n *\n * /a/1.txt\n */\n const options = {\n prefix: prefix,\n };\n\n if (delimiter) {\n options.delimiter = delimiter;\n }\n\n // Lists files in the bucket, filtered by a prefix\n const [files] = await storage.bucket(bucketName).getFiles(options);\n\n console.log('Files:');\n files.forEach(file => {\n console.log(file.name);\n });\n }\n\n listFilesByPrefix().catch(console.error);\n // [END storage_list_files_with_prefix]\n}", "title": "" }, { "docid": "43bbf20827c4a7f24399daec1c73a968", "score": "0.5345676", "text": "function contactsGET (event, context, callback) {\n const params = {\n Bucket: process.env.API_BUCKET\n };\n s3.listObjectsV2(params, (err, data) => {\n if (err) {\n return backendError(callback);\n }\n\n const response = {};\n data.Contents.forEach((content) => {\n const parts = content.Key.split(':');\n response[parts[0]] = {\n x: Number(parts[1]),\n y: Number(parts[2])\n }\n });\n callback(null, {\n statusCode: 200,\n body: JSON.stringify(response)\n });\n });\n}", "title": "" }, { "docid": "76a7fb98202c02ca980cee5ad2588bf1", "score": "0.5341371", "text": "listAllObjects(request) {\n return oci_common_1.genericPaginateRecords(request, req => this.listObjects(req), res => res.listObjects.nextStartWith, (req, nextPageToken) => (req.start = nextPageToken), res => res.listObjects.objects);\n }", "title": "" }, { "docid": "bc52ee71c0a3fae22853cd664ad6e9e4", "score": "0.5293677", "text": "function listFilesByPrefix (bucketName, prefix, delimiter) {\n // Instantiates a client\n const storage = Storage();\n\n // References an existing bucket, e.g. \"my-bucket\"\n const bucket = storage.bucket(bucketName);\n\n /**\n * This can be used to list all blobs in a \"folder\", e.g. \"public/\".\n *\n * The delimiter argument can be used to restrict the results to only the\n * \"files\" in the given \"folder\". Without the delimiter, the entire tree under\n * the prefix is returned. For example, given these blobs:\n *\n * /a/1.txt\n * /a/b/2.txt\n *\n * If you just specify prefix = '/a', you'll get back:\n *\n * /a/1.txt\n * /a/b/2.txt\n *\n * However, if you specify prefix='/a' and delimiter='/', you'll get back:\n *\n * /a/1.txt\n */\n const options = {\n prefix: prefix\n };\n if (delimiter) {\n options.delimiter = delimiter;\n }\n\n // Lists files in the bucket, filtered by a prefix\n return bucket.getFiles(options)\n .then((results) => {\n const files = results[0];\n\n console.log('Files:');\n files.forEach((file) => console.log(file.name));\n\n return files;\n });\n}", "title": "" }, { "docid": "a5f7eb5bc5299733d177b5dfb2aaf5cb", "score": "0.5227982", "text": "generateBookmarkCentricList(annotations, callback) {\n\t\tlet resourceList = [];\n\n\t\tannotations.forEach((na, index) => {\n\t\t\tlet targets = na.target;\n\t\t\tif(na.target.selector) {\n\t\t\t\ttargets = [na.target]; //there is only a single target\n\t\t\t}\n\t\t\tresourceList = resourceList.concat(targets.map((t) => {\n\t\t\t\tconst resourceInfo = AnnotationUtil.getStructuralElementFromSelector(t.selector, 'Resource')\n\t\t\t\tconst collectionInfo = AnnotationUtil.getStructuralElementFromSelector(t.selector, 'Collection')\n\t\t\t\t//console.debug(resourceInfo, collectionInfo)\n\t\t\t\treturn {\n\t\t\t\t\tid : IDUtil.guid(), // unique bookmark id, used for referencing\n\n\t\t\t\t\tannotationId: na.id, //needed for deleting\n\n\t\t\t\t\ttargetId: t.source, //needed for deleting\n\n\t\t\t\t\t// general object (document,fragment,entity) data\n\t\t\t\t\tobject: {\n\n\t\t\t\t\t\t// unique object id\n\t\t\t\t\t\tid: resourceInfo ? resourceInfo.id : null,\n\n\t\t\t\t\t\t// object type: \"Video\", Video-Fragment\", \"Image\", \"Audio\", \"Entity\", ...\n\t\t\t\t\t\ttype: t.type,\n\n\t\t\t\t\t\t// short object title\n\t\t\t\t\t\ttitle: na.id,\n\n\t\t\t\t\t\t// (Creation) date of the object (nice to have)\n\t\t\t\t\t\tdate: \"NEED TO FETCH (DEPENDS ON RESOURCE)\",\n\n\t\t\t\t\t\t// dataset the object originates from\n\t\t\t\t\t\tdataset: collectionInfo ? collectionInfo.id : null,\n\n\t\t\t\t\t\t// placeholder image if available\n\t\t\t\t\t\tplaceholderImage: \"http://localhost:5304/static/images/placeholder.2b77091b.svg\"\n\n\t\t\t\t\t},\n\n\t\t\t\t\t// Bookmark created\n\t\t\t\t\tcreated: na.created,\n\n\t\t\t\t\t// sort position\n\t\t\t\t\tsort: index,\n\n\t\t\t\t\t// optional list of annotations here (leaves out bookmarks)\n\t\t\t\t\tannotations: na.body ? na.body.filter(a => {\n\t\t\t\t\t\treturn a.vocabulary != 'clariahwp5-bookmark-group'\n\t\t\t\t\t}) : null,\n\t\t\t\t}\n\t\t\t}))\n\t\t});\n\t\tif(callback && resourceList.length > 0) {\n\t\t\treturn AnnotationUtil.reconsileResourceList(resourceList, callback)\n\t\t}\n\t\treturn resourceList;\n\t}", "title": "" }, { "docid": "9abe5b8b5e35a1effbad769a2cadfd77", "score": "0.51860106", "text": "function listMyBuckets(callback) {\n s3.listBuckets(function(err, data) {\n if (err) {\n\n } else {\n console.log(\"My buckets now are:\\n\");\n\n for (var i = 0; i < data.Buckets.length; i++) {\n console.log(data.Buckets[i].Name);\n }\n }\n\n callback(err);\n });\n }", "title": "" }, { "docid": "e4bfc31d933ff2d2fb2ba439287f4ad1", "score": "0.51777154", "text": "function listFiles() {\n let s3 = new AWS.S3()\n s3.listObjects({\n Bucket: window.past3_config.bucket,\n Prefix: getFilePrefix(),\n }, loadFileList)\n}", "title": "" }, { "docid": "d8e64d8115229fa44d6e3147ca36dfea", "score": "0.5124853", "text": "_bucket() { }", "title": "" }, { "docid": "cc2fd076e9837d695a1c6f14e3e45b5c", "score": "0.5062974", "text": "function tryLoadFiles(marker) {\n s3Client\n .listFiles(s3info.region, s3info.bucket, s3info.path, 1000, 0, marker)\n .then((result) => {\n var files = result.data;\n files.forEach((f) => {\n f.region = s3info.region;\n f.bucket = s3info.bucket;\n f.domain = s3info.domain;\n });\n\n loop(files, (jobs) => {\n t = t.concat(jobs);\n if (result.marker) {\n $timeout(() => {\n tryLoadFiles(result.marker);\n }, 10);\n } else {\n if (callFn) callFn();\n }\n }, callFn2);\n });\n }", "title": "" }, { "docid": "43303f541fa8167b505b38400f6b680f", "score": "0.50446427", "text": "markersList(map) {\n\n let self = this;\n\n this.state.markers.forEach(marker => {\n const location = { lat: marker.lat, lng: marker.long };\n\n let mark = new window.google.maps.Marker({\n map: map,\n position: location,\n title: marker.name,\n name: marker.name,\n photo: marker.photo,\n animation: window.google.maps.Animation.DROP\n });\n\n /* event listener to send request of \n the marker to the openMarker function \n which fetches the data from foursquare API */\n mark.addListener(\"click\", function() {\n self.openMarker(mark);\n });\n \n //push the location to an array, to pass as a prop for LocationList component for data use\n let virtMarker = this.state.filterMarkers;\n virtMarker.push(mark);\n this.setState({ filterMarkers: virtMarker });\n });\n }", "title": "" }, { "docid": "b83a2291dc19cf9ef2b77d0d7d3304c2", "score": "0.5037695", "text": "function List() {}", "title": "" }, { "docid": "8d98b6d1a05fed2abe7eceb3ae2d9b7c", "score": "0.501537", "text": "function ListBucketsCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "ccf953d7893eccfabed03b50ecede5dd", "score": "0.50058043", "text": "[Symbol.iterator]() {\n\t\treturn this.listings.values();\n\t}", "title": "" }, { "docid": "6db9e8381e5d639cd9bebd53b2c29b52", "score": "0.49846968", "text": "getlist(list,start = 0,stop = -1,truncate=false,behaviorForEachItem = null){\n return new Promise((resolve,reject)=>{\n client.lrange(list,start,stop,(error,reply)=>{\n if(error)return reject(error);\n var array = []\n for (let i = 0; i < reply.length; i++) {\n var elem = reply[i];\n try {\n elem = JSON.parse(reply[i]);\n } catch (e) {\n elem = reply[i];\n } \n array.push(elem);\n if(behaviorForEachItem)\n behaviorForEachItem(elem)\n if(truncate)client.lrem(list, 1, reply[i]);\n }\n return resolve(array);\n })\n });\n }", "title": "" }, { "docid": "5cf8acac04f65a384d833bddee0612b2", "score": "0.498113", "text": "async function listBuckets() {\n try {\n const results = await storage.getBuckets();\n\n const [buckets] = results;\n\n console.log('Buckets:');\n buckets.forEach(bucket => {\n console.log(bucket.name);\n });\n } catch (err) {\n console.error('ERROR:', err);\n }\n}", "title": "" }, { "docid": "5cf8acac04f65a384d833bddee0612b2", "score": "0.498113", "text": "async function listBuckets() {\n try {\n const results = await storage.getBuckets();\n\n const [buckets] = results;\n\n console.log('Buckets:');\n buckets.forEach(bucket => {\n console.log(bucket.name);\n });\n } catch (err) {\n console.error('ERROR:', err);\n }\n}", "title": "" }, { "docid": "57e8c4a71ad4e8749740fff80c3fc48b", "score": "0.49715143", "text": "async listFilesAndDirectoriesSegment(marker, options = {}) {\n const { span, updatedOptions } = createSpan(\"ShareDirectoryClient-listFilesAndDirectoriesSegment\", options);\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n try {\n return await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "title": "" }, { "docid": "62b53196cf05ba5085c8fb52fdf20510", "score": "0.49635923", "text": "getMarkers(){\r\n var markers = [];\r\n for(var value of this.markers.entries()){\r\n markers.push(value[1]);\r\n }\r\n return markers;\r\n }", "title": "" }, { "docid": "1ff7f15a286187a22b0c1da9838cf639", "score": "0.49447548", "text": "async function getImageListFromBucket() {\n const data = await s3.listObjectsV2(\n {\n Bucket: BUCKET_OUT_NAME\n }\n\n ).promise();\n\n if (data) {\n let images = [];\n let promise = await new Promise(function (resolve, reject) {\n data.Contents.forEach(async function (obj, index) {\n const image = s3.getObject(\n {\n Bucket: BUCKET_OUT_NAME,\n Key: obj.Key\n }\n\n ).promise();\n\n images.push(image);\n });\n resolve(images)\n });\n\n return Promise.all(promise);\n }\n }", "title": "" }, { "docid": "fb9061c366a8c61b6d3aa98b23ab53de", "score": "0.4932634", "text": "listItems(options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listItems_1() {\n var e_1, _a;\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n let marker;\n try {\n for (var _b = tslib.__asyncValues(this.listSegments(marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {\n const segment = _c.value;\n if (segment.shareItems) {\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.shareItems)));\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));\n }\n finally { if (e_1) throw e_1.error; }\n }\n });\n }", "title": "" }, { "docid": "06fb9bcab211a0469b293b47ba9b618e", "score": "0.4914819", "text": "function allListings() {\n let allItems = Object.keys(allItems).map((itemId, idx) => {\n return allItems[itemId]\n })\n \n }", "title": "" }, { "docid": "6086474ee3172f392b7f4c4c9199b65c", "score": "0.491208", "text": "function myFunction(response) {\n var arr = JSON.parse(response);\n for (var i = 0; i < arr.list.length; i++) {\n set_marker(arr.list[i]);\n };\n }", "title": "" }, { "docid": "d2c3a0067dec0ab0d1827286daebe5b4", "score": "0.49053028", "text": "function fetchUpdatedS3Objects (options, bucket, prefix, cutoff) {\n // Define a filter function that only looks at object on a single level of the\n // bucket and removes any objects with a LastModified timestamp prior to the cutoff\n const threshold = cutoff.toMillis();\n const filterFunc = (c) => isSimpleObject(c, prefix) && (threshold < c.LastModified.getTime());\n\n return fetchS3Objects(options, bucket, prefix, filterFunc);\n}", "title": "" }, { "docid": "d927590bc5b780c921946af9c45661b9", "score": "0.48742536", "text": "function fetchNewObjects() {\n //console.log(\"Fetching new objects\");\n s3.listObjects({ Bucket: bucket }, function(err, data) {\n if (err) {\n console.log(err, err.stack); // an error occurred\n } else {\n // successful response\n var s3ObjectList = data[\"Contents\"]\n s3ObjectList.forEach(function(obj) {\n // Code to fetch images if they don't already exist and download them\n if (/^images/.test(obj[\"Key\"])) {\n imageDownload(obj[\"Key\"]);\n return;\n } else {\n addVideo(obj[\"Key\"]);\n }\n });\n }\n });\n}", "title": "" }, { "docid": "4c57fbf605e06df1194785838cad21ea", "score": "0.48678097", "text": "listSegments(marker, options = {}) {\n return __asyncGenerator(this, arguments, function* listSegments_1() {\n let listContainersSegmentResponse;\n if (!!marker || marker === undefined) {\n do {\n listContainersSegmentResponse = yield __await(this.listContainersSegment(marker, options));\n listContainersSegmentResponse.containerItems =\n listContainersSegmentResponse.containerItems || [];\n marker = listContainersSegmentResponse.continuationToken;\n yield yield __await(yield __await(listContainersSegmentResponse));\n } while (marker);\n }\n });\n }", "title": "" }, { "docid": "423bf72a1823e109c3ef3ab28d063826", "score": "0.4863409", "text": "function listAllHelper(ref, accumulator, pageToken) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var opt, nextPage;\n var _a, _b;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_c) {\n switch (_c.label) {\n case 0:\n opt = {\n // maxResults is 1000 by default.\n pageToken: pageToken\n };\n return [4 /*yield*/, list$1(ref, opt)];\n case 1:\n nextPage = _c.sent();\n (_a = accumulator.prefixes).push.apply(_a, nextPage.prefixes);\n (_b = accumulator.items).push.apply(_b, nextPage.items);\n if (!(nextPage.nextPageToken != null)) return [3 /*break*/, 3];\n return [4 /*yield*/, listAllHelper(ref, accumulator, nextPage.nextPageToken)];\n case 2:\n _c.sent();\n _c.label = 3;\n case 3: return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "423bf72a1823e109c3ef3ab28d063826", "score": "0.4863409", "text": "function listAllHelper(ref, accumulator, pageToken) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var opt, nextPage;\n var _a, _b;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_c) {\n switch (_c.label) {\n case 0:\n opt = {\n // maxResults is 1000 by default.\n pageToken: pageToken\n };\n return [4 /*yield*/, list$1(ref, opt)];\n case 1:\n nextPage = _c.sent();\n (_a = accumulator.prefixes).push.apply(_a, nextPage.prefixes);\n (_b = accumulator.items).push.apply(_b, nextPage.items);\n if (!(nextPage.nextPageToken != null)) return [3 /*break*/, 3];\n return [4 /*yield*/, listAllHelper(ref, accumulator, nextPage.nextPageToken)];\n case 2:\n _c.sent();\n _c.label = 3;\n case 3: return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "b30bbc85358bda20c7b9e27b71b6784e", "score": "0.484653", "text": "async listHandlesSegment(marker, options = {}) {\n const { span, updatedOptions } = createSpan(\"ShareFileClient-listHandlesSegment\", options);\n try {\n marker = marker === \"\" ? undefined : marker;\n const response = await this.context.listHandles(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));\n // TODO: Protocol layer issue that when handle list is in returned XML\n // response.handleList is an empty string\n if (response.handleList === \"\") {\n response.handleList = undefined;\n }\n return response;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "title": "" }, { "docid": "ae538e4005603a6f1814e903fad76165", "score": "0.48368815", "text": "enterIntoBuckets(ctx) {\n\t}", "title": "" }, { "docid": "23a8d4014d177527fb19b7b83a5f8f51", "score": "0.48326278", "text": "async listBlobFlatSegment(marker2, options = {}) {\n const { span, updatedOptions } = createSpan(\"ContainerClient-listBlobFlatSegment\", options);\n try {\n const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), convertTracingToRequestOptionsBase(updatedOptions)));\n const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {\n const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });\n return blobItem;\n }) }) });\n return wrappedResponse;\n } catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }", "title": "" }, { "docid": "4b33d71452b477a1cfbf46b4c16202cf", "score": "0.4820377", "text": "async getCallbacks() {\n const cbs = {};\n const f = `\nX:${this.getField('X')}\nY:${this.getField('Y')}\nZ:${this.getField('Z')}\nif (!xyz._lasso(q[0], q[1], q[2])) return;\n`\n await this.dataToMarkers(f, undefined, cbs);\n console.log('filtered OK ', Object.keys(cbs).length);\n // this.dataToMarkers();\n return cbs;\n}", "title": "" }, { "docid": "b84a4951dab4aef4bcb8f8493d17516d", "score": "0.48186088", "text": "function getArtists() { \n\n}", "title": "" }, { "docid": "a3158e5392f0a49257f96957e7d7f1d0", "score": "0.48093098", "text": "function tryLoadFiles(marker) {\n QiniuClient\n .listFiles(qiniuInfo.region, qiniuInfo.bucket, qiniuInfo.path.toString(), marker, {\n maxKeys: 1000,\n minKeys: 0,\n })\n .then((result) => {\n var files = result.data;\n files.forEach((f) => {\n f.region = qiniuInfo.region;\n f.bucket = qiniuInfo.bucket;\n f.domain = qiniuInfo.domain;\n f.qiniuBackendMode = qiniuInfo.qiniuBackendMode;\n });\n\n loop(files, (jobs) => {\n t = t.concat(jobs);\n if (result.marker) {\n $timeout(() => { tryLoadFiles(result.marker); }, 10);\n } else {\n if (callFn) callFn();\n }\n }, callFn2);\n });\n }", "title": "" }, { "docid": "b4e82d54e90f35061af0fa8a80238917", "score": "0.48016337", "text": "function bucketGetAll(request, response) {\n Bucket.find({})\n .sort(\"bOrder\")\n .then(bucketData => {\n response.render(\"bucket-index\", {\n bucket: bucketData\n });\n })\n .catch(err => {\n console.log(err);\n });\n}", "title": "" }, { "docid": "b87d27bf8f5222aea99a70747e340eb4", "score": "0.47979805", "text": "function listObjects (bucketName, maxObjects) {\n return new Promise((resolve, reject) => {\n var params = {\n Bucket: bucketName + BUCKET_SUFFIX,\n MaxKeys: maxObjects\n }\n\n s3.listObjects(params, (err, data) => {\n if (err) return reject(err)\n return resolve(data)\n })\n })\n}", "title": "" }, { "docid": "2e1e997e4965faa39ad530fb378edb4f", "score": "0.4793632", "text": "list (params) {\n return super.list(params)\n .then(orgs => {\n return orgs.map(org => {\n let cpy = {};\n for (let key in org) {\n if (key === 'url' && !params.code) continue;\n if (key === 'code' && !params.code) continue;\n cpy[key] = org[key];\n }\n return cpy;\n });\n });\n }", "title": "" }, { "docid": "69bd6a746995f6b51ea8244393a1932c", "score": "0.47921896", "text": "function getMarkerInfo(groupId) {\n // Fetch the json with the eventMarker objects \n // For each object call addMarker()\n \n fetch('/sortedMarkers?groupid=' + groupId).then(response => response.json()).then((eventMarkers) => {\n eventMarkers.forEach((eventMarker) => {\n geocoder.geocode({'address': eventMarker.location}, (results) => {\n // Geocoded the address to longitude and lattitude for\n // Marker placement\n addMarkerToMap(results[0].geometry.location, \n eventMarker.description, \n eventMarker.name, \n eventMarker.groupName, \n eventMarker.location, \n eventMarker.dateOutput,\n eventMarker.simpleDate,\n groupId);\n });\n });\n });\n}", "title": "" }, { "docid": "afea8b1260e5beb04dec3adfe266d970", "score": "0.4788662", "text": "listItems(options = {}) {\n return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listItems_1() {\n var e_2, _a;\n let marker2;\n try {\n for (var _b = tslib.__asyncValues(this.listSegments(marker2, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done; ) {\n const segment = _c.value;\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems)));\n }\n } catch (e_2_1) {\n e_2 = { error: e_2_1 };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return))\n yield tslib.__await(_a.call(_b));\n } finally {\n if (e_2)\n throw e_2.error;\n }\n }\n }, \"listItems_1\"));\n }", "title": "" }, { "docid": "75a1c86488f4de6050059a236078b868", "score": "0.4784809", "text": "updateMarkers(markers) {\n //abstract\n }", "title": "" }, { "docid": "53d2ddb138240f2ff2d6e0a053180c14", "score": "0.47841355", "text": "showListings() {\n var bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (var i = 0; i < this.markers.length; i++) {\n this.markers[i].setMap(map);\n \n bounds.extend(this.markers[i].position);\n }\n map.setCenter(bounds.getCenter());\n }", "title": "" }, { "docid": "f9f0418b2e75ceaaf0e56e4f79ed519c", "score": "0.47789136", "text": "function showListings() {\n var bounds = new google.maps.LatLngBounds();\n\n for (var i = 0; i < viewModel.markerList().length; i++) {\n\n viewModel.markerList()[i].setMap(map);\n bounds.extend(viewModel.markerList()[i].position);\n }\n\n map.fitBounds(bounds);\n }", "title": "" }, { "docid": "5b1abe94820115e05a94736a41ebac12", "score": "0.47768778", "text": "function get_bucket(callback) {\r\n loadingScreen('Getting bucket list');\r\n $.ajax({\r\n type: \"GET\",\r\n\t\t\t\turl: 'http://mwlists.com/_api/_getlive.php?bucket=' + bucket_api +'&authid=qZ8wLbRsJUmMVmR7',\r\n // url: 'http://mwlists.com/BookMarklets/getlive_unlockedmw.php?bucket=' + bucket_api,\r\n //data: params,\r\n cache: false,\r\n dataType: \"jsonp\",\r\n timeout: 30000,\r\n crossDomain: true,\r\n success: function (bucket) {\r\n //var bucket = Util.parseJSON(response);\r\n //log(bucket);\r\n loadingScreen();\r\n if(bucket.length > 0) {\r\n callback(bucket);\r\n } else {\r\n alert('bucket was empty or incorrect bucket API');\r\n return false;\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "b828501475954eb100b276b3e583bbe8", "score": "0.47692636", "text": "constructor (filterCb, objects) {\n super();\n this.filterCb = filterCb;\n this.objects = {};\n for (let i = 0; i < objects.length; i++) {\n this.objects[objects[i].metadata.name] = objects[i];\n }\n }", "title": "" }, { "docid": "ebb310fb33f886c57761669283b9bf48", "score": "0.47690123", "text": "function ostk_getListByKey(obj, key){\n var array = Array();\n for(var i = 0 ; i < obj.length ; i++){\n \tvar item = obj[i];\n array.push(item[key]);\n }//foreach\n return array;\n}", "title": "" }, { "docid": "941febb67d4be96f8940ebaa9aa0d44c", "score": "0.4768797", "text": "function returnAllListEntryObjects(input) {\n var entryObjectsArray = [];\n var events = input.data.items;\n if (events.length === 0) {\n console.log('No upcoming events found.');\n } else {\n // Adapted from Google Sample\n for (var i = 0; i < events.length; i++) {\n let event = events[i];\n let start = event.start.dateTime;\n start = moment(start).toISOString();\n let end = event.end.dateTime;\n end = moment(end).toISOString();\n let summary = event.summary;\n let description = event.description;\n let gid = event.id;\n let entryToAdd = new GcalEntry(start, end, summary, description, gid);\n entryObjectsArray.push(entryToAdd);\n }\n }\n return entryObjectsArray;\n}", "title": "" }, { "docid": "20c2dc64b760e0239368b2d7406d0573", "score": "0.47632152", "text": "function listBuckets () {\n return new Promise((resolve, reject) => {\n s3.listBuckets({}, (err, data) => {\n if (err) return reject(err)\n return resolve(data)\n })\n })\n}", "title": "" }, { "docid": "60e7a61d3cbc16432a826dba8af8b522", "score": "0.47554386", "text": "function addMarkers(){\n for (var i = 0; i < resultsList.length; i++) {\n createMarker(resultsList[i]);\n }\n}", "title": "" }, { "docid": "6be15f1e75082aa50d8631d89e9b8a94", "score": "0.47550103", "text": "visitRangePartitionList(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "e4e0fc1eb5ecd63435a504d062f68d6a", "score": "0.47387367", "text": "function getBuckets() {\n return getBuckets_rest();\n }", "title": "" }, { "docid": "618c9c0bd78e285a3752e228c765b0f4", "score": "0.4737024", "text": "function showListings(map, markers) {\r\n\tvar bounds = new google.maps.LatLngBounds();\r\n\t// Extend the boundaries of the map for each marker and display the marker\r\n\tfor (var key in markers) {\r\n\t\tmarkers[key].setMap(map);\r\n\t\tbounds.extend(markers[key].position);\r\n\t}\r\n\tmap.fitBounds(bounds);\r\n}", "title": "" }, { "docid": "7a5f0619b720a6f8a96adc3b6f70aec4", "score": "0.47295484", "text": "function list$1(ref, options) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var authToken, op, requestInfo;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (options != null) {\n if (typeof options.maxResults === 'number') {\n validateNumber('options.maxResults', \n /* minValue= */ 1, \n /* maxValue= */ 1000, options.maxResults);\n }\n }\n return [4 /*yield*/, ref.storage._getAuthToken()];\n case 1:\n authToken = _a.sent();\n op = options || {};\n requestInfo = list(ref.storage, ref._location, \n /*delimiter= */ '/', op.pageToken, op.maxResults);\n return [2 /*return*/, ref.storage._makeRequest(requestInfo, authToken).getPromise()];\n }\n });\n });\n}", "title": "" }, { "docid": "c9aabdc07a4e2f60530a02b61ff4ec12", "score": "0.47253123", "text": "_bucket(int) { }", "title": "" }, { "docid": "b767a84d58e9c058482c208bc9b00c85", "score": "0.47240132", "text": "static ls(loc, search=\"*\") {\n return ProxyServerIO.ajax(`/@ls/${loc}/${search}`);\n }", "title": "" }, { "docid": "495e5eb2f19a93c44c52fdc1e1f0ff38", "score": "0.47181112", "text": "listItems(options = {}) {\n return __asyncGenerator(this, arguments, function* listItems_1() {\n var e_2, _a;\n let marker;\n try {\n for (var _b = __asyncValues(this.listSegments(marker, options)), _c; _c = yield __await(_b.next()), !_c.done;) {\n const segment = _c.value;\n yield __await(yield* __asyncDelegator(__asyncValues(segment.containerItems)));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));\n }\n finally { if (e_2) throw e_2.error; }\n }\n });\n }", "title": "" }, { "docid": "b06c9a0f6bed4cbf8657508b31759b71", "score": "0.47061488", "text": "function showListings() {\n // Extend the boundaries of the map for each marker and display the marker\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n bounds.extend(markers[i].position);\n }\n map.fitBounds(bounds);\n }", "title": "" }, { "docid": "b6e65cb6a1b22dac8a9f1029528d7ea1", "score": "0.47053736", "text": "_listResources() {\n return this.logMessageAsync(`Listed resources at ${this._location}`,\n this._ioHandler.ls(this._location))\n }", "title": "" }, { "docid": "3092972712a6be1a434a791465a383c2", "score": "0.46964127", "text": "function list$1(ref, options) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var authToken, op, requestInfo;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (options != null) {\n if (typeof options.maxResults === 'number') {\n validateNumber('options.maxResults', \n /* minValue= */ 1, \n /* maxValue= */ 1000, options.maxResults);\n }\n }\n return [4 /*yield*/, ref.storage.getAuthToken()];\n case 1:\n authToken = _a.sent();\n op = options || {};\n requestInfo = list(ref.storage, ref._location, \n /*delimiter= */ '/', op.pageToken, op.maxResults);\n return [2 /*return*/, ref.storage.makeRequest(requestInfo, authToken).getPromise()];\n }\n });\n });\n}", "title": "" }, { "docid": "0875b53af20a18ca8727960e0e3f85b6", "score": "0.46935102", "text": "function addMarkers(){\r\n /* objects is passed from server to map.html with jinja2. */\r\n var objdata = JSON.parse(objects);\r\n \r\n for (item in objdata) {\r\n // custom icon for map marker\r\n var customIcon = L.icon({\r\n iconUrl: '/static/icon_blue.png',\r\n iconSize: [30, 30], // size of the icon\r\n popupAnchor: [0,-5]\r\n });\r\n var marker = L.marker([objdata[item][\"lat\"], objdata[item][\"long\"]], {icon: customIcon}).addTo(mymap);\r\n var title = objdata[item][\"title\"];\r\n var creators = objdata[item][\"creators\"];\r\n var link = objdata[item][\"objectid\"];\r\n \r\n var imgURI = objdata[item][\"image\"];\r\n var imgArray = imgURI.split(',');\r\n var imgLink = imgArray[0];\r\n var data = (\"<div class='row'><div class='col'><img src=\"+imgLink+\"/full/full/0/default.jpg alt=\"+title+\" style='width: 120px' height=auto></div><div class='col'><b>\" + \"<a href=objects/\" + link + \" id='title'>\" + title + \"</a>\" + \"</b>\" + creators+\"</div>\");\r\n marker.bindPopup(data);\r\n idMarkers.set(objdata[item][\"objectid\"], marker);\r\n }\r\n}", "title": "" }, { "docid": "3c490ae40fe0e6cd6c795c7dff9e0de4", "score": "0.4689603", "text": "function initChunklist(object){}", "title": "" }, { "docid": "2f84bb79b09880c69d904356774917ee", "score": "0.46865746", "text": "function delete_marker(old_marker){\r\n\r\n}", "title": "" }, { "docid": "e68c05b4c61617eb4716127414674a08", "score": "0.4681624", "text": "function getObject(object,arg,option,key){\n /*\targ.list = ev.data;\n console.log(ev.data);\n */\n for (var i=0; i < object.length; i++) {\n //console.log(object[i]);\n switch (option){\n case \"Files\": getFile(object[i],arg,key);\n break;\n case \"User\": getProject(object[i],arg);\n break;\n case \"Branch\": getBranch(object[i],arg);\n break;\n }\n\n };\n}", "title": "" }, { "docid": "dcb4613e7c144c86b8bbeda44d448d21", "score": "0.46788347", "text": "async listHandlesSegment(marker, options = {}) {\n const { span, updatedOptions } = createSpan(\"ShareDirectoryClient-listHandlesSegment\", options);\n try {\n marker = marker === \"\" ? undefined : marker;\n const response = await this.context.listHandles(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));\n // TODO: Protocol layer issue that when handle list is in returned XML\n // response.handleList is an empty string\n if (response.handleList === \"\") {\n response.handleList = undefined;\n }\n return response;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "title": "" }, { "docid": "bffd840ae2c1fa6843147cd969748981", "score": "0.46602678", "text": "function showListings() {\n var bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n bounds.extend(markers[i].position);\n }\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "235897a1877cc1aa5166f20ceb1c63e0", "score": "0.4659745", "text": "function listAllHelper(ref, accumulator, pageToken) {\n return Object(tslib_es6[\"b\" /* __awaiter */])(this, void 0, void 0, function () {\n var opt, nextPage;\n var _a, _b;\n return Object(tslib_es6[\"d\" /* __generator */])(this, function (_c) {\n switch (_c.label) {\n case 0:\n opt = {\n // maxResults is 1000 by default.\n pageToken: pageToken\n };\n return [4 /*yield*/, list$1(ref, opt)];\n case 1:\n nextPage = _c.sent();\n (_a = accumulator.prefixes).push.apply(_a, nextPage.prefixes);\n (_b = accumulator.items).push.apply(_b, nextPage.items);\n if (!(nextPage.nextPageToken != null)) return [3 /*break*/, 3];\n return [4 /*yield*/, listAllHelper(ref, accumulator, nextPage.nextPageToken)];\n case 2:\n _c.sent();\n _c.label = 3;\n case 3: return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "838ca0f9251230ccf0d009dc03c92942", "score": "0.46585307", "text": "function populateMarkers(rawData, filter) {\n apiLoc = rawData;\n // jQuery AJAX call for JSON\n $.getJSON(apiLoc, function(data) {\n //For each item in our JSON, add a new map marker\n $.each(data.raw_data, function(i, ob) {\n if(!filter){\n constructMarker(ob, i);\n }else if (ob[filter.key].toLowerCase().trim() === filter.value){\n constructMarker(ob), i;\n }\n });\n var markerCluster = new MarkerClusterer(map, MAPAPP.markers,\n {imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});\n console.log(JSON.stringify(MAPAPP.new_cordinates)); \n }); \n \n}", "title": "" }, { "docid": "ff566cae632cf0de30d896f6b2653b94", "score": "0.46525744", "text": "function fetchObjects(data) {\n // get new array with just the first 10 elements\n let objectIDs = data.objectIDs.slice(0, 10);\n console.log(\"fetching: \" + objectIDs.length + \" objects\");\n objectIDs.forEach(function(n) {\n // console.log(objectBaseUrl + n);\n let objUrl = objectBaseUrl + n;\n window\n .fetch(objUrl)\n .then(data => data.json())\n .then(data => {\n console.log(data);\n addObject(data);\n addToListOfItems(data);\n console.log(myArray);\n });\n \n });\n \n}", "title": "" }, { "docid": "87e8c689d276acf90d377204b7e1e640", "score": "0.46500227", "text": "function ListObjectsCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "3f96256ebb9aec52209f1edc77adc064", "score": "0.46429768", "text": "function showListings() {\r\n var bounds = new google.maps.LatLngBounds();\r\n // Extend the boundaries of the map for each marker and display the marker\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(map);\r\n bounds.extend(markers[i].position);\r\n }\r\n map.fitBounds(bounds);\r\n }", "title": "" }, { "docid": "3f96256ebb9aec52209f1edc77adc064", "score": "0.46429768", "text": "function showListings() {\r\n var bounds = new google.maps.LatLngBounds();\r\n // Extend the boundaries of the map for each marker and display the marker\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(map);\r\n bounds.extend(markers[i].position);\r\n }\r\n map.fitBounds(bounds);\r\n }", "title": "" }, { "docid": "a15b819551149c3a349fb76fbe1a3cf5", "score": "0.46422178", "text": "listAllBucketsResponses(request) {\n return oci_common_1.paginateResponses(request, req => this.listBuckets(req));\n }", "title": "" }, { "docid": "45527d32812c60a0dbae383918f49b44", "score": "0.46420056", "text": "function listAllHelper(ref, accumulator, pageToken) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var opt, nextPage;\r\n var _a, _b;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n opt = {\r\n // maxResults is 1000 by default.\r\n pageToken: pageToken\r\n };\r\n return [4 /*yield*/, list$1(ref, opt)];\r\n case 1:\r\n nextPage = _c.sent();\r\n (_a = accumulator.prefixes).push.apply(_a, nextPage.prefixes);\r\n (_b = accumulator.items).push.apply(_b, nextPage.items);\r\n if (!(nextPage.nextPageToken != null)) return [3 /*break*/, 3];\r\n return [4 /*yield*/, listAllHelper(ref, accumulator, nextPage.nextPageToken)];\r\n case 2:\r\n _c.sent();\r\n _c.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n }", "title": "" }, { "docid": "2fc0133d9cf4dff1ebf78894d567e620", "score": "0.4639953", "text": "function loadVillagersList() {\n \n}", "title": "" }, { "docid": "650ad560958880895bda26879487b10f", "score": "0.46384844", "text": "function showListings(){\n var bounds = new google.maps.LatLngBounds();\n for (var i=0; i < markers.length; i++){\n markers[i].setMap(map);\n bounds.extend(markers[i].position);\n }\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "fbbe1ce176a282902d1f4a049d54836d", "score": "0.46361217", "text": "function showListings() {\n var bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n bounds.extend(markers[i].position);\n }\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "92e6de0888f829eb07cf85697cda5711", "score": "0.46312916", "text": "get markers() {\n return this._as(2);\n }", "title": "" }, { "docid": "370d8c652d4685c1eed08dd0ddc9b70b", "score": "0.46312207", "text": "constructor() { \n \n S3BucketList.initialize(this);\n }", "title": "" }, { "docid": "d219134ede68097c1d43a088034c92e8", "score": "0.46248257", "text": "function listImages(list, called, finished){\n\t\t\thasCalled = true; // set that the function has been called\n\n\t\t\tconsole.log(\"Getting List Items\");// log this happening\n\t\t\t\n\t\t\t//one logical operator\n\t\t\t\tfor(i=0; i<totalImages; i++){ // loop to get images\n\t\t\t\t\t\n\t\t\t\t\tgetLoc(i); // call the getLog method\n\t\t\t\t\t\n\t\t\t\t\tconsole.log(\"Getting new image\"); // log that it is doing work\n\t\t\t\t\t\n\t\t\t\t\tconsole.log(\"Image id: \" +images[i].idn+ \" \" + \"Name : \" +images[i].n+ \" \" + \" location: \" + images[i].url );// print the result\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\tif(i > totalImages){ //does nothing\n\t\t\t\n\t\t\t//do nothing\n\t\t\t\n\t\t\t}else if(hasFinished = true){ // check to see if the function is finished\n\t\t\t\n\t\t\t\t\tconsole.log(message); // if so print the message defined earlier\n\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}//end listh Images", "title": "" }, { "docid": "726775deafc98a370c17ab6a7b4099cf", "score": "0.4624599", "text": "function displayMarker(marker) {\n return \"<li><i>Color</i>: \" + marker.color + \", <i>Material</i>: \" + marker.material + \", <i>Is permanent</i>: \" + marker.isPerm + \"<button class='btn btn-warning' onclick='editMarker(\" + markerArray.indexOf(marker) + \")'>Edit</button><button class='btn btn-danger' onclick='deleteMarker(\" + markerArray.indexOf(marker) + \")'>&times;</button></li>\";\n}", "title": "" }, { "docid": "b1e81c21e272753dfe8235049046ced3", "score": "0.4618633", "text": "function listAllHelper(ref, accumulator, pageToken) {\n return tslib.__awaiter(this, void 0, void 0, function() {\n var opt, nextPage;\n var _a, _b;\n return tslib.__generator(this, function(_c) {\n switch(_c.label){\n case 0:\n opt = {\n // maxResults is 1000 by default.\n pageToken: pageToken\n };\n return [\n 4,\n list$1(ref, opt)\n ];\n case 1:\n nextPage = _c.sent();\n (_a = accumulator.prefixes).push.apply(_a, nextPage.prefixes);\n (_b = accumulator.items).push.apply(_b, nextPage.items);\n if (!(nextPage.nextPageToken != null)) return [\n 3,\n 3\n ];\n return [\n 4,\n listAllHelper(ref, accumulator, nextPage.nextPageToken)\n ];\n case 2:\n _c.sent();\n _c.label = 3;\n case 3:\n return [\n 2\n ];\n }\n });\n });\n}", "title": "" }, { "docid": "2cfa0427c2108b2ba9ee537b7ab1b7da", "score": "0.4616926", "text": "function showListings() {\n var bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n bounds.extend(markers[i].position);\n }\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "2cfa0427c2108b2ba9ee537b7ab1b7da", "score": "0.4616926", "text": "function showListings() {\n var bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n bounds.extend(markers[i].position);\n }\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "a9ecf3de94e922fdb0ead545312f1875", "score": "0.46127963", "text": "function update_marker_lists() {\n for (marker of markers) {\n var marker_dist_from_location = google.maps.geometry.spherical.computeDistanceBetween(location,\n marker.position);\n\n if (marker_dist_from_location <= nearby_radius) {\n nearby_markers.push(marker);\n }\n }\n }", "title": "" }, { "docid": "38847f35c6944a56a710aa1f3c8b2886", "score": "0.46108425", "text": "function printList(path, filter, callback){ //Here we created a custom callback. Now callback can be used by supplying any function name. \n callback(path, filter);\n}", "title": "" }, { "docid": "9f6455580ba35a81e7fc81f58b5e3833", "score": "0.4610081", "text": "async listContainersSegment(marker, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-listContainersSegment\", options);\n try {\n return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, options), { include: typeof options.include === \"string\" ? [options.include] : options.include }), convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "title": "" }, { "docid": "11a6149afb01fc262eec5b7567658e8d", "score": "0.46018857", "text": "function showListings() {\n var bounds = new google.maps.LatLngBounds();\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n bounds.extend(markers[i].position);\n }\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "17777c18e9d00de914066dbcf2a95ad6", "score": "0.4600669", "text": "function searchForListings(searchTerm) {\n \n}", "title": "" }, { "docid": "6bd5761d6ffb80b1c0af29d6ef5a5fed", "score": "0.45987844", "text": "function loadPins(category, obj, markersExist) {\n // console.time('loadPins');\n if (markersExist == false) {\n\n var catID = 'category not found';\n var defaultIcon = 'default.png';\n\n\n markerArray[markerArray.length] = perform(category);\n\n // extract important category info & defaults\n $.each(categories, function(i, s) {\n if (s.name == category) {\n\n defaultIcon = s.icon;\n catID = s.ID - 1;\n\n }\n });\n\n var catTarget = 'div#category_div_' + category;\n \n $('<div name=\"' + categories[catID].name + '_cat_description\" class=\"cat_description\"/>')\n .html('<div class=\"inner_desc\">' + categories[catID].text + '<br/><a class=\"cat_link\" href=\"'+ categories[catID].link +'\" target=\"_blank\" >' + categories[catID].link + '</a></div>')\n .appendTo(catTarget);\n \n $('<ul class=\"object_list\"/>').appendTo(catTarget);\n\n // create building navigation list\n $.each(categoryItems[category], function(i, s) {\n\n var name = s.name;\n if (s.code) {var code = s.code;}\n var lat = s.lat;\n var lon = s.lon;\n if (s.info) {var info = s.info;}\n if (s.img) {\n if (s.img.indexOf(':') === -1) {\n var img = 'images/objects/' + category + '/' + s.img;\n }\n else {\n var img = s.img;\n }\n }\n if (s.video) {var video = s.video;}\n if (s.icon) {var iconpath = 'images/icons/numeral-icons/' + s.icon;} else {var iconpath = 'images/icons/numeral-icons/' + defaultIcon;}\n if (s.link) {var link = s.link;}\n if (s.code) {var id = category + '_' + code;}\n\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(lat, lon),\n map: map,\n title: name,\n icon: iconpath + '/' + (i+1) + \".png\"\n });\n\n markerCatArray[markerCatArray.length] = category;\n\n markerArray[catID][markerArray[catID].length] = marker;\n\n var target = 'div#category_div_' + category + ' ul';\n\n // create object navigation list\n $(\"<li name='\" + id + \"'/>\")\n .html('<img src=\"' + iconpath + '/' + (i+1) + '.png\" alt=\"' + id + '\"/><span class=\"object_name\">' + name + '</span>')\n .click(function() {\n\n $(this).siblings('li').removeClass('active_item');\n $(this).toggleClass('active_item');\n displayPoint(marker, i);\n\n })\n .appendTo(target);\n\n // Listener that builds the infopane popups on marker click\n google.maps.event.addListener(marker, 'click', function() {\n\n // Check to see if an InfoWindow already exists\n if (!infoWindow) {\n infoWindow = new google.maps.InfoWindow();\n }\n //close menu to show object just selected\n if (mobile == 1 && menuOn == 1){\n closeMenu();\n }\n // Create the info panes which hold content about each building\n var content = '<div id=\"' + category + '_info\" class=\"infopane\">' +\n '<h2>' + name + '</h2>' +\n '<div>';\n if (img)\n {\n content += '<img src=\"' + img + '\" alt=\"' + name + '\" width=\"40%\" style=\"float:right\"/>';\n }\n if (info)\n {\n content += info;\n }\n if (link)\n {\n content += '<br/><br/><a href=\"' + link + '\" target=\"_blank\">More information about ' + name + ' on the web</a>';\n }\n content += '</div>' +\n '</div>';\n\n // Set the content of the InfoWindow\n infoWindow.setContent(content);\n\n // Open the InfoWindow\n infoWindow.open(map, marker);\n\n }); //end click listener\n });//end markers each loop\n\n }//end if markersExist\n // console.timeEnd('loadPins');\n } //end loadPins()", "title": "" }, { "docid": "94a715f2b0f13fd41f543a1ac0787098", "score": "0.45978478", "text": "function requestListings() {\n\treturn {type:\"LISTINGS_REQUEST\"};\n}", "title": "" }, { "docid": "742a73e7832e0928a97f15e1c2492898", "score": "0.4595168", "text": "async listSharesSegment(marker, options = {}) {\n const { span, updatedOptions } = createSpan(\"ShareServiceClient-listSharesSegment\", options);\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n try {\n const res = await this.serviceContext.listSharesSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));\n // parse protocols\n if (res.shareItems) {\n for (let i = 0; i < res.shareItems.length; i++) {\n const protocolsStr = res.shareItems[i].properties.enabledProtocols;\n res.shareItems[i].properties.protocols = toShareProtocols(protocolsStr);\n }\n }\n return res;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "title": "" }, { "docid": "e7e2247af3e0323f770946d183bce226", "score": "0.45850745", "text": "listAllObjectsResponses(request) {\n return oci_common_1.genericPaginateResponses(request, req => this.listObjects(req), res => res.listObjects.nextStartWith, (req, nextPageToken) => (req.start = nextPageToken));\n }", "title": "" }, { "docid": "11a84fac75d432b655dfdb4688706a17", "score": "0.45717397", "text": "function showListings() {\n\t\tconst bounds = new google.maps.LatLngBounds();\n\t\t// Extend the boundaries of the map for each marker and display the marker\n\t\tfor ( let i = 0; i < markers.length; i++ ) {\n\t\t\tmarkers[i].setMap(map);\n\t\t\tbounds.extend(markers[i].position);\n\t\t}\n\t\tmap.fitBounds(bounds);\n\t}", "title": "" }, { "docid": "5dc7cded3253a8cd8be3d029428da666", "score": "0.45606038", "text": "function showListings(locations) {\n let bounds = new google.maps.LatLngBounds(); \n for (let location of locations) {\n findAndSetLocationMarker(bounds, location);\n }\n}", "title": "" }, { "docid": "52ee42ab3110c54489cc1872db86383f", "score": "0.45546553", "text": "function listClick() {\n google.maps.event.trigger(this.marker, 'click');\n}", "title": "" }, { "docid": "12d03e838c2863933dca78f390ef6bb9", "score": "0.4548306", "text": "bucketIndexList(timerange) {\n const pos1 =\n Generator.getBucketPosFromDate(timerange.begin(), this._length);\n const pos2 =\n Generator.getBucketPosFromDate(timerange.end(), this._length);\n const indexList = [];\n if (pos1 <= pos2) {\n for (let pos = pos1; pos <= pos2; pos++) {\n indexList.push(`${this._size}-${pos}`);\n }\n }\n return indexList;\n }", "title": "" }, { "docid": "1e759b93d634e3a2779c5f9de67f5cf4", "score": "0.4547144", "text": "function displayList() {\n // clear bucket list element\n bucketListEl.innerHTML = \"\";\n\n // add a message to user when they have no items in their list\n if (bucketList.length === 0)\n {\n bucketListEl.innerHTML += \"<li><i>No items yet</i></li>\";\n }\n\n // show all bucket list items\n bucketList\n .forEach((item, i) => {\n // create a list element and cross it out if the user has completed the item\n const li = document.createElement(\"li\");\n li.className = item.complete ? \"strikethrough\" : \"\";\n\n // create a checkbox that is used to select items to toggle or delete\n const checkbox = document.createElement(\"input\");\n checkbox.type = \"checkbox\";\n checkbox.id = `item${i}`;\n\n // add a label that can also toggle the checkbox\n const label = document.createElement(\"label\");\n label.textContent = item.task;\n label.setAttribute(\"for\", `item${i}`);\n \n // add both items to the list item\n li.appendChild(checkbox);\n li.appendChild(label);\n\n // add the list item to the bucket list element\n bucketListEl.appendChild(li);\n });\n}", "title": "" } ]
684b690b7d4410755638d8b3ecdb6753
showInput end /custom scroll init
[ { "docid": "bc64cd6e7439b54dca012c88ca0f66a5", "score": "0.0", "text": "function customScrollInit(){\n\t/*main navigation*/\n\tif($('.panel-frame').length){\n\t\t$('.panel-frame, .drop-visible__holder').mCustomScrollbar({\n\t\t\t//axis:\"x\",\n\t\t\ttheme:\"minimal-dark\",\n\t\t\tscrollbarPosition: \"inside\",\n\t\t\tautoExpandScrollbar:true\n\t\t});\n\t}\n\t/*main navigation end*/\n\n\t/*produce minimal*/\n\tvar $produceMinimal = $(\".produce-minimal\");\n\tif($produceMinimal.length){\n\t\t$produceMinimal.mCustomScrollbar({\n\t\t\ttheme:\"minimal-dark\",\n\t\t\tscrollbarPosition: \"inside\",\n\t\t\tautoExpandScrollbar:true\n\t\t});\n\t}\n\t/*produce minimal end*/\n\n\t/*produce full*/\n\tvar $produceFull = $('.location-info__holder, .produce-full-holder, .produce-small__holder');\n\tif($produceFull.length){\n\t\t$produceFull.mCustomScrollbar({\n\t\t\tscrollbarPosition: \"outside\",\n\t\t\tautoExpandScrollbar:true\n\t\t});\n\t}\n\t/*produce full end*/\n\n\t/*product custom scroll*/\n\tvar $productMenu = $('.product-box__menu');\n\tif($productMenu.length){\n\t\t$productMenu.mCustomScrollbar({\n\t\t\ttheme:\"minimal-dark\",\n\t\t\tscrollbarPosition: \"inside\",\n\t\t\tautoExpandScrollbar:true\n\t\t});\n\t}\n\tvar productMenu = $('.product-menu');\n\tproductMenu.find('.product-box__menu').equalHeight({\n\t\tamount: 3,\n\t\tuseParent: true,\n\t\tparent: productMenu,\n\t\tresize: true\n\t});\n\n\t/*product custom scroll end*/\n}", "title": "" } ]
[ { "docid": "7e936a5a97a105545c52d28a78bb55ed", "score": "0.6774413", "text": "enter() {\n this.callcallbacks(this.getinput());\n this.input.value = \"\";\n window.scroll(window.scrollX, document.body.scrollHeight);\n }", "title": "" }, { "docid": "061d523866f8de0fb3b93a5c496a92e9", "score": "0.6744328", "text": "function qodeOnWindowScroll() {\r\n\r\n }", "title": "" }, { "docid": "676afaeddf2a12f539466fc62de0e2b8", "score": "0.65722555", "text": "function init(){\n\n Form.init($input);\n\n $scrollDown.on('click',function(){\n $(this).addClass('hide');\n gsap.to(window, .5, {scrollTo: {y: $(window).height() , ease: Power3.easeOut}});\n });\n}", "title": "" }, { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.6444414", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.6444414", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.6444414", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.6444414", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "138e785d76a506967b8f5611afd94d40", "score": "0.64356124", "text": "function updateScroll(){\n if (outputScrollCheckbox.checked) {\n outputContainer.scrollTop = outputContainer.scrollHeight;\n }\n}", "title": "" }, { "docid": "359f8616702353f21a07786252ee42e0", "score": "0.64243114", "text": "function qodefOnWindowScroll() {\n \n }", "title": "" }, { "docid": "359f8616702353f21a07786252ee42e0", "score": "0.64243114", "text": "function qodefOnWindowScroll() {\n \n }", "title": "" }, { "docid": "359f8616702353f21a07786252ee42e0", "score": "0.64243114", "text": "function qodefOnWindowScroll() {\n \n }", "title": "" }, { "docid": "3a896cb79435821c0c8c6d102a07aa12", "score": "0.62837905", "text": "scrollDown() \n {\n\t\tthis.cliContainer.scrollTop(10000);\n }", "title": "" }, { "docid": "49a9b2719f4ea618423e8c21fe4f37b3", "score": "0.6175274", "text": "onScrollEnd() {\n this.createQtip();\n }", "title": "" }, { "docid": "b7ed21e0f1f7a6a3c9f5612f93691af7", "score": "0.6143037", "text": "function eltdfOnWindowScroll() {\n }", "title": "" }, { "docid": "ad08620727346fb1216c6324d65c8f1b", "score": "0.6116383", "text": "function eltdfOnWindowScroll() {\n\t eltdfInitPortfolioPagination().scroll();\n }", "title": "" }, { "docid": "c1bfee64025541ad4bebd62558ac717d", "score": "0.61054635", "text": "function mkdfOnWindowScroll() {\n \n }", "title": "" }, { "docid": "c1bfee64025541ad4bebd62558ac717d", "score": "0.61054635", "text": "function mkdfOnWindowScroll() {\n \n }", "title": "" }, { "docid": "d7ca27652637ebdf76084bd5e4d7c66f", "score": "0.61015266", "text": "_next() {\n this._scroll(true);\n }", "title": "" }, { "docid": "d633ad0edc3cba34a84ec4e2780e5416", "score": "0.606986", "text": "function scrolling() {\n var scrollPercent = input[0].scrollTop / (scrollHeight() - 480);\n scroller.scroll(scrollPercent);\n }", "title": "" }, { "docid": "5317f9d404e5b403b0d5d49b9cd007db", "score": "0.60632336", "text": "inputFocused(inputName) {\n this.formFocused = true;\n const heights = {\n 'name': 0,\n 'email': 60,\n 'password': 120,\n 'passwordConfirmation': 180\n };\n this.refs.scrollView.scrollTo({x: 0 , y: heights[inputName], animated: true});\n }", "title": "" }, { "docid": "f1712a631f943ed4ef0521bbe0c4f3c6", "score": "0.6057215", "text": "function alert_scroll (title, input){\n\tif (input instanceof Array) input = input.join (\"\\r\");\n\tvar w = new Window (\"dialog\", title);\n\tvar list = w.add (\"edittext\", undefined, input, {multiline: true, scrolling: true});\n\tlist.maximumSize.height = w.maximumSize.height-100;\n\tlist.minimumSize.width = 450;\n\tw.add (\"button\", undefined, \"Close\", {name: \"ok\"});\n\tw.show ();\n}", "title": "" }, { "docid": "775c9501addc9ab89030f82e07d23e63", "score": "0.605357", "text": "function onScrollEnd() {\n\t\t\tvar tHead = scrollEvent[1]\n\t\t\tvar tBody = scrollEvent[3]\n\t\t\tvar tForm = formName\n\t\t\tvar wicketCall = scrollEvent[13]\n\t\t\t\n\t\t\tvar currentScrollTop = DS.scroller[tForm].scrollTop;\n\t\t\tvar scrollDiff = DS.Servoy.TableView.needToUpdateRowsBuffer(tBody,tForm);\n\t\t\t\n\t\t\t//destroy custom scrollbar and put contents back where servoy can find them\n\t\t\tif (Servoy.TableView.isAppendingRows) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t//put contents of small scrollbar div back into parent container and update scroll position so it looks the same\n\t\t\t\t\tvar contents = DS.scroller[tForm].contentContainerNode.innerHTML;\n\t\t\t\t\tDS.scroller[tForm].destroy();\n\t\t\t\t\t$('#' + tBody + ' .ftscroller_container').remove();\n\t\t\t\t\t$('#' + tBody).html(contents);\n\t\t\t\t\t$('#' + tBody).scrollTop(currentScrollTop);\n\t\t\t\t\t\n\t\t\t\t\t//remove scrollbar while we wait for tiny scrollbars to be added\n\t\t\t\t\t$('#' + list.id).css('overflow-y','hidden');\n\t\t\t\t\t\n\t\t\t\t\t//recreate scrollbar and set scroll position\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\tscrollbarSmall(formName); \n\t\t\t\t\t\tDS.scroller[tForm].scrollTop = currentScrollTop;\n\t\t\t\t\t},1000);\n\t\t\t\t\t\n\t\t\t\t\tif (function() {\n\t\t\t\t\t\tonABC();\n\t\t\t\t\t\treturn Wicket.$('tBody') != null;\n\t\t\t\t\t}.bind(this)()) {\n\t\t\t\t\t\tWicket.showIncrementally('indicator');\n\t\t\t\t\t}\n\t\t\t\t\tvar wcall = wicketAjaxGet(wicketCall + '&scrollDiff=' + scrollDiff + '&currentScrollTop=' + currentScrollTop, function() {\n\t\t\t\t\t\thideBlocker();;\n\t\t\t\t\t\tWicket.hideIncrementally('indicator');\n\t\t\t\t\t}.bind(this), function() {\n\t\t\t\t\t\tonAjaxError();;\n\t\t\t\t\t\tWicket.hideIncrementally('indicator');\n\t\t\t\t\t}.bind(this), function() {\n\t\t\t\t\t\tif (!\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tonABC();\n\t\t\t\t\t\t\treturn Wicket.$(tBody) != null;\n\t\t\t\t\t\t}.bind(this)()) {\n\t\t\t\t\t\t\t//maybe put recreate mini in here...\n\n\t\t\t\t\t\t\tWicket.hideIncrementally('indicator');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonABC();\n\t\t\t\t\t\treturn Wicket.$(tBody) != null;\n\t\t\t\t\t});\n\t\t\t\t},0)\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3f11b00dcce6d8ca64cc1e825aabc400", "score": "0.6051514", "text": "function mkdfOnWindowScroll() {\n\n }", "title": "" }, { "docid": "3f11b00dcce6d8ca64cc1e825aabc400", "score": "0.6051514", "text": "function mkdfOnWindowScroll() {\n\n }", "title": "" }, { "docid": "3f11b00dcce6d8ca64cc1e825aabc400", "score": "0.6051514", "text": "function mkdfOnWindowScroll() {\n\n }", "title": "" }, { "docid": "8bdc6c8b0964e94017559865e165297a", "score": "0.60496914", "text": "function initiScroll(){\n var timeWrapper = new IScroll('.time_wrapper', scrolloptions);\n var timeLineWrapper = new IScroll('.timeline_wrapper', scrolloptions);\n \n timeWrapper.on('scroll', function(event) {\n var scrollPos = parseInt(this.x) * (-1);\n var percent = (scrollPos / maxscrolltimeinnerfull);\n timeLineWrapper.scrollTo(-(maxscrolltimeline * percent),0)\n });\n \n timeLineWrapper.on('scroll', function(event) {\n var scrollPos = parseInt(this.x) * (-1);\n var percent = (scrollPos / maxscrolltimeline);\n timeWrapper.scrollTo(-(maxscrolltimeinnerfull * percent),0);\n });\n }", "title": "" }, { "docid": "59756fd85005bc4b712a36384e4f994c", "score": "0.6025006", "text": "function enterScroll() { \n document.body.style.overflow = 'hidden';\n if (!focus) {\n setActiveNodes([])\n }\n }", "title": "" }, { "docid": "6d4533c9b62cde61e7fceed936e37d13", "score": "0.6024151", "text": "function mkdfOnWindowScroll() {\n }", "title": "" }, { "docid": "35e56b94eed3e28f885852dd3bbff3eb", "score": "0.6010707", "text": "function fScroll(val)\n{\n var hidScroll = document.getElementById('hidScroll');\n hidScroll.value = val.scrollTop;\n}", "title": "" }, { "docid": "0bd0ea89ddbc52d95672256f325bff55", "score": "0.5992817", "text": "function qodefOnWindowScroll() {\n qodef.scroll = $(window).scrollTop();\n }", "title": "" }, { "docid": "5f594032b84f0bbe3b699081387a55e4", "score": "0.5967421", "text": "function eltdfOnWindowScroll() {\n\t}", "title": "" }, { "docid": "abf26e1d1ada783ea7ba19ede702490d", "score": "0.5955754", "text": "function scrollToSubmitEnd() {\n // ...\n }", "title": "" }, { "docid": "15da2951528764f553e35c39b8f2b51d", "score": "0.5945292", "text": "function eltdOnWindowScroll() {\n\n }", "title": "" }, { "docid": "58ef5bfe7eb3aa74330dd097327018cd", "score": "0.5935477", "text": "function scroll() {\r\n\t\t\tslotScroller.scrollTop(top);\r\n\t\t}", "title": "" }, { "docid": "7d5c15af1c34a7d7ed27687f9a2d4918", "score": "0.5923439", "text": "function fp_scroll(){\n updatePageSection();\n updateProgressBar(calculateScrollPercentage());\n showContent(gl_currentSection);\n}", "title": "" }, { "docid": "ebec67927f2fcd3a7ce10d1f423b5cb9", "score": "0.59022117", "text": "_scrollToEnd() {\n const { order } = this._lastRenderedValues();\n this.setScrollTop(order === 'asc' ? this._getScrollableElement().scrollHeight - this._getScrollableElement().clientHeight : 0);\n }", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.58959466", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.58959466", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.58959466", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.58959466", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.58959466", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "665122938d36786f3d9590b99e500d61", "score": "0.58803445", "text": "function customScroll(){\n\t\n\t\t$(\".elenco_popup\").mCustomScrollbar({\n\t\t \n\t\t\taxis: \"y\",\n\t\t\tautoHideScrollbar: true,\n\t\t\tmouseWheel: { \n\t\t\t\n\t\t\t\tenable: true,\n\t\t\t\taxis: \"y\"\t\n\t\t\t},\n\t\t\ttheme: \"rounded-dark\"\n\t\t \n\t\t});\n\t\n}", "title": "" }, { "docid": "b7a5a2ee8489473fdd394e7d565325c5", "score": "0.58357227", "text": "function scroll(output) {\n $(\".repl\").animate({\n scrollTop: output.height(),\n },\n 50\n );\n }", "title": "" }, { "docid": "0af4449acc69b542097226b07977222c", "score": "0.5822077", "text": "function updateScroll(){if(!elements.li[0])return;var height=elements.li[0].offsetHeight,top=height*ctrl.index,bot=top+height,hgt=elements.scroller.clientHeight,scrollTop=elements.scroller.scrollTop;if(top<scrollTop){scrollTo(top);}else if(bot>scrollTop+hgt){scrollTo(bot-hgt);}}", "title": "" }, { "docid": "0af4449acc69b542097226b07977222c", "score": "0.5822077", "text": "function updateScroll(){if(!elements.li[0])return;var height=elements.li[0].offsetHeight,top=height*ctrl.index,bot=top+height,hgt=elements.scroller.clientHeight,scrollTop=elements.scroller.scrollTop;if(top<scrollTop){scrollTo(top);}else if(bot>scrollTop+hgt){scrollTo(bot-hgt);}}", "title": "" }, { "docid": "8282470996d9cfc6cbc81cc97c24c379", "score": "0.5778843", "text": "function Scrollable() {}", "title": "" }, { "docid": "cfe4397409c56acef6b99a0b6a571983", "score": "0.574576", "text": "windowScrolledUp() {\n // this.productIndex += 10;\n this.searchProduct();\n }", "title": "" }, { "docid": "32bb24c7ba1a126708bcd1fe1a5534e3", "score": "0.5735707", "text": "handleScroll() {\n\t\tAnimationsUpdateDimensions();\n\t\tthis.hideShowCanvases();\n\t}", "title": "" }, { "docid": "3bcd27466db48442e816a9036412925e", "score": "0.57296175", "text": "function setOutput(){\n if(httpObject.readyState == 4){\n var response = httpObject.responseText;\n var objDiv = document.getElementById(\"result\");\n objDiv.innerHTML += response;\n objDiv.scrollTop = objDiv.scrollHeight;\n var inpObj = document.getElementById(\"msg\");\n inpObj.value = \"\";\n inpObj.focus();\n \n $(\"#result\").getNiceScroll().resize();\n }\n }", "title": "" }, { "docid": "49bcf4d6a0d0845d5a7e477be29f287c", "score": "0.57284683", "text": "function crea_scroll_dettaglio_opere() {\r\n\tdistruggi_scroll()\r\n\tmyScroll_dettaglio_opere = new iScroll('wrapper_dettaglio', {snap: 'li', momentum: true, hScrollbar: false, vScrollbar: false,hScroll:false/*, onScrollEnd: function (){ mostra_foto()}*/})\r\n}", "title": "" }, { "docid": "b09e18dc54a5aeb9329713e5f0ab4f87", "score": "0.57147115", "text": "displayOnScroll() {\r\n $(window).on('scroll', () => {\r\n this.display();\r\n });\r\n }", "title": "" }, { "docid": "61245efa51feba8b1b24f05f0ce68c17", "score": "0.57085174", "text": "function scrollToInput() {\n var pageContent = smartSelect.parents('.page-content');\n if (pageContent.length === 0) return;\n var paddingTop = parseInt(pageContent.css('padding-top'), 10),\n paddingBottom = parseInt(pageContent.css('padding-bottom'), 10),\n pageHeight = pageContent[0].offsetHeight - paddingTop - picker.height(),\n pageScrollHeight = pageContent[0].scrollHeight - paddingTop - picker.height(),\n newPaddingBottom;\n var inputTop = smartSelect.offset().top - paddingTop + smartSelect[0].offsetHeight;\n if (inputTop > pageHeight) {\n var scrollTop = pageContent.scrollTop() + inputTop - pageHeight;\n if (scrollTop + pageHeight > pageScrollHeight) {\n newPaddingBottom = scrollTop + pageHeight - pageScrollHeight + paddingBottom;\n if (pageHeight === pageScrollHeight) {\n newPaddingBottom = picker.height();\n }\n pageContent.css({'padding-bottom': (newPaddingBottom) + 'px'});\n }\n pageContent.scrollTop(scrollTop, 300);\n }\n }", "title": "" }, { "docid": "00cbd71f4f8e11a5c031a46ee307050f", "score": "0.57065624", "text": "function customScroll() {\n $(\".favorite__wrap-list\").mCustomScrollbar({\n\t callbacks:{\n\t onInit:function(){\n\n\t \t// Adiciona elemento para fazer o gradient no final do scroll\n\t \t// após o plugin terminar de ser carregado.\n\t\t\t\t$('.favorite__wrap-list').append('<span class=\"favorite__mask\"></span>');\n\t\t }\n\t }\n\t});\n}", "title": "" }, { "docid": "7aa4ca2fe93ecc3527f441b27fa2bfde", "score": "0.5704552", "text": "_onScroll(_adj) {\n }", "title": "" }, { "docid": "43ee8aec26979bcbaef5c6dfdb9e905d", "score": "0.5701525", "text": "function processDescScrollOut() {\r\n\tsetImgSrc(\"scrollImg\",\"../image/PORT_SCROLL_BAR.png\" );\r\n}", "title": "" }, { "docid": "1d9320fd516c2dc1dcb32d1919499597", "score": "0.5694783", "text": "function changeScrollPostionAndValue(obj, option) {\n var parentNode = obj.parent();\n var idx = eval(obj.attr('idx'));\n var step = obj.outerHeight();\n parentNode.get(0).scrollTop = (idx + 1) * step - parentNode.outerHeight();\n if (option.autoUpdate) {\n parentNode.siblings('input').val(obj.get(0).innerHTML);\n }\n }", "title": "" }, { "docid": "36ff13d792cf73eb0fc0273b9415b4e8", "score": "0.5678404", "text": "function ScrollToSteamInputBox()\n{\n\tvar WindowHeight = $(\".stream_windows\").height();\n\tvar InputBoxHeight = $(\".input_box\").height();\n\tvar InputBoxTopMargin = parseInt($(\".input_box\").css('marginTop'))\n\tvar DesiredYOffset = (WindowHeight + InputBoxHeight + InputBoxTopMargin) / 2;\n\twindow.scrollTo(0,DesiredYOffset);\n}", "title": "" }, { "docid": "01d1fb56191c1d1d0e3fca53474b3696", "score": "0.5669466", "text": "_onScroll(e) {\n const screen = screenInfo(e);\n this._scroll = screen.scrolly;\n }", "title": "" }, { "docid": "1217f987f130026f894c2a11bc314b74", "score": "0.5659576", "text": "function updateAutoScroll() {\n // Only allow it if you have results, of course\n if(autoResults) {\n // Get the new result (position error checking when hitting up and down)\n var new_auto = autoResults[autoPos];\n lastAuto = new_auto; // Make sure hitting left or right won't screw it up\n $search_input.val(new_auto); // Set it in the search bar\n $search_auto.find('.auto-result').each(function(i) {\n // Make sure only the proper line is selected\n var $el = $(this);\n if(autoPos === i + 1) { // Since the real index 0 is your original query\n $el.addClass('selected');\n } else {\n $el.removeClass('selected');\n }\n });\n }\n }", "title": "" }, { "docid": "6eee1ffe538ae3dc2c74df7ad013bbac", "score": "0.56588715", "text": "function scrollDown(input) {\n var clientHeight = input[0].clientHeight;\n var scrollHeight = input[0].scrollHeight;\n var scrollTop = input[0].scrollTop;\n var isScrolledToBottom = scrollHeight - clientHeight <= scrollTop;\n if (!isScrolledToBottom) {\n input[0].scrollTop = scrollHeight - clientHeight;\n }\n }", "title": "" }, { "docid": "a33b4c56e38f0fb0ff9e141979ed136f", "score": "0.5654076", "text": "function fScrollMove(what)\n{\n var hidScroll = document.getElementById('hidScroll');\n document.getElementById(what).scrollTop = hidScroll.value;\n}", "title": "" }, { "docid": "0dfc082f15cc11c4551b9c6887285385", "score": "0.5615763", "text": "function scrollDown(base) {\r\n window.scrollTo(0, base);\r\n $(\"#entry\").focus();\r\n}", "title": "" }, { "docid": "37238ba54b20dca2d18ac56dc590378b", "score": "0.5596829", "text": "function ExplorEbyscroll(){\n\tvar t=$('#mCSB_1_container').offset();\n\tvar t=t.top;\n\t//for category zIndex \n//\tif(t<=-364){\n//\t\t$('#LefT').css('zIndex','2502');\n//\t\t$('#CenteR').css('zIndex','2525');\t\t\n//\t}else{\n//\t\t$('#LefT').css('zIndex','2525');\n//\t\t$('#CenteR').css('zIndex','2502');\t\t\n//\t}\n\t//for category guide and search show\n\tif(t<=-605){\n\t\t$('#ToP_scroll').css('display','block');\t\t\n\t}else{\n\t\t$('#ToP_scroll').css('display','none');\t\t\t\t\t\t\n\t}\t\t\t\n}", "title": "" }, { "docid": "d6ea9f7e0ada4c8c00ecdfdd5d1aa3c9", "score": "0.55930984", "text": "function txtScroll(e){var t=100;e.find(\".jsScroll_2\").html(e.find(\".jsScroll_1\").html());setInterval(function(){var t=e.find(\".jsScroll_2\").height()-e.scrollTop();if(t>0){var n=e.scrollTop()+1;e.scrollTop(n)}else e.scrollTop(0)},t)}", "title": "" }, { "docid": "eaae4c5809ef6b2cb20c6f02744d4617", "score": "0.5581549", "text": "preload() {\n this.input.maxPointers = 1\n this.cursors = this.input.keyboard.createCursorKeys()\n this.scrollable = new ScrollablePlugin(this, this.plugins)\n this.scrollable.start(-300, 800, [\"drag\", \"wheel\"])\n }", "title": "" }, { "docid": "92e70027b5cb87a8722296f6ee8c2095", "score": "0.55762225", "text": "function crea_scroll_dettaglio_opere_foto() {\r\n\tmyScroll_dettaglio_opere_foto = new iScroll('wrapper_dettaglio_foto', {momentum: false, hScrollbar: false, vScrollbar: false, hScroll:true, vScroll:false/*, onScrollEnd: function (){ mostra_foto()}*/})\r\n}", "title": "" }, { "docid": "9ae6ae1c4e8825947a7d9e62291da73c", "score": "0.5565943", "text": "function bindScroll() {\n\t\tif ((jQuery(window).scrollTop() + jQuery(window).height() > jQuery(document).height() - 100) && config.text_speakEndPage != null && config.text_speakEndPage != \"\") {\n\t\t\tjQuery(window).unbind('scroll');\n\t\t\tresponsiveVoice.speak(GetRandomMsg(config.text_speakEndPage), 'Dutch Female');\n\t\t\ttrackEvent('agentFeature', 'scrollEnd');\n\t\t}\n\t}", "title": "" }, { "docid": "2c1816a64207bb54121841e774018156", "score": "0.55626523", "text": "function scroll(input,direction){\n var ni={};\n ni[\"channels\"]=input.channels;\n ni[\"period\"]=input.period;\n ni[\"filters\"]=input.filters;\n var st = new Date(input.st.replace(/ /,'T') + \"Z\");\n var et = new Date(input.et.replace(/ /,'T') + \"Z\");\n var diff = et - st; // millisecons\n var shift = scrollAdjustment*diff;\n if(direction==\"left\"){\n st = new Date(st - shift); \n et = new Date(et - shift); \n }else{\n st = new Date(+st + shift); \n et = new Date(+et + shift); \n }\n ni[\"st\"]=st.toISOString().slice(0,19).replace(/T/,' ');\n ni[\"et\"]=et.toISOString().slice(0,19).replace(/T/,' ');\n return ni;\n}", "title": "" }, { "docid": "dcb278c70ed230360e70281690a58dca", "score": "0.5562276", "text": "function scrollDown() { // Scrolling down means the scrollbar scrolls down. The canvas moves up.\n\t if (firstLine<totalVisibleHeight)\n\t {\n\t\t\tfirstLine++;\n\t\t\tvisibleYStart++;\n\t\t\tdoRedraw();\n\t\t\tupdateScrollbarY(true,0); // Show a part of the scrollbar again\n }\n }", "title": "" }, { "docid": "ce12cb935aed94ccd77808fe1c1e99b4", "score": "0.5561857", "text": "function updateScroll() {\n codediv.scrollTop = codediv.scrollHeight;\n}", "title": "" }, { "docid": "f990dcbbed1e3587c8ac267412491f6f", "score": "0.55616474", "text": "function scrollDown(base) {\n window.scrollTo(0, base);\n $(\"#entry\").focus();\n}", "title": "" }, { "docid": "a96cabdabb85da495da1616587a0cc4c", "score": "0.5543694", "text": "function OnInput() {\n this.style.height = \"auto\";\n this.style.height = (this.scrollHeight) + \"px\";\n}", "title": "" }, { "docid": "e0acff9349dde9f5da8a2b5448b7e6f6", "score": "0.55350864", "text": "function infiniteScroll(){\n getAndDisplayResults();\n}", "title": "" }, { "docid": "630421aba9a04fd7a073286fe8d0b653", "score": "0.55347294", "text": "displayAfterScroll_() {\n const scrollTop = this.viewport_.getScrollTop();\n const viewportHeight = this.viewport_.getSize().height;\n const scrollHeight = this.viewport_.getScrollHeight();\n if (scrollHeight < viewportHeight * 2) {\n this.removeOnScrollListener_();\n return;\n }\n\n // Check user has scrolled at least one viewport from init position.\n if (scrollTop > viewportHeight) {\n this.deferMutate(() => {\n setStyles(this.element, {\n 'display': 'block',\n });\n this.viewport_.addToFixedLayer(this.element);\n this.scheduleLayout(this.ad_);\n this.removeOnScrollListener_();\n });\n }\n }", "title": "" }, { "docid": "f4bb180f35c11cf72dfca05b725f500f", "score": "0.55220884", "text": "keepScrolled () {\n try {\n // Keeps scrolled to the bottom\n const textarea = document.getElementById('ipfsTerminal')\n if (textarea) {\n textarea.scrollTop = textarea.scrollHeight\n }\n } catch (error) {\n console.warn(error)\n }\n }", "title": "" }, { "docid": "dad0ead09543680e083d60ad096bed29", "score": "0.55219537", "text": "function scrollDisplay () {\n // Nice scroll to last message\n $(\"#screen\").scrollTo('100%', 0); \n }", "title": "" }, { "docid": "e2b455ac18eb25fe133b002e810c75da", "score": "0.5504166", "text": "function scrollend(event){\n\t//console.log(event.currentPage);\n\t//activeTab(event.currentPage);\n}", "title": "" }, { "docid": "4d09ac92ef4a2a57f9795581f804dbf7", "score": "0.54997987", "text": "function endScroll() { /*debug*///console.log(\"Carousel-endScroll()\");\n\t\t\tthis._slideNext.stop();\n\t\t\tthis._slidePrev.stop();\n\t\t}", "title": "" }, { "docid": "99c2bcda79fa33aa7cc491b372ddc3fb", "score": "0.5495167", "text": "onScrollBottom() {}", "title": "" }, { "docid": "7f053d341d91a5db3f929dbef480e5c0", "score": "0.5491891", "text": "function Scroll(){\n\t$('.album').mCustomScrollbar(\n\t\t{\n\t\t set_width:false,\n \t\t set_height:false,\n \t\t horizontalScroll:false,\n \t\t scrollInertia:500,\n \t\t scrollEasing:'easeInCubic',\n \t\t mouseWheel:true,\n \t\t autoDraggerLength:true,\n \t\t \t\n\t\t scrollButtons:\n\t\t \t{\n\t\t enable:true,\n\t\t scrollType:\"continuous\",\n\t\t scrollSpeed:50,\n\t\t scrollAmount:50\n\t\t \t},\n\t\t advanced:\n\t\t \t{\n updateOnBrowserResize:true,\n updateOnContentResize:true,\n autoExpandHorizontalScroll:false,\n autoScrollOnFocus:true, \n \t},\n callbacks:{ onScrollStart:function(){} } \t\n\t\t }\t\n\t);\t\t\n}", "title": "" }, { "docid": "0d96a923fbaf82c098b48ad419c6c7bb", "score": "0.54874176", "text": "function qodefSideAreaScroll(){\n\n var sideMenu = $('.qodef-side-menu');\n\n if(sideMenu.length){ \n sideMenu.niceScroll({ \n scrollspeed: 60,\n mousescrollstep: 40,\n cursorwidth: 0, \n cursorborder: 0,\n cursorborderradius: 0,\n cursorcolor: \"transparent\",\n autohidemode: false, \n horizrailenabled: false \n });\n }\n }", "title": "" }, { "docid": "3f740846fd036e5270aab1231e7fcb4f", "score": "0.5468161", "text": "'*~scroll'() {\n if (!this.modal) return;\n this.checkDragFinished();\n this._lastChildScrollTime = performance.now();\n // Wiping touch state\n this._dragStartY = null;\n this._dragDeltaY = null;\n }", "title": "" }, { "docid": "710bb7ca112422156adf7d66c42e969f", "score": "0.546695", "text": "_scrollHandler () {}", "title": "" }, { "docid": "0748f2fe958af2a4c297d67c2f149873", "score": "0.5458001", "text": "function mkdfOnWindowScroll() {\n mkdf.scroll = $(window).scrollTop();\n }", "title": "" }, { "docid": "2be51a539961e87cc563d59c4d5ce35e", "score": "0.5456302", "text": "function moveScroller(){\n\t\t\t\t$scroller.css('left', (increment * index) - ($scroller.width() / 2));\n\t\t\t\t$inputs.eq(index).attr('checked', 'checked');\n\t\t\t\t$select.prop('selectedIndex', index);\n\t\t\t\tshowOverlay();\n\t\t\t\t$value.text(values[index]);\n\t\t\t\t$this.trigger('onmoveincrementalslider', index);\n\t\t\t}", "title": "" }, { "docid": "d7ae2877c1667ce6276c2fa3c7d099c2", "score": "0.5453282", "text": "set listenWindowScroll(value) {\n this.windowScroll = convertToBoolProperty(value);\n }", "title": "" }, { "docid": "92d62da86d35dd48f74d6a1f0974f019", "score": "0.54515594", "text": "function initScroll() {\n\t\t\t\twindow.addEventListener(\"scroll\", function(evt) {\n\t\t\t\t\t\tblood.canvas.style.top = \"-\" + window.scrollY + \"px\";\n\t\t\t\t\t\tcuts.canvas.style.top = \"-\" + window.scrollY + \"px\";\n\t\t\t\t}, false);\n\t\t}", "title": "" }, { "docid": "be9eae45080b76e492eef0a3a21f7ebf", "score": "0.54203165", "text": "scrollToPosition(){\n\tconst c = this.getDocsContainer(),\n\t\t pixelsPerPage = this.pixelsPerPg(c.scrollHeight),\n\t\t topOfPage = pixelsPerPage * (this.state.activePage - 1);\n\n\tif(topOfPage!=c.scrollTop)\n\t c.scrollTop = topOfPage;\n\n\t//add the onscroll handler after short delay\n\tsetTimeout(()=>(c.onscroll=this.setScrollTimeout),ADD_ONSCROLL_DELAY);\n }", "title": "" }, { "docid": "b062fc114e8b028f5ea9c06a87bd40f2", "score": "0.541645", "text": "function niceScroll() {\n if (winWidth >= 767) {\n $(\"body\").css('overflow','hidden').niceScroll({\n cursorcolor: \"rgb(45, 54, 76)\",\n cursorwidth: \"7px\",\n cursorborder: \"0\",\n cursorborderradius: '0',\n zIndex: '999999'\n });\n\n $(\"#endContent\").niceScroll({\n cursorcolor: \"rgb(45, 54, 76)\",\n cursorwidth: \"5px\",\n });\n } else {\n $(\"body, #endContent\").niceScroll({cursorwidth: \"0\", cursorborder: \"0\"});\n $(\"body\").css('overflow', 'visible');\n }\n }", "title": "" }, { "docid": "a605dbf39a085e5930e56e4e24b6917b", "score": "0.5416109", "text": "callback() {\n scrollToVarDefn( textEditor, t.name, range );\n }", "title": "" }, { "docid": "0df5d51dc060faa9c5a9480f6566d949", "score": "0.541465", "text": "handleScroll(){\n // detatch the IOPanel if we scroll lower than 80px\n this.setState({\n detachIOPanel: window.scrollY > 80\n });\n }", "title": "" }, { "docid": "edeb4360ee5069818a872e1c8c37da15", "score": "0.54137087", "text": "menuScrollInit() {\n this.screenHeight = document.body.clientHeight - parseFloat($(\".up-top\").css(\"height\"));\n let allMenuLen = parseFloat($(\".left-wrap\").css(\"height\"));\n if (this.screenHeight < allMenuLen) {\n this.showMenuScroll = true;\n $(\".left-wrap\").css('top', $(\".left-scrollTop\").css(\"height\"));\n } else {\n this.showMenuScroll = false;\n $(\".left-wrap\").css('top', '0');\n }\n }", "title": "" }, { "docid": "6d06a67a42786c5c1148ccf8f31712f1", "score": "0.54081523", "text": "function searchScroll() {\n var heightScroll = $(document).height() - $(window).height() - 430;\n\n var scrollTop = jQuery(window).scrollTop();\n if (scrollTop >= heightScroll) {\n $('#next-step').removeClass('scrollDown');\n }\n else {\n $('#next-step').addClass('scrollDown');\n }\n}", "title": "" }, { "docid": "32bd7cf38a596aaaee5550cccba52008", "score": "0.5398094", "text": "onStart(detail) {\n // We have to prevent default in order to block scrolling under the picker\n // but we DO NOT have to stop propagation, since we still want\n // some \"click\" events to capture\n if (detail.event.cancelable) {\n detail.event.preventDefault();\n }\n detail.event.stopPropagation();\n hapticSelectionStart();\n // reset everything\n cancelAnimationFrame(this.rafId);\n const options = this.col.options;\n let minY = (options.length - 1);\n let maxY = 0;\n for (let i = 0; i < options.length; i++) {\n if (!options[i].disabled) {\n minY = Math.min(minY, i);\n maxY = Math.max(maxY, i);\n }\n }\n this.minY = -(minY * this.optHeight);\n this.maxY = -(maxY * this.optHeight);\n }", "title": "" }, { "docid": "9733684637ae0c83ccfac73f111b331d", "score": "0.53965", "text": "function leaveScroll() { \n document.body.style.overflow = 'auto';\n if (!focus) {\n setActiveNodes([])\n }\n }", "title": "" }, { "docid": "b0dccbc0f6ffce7f7d51e0da3e479704", "score": "0.53950083", "text": "function setupInputBox() {\r\n\r\n }", "title": "" }, { "docid": "28a2e157a18f2ce1e887886d17416ff7", "score": "0.5389297", "text": "function mkdfSideAreaScroll(){\n\n var sideMenu = $('.mkdf-side-menu');\n\n if(sideMenu.length){ \n sideMenu.niceScroll({ \n scrollspeed: 60,\n mousescrollstep: 40,\n cursorwidth: 0, \n cursorborder: 0,\n cursorborderradius: 0,\n cursorcolor: \"transparent\",\n autohidemode: false, \n horizrailenabled: false \n });\n }\n }", "title": "" }, { "docid": "dfd5da1730f53ee6ce34e11b265e8353", "score": "0.53844196", "text": "function onScroll() {\n\tpreviousScrollY = currentScrollY;\n\tcurrentScrollY = window.scrollY;\n\tfireIt();\n}", "title": "" }, { "docid": "6db3c80d3250ee0f55027d6742fe3be8", "score": "0.53832835", "text": "inputFocused (refName) {\n setTimeout(() => {\n let scrollResponder = this.refs.scrollView.getScrollResponder();\n scrollResponder.scrollResponderScrollNativeHandleToKeyboard(\n React.findNodeHandle(this.refs[refName]),\n 110, //additionalOffset\n true\n );\n }, 50);\n }", "title": "" }, { "docid": "545bb7f543b1f546cfd72cfda0bcad94", "score": "0.537932", "text": "get outputsScrolled() {\n return this._outputsScrolled;\n }", "title": "" }, { "docid": "c89bf97279fbbb2912c3a0d44cfc230e", "score": "0.5375702", "text": "function scrollDown() {\n scrollCurrentSlideBy(0, -100);\n lastDeltaY = 0;\n }", "title": "" } ]
f977a9b266d2e951bc18bcf83bd6cac1
Draw a marker on the timeline indicating where the question is Chrome incorrectly reports metadata is loaded before duration is set so this function will recall itself on a 1 second timeout if duration is not loaded
[ { "docid": "5fabc12276ddc457b6535d350454f782", "score": "0.71852237", "text": "function addMarker(timelineSelector) {\n\t\tif(popcorn.video.readyState <= 0 || isNaN(popcorn.video.duration) || popcorn.video.duration <= 0) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tconsole.log(\"Duration is not loaded so waiting a second to try again\");\n\t\t\t\taddMarker(timelineSelector);\n\t\t\t},1000);\n\t\t} else {\n\t\t\tmarker = document.createElement(\"span\");\n\t\t\tmarker.setAttribute(\"class\", \"quiz_marker quiz_incomplete\");\n\t\t\tvar timePercent = (options.start / popcorn.video.duration * 100);\n\t\t\tmarker.style.marginLeft = timePercent + '%';\n//\t\t\tmarker.style.marginRight = (99-timePercent)+'%';\n\t\t\tmarker.style.width = '0.5%';\n\t\t\tvar timelineElement = document.querySelector(options.timeline);\n\t\t\tif(timelineElement) {\n\t\t\t\ttimelineElement.appendChild(marker);\n\t\t\t}\t\t\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "e17ba2c04128c1d717facdd1626274db", "score": "0.6061502", "text": "function setTimer(marker) {\n setTimeout(function () {\n marker.setAnimation(null);\n }, 3000);\n}", "title": "" }, { "docid": "41d7a930548997d6d5af35ede44a4ad0", "score": "0.55882126", "text": "function addMarkerWithTimeout(position, timeout) {\r\n window.setTimeout(function() {\r\n\r\n var marker;\r\n marker = new google.maps.Marker({\r\n position: position,\r\n map: map,\r\n icon: position.icon,\r\n animation: google.maps.Animation.DROP\r\n });\r\n markers.push(marker);\r\n (function(marker){\r\n google.maps.event.addListener(marker,'click',function()\r\n {\r\n if(!infoLocal){\r\n infoLocal = new google.maps.InfoWindow();\r\n }\r\n\r\n var output = \"\";\r\n output +=\"<p>Nombre: \"+position.nombre+\"</p>\";\r\n output +=\"<p>Descripcion:</p><p>\"+position.descripcion+\"</p>\";\r\n output +=\"<p>Nombre de la tapa: \"+position.nombre_tapa+\"</p>\";\r\n output +=\"<p>Descripcion de la tapa:</p><p>\"+position.descripcion_tapa+\"</p>\";\r\n output +=\"<p>Foto tapa</p><img src='\"+position.nombre+\"'>'</p>\";\r\n\r\n infoLocal.setContent(output);\r\n infoLocal.open(map,marker);\r\n infos.push(infoLocal);\r\n });\r\n })(marker);\r\n\r\n }, timeout);\r\n}", "title": "" }, { "docid": "75deacc15982cbed940c74438c151796", "score": "0.5481853", "text": "function AnimationMetadata() {}", "title": "" }, { "docid": "75deacc15982cbed940c74438c151796", "score": "0.5481853", "text": "function AnimationMetadata() {}", "title": "" }, { "docid": "4336f83705788d8579608c6677cbea13", "score": "0.54107493", "text": "function AnimationMetadata() { }", "title": "" }, { "docid": "4336f83705788d8579608c6677cbea13", "score": "0.54107493", "text": "function AnimationMetadata() { }", "title": "" }, { "docid": "b72f87718764657460166aa18426d5ad", "score": "0.52718437", "text": "function addMarkerWithTimeout(position, timeout) {\r\n\r\n window.setTimeout(function() {\r\n\r\n var marker;\r\n marker = new google.maps.Marker({\r\n position: position,\r\n map: infoGlobalMapa.map,\r\n icon: position.icon,\r\n animation: google.maps.Animation.DROP\r\n });\r\n\r\n infoGlobalMapa.markers.push(marker);\r\n\r\n (function(marker){\r\n google.maps.event.addListener(marker,'click',function()\r\n {\r\n if(!infoGlobalMapa.infoLocal){\r\n\r\n infoGlobalMapa.infoLocal = new google.maps.InfoWindow();\r\n }\r\n\r\n var output = \"\";\r\n output +=\"<p>Nombre:</p><p><b>\"+position.nombre+\"</b></p>\";\r\n output +=\"<p>Descripcion:</p><p><b>\"+position.descripcion+\"</b></p>\";\r\n output +=\"<p>Foto tapa</p><img style='width:140px;height:70px;' src='\"+position.foto+\"'>'</p>\";\r\n output +=\"<br><button class='tapas' id='\"+position.nombre+\"'>Ver tapas</button>\";\r\n\r\n infoGlobalMapa.infoLocal.setContent(output);\r\n infoGlobalMapa.infoLocal.open(infoGlobalMapa.map,marker);\r\n infoGlobalMapa.infos.push(infoGlobalMapa.infoLocal);\r\n });\r\n })(marker);\r\n\r\n }, timeout);\r\n}", "title": "" }, { "docid": "7a0a44afae1b8f8c6114120473a7f447", "score": "0.52621645", "text": "function redrawTimeline() {\r\n timeline.destroy();\r\n timeline = new vis.Timeline(container, items, groups, options);\r\n timeline.on('select', onSelect);\r\n if(death != undefined) {\r\n timeline.addCustomTime(death, 'deces');\r\n }\r\n tooltipsCreated = false;\r\n}", "title": "" }, { "docid": "bfd6267e1dc3e02e5d48dcde1170fad8", "score": "0.52333105", "text": "function AnimationSequenceMetadata() {}", "title": "" }, { "docid": "bfd6267e1dc3e02e5d48dcde1170fad8", "score": "0.52333105", "text": "function AnimationSequenceMetadata() {}", "title": "" }, { "docid": "f6f7d9353b9470070589c02e79d5222e", "score": "0.5212461", "text": "function showTooltipTimeout()\n\t{\n\t\tif (current_elem != null)\n\t\t{\n\t\t\tshow_delta += time_delta;\n\t\t\tif (show_delta < show_delay)\n\t\t\t{\n\t\t\t\t//Repeat the call of timeout\n\t\t\t\t_wnd.setTimeout(showTooltipTimeout, time_delta);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tshow_delta = 0;\n\t\t\t\tshow();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "793e4eaac0a1a7a175232ab1040b5f3e", "score": "0.51771444", "text": "function addMarkerWithTimeout(position, info, timeout) {\n window.setTimeout(function() {\n var marker = new google.maps.Marker({\n position: position,\n map: map,\n animation: google.maps.Animation.DROP\n });\n marker.addListener('click', function() {\n infoWindow.setContent(info);\n infoWindow.open(map, marker);\n });\n markersArr.push(marker); // All the marker will be stored in the reserved array */\n }, timeout);\n}", "title": "" }, { "docid": "689326d9e9e024ee68d2e4204b35343b", "score": "0.5158975", "text": "function AnimationAnimateMetadata() { }", "title": "" }, { "docid": "689326d9e9e024ee68d2e4204b35343b", "score": "0.5158975", "text": "function AnimationAnimateMetadata() { }", "title": "" }, { "docid": "06aebb990879dc0d2d29544f5d675ffa", "score": "0.51428246", "text": "function initMedia() {\n\t\tvar player = mejs.players[0];\n\t\t\t\n\t\tif (!player.media.playing)\n\t\t{\n\t\t\tplayer.media.playing = true;\n\t\t\tplayer.media.play();\n\t\t}\n\n\t\t// TODO: make sure this works... some FLV lack proper metadata!\n\t\tvar duration = player.media.duration;\n\t\tif (isNaN(duration) || duration == 0)\n\t\t{\n\t\t\t// try again once there's a real duration\n\t\t\tsetTimeout(initMedia, 500);\n\t\t\treturn;\n\t\t}\n\n\t\tplayer.media.pause();\n\n\t\t//var duration = 319; // for mockup purposes of EasterCemetaryVisit.mov\n\n\t\t// find timestamps and convert them to links\n\t\tvar timerail = jQuery('.mejs-time-rail');\n\t\tvar timerail_width = jQuery('.mejs-time-rail .mejs-time-total').css('width');\n\t\tconsole.log('timerail width: ' + timerail_width);\n\t\tconsole.log('duration: ' + duration);\n\n\t\ttimerail.css('position', 'relative');\n\t\tjQuery('div.scrolling-text').each(function (scrollIdx,scrollTextEl) {\n\n\t\t\tjQuery(scrollTextEl).find('span.timestamp').each(function (index) {\n\t\t\t\tindex = index+1 // start from 1 instead of 0\n\t\t\t\tvar time = convertTimestampToTime(jQuery(this).text());\n\t\t\t\t//console.log('timespan ' + index + ' @ ' + jQuery(this).text() + ' (' + time + ')');\n\t\t\t\t\n\t\t\t\ttimerail.append('<div id=\"marker_' + index + '\">'+index+'</div>');\n\t\t\t\tjQuery('.mejs-time-rail #marker_'+index).css({\n\t\t\t\t\t'position': 'absolute',\n\t\t\t\t\t'color': 'white',\n\t\t\t\t\t'left': (time*parseInt(timerail_width)*1.0/duration)+'px',\n\t\t\t\t\t'bottom': '-14px'});\n\t\t\t\t\n\t\t\t\tjQuery(this).replaceWith('<a href=\"#\" onclick=\"jQuery(\\'video,audio\\')[0].player.setCurrentTime('+time+');return false;\" class=\"timestamp\" timestamp=\"' + time + '\">' + index + '</a>');\n\t\t\t});\n\n\t\t\t// bind scroll event to detect manual scrolling\n\t\t\tjQuery(scrollTextEl).hover(\n\t\t\tfunction(e) {\n\t\t\t\tjQuery(e.currentTarget).attr('pauseScrolling', 1);\n\t\t\t},\n\t\t\tfunction(e) {\n\t\t\t\tjQuery(e.currentTarget).attr('pauseScrolling', 0);\n\t\t\t});\n\t\t});\n\n\n\t\t// begin autoscrolling behavior\n\t\tsetInterval(function() {\n\t\t\t\t// TODO: div.scrollable text should be a text render style ideally - currently implemented directly in theme templates\n\t\t\t\tvar currentTime = player.media.currentTime;\n\t\t\t\tjQuery('.scrolling-text').each(function(index, el) {\n\t\t\t\t\tif (jQuery(el).attr('pauseScrolling') == 1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tel.timestamps = jQuery(el).find('a.timestamp');\n\t\t\t\t\tel.prevTs = null;\n\t\t\t\t\tel.timestamps.each(function(ti,tel) {\n\t\t\t\t\t\tif (parseInt(jQuery(tel).attr('timestamp')) <= currentTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tel.prevTs = jQuery(tel);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif (el.prevTs !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tjQuery(el).animate({scrollTop: el.prevTs.position().top + jQuery(el).scrollTop() - jQuery(el).position().top }, 900);\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t}, 1000);\n\t}", "title": "" }, { "docid": "be28e0882f24b2b936d9b16b1ae31fc6", "score": "0.5132711", "text": "function prepareTimeline() {\n\n let timeLine = '';\n let experience = data.info;\n let countExperience = experience.length;\n for (; countExperience > 0; countExperience--) {\n let index = countExperience - 1;\n timeLine += '<div class=\"timeline__unit\">' +\n '<div class=\"timeline__unit__left-information\">' +\n '<div class=\"timeline__unit__left-information__date\">' + experience[index].time + '</div>' +\n '<div class=\"timeline__unit__left-information__position\">' + experience[index].pos + '</div></div>' +\n '<div class=\"timeline__unit__diagram\">' +\n '<div class=\"timeline__unit__diagram__dot\"></div>' +\n '<div class=\"timeline__unit__diagram__line__job\"></div>' +\n '</div>' +\n '<div class=\"timeline__unit__right-information\">' +\n '<div class=\"timeline__unit__right-information__name-of-place\">' + experience[index].header + '</div>' +\n '<div class=\"timeline__unit__right-information__responsibility\">' + experience[index].body + '</div></div>' +\n '</div>';\n }\n\n let education = data.education;\n for (let countEducation = 0; countEducation < education.length; countEducation++) {\n timeLine += '<div class=\"timeline__unit\">' +\n\n '<div class=\"timeline__unit__left-information\">' +\n '<div class=\"timeline__unit__left-information__date\">' + education[countEducation].time + '</div>' +\n '<div class=\"timeline__unit__left-information__position\">' + education[countEducation].pos + '</div></div>' +\n '<div class=\"timeline__unit__diagram\">' +\n '<div class=\"timeline__unit__diagram__dot\"></div>' +\n '<div class=\"timeline__unit__diagram__line__study\"></div>' +\n '</div>' +\n '<div class=\"timeline__unit__right-information\">' +\n '<div class=\"timeline__unit__right-information__name-of-place\">' + education[countEducation].header + '</div>' +\n '<div class=\"timeline__unit__right-information__responsibility\">' + education[countEducation].body + '</div></div>' +\n '</div>';\n }\n return timeLine.split(\"\").reverse().join(\"\").replace('__enil__margaid__tinu__enilemit', '').split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "5c367ab99863faa4230d0ee24244f3be", "score": "0.5118232", "text": "_checkForMarkerClick() {\n const trackClip = this.get('clip.content');\n const currentAudioTime = trackClip.getCurrentAudioTime();\n const markers = trackClip.get('markers') || [];\n\n const marker = markers.find(({ time }) => {\n return (currentAudioTime - MARKER_CLICK_WINDOW <= time) &&\n (currentAudioTime + MARKER_CLICK_WINDOW >= time);\n });\n\n if (marker && isValidNumber(marker.time)) {\n console.log('clicked marker', marker);\n\n const arrangement = trackClip.get('arrangement.content');\n const quantizedBeat = arrangement.get('beatGrid').quantizeBeat(arrangement.getCurrentBeat());\n const quantizedAudioTime = trackClip.getAudioTimeFromArrangementBeat(quantizedBeat);\n\n const prevAudioStartTime = trackClip.get('audioStartTime');\n const timeDelta = quantizedAudioTime - marker.time;\n trackClip.set('audioStartTime', prevAudioStartTime - timeDelta);\n trackClip.set('markers', []);\n }\n }", "title": "" }, { "docid": "9708047505c5155780e66594715af77c", "score": "0.5115718", "text": "function plotPlaynBackAlarm(bubbleMessage, coord) {\r\n\r\n var icon = new google.maps.MarkerImage(\"../images/carmarker_Alarm.png\",\r\n new google.maps.Size(26, 40),\r\n new google.maps.Point(0, 0),\r\n new google.maps.Point(15, 31));\r\n\r\n var alarmMarker = new google.maps.Marker({\r\n position: coord,\r\n icon: icon,\r\n draggable: false,\r\n zIndex: 28800001\r\n });\r\n\r\n //Remove the info bubble on map click.\r\n google.maps.event.addListener(map, 'click', function (evt) {\r\n if (infowindow) {\r\n infowindow.close();\r\n }\r\n });\r\n\r\n google.maps.event.addListener(alarmMarker, 'mouseover', function () {\r\n if (infowindow) {\r\n infowindow.close();\r\n }\r\n infowindow.setContent(bubbleMessage);\r\n infowindow.open(map, alarmMarker);\r\n });\r\n\r\n google.maps.event.addListener(alarmMarker, 'mouseout', setTimeout(function () {\r\n if (infowindow) {\r\n infowindow.close();\r\n }\r\n }, 3000));\r\n\r\n return alarmMarker;\r\n}", "title": "" }, { "docid": "920ba110890d796d228da91af9f42f13", "score": "0.51025325", "text": "function showMarkerText() {//{{{\r\n\tif (infowindow) {\r\n\t\tinfowindow.close();\r\n\t}\r\n\tmap.panTo(new google.maps.LatLng(39.94102, 82.699584));\r\n\tsetTimeout(function() {\r\n\t\tzoomTo(8, actTimeOut, function() {\r\n\t\t\tloopAddMarker(markerText, function() {\r\n\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\tslideDown('theEnd', actTimeOut, function() {\r\n\t\t\t\t\t\tvar theEndText = '<div id=\"theEndText\">Happy birthday to my dearest Wen Jing :) <br />' + \r\n\t\t\t\t\t\t'<button data-toggle=\"wshare\" data-type=\"weibo\">分享到微博</button>' + \r\n\t\t\t\t\t'<button onclick=\"window.location.reload();\">再看一次</button></div>';\r\n\t\t\t\tdocument.getElementById('theEnd').innerHTML = theEndText;\r\n\t\t\t\t\t});\r\n\t\t\t\t}, 5000);\r\n\t\t\t});\r\n\t\t})\r\n\t}, actTimeOut);\r\n}//}}}", "title": "" }, { "docid": "34dd70babc95e40687e8cf3694a1fc7d", "score": "0.50657547", "text": "function AnimationSequenceMetadata() { }", "title": "" }, { "docid": "34dd70babc95e40687e8cf3694a1fc7d", "score": "0.50657547", "text": "function AnimationSequenceMetadata() { }", "title": "" }, { "docid": "eb3857471af0847ef50de0980e0e3279", "score": "0.50588334", "text": "_createEntranceAnim(tweet) {\n const tl = new TimelineLite();\n const $image = this.$.image;\n const media = tweet.gdqMedia;\n if (!media) {\n return tl;\n }\n let didStartingWork = false; // GSAP likes to run .calls again when you .resume\n tl.call(() => {\n if (didStartingWork) {\n return;\n }\n didStartingWork = true;\n tl.pause();\n $image.$svg.image.load(media[0].media_url_https).loaded(() => {\n tl.resume();\n }).error(error => {\n nodecg.log.error(error);\n tl.clear();\n tl.resume();\n });\n }, undefined, null, '+=0.03');\n tl.addLabel('start', '+=0.03');\n tl.to(this._bgRect.node, 0.75, {\n drawSVG: '100%',\n ease: Linear.easeNone\n }, 'start');\n tl.add($image.enter(), 'start');\n tl.add(this.$.tweet._createEntranceAnim(tweet), 'start+=0.1');\n tl.to(this.$.label, 0.334, {\n scaleX: 1,\n ease: Sine.easeInOut,\n onComplete: () => {\n this.$.label.style.color = '';\n }\n }, 'start+=0.4');\n tl.to(this._bgRect.node, 0.5, {\n 'fill-opacity': this.backgroundOpacity,\n ease: Sine.easeOut\n }, 'start+=1');\n if (media.length > 1) {\n media.slice(1).forEach(mediaEntity => {\n tl.add(this._createHold());\n tl.add(this._changeImage(mediaEntity.media_url_https));\n });\n }\n return tl;\n }", "title": "" }, { "docid": "0031d9a5d66421a0d7b9a641878bf91a", "score": "0.5054391", "text": "function animateMarker(timestamp) {\n setTimeout(function() {\n requestAnimationFrame(animateMarker);\n\n radius += (maxRadius - radius) / framesPerSecond;\n opacity -= (.9 / framesPerSecond);\n\n map.setPaintProperty('point', 'circle-radius', radius);\n map.setPaintProperty('point', 'circle-opacity', opacity);\n\n if (opacity <= 0) {\n radius = initialRadius;\n opacity = initialOpacity;\n }\n\n }, 1000 / framesPerSecond);\n\n }", "title": "" }, { "docid": "ad3adac9ed7f36c19fbcc107e622dce2", "score": "0.5046081", "text": "function addMarkerWithTimeout(position, timeout) {\n window.setTimeout(() => {\n markers.push(\n new google.maps.Marker({\n position: position,\n map,\n animation: google.maps.Animation.BOUNCE,\n })\n );\n }, timeout);\n}", "title": "" }, { "docid": "43a94c558c65e6e37f30f034d318f14a", "score": "0.50403506", "text": "function AnimationAnimateMetadata() {}", "title": "" }, { "docid": "43a94c558c65e6e37f30f034d318f14a", "score": "0.50403506", "text": "function AnimationAnimateMetadata() {}", "title": "" }, { "docid": "1bf0099110091039cbbaa4a5f22f4408", "score": "0.5036017", "text": "function startTimeout() {\n\n\ttemporaryMarkerTimeout = setTimeout(function() {\n\t\ttemporaryMarker.setMap(null);\n\t\ttemporaryMarkerInfobox.setMap(null);\n\t}, 5000);\n}", "title": "" }, { "docid": "c40f424602f08955a181726720c05386", "score": "0.5021783", "text": "function redraw() {\n\n var currentTime = videoPlayer.currentTime;if (editting == false){\n\tdocument.getElementById(\"end-time\").value = currentTime; //change this if editting so it doesn't get weird.\n\t\n\t\t\n\t}\n\t\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (currentAnnotation) {\n drawAnnotation(currentAnnotation, ctx);\n }\n\n for (var i = 0; i < annotationList.length; i++) {\n var ann = annotationList[i];\n if (currentTime >= ann.start && currentTime <= ann.end) {\n drawAnnotation(ann, ctx);\n }\n }\n updateList();\n}", "title": "" }, { "docid": "db54be03a5e1bce5678562f890090c45", "score": "0.5004667", "text": "waitFor_raceMeetingOverview_TrackInformation() {\n if(!this.raceMeetingOverview_TrackInformation.isVisible()){\n this.raceMeetingOverview_TrackInformation.waitForVisible(5000);\n }\n }", "title": "" }, { "docid": "7d9c952851d16db81cdc8c3624f94eed", "score": "0.49977675", "text": "function zeroDurationLine()\r\n{\r\n durationRange.value=0;\r\n}", "title": "" }, { "docid": "e3b17709716fccf1c81515036cb97e28", "score": "0.49821162", "text": "function startTimeout() {\n\n temporaryMarkerTimeout = setTimeout(function () {\n temporaryMarker.setMap(null);\n temporaryMarkerInfobox.setMap(null);\n session.map.temporaryMarker = null;\n }, 5000);\n}", "title": "" }, { "docid": "0b3f6f37795933399224e11f172cf675", "score": "0.49811393", "text": "function AnimationQueryMetadata() {}", "title": "" }, { "docid": "0b3f6f37795933399224e11f172cf675", "score": "0.49811393", "text": "function AnimationQueryMetadata() {}", "title": "" }, { "docid": "8c55ef28ea4f44175fa9d6d7b07fcf11", "score": "0.49802712", "text": "function avlAnimation(map, icon, clock) {\n\t\n\tvar startTime, endTime, rate, currentIndex, elapsedTime,\n\t\tlastTime, lineDone, paused, durations, sprite, positions;\n\t\n\tvar ready = false;\n\t\n\t// create icon for animation and initialize values\n\t// positions is an array of position values: { lat, lon, timestamp }\n\tfunction animation(data) {\n\t\n\t\t// remove old sprite.\n\t\tif (sprite)\n\t\t\tmap.removeLayer(sprite);\n\t\t\n\t\tpositions = data\n\t\t\n\t\tready = true;\n\t\tstartTime = positions[0].timestamp;\n\t\tendTime = positions[positions.length-1].timestamp;\n\t\trate = 1;\n\t\n\t\tcurrentIndex = 0; // this means we're going to 1\n\t\n\t\telapsedTime = positions[0].timestamp,\n\t\t\tlastTime = 0,\n\t\t\tlineDone = 0;\n\t\n\t\tpaused = true;\n\t\n\t\tdurations = []\n\t\tfor (var i = 0; i < positions.length - 1; i++)\n\t\t\tdurations.push(positions[i+1].timestamp - positions[i].timestamp);\n\t\t\n\t\tsprite = L.marker(positions[0], {icon: icon}).addTo(map);\n\t\tclock.textContent = parseTime(elapsedTime);\n\t}\n\t\n\tfunction tick() {\n\t\tvar now = Date.now(),\n\t\t\tdelta = now - lastTime;\n\t\t\n\t\tlastTime = now;\n\t\t\n\t\telapsedTime += delta * rate;\n\t\t\n\t\tlineDone += delta * rate;\n\t\t\n\t\tif (lineDone > durations[currentIndex]) {\n\t\t\t// advance index and icon\n\t\t\tcurrentIndex += 1\n\t\t\tlineDone = 0;\n\t\t\t\n\t\t\tif (currentIndex == positions.length - 1)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tsprite.setLatLng(positions[currentIndex])\n\t\t\tsprite.update()\n\t\t\telapsedTime = positions[currentIndex].timestamp\n\t\t}\n\t\telse {\n\t\t\tvar pos = interpolatePosition(positions[currentIndex], positions[currentIndex+1], durations[currentIndex], lineDone)\n\t\t\tsprite.setLatLng(pos)\n\t\t\tsprite.update()\n\t\t\t\n\t\t}\n\t\tclock.textContent = parseTime(elapsedTime);\n\t\t\n\t\tif (!paused)\n\t\t\trequestAnimationFrame(tick)\n\t}\n\t\n\tanimation.ready = function() {\n\t\treturn ready;\n\t}\n\t\n\tanimation.start = function() { \n\t\tlastTime = Date.now();\n\t\tpaused = false;\n\t\ttick();\n\t}\n\t\n\tanimation.pause = function() {\n\t\tpaused = true;\n\t}\n\t\n\tanimation.paused = function() {\n\t\treturn paused;\n\t}\n\t\n\tanimation.rate = function(_) {\n\t\tif(_)\n\t\t\trate = _;\n\t\telse\n\t\t\treturn rate;\n\t}\n\t\n\t// skip to next AVL\n\tanimation.next = function() {\n\t\tupdateToIndex(currentIndex+1);\n\t}\n\t\n\t// previous AVL\n\tanimation.prev = function() {\n\t\t// In most cases, we don't actually want to go *back* an index, just\n\t\t// restart this one. Exception: if we are less than 500ms (in realtime)\n\t\t// into this avl.\n\t\t\n\t\tvar delta = elapsedTime - positions[currentIndex].timestamp;\n\t\tif (delta/rate < 500)\n\t\t\tupdateToIndex(currentIndex-1);\n\t\telse\n\t\t\tupdateToIndex(currentIndex);\n\t}\n\t\t\n\tfunction updateToIndex(i) {\n\t\tif (i > positions.length - 1)\n\t\t\ti = positions.length - 1;\n\t\tif (i < 0)\n\t\t\ti = 0;\n\t\t\n\t\tcurrentIndex = i; //+= 1;\n\t\tlineDone = 0;\n\t\tvar avl = positions[currentIndex];\n\t\telapsedTime = avl.timestamp;\n\t\t\n\t\t// update GUI if tick won't.\n\t\tif (paused) {\n\t\t\tsprite.setLatLng(avl);\n\t\t\tsprite.update();\n\t\t\tclock.textContent = parseTime(elapsedTime);\n\t\t}\n\t}\n\t\n\tfunction parseTime(x) {\n\t\treturn new Date(x).toTimeString().slice(0, 8);\n\t}\n\t\n\t// taken from leafletMovingMarker.js\n\tvar interpolatePosition = function(p1, p2, duration, t) {\n\t var k = t/duration;\n\t k = (k>0) ? k : 0;\n\t k = (k>1) ? 1 : k;\n\t return L.latLng(p1.lat + k*(p2.lat-p1.lat), p1.lon + k*(p2.lon-p1.lon));\n\t};\n\n\n\treturn animation;\n}", "title": "" }, { "docid": "a5ab71c65b0319bd573e737d5c015f16", "score": "0.49718633", "text": "function showMissedParasites(){\n\tvar timeAnim = 500;\n\tpicture_objects.forEach(function(parasiteObj, index, tab){\n\n\t\tif(paraIndexValides.indexOf(index) == -1){\n\t\t\t\t\n\t\t\twindow.setTimeout(function()\n\t\t\t{\n\t\t\t\tcanvas_context.beginPath();\n\t\t\t\tcanvas_context.lineWidth=2/canvas_quotient;\n\t\t\t\tcanvas_context.strokeStyle=\"blue\";\n\t\t\t\tcanvas_context.setLineDash([3,2.5,3,2.5]);\n\t\t\t\tcanvas_context.rect((picture_objects[index].pos_x)/canvas_quotient, (picture_objects[index].pos_y+1)/canvas_quotient, (picture_objects[index].size_x)/canvas_quotient, (picture_objects[index].size_y+1)/canvas_quotient);\n\t\t\t\tcanvas_context.stroke();\n\n\t\t\t}, timeAnim);\n\n\t\t timeAnim +=1200/(picture_objects.length - paraIndexValides.length);\n\t\t}\n\t\t\n\t});\n}", "title": "" }, { "docid": "0139cd8904db9f0044f758a8e4f2e092", "score": "0.49522927", "text": "function drawAnimation() {\n//\tlet addr = animAddress[curAnim];\n\tvar bf = new bytebuffer(romFrameData);\n\tlet addr = bf.getInt(animAddressIndex + curAnim * 8);\n\n\tif(animTimer) {\n\t\tclearTimeout(animTimer)\n\t\tanimTimer = null;\n\t}\n//\tlet addr = animAddress[curAnim];\n\tvar bf = new bytebuffer(romFrameData);\n\t\n\tlet offset = bf.getShort(addr + curAnimAct * 2);\n\tif(offset == 0) {\n\t\tlabelInfo.innerText = \"EOF\";\n\t\treturn;\n\t}\n\tlet startAddress = addr + offset;\n\t\n\tif(addr < 0x90000)\t// obj\n\t\tloopDrawAnimation(startAddress, 0xA);\n\telse\t// player\n\t\tloopDrawAnimation(startAddress, 0xC);\n\n\tlabelInfo.innerText = 'addr:' + addr.toString(16).toUpperCase() + \"/\" + startAddress.toString(16).toUpperCase() + \" off:\"\n\t\t\t+ offset.toString(16).toUpperCase() + ' act:' + curAnimAct\n\t\t\t+ ' ' + curAnim + '/' + curAnimAct + \"/\" + (bf.getShort(addr)/2-1);\n}", "title": "" }, { "docid": "c94fa491fe4c97b33ec85e401ffde3fb", "score": "0.49443114", "text": "function AnimationQueryMetadata() { }", "title": "" }, { "docid": "c94fa491fe4c97b33ec85e401ffde3fb", "score": "0.49443114", "text": "function AnimationQueryMetadata() { }", "title": "" }, { "docid": "2fdb46d4d239ae6a991b0cee71fa6a11", "score": "0.49354333", "text": "function onLoad(start, end)\n{\n\tvar eventSource = new Timeline.DefaultEventSource(0);\n\tvar startProj = SimileAjax.DateTime.parseIso8601DateTime(start);\n\tvar endProj = SimileAjax.DateTime.parseIso8601DateTime(end);\n\tvar theme = Timeline.ClassicTheme.create();\n\ttheme.autoWidth = true;\n\ttheme.event.bubble.width = 350;\n\ttheme.event.bubble.height = 300;\n\ttheme.timeline_start = startProj;\n\ttheme.timeline_stop = endProj;\n\tvar center_val = _graph_center!='' ? _graph_center : start;\n\tvar dcenter = SimileAjax.DateTime.parseIso8601DateTime(center_val);\n\t//var dleft = SimileAjax.DateTime.parseIso8601DateTime(_left_boundary);\n\tvar d = SimileAjax.DateTime.parseIso8601DateTime(start);\n\tif (_is_single) {\n\t\ttheme.event.track.height = \"20\";\n\t\ttheme.event.tape.height = 10; // px\n\t\ttheme.event.track.height = theme.event.tape.height + 6;\n\t}\n\ttheme.event.track.offset = 20;\n\n\t// control report period resolution\n\tswitch (_zoneperiod) {\n\t\tcase 'HOUR':\n\t\t\tzone_timeline_var = Timeline.DateTime.HOUR;\n\t\t\tbreak;\n\t\tcase 'DAY':\n\t\t\tzone_timeline_var = Timeline.DateTime.DAY;\n\t\t\tbreak;\n\t\tcase 'WEEK':\n\t\t\tzone_timeline_var = Timeline.DateTime.WEEK;\n\t\t\tbreak;\n\t\tcase 'MONTH':\n\t\t\tzone_timeline_var = Timeline.DateTime.MONTH;\n\t\t\tbreak;\n\t}\n\tswitch (_intervalunit) {\n\t\tcase 'DAY':\n\t\t\t_timeline_var = Timeline.DateTime.DAY;\n\t\t\tbreak;\n\t\tcase 'WEEK':\n\t\t\t_timeline_var = Timeline.DateTime.WEEK;\n\t\t\tbreak;\n\t\tcase 'MONTH':\n\t\t\t_timeline_var = Timeline.DateTime.MONTH;\n\t\t\tbreak;\n\t}\n\n\tvar zones = [\n\t\t{ start: startProj,\n\t\t\tend: endProj,\n\t\t\tmagnify: _magnify,\n\t\t\tunit: zone_timeline_var\n\t\t}\n\t];\n\tvar bandInfos = [\n\t\tTimeline.createHotZoneBandInfo({\n\t\t\twidth:\t\t\t\"85%\",\n\t\t\tintervalUnit:\t_timeline_var,\n\t\t\tintervalPixels: 50,\n\t\t\teventSource:\teventSource,\n\t\t\tdate:\t\t\tdcenter,\n\t\t\tzones:\t\t\tzones,\n\t\t\ttheme:\t\t\ttheme,\n\t\t\talign:\t\t\t\"Top\",\n\t\t\tlayout:\t\t\t'original' // original, overview, detailed\n\t\t}),\n\t\tTimeline.createBandInfo({\n\t\t\tlayout:\t\t\t'overview',\n\t\t\tdate:\t\t\td,\n\t\t\ttrackHeight:\t0.5,\n\t\t\ttrackGap:\t\t0.2,\n\t\t\teventSource:\teventSource,\n\t\t\twidth:\t\t\t\"15%\",\n\t\t\tintervalUnit:\tTimeline.DateTime.MONTH,\n\t\t\t// showEventText: false,\n\t\t\tintervalPixels: 100,\n\t\t\ttheme :theme\n\t\t})\n\t];\n\n\tbandInfos[1].highlight = false;\n\tbandInfos[1].syncWith = 0;\n\n\tbandInfos[0].decorators = [\n\t\tnew Timeline.SpanHighlightDecorator({\n\t\t\tstartDate: startProj,\n\t\t\tendDate: endProj,\n\t\t\tinFront: false,\n\t\t\tcolor: \"#FFFFFF\",\n\t\t\topacity: 30,\n\t\t\ttheme: theme\n\t\t})\n\t];\n\tbandInfos[1].decorators = [\n\t\tnew Timeline.SpanHighlightDecorator({\n\t\t\tstartDate: startProj,\n\t\t\tendDate: endProj,\n\t\t\tinFront: false,\n\t\t\tcolor: \"#FFC080\",\n\t\t\topacity: 30,\n\t\t\t//startLabel: \"Begin\",\n\t\t\t//endLabel: \"End\",\n\t\t\ttheme: theme\n\t\t})\n\t];\n\n\ttl = Timeline.create(document.getElementById(\"tl\"), bandInfos, Timeline.HORIZONTAL);\n\teventSource.loadJSON(json, document.location.href);\n\n\t//tl.getBand(0).setMinVisibleDate(dleft);\n\t//tl.getBand(0).setMaxVisibleDate(endProj);\n\ttl.finishedEventLoading();\n\tsetupFilterHighlightControls(document.getElementById(\"controls\"), tl, [0,1], theme);\n\n}", "title": "" }, { "docid": "2c99928279d53046e108a53a72c86bd4", "score": "0.4931637", "text": "function startTooltipTimer(ele)\r\n{\r\n\tif(tooltipTimer) {\r\n\t\tclearTimeout(tooltipTimer)\r\n\t}\r\n\t\r\n\ttooltipTimer = setTimeout(function()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tshowTooltip(ele);\r\n\t\t\t\t\t}, 500);\r\n\t\r\n}", "title": "" }, { "docid": "f4a762fcf628312794ef67a7638e21ca", "score": "0.4928868", "text": "function seekLoadVideo(el) {\r\n \r\n if(el != -1) {\r\n videoPlayer.currentTime = parseInt(el.attr('id').slice(3),10) * (videoPlayer.duration/numThumbs);\r\n }\r\n \r\n curVidCanvas = el;\r\n \r\n // Reset drawing variables\r\n pause();\r\n resetDrawing();\r\n // Line up the tracking data index with the video\r\n for(var i = 0; i < jsonData.length; i++) {\r\n var t1 = jsonData[0].time/microConvert,\r\n t2 = jsonData[i].time/microConvert;\r\n \r\n if(Math.ceil(t2 - t1) == Math.ceil(videoPlayer.currentTime)) {\r\n trackingIndex = i;\r\n lastTrackingIndex = i;\r\n break;//return;\r\n }\r\n }\r\n \r\n // Draw the visualization starting at 'trackingIndex - trailLength'\r\n var start = Math.max(0, trackingIndex - trailLength),\r\n duration = trailLength;\r\n videoSeeked = true;\r\n if(start == 0) {\r\n duration = trackingIndex;\r\n }\r\n for(var i = start; i < start + duration; i++) {\r\n getVideoVisData(i);\r\n }\r\n renderVis();\r\n videoSeeked = false;\r\n}", "title": "" }, { "docid": "bff7439d89e3d6f587c9f5bb7d1a8bd8", "score": "0.49253538", "text": "function AnimationReferenceMetadata() {}", "title": "" }, { "docid": "bff7439d89e3d6f587c9f5bb7d1a8bd8", "score": "0.49253538", "text": "function AnimationReferenceMetadata() {}", "title": "" }, { "docid": "c367d9e593dc055c103f2dbef0a080df", "score": "0.49093848", "text": "function generateTimelines(camera, data){\n const position = new TimelineMax({ paused:true });\n const orientation = new TimelineMax({ paused:true, onComplete: () => {\n orientation.pause();\n position.pause();\n console.log('DONE');\n }});\n\n console.log('first pos', data.position[0]);\n console.log('last pos', data.position[data.position.length - 1]);\n position.set(camera.position, Object.assign(data.position[0], { ease: Linear.easeNone }));\n for (let i = 1; i < data.position.length; i++){\n const time = ((data.orientation[i].frame / data.header.unitsPerSecond) - (data.orientation[i-1].frame / data.header.unitsPerSecond));\n position.to(camera.position, time, {\n x: data.position[i].x,\n y:-data.position[i].y,\n z:-data.position[i].z,\n ease: Linear.easeNone\n });\n }\n\n let x = Math.abs(data.orientation[0].x*(Math.PI/180));\n let y = Math.abs(-data.orientation[0].y*(Math.PI/180));\n let z = Math.abs(-data.orientation[0].z*(Math.PI/180));\n if (x > Math.PI) x = (Math.PI*2) - x;\n if (y > Math.PI) y = (Math.PI*2) - y;\n\n orientation.set(camera.rotation, {\n x,\n y,\n z,\n ease: Linear.easeNone\n });\n\n for (let i = 1; i < data.orientation.length; i++) {\n const time = ((data.orientation[i].frame / data.header.unitsPerSecond) - (data.orientation[i-1].frame / data.header.unitsPerSecond));\n let x = Math.abs(data.orientation[i].x*(Math.PI/180));\n let y = Math.abs(-data.orientation[i].y*(Math.PI/180));\n let z = Math.abs(-data.orientation[i].z*(Math.PI/180));\n if(x > Math.PI){\n x = (Math.PI*2)-x;\n }\n if(y > Math.PI){\n y = (Math.PI*2)-y;\n }\n orientation.to(camera.rotation, time, {\n x,\n y,\n z,\n ease: Linear.easeNone\n });\n }\n\n return { position, orientation };\n}", "title": "" }, { "docid": "2a2edefe2bdfc422761d1ab1ba31fff5", "score": "0.49048132", "text": "_switchToDuration() { this._showFps = false; }", "title": "" }, { "docid": "089af570be81336d38cc90830b3f9e54", "score": "0.48922905", "text": "updateBreakOverlay() {\n if (!this.setting.breakOverlay.display || this.currentMarkerIndex < 0) {\n return;\n }\n\n var currentTime = this.player.currentTime();\n var marker = this.markersList[this.currentMarkerIndex];\n var markerTime = this.setting.markerTip.time(marker);\n\n if (\n currentTime >= markerTime &&\n currentTime <= (markerTime + this.setting.breakOverlay.displayTime)\n ) {\n if (this.overlayIndex !== this.currentMarkerIndex) {\n this.overlayIndex = this.currentMarkerIndex;\n if (this.breakOverlay) {\n\n this.breakOverlay.querySelector('.vjs-break-overlay-text').innerHTML = this.setting.breakOverlay.text(marker);\n }\n }\n\n if (this.breakOverlay) {\n this.breakOverlay.style.visibility = \"visible\";\n }\n } else {\n this.overlayIndex = NULL_INDEX;\n if (this.breakOverlay) {\n this.breakOverlay.style.visibility = \"hidden\";\n }\n }\n }", "title": "" }, { "docid": "48392a10545d4b9473b6fec70d97fd93", "score": "0.4885038", "text": "function constructTimeLineForGivenData(items)\r\n{\r\n\t var container = document.getElementById('visualization');\r\n\t // Configuration for the Timeline\r\n\t var options = {};\r\n\t // Create a Timeline\r\n\t var timeline = new vis.Timeline(container, items, options);\r\n}", "title": "" }, { "docid": "72abb1a1a26842c1fe87b76f9196cab2", "score": "0.48824742", "text": "function addTimelineChart(point) {\n // update aoi (clicked point) layer\n Map.layers().forEach(function (layer) {\n if (layer.getName() === 'aoi') {\n Map.layers().remove(layer);\n }\n });\n\n var pointLayer = ui.Map.Layer(point, { color: 'red', opacity: 0.6 }, 'aoi');\n Map.layers().add(pointLayer);\n\n // update chart and controls\n Map.widgets().reset();\n\n // create a label on the map.\n var label = ui.Label('... loading chart');\n Map.add(label);\n\n // update chart series options, this should be easier, but the ui.Chart is currently very limited, no evens like onDataLoad\n var features = ee.FeatureCollection(videoFrames.map(function (i) {\n var props = ee.Dictionary(i.reduceRegion(ee.Reducer.first(), point, 10));\n props = props.set('system:time_start', i.get('system:time_start'));\n\n return ee.Feature(null, props);\n }));\n\n // find unique property names, use to update series options\n features.toList(5000).map(function (f) {\n return ee.Feature(f).propertyNames().remove('system:id').remove('system:time_start').remove('system:index');\n }).flatten().sort().getInfo(function (bandNames) {\n var seriesCount = distinct(bandNames).length;\n\n // add chart\n var chart = ui.Chart.feature.byFeature(features, 'system:time_start');\n\n chart.setChartType('ScatterChart');\n\n var chartOptions = {\n title: null,\n chartArea: { width: '95%' },\n vAxis: {\n viewWindow: {\n max: 800,\n min: 0\n },\n textStyle: { fontSize: 12 }\n },\n hAxis: { format: 'yyyy-MM-dd', gridlines: { count: 20 }, textStyle: { fontSize: 12 } },\n lineWidth: 1,\n //curveType: 'function',\n pointSize: 4,\n series: {}\n };\n\n // update series type for RGB bands\n chartOptions.series[seriesCount - 1] = { pointSize: 0, color: '#de2d26' };\n chartOptions.series[seriesCount - 2] = { pointSize: 0, color: '#31a354' };\n chartOptions.series[seriesCount - 3] = { pointSize: 0, color: '#2b8cbe' };\n\n chart.setOptions(chartOptions);\n\n chart.style().set({\n position: 'bottom-left',\n width: '98%',\n height: '250px'\n });\n\n Map.add(chart);\n\n // when the chart is clicked, update the map and label.\n chart.onClick(function (xValue, yValue, seriesName) {\n if (!seriesName || seriesName.indexOf('vis-') !== -1) {\n print('Please select one of the sensor series');\n return;\n }\n\n if (!xValue) {\n return; // Selection was cleared.\n }\n\n // Show the image for the clicked date.\n var equalDate = ee.Filter.equals('system:time_start', xValue);\n var equalBand = ee.Filter.equals('short_name', seriesName);\n var image = ee.Image(videoFrames.filter(ee.Filter.and(equalDate, equalBand)).first());\n\n // Show a label with the date on the map.\n ee.String(ee.String(new Date(xValue).toUTCString()).cat(' ').cat(image.get('system:id'))).getInfo(function (str) {\n label.setValue(str);\n\n var layer = ui.Map.Layer(image, {}, 'chart');\n addImageAsChartLayer(layer);\n image.get('system:id').getInfo(function (id) {\n layer.setName(layer.getName() + ' ' + id);\n });\n });\n });\n\n // update label once chart is added\n label.setValue('Click a point on the chart to show the image for that date.');\n });\n }", "title": "" }, { "docid": "11ffd62b3c61ded892ba5cc5df4da466", "score": "0.48791352", "text": "finalize () {\n var _this = this\n if (this.elements.length === 0 && this.children.length === 0) {\n // Insert dummy-element to show position of the partial\n const dummyElement = $('<span>').attr('title', this.name).text(`(${this.name})`)[0]\n this.elements.push(dummyElement)\n this.start = dummyElement\n this.end = dummyElement\n }\n setTimeout(function () {\n _this.adjustMarker()\n }, 1000)\n }", "title": "" }, { "docid": "d48f7ac59aa769375eec37f67316efc7", "score": "0.48703527", "text": "function timelineSkipToEnd() {\n var timelineVideo = document.getElementById(\"timeline-video\");\n\n timelineVideo.pause();\n timelineVideo.currentTime = timelineVideo.duration;\n}", "title": "" }, { "docid": "75d59b144ee170a9e73760cb62a9d63c", "score": "0.48678708", "text": "function showTimeLineView(data) {\n showOrHideLayers(assetViewLayers,\"visible\",\"none\");\n showOrHideLayers(heatmapLayers,\"visible\",\"none\");\n\n if (data.history.length === 0) {\n console.log(\"No History For Asset in the last 24 hours\");\n showPopupNotification(\"No History For That Asset present\");\n return;\n }\n\n let geoJsonData = convertHistoryResponseToGeoJson(data);\n\n map.getSource(\"timeline-view\").setData(geoJsonData);\n map\n .getSource(\"route-line-string\")\n .setData(makeLineStringForGeoJsonTimelineView(geoJsonData));\n\n adjustMap(geoJsonData);\n\n showOrHideLayers(timelineViewLayers,\"none\",\"visible\");\n}", "title": "" }, { "docid": "5978a8bcddd60cc0318f73e9e02274fd", "score": "0.48581892", "text": "function fb_facetboard_set_timeoutinfo(src_service_id, skos_relation, base64codedWarning) {\n\tvar fb_itemname_expander2id = 'fb_itemname_expander2_'+src_service_id;\n\tvar fb_itemname_expander2 = friGetElementId(fb_itemname_expander2id);\n\t\n\tfb_itemname_expander2.setAttribute(\"class\", \"facetcontrol-td-timeout\");\n\tfb_itemname_expander2.setAttribute(\"title\", Base64.decode(base64codedWarning));\n}", "title": "" }, { "docid": "f7c7429c622817c7f45453adce98405b", "score": "0.4850636", "text": "function displayMarkersWithinTime(response) {\n var origins = response.originAddresses;\n var destinations = response.destinationAddresses;\n // Parse through the results, and get the distance and duration of each.\n // Because there might be multiple origins and destinations we have a nested loop\n // Then, make sure at least 1 result was found.\n var atLeastOne = false;\n duhVyooMahdul.searchResultsArray.removeAll();\n for (var i = 0; i < origins.length; i++) {\n var results = response.rows[i].elements;\n for (var j = 0; j < results.length; j++) {\n var element = results[j];\n if (element.status === \"OK\") {\n // Duration value is given in seconds so we make it MINUTES. We need both the value\n // and the text.\n var duration = element.duration.value / 60;\n if (duration <= duhVyooMahdul.time() && duration !== 0) {\n // Markers/elements that survived to this point are sent off to be happily married\n // by the foundTheMarker function so the data can populate the DOM.\n atLeastOne = true;\n markers[i].distanceObj = element;\n duhVyooMahdul.searchResultsArray.push(markers[i]);\n showMarkers(duhVyooMahdul.searchResultsArray());\n }\n }\n }\n }\n // Couldn't find any locations in the desired distance\n if (!atLeastOne) {\n window.alert('We could not find any locations within that distance!');\n }\n}", "title": "" }, { "docid": "0fc37ac6d49e71a27f7b2c4b6e45bdb6", "score": "0.48497525", "text": "function timeToFirstMeaningfulPaintAndTimeToInteractiveMetrics(values, model) {\n var chromeHelper = model.getOrCreateHelper(tr.model.helpers.ChromeModelHelper);\n var rendererHelper = findTargetRendererHelper(chromeHelper);\n var navigationStartFinder = new NavigationStartFinder(rendererHelper);\n var firstMeaningfulPaintHistogram = createHistogram('timeToFirstMeaningfulPaint');\n firstMeaningfulPaintHistogram.description = 'time to first meaningful paint';\n var firstInteractiveHistogram = createHistogram('timeToFirstInteractive');\n firstInteractiveHistogram.description = 'time to first interactive';\n\n function addFirstMeaningfulPaintSampleToHistogram(frameIdRef, navigationStart, fmpMarkerEvent) {\n var snapshot = findFrameLoaderSnapshotAt(rendererHelper, frameIdRef, fmpMarkerEvent.start);\n if (snapshot === undefined || !snapshot.args.isLoadingMainFrame) return;\n var url = snapshot.args.documentLoaderURL;\n if (shouldIgnoreURL(url)) return;\n\n var timeToFirstMeaningfulPaint = fmpMarkerEvent.start - navigationStart.start;\n var extraDiagnostic = {\n url: url,\n pid: rendererHelper.pid\n };\n var breakdownDiagnostic = createBreakdownDiagnostic(rendererHelper, navigationStart.start, fmpMarkerEvent.start);\n firstMeaningfulPaintHistogram.addSample(timeToFirstMeaningfulPaint, {\n \"Breakdown of [navStart, FMP]\": breakdownDiagnostic,\n \"Start\": new RelatedEventSet(navigationStart),\n \"End\": new RelatedEventSet(fmpMarkerEvent),\n \"Navigation infos\": new tr.v.d.Generic({ url: url, pid: rendererHelper.pid,\n start: navigationStart.start, fmp: fmpMarkerEvent.start })\n });\n return { firstMeaningfulPaint: fmpMarkerEvent.start, url: url };\n }\n\n var candidatesForFrameId = findFirstMeaningfulPaintCandidates(rendererHelper);\n\n for (var frameIdRef in candidatesForFrameId) {\n var navigationStart;\n var lastCandidate;\n\n // Iterate over the FMP candidates, remembering the last one.\n for (var ev of candidatesForFrameId[frameIdRef]) {\n var navigationStartForThisCandidate = navigationStartFinder.findNavigationStartEventForFrameBeforeTimestamp(frameIdRef, ev.start);\n // Ignore candidate w/o preceding navigationStart, as they are not\n // attributed to any TTFMP.\n if (navigationStartForThisCandidate === undefined) continue;\n\n if (navigationStart !== navigationStartForThisCandidate) {\n // New navigation is found. Compute TTFMP for current navigation, and\n // reset the state variables.\n if (navigationStart !== undefined && lastCandidate !== undefined) {\n data = addFirstMeaningfulPaintSampleToHistogram(frameIdRef, navigationStart, lastCandidate);\n if (data !== undefined) addTimeToInteractiveSampleToHistogram(firstInteractiveHistogram, rendererHelper, navigationStart, data.firstMeaningfulPaint, data.url);\n }\n navigationStart = navigationStartForThisCandidate;\n }\n lastCandidate = ev;\n }\n\n // Emit TTFMP for the last navigation.\n if (lastCandidate !== undefined) {\n var data = addFirstMeaningfulPaintSampleToHistogram(frameIdRef, navigationStart, lastCandidate);\n\n if (data !== undefined) addTimeToInteractiveSampleToHistogram(firstInteractiveHistogram, rendererHelper, navigationStart, data.firstMeaningfulPaint, data.url);\n }\n }\n\n values.addHistogram(firstMeaningfulPaintHistogram);\n values.addHistogram(firstInteractiveHistogram);\n }", "title": "" }, { "docid": "db31779e7f03216ef96e5cb67ae2eb0a", "score": "0.484482", "text": "function AnimationStaggerMetadata() {}", "title": "" }, { "docid": "db31779e7f03216ef96e5cb67ae2eb0a", "score": "0.484482", "text": "function AnimationStaggerMetadata() {}", "title": "" }, { "docid": "adf5505439bc4af149672732c0051bbe", "score": "0.48386377", "text": "function timerCallBack(timestamp) {\n\t\tvar drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer\n\t\t\t(drawStart = performance.now ?\n\t\t\t(performance.now() + performance.timing.navigationStart) : Date.now()) :\n\t\t\t// Integer milliseconds since unix epoch\n\t\t\ttimestamp || new Date().getTime());\n\t\tif (drawStart - animationStartTime >= 1000) {\n\t\t\tplugin._updateTargets();\n\t\t\tanimationStartTime = drawStart;\n\t\t}\n\t\trequestAnimationFrame(timerCallBack);\n\t}", "title": "" }, { "docid": "adf5505439bc4af149672732c0051bbe", "score": "0.48386377", "text": "function timerCallBack(timestamp) {\n\t\tvar drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer\n\t\t\t(drawStart = performance.now ?\n\t\t\t(performance.now() + performance.timing.navigationStart) : Date.now()) :\n\t\t\t// Integer milliseconds since unix epoch\n\t\t\ttimestamp || new Date().getTime());\n\t\tif (drawStart - animationStartTime >= 1000) {\n\t\t\tplugin._updateTargets();\n\t\t\tanimationStartTime = drawStart;\n\t\t}\n\t\trequestAnimationFrame(timerCallBack);\n\t}", "title": "" }, { "docid": "5e538c6ed55095b1e2c504a13d680247", "score": "0.48385823", "text": "function setTimeoutToMarker(marker) {\n\t_markerMap.push(marker);\n\tmarker.uid = _markerMap.length-1;\n\t\n\tsetTimeout(function(){ \n\t\tmarker.setMap(null); \n\t\tdelete _markerMap[marker.uid];\n\t\tdelete marker; \n\t}, markerTimeout);\n}", "title": "" }, { "docid": "782d3c55abc9ccd30b889f31d9e4db46", "score": "0.48312765", "text": "function animateCircle(polyline) {\r\n $(\".journeyCompleted\").show()\r\n var count = 0;\r\n var distanceInMetres;\r\n if (distance.split(\" \")[1]===\"km\"){\r\n distanceInMetres = (distance.split(\" \")[0]) * 1000;\r\n }\r\n else{\r\n distanceInMetres = (distance.split(\" \")[0]);\r\n }\r\n var metricSpeed = speed * 5 / 18;\r\n var time = distanceInMetres / metricSpeed;\r\n var factor = (100 / time) / 10;\r\n var defaultIcon = [{\r\n icon: lineSymbol,\r\n offset: '0%'\r\n }];\r\n var icons = defaultIcon;\r\n polyline.set('icons', icons);\r\n var animation = setInterval(function() {\r\n if (count <= 100) {\r\n $(\".journeyCompleted span\").text(Math.round(count)+\"%\");\r\n count = count + factor;\r\n icons[0].offset = count + '%';\r\n polyline.set('icons', icons);\r\n }\r\n else {\r\n $(\".journeyCompleted span\").text(\"100%\")\r\n icons[0].offset = 100 + '%';\r\n polyline.set('icons', icons);\r\n alert(\"Destination Arrived\");\r\n clearInterval(animation);\r\n }\r\n }, 100);\r\n }", "title": "" }, { "docid": "09a36987f89dadfe0fd8bceca7a5cfab", "score": "0.48295474", "text": "function updateMarkers(duration){\n\n\tduration = typeof duration !== 'undefined' ? duration : 500;\n\n\tif (mapVisible == false){\n\t\tg.selectAll(\"rect\")\n\t\t\t.transition()\n\t\t\t.duration(duration)\n\t\t\t.attr(\"x\", function(d) { return rect_getProperty(\"position_insight\", d, weekIndex)[0]; })\n\t\t\t.attr(\"y\", function(d) { return rect_getProperty(\"position_insight\", d, weekIndex)[1]; })\n\t\t\t.attr(\"rx\",0)\n\t\t\t.attr(\"ry\",0)\n\t\t\t.attr(\"width\", barWidth)\n\t\t\t.attr(\"height\", function(d) { return rect_getProperty(\"prediction\", d, weekIndex)[0]; })\n\t\t\t.attr(\"fill-opacity\", 0.2)\n\t\t;\n\t} else {\n\t\tg.selectAll(\"rect\")\n\t\t\t.transition()\n\t\t\t.duration(duration)\n\t\t\t.attr(\"x\", function(d) { return rect_getProperty(\"position_exploration\", d, weekIndex)[0]; })\n\t\t\t.attr(\"y\", function(d) { return rect_getProperty(\"position_exploration\", d, weekIndex)[1]; })\n\t\t\t.attr(\"height\", function(d) { return rect_getProperty(\"radius\", d, weekIndex); })\n\t\t\t.attr(\"width\", function(d) { return rect_getProperty(\"radius\", d, weekIndex); })\n\t\t\t.attr(\"rx\", function(d) { return rect_getProperty(\"radius\", d, weekIndex) / 2; })\n\t\t\t.attr(\"ry\", function(d) { return rect_getProperty(\"radius\", d, weekIndex) / 2; })\n\t\t\t.attr(\"fill-opacity\", 0.8)\n\t\t;\n\t}\n}", "title": "" }, { "docid": "b8791be4c468ede39a7909fa5c1b9f8b", "score": "0.4828171", "text": "pushMarker(start, label, index, end = this.videoElement.duration, level = 1) {\n this.marksArray.push({\n markStart: this.toSeconds(start),\n markEnd: end == this.videoElement.duration ? end : this.toSeconds(end),\n markLabel: label,\n markIndex: index,\n markLevel: level\n });\n }", "title": "" }, { "docid": "5782c6026eb05bab3ef31a46b4aa1085", "score": "0.4824407", "text": "function drawInfo() \n{\n // Fills the bottom with dark red during grace period.\n const GRACEPERIOD = 60 / game.speed;\n\n let countdownOver = game.lastTimedEvent >= 180;\n\n const line1Y = 430;\n const line2Y = 455;\n const line3Y = 480;\n\n // Only shows the 321 at first, then switches to game info\n if (!countdownOver) countdownTimer();\n else\n {\n if (game.lastTimedEvent % GRACEPERIOD != 0) ctx.fillStyle = '#550000';\n else ctx.fillStyle = '#111';\n \n ctx.fillRect(0, 400, CANVAS_SIZE, 100);\n\n displayLives();\n \n ctx.strokeStyle = CYAN;\n ctx.strokeText(\"SCORE : \" + game.score + \"/\" + game.oQty, MID_CANVAS , line2Y);\n \n if (game.pause)\n {\n ctx.font = \"20px Arial\";\n ctx.strokeStyle = CYAN;\n ctx.strokeText(\"* PAUSE *\", MID_CANVAS , line3Y);\n }\n }\n\n drawLine();\n\n // Local helper to print the lives in the appropriate color.\n function displayLives() \n {\n switch (game.lives)\n {\n case 3: ctx.strokeStyle = GREEN; break;\n case 2: ctx.strokeStyle = YELLOW; break;\n case 1: ctx.strokeStyle = RED; break;\n case 0: ctx.strokeStyle = RED; break;\n\n default: ctx.strokeStyle = GREEN; break;\n }\n \n ctx.font = \"20px Arial\";\n ctx.strokeText(\"LIVES : \" + game.lives + \"/\" + game.totalLives, MID_CANVAS , line1Y);\n }\n\n // Local helper because 7 lines of code to draw one horizontal line, wow.\n function drawLine() \n {\n ctx.strokeStyle = MAGENTA;\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(0, 400);\n ctx.lineTo(CANVAS_SIZE, 400);\n ctx.closePath();\n ctx.stroke();\n }\n}", "title": "" }, { "docid": "14028ff072ac6c65197d88bb5318246e", "score": "0.48239413", "text": "function AnimationReferenceMetadata() { }", "title": "" }, { "docid": "14028ff072ac6c65197d88bb5318246e", "score": "0.48239413", "text": "function AnimationReferenceMetadata() { }", "title": "" }, { "docid": "8c827f438ab2093a7af6df550b333e2c", "score": "0.4820779", "text": "function hideMeasurementLoadingGifAfter(sec) {\n setTimeout(function(){ \n $( getDataComponent(\"kid-measurement\") + \" .measurement-loading\").addClass(\"hidden\");\n }, sec * 1000);\n}", "title": "" }, { "docid": "f7ef8ed4be3340c4e2feab90d28d9734", "score": "0.48159742", "text": "updateSeekTooltip(event) {\n var _this$config$markers, _this$config$markers$;\n // Bail if setting not true\n if (!this.config.tooltips.seek || !is.element(this.elements.inputs.seek) || !is.element(this.elements.display.seekTooltip) || this.duration === 0) {\n return;\n }\n const tipElement = this.elements.display.seekTooltip;\n const visible = `${this.config.classNames.tooltip}--visible`;\n const toggle = show => toggleClass(tipElement, visible, show);\n\n // Hide on touch\n if (this.touch) {\n toggle(false);\n return;\n }\n\n // Determine percentage, if already visible\n let percent = 0;\n const clientRect = this.elements.progress.getBoundingClientRect();\n if (is.event(event)) {\n percent = 100 / clientRect.width * (event.pageX - clientRect.left);\n } else if (hasClass(tipElement, visible)) {\n percent = parseFloat(tipElement.style.left, 10);\n } else {\n return;\n }\n\n // Set bounds\n if (percent < 0) {\n percent = 0;\n } else if (percent > 100) {\n percent = 100;\n }\n const time = this.duration / 100 * percent;\n\n // Display the time a click would seek to\n tipElement.innerText = controls.formatTime(time);\n\n // Get marker point for time\n const point = (_this$config$markers = this.config.markers) === null || _this$config$markers === void 0 ? void 0 : (_this$config$markers$ = _this$config$markers.points) === null || _this$config$markers$ === void 0 ? void 0 : _this$config$markers$.find(({\n time: t\n }) => t === Math.round(time));\n\n // Append the point label to the tooltip\n if (point) {\n tipElement.insertAdjacentHTML('afterbegin', `${point.label}<br>`);\n }\n\n // Set position\n tipElement.style.left = `${percent}%`;\n\n // Show/hide the tooltip\n // If the event is a moues in/out and percentage is inside bounds\n if (is.event(event) && ['mouseenter', 'mouseleave'].includes(event.type)) {\n toggle(event.type === 'mouseenter');\n }\n }", "title": "" }, { "docid": "7973f2816c36af72a5224fddb7573c61", "score": "0.48157802", "text": "function start(){\n\n\t// add a line to show position (time) on graph\n\t// addPositionLine();\n\tif(data.emotions === \"true\"){\n\t\taddEmotionLabel();\n\t}\n\n\tvar svg = document.getElementById(\"svgGraph\");\n\tvar svgDoc = svg.contentDocument;\n\tvar fig = svgDoc.getElementById(data.graphElId);\n\n\tif(data.annotations){\n\t\tfor (var i = 0; i < data.annotations.length; i++){\n\t\t\tvar note = data.annotations[i];\n\t\t\tannotateSegment(note.start, note.end, note.label, note.color);\n\t\t}\n }\n\n}", "title": "" }, { "docid": "e16d25366c774a6b33bf76258a79be8e", "score": "0.48156157", "text": "function timelineSkipToStart() {\n var timelineVideo = document.getElementById(\"timeline-video\");\n \n timelineVideo.pause();\n timelineVideo.currentTime = 0;\n}", "title": "" }, { "docid": "2a55a27baddca71951ab143d4d268780", "score": "0.48107553", "text": "get av_timer () {\n return new IconData(0xe01b,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "2a55a27baddca71951ab143d4d268780", "score": "0.48107553", "text": "get av_timer () {\n return new IconData(0xe01b,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "1d3c6aaf88534d2b5fcbeee8b9c271b4", "score": "0.48072416", "text": "function plotSpeedLine( map, flyingtime, colour, count, progressbounds )\n{\n // no flying - no line\n if( flyingtime <= 0 ) {\n return;\n }\n\n // calculate how far they could have flown for\n var slowestd = flyingtime/3600 * map.og_minspeed;\n var fastestd = flyingtime/3600 * map.og_maxspeed;\n\n var fpoints = [];\n var wdtotal = 0;\n\n var task = map.og_task.points;\n\n /* put the task on the map */\n for( i = 1; i < task.length; i++ )\n {\n var llength = task[i].wlength; // how long this leg is\n\n // start point of the leg\n var ltlg = new LatLong( task[i-1].nlat, task[i-1].nlng );\n var ltlg2 = new LatLong( task[i].nlat, task[i].nlng );\n\n var bearing = LatLong.bearing( ltlg, ltlg2 );\n\n // if we are between the two we need to add the turn point\n if( slowestd <= 0 && fastestd > 0 ) {\n fpoints.push( new google.maps.LatLng( task[i-1].nlat, task[i-1].nlng ) );\n }\n\n\n // we don't start drawing until we've hit the minimum length\n if( slowestd > 0 && slowestd < llength ) {\n\n var adj = (task[i].length / llength) * slowestd;\n\n // get the point along the line (bearing + start lat/long)\n // this is our first point\n var dltlg = ltlg.destPointRad( bearing, adj );\n\n fpoints.push( new google.maps.LatLng( dltlg.dlat(), dltlg.dlong() ));\n\n\n }\n // Do the last point\n\n if( fastestd > 0 && fastestd < llength ) {\n // get the point along the line (bearing + start lat/long)\n // this is our last point\n\n var adj = (task[i].length / llength) * fastestd;\n\n var dltlg = ltlg.destPointRad( bearing, adj );\n\n // we want to add the beginning of this segment as well\n // as how far along we have gone\n fpoints.push( new google.maps.LatLng( ltlg.dlat(), ltlg.dlong() ));\n fpoints.push( new google.maps.LatLng( dltlg.dlat(), dltlg.dlong() ));\n // stop looping now\n i = task.length;\n\n }\n\n // we've done this bit so drop it out\n slowestd -= llength;\n fastestd -= llength;\n }\n\n // if we only got one point then add the end of the task to make it a line\n if( fpoints.length < 2 || fastestd >= 0 ) {\n fpoints.push( new google.maps.LatLng( task[i-1].nlat, task[i-1].nlng ));\n }\n\n\n // update viewport size\n // for( i = 1; i < fpoints.length; i++ ) {\n // progressbounds.extend( fpoints[i] );\n //}\n\n\n // draw the status line...\n var o = new google.maps.Polyline( { path: fpoints,\n strokeColor: colour,\n strokeWeight: 18,\n strokeOpacity: Math.max((count/map.og_competitors)/2),\n zIndex: 1\n });\n\n o.setMap( map );\n map.og_progressoverlays.push( o );\n\n}", "title": "" }, { "docid": "cc3927f79747034b20383c36ae09eaad", "score": "0.4800081", "text": "function createLoadedMetadata(manifest) {\n\t var canSeek$ = canSeek(videoElement).do(function () {\n\t return setInitialTime(manifest);\n\t });\n\n\t var canPlay$ = canPlay(videoElement).do(function () {\n\t log.info(\"canplay event\");\n\t if (autoPlay) {\n\t videoElement.play();\n\t }\n\t autoPlay = true;\n\t });\n\n\t return first(combineLatestStatic(canSeek$, canPlay$)).mapTo({ type: \"loaded\", value: true });\n\t }", "title": "" }, { "docid": "89a560e3d2f1a4db75237c1e86fd6a70", "score": "0.4791452", "text": "function displayTime(startTime, length) {\n var curTime = new Date().getTime();\n\n // offset 500 is to make sure the setInterval function doesn't take less than 1000 ms\n var ms;\n if (startTime === 0) ms = length + 500;\n else ms = length - (curTime - startTime) + 500; \n\n if (ms <= 0) {\n clearInterval(timer);\n chrome.browserAction.setBadgeText({text: ''});\n\n chrome.runtime.sendMessage({\n msg: \"cancelPopup\"\n })\n return;\n }\n\n // sends the timestring to the popup page\n chrome.runtime.sendMessage({\n msg: \"timeString\",\n data: msToString(ms, \"withHr\")\n })\n \n setBadge(ms);\n}", "title": "" }, { "docid": "ec9eba58281f58b51721b6edff1d9252", "score": "0.47840482", "text": "function timerCallBack(timestamp) {\n\t\t\t\tvar drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer\n\t\t\t\t\t(perfAvail ? (performance.now() + performance.timing.navigationStart) : now()) :\n\t\t\t\t\t// Integer milliseconds since unix epoch\n\t\t\t\t\ttimestamp || now());\n\t\t\t\tif (drawStart - animationStartTime >= 1000) {\n\t\t\t\t\t\t\tself._updateElems();\n\t\t\t\t\tanimationStartTime = drawStart;\n\t\t\t\t}\n\t\t\t\trequestAnimationFrame(timerCallBack);\n\t\t\t}", "title": "" }, { "docid": "ec9eba58281f58b51721b6edff1d9252", "score": "0.47840482", "text": "function timerCallBack(timestamp) {\n\t\t\t\tvar drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer\n\t\t\t\t\t(perfAvail ? (performance.now() + performance.timing.navigationStart) : now()) :\n\t\t\t\t\t// Integer milliseconds since unix epoch\n\t\t\t\t\ttimestamp || now());\n\t\t\t\tif (drawStart - animationStartTime >= 1000) {\n\t\t\t\t\t\t\tself._updateElems();\n\t\t\t\t\tanimationStartTime = drawStart;\n\t\t\t\t}\n\t\t\t\trequestAnimationFrame(timerCallBack);\n\t\t\t}", "title": "" }, { "docid": "85d9def3e48783d12bd86cdb9895b390", "score": "0.47802037", "text": "function afterMatch1(){\n PGPmarker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout('PGPmarker.setAnimation(null)',2520);\n}", "title": "" }, { "docid": "19906410c77cfd7dc7d0c44295778c8f", "score": "0.47754312", "text": "async function beforeInfoWindowMarker() {\n this.timeout(1e4);\n Object.assign(this, await gettingMap);\n this.infoWindowContent = this.infoWindow.getContent();\n window.google.maps.event.trigger(this.marker, 'click');\n}", "title": "" }, { "docid": "ffbb0c5960a9b4db5915e71b529ea861", "score": "0.47740006", "text": "handleLoadedMetaData(...args) {\n const { actions, onLoadedMetadata, startTime } = this.props;\n\n if (startTime && startTime > 0) {\n this.video.currentTime = startTime;\n }\n\n actions.handleLoadedMetaData(this.getProperties());\n\n if (onLoadedMetadata) {\n onLoadedMetadata(...args);\n }\n }", "title": "" }, { "docid": "a385ad655f55c52b14db8478b31cc52f", "score": "0.47690347", "text": "function attachStreamMetadataToPlayer(){\n $.ajax({url: \"http://sourcefabric.airtime.pro/api/live-info\",\n data: {type:\"interval\",limit:\"5\"},\n dataType: \"jsonp\",\n success: function(data) {\n var title_elm = $(\".now_playing .track_title\");\n var artist_elm = $(\".now_playing .artist\");\n var show_elm = $(\".now_playing .show_title\");\n var description_elm = $(\".now_playing .show_description\");\n var str_off_air = \"Off Air\";\n var str_offline = \"Offline\";\n if (data.current === null) {\n //title_elm.attr(\"title\", $.i18n._(\"Off Air\"));\n //artist_elm.attr(\"title\", $.i18n._(\"Offline\"));\n //Refresh in 20 seconds\n title_elm.text(str_off_air);\n artist_elm.text(str_offline);\n title_elm.attr(\"title\", str_off_air);\n artist_elm.attr(\"title\", str_offline);\n time_to_next_track_starts = 20000;\n } else {\n\n var artist = \"\";\n var track = \"\";\n //var nowPlayingHtml = \"\";\n\n show = data.currentShow[0].name;\n description = data.currentShow[0].description;\n\n if (show) {\n show_elm.html(show);\n show_elm.attr(\"title\", show_elm.text());\n }\n\n if (description) {\n description_elm.html(description);\n description_elm.attr(\"title\", description_elm.text());\n }\n\n if (data.current.type == 'livestream')\n {\n var stream_metadata = \"\";\n if (data.current.name != \"\") {\n stream_metadata = data.current.name;\n }\n\n //nowPlayingHtml += \"Live DJ\";\n //nowPlayingHtml += \"<span>\" + stream_metadata + \"</span>\";\n title_elm.text(\"Live DJ\");\n artist_elm.text(stream_metadata);\n title_elm.attr(\"title\", \"Live DJ\");\n artist_elm.attr(\"title\", artist_elm.text());\n }\n else if (data.current.type == 'track') {\n artist = data.current.metadata.artist_name;\n track = data.current.metadata.track_title;\n\n //nowPlayingHtml = \"\";\n if (artist) {\n //nowPlayingHtml += artist;\n artist_elm.html(artist);\n artist_elm.attr(\"title\", artist_elm.text());\n }\n if (track) {\n //nowPlayingHtml += \"<span>\" + track + \"</span>\";\n title_elm.html(track);\n title_elm.attr(\"title\", title_elm.text());\n song_name = track;\n }\n //title_elm.attr(\"title\", $.i18n._(\"Off Air\"));\n //artist_elm.attr(\"title\", $.i18n._(\"Offline\"));\n } else if (data.current.type == 'webstream') {\n var webstreamName = \"\";\n var webstreamMetadata = \"\";\n if (data.current.metadata === null) {\n webstreamName = data.current.name;\n } else {\n webstreamName = data.current.metadata.name;\n webstreamMetadata = data.current.metadata.live_metadata;\n }\n //nowPlayingHtml += webstreamName;\n //nowPlayingHtml += \"<span>\" + webstreamMetadata + \"</span>\";\n\n title_elm.html(webstreamName);\n title_elm.attr(\"title\", title_elm.text());\n artist_elm.html(webstreamMetadata);\n artist_elm.attr(\"title\", artist_elm.text());\n } else {\n //nowPlayingHtml += \"<span>\" + data.current.name + \"</span>\";\n title_elm.text(\"\");\n title_elm.attr(\"title\", \"\");\n artist_elm.text(data.current.name);\n artist_elm.attr(\"title\", artist_elm.text());\n }\n\n //title_elm.html(nowPlayingHtml);\n\n var current_time = new Date();\n\n var current_track_end_time = new Date(data.current.ends);\n\n if (current_track_end_time == \"Invalid Date\" || isNaN(current_track_end_time)) {\n // If the conversion didn't work (since the String is not in ISO format)\n // then change it to be ISO-compliant. This is somewhat hacky and may break\n // if the date string format in live-info changes!\n current_track_end_time = new Date((data.current.ends).replace(\" \", \"T\"));\n }\n //convert current_time to UTC to match the timezone of time_to_next_track_starts\n current_time = new Date(current_time.getTime() + current_time.getTimezoneOffset() * 60 * 1000);\n time_to_next_track_starts = current_track_end_time - current_time;\n\n //Auto-update the metadata every few seconds for live streams since we can't predict when it'll change.\n if (data.current.type == 'livestream') {\n time_to_next_track_starts = 10000;\n }\n // Add 3 seconds to the timeout so Airtime has time to update the metadata before we fetch it\n metadataTimer = setTimeout(attachStreamMetadataToPlayer, time_to_next_track_starts+3000);\n }\n\n // if (data.next === null) {\n // $(\"ul.schedule_list\").find(\"li\").html($.i18n._(\"Nothing scheduled\"));\n // } else {\n // $(\"ul.schedule_list\").find(\"li\").html(data.next.name);\n // $(\"ul.schedule_list\").find(\"li\").attr(\"title\", function () {return $(this).text();});\n // }\n }\n });\n\n //Preventative code if the local and remote clocks are out of sync.\n if (isNaN(time_to_next_track_starts) || time_to_next_track_starts < 0) {\n time_to_next_track_starts = 0;\n }\n\n}", "title": "" }, { "docid": "eabba24894d7b9058e40df4598a1939b", "score": "0.47635072", "text": "function showTimelineView(){\n\n syncAllChanges()\n w2ui.main_layout.content('main', '<div stlye=\"padding:10px;padding-top:30px;margin:10px\" id=\"graph\"></div>');\n var container = document.getElementById('graph');\n // Configuration for the Timeline\n var options = {};\n\n data = timeline2vis(case_data.timeline)\n if(data.length==0){\n $('#graph').html(\"No Timestamps to display. Add Timestamps to the timeline first and mark them as Visualizable\")\n }\n var dataset = new vis.DataSet(data)\n\n // Create a Timeline\n var timeline = new vis.Timeline(container , dataset, options);\n\n\n}", "title": "" }, { "docid": "6ace605a554df87d1dd52177835dbd91", "score": "0.47619313", "text": "function debugData(timeStart, timeEnd) {\n if (timeEnd - startSecond >= 1000) { //Collect frames for a second\n lastFrames = frames;\n frames = 0;\n startSecond = timeEnd;\n maxTotalTime = totalTimeToRender;\n }\n frames++;\n timeSinceLastFrame = timeStart - lastFrameEnd;\n totalTimeToRender = timeEnd - lastFrameEnd;\n if (maxTotalTime < totalTimeToRender) {\n maxTotalTime = totalTimeToRender;\n }\n lastFrameEnd = timeEnd;\n drawFrameTime(timeEnd - timeStart, lastFrames, timeSinceLastFrame, totalTimeToRender, maxTotalTime);\n}", "title": "" }, { "docid": "c948a05e982084a093dcbc0aa4977c95", "score": "0.47609025", "text": "function clsTimeLineGenerator(p_Config){\n var LMe = this;\n\n LMe.svgId = \"\";\n\n LMe.dateFormat = d3.time.format(\"%e-%b-%y\");\n\n LMe.scaleDateDisplayFormat = d3.time.format(\"%b %Y\");\n\n //Object to format Y axis to percentage\n LMe.formatPercent = d3.format(\".0%\");\n\n LMe.frequencyChartLinesData = {};\n\n LMe.keywordList = [];\n\n LMe.color1 = d3.scale.category20c();\n\n LMe.timoutObj = null;\n\n LMe.documentViewMode = \"timeline_view\";\n //LMe.documentViewMode = \"association_view\";\n\n LMe.focussedCircle = null;\n\n //---------------------------------------------------------------\n LMe.constructor = function(p_Config){\n //Assign the configuration attributes\n for (p_Name in p_Config)\n {\n var LValue = null;\n LValue = p_Config[p_Name];\n LMe[p_Name] = LValue;\n }\n\n LMe.tooltip = d3.select(\"#tooltip\")\n .html(\"\")\n .style(\"position\", \"absolute\")\n .style(\"z-index\", \"99999\")\n .style(\"visibility\", \"hidden\")\n .text(\"\")\n .on(\"mouseenter\", function(){\n //console.log('hint mouseover');\n if(LMe.timoutObj)\n {\n window.clearTimeout(LMe.timoutObj);\n }\n\n LMe.tooltip.style(\"visibility\", \"display\");\n })\n .on(\"mouseleave\", function(){\n LMe.tooltip.style(\"visibility\", \"hidden\");\n });\n\n LMe.tooltip.append('div')\n .attr(\"class\", \"tooltip-html\");\n\n /*LMe.tooltip.append('div')\n .attr(\"class\", \"tail\");*/\n\n var Lwidth = LMe.width + LMe.margin.left + LMe.margin.right,\n Lheight = LMe.height + LMe.margin.top + LMe.margin.bottom;\n\n LMe.svg = d3.select(\"#\" + LMe.svgId);\n LMe.svg\n .attr(\"width\", Lwidth + \"px\")\n .attr(\"height\", Lheight + \"px\");\n\n var Lw = $(\".word-freq-chart\").width();\n LMe.width = Lw;\n LMe.timelineWidth = Lw;\n LMe.svg\n .attr(\"width\", Lw + \"px\");\n\n LMe.initializeTimeLine();\n\n LMe.displayAssociationScalesCircles();\n LMe.hideAssociationScaleCircles();\n //LMe.drawAssociationLines();\n\n LMe.createSlider();\n };\n\n //---------------------------------------------------------------\n LMe.initializeTimeLine = function(){\n //Draw the scales\n LMe.drawGraphScales();\n\n LMe.scatterChartTextGroup = LMe.scatterChartGroup.append(\"g\");\n /*LMe.scatterChartTextGroup.append(\"line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", 0)\n .attr(\"x2\", 0)\n .attr(\"y2\", 100)\n .attr(\"class\", \"scatter-chart-line-1\");\n\n LMe.scatterChartTextGroup.append(\"line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", 100)\n .attr(\"x2\", 0)\n .attr(\"y2\", 150)\n .attr(\"class\", \"scatter-chart-line-2\");*/\n\n var LY = LMe.height - LMe.timelineHeight - LMe.margin.top - LMe.margin.bottom - 150;\n\n LMe.scatterChartText = LMe.scatterChartTextGroup.append(\"text\")\n .attr(\"x\", 10)\n .attr(\"y\", LY - 65)\n .attr(\"class\", \"scatter-chart-text\")\n .text(\"\");\n\n LMe.scatterChartTextGroup.attr(\"transform\", \"translate(\" + 0 + \", \" + LY + \")\");\n\n var brush = d3.svg.brush()\n .x(LMe.x)\n .on(\"brush\", function(d){\n LMe.adjustScatterChartAxis();\n LMe.handleOnBrush(d);\n })\n .on(\"brushend\", LMe.handleOnBrush);\n\n var brushg = LMe.timelineGroup.append(\"g\")\n .attr(\"class\", \"brush\")\n .attr(\"transform\", \"translate(\" + (LMe.margin.left + 10) + \",0)\")\n .call(brush);\n\n brushg.selectAll(\".resize\").append(\"path\")\n .attr(\"transform\", \"translate(0,\" + -12 + \")\")\n .attr(\"d\", LMe.resizePath);\n\n brushg.selectAll(\"rect\")\n .attr(\"height\", LMe.timelineHeight - LMe.margin.top)\n .attr(\"y\", LMe.margin.top)\n .attr(\"x\", 0);\n\n LMe.brush = brush;\n LMe.brushg = brushg;\n\n //Prepare data to display document details\n LMe.prepareScatterChart();\n\n //LMe.drawLegends();\n\n //prepare the slider\n /*$( \"#doc-assoc-slider\" ).slider({\n value:0.0,\n min: 0.0,\n max: 1.0,\n step: 0.1,\n slide: function( event, ui ) {\n G_DOC_ASSOCIATION_THREASHOLD = ui.value;\n $( \"#doc-assoc-slider-value\" ).html( ui.value );\n LMe.onChangeAssociationsVisibleRange(ui.value);\n }\n });*/\n };\n\n //---------------------------------------------------------------\n //---------------------------------------------------------------\n LMe.prepareScatterChart = function(){\n //console.log(\"preparing the scatter chart\");\n\n //Display all the documents initially\n var LUnorderedScatterChartData = G_DATA_JSON.DOC_DATA;\n\n var LScatterChartData = [],\n LPrevYVal = 0;\n for(var LLoopIndex = 0; LLoopIndex < LUnorderedScatterChartData.length; LLoopIndex++)\n {\n var d = LUnorderedScatterChartData[LLoopIndex],\n LDocumentName = d.Filename,\n LObj = {};\n\n //Generate proper document name\n /*LDocumentName = LDocumentName.replace(/\\//g, '_');\n LDocumentName = *//*'[' + (LLoopIndex + 1) + ']_' +*//* LDocumentName + '.txt';*/\n\n //Get Y co-ordinate for the document\n var LHeightRange = LMe.height - LMe.timelineHeight - LMe.margin.bottom - LMe.margin.top - 30;\n var LY = Math.floor((Math.random() * (LHeightRange)) + 1);\n if(LY < (50))\n {\n LY = 50;\n }\n\n if((LY < (LPrevYVal + 30)) && (LY > (LPrevYVal - 30)))\n {\n //The previous circle and this circle might overlap\n LY = LY + 100;\n\n if(LHeightRange < LY)\n {\n LY = LY - 100;\n }\n\n }\n\n LPrevYVal = LY;\n\n LObj.id = LLoopIndex;\n LObj.Filename = LDocumentName;\n LObj.DatePublish = d.DatePublish;\n LObj.DocType = d.DocType;\n LObj.keywords = [];\n LObj.keywordOccurances = [];\n LObj.__y = LPrevYVal;\n LScatterChartData.push(LObj);\n }\n\n LMe.addScatterChartCircle(LScatterChartData);\n };\n\n //---------------------------------------------------------------\n LMe.addScatterChartCircle = function(p_data)\n {\n //Remove association lines if any\n LMe.removeAssociationLines();\n LMe.currentDataChart = p_data;\n\n var LPrevYVal = 0,\n //We are clonning the array to avoid sorting to the main data list\n LSortedDocumentData = p_data.slice(0);\n\n LSortedDocumentData.sort(function(a, b) {\n var LDate1 = LMe.dateFormat.parse(a.DatePublish),\n LDate2 = LMe.dateFormat.parse(b.DatePublish);\n if(LDate1 < LDate2)\n {\n return 1;\n }\n else if(LDate1 > LDate2)\n {\n return -1;\n }\n else{\n return 0;\n }\n });\n\n if(LMe.focussedCircle)\n {\n //Check if the focussed circle is present in the current data\n var LFound = false;\n for(var LLoopIndex = 0; LLoopIndex < LSortedDocumentData.length; LLoopIndex++)\n {\n var LObj = LSortedDocumentData[LLoopIndex];\n if(LObj.Filename == LMe.focussedCircle.Filename)\n {\n //Document is present in the current data context\n LFound = true;\n }\n }\n }\n\n if((! LFound) || (!isDocTypeSelected(LMe.focussedCircle.DocType)))\n {\n //LMe.displaySlideInHint();\n var LParam = false;\n if(LMe.focussedCircle)\n {\n LParam = true;\n }\n LMe.deselectFocussedDocument(LParam);\n }\n\n var LClear = true;\n if(! LMe.ScatterPlotCircles) LClear = false;\n\n LMe.scatterChartGroup.selectAll('.document-circles')\n .data(LSortedDocumentData)\n .attr(\"class\", \"document-circles\")\n .on(\"mouseover\", LMe.documentBubbleHover)\n .on(\"click\", LMe.documentBubbleClick)\n .on(\"mouseout\", LMe.documentBubbleMouseOut)\n .attr(\"display\", function(d){\n\n var LIsInSelectedRange = false,\n LIsVisibleInDocTypeSelected = false;\n var Lx = LMe.x1(LMe.dateFormat.parse(d.DatePublish));\n if(Lx < 0 || Lx > (LMe.width - LMe.margin.left - LMe.margin.right ))\n {\n // the bubble is out of range\n LIsInSelectedRange = false\n }\n else\n {\n //the bubble is in range\n LIsInSelectedRange = true;\n }\n\n if(isDocTypeSelected(d.DocType))\n {\n //doc type is selected\n LIsVisibleInDocTypeSelected = true\n }\n\n if(LIsInSelectedRange && LIsVisibleInDocTypeSelected)\n {\n return \"block\";\n }\n else\n {\n return \"none\";\n }\n })\n //.transition().duration(500)\n .attr({\n cx: function(d) {\n var Lx = LMe.x1(LMe.dateFormat.parse(d.DatePublish));\n if(! LMe.focussedCircle)\n {\n return Lx;\n }\n\n var LNotInSelectedRange = (Lx < 0 || Lx > (LMe.width - LMe.margin.left - LMe.margin.right ));\n if((d.Filename == LMe.focussedCircle.Filename) && (LNotInSelectedRange))\n {\n //Document is present in the current data context\n LMe.deselectFocussedDocument(true);\n }\n return Lx;\n },\n cy: function(d) {\n\n if(d.__y)\n {\n return d.__y;\n }\n\n var LHeightRange = LMe.height - LMe.timelineHeight - LMe.margin.bottom - LMe.margin.top - 30;\n var LY = Math.floor((Math.random() * (LHeightRange)) + 1);\n if(LY < (50))\n {\n LY = 50;\n }\n\n if((LY < (LPrevYVal + 30)) && (LY > (LPrevYVal - 30)))\n {\n //The previous circle and this circle might overlap\n LY = LY + 100;\n\n if(LHeightRange < LY)\n {\n LY = LY - 100;\n }\n\n }\n\n LPrevYVal = LY;\n d.__y = LY;\n return LY;\n },\n r: function(d){ return LMe.getRadiusOfScatterBubble(d); },\n fill : \"#eee\",\n stroke : \"#999\",\n opacity : 0.7,\n /*\"stroke-opacity\" : 1,*/\n \"stroke-width\":\"1px\"\n });\n\n LMe.scatterChartGroup.selectAll('.document-circles')\n .data(LSortedDocumentData).exit().remove();\n\n LMe.ScatterPlotCircles = LMe.scatterChartGroup.selectAll('.document-circles')\n .data(LSortedDocumentData);\n\n //Update the data\n LMe.ScatterPlotCircles.data(LSortedDocumentData);\n\n LMe.ScatterPlotCircles.enter().append(\"circle\")\n .attr(\"class\", \"document-circles\")\n .on(\"mouseover\", LMe.documentBubbleHover)\n .on(\"click\", LMe.documentBubbleClick)\n .on(\"mouseout\", LMe.documentBubbleMouseOut)\n .attr(\"display\", function(d){\n var LIsInSelectedRange = false,\n LIsVisibleInDocTypeSelected = false;\n var Lx = LMe.x1(LMe.dateFormat.parse(d.DatePublish));\n if(Lx < 0 || Lx > (LMe.width - LMe.margin.left - LMe.margin.right ))\n {\n // the bubble is out of range\n LIsInSelectedRange = false\n }\n else\n {\n //the bubble is in range\n LIsInSelectedRange = true;\n }\n\n if(isDocTypeSelected(d.DocType))\n {\n //doc type is selected\n LIsVisibleInDocTypeSelected = true\n }\n\n if(LIsInSelectedRange && LIsVisibleInDocTypeSelected)\n {\n return \"block\";\n }\n else\n {\n return \"none\";\n }\n })\n .attr({\n cx: function(d) { return LMe.x1(LMe.dateFormat.parse(d.DatePublish))},\n cy: function(d) {\n if(d.__y)\n {\n return d.__y;\n }\n\n var LHeightRange = LMe.height - LMe.timelineHeight - LMe.margin.bottom - LMe.margin.top - 30;\n var LY = Math.floor((Math.random() * (LHeightRange)) + 1);\n if(LY < (50))\n {\n LY = 50;\n }\n\n if((LY < (LPrevYVal + 30)) && (LY > (LPrevYVal - 30)))\n {\n //The previous circle and this circle might overlap\n LY = LY + 100;\n\n if(LHeightRange < LY)\n {\n LY = LY - 100;\n }\n\n }\n\n LPrevYVal = LY;\n d.__y = LY;\n return LY;\n },\n r: 0,\n fill : \"#eee\",\n stroke : \"#999\",\n opacity : 0.7,\n /*\"stroke-opacity\" : 1,*/\n \"stroke-width\":\"1px\"\n })\n .transition().duration(1000).attr(\"r\", function(d){ return LMe.getRadiusOfScatterBubble(d); });\n\n //change the count of total documents\n var LTxt = LSortedDocumentData.length + \" documents with keyword match\";\n LMe.scatterChartText.text(LTxt);\n\n //Check if there is central document selected\n //LMe.generateTimeLineViewForCentralCircle()\n if(! LMe.focussedCircle)\n {\n //focussed circel is not present\n return;\n }\n\n setTimeout(function(){\n LMe.timeLineViewDrawAssociationLines();\n }, 0)\n };\n\n //---------------------------------------------------------------\n LMe.deselectFocussedDocument = function(p_showHint)\n {\n if(p_showHint === true)\n {\n LMe.displaySlideInHint(\"The selected document has been filtered out.\");\n }\n\n LMe.focussedCircle = null;\n LMe.hideOuterCircleForFocussedCircle();\n\n //Clear the loaded document\n LMe.clearLoadedDocument();\n\n //hide the slider\n LMe.hideSlider();\n };\n\n //---------------------------------------------------------------\n LMe.timeLineViewDrawAssociationLines = function(){\n //Central circle is present so draw time lines\n getDocumentAssociationMatrixData(function(p_assocData){\n var LDocCol;\n var LCenterCircleData = LMe.focussedCircle,\n LCenterCircle;\n //Get the central circle\n LMe.ScatterPlotCircles.each(function(d){\n if(d.Filename == LCenterCircleData.Filename)\n {\n LCenterCircle = this;\n }\n });\n\n var LCentralDocName = d3.select(LCenterCircle).data()[0].Filename;\n\n /*//Get column for the document\n for(var LLoopIndex = 0; LLoopIndex < p_assocData.length; LLoopIndex++)\n {\n var LColumn = p_assocData[LLoopIndex];\n if(LColumn[\"\"] == LCentralDocName)\n {\n LDocCol = LColumn;\n break;\n }\n }*/\n\n var //LIndex = libGetIndexOfWord(LDocCol, LCentralDocName),\n LAssociationDataArr = [],\n LX1 = d3.select(LCenterCircle).attr(\"cx\"),\n LY1 = d3.select(LCenterCircle).attr(\"cy\");\n\n //Travers all document circles and associate them with clicked circle\n LMe.ScatterPlotCircles.each(function(d){\n var LTargetCircle = this;\n if(LCentralDocName == d.Filename)\n {\n d3.select(this).attr({\n fill : \"#D4BE56\",\n stroke : \"#D4BE56\",\n /*\"stroke-opacity\" : 0.5,*/\n// \"stroke-width\":\"10px\",\n opacity : 1/*,\n r : 20*/\n });\n\n //Create an outer circle for stoke white\n LMe.displayOuterCircleForFocussedCircle(this);\n\n //Any document can not be associated with itself\n return;\n }\n\n if(d3.select(this).attr(\"display\") == \"none\")\n {\n //The bubble is not visible\n return;\n }\n\n var LX = d3.select(this).attr(\"cx\"),\n LY = d3.select(this).attr(\"cy\");\n\n if((LX < 0) || (LX > (LMe.width - LMe.margin.left - LMe.margin.right)))\n {\n //The circle is not present in the visible range\n return;\n }\n\n //Circle is present in the visible range\n //display the association\n //var LAssocValue = LDocCol[d.Filename],\n var LAssocValue = getDissimilarityAssocBetwnDoc(LCentralDocName, d.Filename),\n LObj = {};\n\n if(LAssocValue < 1)\n {\n d3.select(this).attr(\"opacity\", function(d){\n return (1 - LAssocValue);\n });\n }\n else\n {\n d3.select(this).attr(\"fill\", \"transparent\")\n .attr(\"stroke\", \"#FFFFFF\")\n .attr(\"opacity\", 1);\n }\n\n var LDispVal = \"block\",\n LLinkVisible = true;\n if((1 - LAssocValue) < G_DOC_ASSOCIATION_THREASHOLD)\n {\n LDispVal = \"none\";\n LLinkVisible = false;\n }\n\n if(LAssocValue == 1)\n {\n LLinkVisible = false;\n }\n\n\n d3.select(this).attr(\"display\", LDispVal);\n\n LObj.value = LAssocValue;\n LObj.x1 = LX1;\n LObj.y1 = LY1;\n LObj.x2 = LX;\n LObj.y2 = LY;\n LObj.visible = LLinkVisible;\n LObj.targetCircle = LTargetCircle;\n LObj.sourceCircle = LCenterCircle;\n\n LAssociationDataArr.push(LObj);\n });\n\n //Remove previous links\n LMe.scatterChartGroup.selectAll(\".association-links\").data([]).exit().remove();\n\n //Here we have the data for association\n //Now draw association lines\n var LLines = LMe.scatterChartGroup.selectAll(\".association-links\").data(LAssociationDataArr);\n\n //add new links\n LLines.enter().append(\"line\")\n .attr(\"class\", \"association-links\")\n .attr(\"x1\", function(d){ return d.x1; })\n .attr(\"y1\", function(d){ return d.y1; })\n .attr(\"x2\", function(d){ return d.x2; })\n .attr(\"y2\", function(d){ return d.y2; })\n .attr(\"opacity\", function(d){ return (1 - d.value); })\n .style(\"display\", function(d){\n if((1 - d.value) <= G_DOC_ASSOCIATION_THREASHOLD)\n {\n return \"none\";\n }\n else\n {\n return \"block\";\n }\n });\n\n LMe.associationLines = LLines;\n });\n };\n\n //---------------------------------------------------------------\n //---------------------------------------------------------------\n //---------------------------------------------------------------\n LMe.getRadiusOfScatterBubble = function(d, p_ForKeyword){\n var LValues = d.keywordOccurances,\n LKeywords = d.keywords,\n LTotal = 0;\n\n if(p_ForKeyword)\n {\n //Get total for the passed keyword\n var LIndex = libGetIndexOfWord(LKeywords, p_ForKeyword);\n LTotal = LValues[LIndex];\n }\n else\n {\n //Get total for all keywords\n for(var LLoopIndex = 0; LLoopIndex < LValues.length; LLoopIndex++)\n {\n LTotal += LValues[LLoopIndex];\n }\n /*if(LMe.focussedCircle)\n {\n if(d.Filename == LMe.focussedCircle.Filename) return 20;\n }*/\n }\n\n\n if(LTotal < 101)\n {\n return 10;\n }\n else if(LTotal > 100 && LTotal < 1001)\n {\n return 15;\n }\n else if(LTotal > 1000)\n {\n return 20;\n }\n else{\n return 10;\n }\n };\n\n //---------------------------------------------------------------\n LMe.documentBubbleHover = function(d)\n {\n var LHTML = '';\n\n LHTML += '<div class=\"title\">' + d.Filename + '</div>';\n LHTML += '<div class=\"doc-date\">' +\n d.DatePublish +\n ' | ' +\n getDocumentTypeTitle(d.DocType) +\n '</div>';\n\n //Get top 5 keywords from the document\n var LWordPerDoc = G_DATA_JSON.WORD_FREQ_PER_DOC,\n LDocOccuranceArr = LWordPerDoc[d.Filename],\n LDocKeywordArr = LWordPerDoc.FIELD1,\n LSortedArray,\n LKeywordIndexArray = [];\n LSortedArray = LDocOccuranceArr.slice(0);\n LSortedArray.sort(function(a,b){return b-a});\n\n for(var LLoopIndex = 0; LLoopIndex < 5; LLoopIndex++)\n {\n var LVal = LSortedArray[LLoopIndex];\n for(var LLoopIndex1=0; LLoopIndex1 < LDocOccuranceArr.length; LLoopIndex1++)\n {\n var ArrayEl = LDocOccuranceArr[LLoopIndex1];\n if(ArrayEl == LVal)\n {\n var LFound = false;\n //check if the index already exists in the keyword array\n for(var LLoopIndex2=0; LLoopIndex2 < LKeywordIndexArray.length; LLoopIndex2++)\n {\n var LKeywordIndex = LKeywordIndexArray[LLoopIndex2];\n if(LKeywordIndex == LLoopIndex1)\n {\n LFound = true;\n break;\n }\n }\n\n if(! LFound)\n {\n LKeywordIndexArray.push(LLoopIndex1);\n }\n }\n }\n }\n\n //Get comma seperated keywords\n var LKeyowrdsStr = '';\n for(var LLoopIndex = 0; LLoopIndex < 5; LLoopIndex++)\n {\n var LWordIndex = LKeywordIndexArray[LLoopIndex];\n LKeyowrdsStr += LDocKeywordArr[LWordIndex];\n\n if(LLoopIndex < LKeywordIndexArray.length - 1)\n {\n LKeyowrdsStr += ', ';\n }\n }\n\n LHTML += '<div class=\"content-title\">' + 'Contains keywords' + '</div>';\n LHTML += '<div class=\"content-keyword-str\">' + LKeyowrdsStr + '</div>';\n\n d3.select(\"#tooltip .tooltip-html\").html(LHTML);\n\n var currHeight = $('#tooltip').height(),\n LPageY = d3.event.pageY,\n LPageX = d3.event.pageX;\n\n var LToolTipTop = LPageY - currHeight - 40,\n LToolTipLeft = LPageX - 150;\n if(LToolTipTop < 0)\n {\n //tooltip is going out of screen\n LToolTipTop = LPageY;\n }\n LMe.tooltip.style(\"top\", LToolTipTop+\"px\")\n .style(\"left\",LToolTipLeft +\"px\");\n\n LMe.tooltip.style(\"visibility\", \"visible\");\n };\n\n //---------------------------------------------------------------\n LMe.documentBubbleMouseOut = function(d)\n {\n LMe.tooltip.style(\"visibility\", \"hidden\");\n };\n\n //---------------------------------------------------------------\n LMe.documentBubbleClick = function(d)\n {\n var LSlider = d3.select(\".doc-assoc-slider-cntnr\");\n\n if(LMe.focussedCircle)\n {\n if(LMe.focussedCircle.Filename == d.Filename)\n {\n //The clicked circle is same as the central circle\n //remove the view\n LMe.focussedCircle = null;\n\n //Clear the loaded document\n LMe.clearLoadedDocument();\n\n //hide the slider\n LMe.hideSlider();\n\n if(LMe.documentViewMode == \"timeline_view\")\n {\n //The visualization is in timeline view\n //Remove all the associations\n //LMe.removeAssociationLines();\n LMe.addScatterChartCircle(LMe.currentDataChart);\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.switchViewToTimelineView();\n LMe.removeAssociationLines();\n }\n\n LMe.displaySlideInHint(\"The document has been unselected.\");\n return;\n }\n\n }\n\n LMe.focussedCircle = d;\n if(LMe.documentViewMode == \"timeline_view\")\n {\n LMe.generateTimeLineViewForCentralCircle();\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.generateAssociationViewForCentralCircle();\n }\n\n //show the slider\n LMe.showSlider();\n\n LMe.displayDocumentDetails(d);\n LMe.displaySlideInHint(\"A new document has been selected.\");\n };\n\n //---------------------------------------------------------------\n LMe.generateTimeLineViewForCentralCircle = function(p_recomputedata){\n\n if (p_recomputedata == true)\n {\n //compute the data and also draw the chart again\n LMe.prepareScatterChart();\n }\n else\n {\n //Redraw the data with current data\n LMe.addScatterChartCircle(LMe.currentDataChart);\n }\n\n /*if(! LMe.focussedCircle)\n {\n //There is no center circle\n return;\n }\n\n getDocumentAssociationMatrixData(function(p_assocData){\n var LDocCol;\n var LCenterCircleData = LMe.focussedCircle,\n LCenterCircle;\n //Get the central circle\n LMe.ScatterPlotCircles.each(function(d){\n if(d.Filename == LCenterCircleData.Filename)\n {\n LCenterCircle = this;\n }\n });\n\n var LCentralDocName = d3.select(LCenterCircle).data()[0].Filename;\n\n //Get column for the document\n for(var LLoopIndex = 0; LLoopIndex < p_assocData.length; LLoopIndex++)\n {\n var LColumn = p_assocData[LLoopIndex];\n if(LColumn[\"\"] == LCentralDocName)\n {\n LDocCol = LColumn;\n break;\n }\n }\n var LIndex = libGetIndexOfWord(LDocCol, LCentralDocName),\n LAssociationDataArr = [],\n LX1 = d3.select(LCenterCircle).attr(\"cx\"),\n LY1 = d3.select(LCenterCircle).attr(\"cy\");\n\n //Travers all document circles and associate them with clicked circle\n LMe.ScatterPlotCircles.each(function(d){\n var LTargetCircle = this;\n if(LCentralDocName == d.Filename)\n {\n //Any document can not be associated with itself\n return;\n }\n\n var LX = d3.select(this).attr(\"cx\"),\n LY = d3.select(this).attr(\"cy\");\n if((LX < 0) || (LX > (LMe.width - LMe.margin.left - LMe.margin.right)))\n {\n //The circle is not present in the visible range\n return;\n }\n\n //Circle is present in the visible range\n //display the association\n var LAssocValue = LDocCol[d.Filename],\n LObj = {};\n\n LObj.value = LAssocValue;\n LObj.x1 = LX1;\n LObj.y1 = LY1;\n LObj.x2 = LX;\n LObj.y2 = LY;\n LObj.targetCircle = LTargetCircle;\n LObj.sourceCircle = LCenterCircle;\n\n LAssociationDataArr.push(LObj);\n });\n\n //Remove previous links\n LMe.scatterChartGroup.selectAll(\".association-links\").data([]).exit().remove();\n\n //Here we have the data for association\n //Now draw association lines\n var LLines = LMe.scatterChartGroup.selectAll(\".association-links\").data(LAssociationDataArr);\n //remove old links\n //LLines.exit().remove();\n //add new links\n LLines.enter().append(\"line\")\n .attr(\"class\", \"association-links\")\n .attr(\"x1\", function(d){ return d.x1; })\n .attr(\"y1\", function(d){ return d.y1; })\n .attr(\"x2\", function(d){ return d.x2; })\n .attr(\"y2\", function(d){ return d.y2; })\n .style(\"display\", function(d){\n if(d.value < G_DOC_ASSOCIATION_THREASHOLD)\n {\n return \"none\";\n }\n else\n {\n return \"block\";\n }\n });\n\n LMe.associationLines = LLines;\n }); */\n };\n\n //---------------------------------------------------------------\n LMe.generateAssociationViewForCentralCircle = function(){\n getDocumentAssociationMatrixData(function(p_assocData){\n //-------------------------------\n var LAssociationViewData = [],\n LLinks = [],\n LIndex = 0,\n LSourceIndex = 0,\n LfoccusedDocData = LMe.focussedCircle,\n LFocussedCircle;\n\n //var LForceHt = (LMe.timelineHeight + (LMe.height - LMe.timelineHeight)/2) * 2,\n var LForceHt = ((LMe.height - LMe.timelineHeight)/2) * 2,\n LForceWd = LMe.width - LMe.margin.left - LMe.margin.right,\n LCenterX = LForceWd / 2,\n LCenterY = LForceHt / 2,\n LLinkDst = LForceWd;\n LLinkDst = LLinkDst/2;\n\n LMe.drawAssociationLines();\n LMe.displayAssociationScalesCircles();\n\n var LFocussedNodeIsVisible = false;\n //Get data for bubbles\n LMe.ScatterPlotCircles.each(function(d){\n var LCircle = d3.select(this);\n LCircle.attr(\"display\", \"none\");\n var LDate = LMe.dateFormat.parse(d.DatePublish),\n Lx = LMe.x1(LDate),\n Ly = LCircle.attr(\"cy\");\n if(Lx < 0 || Lx > (LMe.width - LMe.margin.left - LMe.margin.right))\n {\n return;\n }\n\n if(! isDocTypeSelected(d.DocType))\n {\n //Document type is not selected\n return;\n }\n\n if(LfoccusedDocData)\n {\n if(LfoccusedDocData.Filename == d.Filename)\n {\n LFocussedNodeIsVisible = true;\n LSourceIndex = LIndex;\n }\n }\n else\n {\n LFocussedNodeIsVisible = false;\n }\n\n d._x = Lx;\n d._y = Ly;\n LAssociationViewData.push(d);\n LIndex ++;\n });\n\n if(! LFocussedNodeIsVisible)\n {\n //The focussed node is not visible in the context\n //switch the mode\n LMe.force.stop();\n LMe.displaySlideInHint(\"The selected document has been filtered out.\");\n LMe.switchViewToTimelineView();\n return;\n }\n\n //Get data for links\n for(var LLoopIndex = 0; LLoopIndex < LAssociationViewData.length; LLoopIndex++)\n {\n var LDocCol,\n LBubble = LAssociationViewData[LLoopIndex];\n //Get column for the document\n /*for(var LLoopIndex1 = 0; LLoopIndex1 < G_DATA_JSON.DOC_ASSOC_MATRIX.length; LLoopIndex1++)\n {\n var LColumn = G_DATA_JSON.DOC_ASSOC_MATRIX[LLoopIndex1];\n if(LColumn[\"\"] == LfoccusedDocData.Filename)\n {\n LDocCol = LColumn;\n break;\n }\n }*/\n\n //var LValue = LDocCol[LBubble.Filename];\n var LValue = LAssocValue = getDissimilarityAssocBetwnDoc(LfoccusedDocData.Filename, LBubble.Filename);\n LBubble.associationVal = LValue;\n var LObj = {\"source\":LSourceIndex,\"target\":LLoopIndex,\"value\":LValue};\n LLinks.push(LObj);\n }\n var LCenterCircle;\n if(! LMe.force)\n {\n //LLinkDst = (1 - G_DOC_ASSOCIATION_THREASHOLD) * LLinkDst;\n LMe.force = d3.layout.force()\n .gravity(.05)\n .distance(100)\n //.linkDistance(function(d) { return LLinkDst * (d.value) })\n .charge(-100)\n .size([LForceWd, LForceHt]);\n\n LMe.force.on(\"tick\", function(e) {\n LMe.associationViewNodes\n .attr(\"cx\", function(d) {\n if((LMe.focussedCircle) && (d.Filename == LMe.focussedCircle.Filename))\n {\n d.x = LCenterX;\n }\n\n return d.x = Math.max(20, Math.min(LForceWd - 20, d.x));\n //return d.x;\n })\n .attr(\"cy\", function(d) {\n if((LMe.focussedCircle) && (d.Filename == LMe.focussedCircle.Filename))\n {\n //d.fixed = true;\n d.y = LCenterY;\n LMe.displayOuterCircleForFocussedCircle(this, true);\n }\n return d.y = Math.max(20, Math.min(LForceHt - 50, d.y));\n //return d.y;\n });\n\n LMe.link.attr(\"x1\", function(d) {\n return d.source.x;\n })\n .attr(\"y1\", function(d) {\n return d.source.y;\n })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n\n });\n }\n\n LLinkDst = LLinkDst/ (1 - G_DOC_ASSOCIATION_THREASHOLD);\n LMe.force\n .nodes(LAssociationViewData)\n .links(LLinks)\n .linkDistance(function(d) { return LLinkDst * (d.value) })\n .start();\n\n LMe.scatterChartGroup.selectAll(\".link\")\n .data([]).exit().remove();\n\n LMe.link = LMe.scatterChartGroup.selectAll(\".link\")\n .data(LLinks)\n .enter().append(\"line\")\n .attr(\"class\", \"link document-assos-line\");\n\n LMe.svg.selectAll(\".node\")\n .data([]).exit().remove();\n\n //LMe.LCenterCircle = null;\n\n LMe.associationViewNodes = LMe.scatterChartGroup.selectAll(\".node\")\n .data(LAssociationViewData)\n .enter().append(\"circle\")\n .attr(\"class\", \"node document-circles-assoc\")\n .attr(\"display\", function(d){\n\n if(LfoccusedDocData.Filename == d.Filename)\n {\n LCenterCircle = this;\n return \"block\";\n }\n\n if((1 - d.associationVal) < G_DOC_ASSOCIATION_THREASHOLD)\n {\n return \"none\";\n }\n else\n {\n return \"block\";\n }\n })\n .attr(\"cx\", function(d){return d.x; })\n .attr(\"cy\", function(d){return d.y; })\n .style(\"opacity\", function(d){\n var LOpacity = 1 - d.associationVal;\n if(LOpacity == 0)\n {\n LOpacity = 1;\n }\n return LOpacity;\n })\n .attr(\"r\", function(d){\n if(d.Filename == LfoccusedDocData.Filename)\n {\n d.fixed = true;\n d3.select(this).attr({\n fill : \"#D4BE56\",\n stroke : \"#D4BE56\",\n /*\"stroke-opacity\" : 0.5,*/\n// \"stroke-width\":\"10px\",\n opacity : 1/*,\n r : 20*/\n });\n return LMe.getRadiusOfScatterBubble(d);\n }\n d.fixed = false;\n return LMe.getRadiusOfScatterBubble(d);\n })\n .attr(\"fill\", function(d){\n if(d.Filename == LfoccusedDocData.Filename)\n {\n return \"#D4BE56\";\n }\n\n if(d.associationVal == 1)\n {\n return \"transparent\";\n }\n\n return \"#EEEEEE\";\n })\n .attr(\"stroke\", function(d){\n if(d.Filename == LfoccusedDocData.Filename)\n {\n return \"#D4BE56\";\n }\n\n if(d.associationVal == 1)\n {\n return \"#FFFFFF\";\n }\n\n return \"#EEEEEE\";\n })\n .on(\"mouseover\", LMe.documentBubbleHover)\n .on(\"click\", LMe.documentBubbleClick)\n .on(\"mouseout\", LMe.documentBubbleMouseOut)\n .call(LMe.force.drag);\n\n LMe.displayOuterCircleForFocussedCircle(LCenterCircle, true);\n });\n };\n\n //---------------------------------------------------------------\n LMe.addKeyWordToGraph = function(p_Keyword){\n\n //Draw the frequency data line for a keyword\n LMe.drawKeywordFreqChartForKeyword(p_Keyword);\n\n //add documents circle contaning the keyword\n LMe.addDocumentCirclesForKeyword(p_Keyword);\n\n LMe.keywordList.push(p_Keyword);\n\n /*if(! LMe.focussedCircle)\n {\n //There is no centered circle\n return;\n }*/\n\n //There is a centered circle\n if(LMe.documentViewMode == \"timeline_view\")\n {\n //Documents are in timeline view\n //update the timeline view\n LMe.generateTimeLineViewForCentralCircle();\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n //Documents are in association view\n LMe.generateAssociationViewForCentralCircle();\n }\n };\n\n //---------------------------------------------------------------\n LMe.removeKeywordFromGraph = function(p_Keyword){\n //Draw the frequency data line for a keyword\n //LMe.drawKeywordFreqChartForKeyword(p_Keyword);\n\n\n delete LMe.frequencyChartLinesData[p_Keyword];\n LMe.updateKeywordFrequencyLines();\n\n //add documents circle contaning the keyword\n LMe.removeDocumentCirclesForKeyword(p_Keyword);\n\n var LIndex = libGetIndexOfWord(LMe.keywordList, p_Keyword);\n LMe.keywordList.splice(LIndex, 1);\n\n if(LMe.keywordList.length == 0)\n {\n //There are no keywords selected\n //display all the documents\n if(LMe.documentViewMode == \"association_view\")\n {\n LMe.switchViewToTimelineView();\n }\n LMe.prepareScatterChart();\n return;\n }\n if(! LMe.focussedCircle)\n {\n //There is no centered circle\n //LMe.displaySlideInHint();\n LMe.switchViewToTimelineView();\n return;\n }\n\n //There is a centered circle\n if(LMe.documentViewMode == \"timeline_view\")\n {\n //Documents are in timeline view\n //update the timeline view\n LMe.generateTimeLineViewForCentralCircle();\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n //Documents are in association view\n LMe.generateAssociationViewForCentralCircle();\n }\n };\n\n //---------------------------------------------------------------\n LMe.addDocumentCirclesForKeyword = function(p_Keyword){\n //-----\n var LDocsData = G_DATA_JSON.DOC_DATA,\n LWordsTotalFreqData = G_DATA_JSON.WORD_TOTAL,\n LWordsFreqPerDocData = G_DATA_JSON.WORD_FREQ_PER_DOC,\n LScatterChartData,\n LCompeleteChartData;\n\n function L_GetYValueForDocumentFromCompleteChartData(p_Filename)\n {\n for(var LLoopIndex = 0; LLoopIndex < LCompeleteChartData.length; LLoopIndex++)\n {\n var LObj = LCompeleteChartData[LLoopIndex];\n if(LObj.Filename == p_Filename)\n {\n return LObj.__y;\n }\n }\n }\n\n function L_GetDataForGeneratingCircles(){\n var LResult = [];\n\n function L_L_GetDocumentIndexFromVisibleCircles(p_DocumentName)\n {\n var LResult = -1;\n for(var LLoopIndex1=0; LLoopIndex1 < LScatterChartData.length; LLoopIndex1++)\n {\n var LDocData = LScatterChartData[LLoopIndex1],\n LDocumentName = LDocData.Filename;\n\n //LDocumentName = LDocumentName.replace(/\\//g, '_');\n //LDocumentName = '[' + (LLoopIndex + 1) + ']_' + LDocumentName + '.txt';\n\n if(LDocumentName == p_DocumentName)\n {\n return LLoopIndex1;\n }\n }\n return LResult;\n }\n\n //Traverse all documents to get data for a keyword per doc\n var LPrevYVal = 0;\n for(var LLoopIndex = 0; LLoopIndex < LDocsData.length; LLoopIndex++){\n var LDoc = LDocsData[LLoopIndex],\n LDocumentName = LDoc.Filename,\n LDocumentDate = LDoc.DatePublish,\n LDocumentType = LDoc.DocType;\n\n\n if(! LWordsFreqPerDocData[LDocumentName])\n {\n //Data was not found\n alert('This alert is the result of the inconsitant data.');\n continue;\n }\n\n //Generate proper document name\n /*LDocumentName = LDocumentName.replace(/\\//g, '_');\n LDocumentName = *//*'[' + (LLoopIndex + 1) + ']_' +*//* LDocumentName + '.txt';*/\n\n //Get keyword occurances for this document\n //Get index of the keyword\n var LKeywordIndex = libGetIndexOfWord(LWordsFreqPerDocData.FIELD1, p_Keyword),\n //Get keyword Occurances\n LKeywordOccurance = LWordsFreqPerDocData[LDocumentName][LKeywordIndex];\n\n if(LKeywordIndex < 0)\n {\n continue;\n }\n\n if(LKeywordOccurance < 1)\n {\n //The keyword is not present in the current document.\n continue;\n }\n\n //check if the circle is already visible\n var LFrequencyDataIndex = L_L_GetDocumentIndexFromVisibleCircles(LDocumentName);\n if(LFrequencyDataIndex == -1)\n {\n //Get Y co-ordinate for the document\n var LHeightRange = LMe.height - LMe.timelineHeight - LMe.margin.bottom - LMe.margin.top - 30;\n var LY = Math.floor((Math.random() * (LHeightRange)) + 1);\n if(LY < (50))\n {\n LY = 50;\n }\n\n if((LY < (LPrevYVal + 30)) && (LY > (LPrevYVal - 30)))\n {\n //The previous circle and this circle might overlap\n LY = LY + 100;\n\n if(LHeightRange < LY)\n {\n LY = LY - 100;\n }\n\n }\n\n LPrevYVal = LY;\n\n if(LCompeleteChartData)\n {\n LY = L_GetYValueForDocumentFromCompleteChartData(LDocumentName);\n }\n //document was not found\n var LDocumentCircleData = {\n id : LLoopIndex,\n Filename : LDocumentName,\n DatePublish : LDocumentDate,\n DocType : LDocumentType,\n keywords : [],\n keywordOccurances : [],\n __y : LY\n };\n\n LDocumentCircleData.keywords.push(p_Keyword);\n LDocumentCircleData.keywordOccurances.push(LKeywordOccurance);\n LScatterChartData.push(LDocumentCircleData);\n }\n else{\n //Document was found\n var LDocumentCircleData = LScatterChartData[LFrequencyDataIndex];\n LDocumentCircleData.keywords.push(p_Keyword);\n LDocumentCircleData.keywordOccurances.push(LKeywordOccurance);\n }\n }\n }\n //-----\n\n LScatterChartData = LMe.ScatterPlotCircles.data();\n if(LMe.keywordList.length == 0){\n LCompeleteChartData = LScatterChartData;\n LScatterChartData = [];\n }\n\n L_GetDataForGeneratingCircles();\n LMe.addScatterChartCircle(LScatterChartData);\n //LMe.frequencyChartLinesData[p_Keyword] = LLineData;\n //LMe.updateKeywordFrequencyLines();\n };\n\n //---------------------------------------------------------------\n LMe.removeDocumentCirclesForKeyword = function(p_Keyword){\n var LDocsData = G_DATA_JSON.DOC_DATA,\n LWordsTotalFreqData = G_DATA_JSON.WORD_TOTAL,\n LWordsFreqPerDocData = G_DATA_JSON.WORD_FREQ_PER_DOC,\n LScatterChartData;\n\n LScatterChartData = LMe.ScatterPlotCircles.data();\n //LScatterChartData = LMe.scatterChartGroup.selectAll('.document-circles').each(function(){});\n for(var LLoopIndex = 0; LLoopIndex < LScatterChartData.length; LLoopIndex++)\n {\n var d = LScatterChartData[LLoopIndex],\n LIndexOfKeyword = libGetIndexOfWord(d.keywords, p_Keyword);\n if(LIndexOfKeyword == -1)\n {\n //Keyword did not exist in the current document\n continue;\n }\n\n //Keyword exists in the document\n d.keywords.splice(LIndexOfKeyword, 1);\n d.keywordOccurances.splice(LIndexOfKeyword, 1);\n\n if(d.keywords.length == 0)\n {\n //there are no other keywords which exist in the document\n //remove this entry\n LScatterChartData.splice(LLoopIndex, 1);\n //the data is shifted to one less than the current index\n LLoopIndex--;\n }\n }\n\n LMe.addScatterChartCircle(LScatterChartData);\n };\n\n //---------------------------------------------------------------\n LMe.drawKeywordFreqChartForKeyword = function(p_Keyword){\n //-----\n function L_GetDataForGeneratingLine(){\n var LDocsData = G_DATA_JSON.DOC_DATA,\n LWordsTotalFreqData = G_DATA_JSON.WORD_TOTAL,\n LWordsFreqPerDocData = G_DATA_JSON.WORD_FREQ_PER_DOC,\n LResult = [];\n\n function L_L_GetFrequencyDataIndexOnDate(p_Date)\n {\n var LResult = -1;\n for(var LLoopIndex1=0; LLoopIndex1 < LResult.length; LLoopIndex1++)\n {\n var LDocData = LResult[LLoopIndex1];\n if(LDocData.datePublish == p_Date)\n {\n Result = LLoopIndex1;\n return LResult;\n }\n }\n return LResult;\n }\n\n //Traverse all documents to get data for a keyword per doc\n for(var LLoopIndex = 0; LLoopIndex < LDocsData.length; LLoopIndex++){\n var LDoc = LDocsData[LLoopIndex],\n LDocumentName = LDoc.Filename,\n LDocumentDate = LDoc.DatePublish;\n\n //Generate proper document name\n /*LDocumentName = LDocumentName.replace(/\\//g, '_');\n LDocumentName = *//*'[' + (LLoopIndex + 1) + ']_' +*//* LDocumentName + '.txt';*/\n\n if(! LWordsFreqPerDocData[LDocumentName])\n {\n //Data was not found\n alert('This alert is the result of the inconsitant data.');\n continue;\n }\n\n //Get keyword occurances for this document\n //Get index of the keyword\n var LKeywordIndex = libGetIndexOfWord(LWordsFreqPerDocData.FIELD1, p_Keyword),\n //Get keyword Occurances\n LKeywordOccurance = LWordsFreqPerDocData[LDocumentName][LKeywordIndex];\n\n //Consider the case where two documents are created on the same date\n //and the keyword exists in both\n var LFrequencyDataIndex = L_L_GetFrequencyDataIndexOnDate(LDocumentDate);\n if(LFrequencyDataIndex == -1){\n //Get total occurances\n var LKeywordTotalOccuranceIndex = libGetIndexOfWord(LWordsTotalFreqData.FIELD1, p_Keyword),\n LKeywordTotalOccurance = LWordsTotalFreqData.total[LKeywordTotalOccuranceIndex];\n\n //Any entry on the same date does not exist\n //Create a new entry and add to the data\n var LFreqData = {\n keywordOccurance : LKeywordOccurance,\n datePublish : LDocumentDate,\n keywordTotalOccurance : LKeywordTotalOccurance,\n keyword : p_Keyword,\n noOfDocsOnThatDay : 1\n };\n\n //Add the frequency data to the date published\n LResult.push(LFreqData);\n }\n else{\n //The entry already exists\n var LFreqData = Result[LFrequencyDataIndex];\n LFreqData.keywordOccurance += LKeywordOccurance;\n LFreqData.noOfDocsOnThatDay++;\n }\n }\n\n return LResult;\n }\n //-----\n\n var LLineData = L_GetDataForGeneratingLine();\n LMe.frequencyChartLinesData[p_Keyword] = LLineData;\n LMe.updateKeywordFrequencyLines();\n };\n\n //---------------------------------------------------------------\n LMe.updateKeywordFrequencyLines = function(){\n\n var LMin = 0,\n LMax = 0;\n //-----\n function L_GetLinesData(){\n var LResult = [];\n for(var LKeyword in LMe.frequencyChartLinesData)\n {\n var LData = LMe.frequencyChartLinesData[LKeyword];\n LResult.push(LData);\n }\n return LResult;\n }\n //-----\n\n if(! LMe.line)\n {\n //Line object is not defined\n LMe.line = d3.svg.line()\n // assign the X function to plot our line as we wish\n .x(function(d,i) {\n // verbose logging to show what's actually being done\n //console.log('Plotting X value for date: ' + d.date + ' using index: ' + i + ' to be at: ' + x(d.date) + ' using our xScale.');\n // return the X coordinate where we want to plot this datapoint\n //return x(i);\n return LMe.x(LMe.dateFormat.parse(d.datePublish));\n })\n .y(function(d) {\n // verbose logging to show what's actually being done\n //console.log('Plotting Y value for data value: ' + d.value + ' to be at: ' + y(d.value) + \" using our yScale.\");\n // return the Y coordinate where we want to plot this datapoint\n //return y(d);\n //var LYValue = d.keywordOccurance/ d.keywordTotalOccurance;\n var LYValue = d.keywordOccurance;\n return LMe.y(LYValue);\n })\n// .interpolate(\"cardinal\");\n .interpolate(\"linear\");\n }\n\n var LLinesData = L_GetLinesData();\n\n LMin = d3.min(LLinesData, function(d) {\n return d3.min(d, function(d1) {\n return d1.keywordOccurance;\n });\n });\n LMax = d3.max(LLinesData, function(d) {\n return d3.max(d, function(d1) {\n return d1.keywordOccurance;\n });\n });\n\n LMe.y.domain([LMin, LMax]);\n d3.select('#' + LMe.svgId).select(\".y\").call(LMe.yAxis);\n\n LMe.svg.selectAll(\".timeline-path-group\")\n .data([]).exit().remove();\n\n LMe.dataLines = LMe.svg.selectAll('.data-line-pseudo')\n .data(LLinesData);\n\n var Lgx = LMe.margin.left + 10,\n Lgy = LMe.margin.top;\n\n LMe.dataLines\n .enter()\n .append('svg:g')\n .attr(\"class\", \"timeline-path-group\")\n .attr(\"transform\", \"translate(\" + Lgx +\", \"+ Lgy + \")\")\n .append('path')\n .attr('class', 'data-line')\n .style(\"stroke\", \"#999999\")\n .style('opacity', 1)\n .attr(\"d\", function(d){\n d.sort(function(a, b) {\n var LDate1 = LMe.dateFormat.parse(a.datePublish),\n LDate2 = LMe.dateFormat.parse(b.datePublish);\n if(LDate1 < LDate2)\n {\n return 1;\n }\n else if(LDate1 > LDate2)\n {\n return -1;\n }\n else{\n return 0;\n }\n });\n return LMe.line(d)\n });\n };\n\n //---------------------------------------------------------------\n LMe.drawTimelineForWords = function(p_WordArr){\n var LDocumentsArr, //Document arry in which the words exists\n LOcurrances, //Occurrance of each word in documents\n LChartData = [];\n\n /*d3.select(\"#\" + LMe.svgId).selectAll('*').remove();\n\n var LTimeLineX = 0,\n LTimeLineY = LMe.height - LMe.timelineHeight;\n //This group will contain the graph\n LMe.timelineGroup = d3.select(\"#\" + LMe.svgId)\n .append('g')\n .attr(\"transform\", \"translate(\" + LTimeLineX + \",\" + LTimeLineY + \")\"); */\n\n for(var LLoopIndex1 = 0; LLoopIndex1 < p_WordArr.length; LLoopIndex1++)\n {\n //Draw the chart for each word\n var LDocuments = [],\n LKeyWord = p_WordArr[LLoopIndex1],\n LKeywordIndex = -1,\n LKeywordData = {\n \"keyword\" : \"\",\n \"data\" : []\n };\n LKeywordIndex = libGetIndexOfWord(G_DATA_JSON.WORD_FREQ_PER_DOC.FIELD1, LKeyWord);\n if(LKeywordIndex < 0){\n //The keyword has no record in the present document\n //alert('The keyword is not present');\n return;\n }\n\n LKeywordData[\"keyword\"] = LKeyWord;\n\n //document keyword is present\n //costruct arry of document in which it is present\n for(var LDocumentName in G_DATA_JSON.WORD_FREQ_PER_DOC)\n {\n if(LDocumentName == \"FIELD1\")\n {\n continue;\n }\n\n var LKeywordOccuranceArr = G_DATA_JSON.WORD_FREQ_PER_DOC[LDocumentName],\n LNoOfOccurrances,\n LDate,\n LDocumentOccuranceData = {\n documentName : \"\",\n keywordOccurance : 0,\n datePublish : \"\"\n };\n\n LDocumentOccuranceData.documentName = LDocumentName;\n var LFound = false;\n if((LKeywordOccuranceArr[LKeywordIndex] > 0) || (LKeywordOccuranceArr[LKeywordIndex] != \"0\"))\n {\n //Keyword has occurance\n LDocumentOccuranceData.keywordOccurance = LNoOfOccurrances = LKeywordOccuranceArr[LKeywordIndex];\n for(var LLoopIndex2=0; LLoopIndex2 < G_DATA_JSON.DOC_DATA.length; LLoopIndex2++)\n {\n var LDocData = G_DATA_JSON.DOC_DATA[LLoopIndex2],\n LDocName = LDocData.Filename;\n /*LDocName = LDocData.Filename.replace(/\\//g, '_');\n LDocName = *//*'[' + (LLoopIndex2 + 1) + ']_' +*//* LDocName + '.txt';*/\n if(LDocName == LDocumentName)\n {\n LDate = LDocData.DatePublish;\n LDocumentOccuranceData.datePublish = LDate;\n LFound = true;\n break;\n }\n }\n }\n if(LFound)\n {\n LKeywordData.data.push(LDocumentOccuranceData);\n }\n }\n\n LChartData.push(LKeywordData);\n }\n\n d3.select(\"#\" + LMe.svgId).selectAll('*').remove();\n\n var LTimeLineX = 0,\n LTimeLineY = LMe.height - LMe.timelineHeight;\n //This group will contain the graph\n LMe.timelineGroup = d3.select(\"#\" + LMe.svgId)\n .append('g')\n .attr(\"transform\", \"translate(\" + LTimeLineX + \",\" + LTimeLineY + \")\");\n\n //We have all the required data to generate the graph\n //draw graph\n LMe.drawGraph(LChartData);\n\n LMe.drawDocumentScatterChart(LChartData);\n };\n\n //---------------------------------------------------------------\n LMe.drawGraph = function(p_ChartData){\n var LCompleteJoinedData = [];\n for(var LLoopIndex = 0; LLoopIndex < p_ChartData.length; LLoopIndex++)\n {\n var LKeywordData = p_ChartData[LLoopIndex];\n LCompleteJoinedData = LCompleteJoinedData.concat(LKeywordData.data);\n }\n LMe.drawGraphScales(LCompleteJoinedData);\n\n LMe.dataLinesCollection = [];\n for(var LLoopIndex = 0; LLoopIndex < p_ChartData.length; LLoopIndex++)\n {\n var LKeywordData = p_ChartData[LLoopIndex],\n LFillColor = LMe.color1(LLoopIndex);\n LMe.drawAreaChart(LKeywordData, LFillColor);\n }\n\n\n var brush = d3.svg.brush()\n .x(LMe.x)\n /*.extent([LMe.dateFormat.parse(LMe.DateMax),\n LMe.dateFormat.parse(LMe.DateMin)])*/\n .on(\"brush\", LMe.handleOnBrush)\n //.on(\"brushend\", LMe.handleOnBrush);\n\n var brushg = LMe.timelineGroup.append(\"g\")\n .attr(\"class\", \"brush\")\n .attr(\"transform\", \"translate(\" + LMe.margin.left + \",0)\")\n .call(brush);\n\n brushg.selectAll(\".resize\").append(\"path\")\n .attr(\"transform\", \"translate(0,\" + LMe.timelineHeight / 6 + \")\")\n .attr(\"d\", LMe.resizePath);\n\n brushg.selectAll(\"rect\")\n .attr(\"height\", LMe.timelineHeight)\n .attr(\"y\", 0)\n .attr(\"x\", 0);\n\n LMe.brush = brush;\n LMe.brushg = brushg;\n\n /*var gBrush = LMe.timelineGroup.append(\"g\")\n .attr(\"class\", \"x brush\")\n .call(brush)\n .selectAll(\"rect\")\n .attr(\"y\", 0)\n .attr(\"x\", LMe.margin.left)\n .attr(\"height\", LMe.timelineHeight);\n\n //attr(\"class\", \"brush\").call(brush);\n gBrush.selectAll(\".resize\").append(\"path\").attr(\"d\", LMe.resizePath);*/\n\n }\n\n //---------------------------------------------------------------\n LMe.resizePath = function (d) {\n var e = +(d == \"e\"),\n x = e ? 1 : -1,\n y = 250 / 3;\n return \"M\" + (.5 * x) + \",\" + y\n + \"A6,6 0 0 \" + e + \" \" + (6.5 * x) + \",\" + (y + 6)\n + \"V\" + (2 * y - 6)\n + \"A6,6 0 0 \" + e + \" \" + (.5 * x) + \",\" + (2 * y)\n + \"Z\"\n + \"M\" + (2.5 * x) + \",\" + (y + 8)\n + \"V\" + (2 * y - 8)\n + \"M\" + (4.5 * x) + \",\" + (y + 8)\n + \"V\" + (2 * y - 8);\n };\n\n //---------------------------------------------------------------\n LMe.drawGraphScales = function(){\n var Lmax = 100,\n Lmin = 0;\n\n //create group for time line\n LMe.timelineGroup = LMe.svg\n .append('g')\n .classed(\"time-line-group\", true)\n .attr(\"transform\", \"translate(\" + 0 + \",\" + 0 + \")\");\n\n //create group for time line\n LMe.scatterChartGroup = LMe.svg\n .append('g')\n .classed(\"scatter-chart-group\", true)\n .attr(\"transform\", \"translate(\" + (LMe.margin.left + 10) + \",\" + LMe.timelineHeight + \")\");\n\n\n //Add a rect to show background color\n LMe.timelineGroup\n .append(\"rect\")\n .attr(\"class\", \"time-line-bg\")\n .attr(\"width\", LMe.timelineWidth)\n .attr(\"height\", LMe.timelineHeight);\n\n //Add a title for the scales\n LMe.timelineGroup\n .append(\"text\")\n .attr(\"class\", \"timeline-info-text\")\n .text(\"FREQUENCY of selected keywords in corpus\")\n .attr(\"x\", LMe.margin.left + 10 + 10)\n .attr(\"y\", LMe.margin.top + 7);\n\n var LDateMax = d3.min([\"17-Aug-06\", \"20-Dec-12\"], function(d) {\n return d\n }),\n LDateMin = d3.max([\"17-Aug-06\", \"20-Dec-12\"], function(d) {\n return d.datePublish\n });\n\n LMe.DateMax = LDateMax;\n LMe.DateMin = LDateMin;\n\n var x = d3.time.scale().range([0, LMe.timelineWidth - LMe.margin.left - 10 - LMe.margin.right]);\n x.domain(d3.extent(G_DATA_JSON.DOC_DATA.map(function(d) { return LMe.dateFormat.parse(d.DatePublish); })));\n var xAxis = d3.svg.axis().scale(x).orient('bottom').tickSize(0).tickPadding(5);\n\n var x1 = d3.time.scale().range([0, LMe.timelineWidth - LMe.margin.left - 10 - LMe.margin.right]);\n x1.domain(d3.extent(G_DATA_JSON.DOC_DATA.map(function(d) { return LMe.dateFormat.parse(d.DatePublish); })));\n var xAxis1 = d3.svg.axis().scale(x1).orient('bottom').tickSize(0).tickPadding(5);\n\n var LYaxisHt = LMe.timelineHeight - 50;\n var y = d3.scale.linear().range([LYaxisHt, 0]).domain([Lmin, Lmax]);\n var yAxis = d3.svg.axis().scale(y).orient('left').tickSize(0).tickPadding(5);//.tickFormat(LMe.formatPercent);\n\n var LXAxisXcord = LMe.margin.left + 10,\n LXAxisYcord = LMe.timelineHeight - LMe.margin.bottom - 9,\n\n LX1AxisXcord = LMe.margin.left + 10,\n LX1AxisYcord = 20,\n\n LYAxisXcord = LMe.margin.left + 10,\n LYAxisYcord = LMe.margin.top;\n\n LMe.timelineGroup.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(\" + LYAxisXcord + \",\" + LYAxisYcord + \")\")\n .call(yAxis);\n\n LMe.timelineGroup.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(\" + LXAxisXcord + \",\" + LXAxisYcord + \")\")\n .call(xAxis);\n\n /*LMe.scatterChartGroup.append(\"g\")\n .attr(\"class\", \"x axis x1\")\n .attr(\"transform\", \"translate(\" + 0 + \",\" + LX1AxisYcord + \")\")\n .call(xAxis1);*/\n\n LMe.x = x;\n LMe.x1 = x1;\n LMe.y = y;\n LMe.xAxis = xAxis;\n LMe.xAxis1 = xAxis1;\n LMe.yAxis = yAxis;\n\n };\n\n //---------------------------------------------------------------\n LMe.drawAreaChart = function(p_KeywordData, p_FillColor){\n var data = p_KeywordData.data,\n keyword = p_KeywordData.keyword;\n data.sort(function(a, b) {\n var LDate1 = LMe.dateFormat.parse(a.datePublish),\n LDate2 = LMe.dateFormat.parse(b.datePublish);\n if(LDate1 < LDate2)\n {\n return 1;\n }\n else if(LDate1 > LDate2)\n {\n return -1;\n }\n else{\n return 0;\n }\n });\n\n var garea = d3.svg.area()\n .interpolate(\"linear\")\n .x(function(d) {\n // verbose logging to show what's actually being done\n return LMe.x(LMe.dateFormat.parse(d.datePublish));\n })\n .y0(LMe.timelineHeight - LMe.margin.top - LMe.margin.bottom - 10)\n .y1(function(d) {\n // verbose logging to show what's actually being done\n return LMe.y(d.keywordOccurance);\n });\n\n var LAreaX = LMe.margin.left + 1,\n LAreaY = LMe.margin.top;\n\n var LMapGroup = LMe.timelineGroup\n .append('g')\n .attr('transform', 'translate(' + LAreaX + ',' + LAreaY + ')');\n\n var dataLines = LMapGroup.selectAll('.data-line')\n .data(data);\n dataLines\n .enter()\n .append('svg:path')\n .datum(keyword)\n .style('fill', '#888888')\n .style('fill-opacity', '0.5')\n .attr(\"class\", \"area\")\n .attr(\"d\", garea(data))\n /*.on(\"mouseover\", function(d){\n //Highlight the circles for word\n LMe.highlightDocCircles(d);\n })*/;\n\n LMe.dataLinesCollection.push(dataLines);\n\n }\n\n //---------------------------------------------------------------\n LMe.handleOnBrush = function(){\n ///var LBrushExtend = LMe.brush.extend();\n\n var LBrushExtend = LMe.brush.extent(),\n LLowerDate = LBrushExtend[0],\n LUpperDate = LBrushExtend[1];\n\n LMe.x1.domain(LMe.brush.empty() ? LMe.x.domain() : LMe.brush.extent());\n d3.select('#' + LMe.svgId).select(\".x1\").call(LMe.xAxis1);\n //LMe.displayBubblesInTheRange(LLowerDate, LUpperDate);\n\n if(LMe.documentViewMode == \"timeline_view\")\n {\n LMe.generateTimeLineViewForCentralCircle();\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.generateAssociationViewForCentralCircle();\n }\n\n /*if(LMe.associationLines)\n {\n //If there are lines drawn update the lines\n LMe.associationLines.each(function(d){\n var LLine = d3.select(this);\n if(d.value < G_DOC_ASSOCIATION_THREASHOLD)\n {\n LLine.style(\"display\", \"none\");\n }\n else\n {\n LLine.style(\"display\", \"block\");\n }\n\n d.x1 = d3.select(d.sourceCircle).attr(\"cx\");\n d.y1 = d3.select(d.sourceCircle).attr(\"cy\");\n d.x2 = d3.select(d.targetCircle).attr(\"cx\");\n d.y2 = d3.select(d.targetCircle).attr(\"cy\");\n LLine\n .attr(\"x1\", function(d){ return d.x1; })\n .attr(\"y1\", function(d){ return d.y1; })\n .attr(\"x2\", function(d){ return d.x2; })\n .attr(\"y2\", function(d){ return d.y2; });\n\n });\n } */\n };\n\n //---------------------------------------------------------------\n LMe.drawVerticalLines = function(){\n var rule = d3.select(\"#\" + LMe.svgId).selectAll(\"g.rule\")\n .data(LMe.x1.ticks(10))\n .enter().append(\"svg:g\")\n .attr(\"class\", \"rule\")\n .attr(\"transform\", function(d) { return \"translate(\" + (LMe.x1(d) + LMe.margin.left) + \",\" + \"0\" + \")\"; });\n\n rule.append(\"svg:line\")\n .attr(\"y1\", LMe.height - LMe.timelineHeight - LMe.margin.top - 30)\n .style(\"stroke\", function(d) { return \"#AAAAAA\"; })\n .style(\"stroke-dasharray\", '9, 3, 5' )\n .style(\"stroke-opacity\", function(d) { return 0.5; })\n\n rule.append(\"svg:text\")\n //.attr(\"dx\", '20px')\n .attr(\"dy\", \"10px\")\n .attr(\"class\", \"grid-text\")\n .attr(\"fill\", \"#AAAAAA\")\n .attr(\"transform\", \"rotate(90)\")\n .attr(\"transform-origin\", \"0 0\")\n .text(function(d){\n return LMe.dateFormat(d)\n });\n }\n\n //---------------------------------------------------------------\n LMe.drawDocumentScatterChart = function(p_Data){\n //Generate data for scatter chart\n var LScatterChartData = LMe.generateDataForScatterChart(p_Data);\n\n LMe.ScatterPlot = d3.select(\"#\" + LMe.svgId).append('g');\n LMe.ScatterPlotCircles = LMe.ScatterPlot.selectAll('circle')\n .data(LScatterChartData)\n .enter().append(\"circle\")\n .attr(\"class\", \"document-circles\")\n .on(\"mouseover\", function(d){\n d3.select(this).transition().duration(500)\n .attr(\"r\", \"15\")\n .attr(\"stroke-width\", \"3\");\n\n LMe.tooltip.style(\"visibility\", \"visible\");\n d3.select(\"#tooltip .tooltip-html\").html(\"Loading \" + d.documentName + \"...\");\n\n var currHeight = $('#tooltip').height(),\n LPageY = d3.event.pageY,\n LPageX = d3.event.pageX;\n\n var LToolTipTop = LPageY - currHeight - 100,\n LToolTipLeft = LPageX - 150;\n if(LToolTipTop < 0)\n {\n //tooltip is going out of screen\n LToolTipTop = LPageY + 100;\n }\n LMe.tooltip.style(\"top\", +\"px\")\n .style(\"left\",LToolTipLeft +\"px\");\n\n var LDocURL = \"data/txt/\" + d.documentName;\n d3.text(LDocURL, function(p_Text){\n var LDocTxt = p_Text.substring(0, 120);\n LDocTxt += '...';\n\n //clear the hint\n var LToolTip = d3.select(\"#tooltip .tooltip-html\").html(\"\");\n\n //add title\n LToolTip.append(\"div\")\n .attr(\"class\", \"title\")\n .text(d.documentName)\n\n //add the text content\n LToolTip.append(\"div\")\n .attr(\"class\", \"content\")\n .text(LDocTxt)\n\n /*//add the open document link\n LToolTip.append(\"div\")\n .style(\"text-align\", \"right\")\n .style(\"paddin-top\", \"10px\")\n .append(\"a\")\n .attr(\"href\", LDocURL)\n .attr(\"class\", \"open-link\")\n .attr(\"target\", \"_blank\")\n .text(\"OPEN DOCUMENT\");*/\n\n /**/\n var LHt = $(\"#tooltip\").height();\n var LToolTipTop = LPageY - LHt - 40,\n LToolTipLeft = LPageX - 150;\n if(LToolTipTop < 0)\n {\n //tooltip is going out of screen\n LToolTipTop = LPageY + 30;\n }\n\n LMe.tooltip.style(\"top\", LToolTipTop +\"px\")\n .style(\"left\",LToolTipLeft + \"px\");\n\n /*LMe.timoutObj = setTimeout(function(){\n\n }, 3000);*/\n\n });\n })\n .on(\"click\", function(d){\n d3.select(this).transition().duration(500)\n .attr(\"r\", \"15\")\n .attr(\"stroke-width\", \"3\");\n LMe.onDocumentBubbleClick(d);\n })\n .on(\"mouseout\", function(d){\n d3.select(this).transition().duration(500)\n .attr(\"r\", \"10\")\n .attr(\"stroke-width\", \"1\");\n\n LMe.tooltip.style(\"visibility\", \"hidden\");\n\n //LMe.tooltip.style(\"visibility\", \"hidden\");\n })\n /*.attr(\"title\", function(d){\n return d.documentName;\n })*/\n .attr({\n cx: function(d) { return LMe.x1(LMe.dateFormat.parse(d.datePublish)) + LMe.margin.left; },\n cy: function(d) {\n var LY = Math.floor((Math.random() * (LMe.height - LMe.timelineHeight - LMe.margin.bottom - 50))+1);\n if(LY < (LMe.margin.top + 50))\n {\n LY = LMe.margin.top + 50;\n }\n return LY;\n },\n r: 10\n });\n }\n\n //---------------------------------------------------------------\n LMe.generateDataForScatterChart = function(p_Data)\n {\n //the function will return a data array to generate the scatter chart\n var LResult = [],\n LMergedArray = [];\n\n //Traverse the keyword\n for(var LLoopIndex=0; LLoopIndex < p_Data.length; LLoopIndex++)\n {\n var LKeywordData = p_Data[LLoopIndex],\n LKeyword = LKeywordData.keyword,\n LData = LKeywordData.data;\n for(var LLoopIndex1=0; LLoopIndex1 < LData.length; LLoopIndex1++)\n {\n var LDocumentData = LData[LLoopIndex1],\n LDocumentName = LDocumentData.documentName,\n LDocumentPublishDate = LDocumentData.datePublish;\n\n var LIndex = -1;\n for(var LLoopIndex2=0; LLoopIndex2 < LMergedArray.length; LLoopIndex2++)\n {\n if(LDocumentName == LMergedArray[LLoopIndex2].documentName)\n {\n LIndex = LLoopIndex2;\n break;\n }\n\n }\n\n if(LIndex > -1)\n {\n //The document is already present in the data\n var LDoc = LMergedArray[LIndex];\n LDoc.keywords.push(LKeyword);\n }\n else\n {\n //The document is already present in the data\n var LDoc = {};\n LDoc.keywords = [];\n LDoc.keywords.push(LKeyword);\n LDoc.documentName = LDocumentName;\n LDoc.datePublish = LDocumentPublishDate;\n\n //Merged array\n LMergedArray.push(LDoc);\n }\n }\n }\n\n return LMergedArray;\n };\n\n //---------------------------------------------------------------\n LMe.highlightDocCircles = function(p_keyword)\n {\n //highlight the line chart\n LMe.svg.selectAll(\".timeline-path-group\").each(function(d){\n if(d[0].keyword == p_keyword)\n {\n d3.select(this).select(\"path\").style(\"stroke\", \"#D1B83B\");\n }\n });\n\n if(LMe.documentViewMode == \"timeline_view\")\n {\n //highlight the time line view\n LMe.ScatterPlotCircles.each(function(d){\n var LIndex = libGetIndexOfWord(d.keywords ,p_keyword);\n if(LIndex > -1)\n {\n //keyword is present in the document\n //Change the style to selected\n d3.select(this).classed(\"document-circles-selected\", true);\n\n //Recalculate the radius\n d3.select(this).transition().duration(500).attr(\"r\", LMe.getRadiusOfScatterBubble(d, p_keyword));\n }\n });\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.associationViewNodes.each(function(d){\n var LIndex = libGetIndexOfWord(d.keywords ,p_keyword);\n if(LIndex > -1)\n {\n //keyword is present in the document\n //Change the style to selected\n d3.select(this).classed(\"document-circles-selected\", true);\n\n //Recalculate the radius\n d3.select(this).transition().duration(500).attr(\"r\", LMe.getRadiusOfScatterBubble(d, p_keyword));\n }\n });\n }\n };\n\n //---------------------------------------------------------------\n LMe.unselectSelectedDocCircles = function(p_keyword)\n {\n LMe.svg.selectAll(\".timeline-path-group\").each(function(d){\n if(d[0].keyword == p_keyword)\n {\n d3.select(this).select(\"path\").style(\"stroke\", \"#999999\");\n }\n });\n\n if(LMe.documentViewMode == \"timeline_view\")\n {\n //unhighlight the time line view\n LMe.ScatterPlotCircles.each(function(d){\n var LIndex = libGetIndexOfWord(d.keywords ,p_keyword);\n if(LIndex > -1)\n {\n //keyword is present in the document\n //Change the style to selected\n d3.select(this).classed(\"document-circles-selected\", false);\n\n //Recalculate the radius\n d3.select(this).transition().duration(500).attr(\"r\", LMe.getRadiusOfScatterBubble(d));\n }\n });\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.associationViewNodes.each(function(d){\n var LIndex = libGetIndexOfWord(d.keywords ,p_keyword);\n if(LIndex > -1)\n {\n //keyword is present in the document\n //Change the style to selected\n d3.select(this).classed(\"document-circles-selected\", false);\n\n //Recalculate the radius\n d3.select(this).transition().duration(500).attr(\"r\", function(d){\n /*if(LMe.focussedCircle.Filename == d.Filename){\n return 20;\n }*/\n return LMe.getRadiusOfScatterBubble(d);\n });\n }\n });\n }\n\n };\n\n //---------------------------------------------------------------\n LMe.displayBubblesInTheRange = function(p_FromDate, p_ToDate){\n LMe.ScatterPlotCircles.each(function(d){\n var LCircle = this,\n LDate = LMe.dateFormat.parse(d.DatePublish);\n\n d3.select(LCircle).attr({\n cx: function(d) {\n var Lx = LMe.x1(LMe.dateFormat.parse(d.DatePublish));\n if(Lx < 0 || Lx > (LMe.width - LMe.margin.left - LMe.margin.right ))\n {\n // the bubble is out of range\n d3.select(this).style(\"display\", \"none\");\n }\n else\n {\n //the bubble is in range\n d3.select(this).style(\"display\", \"block\");\n }\n return Lx;\n }\n });\n\n });\n };\n\n //---------------------------------------------------------------\n LMe.onChangeAssociationsVisibleRange = function(p_AssociationVisibilityThreashold)\n {\n if(LMe.documentViewMode == \"timeline_view\")\n {\n LMe.generateTimeLineViewForCentralCircle();\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.generateAssociationViewForCentralCircle();\n }\n /*if(LMe.associationLines)\n {\n //If there are lines drawn update the lines\n LMe.associationLines.each(function(d){\n var LLine = d3.select(this);\n if(d.value < p_AssociationVisibilityThreashold)\n {\n LLine.style(\"display\", \"none\");\n }\n else\n {\n LLine.style(\"display\", \"block\");\n }\n });\n }*/\n };\n\n //---------------------------------------------------------------\n LMe.drawAssociation = function(){\n //Draw assiciation between the documents\n };\n\n //---------------------------------------------------------------\n LMe.switchViewToAssociationView = function(){\n LMe.documentViewMode = \"association_view\";\n LMe.drawAssociationLines();\n LMe.removeAssociationLines();\n LMe.updateDocumentAssociationViewLayout();\n };\n\n //---------------------------------------------------------------\n LMe.switchViewToTimelineView = function(){\n LMe.documentViewMode = \"timeline_view\";\n LMe.removeAssociationViewData();\n LMe.hideAssociationLines();\n LMe.hideAssociationScaleCircles();\n\n //Make all the scatter docs visible\n /*LMe.ScatterPlotCircles.each(function(d){\n var LCircle = d3.select(this);\n LCircle.style(\"display\", \"block\");\n });*/\n\n LMe.addScatterChartCircle(LMe.currentDataChart);\n };\n\n //---------------------------------------------------------------\n LMe.updateDocumentAssociationViewLayout = function()\n {\n LMe.generateAssociationViewForCentralCircle();\n /*var LAssociationViewData = [],\n LLinks = [],\n LIndex = 0,\n LSourceIndex = 0,\n LfoccusedDocData = d3.select(LMe.focussedCircle).data()[0];\n\n //Get data for bubbles\n LMe.ScatterPlotCircles.each(function(d){\n var LCircle = d3.select(this);\n LCircle.style(\"display\", \"none\");\n var Lx = LCircle.attr(\"cx\");\n if(Lx < 0 || Lx > (LMe.width - LMe.margin.left - LMe.margin.right))\n {\n return;\n }\n\n if(LfoccusedDocData.Filename == d.Filename)\n {\n LSourceIndex = LIndex;\n }\n\n LAssociationViewData.push(d);\n LIndex ++;\n });\n\n //Get data for links\n for(var LLoopIndex = 0; LLoopIndex < LAssociationViewData.length; LLoopIndex++)\n {\n var LDocCol,\n LBubble = LAssociationViewData[LLoopIndex];\n //Get column for the document\n for(var LLoopIndex1 = 0; LLoopIndex1 < G_DATA_JSON.DOC_ASSOC_MATRIX.length; LLoopIndex1++)\n {\n var LColumn = G_DATA_JSON.DOC_ASSOC_MATRIX[LLoopIndex1];\n if(LColumn[\"\"] == LfoccusedDocData.Filename)\n {\n LDocCol = LColumn;\n break;\n }\n }\n\n var LValue = LDocCol[LBubble.Filename];\n LBubble.associationVal = LValue;\n var LObj = {\"source\":LSourceIndex,\"target\":LLoopIndex,\"value\":LValue};\n LLinks.push(LObj);\n }\n\n if(! LMe.force)\n {\n var LForceHt = (LMe.timelineHeight + (LMe.height - LMe.timelineHeight)/2) * 2,\n LForceWd = LMe.width,\n LLinkDst = LMe.height - LMe.margin.top - LMe.margin.bottom - LMe.timelineHeight;\n LLinkDst = LLinkDst/2;\n\n LMe.force = d3.layout.force()\n .gravity(.05)\n .distance(100)\n .linkDistance(function(d) { return LLinkDst * d.value; })\n .charge(-100)\n .size([LForceWd, LForceHt]);\n\n LMe.force.on(\"tick\", function(e) {\n LMe.node\n .attr(\"cx\", function(d) {\n return d.x;\n })\n .attr(\"cy\", function(d) {\n return d.y;\n });\n\n LMe.link.attr(\"x1\", function(d) {\n return d.source.x;\n })\n .attr(\"y1\", function(d) {\n return d.source.y;\n })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n\n });\n }\n\n LMe.force\n .nodes(LAssociationViewData)\n .links(LLinks)\n //.linkDistance(function(d) { return (LMe.height/2) * d.value; })\n .start();\n\n LMe.link = LMe.svg.selectAll(\".link\")\n .data(LLinks)\n .enter().append(\"line\")\n .attr(\"class\", \"link document-assos-line\");\n\n LMe.LCenterCircle = null;\n LMe.node = LMe.svg.selectAll(\".node\")\n .data(LAssociationViewData)\n .enter().append(\"circle\")\n .attr(\"class\", \"node document-circles-assoc\")\n .attr(\"r\", function(d){\n if(d.Filename == LfoccusedDocData.Filename)\n {\n return 30;\n }\n return LMe.getRadiusOfScatterBubble(d);\n })\n .attr(\"fill\", function(d){\n if(d.Filename == LfoccusedDocData.Filename)\n {\n return \"#D4BE56\";\n }\n return \"#EEEEEE\";\n })\n .on(\"mouseover\", function(d){\n })\n .on(\"mouseout\", function(d){\n })\n .on(\"click\", function(d){\n })\n .call(LMe.force.drag);*/\n };\n\n //---------------------------------------------------------------\n LMe.removeAssociationLines = function(){\n LMe.scatterChartGroup.selectAll(\".association-links\").data([]).exit().remove();\n };\n\n //---------------------------------------------------------------\n LMe.removeAssociationViewData = function(){\n LMe.force.stop();\n\n LMe.svg.selectAll(\".link\")\n .data([]).exit().remove();\n\n LMe.svg.selectAll(\".node\")\n .data([]).exit().remove();\n };\n\n //---------------------------------------------------------------\n LMe.createSlider = function(){\n var LMainContainer = LMe.scatterChartGroup.append(\"g\").attr(\"class\", \"doc-assoc-slider-cntnr\").style(\"display\", \"none\"),\n LLblContainer = LMainContainer.append(\"g\"),\n LLbl = LLblContainer.append(\"text\").text(\"Document Similarity Threshold ('0' to show all relationships)\").attr(\"class\", \"doc-assoc-slider-lbl\"),\n LSliderContainer = LMainContainer.append(\"g\"),\n LBtnContainer = LMainContainer.append(\"g\");\n\n var margin = {top: 0, right: 20, bottom: 0, left: 20},\n// width = (LMe.width/2 - margin.left),\n width = (LMe.width - LMe.margin.left - LMe.margin.right)/2,\n height = 30 - margin.bottom - margin.top,\n LRectHeight = 17,\n LRectWidth = 35,\n LRectRadius = 5,\n //LScaleX = (LMe.width - LMe.margin.left - LMe.margin.right)/2 - 155,\n LScaleX = 0,\n LScaleY = LMe.height - LMe.timelineHeight - height + 20,\n LBtnHeight = 17,\n LBtnWidth = 90,\n LBtnRadius = 10;\n\n var x = d3.scale.linear()\n .domain([0, 1])\n .range([0, (width + 1)])\n .clamp(true);\n\n LMe.assocSliderScale = x;\n\n var Lbrush = d3.svg.brush()\n .x(x)\n .extent([0, 0])\n .on(\"brush\", L_brushed)\n .on(\"brushend\", L_brushend);\n\n LMainContainer.attr(\"transform\", \"translate(\" + LScaleX + \",\" + LScaleY + \")\");\n LLblContainer.attr(\"transform\", \"translate(\" + 13 + \",\" + 34 + \")\");\n LSliderContainer.attr(\"transform\", \"translate(\" + 0 + \",\" + 0 + \")\");\n LBtnContainer.attr(\"transform\", \"translate(\" + (width + 15) + \",\" + 6 + \")\");\n\n LBtnContainer.append(\"rect\")\n .attr(\"class\", \"svg-rect-btn\")\n .attr(\"rx\", LBtnRadius)\n .attr(\"ry\", LBtnRadius)\n .attr(\"width\", LBtnWidth)\n .attr(\"height\", LBtnHeight)\n .on(\"click\", function(d){\n var LButtonText = LBtnTxt.text();\n if(LButtonText == \"Association View\")\n {\n LBtnTxt.text(\"Timeline View\");\n LMe.switchViewToAssociationView();\n }\n else\n {\n LBtnTxt.text(\"Association View\");\n LMe.switchViewToTimelineView();\n }\n });\n\n var LBtnTxt = LBtnContainer.append(\"text\")\n .attr(\"x\", 45)\n .attr(\"y\", 11)\n .attr(\"class\", \"svg-rect-btn-txt\")\n .text(\"Association View\");\n\n LMe.btnSwitchGraphViewTxt = LBtnTxt;\n\n LSliderContainer.append(\"g\")\n .attr(\"class\", \"x axis slider-axis\")\n .attr(\"transform\", \"translate(0,\" + height / 2 + \")\")\n .call(d3.svg.axis()\n .scale(x)\n .orient(\"bottom\")\n .tickSize(0)\n .tickPadding(12));\n\n var slider = LSliderContainer.append(\"g\")\n .attr(\"class\", \"slider\")\n .call(Lbrush);\n\n slider.selectAll(\".extent,.resize\")\n .remove();\n\n slider.select(\".background\")\n .attr(\"height\", height);\n\n var handle = slider.append(\"rect\")\n .attr(\"class\", \"handle\")\n .attr(\"rx\", LRectRadius)\n .attr(\"ry\", LRectRadius)\n .attr(\"transform\", \"translate(0,\" + height / 2 + \")\")\n .attr(\"width\", LRectWidth)\n .attr(\"height\", LRectHeight);\n\n var sliderText = slider.append(\"text\")\n .attr(\"class\", \"handle-text\")\n .attr(\"transform\", \"translate(0,\" + height / 2 + \")\");\n\n slider\n .call(Lbrush.event)\n .transition() // gratuitous intro!\n .duration(500)\n .call(Lbrush.extent([0, 0]))\n .call(Lbrush.event);\n\n var LPrevBrushExt = Lbrush.extent();\n function L_brushed() {\n var value = Lbrush.extent()[0];\n var value1 = Lbrush.extent()[1];\n\n //console.log(\"value -- \" + value + \", value1 -- \" + value1);\n if(LPrevBrushExt)\n {\n if(LPrevBrushExt[0] == value)\n {\n //The brush has been moved to right\n value = value1;\n }\n else if(LPrevBrushExt[1] == value1)\n {\n //brush has moved to left\n value = value;\n }\n else\n {\n value = value;\n }\n }\n //value = value1;\n LPrevBrushExt = Lbrush.extent();\n\n var LDummyvalue = Math.round(value * 100);\n LDummyvalue = LDummyvalue/100;\n\n /*console.log(\"val -- \" + value);\n console.log(\"value1 -- \" + value1);\n console.log(\"dummy val -- \" + LDummyvalue);*/\n\n if (d3.event.sourceEvent) { // not a programmatic event\n value = x.invert(d3.mouse(this)[0]);\n Lbrush.extent([value, value]);\n }\n\n\n sliderText.attr(\"x\", x(value));\n sliderText.attr(\"y\", 3);\n var LXAxisValue = x(value);\n //LXAxisValue = (LMe.width - LMe.margin.left - LMe.margin.right)/2 + LXAxisValue;\n handle.attr(\"x\", x(value) - LRectWidth/2);\n sliderText.text(LDummyvalue);\n G_DOC_ASSOCIATION_THREASHOLD = 1 - LDummyvalue;\n\n if(LMe.focussedCircle)\n {\n LMe.onChangeAssociationsVisibleRange(LDummyvalue);\n }\n\n if( LMe.horizontantalSliderAdjustor)\n {\n LMe.horizontantalSliderAdjustor\n .attr({\n x1 : LXAxisValue\n });\n }\n\n if( LMe.vericalSliderAdjustor)\n {\n LMe.vericalSliderAdjustor\n .attr({\n x1 : LXAxisValue,\n x2 : LXAxisValue\n });\n }\n }\n\n function L_brushend(){\n var value = Lbrush.extent()[0];\n value = Math.round(value * 100);\n value = value/100;\n\n if (d3.event.sourceEvent) { // not a programmatic event\n //value = x.invert(d3.mouse(this)[0]);\n Lbrush.extent([value, value]);\n }\n sliderText.text(value);\n sliderText.attr(\"x\", x(value));\n sliderText.attr(\"y\", 3);\n handle.attr(\"x\", x(value) - LRectWidth/2);\n handle.attr(\"y\", - LRectHeight/2);\n\n G_DOC_ASSOCIATION_THREASHOLD = value;\n\n var LXAxisValue = x(value);\n LMe.LXAxisValue = LXAxisValue;\n //LXAxisValue = (LMe.width - LMe.margin.left - LMe.margin.right)/2 + LXAxisValue;\n\n if( LMe.horizontantalSliderAdjustor)\n {\n LMe.horizontantalSliderAdjustor\n .attr({\n x1 : LXAxisValue\n });\n }\n\n if( LMe.vericalSliderAdjustor)\n {\n LMe.vericalSliderAdjustor\n .attr({\n x1 : LXAxisValue,\n x2 : LXAxisValue\n });\n }\n\n if(LMe.focussedCircle)\n {\n LMe.onChangeAssociationsVisibleRange(value);\n }\n /*if(LMe.focussedCircle)\n {\n //LMe.onChangeAssociationsVisibleRange(value);\n if(LMe.documentViewMode == \"timeline_view\")\n {\n //The visualization is in timeline view\n //Remove all the associations\n //LMe.removeAssociationLines();\n LMe.addScatterChartCircle(LMe.currentDataChart);\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n //LMe.switchViewToTimelineView();\n //LMe.removeAssociationLines();\n }\n }*/\n }\n };\n\n //---------------------------------------------------------------\n LMe.drawLegends = function(){\n var LDocumentTypeLegendsCntnr = LMe.svg.append(\"g\"),\n LDocumentSizeLegendsCntnr = LMe.svg.append(\"g\");\n\n var LDocTypeLegendHt = 20,\n LDocTypeLegendWd = 60;\n\n LDocumentTypeLegendsCntnr.attr(\"transform\", \"translate(\" + (LMe.width - 120) + \",\" + (LMe.timelineHeight + 50) + \")\");\n\n LDocumentTypeLegendsCntnr.append(\"rect\")\n .attr(\"height\", 160)\n .attr(\"width\", 123)\n .attr(\"fill\", \"#6B6B6B\");\n\n LDocumentTypeLegendsCntnr.append(\"text\")\n .attr(\"x\", 10)\n .attr(\"y\", 22)\n .attr(\"class\", \"legend-doc-type-title\")\n .text(\"Document\")\n .append(\"tspan\")\n .attr(\"x\", 10)\n .attr(\"y\", 37)\n .text(\"Type Filter\");\n\n //Create legends for document type\n var LLegends = LDocumentTypeLegendsCntnr.selectAll(\".doc-type-legend-group\").data(G_DOCUMENT_TYPE);\n var LG = LLegends.enter().append(\"g\")\n .attr(\"class\", \"doc-type-legend-group\")\n .attr(\"transform\", function(d, i){\n d.isSelected = true;\n return \"translate(0,\" + (45 + i * LDocTypeLegendHt) + \")\";\n })\n .on(\"click\", function(d){\n var LLegendGroup = d3.select(this);\n if(d.isSelected)\n {\n //unselect the type\n d.isSelected = false;\n LLegendGroup.select(\"rect\").classed(\"doc-type-legend-rect-unselected\", true);\n }\n else\n {\n //select the type\n d.isSelected = true;\n LLegendGroup.select(\"rect\").classed(\"doc-type-legend-rect-unselected\", false);\n }\n\n if(LMe.documentViewMode == \"timeline_view\")\n {\n LMe.generateTimeLineViewForCentralCircle();\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.generateAssociationViewForCentralCircle();\n }\n\n /*if(LMe.documentViewMode == \"timeline_view\")\n {\n LMe.ScatterPlotCircles.attr(\"display\", function(d){\n if(isDocTypeSelected(d.DocType))\n {\n //doc type is selected\n return \"block\";\n }\n else\n {\n //doc type is not selected\n return \"none\";\n }\n });\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.associationViewNodes.attr(\"display\", function(d){\n if(isDocTypeSelected(d.DocType))\n {\n //doc type is selected\n return \"block\";\n }\n else\n {\n //doc type is not selected\n return \"none\";\n }\n });\n }*/\n });\n\n LG.append(\"rect\")\n .attr(\"width\", 15)\n .attr(\"height\", 15)\n .attr(\"rx\", 5)\n .attr(\"ry\", 5)\n .attr(\"x\", 10)\n .attr(\"y\", 5)\n .attr(\"class\", \"doc-type-legend-rect\");\n\n LG.append(\"text\")\n .text(function(d){\n return d.typeName\n })\n .attr(\"x\", 30)\n .attr(\"y\", 15)\n .attr(\"class\", \"doc-type-legend-txt\");\n\n\n //add the circle size legend box\n LDocumentSizeLegendsCntnr.attr(\"transform\", \"translate(\" + (LMe.width - 120) + \",\" + (LMe.timelineHeight + 220) + \")\");\n\n LDocumentSizeLegendsCntnr.append(\"rect\")\n .attr(\"height\", 160)\n .attr(\"width\", 119)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"#6B6B6B\");\n\n LDocumentSizeLegendsCntnr.append(\"text\")\n .attr(\"x\", 10)\n .attr(\"y\", 22)\n .attr(\"class\", \"legend-doc-type-title\")\n .text(\"Legend\");\n\n var LDocSizeLegends = LDocumentSizeLegendsCntnr.selectAll(\".doc-size-legend-group\").data(G_DOCUMENT_CIRCLE_LEGENDS);\n var LTop = 30;\n var LSizeG = LDocSizeLegends.enter().append(\"g\")\n .attr(\"class\", \"doc-size-legend-group\")\n .attr(\"transform\", function(d, i){\n var LPrevTop = LTop;\n LTop = LTop + d.documentBubbleRadius + 20;\n return \"translate(0,\" + (LPrevTop) + \")\";\n });\n\n LSizeG.append(\"circle\")\n// .attr(\"cx\", function(d){ return d.documentBubbleRadius + 5; })\n .attr(\"cx\", function(d){ return 30; })\n .attr(\"cy\", function(d){ return d.documentBubbleRadius + 5; })\n .attr(\"r\", function(d){ return d.documentBubbleRadius; })\n .attr(\"class\", \"doc-size-legend-circle\");\n\n LSizeG.append(\"text\")\n .text(function(d){\n if(! d.max)\n {\n return d.min + \"+\";\n }\n return d.min + \" - \" + d.max;\n })\n .attr(\"x\", 55)\n .attr(\"y\", function(d){ return d.documentBubbleRadius + 7; })\n .attr(\"class\", \"doc-size-legend-txt\");\n };\n\n //---------------------------------------------------------------\n LMe.displayDocumentDetails = function(p_DocumentDetails)\n {\n //Display document title\n d3.select(\"#doc-title\").text(p_DocumentDetails.Filename);\n\n //Display document info\n var LInfo = p_DocumentDetails.DatePublish + \" | \" + getDocumentTypeTitle(p_DocumentDetails.DocType);\n d3.select(\"#doc-info\").text(LInfo);\n\n //Get top 5 keywords from the document\n var LWordPerDoc = G_DATA_JSON.WORD_FREQ_PER_DOC,\n LDocOccuranceArr = LWordPerDoc[p_DocumentDetails.Filename],\n LDocKeywordArr = LWordPerDoc.FIELD1,\n LSortedArray,\n LKeywordIndexArray = [];\n LSortedArray = LDocOccuranceArr.slice(0);\n LSortedArray.sort(function(a,b){return b-a});\n\n for(var LLoopIndex = 0; LLoopIndex < 5; LLoopIndex++)\n {\n var LVal = LSortedArray[LLoopIndex];\n for(var LLoopIndex1=0; LLoopIndex1 < LDocOccuranceArr.length; LLoopIndex1++)\n {\n var ArrayEl = LDocOccuranceArr[LLoopIndex1];\n if(ArrayEl == LVal)\n {\n var LFound = false;\n //check if the index already exists in the keyword array\n for(var LLoopIndex2=0; LLoopIndex2 < LKeywordIndexArray.length; LLoopIndex2++)\n {\n var LKeywordIndex = LKeywordIndexArray[LLoopIndex2];\n if(LKeywordIndex == LLoopIndex1)\n {\n LFound = true;\n break;\n }\n }\n\n if(! LFound)\n {\n LKeywordIndexArray.push(LLoopIndex1);\n }\n }\n }\n }\n\n //Get comma seperated keywords\n var LKeyowrdsStr = '';\n for(var LLoopIndex = 0; LLoopIndex < 5; LLoopIndex++)\n {\n var LWordIndex = LKeywordIndexArray[LLoopIndex];\n LKeyowrdsStr += LDocKeywordArr[LWordIndex];\n\n if(LLoopIndex < LKeywordIndexArray.length - 1)\n {\n LKeyowrdsStr += ', ';\n }\n }\n\n //display top 5 keyword\n d3.select(\"#top-keywords\").text(LKeyowrdsStr);\n\n //load and display the text document\n d3.select(\"#doc-content\").text(\"Loading..\");\n\n var LURL = \"data/txt/\" + p_DocumentDetails.Filename;\n d3.text(LURL, function(p_content){\n d3.select(\"#doc-content\").text(p_content);\n });\n }\n\n //---------------------------------------------------------------\n LMe.clearLoadedDocument = function(){\n d3.select(\"#doc-title\").text(\"\");\n d3.select(\"#doc-info\").text(\"\");\n d3.select(\"#top-keywords\").text(\"\");\n d3.select(\"#doc-content\").text(\"\");\n };\n\n //---------------------------------------------------------------\n LMe.showSlider = function()\n {\n d3.select(\".doc-assoc-slider-cntnr\").style(\"display\", \"block\");\n if(! LMe.btnSwitchGraphViewTxt) return;\n if(LMe.documentViewMode == \"timeline_view\")\n {\n LMe.btnSwitchGraphViewTxt.text(\"Association View\");\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.btnSwitchGraphViewTxt.text(\"Timeline View\");\n }\n };\n\n //---------------------------------------------------------------\n LMe.hideSlider = function()\n {\n d3.select(\".doc-assoc-slider-cntnr\").style(\"display\", \"none\");\n\n if(! LMe.btnSwitchGraphViewTxt) return;\n\n if(LMe.documentViewMode == \"timeline_view\")\n {\n LMe.btnSwitchGraphViewTxt.text(\"Association View\");\n }\n else if(LMe.documentViewMode == \"association_view\")\n {\n LMe.btnSwitchGraphViewTxt.text(\"Timeline View\");\n }\n };\n\n //---------------------------------------------------------------\n LMe.adjustScatterChartAxis = function(){\n //Change the border\n var LRect = d3.select(\".brush rect.extent\"),\n LRectWidth = parseFloat(LRect.attr(\"width\")),\n LRectHeight = parseFloat(LRect.attr(\"height\")),\n LRectX = parseFloat(LRect.attr(\"x\")),\n LRectY = parseFloat(LRect.attr(\"y\")),\n LStrokeDashArray;\n LStrokeDashArray = (LRectWidth + LRectHeight);\n LStrokeDashArray = LStrokeDashArray + \",\" + LRectWidth;\n LRect.attr(\"stroke-dasharray\", LStrokeDashArray);\n\n if(LRectWidth < 1)\n {\n //The width is zero so we dont need to worry about the display line\n LMe.scatterChartAxisLeft.style(\"display\", \"none\");\n LMe.scatterChartAxisRight.style(\"display\", \"none\");\n LMe.scatterChartTickLeft.style(\"display\", \"none\");\n LMe.scatterChartTickRight.style(\"display\", \"none\");\n LMe.scaleValueTextLeft.style(\"display\", \"none\");\n LMe.scaleValueTextRight.style(\"display\", \"none\");\n }\n else\n {\n if(! LMe.scatterChartAxisLeft){\n LMe.scatterChartAxisLeft = LMe.scatterChartGroup.append(\"line\")\n .attr(\"class\", \"scatter-chart-lines\");\n }\n\n LMe.scatterChartAxisLeft\n .attr(\"x1\", 0)\n .attr(\"y1\", 0)\n .attr(\"x2\", LRectX)\n .attr(\"y2\", 0);\n\n if(! LMe.scatterChartAxisRight){\n LMe.scatterChartAxisRight = LMe.scatterChartGroup.append(\"line\")\n .attr(\"class\", \"scatter-chart-lines\");\n }\n\n var LLeft1 = LRectX + LRectWidth,\n LLeft2 = LMe.width - LMe.margin.left - LMe.margin.right - 10;\n LMe.scatterChartAxisRight\n .attr(\"x1\", LLeft1)\n .attr(\"y1\", 0)\n .attr(\"x2\", LLeft2)\n .attr(\"y2\", 0);\n\n if(! LMe.scatterChartTickLeft){\n LMe.scatterChartTickLeft = LMe.scatterChartGroup.append(\"line\")\n .attr(\"class\", \"scatter-chart-lines\")\n .attr(\"x1\", 0)\n .attr(\"y1\", 0)\n .attr(\"x2\", 0)\n .attr(\"y2\", 20);\n }\n\n if(! LMe.scatterChartTickRight){\n LMe.scatterChartTickRight = LMe.scatterChartGroup.append(\"line\")\n .attr(\"class\", \"scatter-chart-lines\")\n .attr(\"x1\", LLeft2)\n .attr(\"y1\", 0)\n .attr(\"x2\", LLeft2)\n .attr(\"y2\", 20);\n }\n\n var LBrushExtend = LMe.brush.extent(),\n LLowerDate = LBrushExtend[0],\n LUpperDate = LBrushExtend[1];\n if(! LMe.scaleValueTextLeft){\n LMe.scaleValueTextLeft = LMe.scatterChartGroup.append(\"text\")\n .attr(\"class\", \"scale-value-text\")\n .attr(\"x\", 3)\n .attr(\"y\", 20);\n }\n LMe.scaleValueTextLeft.text(LMe.scaleDateDisplayFormat(LLowerDate));\n\n if(! LMe.scaleValueTextRight){\n LMe.scaleValueTextRight = LMe.scatterChartGroup.append(\"text\")\n .attr(\"class\", \"scale-value-text\")\n .attr(\"x\", (LLeft2 - 3))\n .attr(\"y\", 20)\n .attr(\"text-anchor\", \"end\");\n }\n LMe.scaleValueTextRight.text(LMe.scaleDateDisplayFormat(LUpperDate));\n\n LMe.scatterChartAxisLeft.style(\"display\", \"block\");\n LMe.scatterChartAxisRight.style(\"display\", \"block\");\n LMe.scatterChartTickLeft.style(\"display\", \"block\");\n LMe.scatterChartTickRight.style(\"display\", \"block\");\n LMe.scaleValueTextLeft.style(\"display\", \"block\");\n LMe.scaleValueTextRight.style(\"display\", \"block\");\n }\n };\n\n\n\n //---------------------------------------------------------------\n LMe.drawAssociationLines = function(){\n\n //alert('asdf');\n var LForceHt = ((LMe.height - LMe.timelineHeight)/2) * 2,\n LForceWd = LMe.width - LMe.margin.left - LMe.margin.right,\n LCenterX = LForceWd / 2,\n LCenterY = LForceHt / 2,\n LLinkDst = LForceWd;\n LLinkDst = LLinkDst/2;\n\n var LX = LMe.assocSliderScale(G_DOC_ASSOCIATION_THREASHOLD);\n\n if(! LMe.leftAssocScaleLine)\n {\n LMe.leftAssocScaleLine = LMe.scatterChartGroup.append(\"line\")\n .attr({\n class: \"scatter-chart-lines\",\n x1 : LCenterX,\n y1 : LCenterY,\n x2 : LCenterX,\n y2 : LCenterY + 200\n });\n }\n if(! LMe.rightAssocScaleLine)\n {\n LMe.rightAssocScaleLine = LMe.scatterChartGroup.append(\"line\")\n .attr({\n class: \"scatter-chart-lines\",\n x1 : 0,\n y1 : LCenterY,\n x2 : 0,\n y2 : LCenterY + 180\n });\n }\n\n if(! LMe.horizontantalSliderAdjustor)\n {\n LMe.horizontantalSliderAdjustor = LMe.scatterChartGroup.append(\"line\")\n .attr({\n class: \"scatter-chart-lines\",\n x1 : LX,\n y1 : LCenterY + 180,\n x2 : 0,\n y2 : LCenterY + 180\n });\n }\n else\n {\n LMe.horizontantalSliderAdjustor\n .attr({\n class: \"scatter-chart-lines\",\n x1 : LX,\n y1 : LCenterY + 180,\n x2 : 0,\n y2 : LCenterY + 180\n });\n }\n\n\n\n if(! LMe.vericalSliderAdjustor)\n {\n LMe.vericalSliderAdjustor = LMe.scatterChartGroup.append(\"line\")\n .attr({\n class: \"scatter-chart-lines\",\n x1 : LX,\n y1 : LCenterY + 180,\n x2 : LX,\n y2 : LCenterY + 195\n });\n }\n else\n {\n LMe.vericalSliderAdjustor\n .attr({\n class: \"scatter-chart-lines\",\n x1 : LX,\n y1 : LCenterY + 180,\n x2 : LX,\n y2 : LCenterY + 195\n });\n }\n\n\n\n LMe.leftAssocScaleLine.attr(\"display\", \"block\");\n LMe.rightAssocScaleLine.attr(\"display\", \"block\");\n LMe.horizontantalSliderAdjustor.attr(\"display\", \"block\");\n LMe.vericalSliderAdjustor.attr(\"display\", \"block\");\n //alert('2')\n };\n\n //---------------------------------------------------------------\n LMe.hideAssociationLines = function(){\n LMe.leftAssocScaleLine.attr(\"display\", \"none\");\n LMe.rightAssocScaleLine.attr(\"display\", \"none\");\n LMe.horizontantalSliderAdjustor.attr(\"display\", \"none\");\n LMe.vericalSliderAdjustor.attr(\"display\", \"none\");\n };\n\n //---------------------------------------------------------------\n LMe.displayAssociationScalesCircles = function(){\n\n var LForceHt = ((LMe.height - LMe.timelineHeight)/2) * 2,\n LForceWd = LMe.width - LMe.margin.left - LMe.margin.right,\n LCenterX = LForceWd / 2,\n LCenterY = LForceHt / 2;\n\n if(! LMe.assocViewScaleCircle1)\n {\n LMe.assocViewScaleCircle1 = LMe.scatterChartGroup.append(\"circle\")\n .attr(\"r\", 95.25)\n .attr(\"cx\", LCenterX)\n .attr(\"cy\", LCenterY)\n .attr(\"fill\", \"transparent\")\n .attr(\"opacity\", 1)\n .style(\"pointer-events\" , \"none\")\n .attr(\"stroke\", \"#9A9A9B\");\n }\n\n if(! LMe.assocViewScaleCircle2)\n {\n LMe.assocViewScaleCircle2 = LMe.scatterChartGroup.append(\"circle\")\n .attr(\"r\", 190.5)\n .attr(\"cx\", LCenterX)\n .attr(\"cy\", LCenterY)\n .attr(\"fill\", \"transparent\")\n .attr(\"opacity\", 1)\n .style(\"pointer-events\" , \"none\")\n .attr(\"stroke\", \"#9A9A9B\");\n }\n\n if(! LMe.assocViewScaleCircle31)\n {\n /*LMe.assocViewScaleCircle3 = LMe.scatterChartGroup.append(\"circle\")\n .attr(\"r\", 285.75)\n .attr(\"cx\", LCenterX)\n .attr(\"cy\", LCenterY)\n .attr(\"fill\", \"transparent\")\n .attr(\"opacity\", 1)\n .style(\"pointer-events\" , \"none\")\n .attr(\"stroke\", \"#9A9A9B\");*/\n\n var arc1 = d3.svg.arc()\n .innerRadius(285.75)\n .outerRadius(286.75)\n .startAngle(46.2 * (3.14/180)) //converting from degs to radians\n .endAngle((180 - 46.2) * (3.14/180)); //just radians\n\n LMe.assocViewScaleCircle31 = LMe.scatterChartGroup.append(\"path\")\n .attr(\"d\", arc1)\n .attr(\"fill\", \"#9A9A9B\")\n .attr(\"opacity\", 1)\n .style(\"pointer-events\" , \"none\")\n .attr(\"transform\", \"translate(\" + LCenterX + \",\" + LCenterY + \")\")\n\n var arc2 = d3.svg.arc()\n .innerRadius(285.75)\n .outerRadius(286.75)\n .startAngle((46.2 + 180) * (3.14/180)) //converting from degs to radians\n .endAngle((360 - 46.2) * (3.14/180)); //just radians\n\n LMe.assocViewScaleCircle32 = LMe.scatterChartGroup.append(\"path\")\n .attr(\"d\", arc2)\n .attr(\"fill\", \"#9A9A9B\")\n .attr(\"opacity\", 1)\n .style(\"pointer-events\" , \"none\")\n .attr(\"transform\", \"translate(\" + LCenterX + \",\" + LCenterY + \")\")\n }\n\n if(! LMe.assocViewScaleCircle41)\n {\n /*LMe.assocViewScaleCircle4 = LMe.scatterChartGroup.append(\"circle\")\n .attr(\"r\", 383)\n .attr(\"cx\", LCenterX)\n .attr(\"cy\", LCenterY)\n .attr(\"fill\", \"transparent\")\n .attr(\"opacity\", 1)\n .attr(\"stroke-dasharray\", \"200, 200\")\n //.style(\"pointer-events\" , \"none\")\n .attr(\"stroke\", \"#9A9A9B\");*/\n\n var arc1 = d3.svg.arc()\n .innerRadius(383)\n .outerRadius(384)\n .startAngle(59 * (3.14/180)) //converting from degs to radians\n .endAngle((180 - 59) * (3.14/180)); //just radians\n\n LMe.assocViewScaleCircle41 = LMe.scatterChartGroup.append(\"path\")\n .attr(\"d\", arc1)\n .attr(\"fill\", \"#9A9A9B\")\n .attr(\"opacity\", 1)\n .style(\"pointer-events\" , \"none\")\n .attr(\"transform\", \"translate(\" + (LCenterX) + \",\" + (LCenterY) + \")\");\n\n var arc2 = d3.svg.arc()\n .innerRadius(383)\n .outerRadius(384)\n .startAngle((59 + 180) * (3.14/180)) //converting from degs to radians\n .endAngle((360 - 59) * (3.14/180)); //just radians\n\n LMe.assocViewScaleCircle42 = LMe.scatterChartGroup.append(\"path\")\n .attr(\"d\", arc2)\n .attr(\"fill\", \"#9A9A9B\")\n .attr(\"opacity\", 1)\n .style(\"pointer-events\" , \"none\")\n .attr(\"transform\", \"translate(\" + (LCenterX + 1) + \",\" + LCenterY + \")\")\n }\n\n LMe.assocViewScaleCircle1.style(\"display\", \"block\");\n LMe.assocViewScaleCircle2.style(\"display\", \"block\");\n LMe.assocViewScaleCircle31.style(\"display\", \"block\");\n LMe.assocViewScaleCircle32.style(\"display\", \"block\");\n LMe.assocViewScaleCircle41.style(\"display\", \"block\");\n LMe.assocViewScaleCircle42.style(\"display\", \"block\");\n };\n\n //---------------------------------------------------------------\n LMe.hideAssociationScaleCircles = function(){\n LMe.assocViewScaleCircle1.style(\"display\", \"none\");\n LMe.assocViewScaleCircle2.style(\"display\", \"none\");\n LMe.assocViewScaleCircle31.style(\"display\", \"none\");\n LMe.assocViewScaleCircle32.style(\"display\", \"none\");\n LMe.assocViewScaleCircle41.style(\"display\", \"none\");\n LMe.assocViewScaleCircle42.style(\"display\", \"none\");\n };\n\n\n //---------------------------------------------------------------\n LMe.displayOuterCircleForFocussedCircle = function(p_FocussedCircle, p_displayInCenter){\n var LFocussedCircle = d3.select(p_FocussedCircle);\n var LCX = LFocussedCircle.attr(\"cx\"),\n LCY = LFocussedCircle.attr(\"cy\");\n\n if(p_displayInCenter)\n {\n var LForceHt = ((LMe.height - LMe.timelineHeight)/2) * 2,\n LForceWd = LMe.width - LMe.margin.left - LMe.margin.right,\n LCenterX = LForceWd / 2,\n LCenterY = LForceHt / 2;\n LCX = LCenterX;\n LCY = LCenterY;\n }\n\n\n\n if(! LMe.outerCircleOfFocussedCircle)\n {\n LMe.outerCircleOfFocussedCircle = LMe.scatterChartGroup.append(\"circle\");\n }\n\n LMe.outerCircleOfFocussedCircle\n .attr(\"fill\", \"none\")\n// .attr(\"fill\", \"transparent\")\n .attr(\"stroke\", \"#FFF\")\n .style(\"display\", \"block\")\n .attr(\"stroke\", \"#FFF\")\n .attr(\"stroke-width\", \"2px\")\n .attr(\"cx\", LCX)\n .attr(\"cy\", LCY)\n .attr(\"r\", function(d){ return parseFloat(LFocussedCircle.attr(\"r\")) + 5; });\n };\n\n //---------------------------------------------------------------\n LMe.hideOuterCircleForFocussedCircle = function(){\n if(LMe.outerCircleOfFocussedCircle)\n {\n LMe.outerCircleOfFocussedCircle\n .style(\"display\", \"none\");\n }\n };\n\n //---------------------------------------------------------------\n LMe.displaySlideInHint = function(p_Text){\n var LAppHint = d3.select(\".app-hint\");\n\n LAppHint.text(p_Text);\n var LScreenWd = $(window).width(),\n LHintWd = $(\".app-hint\").width(),\n LHintLeft = LScreenWd/2 - LHintWd/2;\n\n LAppHint\n .style(\"display\", \"block\")\n .style(\"top\", \"-50px\")\n .style(\"left\", LHintLeft + \"px\");\n LAppHint.transition().duration(1000).style(\"top\", \"50px\");\n\n if(LMe.hintTimer)\n {\n //The timer was already started and hasn't finished yet\n window.clearTimeout(LMe.hintTimer);\n LMe.hintTimer = null;\n }\n\n LMe.hintTimer = setTimeout(function(){\n LAppHint.transition().duration(1000).style(\"display\", \"none\");\n }, 2500)\n };\n\n //---------------------------------------------------------------\n //construct the object and return the new object\n LMe.constructor(p_Config);\n return LMe;\n}", "title": "" }, { "docid": "056062740a42d710806afe7489a69411", "score": "0.47601154", "text": "function AnimationStaggerMetadata() { }", "title": "" }, { "docid": "056062740a42d710806afe7489a69411", "score": "0.47601154", "text": "function AnimationStaggerMetadata() { }", "title": "" }, { "docid": "dcd581becf9de9cdb6fb4741486f9489", "score": "0.4758787", "text": "function _displayDuration() {\n if (!plyr.supported.full) {\n return;\n }\n\n // Determine duration\n var duration = _getDuration() || 0;\n\n // If there's only one time display, display duration there\n if (!plyr.duration && config.displayDuration && plyr.media.paused) {\n _updateTimeDisplay(duration, plyr.currentTime);\n }\n\n // If there's a duration element, update content\n if (plyr.duration) {\n _updateTimeDisplay(duration, plyr.duration);\n }\n\n // Update the tooltip (if visible)\n _updateSeekTooltip();\n }", "title": "" }, { "docid": "7808b0956668fd5ba634a0342804f7e1", "score": "0.47579384", "text": "function paintNext() {\n\tif (parseInt(cur_time) + step < 901524) {\n\t cur_time = parseInt(cur_time) + step;\n\t\tcur_real_time = time_map[cur_time];\n\t\tconsole.log(\"current time id: \" + \n\t\t\tcur_time.toString() + \n\t\t\t\"\\ncurrent real time: \" +\n\t\t\tcur_real_time.toString());\n\t\tpaintWithTimeId(cur_time);\n\t}\n}", "title": "" }, { "docid": "c33feb7aecc4b28dc846a3dabd09e2d3", "score": "0.4757455", "text": "static updateTimelinePlayhead( pos = null){\n var timeline = document.getElementById('timeline');\n var curr_time = pos == null ? PLAYER.getCurrentTime() : pos;\n var dur = PLAYER.getDuration();\n var x = (curr_time/dur)*Timeline.total_w;\n var playhead = document.getElementById(\"playhead\");\n playhead.setAttribute(\"class\", \"timelinePlayhead\");\n\n playhead.style.left = x+\"px\";\n playhead.style.top = Timeline.top+\"px\";\n playhead.style.height = (Timeline.tag_h*(Timeline.max_depth+1))+\"px\";\n\n timeline.appendChild(playhead); //trick to raise the playhead\n }", "title": "" }, { "docid": "2670b1be629fd2327e19f582dc7fc274", "score": "0.47507948", "text": "function play(timeline) {\n var start = performance.now(),\n i = 0, s = 0\n\n function show(t, index, letter, colour) {\n if(letter) letters[index].textContent = letter\n if(colour) letters[index].style.color = colour\n }\n\n function render(t) {\n\n while(timeline[i] && timeline[i][0] <= (t - start - s)) {\n show.apply(null, timeline[i])\n s += timeline[i][0]\n i++\n }\n\n if(i < timeline.length)\n requestAnimationFrame(render)\n // else\n // console.log(\"done\")\n }\n requestAnimationFrame(render)\n\n}", "title": "" }, { "docid": "31cb0ad6d55a9af1745dd85406a7cd3c", "score": "0.4742553", "text": "function timeoutCallback() {\n afterRAF ? requestAnimFrame(invokeCallback) : invokeCallback();\n }", "title": "" }, { "docid": "7a39ef1ed6f0e35ad547ad58415207d7", "score": "0.47388148", "text": "function addAdMarkers(adCuePointsAra, videoDuration) {\n var iMax = adCuePointsAra.length,\n i,\n playheadWell = document.getElementsByClassName('vjs-progress-control vjs-control')[0];\n // Loop over each cue point, dynamically create a div for each\n // then place in div progress bar\n for (i = 0; i < iMax; i++) {\n var elem = document.createElement('div');\n elem.className = 'vjs-marker';\n elem.id = 'ad' + i;\n elem.style.left = (adCuePointsAra[i].time / videoDuration) * 100 + '%';\n playheadWell.appendChild(elem);\n }\n}", "title": "" }, { "docid": "e01a402230be850ba08b4a1660404d0b", "score": "0.47371548", "text": "function animPlaybackMarker( state ) {\n _$marker.removeClass('playing reset');\n switch (state) {\n case 'play':\n var style = getTransDurationOptionsArray().join( ':' + getRecordingDuration(false) + 's;' );\n _$marker.attr('style', style)\n .addClass('playing');\n break;\n case 'reset':\n _$marker.addClass('reset');\n break;\n }\n }", "title": "" }, { "docid": "a2b5073e2a5e0724a1e009308aeb130f", "score": "0.47362313", "text": "function waiting_anim(){\n const waiting = document.getElementById(\"waiting-anim\");\n new Typewriter(waiting, {\n loop: true, \n delay: 400,\n deleteSpeed: 400,\n cursor: null\n })\n .typeString('...')\n .start();\n}", "title": "" }, { "docid": "2dd4e152d0b29dec4cb81c28041dec16", "score": "0.4733168", "text": "function playheadActiveFr(){\r\n var desc5 = new ActionDescriptor();\r\n var ref1 = new ActionReference();\r\n ref1.putProperty( cTID('Prpr'), sTID('time') );\r\n ref1.putClass( sTID('timeline') );\r\n desc5.putReference( cTID('null'), ref1 );\r\n var desc6 = new ActionDescriptor();\r\n desc6.putInteger( sTID('seconds'), 0 );\r\n // desc6.putInteger( sTID('frame'), timelineCurrentFrame()+setTime );\r\n desc6.putInteger( sTID('frame'), timelineCurrentFrame()+1 ); // Works but timeindicator needs to be at first active frame\r\n desc6.putDouble( sTID('frameRate'), Number(GetFrameRate()) );\r\n desc5.putObject( cTID('T '), sTID('timecode'), desc6 );\r\n executeAction( cTID('setd'), desc5, DialogModes.NO );\r\n}", "title": "" }, { "docid": "5c68236a30f1a210ea7b64448d6cb539", "score": "0.47194183", "text": "function AnnotatedTimeLineModule(a_parent, a_name, a_data, a_state) {\n \n var name = a_name;\n var parent = a_parent;\n var stateObject = a_state;\n var isenseData = a_data;\n var sessions = isenseData.sessions;\n var options;\n var tableGenerator = new Array();\n var legendGenerator = new Array();\n var datatable;\n var visObject;\n var viewPane;\n var controlPane;\n var width_px;\n var height_px;\n var thisModule;\n\n //\n // Meta Data\n //\n var selectedGenerator = 1;\n var fieldVisible = new Array(isenseData.fields['count']);\n var startTimeOffset = new Array();\n var offsetSliderLocation = new Array();\n var offsetSliderScale = new Array();\n \n //\n // These are the first twenty colors used by Google Visualization ScatterPlot.\n // They seem to be the same across other visualizations, although others often\n // have less range. It may be good to have a discussion on good color choices.\n //\n var colorsToUse = [\"#4684ee\",\"#dc3912\",\"#ff9900\",\"#008000\",\"#666666\"\n\t\t ,\"#4942cc\",\"#cb4ac5\",\"#d6ae00\",\"#336699\",\"#dd4477\"\n\t\t ,\"#aaaa11\",\"#66aa00\",\"#888888\",\"#994499\",\"#dd5511\"\n\t\t ,\"#22aa99\",\"#999999\",\"#705770\",\"#109618\",\"#a32929\"];\n \n /*\n * Check the field in the iSENSE data structure (assuming it has time data), and check if\n * the data is in the unix time format. If not, try parsing it as a human readable date, for\n * example \"April 21 2009, 12:47:05\"\n */\n var getTimeData = function(session_id, field_id, datapoint) {\n\n\tvar unixts = parseInt(isenseData.sessions[session_id]['data'][field_id][datapoint].value);\n\t\n\tif(isNaN(unixts)) {\n\t unixts = Date.parse(isenseData.sessions[session_id]['data'][field_id][datapoint].value);\n\t return unixts;\n\t}\n\t\n\treturn unixts * 1000;\n }\n \n /* ----------------------- *\n * Event Handler Functions *\n * ----------------------- */\n\n this.eh_toggleField = function(fld) {\n\tfieldVisible[fld] = !fieldVisible[fld];\n\tthis.redraw();\n }\n\n this.eh_toggleSession = function(ses) {\n\tisenseData.sessions['visible'] = !isenseData.sessions['visible'];\n\tthis.redraw();\n }\n\n this.eh_selectRecipe = function() {\n\tvar selectedOp = parseInt(findInputElement(\"f_\"+name+\"_form\",\n\t\t\t\t\t\t \"i_\"+name+\"_recipe_select\").value);\n\tswitch(selectedOp) {\n\tcase 0:\n\tcase 1:\n\t selectedGenerator = selectedOp;\n\t this.redraw();\n\t break;\n\t \n\tdefault:\n\t break;\n\t}\n }\n\n this.eh_tsReset = function(ses) {\n\toffsetSliderLocation[ses] = 0;\n\tstartTimeOffset[ses] = 0;\n\tthis.redraw();\n }\n \n this.eh_tsUnitSelect = function(ses) {\n\tvar selectedVal = parseInt(findInputElement(\"f_\"+name+\"_form\",\n\t\t\t\t\t\t \"i_\"+name+\"_ts_unit_select_\"+ses).value);\n\tif(isNaN(selectedVal)) {\n\t selectedVal = 0;\n\t}\n\t\n\toffsetSliderScale[ses] = selectedVal;\n\toffsetSliderLocation[ses] = 0;\n\tthis.redraw();\n }\n \n this.eh_tsSlideTick = function(ses, slideval) {\n\t//\n\t// Update the offset display text, but not the visualization\n\t//\n\tvar changeVal = slideval - offsetSliderLocation[ses];\n\tvar shiftScalar = 1000 * offsetSliderScale[ses];\n\tif(changeVal < 0) {\n\t changeVal = Math.floor(changeVal);\n\t} else {\n\t changeVal = Math.ceil(changeVal);\n\t}\n\tstartTimeOffset[ses] += (changeVal * shiftScalar);\n\toffsetSliderLocation[ses] = slideval;\n\t\n\tvar timeString = millisToClockString(startTimeOffset[ses]);\n\t$('#i_'+name+'_ts_offset_disp'+ses).html(timeString);\n }\n\n this.eh_tsSlideEnd = function(ses, slideval) {\n\t//\n\t// Slide complete, now the visualization can be updated\n\t//\n\toffsetSliderLocation[ses] = 0;\n\tthis.redraw();\n }\n /* --- */\n \n /*\n * Setup meta data for session.\n */\n this.registerSession = function(session_id) {\n\tstartTimeOffset[session_id] = 0;\n\toffsetSliderLocation[session_id] = 0;\n\toffsetSliderScale[session_id] = 1;\n }\n\n /*\n * Generate state and meta data.\n */\n this.generateMetaData = function() {\n\tfor(var i = 0; i < fieldVisible.length; ++i) {\n\t fieldVisible[i] = true;\n\t}\n }\n\n /*\n * Redraw the control panel and visualization.\n */\n this.redraw = function() {\n\ttry {\n\t tableGenerator[selectedGenerator]();\n\t legendGenerator[selectedGenerator]();\n\t //visObject = new google.visualization.AnnotatedTimeLine(viewPane);\n\t visObject.draw(datatable, options);\n\t return true;\n\t}\n\tcatch(e) {\n\t alert(e);\n\t return false;\n\t}\n }\n\n this.clean = function() {\n }\n\n /*\n * Create HTML legend generators.\n */\n this.createLegendGenerators = function() {\n\t\n\tlegendGenerator.length = 2;\n\n\t//\n\t//\n\t//\n\tlegendGenerator[0] = function(scope) {\n\t \n\t var table;\n\t var fieldColor;\n\n\t controlPane.empty();\n\t fieldColor = 0;\n\n\t controlPane.createAppend(\n\t 'form', { id : 'f_'+name+'_form' }, [\n\t\t'table', { id : 'f_'+name+'_table', style : 'width:100%' }, [\n\t\t 'tr', {}, [\n\t\t 'td', { style : 'text-align:center;width:100%' , colSpan : 3 }, 'Timeline'],\n\t\t 'tr', {}, [\n\t\t 'td', { colSpan : 3 }, [\n\t\t 'select', { id : 'i_'+name+'_recipe_select', name : 'i_'+name+'_recipe_select', style : 'width:100%' }, [\n\t\t 'option', { id : 'i_'+name+'_recipe_opt_1', value : 1 }, 'Show Exact Time',\n\t\t 'option', { id : 'i_'+name+'_recipe_opt_0', value : 0 }, 'Side-by-Side Comparison']]],\n\t\t 'tr', {}, [\n\t\t 'td', { colSpan : 3, style : 'text-decoration:underline;' }, 'Fields']]]);\n\n\t table = $('#f_'+name+'_table');\n\n\t //\n\t // Setup repice selection, which determines which datatable generator to use.\n\t //\n\t $('#i_'+name+'_recipe_opt_'+selectedGenerator).attr('selected','selected');\t \n\t $('#i_'+name+'_recipe_select')\n\t .bind('change', { scope:thisModule },\n\t\t function(evt, obj) {\n\t\t\t evt.data.scope.eh_selectRecipe();\n\t\t\t return false;\n\t\t });\n\t \n\t //\n\t // Field Selection\n\t //\n\t for(var i = 0; i < isenseData.fields['count']; ++i) {\n\t\t\n\t\tif(isenseData.fields['sensor'][i] == FIELD_TYPE.TIME\n\t\t || isenseData.fields['sensor'][i] == FIELD_TYPE.GEOSPACIAL) {\n\t\t continue;\n\t\t}\n\n\t\ttable.createAppend(\n\t\t 'tr', {}, [\n\t\t 'td', { style : 'width:16px' }, [\n\t\t 'input', { type : 'checkbox',\n\t\t\t id : 'i_'+name+'_field_'+i+'_select',\n\t\t\t name : 'i_'+name+'_field_'+i+'_select'\n\t\t\t }],\n\t\t 'td', { columnspan : 2 }, isenseData.fields['title'][i]+' ('+isenseData.fields['units'][i]+')']);\n\n\t\tif(fieldVisible[i]) {\n\t\t $('#i_'+name+'_field_'+i+'_select').attr('checked','checked');\n\t\t}\n\t\t\n\t\t$('#i_'+name+'_field_'+i+'_select')\n\t\t .bind('click', { scope : thisModule, field : i },\n\t\t\t function(evt, obj) {\n\t\t\t evt.data.scope.eh_toggleField(evt.data.field);\n\t\t\t return false;\n\t\t\t });\n\t }\n\n\t table.createAppend('tr', {}, [\n\t\t\t 'td', { colSpan : \"3\", style : 'text-decoration:underline;' }, 'Sessions']);\n\n\t //\n\t // Session Selection\n\t //\n\t for(var ses in sessions) {\n\t\t\n\t\ttable.createAppend(\n\t\t 'tr', {}, [\n\t\t 'td', {}, [\n\t\t 'input', { type : 'checkbox',\n\t\t\t id : 'i_'+name+'_session_'+ses+'_select'}, []],\n\t\t 'td', { colSpan : \"2\" }, isenseData.sessions[ses]['id']+' - '+isenseData.sessions[ses]['title']]);\n\t\t\n\t\tif(isenseData.sessions[ses]['visible']) {\n\t\t $('#i_'+name+'_session_'+ses+'_select').attr('checked','checked');\n\t\t\n\t\t //\n\t\t // Field color distinction\n\t\t //\n\t\t var j = 1;\n\t\t for(i = 0; i < isenseData.fields['count']; ++i) {\n\t\t\t\n\t\t\tif(isenseData.fields['sensor'][i] == FIELD_TYPE.TIME\n\t\t\t || isenseData.fields['sensor'][i] == FIELD_TYPE.GEOSPACIAL) {\n\t\t\t continue;\n\t\t\t}\n\n\t\t\ttable.createAppend(\n\t\t\t 'tr', {}, [\n\t\t\t 'td', { id : 'f_'+name+'_colorfor_'+ses+'_'+i }, [],\n\t\t\t 'td', {}, j+' - '+isenseData.fields['title'][i]]);\n\t\t\t++j;\n\n\t\t\tif(fieldVisible[i]) {\n\t\t\t $('#f_'+name+'_colorfor_'+ses+'_'+i)\n\t\t\t\t.css({'background-color' : colorsToUse[fieldColor++],\n\t\t\t\t 'border-width' : 'thin',\n\t\t\t\t 'border-color' : 'black'});\n\t\t\t}\n\t\t\telse {\n\t\t\t $('#f_'+name+'_colorfor_'+ses+'_'+i).html('x');\n\t\t\t}\n\t\t }\n\n\t\t //\n\t\t // Session start time offset slider - only works in sync'd start mode\n\t\t // (only if there are more than 1 session)\n\t\t if(sessions.length > 1 && selectedGenerator == 0) {\n\t\t\t\n\t\t\ttable\n\t\t\t .createAppend(\n\t\t\t 'tr', {}, [\n\t\t\t 'td', {}, [],\n\t\t\t 'td', {}, \"Time shift:\",\n\t\t\t 'td', {}, [\n\t\t\t\t'span', { id : 'i_'+name+'_ts_offset_disp'+ses }, []]]);\n\t\t\ttable\n\t\t\t .createAppend(\n\t\t\t 'tr', {}, [\n\t\t\t 'td', {}, [],\n\t\t\t 'td', { colSpan : \"2\" }, [\n\t\t\t 'div', { id : 'i_'+name+'_ts_slider_'+ses }, []]]);\n\t\t\ttable\n\t\t\t .createAppend(\n\t\t\t 'tr', {}, [\n\t\t\t 'td', { colSpan : \"2\" }, [\n\t\t\t 'input', { type : 'button', id : 'i_'+name+'_ts_reset_'+ses, value : 'Reset', style : 'width:20%' }, [],\n\t\t\t\t'select', { id : 'i_'+name+'_ts_unit_select_'+ses, name : 'i_'+name+'_ts_unit_select_'+ses }, [\n\t\t\t\t 'option', { id : 'i_'+name+'_ts_unit_opt_sec_'+ses, value : 1 }, 'Seconds',\n\t\t\t\t 'option', { id : 'i_'+name+'_ts_unit_opt_min_'+ses, value : 60 }, 'Minutes',\n\t\t\t\t 'option', { id : 'i_'+name+'_ts_unit_opt_hour_'+ses, value : 3600 }, 'Hours']]]);\n\t\t \n\t\t\tif(offsetSliderScale[ses] == 1) {\n\t\t\t $('#i_'+name+'_ts_unit_opt_sec_'+ses).attr('selected','selected');\n\t\t\t}\n\t\t\telse if(offsetSliderScale[ses] == 60) {\n\t\t\t $('#i_'+name+'_ts_unit_opt_min_'+ses).attr('selected','selected');\n\t\t\t}\n\t\t\telse if(offsetSliderScale[ses] == 3600) {\n\t\t\t $('#i_'+name+'_ts_unit_opt_hour_'+ses).attr('selected','selected');\n\t\t\t}\n\n\t\t\t$('#i_'+name+'_ts_reset_'+ses)\n\t\t\t .bind('click', { scope : thisModule, session:ses },\n\t\t\t\t function(evt, obj) {\n\t\t\t\t evt.data.scope.eh_tsReset(evt.data.session);\n\t\t\t\t return false;\n\t\t\t\t });\n\t\t\t$('#i_'+name+'_ts_unit_select_'+ses)\n\t\t\t .bind('select', { scope : thisModule, session:ses },\n\t\t\t\t function(evt, obj) {\n\t\t\t\t evt.data.scope.eh_tsUnitSelect(evt.data.session);\n\t\t\t\t return false;\n\t\t\t\t });\n\t\t\t$('#i_'+name+'_ts_slider_'+ses)\n\t\t\t .slider({ max:60, min:-60, value:0, steps:120 });\n\t\t\t$('#i_'+name+'_ts_slider_'+ses)\n\t\t\t .bind('slidestop', { scope : thisModule, session : ses },\n\t\t\t\t function(evt, obj) {\n\t\t\t\t evt.data.scope.eh_tsSlideEnd(evt.data.session, obj.value);\n\t\t\t\t });\n\t\t\t$('#i_'+name+'_ts_slider_'+ses)\n\t\t\t .bind('slide', { scope : thisModule, session : ses },\n\t\t\t\t function(evt, obj) {\n\t\t\t\t evt.data.scope.eh_tsSlideTick(evt.data.session, obj.value);\n\t\t\t\t });\n\t\t }\n\t\t}\n\t\t\n\t\t$('#i_'+name+'_session_'+ses+'_select')\n\t\t .bind('click', { scope:thisModule, session:ses },\n\t\t\t function(evt, obj) {\n\t\t\t evt.data.scope.eh_toggleSession(evt.data.session);\n\t\t\t return false;\n\t\t\t });\n\t\t\n\t }\n\t // End session selection\n\t //\n\t};\n\t\n\t//\n\t// The control panel need not be different in this case.\n\t//\n\tlegendGenerator[1] = legendGenerator[0];\n }\n\n /*\n * Create table generators.\n */\n this.createTableGenerators = function() {\n\t\n\ttableGenerator.length = 2;\n\n\t/* This needs to be finished to replace the original\n\t * The original would not correctly offset the graph because of the way\n\t * it built up the rows (which aligned points on every plot to\n\t * time 'buckets', even if it wasn't an accurate location)\n\t */\n\ttableGenerator[0] = function() {\n\n\t delete datatable;\n\t datatable = new google.visualization.DataTable();\n\n\t var fieldCount = 0;\n\t var earliestTimestamp = -1;\n\t var timeField;\n\t var sessionFieldCount = new Array();\n\t var sessionColumnStart = new Array();\n\t var sessionDataPoint = new Array();\n\t var keepAddingPoints = true;\n\n\t //\n\t // Add columns and find earliest timestamp\n\t //\n\t datatable.addColumn('datetime','Time');\n\t for(var i in sessions) {\n\t\tif(!sessions[i].visible) {\n\t\t continue;\n\t\t}\n\t\t\n\t\tvar fieldTitleNumber = 1;\n\t\tsessionFieldCount[i] = 0;\n\t\tsessionColumnStart[i] = fieldCount + 1;\n\t\tsessionDataPoint[i] = 0;\n\t\tfor(var j = 0; j < isenseData.fields['count']; ++j) {\n\t\t var nextdata;\n\t\t if(isenseData.fields['sensor'][j] == FIELD_TYPE.TIME) {\n\t\t\t\n\t\t\ttimeField = j;\n\t\t\tnextdata = getTimeData(i,j,0);\n\t\t\tif(earliestTimestamp == -1 ||\n\t\t\t earliestTimestamp > nextdata) {\n\t\t\t earliestTimestamp = nextdata;\n\t\t\t}\n\t\t }\n\t\t else if(isenseData.fields['sensor'][j] != FIELD_TYPE.GEOSPACIAL &&\n\t\t\t fieldVisible[j]) {\n\n\t\t\tvar coltitle = \"#\" + sessions[i]['id'] + \"-\" + fieldTitleNumber + \" (\" + isenseData.fields['units'][j] + \")\";\n\t\t\tdatatable.addColumn('number',coltitle);\n\t\t\t++sessionFieldCount[i];\n\t\t\t++fieldCount;\n\t\t\t++fieldTitleNumber;\n\t\t }\n\t\t}\n\t }\n\n\t if(datatable.getNumberOfColumns() <= 1) {\n\t\tdelete datatable;\n\t\tdatatable = new google.visualization.DataTable();\n\t\tdatatable.addColumn('datetime','Time');\n\t\tdatatable.addColumn('number','No Data');\n\t }\n\t \n\t //\n\t // Attempt to cluster sessions together in similar timestamps, without greatly\n\t // reducing the resolution.\n\t //\n\t var row = 0;\n\t while(keepAddingPoints) {\n\t\tvar sessionsToAdd = [];\n\t\tvar nextTimestamp = -1;\n\t\tkeepAddingPoints = false;\n\n\t\t//\n\t\t// Go through the next datapoint that needs to be added for each session,\n\t\t// and get a set of sessions with the earliest timestamp that are close enough\n\t\t// to be grouped into a single timestamp.\n\t\t//\n\t\tfor(var i in sessions) {\n\t\t if(!sessions[i].visible || \n\t\t sessionDataPoint[i] >= isenseData.sessions[i]['data'][timeField].length) {\n\t\t\tcontinue;\n\t\t }\n\t\t keepAddingPoints = true;\n\t\t var sesTimestamp = earliestTimestamp + startTimeOffset[i] +\n\t\t\tgetTimeData(i,timeField,sessionDataPoint[i]) - getTimeData(i,timeField,0);\n\t\t // (parseInt(isenseData.sessions[i]['data'][timeField][sessionDataPoint[i]].value) -\n\t\t // parseInt(isenseData.sessions[i]['data'][timeField][0].value));\n\t\t //\n\t\t // Set resolution here: 100 = tenth of second\n\t\t sesTimestamp -= (sesTimestamp % 100);\n\t\t \n\t\t //\n\t\t // If a session timestamp is less than nextTimestamp (the value of\n\t\t // the next timestamp to be added), clear sessionsToAdd, since there\n\t\t // is an early occuring datapoint that should be added before others.\n\t\t //\n\t\t if(nextTimestamp == -1 ||\n\t\t nextTimestamp > sesTimestamp) {\n\t\t\tdelete sessionsToAdd;\n\t\t\tsessionsToAdd = [];\n\t\t\tsessionsToAdd.push(i);\n\t\t\tnextTimestamp = sesTimestamp;\n\t\t }\n\t\t else if(nextTimestamp == sesTimestamp) {\n\t\t\tsessionsToAdd.push(i);\n\t\t }\n\t\t}\n\t\t\n\t\t//\n\t\t// Add the set of sessions to the table\n\t\t//\n\t\tdatatable.addRow();\n\t\tdatatable.setValue(row, 0, new Date(nextTimestamp));\n\t\tfor(var i = 0; i < sessionsToAdd.length; ++i) {\n\t\t var ses = sessionsToAdd[i];\n\n\t\t var fldadd = 0;\n\t\t for(var j = 0; j < isenseData.fields['count']; ++j) {\n\t\t\tif(fieldVisible[j]) {\n\t\t\t datatable.setValue(row, sessionColumnStart[ses] + fldadd,\n\t\t\t\t\t parseFloat(isenseData.sessions[ses]['data'][j][sessionDataPoint[ses]]));\n\t\t\t ++fldadd;\n\t\t\t}\n\t\t }\n\t\t ++sessionDataPoint[ses];\n\n\t\t //\n\t\t // Error check number of columns added\n\t\t //\n\t\t if(fldadd != sessionFieldCount[ses]) {\n\t\t\tdelete datatable;\n\t\t\tdatatable = new google.visualization.DataTable();\n\t\t\tdatatable.addColumn('datetime','Time');\n\t\t\tdatatable.addColumn('number','No Data - Session ' + ses + ' only added ' + \n\t\t\t\t\t fldadd + ' fields out of ' + sessionFieldCount[ses]);\n\t\t }\n\t\t}\n\n\t\t//\n\t\t// Prepare for next round\n\t\t//\n\t\t++row;\n\t\tnextTimestamp = 1;\n\t }\n\n\t //\n\t // Final error checking\n\t //\n\t if(datatable.getNumberOfRows() == 0) {\n\t\tdelete datatable;\n\t\tdatatable = new google.visualization.DataTable();\n\t\tdatatable.addColumn('datetime','Time');\n\t\tdatatable.addColumn('number','No Data - 0 rows added');\n\t }\n\t \n\t}\n\t/* Below is the flawed original*/\n\n\ttableGenerator[0] = function(scope) {\n\t \n\t //\n\t // Refresh Table\n\t //\n\t delete datatable;\n\t datatable = new google.visualization.DataTable();\n\t \n\t //\n\t // Generate Columns\n\t //\n\t var fldcnt = 0;\n\t var fldTitleNumber;\n\t var sessionFieldCount = new Array();\n\t var sessionRowPosition = new Array();\n\t var sessionIntervalLength = new Array();\n\t var smallestInterval = -1;\n\t var largestInterval = 0;\n\t var startTime = -1;\n\t var latestStartTime = 0;\n\t datatable.addColumn('datetime','Time');\n\t for(var i in sessions) {\n\t\tif(!sessions[i].visible) {\n\t\t continue;\n\t\t}\n\n\t\tsessionFieldCount[i] = 0;\n\t\tsessionRowPosition[i] = 0;\n\t\tfldTitleNumber = 1;\n\t\tfor(var j = 0; j < isenseData.fields['count']; j++) {\n\t\t if(isenseData.fields['sensor'][j] == FIELD_TYPE.TIME) {\n\t\t\t// Timestamp\n\t\t\t// TODO: Check the field precision to decide how\n\t\t\t// to truncate the interval, i.e. data\n\t\t\t// if all data is taken at one second\n\t\t\t// intervals, this should zero out the\n\t\t\t// last three digits.\n\t\t\t\n\t\t\tvar first_t = getTimeData(i,j,0);\n\t\t\tif(isenseData.sessions[i]['data'][j].length > 1) {\n\t\t\t var interval = getTimeData(i,j,1) - first_t;\n\t\t\t interval -= (interval % 100); // Eliminate tiny differences\n\t\t\t sessionIntervalLength[i] = interval;\n\t\t\t \n\t\t\t if(interval < smallestInterval || smallestInterval == -1) {\n\t\t\t\tsmallestInterval = interval;\n\t\t\t }\n\t\t\t \n\t\t\t if(interval > largestInterval) {\n\t\t\t\tlargestInterval = interval;\n\t\t\t }\n\t\t\t \n\t\t\t if((first_t + startTimeOffset[i]) < startTime || startTime == -1) {\n\t\t\t\tstartTime = first_t + startTimeOffset[i];\n\t\t\t }\n\t\t\t \n\t\t\t if((first_t + startTimeOffset[i]) > latestStartTime) {\n\t\t\t\tlatestStartTime = first_t + startTimeOffset[i];\n\t\t\t }\n\t\t\t}\n\t\t\telse if(isenseData.sessions[i]['data'][j].length == 1) {\n\t\t\t sessionIntervalLength[i] = 1000;\n\t\t\t \n\t\t\t if((first_t + startTimeOffset[i]) < startTime || startTime == -1) {\n\t\t\t\t\n\t\t\t\tstartTime = (first_t + startTimeOffset[i]);\n\t\t\t }\n\t\t\t \n\t\t\t if((first_t + startTimeOffset[i]) > latestStartTime) {\n\t\t\t\t\n\t\t\t\tlatestStartTime = first_t + startTimeOffset[i];\n\t\t\t }\n\t\t\t}\n\t\t }\n\t\t else if(isenseData.fields['sensor'][j] != FIELD_TYPE.GEOSPACIAL) {\n\t\t\t// Ignore Latitude and Longitude\n\t\t\t\n\t\t\tif(fieldVisible[j]) {\n\t\t\t var coltitle = \"#\" + sessions[i]['id'] + \"-\" + fldTitleNumber + \" (\" + isenseData.fields['units'][j] + \")\";\n\t\t\t datatable.addColumn('number',coltitle);\n\t\t\t sessionFieldCount[i]++;\n\t\t\t fldcnt++;\n\t\t\t fldTitleNumber++;\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t \n\t var tzOffset = (new Date().getTimezoneOffset()) - (new Date(startTime).getTimezoneOffset());\n\t tzOffset *= 60000;\n\t \n\t //\n\t // Add dummy data columns which display an error message in the vis if\n\t // there was a problem generating the columns.\n\t //\n\t if(fldcnt == 0) {\n\t\tdatatable.addColumn('number','No Data');\n\t\treturn;\n\t }\n\t else if(startTime == -1) {\n\t\tdelete datatable;\n\t\tdatatable = new google.visualization.DataTable();\n\t\tdatatable.addColumn('datetime','Time');\n\t\tdatatable.addColumn('number','Data cannot be graphed - invalid time data');\n\t\treturn;\n\t }\n\t \n\t //\n\t // Get the GCD of sessionIntervals\n\t //\n\t var workInterval = smallestInterval;\n\t for(var i = 2; workInterval > 1 && !GCDFound; i++) {\n\t\tvar GCDFound = true;\n\t\tfor(var ses in sessionIntervalLength) {\n\t\t if(!sessions[ses].visible) {\n\t\t\tcontinue;\n\t\t }\n\t\t \n\t\t if(sessionIntervalLength[ses] % workInterval != 0) {\n\t\t\tGCDFound = false;\n\t\t\tbreak;\n\t\t }\n\t\t}\n\t\tif(!GCDFound) {\n\t\t workInterval = smallestInterval / i;\n\t\t}\n\t }\n\t smallestInterval = workInterval;\n\t \n\t //\n\t // Convert session intervals to a \"add every X rows\" format,\n\t // and calculate how many starting intervals to skip based on\n\t // the shifted start time (make sure all are positive).\n\t // \n\t var currentInterval = new Array();\n\t var smallestIntervalOffset = 1000000;\n\t var largestIntervalOffset = 0;\n\t var startIntervalOffset = new Array();\n\t var creditedIntervalOffset = new Array();\n\t for(var ses in sessionIntervalLength) {\n\t\tcurrentInterval[ses] = 1;\n\t\tcreditedIntervalOffset[ses] = 0;\n\t\tsessionIntervalLength[ses] /= smallestInterval;\n\t\tstartIntervalOffset[ses] = startTimeOffset[ses] / smallestInterval;\n\t\tif(startIntervalOffset[ses] < 0) {\n\t\t startIntervalOffset[ses] = Math.floor(startIntervalOffset[ses]);\n\t\t} else {\n\t\t startIntervalOffset[ses] = Math.ceil(startIntervalOffset[ses]);\n\t\t}\n\t\tif(startIntervalOffset[ses] < smallestIntervalOffset) {\n\t\t smallestIntervalOffset = startIntervalOffset[ses];\n\t\t}\n\t }\n\t largestInterval /= smallestInterval;\n\t \n\t for(var ses in startIntervalOffset) {\n\t\tstartIntervalOffset[ses] -= smallestIntervalOffset;\n\t\tif(startIntervalOffset[ses] > largestIntervalOffset) {\n\t\t largestIntervalOffset = startIntervalOffset[ses];\n\t\t}\n\t }\n\t \n\t //\n\t // Create data rows and then add data.\n\t //\n\t var maxLength = 0;\n\t var max_i = [0,0];\n\t for(var i in sessions) {\n\t\tif(!sessions[i].visible) {\n\t\t continue;\n\t\t}\n\t\t\n\t\tif(max_i[0] == 0) {\n\t\t max_i[0] = i;\n\t\t}\t\n\t\tfor(var j = 0; j < isenseData.fields['count']; j++) {\n\t\t if(fieldVisible[j] && \n\t\t (isenseData.sessions[i]['data'][j].length * sessionIntervalLength[i]) + largestIntervalOffset > maxLength) {\n\t\t\tmaxLength = (isenseData.sessions[i]['data'][j].length * sessionIntervalLength[ses]) + largestIntervalOffset;\n\t\t\tmax_i = [i,j];\n\t\t }\n\t\t}\n\t }\n\t datatable.addRows(maxLength);\n\t \n\t var tot_added = 0;\n\t var limit = isenseData.sessions[max_i[0]]['data'][max_i[1]].length;\n\t for(var i = 0; i < maxLength; i++) {\n\t\tvar convertedTime = (startTime + (smallestInterval * i)) + tzOffset;\n\t\tdatatable.setValue(i,0,new Date(convertedTime));\n\t\tvar cpos = 1;\n\t\t\n\t\tfor(var j in sessions) {\n\t\t if(!sessions[j].visible) {\n\t\t\tcontinue;\n\t\t }\n\n\t\t //\n\t\t // Check to see if adding data should be delayed for a start point shift\n\t\t //\n\t\t if(startIntervalOffset[j] > creditedIntervalOffset[j]) {\n\t\t\tcreditedIntervalOffset[j]++;\n\t\t\tsessionRowPosition[j]++;\n\t\t\tcpos += sessionFieldCount[j];\n\t\t }\n\t\t else {\n\t\t\tfor(var k = 0; k < isenseData.fields['count']; k++) {\n\t\t\t var sensorType = isenseData.fields['sensor'][k];\n\t\t\t if(fieldVisible[k] && sensorType != FIELD_TYPE.TIME && sensorType != FIELD_TYPE.GEOSPACIAL) {\n\t\t\t\t\n\t\t\t\tif(isenseData.sessions[j]['data'][k].length > (i - startIntervalOffset[j]) && \n\t\t\t\t currentInterval[j] <= sessionIntervalLength[j]) {\n\t\t\t\t \n\t\t\t\t datatable.setValue(sessionRowPosition[j],cpos,\n\t\t\t\t\t\t parseFloat(isenseData.sessions[j]['data'][k][(i-startIntervalOffset[j])].value));\n\t\t\t\t tot_added++;\n\t\t\t\t}\n\t\t\t\tcpos++;\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\tif(currentInterval[j] <= sessionIntervalLength[j]) {\n\t\t\t sessionRowPosition[j]++;\n\t\t\t}\n\t\t\t\n\t\t\tif(++currentInterval[j] > largestInterval) {\n\t\t\t currentInterval[j] = 1;\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t \n\t //\n\t // If no data has been added, the table should be set\n\t // to a totally empty table for the visualization to\n\t // behave correctly\n\t //\n\t if(tot_added == 0) {\n\t\tdelete datatable;\n\t\tdatatable = new google.visualization.DataTable();\n\t\tdatatable.addColumn('datetime','Time');\n\t\tdatatable.addColumn('number','No Data');\n\t }\n\t};\n\t/* */\n\n\t/*\n\t * This generator places points in the time dimension\n\t * at the exact time they were actually taken.\n\t */\n\ttableGenerator[1] = function(scope) {\n\t \n\t //\n\t // Refresh Table\n\t //\n\t delete datatable;\n\t datatable = new google.visualization.DataTable();\n\t \n\t //\n\t // Generate Columns. Get the total number of data points that\n\t // will be added.\n\t //\n\t var time_fld = -1;\n\t var fld_i = [];\n\t var fld_cnt = 0;\n\t var fldTitleNumber;\n\t var data_cnt = 0;\n\t var row = 0;\n\t datatable.addColumn('datetime','Time');\n\t for(var i in sessions) {\n\t\tif(!sessions[i].visible) {\n\t\t continue;\n\t\t}\n\t\t\n\t\tfld_i[i] = [];\n\t\tfldTitleNumber = 1;\n\t\tfor(var j = 0; j < isenseData.fields['count']; j++) {\n\t\t var sensorType = isenseData.fields['sensor'][j];\n\t\t if(sensorType == FIELD_TYPE.TIME) {\n\t\t\ttime_fld = j;\n\t\t }\n\t\t else if(fieldVisible[j] &&\n\t\t\t sensorType != FIELD_TYPE.GEOSPACIAL) {\n\t\t\tvar coltitle = \"#\" + isenseData.sessions[i]['id'] + \"-\" + isenseData.fields['title'][j] + \" (\" + isenseData.fields['units'][j] + \")\";\n\t\t\tdatatable.addColumn('number',coltitle);\n\t\t\tfld_i[i][j] = {cnt: 0,col: (fld_cnt + 1)};\n\t\t\tfld_cnt++;\n\t\t\tfldTitleNumber++;\n\t\t\tdata_cnt += isenseData.sessions[i]['data'][j].length;\n\t\t }\n\t\t}\n\t }\n\t \n\t //\n\t // Add dummy data columns which display an error message in the vis if\n\t // there was a problem generating the columns.\n\t //\n\t if(fld_cnt == 0) {\n\t\tdatatable.addColumn('number','No Data');\n\t\treturn;\n\t }\n\t if(time_fld == -1) {\n\t\tdelete datatable;\n\t\tdatatable = new google.visualization.DataTable();\n\t\tdatatable.addColumn('datetime','Time');\n\t\tdatatable.addColumn('number','Data cannot be graphed - invalid time data');\n\t\treturn;\n\t }\n\t \n\t //\n\t // Add all the points.\n\t //\n\t var d = 0;\n\t try {\n\t\twhile(d < data_cnt) {\n\t\t //\n\t\t // Find the data point with the earliest timestamp\n\t\t //\n\t\t var selected_data = [];\n\t\t var early_ts = null;\n\t\t for(var i in sessions) {\n\t\t\tif(!sessions[i].visible) {\n\t\t\t continue;\n\t\t\t}\n\n\t\t\tfor(var j = 0; j < isenseData.fields['count']; j++) {\n\t\t\t var sensorType = isenseData.fields['sensor'][j];\n\t\t\t if(fieldVisible[j] && sensorType != FIELD_TYPE.TIME && sensorType != FIELD_TYPE.GEOSPACIAL) {\n\t\t\t\tvar k = fld_i[i][j].cnt;\n\t\t\t\tif(k < isenseData.sessions[i]['data'][j].length) {\n\t\t\t\t var new_ts = getTimeData(i,time_fld,k);\n\t\t\t\t if(early_ts == null || new_ts < early_ts) {\n\t\t\t\t\tearly_ts = new_ts;\n\t\t\t\t\tdelete selected_data;\n\t\t\t\t\tselected_data = [];\n\t\t\t\t\tselected_data.push([i,j]);\n\t\t\t\t }\n\t\t\t\t else if(new_ts == early_ts){\n\t\t\t\t\tselected_data.push([i,j]);\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t }\n\t\t \n\t\t //\n\t\t // Add the selected data to a new row.\n\t\t //\n\t\t var old_d = d;\n\t\t var tzOffset = (new Date().getTimezoneOffset()) - (new Date(early_ts).getTimezoneOffset());\n\t\t tzOffset *= 60000;\n\t\t var convertedTime = early_ts + tzOffset;\n\t\t datatable.addRow();\n\t\t datatable.setValue(row,0,new Date(convertedTime));\n\t\t for(var s = 0; s < selected_data.length; s++) {\n\t\t\tvar i = selected_data[s][0];\n\t\t\tvar j = selected_data[s][1];\n\t\t\tvar k = fld_i[i][j].cnt++;\n\t\t\tvar col = fld_i[i][j].col;\n\t\t\tdatatable.setValue(row,col,parseFloat(isenseData.sessions[i]['data'][j][k].value));\n\t\t\td++;\n\t\t }\n\t\t row++;\n\t\t \n\t\t if(old_d == d) {\n\t\t\talert(\"tried to add new points, but could not!\");\n\t\t\tbreak;\n\t\t }\n\t\t}\n\t\t\n\t }catch(e){\n\t\talert(\"AnnotatedGen1:\" + e);\n\t }\n\t};\n }\n \n /*\n * Initialize this visualization object. Called from VizWrapper.\n * Pass the DIV visualization will be created in since some visualizations\n * may need to do special initializations with it.\n */ \n this.init = function(panelDiv) {\n\t//\n\t// Create DIVs for vis and control\n\t//\n\t$('#'+name).createAppend('div', { id : name+'_viewpane' }, []);\n\t$('#'+name).createAppend('div', { id : name+'_cntlpane' }, []);\n\t\n\t$('#'+name+'_viewpane').css({'float':'left','width':'740px','height':'600px','margin-right':'4px'});\n\t$('#'+name+'_cntlpane').css({'float':'right','width':'280px','height':'600px'});\n\t\n\tcontrolPane = $('#'+name+'_cntlpane');\n\tviewPane = document.getElementById(name+'_viewpane');\n\n\t//\n\t// Create the Google visualization object\n\t//\n\tvisObject = new google.visualization.AnnotatedTimeLine(viewPane);\n\n\t//\n\t// Check Google options to ensure good defaults exist\n\t//\n\toptions = { colors : colorsToUse,\n\t\t legendPosition : \"newRow\" };\n\n\tthis.generateMetaData();\n\tthis.createTableGenerators();\n\tthis.createLegendGenerators();\n\tfor(var ses in sessions) {\n\t this.registerSession(ses);\n\t}\n }\n\n thisModule = this;\n}", "title": "" }, { "docid": "a3e9f261d7cb70c264571802933acc94", "score": "0.4714429", "text": "function cargar_metadata(e){\n var tamanovideo = video.nextElementSibling.firstElementChild.lastElementChild.lastElementChild;\n var horas = Math.floor( video.duration / 3600);\n var minutos =Math.floor(video.duration/60);\n var segundos = Math.floor(video.duration % 60);\n //Pone un cero delante del número si es menor que 10\n minutos = minutos < 10 ? '0' + minutos : minutos;\n //Pone un cero delante del número si es menor que 10\n segundos = segundos < 10 ? '0' + segundos : segundos;\n tamanovideo.textContent = horas + \":\"+ minutos + \":\" + segundos;\n //console.log(video.currentTime);\n\n }", "title": "" }, { "docid": "c997794a74915ee9ea52d3cf13baf75c", "score": "0.4710831", "text": "function getMarks(duration) {\n\n var marks = {}; \n\n // For full support, we're handling Watch to End with percentage viewed\n if (_config.events[ 'Watch to End' ] ) {\n\n marks[ 'Watch to End' ] = duration * 99 / 100;\n\n }\n\n if( _config.percentageTracking ) {\n\n var points = [];\n var i;\n\n if( _config.percentageTracking.each ) {\n\n points = points.concat( _config.percentageTracking.each );\n\n }\n\n if( _config.percentageTracking.every ) {\n\n var every = parseInt( _config.percentageTracking.every, 10 );\n var num = 100 / every;\n \n for( i = 1; i < num; i++ ) {\n \n points.push(i * every);\n\n }\n\n }\n\n for(i = 0; i < points.length; i++) {\n\n var _point = points[i];\n var _mark = _point + '%';\n var _time = duration * _point / 100;\n \n marks[_mark] = Math.floor( _time );\n\n }\n\n }\n\n return marks;\n\n }", "title": "" }, { "docid": "192bd307df1d501ef5d800cdf1e8391c", "score": "0.47107214", "text": "function drawTracker( map, tracker ) {\n\n // What task is it..\n var task = map.og_task.points;\n\n // Points to plot\n var slowpoints = tracker.points; // from db\n var fastpoints = tracker.fastpoints ? tracker.fastpoints : []; // from streaming\n var compno = tracker.compno;\n\n // Make sure we have something to draw!\n if( (slowpoints.length + fastpoints.length) < 2 ) {\n return;\n }\n\n //\n var totaltime = 0;\n var lastbeforestart = 0;\n var utcstart = tracker.utcstart;\n\n // contains the combined list of points\n var ll = []; // LatLong class point used for all calculations\n var llV = []; // LatLongVector\n var points = []; // original data copied over\n\n // Capture last DB point, if we don't have one that is fine\n var newestslowpoint = slowpoints.length ? slowpoints[0].at : 0;\n var newestfastpoint = fastpoints.length ? fastpoints[0].at : 0;\n tracker.gainXsecond = 0;\n tracker.lossXsecond = 0;\n tracker.Xperiod = undefined;\n\n // Points are most recent to oldest, so we need to put any dynamic points\n // in - up to the time we have a full trace\n\n // From the live feed\n for( var p = 0; p < fastpoints.length && newestslowpoint <= fastpoints[p].at; p++ ) {\n if( ! fastpoints[p].ll ) {\n fastpoints[p].ll = new LatLong( fastpoints[p].lat, fastpoints[p].lng );\n }\n ll.push( fastpoints[p].ll );\n points.push( fastpoints[p] );\n\n lasttime = fastpoints[p].at;\n\ttracker.min = Math.min(tracker.min,fastpoints[p].alt*(map.og_units?3.28084:1));\n\ttracker.max = Math.max(tracker.max,fastpoints[p].alt*(map.og_units?3.28084:1));\n\n // Calculate the change over approximately 60 seconds\n if( p > 0 && newestfastpoint - lasttime <= 60 ) {\n var diff = (fastpoints[p-1].alt - fastpoints[p].alt)*(map.og_units?3.28084:1);\n if( diff > 0 ) {\n tracker.gainXsecond += diff;\n }\n else {\n tracker.lossXsecond += diff;\n }\n tracker.Xperiod = newestfastpoint - lasttime;\n }\n }\n\n // So it doesn't display if we didn't record it\n var climbing = false;\n if( tracker.Xperiod ) {\n tracker.gainXsecond = Math.round(tracker.gainXsecond*10)/10;\n tracker.lossXsecond = Math.round(tracker.lossXsecond*10)/10;\n\t// 9.87 = feet/minute to knots\n\t// 60 = m/minute to m/sec\n tracker.averager = Math.round(((tracker.gainXsecond + tracker.lossXsecond) / tracker.Xperiod) * 60 / (map.og_units?9.87:6))/10;\n\n // If we have gained more than twice what we lost then we are climbing\n // and 80fpm\n if( tracker.gainXsecond > 2*(-tracker.lossXsecond) && (tracker.gainXsecond/tracker.Xperiod)*60 > 80 ) {\n climbing = true;\n }\n }\n else {\n tracker.gainXsecond = undefined;\n tracker.lossXsecond = undefined;\n tracker.averager = undefined;\n }\n\n // remove anything left as we have corresponding slow points from this time back\n fastpoints.length = p;\n\n // Process the ones from the database\n for( var p = 0; p < slowpoints.length; p++ ) {\n // console.log( slowpoints[p].at );\n if( ! slowpoints[p].ll ) {\n slowpoints[p].ll = new LatLong( slowpoints[p].l, slowpoints[p].g );\n\t slowpoints[p].at = slowpoints[p].t;\n\t slowpoints[p].alt = slowpoints[p].a;\n\t slowpoints[p].agl = slowpoints[p].h;\n }\n ll.push( slowpoints[p].ll );\n points.push( slowpoints[p] );\n\ttracker.min = Math.min(tracker.min,slowpoints[p].alt*(map.og_units?3.28084:1));\n\ttracker.max = Math.max(tracker.max,slowpoints[p].alt*(map.og_units?3.28084:1));\n\n lasttime = slowpoints[p].at;\n }\n\n var now = (new Date).getTime()/1000;\n tracker.mostrecent = '';\n if( points.length > 0 ) {\n var now;\n if ( map.og_currentTime ) {\n now = map.og_currentTime.getTime()/1000;\n\t}\n\telse {\n\t now = (new Date).getTime()/1000;\n\t}\n\n var diff = now - points[0].at;\n\n\tvar signal = '<span class=\"icon-stack\">'+\n\t '<i class=\"icon-signal\"></i>'+\n\t '<i class=\"icon-ban-circle icon-stack-base\"></i></span';\n\n if( diff < 90 ) {\n tracker.mostrecent = 'just now';\n\n\t // determine how to display the signal strength\n\t if( points[0].s > 30 ) { signal = \"signalgood\" }\n\t else if ( points[0].s > 20 ) { signal = \"signalok\" }\n\t else { signal = \"signalpoor\" };\n\t signal = \"<a href='#' title='\"+points[0].s+\" db'> <i class='icon-signal \" + signal + \"'></i></a>\";\n }\n else if ( diff > 7200 ) {\n tracker.mostrecent = Math.round(diff/3600) + \" hours ago\";\n }\n else\n {\n tracker.mostrecent = Math.round(diff/60) + \" minutes ago\";\n }\n\ttracker.mostrecent += \" \" + signal;\n\n // And if it is up to date or not\n if( diff <= 90 ) {\n tracker.uptodate = 1;\n tracker.notuptodate = 0;\n }\n else {\n tracker.uptodate = 0;\n tracker.notuptodate = 1;\n }\n tracker.altitude = Math.round(points[0].alt *(map.og_units?.328084:.1))*10;\n tracker.agl = Math.round(points[0].agl *(map.og_units?.328084:.1))*10;\n\tconsole.log( tracker.compno + \"* \" + tracker.altitude + \"ft, \"+tracker.agl + \"ft\" );\n tracker.lastPosition = new google.maps.LatLng( points[0].ll.dlat(), points[0].ll.dlong() );\n }\n\n // Check when the glider started we don't want to carry over traces before this\n if( ! tracker.utcstart || ! tracker.lasttp || tracker.lasttp <= 1 ) {\n\tfindStart( map, tracker, task, ll, points );\n\n\t// If the start time has changed then we need to figure out what the last preceeding point is\n\tfor( var p = points.length-2; p > 0; p-- ) {\n\t if( points[p].at > tracker.utcstart ) {\n\t\tlastbeforestart = p+2;\n\t\tbreak;\n\t }\n\t}\n\n//\tconsole.log( tracker.compno + \" -> start @ \" + tracker.utcstart ? timeToText(tracker.utcstart) : \"none\" );\n }\n \n // Create the compno marker, or get previously created one\n var m = createCompnoMarker( map, compno, new google.maps.LatLng(ll[0].dlat(), ll[0].dlong()) );\n\n // truncate anything before the start time as we don't care about it\n if( lastbeforestart && tracker.utcstart && points.length > lastbeforestart+1 ) {\n\tconsole.log( tracker.compno + \" truncating trace to \" + timeToText(points[lastbeforestart].at) );\n\n\t// If we already have a path and it includes points before the start we want to get rid of them\n\tif( m.firstpointadded && m.firstpointadded > points[lastbeforestart].at ) {\n\t m.lastpointadded = 0;\n\t m.firstpointadded = points[lastbeforestart].at;\n\t resetPath( m );\n\t}\n\t\n points.length = lastbeforestart;\n\tlastbeforestart = undefined;\n }\n\n\n // less than 3 kph and less than 0.5m/s height change means stationary\n var stationary = points.length > 1 ?\n ((Math.abs(Math.round(LatLong.distHaversine( ll[0], ll[1] )/(points[0].at - points[1].at)*3600)) < 3) &&\n (Math.round(2*(points[0].alt - points[1].alt)/(points[0].at - points[1].at)) == 0))\n : 0 == 1 ;\n\n // If we are more than 40 minutes since the last trace then assume it's done\n if( (map.og_currentTime ? map.og_currentTime.getTime()/1000 : tracker.utctime) - points[0].at > 40*60 ) {\n console.log( tracker.compno + \"* stationary due to no points \" + timeToText(points[0].at));\n\tstationary = 1;\n } \n\n if( stationary ) {\n console.log( tracker.compno + \"* stationary at \" + timeToText(points[0].at));\n }\n\n // Calculate the point to point & accumulated distance\n var newestpoint = points[0].at;\n for( var p = points.length -1; p >= 0; p-- ) {\n\n // If we haven't plotted the point yet then we need to\n if( points[p].at > m.lastpointadded ) {\n\n // If it was 2 minutes ago then split the path, need to end and\n // start a new one\n if( points[p].at - m.lastpointadded > 120 ) {\n splitPath( map, m );\n }\n\n m.points.push( new google.maps.LatLng( ll[p].dlat(), ll[p].dlong() ));\n m.lastpointadded = points[p].at;\n\t m.firstpointadded = Math.min(points[p].at,m.firstpointadded);\n }\n\n }\n \n if( tracker.utcstart ) {\n\ttracker.start = timeToText( tracker.utcstart );\n\ttracker.dbstatus = 'S';\n }\n else {\n\t\n\t// Update the tooltip\n\tupdateCompnoMarker( map, compno, tracker.notuptodate, climbing );\n\t\n\t// Update the results display\n\tif( map.results ) {\n\t map.results.updateDetails( compno );\n\t}\n\t\n\tconsole.log( tracker.compno + \": no start\" );\n\t\n\tif( stationary && tracker.status && tracker.status.search('tationary') != -1 ) {\n\t tracker.status = tracker.status + \"Stationary. \";\n }\n\t\n\treturn;\n }\n\n if( ! tracker.utcfinish ) {\n\t// Make sure we don't do this more than once every 30 seconds\n\tif( ! tracker.lastScored || tracker.lastScored + 60 < points[0].at || map.results.isChosenPilot( tracker.compno )) {\n\t // remove old points we will do it all again for now - this is only displayed on a hover anyway so no\n\t // real worry about occasional flicker\n\t tracker.status = \"\";\n\t m.scoredpoints.clear();\n\n\t console.log( tracker.compno + \" scoring at \" + timeToText(points[0].at));\n\n\t //\n\t tracker.lastScored = points[0].at;\n\n\t // Only do this if we have a start\n\t if( tracker.utcstart ) {\n\t\tif( map.og_task.type === \"A\" ) {\n\t\t scoreAATPoints( task, tracker, points, ll, m );\n\t\t}\n\t\telse {\n\t\t scoreSpeedTask( map.og_task, tracker, points, ll, m );\n\t\t}\n\t }\n\t}\n }\n\n // Update the status of the glider properly\n if( tracker.utcfinish ) { // Finishes are definitive\n\ttracker.dbstatus = 'F';\n }\n else {\n\n\t// If we are now stationary\n\tif( stationary ) {\n\t if( ! tracker.utcstart ) {\n\t\ttracker.dbstatus='G';\n\t }\n\t else {\n\t\tconsole.log( tracker.compno + \" assuming landout\" );\n\n\t\tif( LatLong.distHaversine( ll[0], task[task.length-1].ll ) < 0.5 ) {\n\t\t tracker.dbstatus = 'H';\n\t\t}\n\t\telse {\n\t\t tracker.dbstatus = 'R';\n\t\t}\n\t\t\n\t\ttracker.speed = undefined;\n\t\ttracker.hspeed = undefined;\n\t\ttracker.grremaining = undefined;\n\t\ttracker.hgrremaining = undefined;\n\t }\n\t}\n\telse {\n\t if( tracker.utcstart ) {\n\t\ttracker.dbstatus = 'S';\n\t }\n\t else {\n\t\ttracker.dbstatus='G';\n\t }\n\t}\n }\n tracker.stationary = stationary;\n\n if( tracker.utcstart && ! tracker.utcfinish ) {\n\ttracker.utcduration = points[0].at - tracker.utcstart;\n\ttracker.duration = durationToText( tracker.utcduration );\n }\n\n // Update the tooltip\n updateCompnoMarker( map, compno, tracker.notuptodate, climbing );\n \n // Update the results display\n if( map.results ) {\n map.results.updateDetails( compno );\n }\n}", "title": "" }, { "docid": "4d1297eaca632d5385d1593b4708fe89", "score": "0.47096437", "text": "function showTimer (duration) {\n var markup = timerMarkup();\n var ahead = Date.now() + duration || 492000;\n var running = setInterval(tick, 1000);\n \n function tick () {\n var point = ahead - Date.now();\n var moment = new Date(point);\n\n if (point <= 0) clear();\n\n markup.min.textContent = moment.getMinutes();\n markup.sec.textContent = pad(moment.getSeconds());\n } \n\n function clear () {\n clearInterval(running);\n markup.el.style.display = 'none';\n }\n\n function pad (value) {\n var number = value.toString();\n return (number.length === 1) ? '0' + number : number; \n }\n\n document.body.appendChild(markup.el);\n}", "title": "" }, { "docid": "750074ec9f5e56019d01929d48556a66", "score": "0.4708896", "text": "function timerFunc1() {\n\n kony.application.showLoadingScreen(\"loadingscreenskin\", \"Please wait..\", constants.LOADING_SCREEN_POSITION_FULL_SCREEN, true, true, {\n enableMenuKey: true,\n enableBackKey: true,\n progressIndicatorColor: \"000000\"\n });\n}", "title": "" } ]
c0c9758f8f301fc167057f0a31a21749
Convert HTML string to AST.
[ { "docid": "1b3128682eb46ff67338b771685565d9", "score": "0.0", "text": "function parse (\n template,\n options\n) {\n warn$2 = options.warn || baseWarn;\n\n platformIsPreTag = options.isPreTag || no;\n platformMustUseProp = options.mustUseProp || no;\n platformGetTagNamespace = options.getTagNamespace || no;\n\n transforms = pluckModuleFunction(options.modules, 'transformNode');\n preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');\n postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');\n\n delimiters = options.delimiters;\n\n var stack = [];\n var preserveWhitespace = options.preserveWhitespace !== false;\n var root;\n var currentParent;\n var inVPre = false;\n var inPre = false;\n var warned = false;\n\n function warnOnce (msg) {\n if (!warned) {\n warned = true;\n warn$2(msg);\n }\n }\n\n function endPre (element) {\n // check pre state\n if (element.pre) {\n inVPre = false;\n }\n if (platformIsPreTag(element.tag)) {\n inPre = false;\n }\n }\n\n parseHTML(template, {\n warn: warn$2,\n expectHTML: options.expectHTML,\n isUnaryTag: options.isUnaryTag,\n canBeLeftOpenTag: options.canBeLeftOpenTag,\n shouldDecodeNewlines: options.shouldDecodeNewlines,\n shouldKeepComment: options.comments,\n start: function start (tag, attrs, unary) {\n // check namespace.\n // inherit parent ns if there is one\n var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);\n\n // handle IE svg bug\n /* istanbul ignore if */\n if (isIE && ns === 'svg') {\n attrs = guardIESVGBug(attrs);\n }\n\n var element = createASTElement(tag, attrs, currentParent);\n if (ns) {\n element.ns = ns;\n }\n\n if (isForbiddenTag(element) && !isServerRendering()) {\n element.forbidden = true;\n \"development\" !== 'production' && warn$2(\n 'Templates should only be responsible for mapping the state to the ' +\n 'UI. Avoid placing tags with side-effects in your templates, such as ' +\n \"<\" + tag + \">\" + ', as they will not be parsed.'\n );\n }\n\n // apply pre-transforms\n for (var i = 0; i < preTransforms.length; i++) {\n element = preTransforms[i](element, options) || element;\n }\n\n if (!inVPre) {\n processPre(element);\n if (element.pre) {\n inVPre = true;\n }\n }\n if (platformIsPreTag(element.tag)) {\n inPre = true;\n }\n if (inVPre) {\n processRawAttrs(element);\n } else if (!element.processed) {\n // structural directives\n processFor(element);\n processIf(element);\n processOnce(element);\n // element-scope stuff\n processElement(element, options);\n }\n\n function checkRootConstraints (el) {\n if (true) {\n if (el.tag === 'slot' || el.tag === 'template') {\n warnOnce(\n \"Cannot use <\" + (el.tag) + \"> as component root element because it may \" +\n 'contain multiple nodes.'\n );\n }\n if (el.attrsMap.hasOwnProperty('v-for')) {\n warnOnce(\n 'Cannot use v-for on stateful component root element because ' +\n 'it renders multiple elements.'\n );\n }\n }\n }\n\n // tree management\n if (!root) {\n root = element;\n checkRootConstraints(root);\n } else if (!stack.length) {\n // allow root elements with v-if, v-else-if and v-else\n if (root.if && (element.elseif || element.else)) {\n checkRootConstraints(element);\n addIfCondition(root, {\n exp: element.elseif,\n block: element\n });\n } else if (true) {\n warnOnce(\n \"Component template should contain exactly one root element. \" +\n \"If you are using v-if on multiple elements, \" +\n \"use v-else-if to chain them instead.\"\n );\n }\n }\n if (currentParent && !element.forbidden) {\n if (element.elseif || element.else) {\n processIfConditions(element, currentParent);\n } else if (element.slotScope) { // scoped slot\n currentParent.plain = false;\n var name = element.slotTarget || '\"default\"';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;\n } else {\n currentParent.children.push(element);\n element.parent = currentParent;\n }\n }\n if (!unary) {\n currentParent = element;\n stack.push(element);\n } else {\n endPre(element);\n }\n // apply post-transforms\n for (var i$1 = 0; i$1 < postTransforms.length; i$1++) {\n postTransforms[i$1](element, options);\n }\n },\n\n end: function end () {\n // remove trailing whitespace\n var element = stack[stack.length - 1];\n var lastNode = element.children[element.children.length - 1];\n if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {\n element.children.pop();\n }\n // pop stack\n stack.length -= 1;\n currentParent = stack[stack.length - 1];\n endPre(element);\n },\n\n chars: function chars (text) {\n if (!currentParent) {\n if (true) {\n if (text === template) {\n warnOnce(\n 'Component template requires a root element, rather than just text.'\n );\n } else if ((text = text.trim())) {\n warnOnce(\n (\"text \\\"\" + text + \"\\\" outside root element will be ignored.\")\n );\n }\n }\n return\n }\n // IE textarea placeholder bug\n /* istanbul ignore if */\n if (isIE &&\n currentParent.tag === 'textarea' &&\n currentParent.attrsMap.placeholder === text\n ) {\n return\n }\n var children = currentParent.children;\n text = inPre || text.trim()\n ? isTextTag(currentParent) ? text : decodeHTMLCached(text)\n // only preserve whitespace if its not right after a starting tag\n : preserveWhitespace && children.length ? ' ' : '';\n if (text) {\n var expression;\n if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {\n children.push({\n type: 2,\n expression: expression,\n text: text\n });\n } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {\n children.push({\n type: 3,\n text: text\n });\n }\n }\n },\n comment: function comment (text) {\n currentParent.children.push({\n type: 3,\n text: text,\n isComment: true\n });\n }\n });\n return root\n}", "title": "" } ]
[ { "docid": "6ea2c177f1516fbf0e8c78ea7df59294", "score": "0.63622856", "text": "function convert(html) {\n const convert_text = (html_text) => {\n /*\n The code is a bit ugly... it seems that the xhtml serializer relies on the specificities of the parse5 module output.\n On the other hand, the output of that module does not seem to implement a bunch of DOM features that the rest of the code\n relies on which means that it cannot be used elsewhere...\n */\n return '<!DOCTYPE html>' + xmlserializer_1.serializeToString(parse5_1.parse(html_text));\n };\n const return_value = (typeof html === \"string\") ? convert_text(html) : convert_text(html.serialize());\n return utils_1.remove_entities(return_value);\n // // Last touch: the result should not include xml entities but only code numbers.\n // // The xhtml conversion should filter them out, but but it does not :-(\n // for (const conversion of constants.entity_codes) {\n // const [entity, code] = conversion;\n // // This should be a return_value.replaceAll(entity,code), but that function is not\n // // implemented in node version 14.*\n // return_value = return_value.split(entity).join(code);\n // }\n // return return_value;\n}", "title": "" }, { "docid": "3d1994a2b29c77e2b48e35d300ddeaa2", "score": "0.62791353", "text": "convertToHTML(page){\n return new DOMParser().parseFromString(page, \"text/html\")\n }", "title": "" }, { "docid": "e2caab4e19c5867fb03d7cc546cb1f90", "score": "0.6136139", "text": "function importParse(htmlString, href) {\n var doc;\n try {\n doc = dom5.parse(htmlString, { locationInfo: true });\n }\n catch (err) {\n console.log(err);\n return null;\n }\n // Add line/column information\n dom5.treeMap(doc, function (node) {\n if (node.__location && node.__location.start >= 0) {\n node.__locationDetail = getLineAndColumn(htmlString, node.__location.start);\n if (href) {\n node.__ownerDocument = href;\n }\n }\n });\n var registry = {\n base: [],\n template: [],\n script: [],\n style: [],\n import: [],\n 'dom-module': [],\n comment: [],\n ast: doc };\n var queue = [].concat(doc.childNodes);\n var nextNode;\n while (queue.length > 0) {\n nextNode = queue.shift();\n if (nextNode) {\n queue = queue.concat(nextNode.childNodes);\n addNode(nextNode, registry);\n }\n }\n ;\n return registry;\n}", "title": "" }, { "docid": "ee97d1874865176a871d65982001fa79", "score": "0.6095513", "text": "function parseHtml(htmlString){\n var d = document.createElement('div');\n d.innerHTML = htmlString;\n return u(d).children();\n}", "title": "" }, { "docid": "a91fb101bbc547ac36eea7783767997d", "score": "0.5951022", "text": "function parseHTML(html) {\n return parseHTMLRecursive(html, 0, null, 0).result;\n}", "title": "" }, { "docid": "f96990dfe59479526d86ac96c0f30964", "score": "0.59500283", "text": "function convertHtmlStringToDocForParse (str) {\n\tvar a = document.createElement('div');\n\ta.innerHTML = str;\n\treturn a\n}", "title": "" }, { "docid": "6247dd61ae5dd220b4ad50daeaeccbbd", "score": "0.5947724", "text": "html(html){\n if(html)\n this.parse(html);\n }", "title": "" }, { "docid": "a0715b3efbb97acc06d6f68463806929", "score": "0.5873494", "text": "function parseHTML(htmlstr) {\n var t = document.createElement('template');\n t.innerHTML = htmlstr;\n return t.content.cloneNode(true);\n}", "title": "" }, { "docid": "f6f9b210e631c3ea9ebb96f178c44813", "score": "0.58458227", "text": "function convertHTML(str) {\n // iterate over the splited str\n const splitedStr = str.split(\"\");\n\n for (let i = 0; i < splitedStr.length; i++) {\n switch (splitedStr[i]) {\n case \"&\":\n splitedStr.splice(i, 1, \"&amp;\");\n break;\n case \"<\":\n splitedStr.splice(i, 1, \"&lt;\");\n break;\n case \">\":\n splitedStr.splice(i, 1, \"&gt;\");\n break;\n case \"<>\":\n splitedStr.splice(i, 1, \"&lt;&gt;\");\n break;\n case \"'\":\n splitedStr.splice(i, 1, \"&apos;\");\n case '\"':\n splitedStr.splice(i, 1, \"&quot;\");\n }\n }\n\n for (let j = 0; j < splitedStr.join(\"\").split(\"\").length; j++) {\n switch (splitedStr.join(\"\").split(\"\")[j]) {\n case '\"':\n console.log(\"MATHC\");\n splitedStr.join(\"\").split(\"\").splice(j, 1, \"&quot\");\n }\n }\n\n return splitedStr.join(\"\");\n}", "title": "" }, { "docid": "92a6fd579ab7ed7ffd9aac26dc284821", "score": "0.5783236", "text": "function mdast(text) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!text) return null;\n\n var _setup9 = setup(text, opts);\n\n var _setup10 = _slicedToArray(_setup9, 2);\n\n text = _setup10[0];\n opts = _setup10[1];\n return processor(opts).parse(text);\n}", "title": "" }, { "docid": "72ff178b704f3a7995c970d5bbc8138e", "score": "0.5725157", "text": "function astNodeToHtmlText(ast) {\n return charToEntity(ast.allText);\n}", "title": "" }, { "docid": "7c6c262c9875ea2122f3efbaae190f91", "score": "0.5707709", "text": "function convertHTML(str) {\n return str.replace(regex, (match) => HTMLElements[match])\n}", "title": "" }, { "docid": "a723882645dab3ad15782ff5e8ce2b7a", "score": "0.57015383", "text": "HTML2Source(str)\n {\n // To force auto-conversion to string\n return (str + \"\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n }", "title": "" }, { "docid": "64ef5440c444d734e9aabe05a44e321e", "score": "0.5688792", "text": "function textToHTML(str) {\n var parser = new DOMParser();\n var doc = parser.parseFromString(str, 'text/html');\n return doc.body.innerHTML;\n\n}", "title": "" }, { "docid": "de872d0d1a5189d130fd9e5335c0fffa", "score": "0.5638016", "text": "function parse(str, options) {\n var filename = options.filename\n , utils = require('jade').utils\n\n try {\n // Parse\n var parser = new Parser(str, filename)\n if(options.debug) parser.debug()\n\n // Compile\n var compiler = new (options.compiler || Compiler)(parser.parse(), options)\n compiler.line = function(){} // do not add line numbers here\n compiler.buffer = function(str, esc){\n var buf = this.buf\n\n if (esc) str = utils.escape(str)\n\n if (this.lastBufferedIndex == buf.length) {\n buf.pop()\n str = this.lastBufferedString + str\n }\n\n buf.push(\"buf.push('\"+ str +\"');\")\n this.lastBufferedIndex = buf.length\n this.lastBufferedString = str\n }\n var js = compiler.compile()\n\n // Debug compiler\n if (options.debug) {\n console.log('\\n\\x1b[1mCompiled Function\\x1b[0m:\\n\\n%s', js.replace(/^/gm, ' '))\n }\n\n try {\n return ''\n + attrs.toString() +'\\n'\n + escape.toString() +'\\n'\n + 'var buf = [];\\n'\n + (options.self\n ? 'var self = locals || {}, __ = __ || locals.__\\n'+ js\n : 'with (locals || {}){'+ js +'}')\n + 'return buf.join(\"\");'\n }\n catch (err) {\n process.compile(js, filename || 'Jade')\n\n return\n }\n }\n catch (err) {\n console.log(err)\n }\n}", "title": "" }, { "docid": "d420bda4dbcc6968bec9391d7e27bbc3", "score": "0.5607507", "text": "function ParseTreeTransformer() {}", "title": "" }, { "docid": "9880d6011fa428c04c986d2c72cd8f2e", "score": "0.5567189", "text": "function convertToHtml(html) {\n\t\thtml = html.replace(/\\n<image\\>\\n/g, '<div class=\"image\">')\n\t\t\t.replace(/\\n<\\/image>\\n/g, '</div>')\n\t\t\t.replace(/<img src=\"+/g, '<img src=\"../img/wiki-img/')\n\t\t\t.replace(/<b>+/g, '<strong>')\n\t\t\t.replace(/<\\/b>+/g, '</strong>')\n\t\t\t.replace(/<i>+/g, '<em>')\n\t\t\t.replace(/<\\/i>+/g, '</em>')\n\t\t\t.replace(/\\n<ul>+/g, '<ul>')\n\t\t\t.replace(/<\\/ul>\\n/g, '</ul>')\n\t\t\t.replace(/\\n<ol>+/g, '<ol>')\n\t\t\t.replace(/<\\/ol>\\n/g, '</ol>')\n\t\t\t.replace(/<\\/li>\\n<li>+/g, '</li><li>')\n\t\t\t.replace(/\\n/g, '<br>');\n\t\treturn html;\n\t}", "title": "" }, { "docid": "f1e61ccaf19bbb8136ac3052252cf3c8", "score": "0.54763645", "text": "function parseHTML(html) {\n if (!isString(html)) return [];\n if (singleTagRe.test(html)) return [createElement(RegExp.$1)];\n var fragment = fragmentRe.test(html) && RegExp.$1,\n container = containers[fragment] || containers['*'];\n container.innerHTML = html;\n return cash(container.childNodes).detach().get();\n}", "title": "" }, { "docid": "2d73e34fcb98231126fa3747d39653bb", "score": "0.5464489", "text": "function convert(html) {\n return html.replace(/(<(\\w+)[^>]*?)\\/>/g, function(all, front, tag) {\n return tags.test(tag) ?\n all :\n front + \"></\" + tag + \">\";\n });\n}", "title": "" }, { "docid": "258eb58fdb80c8e41ce59cfd29ef02ac", "score": "0.54198164", "text": "function $goog$string$html$HtmlParser$$() {\n}", "title": "" }, { "docid": "c08bd0dcdf20515c0d0989d04de8d5af", "score": "0.54085046", "text": "function md2html (input_text) {\n // I do not use `require('marked')` as written in the doc, because that causes some errors.\n var markedOptions = {\n renderer: new marked.Renderer(),\n highlight: function(code) {\n return require('highlight.js').highlightAuto(code).value;\n },\n pedantic: false,\n gfm: true,\n tables: true,\n breaks: true, // true: hard break; false: soft break. GFM uses hard one.\n sanitize: false,\n smartLists: true,\n smartypants: false,\n xhtml: false\n };\n return marked(input_text,markedOptions);\n }", "title": "" }, { "docid": "ac245baa72a5204cc95ed46f6130c736", "score": "0.5395491", "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,shouldDecodeNewlinesForHref:options.shouldDecodeNewlinesForHref,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": "638316bcf54a5811e9abb461555e91ae", "score": "0.53882647", "text": "function DOMParser() {}", "title": "" }, { "docid": "c6730943e8c3add76ecbf93985392b8f", "score": "0.5386166", "text": "function parse() {\n let editor = ace.edit(\"editor\");\n var txt = editor.getValue();\n console.log('parsing: ' + txt);\n try {\n\tconst sexp = Sexp(txt);\n\tclearError();\n\tactiveRenderer.reset();\n\tactiveRenderer.addAst(sexp);\n\tactiveRenderer.initScale();\n\tactiveRenderer.initPositions();\n\tactiveRenderer.optimize();\n }\n catch (err) {\n\tconsole.log(err);\n\tsetError(err);\n }\n}", "title": "" }, { "docid": "57ba436055fe847963b4f54467323b84", "score": "0.5382055", "text": "function parse(elementOrHtml, rules, context, cleanUp) {\n wysihtml5.lang.object(currentRules).merge(defaultRules).merge(rules).get();\n \n context = context || elementOrHtml.ownerDocument || document;\n var fragment = context.createDocumentFragment(),\n isString = typeof(elementOrHtml) === \"string\",\n element,\n newNode,\n firstChild;\n \n if (isString) {\n element = wysihtml5.dom.getAsDom(elementOrHtml, context);\n } else {\n element = elementOrHtml;\n }\n \n while (element.firstChild) {\n firstChild = element.firstChild;\n element.removeChild(firstChild);\n newNode = _convert(firstChild, cleanUp);\n if (newNode) {\n fragment.appendChild(newNode);\n }\n }\n \n // Clear element contents\n element.innerHTML = \"\";\n \n // Insert new DOM tree\n element.appendChild(fragment);\n \n return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\n }", "title": "" }, { "docid": "57ba436055fe847963b4f54467323b84", "score": "0.5382055", "text": "function parse(elementOrHtml, rules, context, cleanUp) {\n wysihtml5.lang.object(currentRules).merge(defaultRules).merge(rules).get();\n \n context = context || elementOrHtml.ownerDocument || document;\n var fragment = context.createDocumentFragment(),\n isString = typeof(elementOrHtml) === \"string\",\n element,\n newNode,\n firstChild;\n \n if (isString) {\n element = wysihtml5.dom.getAsDom(elementOrHtml, context);\n } else {\n element = elementOrHtml;\n }\n \n while (element.firstChild) {\n firstChild = element.firstChild;\n element.removeChild(firstChild);\n newNode = _convert(firstChild, cleanUp);\n if (newNode) {\n fragment.appendChild(newNode);\n }\n }\n \n // Clear element contents\n element.innerHTML = \"\";\n \n // Insert new DOM tree\n element.appendChild(fragment);\n \n return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\n }", "title": "" }, { "docid": "f85ee0ab6c00066e58e7a4d822e2e12f", "score": "0.5381637", "text": "function transform(element){\n var ts = element.innerHTML;\n ts = _parseURLs(ts);\n ts = _parseUsernames(ts);\n ts = _parseHashtags(ts);\n element.innerHTML = ts;\n }", "title": "" }, { "docid": "079ecea7180f5af1e8e84efc902098b6", "score": "0.53490174", "text": "function PEGtoAST(node) {\n switch (type(node)) {\n case \"null\":\n return undefined;\n case \"string\":\n return new StringNode(node);\n case \"array\":\n return new ASTNodeList(...node.map(PEGtoAST));\n case \"object\":\n switch (node.TYPE) {\n case \"whitespace\":\n return new Whitespace();\n case \"parbreak\":\n return new Parbreak();\n case \"subscript\":\n return new Subscript(PEGtoAST(node.content));\n case \"superscript\":\n return new Superscript(PEGtoAST(node.content));\n case \"inlinemath\":\n return new InlineMath(PEGtoAST(node.content));\n case \"displaymath\":\n return new DisplayMath(PEGtoAST(node.content));\n case \"mathenv\":\n return new MathEnv(node.env, PEGtoAST(node.content));\n case \"group\":\n return new Group(PEGtoAST(node.content));\n case \"macro\":\n return new Macro(node.content, PEGtoAST(node.args));\n case \"environment\":\n return new Environment(\n PEGtoAST(node.env),\n PEGtoAST(node.args),\n PEGtoAST(node.content)\n );\n case \"verbatim\":\n return new Verbatim(PEGtoAST(node.content));\n case \"verb\":\n return new Verb(node[\"escape\"], PEGtoAST(node.content));\n case \"commentenv\":\n return new CommentEnv(PEGtoAST([node.content]));\n case \"comment\":\n return new CommentNode(\n node.sameline,\n PEGtoAST(node.content)\n );\n case \"arglist\":\n return new ArgList(PEGtoAST(node.content));\n }\n }\n}", "title": "" }, { "docid": "ae2c9883ee65d284911c2518195d559e", "score": "0.53388274", "text": "fromString(string, type) {\n if (!type) {\n type = 'text/html';\n }\n var parser = new DOMParser();\n this.doc = parser.parseFromString(string, type);\n return this;\n }", "title": "" }, { "docid": "d40eed9e5b2b881252721bc39b43691f", "score": "0.53349835", "text": "function parse(elementOrHtml, config) {\n wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();\n\n var context = config.context || elementOrHtml.ownerDocument || document,\n fragment = context.createDocumentFragment(),\n isString = typeof(elementOrHtml) === \"string\",\n clearInternals = false,\n element,\n newNode,\n firstChild;\n\n if (config.clearInternals === true) {\n clearInternals = true;\n }\n\n if (isString) {\n element = wysihtml5.dom.getAsDom(elementOrHtml, context);\n } else {\n element = elementOrHtml;\n }\n\n if (currentRules.selectors) {\n _applySelectorRules(element, currentRules.selectors);\n }\n\n while (element.firstChild) {\n firstChild = element.firstChild;\n newNode = _convert(firstChild, config.cleanUp, clearInternals, config.uneditableClass);\n if (newNode) {\n fragment.appendChild(newNode);\n }\n if (firstChild !== newNode) {\n element.removeChild(firstChild);\n }\n }\n\n if (config.unjoinNbsps) {\n // replace joined non-breakable spaces with unjoined\n var txtnodes = wysihtml5.dom.getTextNodes(fragment);\n for (var n = txtnodes.length; n--;) {\n txtnodes[n].nodeValue = txtnodes[n].nodeValue.replace(/([\\S\\u00A0])\\u00A0/gi, \"$1 \");\n }\n }\n\n // Clear element contents\n element.innerHTML = \"\";\n\n // Insert new DOM tree\n element.appendChild(fragment);\n\n return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\n }", "title": "" }, { "docid": "e3793db4303ec191608da83584b1f99c", "score": "0.53339374", "text": "function parse(str) {\n var pieces = str.replace(/^</, \"\").replace(/>$/, \"\").split(/\\s+/);\n\n var _ref = parseTag(pieces.shift());\n\n var tag = _ref.tag;\n var classes = _ref.classes;\n var attrs = parseAttrs(pieces.join(\" \"));\n\n // merge classes\n if (classes.length || null != attrs[\"class\"]) {\n attrs[\"class\"] = classes.join(\" \") + (null == attrs[\"class\"] ? \"\" : attrs[\"class\"]);\n }\n\n return { tag: tag, attrs: attrs };\n}", "title": "" }, { "docid": "cff99dd2d78e04ed61d40a8f8e01ca7d", "score": "0.5328712", "text": "function parse(elementOrHtml, config) {\n wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();\n\n var context = config.context || elementOrHtml.ownerDocument || document,\n fragment = context.createDocumentFragment(),\n isString = typeof(elementOrHtml) === \"string\",\n clearInternals = false,\n element,\n newNode,\n firstChild;\n\n if (config.clearInternals === true) {\n clearInternals = true;\n }\n\n if (config.uneditableClass) {\n uneditableClass = config.uneditableClass;\n }\n\n if (isString) {\n element = wysihtml5.dom.getAsDom(elementOrHtml, context);\n } else {\n element = elementOrHtml;\n }\n\n while (element.firstChild) {\n firstChild = element.firstChild;\n newNode = _convert(firstChild, config.cleanUp, clearInternals);\n if (newNode) {\n fragment.appendChild(newNode);\n }\n if (firstChild !== newNode) {\n element.removeChild(firstChild);\n }\n }\n\n // Clear element contents\n element.innerHTML = \"\";\n\n // Insert new DOM tree\n element.appendChild(fragment);\n\n return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\n }", "title": "" }, { "docid": "cff99dd2d78e04ed61d40a8f8e01ca7d", "score": "0.5328712", "text": "function parse(elementOrHtml, config) {\n wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();\n\n var context = config.context || elementOrHtml.ownerDocument || document,\n fragment = context.createDocumentFragment(),\n isString = typeof(elementOrHtml) === \"string\",\n clearInternals = false,\n element,\n newNode,\n firstChild;\n\n if (config.clearInternals === true) {\n clearInternals = true;\n }\n\n if (config.uneditableClass) {\n uneditableClass = config.uneditableClass;\n }\n\n if (isString) {\n element = wysihtml5.dom.getAsDom(elementOrHtml, context);\n } else {\n element = elementOrHtml;\n }\n\n while (element.firstChild) {\n firstChild = element.firstChild;\n newNode = _convert(firstChild, config.cleanUp, clearInternals);\n if (newNode) {\n fragment.appendChild(newNode);\n }\n if (firstChild !== newNode) {\n element.removeChild(firstChild);\n }\n }\n\n // Clear element contents\n element.innerHTML = \"\";\n\n // Insert new DOM tree\n element.appendChild(fragment);\n\n return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\n }", "title": "" }, { "docid": "cff99dd2d78e04ed61d40a8f8e01ca7d", "score": "0.5328712", "text": "function parse(elementOrHtml, config) {\n wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();\n\n var context = config.context || elementOrHtml.ownerDocument || document,\n fragment = context.createDocumentFragment(),\n isString = typeof(elementOrHtml) === \"string\",\n clearInternals = false,\n element,\n newNode,\n firstChild;\n\n if (config.clearInternals === true) {\n clearInternals = true;\n }\n\n if (config.uneditableClass) {\n uneditableClass = config.uneditableClass;\n }\n\n if (isString) {\n element = wysihtml5.dom.getAsDom(elementOrHtml, context);\n } else {\n element = elementOrHtml;\n }\n\n while (element.firstChild) {\n firstChild = element.firstChild;\n newNode = _convert(firstChild, config.cleanUp, clearInternals);\n if (newNode) {\n fragment.appendChild(newNode);\n }\n if (firstChild !== newNode) {\n element.removeChild(firstChild);\n }\n }\n\n // Clear element contents\n element.innerHTML = \"\";\n\n // Insert new DOM tree\n element.appendChild(fragment);\n\n return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\n }", "title": "" }, { "docid": "cff99dd2d78e04ed61d40a8f8e01ca7d", "score": "0.5328712", "text": "function parse(elementOrHtml, config) {\n wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();\n\n var context = config.context || elementOrHtml.ownerDocument || document,\n fragment = context.createDocumentFragment(),\n isString = typeof(elementOrHtml) === \"string\",\n clearInternals = false,\n element,\n newNode,\n firstChild;\n\n if (config.clearInternals === true) {\n clearInternals = true;\n }\n\n if (config.uneditableClass) {\n uneditableClass = config.uneditableClass;\n }\n\n if (isString) {\n element = wysihtml5.dom.getAsDom(elementOrHtml, context);\n } else {\n element = elementOrHtml;\n }\n\n while (element.firstChild) {\n firstChild = element.firstChild;\n newNode = _convert(firstChild, config.cleanUp, clearInternals);\n if (newNode) {\n fragment.appendChild(newNode);\n }\n if (firstChild !== newNode) {\n element.removeChild(firstChild);\n }\n }\n\n // Clear element contents\n element.innerHTML = \"\";\n\n // Insert new DOM tree\n element.appendChild(fragment);\n\n return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\n }", "title": "" }, { "docid": "42897ed83979dea07b55c02a175de748", "score": "0.5286178", "text": "function toHtml(html) {\n\n var frag = document.createDocumentFragment();\n var parts = String(string).match(/^\\s*<(\\w+)/);\n var base = document.createElement(\"div\");\n var data = [];\n\n if (parts && parts[1]) {\n data = toHtmlData[parts[1]] || toHtmlData[\"*\"];\n } else {\n triggerFatal(\"dom.toHtml passed unrecognised HTML: \" + string);\n }\n\n base.innerHTML = data[1];\n\n util.Number.times(data[0], function () {\n base = base.firstChild;\n });\n\n base.innerHTML = string;\n\n while (base.firstChild) {\n frag.appendChild(base.firstChild);\n }\n\n return frag;\n\n }", "title": "" }, { "docid": "4b7a9fb2e40f7e606ad12f0fcf7c4e25", "score": "0.52838844", "text": "function prepareAst(src){\n var tree = (typeof src === 'string') ? parse(src) : src\n return hoist(tree)\n}", "title": "" }, { "docid": "eff10c9fba7601ab6d303978ac7d2184", "score": "0.5282251", "text": "function HtmlTextParser(html) {\n this._html = html;\n this._content_div_html = null;\n this._content_div = null;\n this._parts_table = null;\n this._parts_table_tbody = null;\n this._nextpage_form = null;\n}", "title": "" }, { "docid": "b36004fdb040f5a6354ea49a57670742", "score": "0.5280391", "text": "function fromMD(text) {\n var AST = {\n front: {},\n notes: [],\n abstract: [],\n middle: [],\n back: []\n };\n\n var lines = text.split(\"\\n\");\n var divider = lines[0];\n\n // Split into top level chapters\n var lineNumber = -1;\n var lastChapterEnd = 0;\n var chapterMeta = [];\n var chapters = []\n lines.forEach(function(line) {\n lineNumber += 1;\n if ((line.indexOf(divider) != 0) || (lineNumber == 0) ||\n (!/^\\s+\\S+/.test(line.substring(divider.length))))\n return;\n\n var content = line.substring(divider.length).trim();\n var type = content.replace(/\\s.*$/, '');\n var title = content.replace(/^[^\\s]*\\s*/, '');\n chapterMeta.push({ type: type, title: title });\n chapters.push(lines.slice(lastChapterEnd+1, lineNumber));\n lastChapterEnd = lineNumber;\n });\n chapters.push(lines.slice(lastChapterEnd+1));\n\n // The first chapter forms the bulk of the front matter\n AST.front = YAML.parse(chapters.shift().join(\"\\n\"));\n\n // The remainder of the chapters are parsed as markdown\n for (var i=0; i < chapters.length; ++i) {\n var blocks = md2blocks(chapters[i].join(\"\\n\"), (chapterMeta[i].type == \"back\"));\n\n switch (chapterMeta[i].type) {\n case \"note\":\n AST.notes.push({\n type: \"section\",\n text: chapterMeta[i].title,\n });\n AST.notes = AST.notes.concat(blocks)\n case \"abstract\":\n blocks.unshift({\n type: \"section\",\n text: \"Abstract\",\n });\n AST.abstract = blocks;\n break;\n case \"middle\": AST.middle = blocks; break;\n case \"back\": AST.back = blocks; break;\n default:\n console.log(\"unknown chapter type: [\"+ chapterMeta[i].type +\"]\");\n }\n }\n\n return AST;\n}", "title": "" }, { "docid": "1fa0e318c7adbe4a28f6f643d841b35d", "score": "0.5270284", "text": "function parse(md) {\n\tvar tokenizer = /((?:^|\\n+)(?:\\n---+|\\* \\*(?: \\*)+)\\n)|(?:^```(\\w*)\\n([\\s\\S]*?)\\n```$)|((?:(?:^|\\n+)(?:\\t| {2,}).+)+\\n*)|((?:(?:^|\\n)([>*+-]|\\d+\\.)\\s+.*)+)|(?:\\!\\[([^\\]]*?)\\]\\(([^\\)]+?)\\))|(\\[)|(\\](?:\\(([^\\)]+?)\\))?)|(?:(?:^|\\n+)([^\\s].*)\\n(\\-{3,}|={3,})(?:\\n+|$))|(?:(?:^|\\n+)(#{1,3})\\s*(.+)(?:\\n+|$))|(?:`([^`].*?)`)|( \\n\\n*|\\n{2,}|__|\\*\\*|[_*])/gm,\n\t\tcontext = [],\n\t\tout = '',\n\t\tlast = 0,\n\t\tlinks = {},\n\t\tchunk, prev, token, inner, t;\n\n\tfunction tag(token) {\n\t\tvar desc = TAGS[token.replace(/\\*/g,'_')[1] || ''],\n\t\t\tend = context[context.length-1]==token;\n\t\tif (!desc) { return token; }\n\t\tif (!desc[1]) { return desc[0]; }\n\t\tcontext[end?'pop':'push'](token);\n\t\treturn desc[end|0];\n\t}\n\n\tfunction flush() {\n\t\tvar str = '';\n\t\twhile (context.length) { str += tag(context[context.length-1]); }\n\t\treturn str;\n\t}\n\n\tmd = md.replace(/^\\[(.+?)\\]:\\s*(.+)$/gm, function (s, name, url) {\n\t\tlinks[name.toLowerCase()] = url;\n\t\treturn '';\n\t}).replace(/^\\n+|\\n+$/g, '');\n\n\twhile ( (token=tokenizer.exec(md)) ) {\n\t\tprev = md.substring(last, token.index);\n\t\tlast = tokenizer.lastIndex;\n\t\tchunk = token[0];\n\t\tif (prev.match(/[^\\\\](\\\\\\\\)*\\\\$/)) {\n\t\t\t// escaped\n\t\t}\n\t\t// Code/Indent blocks:\n\t\telse if (token[3] || token[4]) {\n\t\t\tchunk = '<pre class=\"code '+(token[4]?'poetry':token[2].toLowerCase())+'\">'+outdent(encodeAttr(token[3] || token[4]).replace(/^\\n+|\\n+$/g, ''))+'</pre>';\n\t\t}\n\t\t// > Quotes, -* lists:\n\t\telse if (token[6]) {\n\t\t\tt = token[6];\n\t\t\tif (t.match(/\\./)) {\n\t\t\t\ttoken[5] = token[5].replace(/^\\d+/gm, '');\n\t\t\t}\n\t\t\tinner = parse(outdent(token[5].replace(/^\\s*[>*+.-]/gm, '')));\n\t\t\tif (t==='>') { t = 'blockquote'; }\n\t\t\telse {\n\t\t\t\tt = t.match(/\\./) ? 'ol' : 'ul';\n\t\t\t\tinner = inner.replace(/^(.*)(\\n|$)/gm, '<li>$1</li>');\n\t\t\t}\n\t\t\tchunk = '<'+t+'>' + inner + '</'+t+'>';\n\t\t}\n\t\t// Images:\n\t\telse if (token[8]) {\n\t\t\tchunk = \"<img src=\\\"\" + (encodeAttr(token[8])) + \"\\\" alt=\\\"\" + (encodeAttr(token[7])) + \"\\\">\";\n\t\t}\n\t\t// Links:\n\t\telse if (token[10]) {\n\t\t\tout = out.replace('<a>', (\"<a href=\\\"\" + (encodeAttr(token[11] || links[prev.toLowerCase()])) + \"\\\">\"));\n\t\t\tchunk = flush() + '</a>';\n\t\t}\n\t\telse if (token[9]) {\n\t\t\tchunk = '<a>';\n\t\t}\n\t\t// Headings:\n\t\telse if (token[12] || token[14]) {\n\t\t\tt = 'h' + (token[14] ? token[14].length : (token[13][0]==='='?1:2));\n\t\t\tchunk = '<'+t+'>' + parse(token[12] || token[15]) + '</'+t+'>';\n\t\t}\n\t\t// `code`:\n\t\telse if (token[16]) {\n\t\t\tchunk = '<code>'+encodeAttr(token[16])+'</code>';\n\t\t}\n\t\t// Inline formatting: *em*, **strong** & friends\n\t\telse if (token[17] || token[1]) {\n\t\t\tchunk = tag(token[17] || '--');\n\t\t}\n\t\tout += prev;\n\t\tout += chunk;\n\t}\n\n\treturn (out + md.substring(last) + flush()).trim();\n}", "title": "" }, { "docid": "49abcb63fa23318526ccb6c16ec93025", "score": "0.5265893", "text": "function parse(elementOrHtml, rules, context, cleanUp) {\r\n wysihtml5.lang.object(currentRules).merge(defaultRules).merge(rules).get();\r\n \r\n context = context || elementOrHtml.ownerDocument || document;\r\n var fragment = context.createDocumentFragment(),\r\n isString = typeof(elementOrHtml) === \"string\",\r\n element,\r\n newNode,\r\n firstChild;\r\n \r\n if (isString) {\r\n element = wysihtml5.dom.getAsDom(elementOrHtml, context);\r\n } else {\r\n element = elementOrHtml;\r\n }\r\n \r\n while (element.firstChild) {\r\n firstChild = element.firstChild;\r\n element.removeChild(firstChild);\r\n newNode = _convert(firstChild, cleanUp);\r\n if (newNode) {\r\n fragment.appendChild(newNode);\r\n }\r\n }\r\n \r\n // Clear element contents\r\n element.innerHTML = \"\";\r\n \r\n // Insert new DOM tree\r\n element.appendChild(fragment);\r\n \r\n return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\r\n }", "title": "" }, { "docid": "7b783a3206b633eceb21f50d8cd95969", "score": "0.5257516", "text": "parseText(encodedStr) {\n var dom = this.textParser.parseFromString('<!doctype html><body>' + encodedStr, 'text/html')\n var decodedString = dom.body.textContent\n var dom2 = this.textParser.parseFromString('<!doctype html><body>' + decodedString, 'text/html')\n var decodedString2 = dom2.body.textContent\n return decodedString2\n }", "title": "" }, { "docid": "9f6f0b085d569d367ff4c841e4136193", "score": "0.52573246", "text": "function html2dom(html) {\r\n var div = document.createElement(\"div\");\r\n div.innerHTML = html;\r\n var domContent = div.firstChild;\r\n return domContent;\r\n }", "title": "" }, { "docid": "f49dbecf662daa6470de44f2ab5000a0", "score": "0.52370244", "text": "function mdf(html) {\n html = math(html)\n html = code(html)\n html = emstrong(html)\n return html\n }", "title": "" }, { "docid": "b4193a2426b80c72e6e5809ee180b070", "score": "0.52329606", "text": "get ast() {\n return this.parser.ast;\n }", "title": "" }, { "docid": "274a223017e34e3fa1eb68a80b5d948f", "score": "0.5230984", "text": "function html(text) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!text) return null;\n\n var _setup5 = setup(text, opts);\n\n var _setup6 = _slicedToArray(_setup5, 2);\n\n text = _setup6[0];\n opts = _setup6[1];\n return processor(opts).use(rehypeStringify).processSync(text).contents;\n}", "title": "" }, { "docid": "6518dee4934e29f53060ae096dfb40f5", "score": "0.5230712", "text": "function EVAL(ast, env) {\n return ast;\n}", "title": "" }, { "docid": "74704e305bbee452223d2ab12c40df02", "score": "0.52237976", "text": "function Parse() {\n var lexer = new Lexer();\n var ast = new AST(lexer);\n this.astCompiler = new ASTCompiler(ast);\n }", "title": "" }, { "docid": "c4aaf3c5f773bd4de5c6f7aff901f6b9", "score": "0.5215238", "text": "parse(code) {\n // parse code to an AST\n return {};\n }", "title": "" }, { "docid": "e0829f71f002f354ad0af7e12f289c60", "score": "0.5212342", "text": "function MDTOHTML(inp, out){\n\t// nodes\n\tvar node = ''\n\n\t// input text\n\tvar input_text = '\\n' + inp.value;\n\n\t// if text, then call\n\tif (input_text) {\n\n\t\t// Call Parent Tag Processor Function\n\t\tvar parentnodes = ParentRegex(input_text);\n\t\tfor (var i = 0; i < parentnodes.length; i++) {\n\t\t\tnode = node + InlineRegex(parentnodes[i]);\n\t\t}\n\t};\n\treturn node;\n\n}", "title": "" }, { "docid": "b52bb14cfaee127aa87c5cd17ecdd8ed", "score": "0.5204601", "text": "function decodeHTML(str) {\n return htmlDecoder(str, false);\n}", "title": "" }, { "docid": "d7c27885f47028c389430b41bc49898c", "score": "0.51883304", "text": "function createHTMLNodesFromString(htmlString) {\n var div = document.createElement(\"div\");\n div.innerHTML = htmlString;\n return div.childNodes;\n }", "title": "" }, { "docid": "1c17c48e056c697ad85a912577d01465", "score": "0.5183355", "text": "function parseHTML(domElement) {\n var result = '',\n arr = [];\n result += '<' + domElement.type;\n if (typeof domElement === 'string') {\n return result + '>';\n }\n for (var attr in domElement.attributes) {\n if (domElement.attributes.hasOwnProperty(attr)) {\n arr.push([attr, domElement.attributes[attr]]);\n }\n }\n arr.sort();\n if (!isEmpty(domElement.attributes)) {\n for (var i = 0; i < arr.length; i += 1) {\n result += ' ' + arr[i][0] + '=\"' + arr[i][1] + '\"';\n }\n }\n result += '>';\n return result;\n }", "title": "" }, { "docid": "9aee73db14a58b587aeb9d18b79153e5", "score": "0.5179356", "text": "function text2html2(source) {\n\tvar root = new ListTree(\"root\");\n\tvar child1 = new ListTree(\"child1\");\n\troot.addChild(child1);\n\tvar child2 = new ListTree(\"child2\");\n\troot.addChild(child2);\n\tvar result = root.toHTML();\n\t// console.log(JSON.stringify(root, null, '\\t'));\n\treturn result;\n}", "title": "" }, { "docid": "02722827d7c56eb8ec2a1d0ac634dc74", "score": "0.51729524", "text": "function mdToHTML(text){\n input = text\n //======== TITRES =========//\n .replace(/^#{1} (.*$)/gim, '<h1>$1</h1>')\n .replace(/^#{2} (.*$)/gim, '<h2>$1</h2>')\n .replace(/^#{3} (.*$)/gim, '<h3>$1</h3>')\n .replace(/^#{4} (.*$)/gim, '<h4>$1</h4>')\n .replace(/^#{5} (.*$)/gim, '<h5>$1</h5>')\n .replace(/^#{6} (.*$)/gim, '<h6>$1</h6>')\n\n //======== PARAGRAPHES =========//\n .replace(/^\\n\\n(.*)$/gim,'<p>$1</p>')\n\n //======== CITATIONS =========//\n .replace(/^\\> (.*$)/gim, '<blockquote>$1</blockquote>')\n\n //======== STYLE POLICE =========//\n .replace(/\\*{2}(.*)\\*{2}|\\_{2}(.*)\\_{2}/gim, '<strong>$1$2</strong>')\n .replace(/\\*{1}(.*)\\*{1}/gim, '<em>$1</em>')\n .replace(/\\_{1}(.*)\\_{1}/gim, '<em>$1</em>')\n .replace(/~~(.*)~~/gim, '<del>$1</del>')\n\n //======== IMAGES ET LIENS=========//\n .replace(/!\\[(.*?)\\]\\((.*?)\\)/gim, \"<img alt='$1' src='$2' />\")\n .replace(/\\[(.*?)\\]\\((.*?)\\)/gim, \"<a href='$2'>$1</a>\")\n\n //break & horizontal rule\n .replace(/\\n/gim, '<br />')\n .replace(/\\s{2}/gim, '<br />')\n .replace(/-{3,}/gim, '<hr />')\n \n //======== CODE(HTML-CSS-JS) =========//\n .replace(/\\`(.*)\\`/gim, '<code>$1</code>')\n return input.trim()\n}", "title": "" }, { "docid": "77257b09aa809353bf8f6bee1fbc8430", "score": "0.5169072", "text": "function htmlToDOM(html) {\n var template = document.createElement('template');\n html = html.trim();\n template.innerHTML = html;\n return template.content.firstChild;\n }", "title": "" }, { "docid": "f8539fb49273efd0abd1ddc2b6ee18b4", "score": "0.5164606", "text": "function ASTtoString(input, settings, indent = 0) {\n input.type;\n const transforms = {\n 'root': wrapper(\"\\n\", \"\"),\n 'paragraph': wrapper(\"\", \"\\n\"),\n 'emphasis': (a) => { return \"\\\\emph{\" + wrapper(\"\", \"\")(a, settings) + \"}\"; },\n 'strong': (a) => { return \"\\\\textbf{\" + wrapper(\"\", \"\")(a, settings) + \"}\"; },\n 'delete': (a) => { return \"\\\\st{\" + wrapper(\"\", \"\")(a, settings) + \"}\"; },\n 'footnote': (a) => { return \"\\\\footnote{\" + wrapper(\"\", \"\")(a, settings) + \"}\"; },\n 'list': list,\n 'listItem': (a) => { return \"\\t\".repeat(indent) + \"\\\\item \" + wrapper(\"\", \"\")(a, settings, indent); },\n 'heading': heading,\n 'wikiLink': internalLink,\n 'link': externalLink,\n 'code': codeBlock,\n 'inlineCode': inlineCode,\n 'inlineMath': inlineMath,\n 'math': displayMath,\n };\n const f = transforms[input.type] || defaultC;\n const trans = f(input, settings, indent);\n return trans;\n}", "title": "" }, { "docid": "c4b44c99d3b9875b660cb04dc1aefbf1", "score": "0.5163418", "text": "function faux_parse_HTML(html, depth) {\n\n\t\t!!depth || (depth = 0); \n\n\t\tif (depth == 0) {\n\t\t\tconsole.log('Source: ' + html + \"\\nElements to create:\");\n\t\t}\n\n\t\tvar matches = html.match(tag_finder);\n\n\t\tif (matches != null && matches.length >= 2) {\n\n\t\t\tconsole.log(\n\t\t\t\t\"\\t\".repeat(depth) + matches[1].toUpperCase()\n\t\t\t)\n\t\t\t\n\t\t\tfaux_parse_HTML(matches[2], ++depth);\n\t\t} \n\t}", "title": "" }, { "docid": "56a9956aa3bd236e888bded417c2f806", "score": "0.51569396", "text": "function convertHTML(str) {\n\n let arr = str.split(\"\");\n let resp = [];\n for (let i = 0; i < arr.length; i++) {\n switch (arr[i]) {\n case \"&\":\n resp.push(\"&amp;\");\n break;\n case \"<\":\n resp.push(\"&lt;\")\n break;\n case \">\":\n resp.push(\"&gt;\")\n break;\n case \"\\\"\":\n resp.push(\"&quot;\")\n break;\n case \"\\'\":\n resp.push(\"&apos;\")\n break;\n default:\n resp.push(arr[i])\n }\n }\n\n return resp.join(\"\")\n}", "title": "" }, { "docid": "ac925ea07c5dcd2627334df27a2129f9", "score": "0.51468694", "text": "function parse(elementOrHtml, rules, context, cleanUp) {\n\t\twysihtml5.lang.object(currentRules).merge(defaultRules).merge(rules).get();\n\n\t\tcontext = context || elementOrHtml.ownerDocument || document;\n\t\tvar fragment = context.createDocumentFragment(),\n\t\t\tisString = typeof(elementOrHtml) === \"string\",\n\t\t\telement,\n\t\t\tnewNode,\n\t\t\tfirstChild;\n\n\t\tif(isString) {\n\t\t\telement = wysihtml5.dom.getAsDom(elementOrHtml, context);\n\t\t} else {\n\t\t\telement = elementOrHtml;\n\t\t}\n\n\t\twhile(element.firstChild) {\n\t\t\tfirstChild = element.firstChild;\n\t\t\telement.removeChild(firstChild);\n\t\t\tnewNode = _convert(firstChild, cleanUp);\n\t\t\tif(newNode) {\n\t\t\t\tfragment.appendChild(newNode);\n\t\t\t}\n\t\t}\n\n\t\t// Clear element contents\n\t\telement.innerHTML = \"\";\n\n\t\t// Insert new DOM tree\n\t\telement.appendChild(fragment);\n\n\t\treturn isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\n\t}", "title": "" }, { "docid": "0c7ecc6e8297b2087719574728a75004", "score": "0.5123349", "text": "parseString(code) {\n let doc = Text.of(code.split(\"\\n\"));\n let parse = this.parser.startParse(new DocInput(doc), 0, new EditorParseContext(this.parser, EditorState.create({ doc }), [], Tree.empty, { from: 0, to: code.length }, [], null));\n let tree;\n while (!(tree = parse.advance())) { }\n return tree;\n }", "title": "" }, { "docid": "bbee30e98a48812c4262e6b4a16a2351", "score": "0.5101756", "text": "function fromHTML(editor, el, next) {\n return {\n object: 'block',\n type: 'clause',\n data: {},\n nodes: next(el.childNodes),\n };\n }", "title": "" }, { "docid": "55ef1f54aff19e5f33202bad27ad0012", "score": "0.51005757", "text": "function codeGen(AST)\n {\n function printTagOpen(node, attrMap)\n {\n if (!AST_HTML_MAP[node.type])\n {\n return \"\"; //These kinds of nodes don't have an HTML tag.\n }\n\n var tagName = AST_HTML_MAP[node.type];\n var openTagStr = \"<\" + tagName;\n\n if (node.isType(AST_ENUM.HEADER) && node.meta.HEADERLVL)\n {\n var h_lvl = node.meta.HEADERLVL + OPT.MIN_HEADER;\n openTagStr += (h_lvl > 6) ? \"6\" : (h_lvl + \"\");\n }\n\n if (attrMap)\n {\n for (var each in attrMap)\n {\n attrMap[each] = attrMap[each].substring(0, OPT.MAX_ATTR_CHARS);\n openTagStr += \" \" + each + \"=\\\"\" +\n str_encodeHTMLAttr(attrMap[each]) + \"\\\"\";\n }\n }\n\n if (AST_XHTML_MAP[node.type] && OPT.XHTML)\n {\n openTagStr += \"/\";\n }\n openTagStr += \">\";\n\n if (node.isType(AST_ENUM.CODE_BLOCK))\n {\n openTagStr += \"<code>\";\n }\n return openTagStr;\n }\n\n function printTagClose(node)\n {\n if (!AST_HTML_MAP[node.type])\n {\n return \"\";\n }\n\n var tagName = AST_HTML_MAP[node.type];\n if (node.isType(AST_ENUM.HEADER) && node.meta.HEADERLVL)\n {\n var h_lvl = node.meta.HEADERLVL + OPT.MIN_HEADER;\n tagName += (h_lvl > 6) ? \"6\" : (h_lvl + \"\");\n }\n if (node.isType(AST_ENUM.CODE_BLOCK))\n {\n return \"</code>\" + \"</\" + tagName + \">\";\n }\n return \"</\" + tagName + \">\";\n }\n\n function printText(node)\n {\n if (!(node instanceof ASTNode) || !node.meta.TEXT)\n {\n return \"\";\n }\n if (OPT.XHTML)\n { //If XHTML, encode \", ', and / as well\n return str_encodeHTML(node.meta.TEXT);\n }\n return str_encodeHTMLBody(node.meta.TEXT);\n }\n\n function printLink(node)\n {\n var url = node.meta.URL,\n isImg = node.isType(AST_ENUM.LINK_IMG),\n altText = node.meta.ALT, //alt text -> Image node.\n parent = node.parent,\n isParentLink = false;\n\n while (parent)\n {\n if (AST_LINK_MAP[parent.type])\n {\n isParentLink = true;\n }\n if (parent.meta.SYM_TABLE && parent.meta.SYM_TABLE[url])\n {\n url = parent.meta.SYM_TABLE[url];\n break;\n }\n parent = parent.parent;\n }\n\n if (node.isType(AST_ENUM.LINK_INT))\n {\n url = \"#\" + str_printCSSID(url, true);\n }\n\n if (isImg && REGEX_WS_ONLY.test(altText) && isParentLink)\n {\n altText = url;\n }\n\n var linkAttr = isImg ? {src : url, alt : altText} : {href : url};\n if (isImg)\n {\n return printTagOpen(node, linkAttr);\n }\n if (node.isType(AST_ENUM.LINK_WIKI))\n {\n linkAttr[\"class\"] = str_encodeCSS(OPT.CSS_WIKI);\n }\n\n if (node.getLength() > 0)\n {\n return printTagOpen(node, linkAttr) + printInline(node, linkAttr) +\n printTagClose(node);\n }\n return printTagOpen(node, linkAttr) + str_encodeHTMLBody(node.meta.URL) +\n printTagClose(node);\n }\n\n function printInline(node)\n {\n var cc = node.getLength(), ci = 0, middle = \"\";\n\n for (ci = 0; ci < cc; ci += 1)\n {\n var ch = node.children[ci];\n if (AST_LINK_MAP[ch.type])\n {\n middle += printLink(ch);\n }\n else if (AST_SPAN_MAP[ch.type])\n {\n middle += printTagOpen(ch) + printInline(ch) + printTagClose(ch);\n }\n else\n {\n middle += printText(ch);\n }\n }\n return middle;\n }\n\n function printDivLine(node, attrMap, lvl)\n {\n return (str_repeat(WS_STR, lvl) + printTagOpen(node, attrMap) + NL_STR);\n }\n\n function printBlock(node, attrMap, lvl, last)\n {\n var cc = node.getLength(),\n ci = 0,\n ch = null,\n middle = \"\",\n classes = null,\n chAttrTable = null,\n id = null,\n returnStr = \"\",\n open = printTagOpen(node, attrMap),\n close = printTagClose(node, attrMap),\n indent = str_repeat(WS_STR, lvl);\n\n for (ci = 0; ci < cc; ci += 1)\n {\n ch = node.children[ci];\n if (ch.isType(AST_ENUM.ID))\n {\n id = str_printCSSID(ch.meta.ID);\n continue;\n }\n else if (ch.isType(AST_ENUM.CLASS))\n {\n classes = classes ? classes : [];\n classes.push(ch.meta.ID);\n continue;\n }\n else\n {//Prepare attribute table. Clear id & class buffer.\n if (id || classes)\n {\n chAttrTable = Object.create(null);\n if (id)\n {\n chAttrTable.id = id;\n }\n if (classes)\n {\n chAttrTable[\"class\"] = str_printCSSClasses(classes, true);\n }\n }\n id = null;\n classes = null;\n }\n\n if (ch.isType(AST_ENUM.DIV_LINE))\n {\n middle += printDivLine(ch, attrMap, lvl);\n }\n else if (ch.isType(AST_ENUM.TEXT) || AST_SPAN_MAP[ch.type] ||\n AST_LINK_MAP[ch.type])\n {\n middle += printInline(node); //Let printInline enumerate this subtree.\n break;\n }\n else\n {\n middle += printBlock(ch, chAttrTable, lvl + 1, (ci === cc - 1));\n }\n chAttrTable = null;\n }\n\n if (node.isType(AST_ENUM.CODE_BLOCK))\n {\n returnStr = open + middle + close;\n }\n else if (node.isType(AST_ENUM.ROOT))\n {\n return middle;\n }\n else\n { //Alternatively, just trim trailing WS for the middle here.\n returnStr = indent + open + NL_STR + middle + NL_STR + indent + close;\n }\n\n if (!last)\n {\n returnStr += NL_STR;\n }\n return returnStr;\n }\n return printBlock(AST, null, -1, false);\n }", "title": "" }, { "docid": "a11e9c7b5018c4205c16b9b5c5fb7560", "score": "0.5098509", "text": "function convertHTML(str) {\n\n const escapeHTML = str => str.replace(/[&<>'\"]/g, \n tag => ({\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n \"'\": '&apos;',\n '\"': '&quot;'\n }[tag]));\n \n return escapeHTML(str);\n }", "title": "" }, { "docid": "9e062d4d8c22d2bdee74ecb0dd2bac7f", "score": "0.50864214", "text": "function buildHTML(tree, options) {\n // buildExpression is destructive, so we need to make a clone\n // of the incoming tree so that it isn't accidentally changed\n tree = JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(tree));\n\n // Build the expression contained in the tree\n var expression = buildExpression(tree, options, true);\n var body = makeSpan([\"base\"], expression, options);\n\n // Add struts, which ensure that the top of the HTML element falls at the\n // height of the expression, and the bottom of the HTML element falls at the\n // depth of the expression.\n var topStrut = makeSpan([\"strut\"]);\n var bottomStrut = makeSpan([\"strut\", \"bottom\"]);\n\n topStrut.style.height = body.height + \"em\";\n bottomStrut.style.height = body.height + body.depth + \"em\";\n // We'd like to use `vertical-align: top` but in IE 9 this lowers the\n // baseline of the box to the bottom of this strut (instead staying in the\n // normal place) so we use an absolute value for vertical-align instead\n bottomStrut.style.verticalAlign = -body.depth + \"em\";\n\n // Wrap the struts and body together\n var htmlNode = makeSpan([\"katex-html\"], [topStrut, bottomStrut, body]);\n\n htmlNode.setAttribute(\"aria-hidden\", \"true\");\n\n return htmlNode;\n}", "title": "" }, { "docid": "fcc596dca3b6751451c5ee97ab856c9b", "score": "0.5072834", "text": "function convertHTML(str) {\n const obj = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&apos;'\n };\n\n const reg = /[&<>\\\"\\']/g;\n\n return str.replace(reg, function (match) {\n return obj[match];\n });\n}", "title": "" }, { "docid": "763e78e393c2f33ffc6f1beefa404287", "score": "0.50601834", "text": "function parse() {\n grid = document.getElementById(\"grid\");\n var source = document.getElementById(\"markdown\").value.split('\\n');\n grid.innerHTML = \"\";\n\n for (var k = 0; k < source.length; k++) {\n if (k == 1) continue;\n tr = document.createElement(\"tr\");\n tr.id = \"r-\" + k;\n\n start = -1;\n end = -1;\n line = source[k];\n\n lookahead = nextSymbol();\n\n if (line[0] != '|') {\n line = line.insert(0, '| ');\n }\n if (line[line.length - 1] == '|') {\n line = line.substr(0, line.length - 1);\n }\n cell();\n\n grid.appendChild(tr);\n\n }\n }", "title": "" }, { "docid": "ef786a9b58d0765697e26dc077e84500", "score": "0.50593907", "text": "function buildDom(htmlString) {\n const div = document.createElement(\"div\");\n div.innerHTML = htmlString;\n return div.children[0];\n}", "title": "" }, { "docid": "7d20afd6c6bc457fac86bb687a9bc41b", "score": "0.5055941", "text": "function decodeHTML(html) {\n let $textarea = document.createElement('textarea');\n $textarea.innerHTML = html;\n return $textarea.value;\n}", "title": "" }, { "docid": "b6d9c21a2bb7f2aa9b5349faf03216e7", "score": "0.50517595", "text": "function buildDom(htmlString) {\n const div = document.createElement('div');\n div.innerHTML = htmlString;\n return div.children[0];\n}", "title": "" }, { "docid": "8f7efc8cfd0df54023ffca828de80ab8", "score": "0.5043908", "text": "function buildDom(htmlString) {\n const div = document.createElement(\"div\");\n div.innerHTML = htmlString;\n\n return div.children[0];\n}", "title": "" }, { "docid": "a57f34c91225105fab0e4888c993becb", "score": "0.5041763", "text": "function StringToDOM(html_string, return_first)\r\n{\r\n\tvar node = document.createElement(\"div\");\r\n\tnode.innerHTML = html_string;\r\n\tswitch (node.childNodes.length)\r\n\t{\r\n\t\tcase 0: return null;\r\n\t\tcase 1: return node.firstChild;\r\n\t\tdefault: return return_first ? node.firstChild : Array.prototype.slice.call(node.childNodes, 0);\r\n\t}\r\n}", "title": "" }, { "docid": "96c631d801a1f108d9b618f835ab84cc", "score": "0.5041517", "text": "function linkifyHtml(str) {\n\tvar opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\tvar tokens = _simpleHtmlTokenizer2.default.tokenize(str);\n\tvar linkifiedTokens = [];\n\tvar linkified = [];\n\tvar i;\n\n\topts = new Options(opts);\n\n\t// Linkify the tokens given by the parser\n\tfor (i = 0; i < tokens.length; i++) {\n\t\tvar token = tokens[i];\n\n\t\tif (token.type === StartTag) {\n\t\t\tlinkifiedTokens.push(token);\n\n\t\t\t// Ignore all the contents of ignored tags\n\t\t\tvar tagName = token.tagName.toUpperCase();\n\t\t\tvar isIgnored = tagName === 'A' || options.contains(opts.ignoreTags, tagName);\n\t\t\tif (!isIgnored) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar preskipLen = linkifiedTokens.length;\n\t\t\tskipTagTokens(tagName, tokens, ++i, linkifiedTokens);\n\t\t\ti += linkifiedTokens.length - preskipLen - 1;\n\t\t\tcontinue;\n\t\t} else if (token.type !== Chars) {\n\t\t\t// Skip this token, it's not important\n\t\t\tlinkifiedTokens.push(token);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Valid text token, linkify it!\n\t\tvar linkifedChars = linkifyChars(token.chars, opts);\n\t\tlinkifiedTokens.push.apply(linkifiedTokens, linkifedChars);\n\t}\n\n\t// Convert the tokens back into a string\n\tfor (i = 0; i < linkifiedTokens.length; i++) {\n\t\tvar _token = linkifiedTokens[i];\n\t\tswitch (_token.type) {\n\t\t\tcase StartTag:\n\t\t\t\t{\n\t\t\t\t\tvar link = '<' + _token.tagName;\n\t\t\t\t\tif (_token.attributes.length > 0) {\n\t\t\t\t\t\tvar attrs = attrsToStrings(_token.attributes);\n\t\t\t\t\t\tlink += ' ' + attrs.join(' ');\n\t\t\t\t\t}\n\t\t\t\t\tlink += '>';\n\t\t\t\t\tlinkified.push(link);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase EndTag:\n\t\t\t\tlinkified.push('</' + _token.tagName + '>');\n\t\t\t\tbreak;\n\t\t\tcase Chars:\n\t\t\t\tlinkified.push(escapeText(_token.chars));\n\t\t\t\tbreak;\n\t\t\tcase Comment:\n\t\t\t\tlinkified.push('<!--' + escapeText(_token.chars) + '-->');\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn linkified.join('');\n}", "title": "" }, { "docid": "96c631d801a1f108d9b618f835ab84cc", "score": "0.5041517", "text": "function linkifyHtml(str) {\n\tvar opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\tvar tokens = _simpleHtmlTokenizer2.default.tokenize(str);\n\tvar linkifiedTokens = [];\n\tvar linkified = [];\n\tvar i;\n\n\topts = new Options(opts);\n\n\t// Linkify the tokens given by the parser\n\tfor (i = 0; i < tokens.length; i++) {\n\t\tvar token = tokens[i];\n\n\t\tif (token.type === StartTag) {\n\t\t\tlinkifiedTokens.push(token);\n\n\t\t\t// Ignore all the contents of ignored tags\n\t\t\tvar tagName = token.tagName.toUpperCase();\n\t\t\tvar isIgnored = tagName === 'A' || options.contains(opts.ignoreTags, tagName);\n\t\t\tif (!isIgnored) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar preskipLen = linkifiedTokens.length;\n\t\t\tskipTagTokens(tagName, tokens, ++i, linkifiedTokens);\n\t\t\ti += linkifiedTokens.length - preskipLen - 1;\n\t\t\tcontinue;\n\t\t} else if (token.type !== Chars) {\n\t\t\t// Skip this token, it's not important\n\t\t\tlinkifiedTokens.push(token);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Valid text token, linkify it!\n\t\tvar linkifedChars = linkifyChars(token.chars, opts);\n\t\tlinkifiedTokens.push.apply(linkifiedTokens, linkifedChars);\n\t}\n\n\t// Convert the tokens back into a string\n\tfor (i = 0; i < linkifiedTokens.length; i++) {\n\t\tvar _token = linkifiedTokens[i];\n\t\tswitch (_token.type) {\n\t\t\tcase StartTag:\n\t\t\t\t{\n\t\t\t\t\tvar link = '<' + _token.tagName;\n\t\t\t\t\tif (_token.attributes.length > 0) {\n\t\t\t\t\t\tvar attrs = attrsToStrings(_token.attributes);\n\t\t\t\t\t\tlink += ' ' + attrs.join(' ');\n\t\t\t\t\t}\n\t\t\t\t\tlink += '>';\n\t\t\t\t\tlinkified.push(link);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase EndTag:\n\t\t\t\tlinkified.push('</' + _token.tagName + '>');\n\t\t\t\tbreak;\n\t\t\tcase Chars:\n\t\t\t\tlinkified.push(escapeText(_token.chars));\n\t\t\t\tbreak;\n\t\t\tcase Comment:\n\t\t\t\tlinkified.push('<!--' + escapeText(_token.chars) + '-->');\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn linkified.join('');\n}", "title": "" }, { "docid": "3021dde79bff979c4d9efb183f25601d", "score": "0.50400466", "text": "function transformer(ast) {\n return flatMap(ast, function (node) {\n if (node.tagName === 'table') {\n var _header$children, _header$children$, _body$children;\n\n var _node$children = _slicedToArray(node.children, 2),\n header = _node$children[0],\n body = _node$children[1]; // hAST tables are deeply nested with an innumerable amount of children\n // This is necessary to pullout all the relevant strings\n // Parse Header Values\n\n\n var headerChildren = (header === null || header === void 0 ? void 0 : (_header$children = header.children) === null || _header$children === void 0 ? void 0 : (_header$children$ = _header$children[0]) === null || _header$children$ === void 0 ? void 0 : _header$children$.children) || [];\n var headerValue = headerChildren.map(function (hc) {\n var _hc$children, _hc$children$;\n\n return (hc === null || hc === void 0 ? void 0 : (_hc$children = hc.children) === null || _hc$children === void 0 ? void 0 : (_hc$children$ = _hc$children[0]) === null || _hc$children$ === void 0 ? void 0 : _hc$children$.value) || '';\n }).join(' '); // Parse Body Values\n\n var bodyChildren = (body === null || body === void 0 ? void 0 : (_body$children = body.children) === null || _body$children === void 0 ? void 0 : _body$children.map(function (bc) {\n return bc === null || bc === void 0 ? void 0 : bc.children;\n }).reduce(function (a, b) {\n return a.concat(b);\n }, [])) || [];\n var bodyValue = bodyChildren.map(function (bc) {\n var _bc$children, _bc$children$;\n\n return (bc === null || bc === void 0 ? void 0 : (_bc$children = bc.children) === null || _bc$children === void 0 ? void 0 : (_bc$children$ = _bc$children[0]) === null || _bc$children$ === void 0 ? void 0 : _bc$children$.value) || '';\n }).join(' ');\n return [_objectSpread(_objectSpread({}, node), {}, {\n children: [_objectSpread(_objectSpread({}, node.children[0]), {}, {\n value: headerValue\n }), _objectSpread(_objectSpread({}, node.children[1]), {}, {\n value: bodyValue\n })]\n })];\n }\n\n return [node];\n });\n}", "title": "" }, { "docid": "1e75a11d2010c69276294da2509280f7", "score": "0.5033545", "text": "function toHAST(tree, options) {\n var h = factory(tree, options)\n var node = one(h, tree)\n var footnotes = footer(h)\n\n if (node && node.children && footnotes) {\n node.children = node.children.concat(u('text', '\\n'), footnotes)\n }\n\n return node\n}", "title": "" }, { "docid": "95b14c0e65222fa8806fe563f37bd018", "score": "0.50333023", "text": "function parse(input,options){return Parser.parse(input,options);}// This function tries to parse a single expression at a given", "title": "" }, { "docid": "7fe11bf5198cb5abde4fbd806b744de1", "score": "0.503028", "text": "function htmlToText(html) {\n var node = document.createElement('div');\n\n node.innerHTML = html;\n\n return domNodeToText(node);\n }", "title": "" }, { "docid": "22c9507dbe5492d9b129f03a791fb764", "score": "0.5028235", "text": "function toHAST(tree, options) {\n var h = factory(tree, options);\n var node = one(h, tree);\n var footnotes = footer(h);\n\n if (node && node.children && footnotes) {\n node.children = node.children.concat(u('text', '\\n'), footnotes);\n }\n\n return node;\n}", "title": "" }, { "docid": "bf7b8a12e431a35488ee8571893c995e", "score": "0.5019726", "text": "function convertHTML(str) {\n\n var amp = /&/g;\n var lt = /</g;\n var gt = />/g;\n var quot = /\"/g;\n var apos = /'/g;\n\n str = str.replace(amp, \"&amp;\");\n str = str.replace(lt, \"&lt;\");\n str = str.replace(gt, \"&gt;\");\n str = str.replace(quot, \"&quot;\");\n str = str.replace(apos, \"&apos;\");\n \n return str;\n}", "title": "" }, { "docid": "3206291b1a41eaa5071b6957fee93bf0", "score": "0.501934", "text": "decode(text){\n return new DOMParser().parseFromString(text,\"text/html\").documentElement.textContent;\n }", "title": "" }, { "docid": "c78d60812a61290ff610960534c7f2c5", "score": "0.501515", "text": "function nodeToAM(outnode) { \n if (HTMLArea.is_ie) {\n\t var str = outnode.innerHTML.replace(/\\`/g,\"\");\n\t var newAM = AMparseMath(str);\n\t outnode.innerHTML = newAM.innerHTML; \n } else {\n\t //doesn't work on IE, probably because this script is in the parent\n\t //windows, and the node is in the iframe. Should it work in Moz?\n var myAM = outnode.innerHTML; //next 2 lines needed to make caret\n outnode.innerHTML = myAM; //move between `` on Firefox insert math\n\t AMprocessNode(outnode);\n }\n \n}", "title": "" }, { "docid": "50caaf66a9c3c1922e23bbd7b5239f16", "score": "0.5013199", "text": "function make(str) {\n\treturn parse(TokenStream(InputStream(str)));\n}", "title": "" }, { "docid": "7890cb4ee8e6a1d05142bfed93c3ef41", "score": "0.50062543", "text": "function toHAST(tree, options) {\n\t var h = factory(tree, options);\n\t var node = one(h, tree);\n\t var footnotes = footer(h);\n\n\t if (node && node.children && footnotes) {\n\t node.children = node.children.concat(u('text', '\\n'), footnotes);\n\t }\n\n\t return node;\n\t}", "title": "" }, { "docid": "bfb57fef9ad6b828ccd143bc2b5bb026", "score": "0.49947378", "text": "function AST(lexer) {\n this.lexer_ = lexer;\n }", "title": "" }, { "docid": "ea0152a94801f060cb15b06b74c52317", "score": "0.4994305", "text": "function _parse_template2 (html, ps){\n _logger('parsing html:', html);\n }", "title": "" }, { "docid": "869bdbb34b190175c78706d42b5b67cd", "score": "0.49858794", "text": "function convertHTML(str) {\n const htmlEntities = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&apos;',\n };\n return str.replace(/([&<>\\\"'])/g, (match) => htmlEntities[match]);\n}", "title": "" }, { "docid": "fcddc3052ff94093aa2959a42b884db0", "score": "0.4984506", "text": "function buildDom(htmlString) {\n const tempDiv = document.createElement(\"div\");\n tempDiv.innerHTML = htmlString;\n\n const result = tempDiv.children[0];\n return result;\n}", "title": "" }, { "docid": "3306a6d905f70388fddd79959eb8397c", "score": "0.49696767", "text": "traverseAsAST(visitor) {\n return babel.traverse(this, visitor);\n }", "title": "" }, { "docid": "7be227faacf878889a626e2666cdd214", "score": "0.4969335", "text": "function decodeHTML (html)\n{\n let txt = document.createElement(\"textarea\");\n txt.innerHTML = html;\n return txt.value;\n}", "title": "" }, { "docid": "af068fe1fc52afb023e3b64e30f5312b", "score": "0.4968821", "text": "function convertToHtmlText(html) {\n let whitelist = ['a', 'ul', 'ol', 'li'];\n\n let normalizeListElementsRegexReplace1 = /<li>\\s*<p>\\s*/gi;\n let normalizeListElementsRegexReplacement1 = '<li>';\n let normalizeListElementsRegexReplace2 = /\\s*<\\/p>\\s*<\\/li>/gi;\n let normalizeListElementsRegexReplacement2 = '</li>';\n let normalizeListElementsRegexReplace3 = /<br \\/>\\s*<li>/gi\n let normalizeListElementsRegexReplacement3 = '<li>';\n let normalizeListElementsRegexReplace4 = /<br \\/><\\/ul>/gi\n let normalizeListElementsRegexReplacement4 = '</ul><br />';\n let normalizeListElementsRegexReplace5 = /<br \\/><ul>/gi\n let normalizeListElementsRegexReplacement5 = '<ul>';\n\n if (html != null) {\n html = html.replace(normalizeListElementsRegexReplace1, normalizeListElementsRegexReplacement1);\n html = html.replace(normalizeListElementsRegexReplace2, normalizeListElementsRegexReplacement2);\n }\n\n whitelist.forEach(element => {\n if (html != null) {\n html = cheerio.load(html.split('<' + element + '>')\n .join('{%' + element + '%}')\n .split('<' + element)\n .join('{%' + element)\n .split('</' + element + '>')\n .join('{%/' + element + '%}'), {\n normalizeWhitespace: true\n }).root().html();\n }\n });\n if (html != null) {\n html = cheerio.load(html, {\n normalizeWhitespace: true\n }).root().text();\n }\n whitelist.forEach(element => {\n if (html != null) {\n html = html.split('{%' + element + '%}')\n .join('<' + element + '>')\n .split('{%' + element)\n .join('<' + element)\n .split('{%/' + element + '%}')\n .join('</' + element + '>');\n }\n });\n if (html != null) {\n return html.trim()\n .split('\\n')\n .join('<br />')\n .replace(normalizeListElementsRegexReplace3, normalizeListElementsRegexReplacement3)\n .replace(normalizeListElementsRegexReplace4, normalizeListElementsRegexReplacement4)\n .replace(normalizeListElementsRegexReplace5, normalizeListElementsRegexReplacement5)\n .toString();\n }\n return \"\";\n}", "title": "" }, { "docid": "e473bd3e2ef60c787b8a21566e4e8dd9", "score": "0.4968574", "text": "function parse(input, options) {\n return Parser.parse(input, options);\n} // This function tries to parse a single expression at a given", "title": "" }, { "docid": "703ed66cbffbba34839debe23e263f4b", "score": "0.49481243", "text": "function Parse(text) {\n\tif (text === String.empty)\n\t\tthrow \"No input provided to parse\";\n\n\t// Case doesn't matter.\n\ttext = text.toLowerCase();\n\n\tvar textIter = text[Symbol.iterator]();\n\tvar next = textIter.next();\n\n\t//prevCh is used when we hit symbols which don't mean anything by themselves. Ex: '-' in <-> and ->\n\tvar prevCh = \"\",\n\t\tresult = {\n\t\t\tnodeType : \"\",\n\t\t\tchildren : []\n\t\t};\n\n\t// left is a flag that keeps track of which side of the operator we are on.\n\tvar left = true;\n\n\twhile(!next.done) {\n\t\tswitch (next.value) {\n\t\t\tcase \" \":\n\t\t\t\t// If we hit a space, move on.\n\t\t\t\tbreak;\n\n\t\t\tcase \"(\":\n\t\t\t\t// TODO: this could be handled a bit better by moving the iterator up in the scope.\n\n\t\t\t\t// When we hit a left parenthesis, get and parse the subexpression.\n\t\t\t\tnext = textIter.next();\n\t\t\t\t\n\t\t\t\tvar subexpression = \"\"; \n\t\t\t\tvar stack = [\"(\"];\n\n\t\t\t\twhile (stack.length > 0) {\n\n\t\t\t\t\tif (next.value === \"(\") {\n\t\t\t\t\t\tstack.push(next.value);\n\t\t\t\t\t}\n\t\t\t\t\telse if (next.value === \")\") {\n\t\t\t\t\t\tstack.pop();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (stack.length === 0)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tsubexpression += next.value;\n\t\t\t\t\tnext = textIter.next();\n\n\t\t\t\t}\n\n\t\t\t\t//Add the AST of the subexpression to the children of the result;\n\t\t\t\tvar newChild = Parse(subexpression);\n\t\t\t\tresult.children.push(newChild);\n\n\t\t\t\tbreak;\t\t\t\t\n\n\t\t\tcase \")\": \n\t\t\t\tthrow \"Unbalanced parenthesis\";\n\t\t\t\n\t\t\tcase \"v\":\n\t\t\t\tresult.nodeType = NODETYPE.OR;\n\t\t\t\tbreak;\n\n\t\t\tcase \"&\":\n\t\t\t\tresult.nodeType = NODETYPE.AND;\n\t\t\t\tbreak;\n\n\t\t\tcase \"#\":\n\t\t\t\tresult.nodeType = NODETYPE.XOR;\n\t\t\t\tbreak;\n\n\t\t\tcase \"-\":\n\n\t\t\t\t// prevCH is either the empty string or \"<\" at this point, so we add '-' to it's value;\t\t\n\t\t\t\tprevCh += next.value;\n\t\t\t\tbreak;\n\n\t\t\tcase \"<\":\n\n\t\t\t\t// prevCh should be empty here.\n\t\t\t\tprevCh = next.value;\n\t\t\t\tbreak;\n\n\t\t\tcase \">\":\n\n\t\t\t\tif(prevCh === \"-\") {\n\t\t\t\t\tresult.nodeType = NODETYPE.IMP;\n\t\t\t\t} else if (prevCh === \"<-\") {\n\t\t\t\t\tresult.nodeType = NODETYPE.BIIMP;\n\t\t\t\t} else {\n\t\t\t\t\tthrow \"Invalid synmbol :\" + prevCH;\n\t\t\t\t}\n\n\t\t\t\tprevCh = \"\";\n\n\t\t\t\tbreak;\n\t\t\tcase \"~\":\n\t\t\t\tresult.nodeType = NODETYPE.NOT;\n\t\t\t\tbreak;\n\n\t\t\t// Default case is when we hit an \"atom\" which is any lowercase letter except 'v'.\n\t\t\tdefault :\n\n\t\t\t\tvar atom = {\n\t\t\t\t\tnodeType : NODETYPE.ATOM,\n\t\t\t\t\tlabel : next.value\n\t\t\t\t};\n\n\t\t\t\tresult.children.push(atom);\n\t\t}\n\t\t\n\t\tnext = textIter.next();\n\t}\n\n\n\treturn OptimizeRoot(result);\n}", "title": "" }, { "docid": "c42b91e12a269473bf20a30ffd8ccd6b", "score": "0.4945419", "text": "function wrapper(ast, options) {\n var settings = options || {};\n var file;\n\n if (settings.messages) {\n file = settings;\n settings = {};\n } else {\n file = settings.file;\n }\n\n return transform(ast, {\n schema: settings.space === 'svg' ? svg : html,\n file: file,\n verbose: settings.verbose,\n location: false\n });\n} // Transform a node.", "title": "" }, { "docid": "1ea013fb89f1b381189687466d7df4da", "score": "0.49447927", "text": "function ParseTreeVisitor() {\n }", "title": "" }, { "docid": "b91429d7cb4ebbdca599a38452539249", "score": "0.49396855", "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={type:1,tag:tag,attrsList:attrs,attrsMap:makeAttrsMap(attrs),parent:currentParent,children:[]};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++){preTransforms[i](element,options);}if(!inVPre){processPre(element);if(element.pre){inVPre=true;}}if(platformIsPreTag(element.tag)){inPre=true;}if(inVPre){processRawAttrs(element);}else{processFor(element);processIf(element);processOnce(element);processKey(element);// determine whether this is a plain element after\n// removing structural attributes\nelement.plain=!element.key&&!attrs.length;processRef(element);processSlot(element);processComponent(element);for(var i$1=0;i$1<transforms.length;i$1++){transforms[i$1](element,options);}processAttrs(element);}function checkRootConstraints(el){if(true){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 if(true){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$2=0;i$2<postTransforms.length;i$2++){postTransforms[i$2](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(true){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": "b429587c998c9e8fe9f38af62f5663ce", "score": "0.49393445", "text": "interpret() {\n this.toInterpret = this.editor.value;\n this.interpreted = this.md2html();\n this.showInterpreted();\n }", "title": "" }, { "docid": "8fdcef4e1027283d2dc86aa39b5e34d9", "score": "0.49312526", "text": "parse(str){\n let C = this.C;\n str = this._fixStr(str);\n this.tagName = str.split(C.SPACECHAR).shift().toLowerCase();\n let propsArr = this._parseProps(str);\n this._props = propsArr;\n this._assignProps(propsArr);\n }", "title": "" }, { "docid": "8a8e3ed5a8c0d33ffcda75481e30d47b", "score": "0.4928351", "text": "parse(src) {\n this.inlineLexer = new InlineLexer(src.links, this.options);\n // use an InlineLexer with a TextRenderer to extract pure text\n this.inlineTextLexer = new InlineLexer(\n src.links,\n merge({}, this.options, { renderer: new TextRenderer() }),\n );\n this.tokens = src.reverse();\n\n let out = ''\n while (this.next()) {\n out += this.tok();\n }\n\n return out;\n }", "title": "" }, { "docid": "af0746d80beee402eded08a5f2522aeb", "score": "0.4928055", "text": "function render(text) {\n return evalContext(this.ast, this.context, this.module);\n }", "title": "" }, { "docid": "f1f757eae7c783a2ff291b0f6dc5b158", "score": "0.49266383", "text": "function parse(template,options){warn$1=options.warn||baseWarn;platformGetTagNamespace=options.getTagNamespace||no;platformMustUseProp=options.mustUseProp||no;platformIsPreTag=options.isPreTag||no;preTransforms=pluckModuleFunction(options.modules,'preTransformNode');transforms=pluckModuleFunction(options.modules,'transformNode');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;parseHTML(template,{expectHTML:options.expectHTML,isUnaryTag:options.isUnaryTag,isFromDOM:options.isFromDOM,shouldDecodeTags:options.shouldDecodeTags,shouldDecodeNewlines:options.shouldDecodeNewlines,start:function start(tag,attrs,unary){// check namespace.\n\t// inherit parent ns if there is one\n\tvar ns=currentParent&&currentParent.ns||platformGetTagNamespace(tag);// handle IE svg bug\n\t/* istanbul ignore if */if(options.isIE&&ns==='svg'){attrs=guardIESVGBug(attrs);}var element={type:1,tag:tag,attrsList:attrs,attrsMap:makeAttrsMap(attrs),parent:currentParent,children:[]};if(ns){element.ns=ns;}if(\"client\"!=='server'&&isForbiddenTag(element)){element.forbidden=true;\"development\"!=='production'&&warn$1('Templates should only be responsible for mapping the state to the '+'UI. Avoid placing tags with side-effects in your templates, such as '+\"<\"+tag+\">.\");}// apply pre-transforms\n\tfor(var i=0;i<preTransforms.length;i++){preTransforms[i](element,options);}if(!inVPre){processPre(element);if(element.pre){inVPre=true;}}if(platformIsPreTag(element.tag)){inPre=true;}if(inVPre){processRawAttrs(element);}else{processFor(element);processIf(element);processOnce(element);// determine whether this is a plain element after\n\t// removing structural attributes\n\telement.plain=!element.key&&!attrs.length;processKey(element);processRef(element);processSlot(element);processComponent(element);for(var i$1=0;i$1<transforms.length;i$1++){transforms[i$1](element,options);}processAttrs(element);}function checkRootConstraints(el){if(true){if(el.tag==='slot'||el.tag==='template'){warn$1(\"Cannot use <\"+el.tag+\"> as component root element because it may \"+'contain multiple nodes:\\n'+template);}if(el.attrsMap.hasOwnProperty('v-for')){warn$1('Cannot use v-for on stateful component root element because '+'it renders multiple elements:\\n'+template);}}}// tree management\n\tif(!root){root=element;checkRootConstraints(root);}else if(\"development\"!=='production'&&!stack.length&&!warned){// allow 2 root elements with v-if and v-else\n\tif(root.attrsMap.hasOwnProperty('v-if')&&element.attrsMap.hasOwnProperty('v-else')){checkRootConstraints(element);}else{warned=true;warn$1(\"Component template should contain exactly one root element:\\n\\n\"+template);}}if(currentParent&&!element.forbidden){if(element.else){processElse(element,currentParent);}else{currentParent.children.push(element);element.parent=currentParent;}}if(!unary){currentParent=element;stack.push(element);}// apply post-transforms\n\tfor(var i$2=0;i$2<postTransforms.length;i$2++){postTransforms[i$2](element,options);}},end:function end(){// remove trailing whitespace\n\tvar element=stack[stack.length-1];var lastNode=element.children[element.children.length-1];if(lastNode&&lastNode.type===3&&lastNode.text===' '){element.children.pop();}// pop stack\n\tstack.length-=1;currentParent=stack[stack.length-1];// check pre state\n\tif(element.pre){inVPre=false;}if(platformIsPreTag(element.tag)){inPre=false;}},chars:function chars(text){if(!currentParent){if(\"development\"!=='production'&&!warned){warned=true;warn$1('Component template should contain exactly one root element:\\n\\n'+template);}return;}text=inPre||text.trim()?decodeHTMLCached(text)// only preserve whitespace if its not right after a starting tag\n\t:preserveWhitespace&&currentParent.children.length?' ':'';if(text){var expression;if(!inVPre&&text!==' '&&(expression=parseText(text,delimiters))){currentParent.children.push({type:2,expression:expression,text:text});}else{currentParent.children.push({type:3,text:text});}}}});return root;}", "title": "" } ]
e2af46556b1d78e3d0691428e6f9f6dd
what to do on hover (with intent)
[ { "docid": "c74b326e09229b12bb8f15e8d6695431", "score": "0.0", "text": "function mouseIn(event) {\r\n // change fill, store old fill in temp, bring up tooltip\r\n // if color is #333333 then zip has no relevant data, so do nothing\r\n if ($(this).css(\"fill\") != \"#eeeeee\") {\r\n d3.select(this).transition().style(\"fill\",highlight);\r\n\tvar zip = $(this).attr(\"zip\");\r\n\tcolorPoint(zip,highlight);\r\n $(\"#tooltip\").fadeIn(150);\r\n $('#tooltip').css({\r\n left: event.pageX,\r\n top: event.pageY\r\n });\r\n $(\"#tooltip-zip\").text($(this).attr(\"id\"));\r\n $(\"#tooltip-complaints\").text(pdata[$(this).attr(\"id\")][active_complaint]);\r\n\t$(\".tooltip-dem-label\").remove();\r\n\t$(\".tooltip-dem\").remove();\r\n\t$(\"br\").remove();\r\n\tfor (d in demographics) {\r\n\t $(\"#tooltip-data\").append(\r\n\t\t\"<br><p class='tooltip-dem-label'>\" + demographics[d] + \": </p>\" +\r\n\t\t \"<p class='tooltip-dem'>\" +\r\n\t\t pdata[$(this).attr(\"id\")][demographics[d]] +\r\n\t\t \"</p\")\r\n\t}\r\n }\r\n}", "title": "" } ]
[ { "docid": "c66d34ab415b43e71620bc7993479af5", "score": "0.7348828", "text": "function hovering() {\n\n}", "title": "" }, { "docid": "d58f0fa3fd8f54097d5e79801cfa21fa", "score": "0.7160468", "text": "hover(c)\n {\n }", "title": "" }, { "docid": "3891699c4413fd63a882557cf0d7897a", "score": "0.71575904", "text": "hover(item, monitor){\n //monitor.isOver() ? setShow(true) : setShow(false);\n }", "title": "" }, { "docid": "cdea9e5f0884a45654a54055ef548922", "score": "0.7112597", "text": "function onHover() {\n setHover(!hover);\n }", "title": "" }, { "docid": "d0a5bb5c1a6da65ed71b50874828df12", "score": "0.70207494", "text": "onHoverStart() {\n\n }", "title": "" }, { "docid": "e9f31df349a509a99bf18fac7e713da4", "score": "0.6896281", "text": "function hover() {\n\t\tmouseOver = true;\n\t\ttekst.style.display = \"block\";\n\t\ttekst.style.color = \"white\";\n\t\ttekst.style.marginTop = \"100px\";\n\t\t}", "title": "" }, { "docid": "8fed0d0e0ae1711134dd67bf8b2b769f", "score": "0.6846683", "text": "function hover(obj) { obj.style.color = \"red\"; }", "title": "" }, { "docid": "cd610c23d6cf944bfb068de62b0ea982", "score": "0.68129206", "text": "showHoverEffect() {\n this._boundingRect.showHoverEffect();\n }", "title": "" }, { "docid": "1a6131830815ee232fc7b3f808f92891", "score": "0.6795392", "text": "hoverOver() {\n alert(\"Oh boy!\")\n }", "title": "" }, { "docid": "4efe19ac09169515c15e8daa7739e954", "score": "0.6775065", "text": "function hover(element) {\n //console.log(element);\n}", "title": "" }, { "docid": "1005049abdcf97e4ad230cc65152bce3", "score": "0.6743579", "text": "function hovercheck(sign){\n if (sign === 1){hovered();}\n if (sign === -1){touched();}\n }", "title": "" }, { "docid": "7a7209bd24181c28d88fc1ddf2e982dc", "score": "0.6706316", "text": "function mouseover(){\n tooltip.transition()\n .duration(200)\n .style(\"opacity\", .9);\n }", "title": "" }, { "docid": "6932b9e15c36db3f23b6baa997fe9c39", "score": "0.6706227", "text": "simulateHover(point) {\r\n this.i.jl(toPoint(point));\r\n }", "title": "" }, { "docid": "28f631a49185eae35fa09580d1f2b291", "score": "0.66873425", "text": "onHoverEnd() {\n\n }", "title": "" }, { "docid": "1ac539b2f4950d129357e32e5f2752fe", "score": "0.6680707", "text": "function on_mouseoverLabel() {\n\t\td3.select(this).classed(\"hover\", true);\n\t}", "title": "" }, { "docid": "2a3b1db4a30d9ce56edf37aaad697a8f", "score": "0.66780907", "text": "function hover() {\n const { id, manager } = this;\n\n manager.highlightNode(id);\n}", "title": "" }, { "docid": "cbdead8a333de575167384256f940ab8", "score": "0.66617244", "text": "function hover(ito) {\n\tito.style.backgroundColor = \"gray\";\n}", "title": "" }, { "docid": "9050192571b81283c6f54896179e565a", "score": "0.66364694", "text": "function showHoverSkill() {\n $('.skill-icon').hover(function() {\n $(this).css({\n 'opacity':0.5,\n 'cursor': 'pointer'\n });\n }, function() {\n $(this).css({\n 'opacity': 1\n });\n });\n}", "title": "" }, { "docid": "7ff520a27b37e86232f68a53fc09a837", "score": "0.66179365", "text": "function hoverEffects() {\n\t\tthis.graphic.on(\"mouseover\", function() {\n\t\t\tthis.hovering = !this.hovering;\n\t\t\tthis.info.visible = !this.info.visible;\n\t\t});\n\t\tthis.graphic.on(\"mouseout\", function() {\n\t\t\tthis.hovering = !this.hovering;\n\t\t\tthis.info.visible = !this.info.visible;\n\t\t});\n\t}", "title": "" }, { "docid": "a92e5803734d4473bd8f074eea36b70b", "score": "0.65783954", "text": "_hoverCallback() {\n this._hovered = true;\n }", "title": "" }, { "docid": "a3f8948c5d748d1b55e934fa15c76676", "score": "0.6535352", "text": "_hoverCallback() {\n this.hovered = true;\n }", "title": "" }, { "docid": "73181f9b17edf8ea4474ae0cad755f32", "score": "0.64850104", "text": "function mouseover() {\n focus.style(\"opacity\", 1)\n tooltip\n .style(\"opacity\", 1)\n }", "title": "" }, { "docid": "2bbd837cf4c0b0a2027a8e85202acf7d", "score": "0.646767", "text": "function hover(){\n\t\tif ( movable(this.id) ) {\n\t\t\tthis.style.borderColor = \"red\";\t\n\t\t\tthis.style.cursor = \"pointer\";\n\t\t}\n\t}", "title": "" }, { "docid": "58b20b2110836df020edf07bf1dac4d4", "score": "0.6465356", "text": "function p1_mouseOver( e ) { e.srcElement.style.cursor = \"Pointer\";\t}", "title": "" }, { "docid": "58b20b2110836df020edf07bf1dac4d4", "score": "0.6465356", "text": "function p1_mouseOver( e ) { e.srcElement.style.cursor = \"Pointer\";\t}", "title": "" }, { "docid": "b08b6521bca9c74ba11cd9afc81b0c95", "score": "0.64645", "text": "showStatesHover(){\n const statesTxt =`[IsIcon_hp]${this.hp}/${this.mhp}`\n this.statesTxt.computeTag(statesTxt);\n this.statesTxt.pivot.x = this.statesTxt.width/2;\n this.statesTxt._filters = [$systems.filtersList.OutlineFilterx4Black];\n const zero = this.statesTxt.pivot.zero;\n TweenLite.to(this.statesTxt.pivot, 0.4, { y:zero.y+this.statesTxt.height, ease: Expo.easeOut });\n TweenLite.to(this.statesTxt, 0.4, { alpha:1, ease: Expo.easeOut });\n \n }", "title": "" }, { "docid": "ed359079f62b2f88e5acc725ebb8a0c5", "score": "0.646422", "text": "function p2_mouseOver( e ) { e.srcElement.style.cursor = \"Pointer\";\t}", "title": "" }, { "docid": "ed359079f62b2f88e5acc725ebb8a0c5", "score": "0.646422", "text": "function p2_mouseOver( e ) { e.srcElement.style.cursor = \"Pointer\";\t}", "title": "" }, { "docid": "6250af706d1f2978c3f3bc0d2dd382ce", "score": "0.6456499", "text": "function onMouseOver(e,d,i) {\n\n }", "title": "" }, { "docid": "c02bbe9304b7828fcb2532196d4c5d36", "score": "0.6440594", "text": "function hover() {\n\t\tif (movable(this)) {\n\t\t\tthis.classList.add(\"hover\");\n\t\t}\n\t}", "title": "" }, { "docid": "cadfdf47a6fc15abc94545f5225f8d25", "score": "0.6419505", "text": "function registerHoverBehav() {\n\t\t\t$('#markContainer').hover(function() {\n\t\t\t\twTL.restart();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "263fd979fefbe147df0e82aa0b6372c5", "score": "0.64180875", "text": "function hover()\r\n\t{\r\n\t\tif ( movable(this.id) ) \r\n\t\t{\r\n\t\t\tthis.style.borderColor = \"red\";\t\r\n\t\t\tthis.style.cursor = \"pointer\";\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "427b9d7dd8cc2dd6fcda434a8ea7260f", "score": "0.64169115", "text": "function handleMouseOver(d, i) { // Add interactivity\n\n // Use D3 to select element, change color and size\n d3.select(this).attr({\n r: 5\n });\n\n var letter = d.letter;\n if(d.letter.endsWith('**')) {\n letter = d.letter.substring(0, d.letter.length - 2);\n }\n // Specify where to put label of text\n d3.selectAll(\"#scatter_\" + letter.replace(/\\s+/g, '_')).attr(\"class\", \"scattertext_hover\");\n }", "title": "" }, { "docid": "01fe09ac1a45d79013b570e49e981c99", "score": "0.64154816", "text": "function handleInspectHover(e) {\n\n e.stopImmediatePropagation();\n\n // position the highlight.\n positionHighlight(e.target);\n }", "title": "" }, { "docid": "1f60beff0089d79ed54389b331934ff2", "score": "0.64044094", "text": "static featureHover(e) {\n // TODO Make these settings available to change in the settings screen\n e.target.setStyle({\n weight: 2,\n color: '#efefef',\n dashArray: '',\n });\n\n // Checks the browser type\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n e.target.bringToFront();\n }\n }", "title": "" }, { "docid": "604bf0720219e840b1dc798c78bf3563", "score": "0.6403001", "text": "function chartHover(event) {\n\tconst id = getSkillsChartEventId(event);\n\n\t// Akin to a skill point mouseLeave event, so show the last clicked skill card\n\tif(!id) {\n\t\tshowSkillsCard(lastClickedSkillId);\n\t\treturn;\n }\n\n\t// If a skill other than the one last clicked is being hovered, show that card\n\tif(lastClickedSkillId.localeCompare(id) != 0) {\n\t\tshowSkillsCard(id);\n\t}\n}", "title": "" }, { "docid": "8186d4851f119583f9f491346d273346", "score": "0.64012235", "text": "function hover() {\n alert(\"Settime\");\n \n}", "title": "" }, { "docid": "2930128fe1b4ff6549c6f14ef6c6ef82", "score": "0.63961536", "text": "function eventHover(event) {\n var proposal = calcPointToPercentage(event.calcPoint);\n var to = scope_Spectrum.getStep(proposal);\n var value = scope_Spectrum.fromStepping(to);\n Object.keys(scope_Events).forEach(function (targetEvent) {\n if (\"hover\" === targetEvent.split(\".\")[0]) {\n scope_Events[targetEvent].forEach(function (callback) {\n callback.call(scope_Self, value);\n });\n }\n });\n }", "title": "" }, { "docid": "c182dbc851e96e03a2abd12d027af18e", "score": "0.6394666", "text": "function onMouseOver(e) {\n\t//console.log(this.options.title); //return the title of the marker being moused over\n\tvar mID = '#'.concat(this.options.title); //construct the needed ID selector \n\t//console.log(mID);\n\t$(mID).toggleClass('hover');\n}", "title": "" }, { "docid": "cd14201c4ce39f9675efe1edb9c3ef15", "score": "0.638151", "text": "function hovered(){\n\tthis.style.background = HOVER_BG;\n\tthis.style.color = HOVER_TEXT;\n}", "title": "" }, { "docid": "7f995d8f0aeadf946990aa50024f5646", "score": "0.63775784", "text": "async hover(retry = RETRY_COUNT) {\n this.log('[HOVR] ' + this.elementName)\n return (await this.element(retry)).hover()\n }", "title": "" }, { "docid": "dfcb3cc7b6fb8377bad3e51f0aabfc41", "score": "0.6368025", "text": "hover() {\n this.y -= 5;\n }", "title": "" }, { "docid": "73dabd4a4403bc3f22b7b1b69f42085e", "score": "0.6360697", "text": "function mouseEnterHover(e) {\n e.target.querySelector(\".img-text\").classList.add(\"open\");\n}", "title": "" }, { "docid": "2f520a552a6161e31e9f5275a2dc10e5", "score": "0.63550276", "text": "function eventHover(event) {\n var proposal = calcPointToPercentage(event.calcPoint);\n var to = scope_Spectrum.getStep(proposal);\n var value = scope_Spectrum.fromStepping(to);\n Object.keys(scope_Events).forEach(function (targetEvent) {\n if (\"hover\" === targetEvent.split(\".\")[0]) {\n scope_Events[targetEvent].forEach(function (callback) {\n callback.call(scope_Self, value);\n });\n }\n });\n }", "title": "" }, { "docid": "6b8c7ed6db9b40f49e02b6cb08a9bfdf", "score": "0.63422567", "text": "function p4_mouseOver( e ) { e.srcElement.style.cursor = \"Pointer\"; }", "title": "" }, { "docid": "6b8c7ed6db9b40f49e02b6cb08a9bfdf", "score": "0.63422567", "text": "function p4_mouseOver( e ) { e.srcElement.style.cursor = \"Pointer\"; }", "title": "" }, { "docid": "9815839a2bc42a006af7c94436306add", "score": "0.63387746", "text": "function mouseover() {\n d3.select(this).select(\"circle\").transition()\n .duration(500)\n .attr(\"r\", 16);\n d3.select(this).select(\"text\").transition()\n .duration(500)\n .attr(\"x\", 13)\n .style(\"stroke-width\", \".5px\")\n .style(\"font\", options.clickTextSize + \"px serif\")\n .style(\"opacity\", 1);\n }", "title": "" }, { "docid": "3518aa0e598b7d99e5f5cc73ea45a196", "score": "0.63346183", "text": "function eventHover ( event ) {\n\n var proposal = calcPointToPercentage(event.calcPoint);\n\n var to = scope_Spectrum.getStep(proposal);\n var value = scope_Spectrum.fromStepping(to);\n\n Object.keys(scope_Events).forEach(function( targetEvent ) {\n if ( 'hover' === targetEvent.split('.')[0] ) {\n scope_Events[targetEvent].forEach(function( callback ) {\n callback.call( scope_Self, value );\n });\n }\n });\n }", "title": "" }, { "docid": "f7340a9546b897d19e7e72322db58a31", "score": "0.6330657", "text": "function hoverEntryListener(){\n this.style.cursor = \"pointer\";\n this.style.transform = \"translateY(-2px)\";\n }", "title": "" }, { "docid": "618c20d817203ee000b50fa1f1e69846", "score": "0.63248694", "text": "handleMouseOver() {\n this.showBubble();\n }", "title": "" }, { "docid": "03fcb8c5d518c32ebdafa83b81de05dc", "score": "0.63077784", "text": "function hover ( event ) {\n\t\n\t\t\t\tvar location = event.calcPoint - offset(scope_Base)[ options.style ],\n\t\t\t\t\tto = scope_Spectrum.getStep(( location * 100 ) / baseSize()),\n\t\t\t\t\tvalue = scope_Spectrum.fromStepping( to );\n\t\n\t\t\t\tObject.keys(scope_Events).forEach(function( targetEvent ) {\n\t\t\t\t\tif ( 'hover' === targetEvent.split('.')[0] ) {\n\t\t\t\t\t\tscope_Events[targetEvent].forEach(function( callback ) {\n\t\t\t\t\t\t\tcallback.call( scope_Self, value );\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "931cec588a776a64b48e2a8fc332970b", "score": "0.6306963", "text": "drawHoverCursor() {}", "title": "" }, { "docid": "979bb197335472874e8ad6267e248fe5", "score": "0.63047034", "text": "function rrules_rule_hover() {\n var description_html = \"\";\n var description = $(this).attr(\"data-rule-desc\").split('\\\\n');\n\n $.each(description, function (index, value) {\n description_html = description_html + '<div>' + value + '</div>'\n });\n\n // Show the Rule id and name of the hovered Rule\n $(\".rrules_rule_info_name\").text($(this).find(\".rrules_rule_name\").text()).addClass(\"on\");\n $(\".rrules_rule_hint\").html(description_html);\n}", "title": "" }, { "docid": "78938a1cd80b66278f232560ba26f6e2", "score": "0.6296706", "text": "function handleHover(centered, d){\n mediumlightBar(mapObj[d.properties.ID].realname);\n}", "title": "" }, { "docid": "8af6be85e715345a9b4a8fc104c07b97", "score": "0.6281925", "text": "function highlightOther(point){\n for (i = 0; i < Highcharts.charts.length; i++) {\n if (point.type === 'mouseOver'){\n Highcharts.charts[i].series[0].data[point.target.index].setState('hover');\n } else {\n Highcharts.charts[i].series[0].data[point.target.index].setState();\n }\n }\n }", "title": "" }, { "docid": "4c213a4633ad27e347c7961787a890d1", "score": "0.62731653", "text": "onOver () {\r\n this.setState({hover: true});\r\n }", "title": "" }, { "docid": "4a8ec147c217e030672c7ead5b6a9f61", "score": "0.6272367", "text": "hover(c)\n {\n for (let i = 0; i < this.buttons.length; i++)\n {\n this.buttons[i].hover(c);\n }\n\n this.exitbutton.hover(c);\n }", "title": "" }, { "docid": "1754502eebfaf33861bf11a38a116896", "score": "0.6271278", "text": "function eventHover ( event ) {\r\n\r\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\r\n\r\n\t\tvar to = scope_Spectrum.getStep(proposal);\r\n\t\tvar value = scope_Spectrum.fromStepping(to);\r\n\r\n\t\tObject.keys(scope_Events).forEach(function( targetEvent ) {\r\n\t\t\tif ( 'hover' === targetEvent.split('.')[0] ) {\r\n\t\t\t\tscope_Events[targetEvent].forEach(function( callback ) {\r\n\t\t\t\t\tcallback.call( scope_Self, value );\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "1754502eebfaf33861bf11a38a116896", "score": "0.6271278", "text": "function eventHover ( event ) {\r\n\r\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\r\n\r\n\t\tvar to = scope_Spectrum.getStep(proposal);\r\n\t\tvar value = scope_Spectrum.fromStepping(to);\r\n\r\n\t\tObject.keys(scope_Events).forEach(function( targetEvent ) {\r\n\t\t\tif ( 'hover' === targetEvent.split('.')[0] ) {\r\n\t\t\t\tscope_Events[targetEvent].forEach(function( callback ) {\r\n\t\t\t\t\tcallback.call( scope_Self, value );\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "1754502eebfaf33861bf11a38a116896", "score": "0.6271278", "text": "function eventHover ( event ) {\r\n\r\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\r\n\r\n\t\tvar to = scope_Spectrum.getStep(proposal);\r\n\t\tvar value = scope_Spectrum.fromStepping(to);\r\n\r\n\t\tObject.keys(scope_Events).forEach(function( targetEvent ) {\r\n\t\t\tif ( 'hover' === targetEvent.split('.')[0] ) {\r\n\t\t\t\tscope_Events[targetEvent].forEach(function( callback ) {\r\n\t\t\t\t\tcallback.call( scope_Self, value );\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "fe452e6d31557ce526d9290519310886", "score": "0.6259807", "text": "function addHoverEffects(){\n $('.place').hover(function(){\n console.log($('.place').data()); \n})}", "title": "" }, { "docid": "6bd7f4ebab74f825acf780ddc5e435c0", "score": "0.6258938", "text": "function showHover(event){\n if (this.classList.contains('selected')) {\n return;\n } else {\n this.classList.add('hover');\n }\n }", "title": "" }, { "docid": "2c600c8f8260bb9499d6b8fab1e40c6e", "score": "0.6254131", "text": "function makeHover(e){\n\te.classList.toggle(\"hover\");\n}", "title": "" }, { "docid": "fac3daf0e2c83cc1fe64aff7599b44bd", "score": "0.6247984", "text": "onPointHover(obj, mouse) {\n let index = pointList.indexOf(obj),\n tweet = tweets[index],\n data = {\n image: tweet[\"avatar\"],\n name: tweet[\"author\"],\n text: tweet[\"body\"]\n };\n\n this.mouseCoordinates = mouse;\n\n // Don't show the tweets when we're in the country view mode, or dragging.\n if (!this.isCountryClicked && !this.isMouseDown) {\n this.props.actions.setPointHovered(true);\n this.props.actions.setPointTweetData(data);\n this.toggleGlobeVisibility(0, 0.6, 0.4);\n this.onCountryHoverOff();\n }\n }", "title": "" }, { "docid": "1a960129496c62c2e57a2554f83c2a7b", "score": "0.62469906", "text": "_onCtrlMouseEnter () {\n this._isHovering = true;\n\n this._show();\n }", "title": "" }, { "docid": "498bcc642cc7a49870133857c56a6f87", "score": "0.6244332", "text": "function hover ( event ) {\r\n\r\n\t\t\tvar location = event.calcPoint - offset(scope_Base)[ options.style ],\r\n\t\t\t\tto = scope_Spectrum.getStep(( location * 100 ) / baseSize()),\r\n\t\t\t\tvalue = scope_Spectrum.fromStepping( to );\r\n\r\n\t\t\tObject.keys(scope_Events).forEach(function( targetEvent ) {\r\n\t\t\t\tif ( 'hover' === targetEvent.split('.')[0] ) {\r\n\t\t\t\t\tscope_Events[targetEvent].forEach(function( callback ) {\r\n\t\t\t\t\t\tcallback.call( scope_Self, value );\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "30200cdc4a534a0ae693a5c08ea282fe", "score": "0.62420374", "text": "function eventHover(event) {\n var proposal = calcPointToPercentage(event.calcPoint);\n\n var to = scope_Spectrum.getStep(proposal);\n var value = scope_Spectrum.fromStepping(to);\n\n Object.keys(scope_Events).forEach(function(targetEvent) {\n if (\"hover\" === targetEvent.split(\".\")[0]) {\n scope_Events[targetEvent].forEach(function(callback) {\n callback.call(scope_Self, value);\n });\n }\n });\n }", "title": "" }, { "docid": "30200cdc4a534a0ae693a5c08ea282fe", "score": "0.62420374", "text": "function eventHover(event) {\n var proposal = calcPointToPercentage(event.calcPoint);\n\n var to = scope_Spectrum.getStep(proposal);\n var value = scope_Spectrum.fromStepping(to);\n\n Object.keys(scope_Events).forEach(function(targetEvent) {\n if (\"hover\" === targetEvent.split(\".\")[0]) {\n scope_Events[targetEvent].forEach(function(callback) {\n callback.call(scope_Self, value);\n });\n }\n });\n }", "title": "" }, { "docid": "30200cdc4a534a0ae693a5c08ea282fe", "score": "0.62420374", "text": "function eventHover(event) {\n var proposal = calcPointToPercentage(event.calcPoint);\n\n var to = scope_Spectrum.getStep(proposal);\n var value = scope_Spectrum.fromStepping(to);\n\n Object.keys(scope_Events).forEach(function(targetEvent) {\n if (\"hover\" === targetEvent.split(\".\")[0]) {\n scope_Events[targetEvent].forEach(function(callback) {\n callback.call(scope_Self, value);\n });\n }\n });\n }", "title": "" }, { "docid": "30200cdc4a534a0ae693a5c08ea282fe", "score": "0.62420374", "text": "function eventHover(event) {\n var proposal = calcPointToPercentage(event.calcPoint);\n\n var to = scope_Spectrum.getStep(proposal);\n var value = scope_Spectrum.fromStepping(to);\n\n Object.keys(scope_Events).forEach(function(targetEvent) {\n if (\"hover\" === targetEvent.split(\".\")[0]) {\n scope_Events[targetEvent].forEach(function(callback) {\n callback.call(scope_Self, value);\n });\n }\n });\n }", "title": "" }, { "docid": "24de4f44626673638f825eb610406ebc", "score": "0.624094", "text": "handleMouseOver (button) {\n switch(button) {\n case \"help\":\n if(this.state.helpButton === needHelp) {\n this.setState({helpButton: needHelpHover});\n }\n break;\n }\n }", "title": "" }, { "docid": "1d0cccfc99ffa9f58739d01cb95c925c", "score": "0.6233489", "text": "hover(props, monitor) {\n if(!props.droppable)\n return;\n\n if(props.artifacts.length === 0)\n props.onTargetHover(-1, props.artifacts.length > 0 ? props.artifacts.length - 1 : 0, monitor.getItem().item, true);\n }", "title": "" }, { "docid": "5530cdc5bdd2833710374fd67d52da51", "score": "0.6225353", "text": "function eventHover ( event ) {\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\n\t\tvar to = scope_Spectrum.getStep(proposal);\n\t\tvar value = scope_Spectrum.fromStepping(to);\n\n\t\tObject.keys(scope_Events).forEach(function( targetEvent ) {\n\t\t\tif ( 'hover' === targetEvent.split('.')[0] ) {\n\t\t\t\tscope_Events[targetEvent].forEach(function( callback ) {\n\t\t\t\t\tcallback.call( scope_Self, value );\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "5530cdc5bdd2833710374fd67d52da51", "score": "0.6225353", "text": "function eventHover ( event ) {\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\n\t\tvar to = scope_Spectrum.getStep(proposal);\n\t\tvar value = scope_Spectrum.fromStepping(to);\n\n\t\tObject.keys(scope_Events).forEach(function( targetEvent ) {\n\t\t\tif ( 'hover' === targetEvent.split('.')[0] ) {\n\t\t\t\tscope_Events[targetEvent].forEach(function( callback ) {\n\t\t\t\t\tcallback.call( scope_Self, value );\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "5530cdc5bdd2833710374fd67d52da51", "score": "0.6225353", "text": "function eventHover ( event ) {\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\n\t\tvar to = scope_Spectrum.getStep(proposal);\n\t\tvar value = scope_Spectrum.fromStepping(to);\n\n\t\tObject.keys(scope_Events).forEach(function( targetEvent ) {\n\t\t\tif ( 'hover' === targetEvent.split('.')[0] ) {\n\t\t\t\tscope_Events[targetEvent].forEach(function( callback ) {\n\t\t\t\t\tcallback.call( scope_Self, value );\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "b77db30daf03aec3ccc61252a1979a4b", "score": "0.62238204", "text": "function hover_message(hover_message)\n{\n\talert(\"Mouse hovered over me ... \" + hover_message);\n}", "title": "" }, { "docid": "519c426d5f7831558a7c8392727ae99e", "score": "0.6220334", "text": "function hoverOn() {\n $el.removeClass( hoverOffClass )\n .addClass( hoverOnClass );\n callback( 'onHoverOn' );\n }", "title": "" }, { "docid": "7e49398d74315a4eca6972554ab022af", "score": "0.6214564", "text": "function mouseover() {\n tooltip.style(\"display\", \"inline\");\n }", "title": "" }, { "docid": "c60b2f8a089600d1cfedc30f86644253", "score": "0.6212214", "text": "function bindHover() {\n document.body.addEventListener(\"mousemove\", function (e) {\n if (e.target.className.animVal == \"link\") {\n let d = d3.select(e.target).data()[0];\n let key = d.source.name + \" → \" + d.target.name;\n let amount = formatAbbreviation(d.value);\n showDetail(e, key, amount, null, null);\n } else if (e.target.nodeName == \"rect\" && e.target.className.animVal != \"bar\") {\n let d = d3.select(e.target).data()[0];\n let key = d.name;\n let amount = formatAbbreviation(d.value);\n showDetail(e, key, amount, null, null);\n }\n });\n document.body.addEventListener(\"mouseout\", function (e) {\n if (e.target.className.animVal == \"link\" || e.target.nodeName == \"rect\") hideDetail();\n });\n}", "title": "" }, { "docid": "3228e38ff650de73fa08f4bb6a1fe9f3", "score": "0.6203701", "text": "function add_hover(j) {\n var full_route_div = $(\"#full_route_\"+j);\n var abbr_route_div = $(\"#abbr_route_\"+j); \n abbr_route_div.mouseenter(function(e) {\n e.preventDefault();\n e.stopPropagation();\n var full_route_div_id = this.id.replace(\"abbr\", \"full\");\n $(\"#\"+full_route_div_id).fadeIn(500);\n });\n full_route_div.mouseleave(function(e) {\n e.preventDefault();\n e.stopPropagation();\n var full_route_div_id = this.id.replace(\"abbr\", \"full\");\n $(\"#\"+full_route_div_id).fadeOut(500); \n }); \n }", "title": "" }, { "docid": "1c803aa483a07bcb15d160178abe6f72", "score": "0.6196946", "text": "function itemMouseOver(e){\n\t\te.target.openPopup();\n\t}", "title": "" }, { "docid": "a017b0047d87e5b2753698be32bdd6df", "score": "0.61924535", "text": "function onMouseOver(d) {\n d3.selectAll(\"#vizD3 .tooltip\").transition()\n .duration(200)\n .style(\"opacity\", 0.9);\n d3.selectAll(\"#vizD3 .tooltip\").html( ((d.side===\"Buy\")?(\"Bought on \"):(\"Sold on \"))+euroDate(d.timestamp)+\":<br/>\"+d.rfq_qty+\"k @ \"+fmtsigfigs(d.qtpct) )\n .style(\"left\", d3.mouse(this)[0]+132+\"px\")\n .style(\"top\", d3.mouse(this)[1]+66+\"px\");\n focus(x(d.status), y(d.qtpct), d.rfq_qty_size);\n }", "title": "" }, { "docid": "fa5e1ecb0cfd94614e1d4c79e2308b8f", "score": "0.61864334", "text": "static create_event_hovered(){}", "title": "" }, { "docid": "dfe2f65d0cc5d4d0990c249fabf21b1d", "score": "0.6182423", "text": "function hover(event) {\n var location = event.calcPoint - offset(scope_Base)[options.style],\n to = scope_Spectrum.getStep((location * 100) / baseSize()),\n value = scope_Spectrum.fromStepping(to);\n Object.keys(scope_Events).forEach(function(targetEvent) {\n if ('hover' === targetEvent.split('.')[0]) {\n scope_Events[targetEvent].forEach(function(callback) {\n callback.call(scope_Self, value);\n });\n }\n });\n }", "title": "" }, { "docid": "5060d229e0faf432d7048c6c41c2fc16", "score": "0.61787844", "text": "function eventHover(event) {\r\n var proposal = calcPointToPercentage(event.calcPoint);\r\n\r\n var to = scope_Spectrum.getStep(proposal);\r\n var value = scope_Spectrum.fromStepping(to);\r\n\r\n Object.keys(scope_Events).forEach(function(targetEvent) {\r\n if (\"hover\" === targetEvent.split(\".\")[0]) {\r\n scope_Events[targetEvent].forEach(function(callback) {\r\n callback.call(scope_Self, value);\r\n });\r\n }\r\n });\r\n }", "title": "" }, { "docid": "96fde42d4b5f01a2ef518a30bf3eb41c", "score": "0.61655515", "text": "function hover(el) {\n\tel.style.backgroundColor = '#a2a2a2';\n\t// el.classList.add('hover');\n}", "title": "" }, { "docid": "76a0c54c1c73ee24bd5e352f285c79ca", "score": "0.6159533", "text": "function phoneHover() {\n gsap.to(\".left-icon1\", { transformOrigin: \"50% 50%\", rotate: \"180\", fontSize: \"2rem\", duration: 0.2, ease: \"linear\" })\n gsap.to(\".right-icon1\", { transformOrigin: \"50% 50%\", rotate: \"-180\", fontSize: \"2rem\", duration: 0.2, ease: \"linear\" })\n gsap.to(\".phone-container\", { color: \"white\", duration: 0.2, ease: \"linear\" })\n }", "title": "" }, { "docid": "d5413f3acaa32ef6a8505794ef5389da", "score": "0.6153749", "text": "hoverOut() {\n this.y += 5;\n }", "title": "" }, { "docid": "201074fba0bf4ca155fedb3dd4153d62", "score": "0.6152117", "text": "function eventHover(event) {\n\t\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\n\t\t\tvar to = scope_Spectrum.getStep(proposal);\n\t\t\tvar value = scope_Spectrum.fromStepping(to);\n\n\t\t\tObject.keys(scope_Events).forEach(function (targetEvent) {\n\t\t\t\tif (\"hover\" === targetEvent.split(\".\")[0]) {\n\t\t\t\t\tscope_Events[targetEvent].forEach(function (callback) {\n\t\t\t\t\t\tcallback.call(scope_Self, value);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "81be4b2b9aaf84ecb110a76ec237d4b5", "score": "0.6149526", "text": "onhover(option = false) {\n if (!option) {\n let _option = $(this.config.get('triggerClass'), this.container);\n if (_option.length > 0) {\n option = _option;\n }\n }\n if (option) {\n option.hover(\n //Hover in\n (e) => {\n let item = $(e.currentTarget);\n let detail = $(this.config.get('detailClass'), item);\n if (detail.length > 0) {\n return this.doHoverIn(detail, e);\n }\n },\n //Hover out\n (e) => {\n let item = $(e.currentTarget);\n let detail = $(this.config.get('detailClass'), item);\n if (detail.length > 0) {\n return this.doHoverOut(detail, e);\n }\n },\n );\n }\n }", "title": "" }, { "docid": "99f05ab3abadc89d2a040a96899e1d3b", "score": "0.6148391", "text": "function linkMouseover(d) {\n svg.selectAll(\".link\").classed(\"active\", function(p) { return p === d; });\n svg.selectAll(\".node\").classed(\"active\", function(p) { return p === d.source || p === d.target; });\n d.source.popupFunc();\n d.target.popupFunc();\n}", "title": "" }, { "docid": "1c6eb3a1f841f5d659ccb216891603d2", "score": "0.61429566", "text": "onMouseEnter() {\n this.setState({\n hover: true\n })\n }", "title": "" }, { "docid": "11d1f3cee5ba753c9bf4cdbe84a06bae", "score": "0.61425143", "text": "function overArnold(event) {\n defaultWorkTip.style.display = \"none\";\n arnoldTip.style.display = \"block\";\n }", "title": "" }, { "docid": "edd0abd16c653a864049aefb8ce4995b", "score": "0.6141858", "text": "function hover ( event ) {\n\n\t\tvar location = event.calcPoint - offset(scope_Base)[ options.style ],\n\t\t\tto = scope_Spectrum.getStep(( location * 100 ) / baseSize()),\n\t\t\tvalue = scope_Spectrum.fromStepping( to );\n\n\t\tObject.keys(scope_Events).forEach(function( targetEvent ) {\n\t\t\tif ( 'hover' === targetEvent.split('.')[0] ) {\n\t\t\t\tscope_Events[targetEvent].forEach(function( callback ) {\n\t\t\t\t\tcallback.call( scope_Self, value );\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "a0ca73c2ed0f600bc66f88e47641af48", "score": "0.61388886", "text": "function articleHover(){\n\t$('.about_us_article').hover(\n\t\tfunction() {\n\t\t\t$('.about_arrow', this).css('display', 'block').stop().animate({top: '5%'}, 1000);\n\t\t}, function() {\n\t\t\t$('.about_arrow', this).css('display', 'none').stop().animate({top: '60%'}, 100);\n\t\t}\n\t\t);\n}", "title": "" }, { "docid": "327336db942d7c162dc567d0bff25a89", "score": "0.61328226", "text": "function hoverEnter() {\n\tif(!override_caption) {\n\t\tshowCaption();\n\t}\n}", "title": "" }, { "docid": "06f6fadb3c68e3d6532db00d708065f5", "score": "0.61321336", "text": "function handleItemMouseOver(node, title) {\n if (node && allowHover) {\n node.classList.add('on-hover');\n node.style.setProperty('--stop-name', `\"${title}\"`);\n }\n }", "title": "" }, { "docid": "4b28d3e5e87f48786820d299ca29d11e", "score": "0.6121833", "text": "function OnMouseEnter() {\r\n\tguiTexture.texture = hoverTexture;\r\n\tmouseOver = true;\r\n}", "title": "" }, { "docid": "8877da3d2150a06c16fde21c6d236a50", "score": "0.611151", "text": "function on_hover(ev, d, action, me) {\n let selector;\n if (ev.target.classList.contains('left-bar')) {\n selector = 'left-bar';\n }\n if (ev.target.classList.contains('right-bar')) {\n selector = 'right-bar';\n }\n if (selector) {\n let color = selector === 'left-bar' ? sec_max_perc_color : max_perc_color;\n if (action === 'move') {\n color = color + '80';\n }\n d3.select(me).select('rect.' + selector).attr(\"fill\", color);\n }\n }", "title": "" }, { "docid": "dc1052db81da4d967fdb5dd41a7df9b6", "score": "0.6111387", "text": "function showextraevents(event) { event.stopPropagation(); $(this).stop().toggleClass('hover'); }", "title": "" }, { "docid": "38e8c5780024391290636bdc92e07589", "score": "0.6109055", "text": "function mouseOver(){\n\t\tfilter(BLUR, 6);\n\t}", "title": "" } ]
37eda35682950dc0a49ebf574235704e
Returns the original source, line, and column information for the generated source's line and column positions provided. The only argument is an object with the following properties: line: The line number in the generated source. The line number is 1based. column: The column number in the generated source. The column number is 0based. and an object is returned with the following properties: source: The original source file, or null. line: The line number in the original source, or null. The line number is 1based. column: The column number in the original source, or null. The column number is 0based. name: The original identifier, or null.
[ { "docid": "ff38d1925e2f97566ae159828f53780d", "score": "0.6739409", "text": "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util$1.getArg(aArgs, \"line\"),\n generatedColumn: util$1.getArg(aArgs, \"column\")\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n const sectionIndex = binarySearch$1.search(needle, this._sections,\n function(aNeedle, section) {\n const cmp = aNeedle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (aNeedle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n const section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n }", "title": "" } ]
[ { "docid": "c910c76c193fa637c2167e378da487c9", "score": "0.7510246", "text": "function originalPositionFor(source, line, column, name) {\n if (!source.map) {\n return { column, line, name, source: source.source, content: source.content };\n }\n const segment = traceSegment(source.map, line, column);\n // If we couldn't find a segment, then this doesn't exist in the sourcemap.\n if (segment == null)\n return null;\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length === 1)\n return SOURCELESS_MAPPING;\n return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);\n}", "title": "" }, { "docid": "43aba98b5e58bd0c73d1c118d6e119e3", "score": "0.74474883", "text": "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, \"line\"),\n generatedColumn: util.getArg(aArgs, \"column\")\n };\n\n if (needle.generatedLine < 1) {\n throw new Error(\"Line numbers must be >= 1\");\n }\n\n if (needle.generatedColumn < 0) {\n throw new Error(\"Column numbers must be >= 0\");\n }\n\n let bias = util.getArg(aArgs, \"bias\", SourceMapConsumer.GREATEST_LOWER_BOUND);\n if (bias == null) {\n bias = SourceMapConsumer.GREATEST_LOWER_BOUND;\n }\n\n let mapping;\n this._wasm.withMappingCallback(m => mapping = m, () => {\n this._wasm.exports.original_location_for(\n this._getMappingsPtr(),\n needle.generatedLine - 1,\n needle.generatedColumn,\n bias\n );\n });\n\n if (mapping) {\n if (mapping.generatedLine === needle.generatedLine) {\n let source = util.getArg(mapping, \"source\", null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n\n let name = util.getArg(mapping, \"name\", null);\n if (name !== null) {\n name = this._names.at(name);\n }\n\n return {\n source,\n line: util.getArg(mapping, \"originalLine\", null),\n column: util.getArg(mapping, \"originalColumn\", null),\n name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }", "title": "" }, { "docid": "43aba98b5e58bd0c73d1c118d6e119e3", "score": "0.74474883", "text": "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, \"line\"),\n generatedColumn: util.getArg(aArgs, \"column\")\n };\n\n if (needle.generatedLine < 1) {\n throw new Error(\"Line numbers must be >= 1\");\n }\n\n if (needle.generatedColumn < 0) {\n throw new Error(\"Column numbers must be >= 0\");\n }\n\n let bias = util.getArg(aArgs, \"bias\", SourceMapConsumer.GREATEST_LOWER_BOUND);\n if (bias == null) {\n bias = SourceMapConsumer.GREATEST_LOWER_BOUND;\n }\n\n let mapping;\n this._wasm.withMappingCallback(m => mapping = m, () => {\n this._wasm.exports.original_location_for(\n this._getMappingsPtr(),\n needle.generatedLine - 1,\n needle.generatedColumn,\n bias\n );\n });\n\n if (mapping) {\n if (mapping.generatedLine === needle.generatedLine) {\n let source = util.getArg(mapping, \"source\", null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n\n let name = util.getArg(mapping, \"name\", null);\n if (name !== null) {\n name = this._names.at(name);\n }\n\n return {\n source,\n line: util.getArg(mapping, \"originalLine\", null),\n column: util.getArg(mapping, \"originalColumn\", null),\n name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }", "title": "" }, { "docid": "849141ac0cdb5bb56c516cda820675b9", "score": "0.74257195", "text": "generatedPositionFor(aArgs) {\n let source = util.getArg(aArgs, \"source\");\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n const needle = {\n source,\n originalLine: util.getArg(aArgs, \"line\"),\n originalColumn: util.getArg(aArgs, \"column\")\n };\n\n if (needle.originalLine < 1) {\n throw new Error(\"Line numbers must be >= 1\");\n }\n\n if (needle.originalColumn < 0) {\n throw new Error(\"Column numbers must be >= 0\");\n }\n\n let bias = util.getArg(aArgs, \"bias\", SourceMapConsumer.GREATEST_LOWER_BOUND);\n if (bias == null) {\n bias = SourceMapConsumer.GREATEST_LOWER_BOUND;\n }\n\n let mapping;\n this._wasm.withMappingCallback(m => mapping = m, () => {\n this._wasm.exports.generated_location_for(\n this._getMappingsPtr(),\n needle.source,\n needle.originalLine - 1,\n needle.originalColumn,\n bias\n );\n });\n\n if (mapping) {\n if (mapping.source === needle.source) {\n let lastColumn = mapping.lastGeneratedColumn;\n if (this._computedColumnSpans && lastColumn === null) {\n lastColumn = Infinity;\n }\n return {\n line: util.getArg(mapping, \"generatedLine\", null),\n column: util.getArg(mapping, \"generatedColumn\", null),\n lastColumn,\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }", "title": "" }, { "docid": "849141ac0cdb5bb56c516cda820675b9", "score": "0.74257195", "text": "generatedPositionFor(aArgs) {\n let source = util.getArg(aArgs, \"source\");\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n const needle = {\n source,\n originalLine: util.getArg(aArgs, \"line\"),\n originalColumn: util.getArg(aArgs, \"column\")\n };\n\n if (needle.originalLine < 1) {\n throw new Error(\"Line numbers must be >= 1\");\n }\n\n if (needle.originalColumn < 0) {\n throw new Error(\"Column numbers must be >= 0\");\n }\n\n let bias = util.getArg(aArgs, \"bias\", SourceMapConsumer.GREATEST_LOWER_BOUND);\n if (bias == null) {\n bias = SourceMapConsumer.GREATEST_LOWER_BOUND;\n }\n\n let mapping;\n this._wasm.withMappingCallback(m => mapping = m, () => {\n this._wasm.exports.generated_location_for(\n this._getMappingsPtr(),\n needle.source,\n needle.originalLine - 1,\n needle.originalColumn,\n bias\n );\n });\n\n if (mapping) {\n if (mapping.source === needle.source) {\n let lastColumn = mapping.lastGeneratedColumn;\n if (this._computedColumnSpans && lastColumn === null) {\n lastColumn = Infinity;\n }\n return {\n line: util.getArg(mapping, \"generatedLine\", null),\n column: util.getArg(mapping, \"generatedColumn\", null),\n lastColumn,\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }", "title": "" }, { "docid": "849141ac0cdb5bb56c516cda820675b9", "score": "0.74257195", "text": "generatedPositionFor(aArgs) {\n let source = util.getArg(aArgs, \"source\");\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n const needle = {\n source,\n originalLine: util.getArg(aArgs, \"line\"),\n originalColumn: util.getArg(aArgs, \"column\")\n };\n\n if (needle.originalLine < 1) {\n throw new Error(\"Line numbers must be >= 1\");\n }\n\n if (needle.originalColumn < 0) {\n throw new Error(\"Column numbers must be >= 0\");\n }\n\n let bias = util.getArg(aArgs, \"bias\", SourceMapConsumer.GREATEST_LOWER_BOUND);\n if (bias == null) {\n bias = SourceMapConsumer.GREATEST_LOWER_BOUND;\n }\n\n let mapping;\n this._wasm.withMappingCallback(m => mapping = m, () => {\n this._wasm.exports.generated_location_for(\n this._getMappingsPtr(),\n needle.source,\n needle.originalLine - 1,\n needle.originalColumn,\n bias\n );\n });\n\n if (mapping) {\n if (mapping.source === needle.source) {\n let lastColumn = mapping.lastGeneratedColumn;\n if (this._computedColumnSpans && lastColumn === null) {\n lastColumn = Infinity;\n }\n return {\n line: util.getArg(mapping, \"generatedLine\", null),\n column: util.getArg(mapping, \"generatedColumn\", null),\n lastColumn,\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }", "title": "" }, { "docid": "5328ec2affb5eecdc2a0a91713050860", "score": "0.7355264", "text": "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, \"line\"),\n generatedColumn: util.getArg(aArgs, \"column\")\n };\n\n if (needle.generatedLine < 1) {\n throw new Error(\"Line numbers must be >= 1\");\n }\n\n if (needle.generatedColumn < 0) {\n throw new Error(\"Column numbers must be >= 0\");\n }\n\n let bias = util.getArg(aArgs, \"bias\", SourceMapConsumer.GREATEST_LOWER_BOUND);\n if (bias == null) {\n bias = SourceMapConsumer.GREATEST_LOWER_BOUND;\n }\n\n let mapping;\n this._wasm.withMappingCallback(m => mapping = m, () => {\n this._wasm.exports.original_location_for(\n this._getMappingsPtr(),\n needle.generatedLine - 1,\n needle.generatedColumn,\n bias\n );\n });\n\n if (mapping) {\n if (mapping.generatedLine === needle.generatedLine) {\n let source = util.getArg(mapping, \"source\", null);\n if (source !== null) {\n source = this._absoluteSources.at(source);\n }\n\n let name = util.getArg(mapping, \"name\", null);\n if (name !== null) {\n name = this._names.at(name);\n }\n\n return {\n source,\n line: util.getArg(mapping, \"originalLine\", null),\n column: util.getArg(mapping, \"originalColumn\", null),\n name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }", "title": "" }, { "docid": "4545c59f7432b43b31dbe4e144c1d96b", "score": "0.7270183", "text": "generatedPositionFor(aArgs) {\n let source = util$1.getArg(aArgs, \"source\");\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n const needle = {\n source,\n originalLine: util$1.getArg(aArgs, \"line\"),\n originalColumn: util$1.getArg(aArgs, \"column\")\n };\n\n if (needle.originalLine < 1) {\n throw new Error(\"Line numbers must be >= 1\");\n }\n\n if (needle.originalColumn < 0) {\n throw new Error(\"Column numbers must be >= 0\");\n }\n\n let bias = util$1.getArg(aArgs, \"bias\", SourceMapConsumer$2.GREATEST_LOWER_BOUND);\n if (bias == null) {\n bias = SourceMapConsumer$2.GREATEST_LOWER_BOUND;\n }\n\n let mapping;\n this._wasm.withMappingCallback(m => mapping = m, () => {\n this._wasm.exports.generated_location_for(\n this._getMappingsPtr(),\n needle.source,\n needle.originalLine - 1,\n needle.originalColumn,\n bias\n );\n });\n\n if (mapping) {\n if (mapping.source === needle.source) {\n let lastColumn = mapping.lastGeneratedColumn;\n if (this._computedColumnSpans && lastColumn === null) {\n lastColumn = Infinity;\n }\n return {\n line: util$1.getArg(mapping, \"generatedLine\", null),\n column: util$1.getArg(mapping, \"generatedColumn\", null),\n lastColumn,\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }", "title": "" }, { "docid": "49f529480074a762a79dfd95f535167e", "score": "0.72023904", "text": "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util$1.getArg(aArgs, \"line\"),\n generatedColumn: util$1.getArg(aArgs, \"column\")\n };\n\n if (needle.generatedLine < 1) {\n throw new Error(\"Line numbers must be >= 1\");\n }\n\n if (needle.generatedColumn < 0) {\n throw new Error(\"Column numbers must be >= 0\");\n }\n\n let bias = util$1.getArg(aArgs, \"bias\", SourceMapConsumer$2.GREATEST_LOWER_BOUND);\n if (bias == null) {\n bias = SourceMapConsumer$2.GREATEST_LOWER_BOUND;\n }\n\n let mapping;\n this._wasm.withMappingCallback(m => mapping = m, () => {\n this._wasm.exports.original_location_for(\n this._getMappingsPtr(),\n needle.generatedLine - 1,\n needle.generatedColumn,\n bias\n );\n });\n\n if (mapping) {\n if (mapping.generatedLine === needle.generatedLine) {\n let source = util$1.getArg(mapping, \"source\", null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util$1.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n\n let name = util$1.getArg(mapping, \"name\", null);\n if (name !== null) {\n name = this._names.at(name);\n }\n\n return {\n source,\n line: util$1.getArg(mapping, \"originalLine\", null),\n column: util$1.getArg(mapping, \"originalColumn\", null),\n name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }", "title": "" }, { "docid": "808947d14abf1e873331d9c9adc7ad1b", "score": "0.7090687", "text": "generatedPositionFor(aArgs) {\n const index = this._findSectionIndex(util.getArg(aArgs, \"source\"));\n const section = index >= 0 ? this._sections[index] : null;\n const nextSection =\n index >= 0 && index + 1 < this._sections.length\n ? this._sections[index + 1]\n : null;\n\n const generatedPosition =\n section && section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition && generatedPosition.line !== null) {\n const lineShift = section.generatedOffset.generatedLine - 1;\n const columnShift = section.generatedOffset.generatedColumn - 1;\n\n if (generatedPosition.line === 1) {\n generatedPosition.column += columnShift;\n if (typeof generatedPosition.lastColumn === \"number\") {\n generatedPosition.lastColumn += columnShift;\n }\n }\n\n if (\n generatedPosition.lastColumn === Infinity &&\n nextSection &&\n generatedPosition.line === nextSection.generatedOffset.generatedLine\n ) {\n generatedPosition.lastColumn =\n nextSection.generatedOffset.generatedColumn - 2;\n }\n generatedPosition.line += lineShift;\n\n return generatedPosition;\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }", "title": "" }, { "docid": "124edd1f3fa730bf6b1bdc8a1b8fce24", "score": "0.6925945", "text": "generatedPositionFor(aArgs) {\n for (let i = 0; i < this._sections.length; i++) {\n const section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, \"source\")) === -1) {\n continue;\n }\n const generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n const ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n }", "title": "" }, { "docid": "124edd1f3fa730bf6b1bdc8a1b8fce24", "score": "0.6925945", "text": "generatedPositionFor(aArgs) {\n for (let i = 0; i < this._sections.length; i++) {\n const section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, \"source\")) === -1) {\n continue;\n }\n const generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n const ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n }", "title": "" }, { "docid": "279ad17299778c0fe831c84722ccd536", "score": "0.6879853", "text": "generatedPositionFor(aArgs) {\n for (let i = 0; i < this._sections.length; i++) {\n const section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util$1.getArg(aArgs, \"source\")) === -1) {\n continue;\n }\n const generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n const ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n }", "title": "" }, { "docid": "411a88395fbfe123cba281eeee40dd0f", "score": "0.685645", "text": "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, \"line\"),\n generatedColumn: util.getArg(aArgs, \"column\")\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n const sectionIndex = binarySearch.search(needle, this._sections,\n function(aNeedle, section) {\n const cmp = aNeedle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (aNeedle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n const section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n }", "title": "" }, { "docid": "411a88395fbfe123cba281eeee40dd0f", "score": "0.685645", "text": "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, \"line\"),\n generatedColumn: util.getArg(aArgs, \"column\")\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n const sectionIndex = binarySearch.search(needle, this._sections,\n function(aNeedle, section) {\n const cmp = aNeedle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (aNeedle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n const section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n }", "title": "" }, { "docid": "411a88395fbfe123cba281eeee40dd0f", "score": "0.685645", "text": "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, \"line\"),\n generatedColumn: util.getArg(aArgs, \"column\")\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n const sectionIndex = binarySearch.search(needle, this._sections,\n function(aNeedle, section) {\n const cmp = aNeedle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (aNeedle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n const section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n }", "title": "" }, { "docid": "35a6c20362969dd69220f915ea4769ad", "score": "0.6698116", "text": "function c(){this.generatedLine=0;this.generatedColumn=0;this.source=null;this.originalLine=null;this.originalColumn=null;this.name=null}", "title": "" }, { "docid": "0bf5645457ad7e3c5fd72cacf04ab0d1", "score": "0.6570778", "text": "function m(e,t,n){var i=e.source-t.source;if(i!==0){return i}i=e.originalLine-t.originalLine;if(i!==0){return i}i=e.originalColumn-t.originalColumn;if(i!==0||n){return i}i=e.generatedColumn-t.generatedColumn;if(i!==0){return i}i=e.generatedLine-t.generatedLine;if(i!==0){return i}return e.name-t.name}", "title": "" }, { "docid": "b50b032362643814f28ea450d5fd892f", "score": "0.64546955", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n }", "title": "" }, { "docid": "ce45f9131bc20fc6ccb2aed5bd939bea", "score": "0.6441338", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n }", "title": "" }, { "docid": "a49b14e108cee6f6e9990de6b2bf9cd9", "score": "0.6436206", "text": "function getLocation(source, position) {\n\t var line = 1;\n\t var column = position + 1;\n\t var lineRegexp = /\\r\\n|[\\n\\r\\u2028\\u2029]/g;\n\t var match;\n\t while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n\t line += 1;\n\t column = position + 1 - (match.index + match[0].length);\n\t }\n\t return { line: line, column: column };\n\t}", "title": "" }, { "docid": "9030912fbdcf83f55bd6d53d366cecbb", "score": "0.64350843", "text": "function getLocation(source, position) {\n\t var lineRegexp = /\\r\\n|[\\n\\r]/g;\n\t var line = 1;\n\t var column = position + 1;\n\t var match = void 0;\n\t while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n\t line += 1;\n\t column = position + 1 - (match.index + match[0].length);\n\t }\n\t return { line: line, column: column };\n\t}", "title": "" }, { "docid": "9030912fbdcf83f55bd6d53d366cecbb", "score": "0.64350843", "text": "function getLocation(source, position) {\n\t var lineRegexp = /\\r\\n|[\\n\\r]/g;\n\t var line = 1;\n\t var column = position + 1;\n\t var match = void 0;\n\t while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n\t line += 1;\n\t column = position + 1 - (match.index + match[0].length);\n\t }\n\t return { line: line, column: column };\n\t}", "title": "" }, { "docid": "9030912fbdcf83f55bd6d53d366cecbb", "score": "0.64350843", "text": "function getLocation(source, position) {\n\t var lineRegexp = /\\r\\n|[\\n\\r]/g;\n\t var line = 1;\n\t var column = position + 1;\n\t var match = void 0;\n\t while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n\t line += 1;\n\t column = position + 1 - (match.index + match[0].length);\n\t }\n\t return { line: line, column: column };\n\t}", "title": "" }, { "docid": "9030912fbdcf83f55bd6d53d366cecbb", "score": "0.64350843", "text": "function getLocation(source, position) {\n\t var lineRegexp = /\\r\\n|[\\n\\r]/g;\n\t var line = 1;\n\t var column = position + 1;\n\t var match = void 0;\n\t while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n\t line += 1;\n\t column = position + 1 - (match.index + match[0].length);\n\t }\n\t return { line: line, column: column };\n\t}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "0dbd929e0ea0ba500f9de01652a517a0", "score": "0.6433285", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}", "title": "" }, { "docid": "031bbe2ca49b5c7b6a81881f9c12a3f1", "score": "0.6431352", "text": "function b(e,t){var n=e.generatedLine-t.generatedLine;if(n!==0){return n}n=e.generatedColumn-t.generatedColumn;if(n!==0){return n}n=v(e.source,t.source);if(n!==0){return n}n=e.originalLine-t.originalLine;if(n!==0){return n}n=e.originalColumn-t.originalColumn;if(n!==0){return n}return v(e.name,t.name)}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "16211b18a7e383c7d3f36b7c3c0ae4af", "score": "0.64217544", "text": "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "8ee827f4c7fd1a5893648aa52bac47df", "score": "0.64011073", "text": "function getLocation(source, position) {\n\t var lineRegexp = /\\r\\n|[\\n\\r]/g;\n\t var line = 1;\n\t var column = position + 1;\n\t var match;\n\n\t while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n\t line += 1;\n\t column = position + 1 - (match.index + match[0].length);\n\t }\n\n\t return {\n\t line: line,\n\t column: column\n\t };\n\t}", "title": "" }, { "docid": "b3b7525fe170f1ab6756effdf5d49b3a", "score": "0.63990486", "text": "function getLocation(source, position) {\n var line = 1;\n var column = position + 1;\n var lineRegexp = /\\r\\n|[\\n\\r\\u2028\\u2029]/g;\n var match;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "title": "" }, { "docid": "5991530e62afa726aa6c434d7febb0dc", "score": "0.63429165", "text": "origin(line, column) {\n if ( !this.map ) return false;\n var consumer = this.map.consumer();\n\n var from = consumer.originalPositionFor({ line, column });\n if ( !from.source ) return false;\n\n var result = {\n file: this.mapResolve(from.source),\n line: from.line,\n column: from.column\n };\n\n var source = consumer.sourceContentFor(result.file);\n if ( source ) result.source = source;\n\n return result;\n }", "title": "" }, { "docid": "76803105494a970cd33349d185ecd05e", "score": "0.63176703", "text": "function getOriginalPosition(map, line, column) {\n\t\tvar originalPosition = map.originalPositionFor({ line: line, column: column});\n\n\t\t// if the SourceMapConsumer was able to find a location, return it\n\t\tif (originalPosition.line !== null) {\n\t\t\treturn originalPosition;\n\t\t}\n\n\t\tvar entries = [];\n\n\t\t// find all map entries that apply to the given line in the generated output\n\t\tmap.eachMapping(function (entry) {\n\t\t\tif (entry.generatedLine === line) {\n\t\t\t\tentries.push(entry);\n\t\t\t}\n\t\t}, null, map.GENERATED_ORDER);\n\n\t\tif (entries.length === 0) {\n\t\t\t// no valid mappings exist -- return the line and column arguments\n\t\t\treturn { line: line, column: column };\n\t\t}\n\n\t\toriginalPosition = entries[0];\n\n\t\t// Chrome/Node.js column is at the start of the term that generated the exception\n\t\t// IE column is at the beginning of the expression/line with the exceptional term\n\t\t// Safari column number is just after the exceptional term\n\t\t// - need to go back one element in the mapping\n\t\t// Firefox, PhantomJS have no column number\n\t\t// - for no col number, find the largest original line number for the generated line\n\n\t\tif (column !== null) {\n\t\t\t// find the most likely mapping for the given generated line and column\n\t\t\tvar entry;\n\t\t\tfor (var i = 1; i < entries.length; i++) {\n\t\t\t\tentry = entries[i];\n\t\t\t\tif (column > originalPosition.generatedColumn && column >= entry.generatedColumn) {\n\t\t\t\t\toriginalPosition = entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tline: originalPosition.originalLine,\n\t\t\tcolumn: originalPosition.originalColumn,\n\t\t\tsource: originalPosition.source\n\t\t};\n\t}", "title": "" }, { "docid": "46c2ebf43f52b1ae3483d9bf4dc6e9b6", "score": "0.6305412", "text": "function y(e,t,n){var i=e.generatedLine-t.generatedLine;if(i!==0){return i}i=e.generatedColumn-t.generatedColumn;if(i!==0||n){return i}i=e.source-t.source;if(i!==0){return i}i=e.originalLine-t.originalLine;if(i!==0){return i}i=e.originalColumn-t.originalColumn;if(i!==0){return i}return e.name-t.name}", "title": "" }, { "docid": "0902ee05289f36873e11d56f0ff8b1b4", "score": "0.6285292", "text": "async function findOriginalSourcePositionAndContent(webpackSource, position) {\n var _a, _b, _c;\n const consumer = await new source_map_1.SourceMapConsumer(webpackSource.map());\n try {\n const sourcePosition = consumer.originalPositionFor({\n line: position.line,\n column: (_a = position.column) !== null && _a !== void 0 ? _a : 0,\n });\n if (!sourcePosition.source) {\n return null;\n }\n const sourceContent = (_b = consumer.sourceContentFor(sourcePosition.source, /* returnNullOnMissing */ true)) !== null && _b !== void 0 ? _b : null;\n return {\n sourcePosition,\n sourceContent,\n };\n }\n finally {\n // @ts-ignore: unexpected type\n (_c = consumer.destroy) === null || _c === void 0 ? void 0 : _c.call(consumer);\n }\n}", "title": "" }, { "docid": "51f69e1f46daefd5de2f1ece7e0413c4", "score": "0.6209768", "text": "sourceForNode(node) {\n if (!node.loc) {\n return;\n }\n\n let source = this.source.split('\\n');\n let firstLine = node.loc.start.line - 1;\n let lastLine = node.loc.end.line - 1;\n let currentLine = firstLine - 1;\n let firstColumn = node.loc.start.column;\n let lastColumn = node.loc.end.column;\n let string = [];\n let line;\n\n while (currentLine < lastLine) {\n currentLine += 1;\n line = source[currentLine];\n\n if (currentLine === firstLine) {\n if (firstLine === lastLine) {\n string.push(line.slice(firstColumn, lastColumn));\n } else {\n string.push(line.slice(firstColumn));\n }\n } else if (currentLine === lastLine) {\n string.push(line.slice(0, lastColumn));\n } else {\n string.push(line);\n }\n }\n\n return string.join('');\n }", "title": "" }, { "docid": "38f9706026141ef176ea0efe31f2ce14", "score": "0.61633754", "text": "toStringWithSourceMap(aArgs) {\n const generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n const map = new SourceMapGenerator(aArgs);\n let sourceMappingActive = false;\n let lastOriginalSource = null;\n let lastOriginalLine = null;\n let lastOriginalColumn = null;\n let lastOriginalName = null;\n this.walk(function(chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if (lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (let idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function(sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map };\n }", "title": "" }, { "docid": "38f9706026141ef176ea0efe31f2ce14", "score": "0.61633754", "text": "toStringWithSourceMap(aArgs) {\n const generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n const map = new SourceMapGenerator(aArgs);\n let sourceMappingActive = false;\n let lastOriginalSource = null;\n let lastOriginalLine = null;\n let lastOriginalColumn = null;\n let lastOriginalName = null;\n this.walk(function(chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if (lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (let idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function(sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map };\n }", "title": "" }, { "docid": "38f9706026141ef176ea0efe31f2ce14", "score": "0.61633754", "text": "toStringWithSourceMap(aArgs) {\n const generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n const map = new SourceMapGenerator(aArgs);\n let sourceMappingActive = false;\n let lastOriginalSource = null;\n let lastOriginalLine = null;\n let lastOriginalColumn = null;\n let lastOriginalName = null;\n this.walk(function(chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if (lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (let idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function(sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map };\n }", "title": "" }, { "docid": "258dd69937dc03d2baefac53bbd0bf19", "score": "0.5922579", "text": "get source() {\n var spec = this.getAttribute('source');\n \n if (spec === null) return null;\n \n var flds = spec.split('.');\n \n if (flds.length !== 2) reporter.fatalError('Column ' + name + ' source spec -' + spec + '- invalid');\n \n return {\n table: flds[0],\n column: flds[1]\n };\n }", "title": "" }, { "docid": "6f63248a298bfd01d9b72a094553a1ab", "score": "0.5677463", "text": "function getSource(tracepath) {\n\t\t/* jshint maxcomplexity:13 */\n\t\tvar match;\n\t\tvar source;\n\t\tvar line;\n\t\tvar col;\n\t\tvar map;\n\t\tvar originalPos;\n\t\tvar result;\n\n\t\tif (tracepath === '<anonymous>') {\n\t\t\treturn 'anonymous';\n\t\t}\n\n\t\tif (!(match = /^(.*?):(\\d+)(:\\d+)?$/.exec(tracepath))) {\n\t\t\t// no line or column data\n\t\t\treturn tracepath;\n\t\t}\n\n\t\ttracepath = match[1];\n\t\tline = Number(match[2]);\n\t\tcol = match[3] ? Number(match[3].substring(1)) : null;\n\n\t\t// strip the host when we have a URL\n\n\t\tif ((match = /^\\w+:\\/\\/[^\\/]+\\/(.*)$/.exec(tracepath))) {\n\t\t\t// resolve the URL path to a filesystem path\n\t\t\ttracepath = pathUtil ? pathUtil.resolve(match[1]) : match[1];\n\t\t}\n\n\t\tif (has('host-browser')) {\n\t\t\t// no further processing in browser environments\n\t\t\treturn tracepath + ':' + line + (col == null ? '' : ':' + col);\n\t\t}\n\n\t\tsource = pathUtil.relative('.', tracepath);\n\n\t\t// first, check for an instrumentation source map\n\t\tif (tracepath in instrumentationSourceMap) {\n\t\t\tmap = instrumentationSourceMap[tracepath];\n\t\t\toriginalPos = getOriginalPosition(map, line, col);\n\t\t\tline = originalPos.line;\n\t\t\tcol = originalPos.column;\n\t\t\tif (originalPos.source) {\n\t\t\t\tsource = originalPos.source;\n\t\t\t}\n\t\t}\n\n\t\t// next, check for original source map\n\t\tif ((map = getSourceMap(tracepath))) {\n\t\t\toriginalPos = getOriginalPosition(map, line, col);\n\t\t\tline = originalPos.line;\n\t\t\tcol = originalPos.column;\n\t\t\tif (originalPos.source) {\n\t\t\t\tsource = pathUtil.join(pathUtil.dirname(source), originalPos.source);\n\t\t\t}\n\t\t}\n\n\t\tresult = source + ':' + line;\n\t\tif (col !== null) {\n\t\t\tresult += ':' + col;\n\t\t}\n\t\treturn result;\n\t}", "title": "" }, { "docid": "95cf1558ce21c1a6c1b20fcdbcbdabf0", "score": "0.56077266", "text": "offsetToOriginalRelative (sourceMapScanner, startCol, endCol) {\n const lines = this.lines.filter((line, i) => {\n return startCol <= line.endCol && endCol >= line.startCol\n })\n if (!lines.length) {\n return []\n }\n\n const sourceMapIterator = sourceMapScanner.getIterator()\n let start = sourceMapIterator.scanTo(lines[0].line, startCol - lines[0].startCol)\n let last = start\n let endPos = { line: lines[lines.length - 1].line, col: endCol - lines[lines.length - 1].startCol }\n let returnLocs = []\n while (true) {\n let next = sourceMapIterator.next()\n const isPastEnd = !next || sourceMapIterator.isGeneratedAfter(next, endPos.line, endPos.col)\n\n if (isPastEnd || next.source !== start.source ||\n next.originalLine < start.originalLine ||\n (next.originalLine === start.originalLine && next.originalColumn < start.originalColumn)) {\n if (last !== start) {\n returnLocs.push({\n sourceFile: start.source,\n startLine: start.originalLine,\n relStartCol: start.originalColumn,\n endLine: last.originalLine,\n relEndCol: last.originalColumn\n })\n }\n if (isPastEnd) {\n break\n }\n start = next\n } else {\n\n // now we now we aren't going past the start (or different source) or the end etc.\n // if the next token is going back past the last, ignore it.\n if (next.originalLine < last.originalLine ||\n (next.originalLine === last.originalLine && next.originalColumn < last.originalColumn)) {\n continue\n }\n }\n\n last = next\n }\n return this._removeOverlapping(returnLocs)\n }", "title": "" }, { "docid": "f9298918214d3ce5d3a55d10dfee5a04", "score": "0.560391", "text": "function Mapping(){this.generatedLine=0;this.generatedColumn=0;this.source=null;this.originalLine=null;this.originalColumn=null;this.name=null;}", "title": "" }, { "docid": "f9298918214d3ce5d3a55d10dfee5a04", "score": "0.560391", "text": "function Mapping(){this.generatedLine=0;this.generatedColumn=0;this.source=null;this.originalLine=null;this.originalColumn=null;this.name=null;}", "title": "" }, { "docid": "df8844a99e526baeff9889ea698f2029", "score": "0.558359", "text": "function stacktrace_extract_fn_and_srcinfo(stackline) {\n var fn;\n if (stackline) {\n try {\n fn = {\n name: (stackline.indexOf(\"@\") > 0 /* FF detect */\n ? /* FF */ stackline.replace(/^([^@a-zA-Z_]*)([^@<]*)[<]*@.*$/, \"$2\")\n : /* Chrome / Safari */ stackline.replace(/^(.*at +(([^:]+) .*\\/\\/.*))|(.*at +[^ ]+)$/, \"$3\")\n ) || \"anonymous\",\n loc: (stackline.indexOf(\" -- \") > 0 /* Opera detect */\n ? /* Opera */ stackline.replace(/^(.*\\/code\\/chapter[^\\/]+\\/)?([^ )]+)\\)? -- .*$/, \"$2\")\n : (stackline.indexOf(\"@\") > 0 /* FF detect */\n ? /* FF */ stackline.replace(/^(.*\\/code\\/chapter[^\\/]+\\/)?([^ )]+)\\)?$/, \"$2\")\n : (stackline.indexOf(\"at \") >= 0 /* Chrome detect */\n ? /* Chrome / Chromium */ stackline.replace(/^.*at +(.*\\/code\\/chapter[^\\/]+\\/)?([^ )]+)\\)?( .*)?\\)?$/, \"$2\")\n : /* Safari don't do no lineno/srcfile info */ \"...\"\n )\n )\n )\n };\n // FF hotfix:\n if (fn.name == \"getCurrentFunctionName()\") {\n fn.name = \"anonymous\";\n }\n // Opera hotfix:\n if (fn.name.indexOf(\"getSource failed with url:\") >= 0) {\n fn.name = fn.name.replace(/^.*(object\\(.*\\)).*$/, \"$1\");\n fn.name = fn.name.replace(/object\\(/, \"anonymous(\");\n if (fn.name.indexOf(\"getSource failed with url:\") >= 0) {\n fn.name = \"anonymous\";\n }\n }\n fn.func_n_loc = fn.name + \" @ line \" + fn.loc;\n } catch(e) {\n fn = null;\n }\n }\n return fn || {\n name: \"...\",\n loc: \"???\",\n func_n_loc: \"...\"\n };\n}", "title": "" }, { "docid": "fe0e73a3f29876690dc5aeea0b13eebe", "score": "0.55096793", "text": "function loc () { return new schema.Location (cur.line, cur.col, src); }", "title": "" }, { "docid": "6e9af00eaa9cb4389c09ae046de5f749", "score": "0.5500773", "text": "function getErrorSource(error) {\n var match = /\\n at [^(]+ \\((.*):(\\d+):(\\d+)\\)/.exec(error.stack);\n if (match) {\n var source = match[1];\n var line = +match[2];\n var column = +match[3];\n\n // Support the inline sourceContents inside the source map\n var contents = fileContentsCache[source];\n\n // Support files on disk\n if (!contents && fs && fs.existsSync(source)) {\n try {\n contents = fs.readFileSync(source, 'utf8');\n } catch (er) {\n contents = '';\n }\n }\n\n // Format the line from the original source code like node does\n if (contents) {\n var code = contents.split(/(?:\\r\\n|\\r|\\n)/)[line - 1];\n if (code) {\n return source + ':' + line + '\\n' + code + '\\n' + new Array(column).join(' ') + '^';\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "6d4c6b2f17f7f09c15a81ce0e08835ee", "score": "0.54803807", "text": "function getErrorSource(error) {\n var match = /\\n at [^(]+ \\((.*):(\\d+):(\\d+)\\)/.exec(error.stack);\n if (match) {\n var source = match[1];\n var line = +match[2];\n var column = +match[3];\n\n // Support the inline sourceContents inside the source map\n var contents = fileContentsCache[source];\n\n // Support files on disk\n if (!contents && fs && fs.existsSync(source)) {\n contents = fs.readFileSync(source, 'utf8');\n }\n\n // Format the line from the original source code like node does\n if (contents) {\n var code = contents.split(/(?:\\r\\n|\\r|\\n)/)[line - 1];\n if (code) {\n return source + ':' + line + '\\n' + code + '\\n' + new Array(column).join(' ') + '^';\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "cb1aa19d24adc654a6a6f1f3e34433d2", "score": "0.5449661", "text": "traceMappings() {\n\t\tconst mappings = [];\n\t\tconst names = new FastStringArray();\n\t\tconst sources = new FastStringArray();\n\t\tconst sourcesContent = [];\n\t\tconst { mappings: rootMappings, names: rootNames } = this.map;\n\t\tfor (let i = 0; i < rootMappings.length; i++) {\n\t\t\tconst segments = rootMappings[i];\n\t\t\tconst tracedSegments = [];\n\t\t\tfor (let j = 0; j < segments.length; j++) {\n\t\t\t\tconst segment = segments[j];\n\t\t\t\t// 1-length segments only move the current generated column, there's no\n\t\t\t\t// source information to gather from it.\n\t\t\t\tif (segment.length === 1) continue;\n\t\t\t\tconst source = this.sources[segment[1]];\n\t\t\t\tconst traced = source.traceSegment(\n\t\t\t\t\tsegment[2],\n\t\t\t\t\tsegment[3],\n\t\t\t\t\tsegment.length === 5 ? rootNames[segment[4]] : \"\"\n\t\t\t\t);\n\t\t\t\tif (!traced) continue;\n\t\t\t\t// So we traced a segment down into its original source file. Now push a\n\t\t\t\t// new segment pointing to this location.\n\t\t\t\tconst { column, line, name } = traced;\n\t\t\t\tconst { content, filename } = traced.source;\n\t\t\t\t// Store the source location, and ensure we keep sourcesContent up to\n\t\t\t\t// date with the sources array.\n\t\t\t\tconst sourceIndex = sources.put(filename);\n\t\t\t\tsourcesContent[sourceIndex] = content;\n\t\t\t\t// This looks like unnecessary duplication, but it noticeably increases\n\t\t\t\t// performance. If we were to push the nameIndex onto length-4 array, v8\n\t\t\t\t// would internally allocate 22 slots! That's 68 wasted bytes! Array\n\t\t\t\t// literals have the same capacity as their length, saving memory.\n\t\t\t\tif (name) {\n\t\t\t\t\ttracedSegments.push([\n\t\t\t\t\t\tsegment[0],\n\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\tline,\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\tnames.put(name),\n\t\t\t\t\t]);\n\t\t\t\t} else {\n\t\t\t\t\ttracedSegments.push([segment[0], sourceIndex, line, column]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmappings.push(tracedSegments);\n\t\t}\n\t\t// TODO: Make all sources relative to the sourceRoot.\n\t\treturn defaults(\n\t\t\t{\n\t\t\t\tmappings,\n\t\t\t\tnames: names.array,\n\t\t\t\tsources: sources.array,\n\t\t\t\tsourcesContent,\n\t\t\t},\n\t\t\tthis.map\n\t\t);\n\t}", "title": "" }, { "docid": "0a8bcbd134365d0b2c62b947d57cfe10", "score": "0.5437621", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var sublineIndex = Math.floor(columnNum / 80);\n var sublineColumnNum = columnNum % 80;\n var sublines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n sublines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), sublines[0]]].concat(sublines.slice(1, sublineIndex + 1).map(function (subline) {\n return ['', subline];\n }), [[' ', whitespace(sublineColumnNum - 1) + '^'], ['', sublines[sublineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "0a8bcbd134365d0b2c62b947d57cfe10", "score": "0.5437621", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var sublineIndex = Math.floor(columnNum / 80);\n var sublineColumnNum = columnNum % 80;\n var sublines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n sublines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), sublines[0]]].concat(sublines.slice(1, sublineIndex + 1).map(function (subline) {\n return ['', subline];\n }), [[' ', whitespace(sublineColumnNum - 1) + '^'], ['', sublines[sublineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "0a8bcbd134365d0b2c62b947d57cfe10", "score": "0.5437621", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var sublineIndex = Math.floor(columnNum / 80);\n var sublineColumnNum = columnNum % 80;\n var sublines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n sublines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), sublines[0]]].concat(sublines.slice(1, sublineIndex + 1).map(function (subline) {\n return ['', subline];\n }), [[' ', whitespace(sublineColumnNum - 1) + '^'], ['', sublines[sublineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "0a8bcbd134365d0b2c62b947d57cfe10", "score": "0.5437621", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var sublineIndex = Math.floor(columnNum / 80);\n var sublineColumnNum = columnNum % 80;\n var sublines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n sublines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), sublines[0]]].concat(sublines.slice(1, sublineIndex + 1).map(function (subline) {\n return ['', subline];\n }), [[' ', whitespace(sublineColumnNum - 1) + '^'], ['', sublines[sublineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "0a8bcbd134365d0b2c62b947d57cfe10", "score": "0.5437621", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var sublineIndex = Math.floor(columnNum / 80);\n var sublineColumnNum = columnNum % 80;\n var sublines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n sublines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), sublines[0]]].concat(sublines.slice(1, sublineIndex + 1).map(function (subline) {\n return ['', subline];\n }), [[' ', whitespace(sublineColumnNum - 1) + '^'], ['', sublines[sublineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "95f891ba8726ccc44ba787c6d515d243", "score": "0.5433894", "text": "traceSegment(line, column, name) {\n\t\tconst { mappings, names } = this.map;\n\t\t// It's common for parent sourcemaps to have pointers to lines that have no\n\t\t// mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n\t\tif (line >= mappings.length) return null;\n\t\tconst segments = mappings[line];\n\t\tif (segments.length === 0) return null;\n\t\tlet index = binarySearch(segments, column, segmentComparator$1);\n\t\tif (index === -1) return null; // we come before any mapped segment\n\t\t// If we can't find a segment that lines up to this column, we use the\n\t\t// segment before.\n\t\tif (index < 0) {\n\t\t\tindex = ~index - 1;\n\t\t}\n\t\tconst segment = segments[index];\n\t\t// 1-length segments only move the current generated column, there's no\n\t\t// source information to gather from it.\n\t\tif (segment.length === 1) return null;\n\t\tconst source = this.sources[segment[1]];\n\t\t// So now we can recurse down, until we hit the original source file.\n\t\treturn source.traceSegment(\n\t\t\tsegment[2],\n\t\t\tsegment[3],\n\t\t\t// A child map's recorded name for this segment takes precedence over the\n\t\t\t// parent's mapped name. Imagine a mangler changing the name over, etc.\n\t\t\tsegment.length === 5 ? names[segment[4]] : name\n\t\t);\n\t}", "title": "" }, { "docid": "c9ad6950d34435e895e2323c19c8a7db", "score": "0.54326576", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "c9ad6950d34435e895e2323c19c8a7db", "score": "0.54326576", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "c9ad6950d34435e895e2323c19c8a7db", "score": "0.54326576", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "c9ad6950d34435e895e2323c19c8a7db", "score": "0.54326576", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "c9ad6950d34435e895e2323c19c8a7db", "score": "0.54326576", "text": "function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" }, { "docid": "6937853685b75edfda9ab6de257fa77e", "score": "0.5431816", "text": "function Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n }", "title": "" } ]
0cf237a450055cad29576d7044f6a209
Method: displayInterface() Input: adl, scorm, testsuite, testlog Output: none Description: This function is responsbile for displaying test information.
[ { "docid": "8877a2af3bb13df4b2348a9967832175", "score": "0.8027", "text": "function displayInterface(adl, scorm, testsuite, testlog)\n {\n\t parent.logFrame.appendHTML(\n \"<p style='text-align:center;'><span class='ADLTitle'>\"+adl+\"</span><br />\" +\n\t \"<span class='logTitle'>\"+scorm+\"</span><br />\" +\n\t \"<span class='logTitle'>\"+testsuite+\"</span><br />\" +\n\t \"<span class='logTitle'>\"+testlog+\"</span><br /><br />\");\n }", "title": "" } ]
[ { "docid": "021769a4eb09b2e8f8035b9516af4777", "score": "0.6245465", "text": "function runDisplayTests(){\n\tlet className = \"Display\";\n\tif(!RUN_DISPLAY_TEST){\n\t\treturn;\n\t}\n\tlet display;\n\tlet displayId = \"displayTestId\";\n\tlet maxId = \"maxTestId\";\n\tlet ele1;\n\tlet ele2;\n\tlet ele1Txt;\n\tlet ele2Txt;\n\tlet num1;\n\tlet num2;\n\tlet num3;\n\tlet value1;\n\tlet value2;\n\tlet value3;\n\t\n\tstartTestsMsg(className);\n\ttest(\"MyError\", className, [null, \"abc\"], \"toString\", [], true);\n\ttest(\"MyError\", className, [\"abc\", null], \"toString\", [], true);\n\ttest(\"MyError\", className, [\"abc\", 12], \"toString\", [], true);\n\ttest(\"MyError\", className, [\"abc\", true], \"toString\", [], true);\n\ttest(\"MyError\", className, [12, \"abc\"], \"toString\", [], true);\n\ttest(\"MyError\", className, [true, \"abc\"], \"toString\", [], true);\n\ttest(\"MyError\", className, [\"abc\", \"abc\"], \"show\", [null], true);\n\ttest(\"MyError\", className, [\"abc\", \"abc\"], \"show\", [\"\"], true);\n\ttest(\"MyError\", className, [\"abc\", \"abc\"], \"setDisplayValue\", [1], true);\n\ttest(\"MyError\", className, [\"abc\", \"abc\"], \"setDisplayValue\", [null], true);\n\ttest(\"MyError\", className, [\"abc\", \"abc\"], \"setDisplayValue\", [\"1\"], true);\n\ttest(displayId+\",\"+maxId, className, [displayId, maxId], \"toString\");\n\t\n\tele1 = generateTestTag(displayId);\n\tele2 = generateTestTag(maxId);\n\tvalue1 = \"325\";\n\tnum1 = new Number(value1);\n\tdisplay = new Display(displayId, maxId);\n\tdisplay.show(num1);\n\tele1Txt = document.getElementById(displayId).innerHTML;\n\tele2Txt = document.getElementById(maxId).innerHTML;\n\tif(ele1Txt === value1){\n\t\tgreenLog(\"Display.show() change displayId innerHTML\");\n\t}else{\n\t\tredLog(\"Display.show() do not change displayId innerHTML\");\n\t}\n\tif(ele2Txt === \"\"){\n\t\tgreenLog(\"Display.show() change maxId innerHTML\");\n\t}else{\n\t\tredLog(\"Display.show() do not change maxId innerHTML\");\n\t}\n\tvalue1 = num1.getMax();\n\tnum1 = new Number(value1);\n\tdisplay.show(num1);\n\tele2Txt = document.getElementById(maxId).innerHTML;\n\tif(ele2Txt === \"max\"){\n\t\tgreenLog(\"Display.show() change maxId innerHTML\");\n\t}else{\n\t\tredLog(\"Display.show() do not change maxId innerHTML\");\n\t}\n\tvalue1 = num1.getMin();\n\tnum1 = new Number(value1);\n\tdisplay.show(num1);\n\tele2Txt = document.getElementById(maxId).innerHTML;\n\tif(ele2Txt === \"min\"){\n\t\tgreenLog(\"Display.show() change maxId innerHTML\");\n\t}else{\n\t\tredLog(\"Display.show() do not change maxId innerHTML\");\n\t}\n\tvalue1 = \"-0\";\n\tnum1 = new Number(value1);\n\tdisplay.show(num1);\n\tele1Txt = document.getElementById(displayId).innerHTML;\n\tif(ele1Txt === \"0\"){\n\t\tgreenLog(\"Display.show() change displayId innerHTML\");\n\t}else{\n\t\tredLog(\"Display.show() do not change displayId innerHTML\");\n\t}\n\tremoveTestTag(ele1);\n\tremoveTestTag(ele2);\n\t\n}", "title": "" }, { "docid": "5926e458971b20697575e90b55c063ea", "score": "0.6169064", "text": "function showTesting() {\n selectAllH().append(function() {\n // let's see the tag names (for test)\n return ' (' + $(this).prop('tagName') + ', ' + $(this).prop('id') + ')';\n });\n }", "title": "" }, { "docid": "50dac095e1bdfaff61f708a6fa1560ca", "score": "0.57895404", "text": "function printTestResults(){\n\tconsole.log(\"------ TEST RESULTS ------\");\n\tconsole.log(succeded + \" tests succeeded\");\n\tconsole.log(failed + \" tests failed\");\n\tconsole.log(\"--------------------------\");\n}", "title": "" }, { "docid": "8d1f3a03d2dd8c5f748baba4377452ec", "score": "0.57401675", "text": "function updateTests() {\n document.getElementById(\"tests\").innerHTML = \"<h1>Test suite</h1><br/>\" + assert.tests.map(test => test + \"<br/>\" + \"<hr>\").join(\" \")\n}", "title": "" }, { "docid": "c191dcfa9842b833f9ea07bf6e2b7b1e", "score": "0.5739669", "text": "function refreshConsole() {\n var html = [];\n eachSuite(data, function (suite) {\n // Check if we want to show the suite at all. Store this information in the model.\n var showSuite = state.filter.withoutoutput;\n var outputShown = true;\n var insideTest = false;\n $.each(suite.executionEvents, function(index, evtobj) {\n switch (evtobj.event) {\n case \"TEST_STARTED\":\n outputShown = currentFilter(evtobj.test);\n insideTest = true;\n break;\n\n case \"TEST_FINISHED\":\n insideTest = false;\n break;\n\n case \"APPEND_STDOUT\":\n case \"APPEND_STDERR\":\n if ((insideTest && outputShown) || !insideTest) {\n showSuite = true;\n }\n outputShown = true;\n break;\n }\n evtobj.shown = outputShown;\n });\n\n if (!showSuite) {\n return true; // continue the loop\n }\n\n html.push(\"<div class='suitebox'>\",\n \"<div class='name'>\", suite.description.displayName, \"</div>\",\n \"<pre class='outbox'>\");\n\n var emptyOutBoxIndex = html.length - 1;\n $.each(suite.executionEvents, function(index, evtobj) {\n var shown = evtobj.shown;\n delete evtobj.shown;\n if (!shown) {\n return true; // continue the loop\n }\n\n switch (evtobj.event) {\n case \"SUITE_FAILURE\":\n html.push(\"<span class='failure marker' />\",\n \"<span class='side'><div><span class='suitefailure tag FAILURE'>suite failure</span></div></span>\");\n break;\n\n case \"TEST_STARTED\":\n // Add a content wrapper for the test...\n html.push(\"<span class='test' id='c\", evtobj.description.htmlId, \"'>\",\n \"<span class='start marker' />\",\n \"<span class='side'><div><span class='test label tag \",\n evtobj.test.status, \"'>\", evtobj.description.methodName,\n \"</span></div></span>\");\n break;\n\n case \"APPEND_STDOUT\":\n case \"APPEND_STDERR\":\n html.push(\"<span class='\", evtobj.event == \"APPEND_STDOUT\" ? \"out\" : \"err\", \"'>\", \n \t\thtmlEscape(evtobj.content), \"</span>\");\n emptyOutBoxIndex = undefined;\n break;\n\n case \"TEST_FINISHED\":\n html.push(\"</span>\");\n break;\n\n default:\n // do nothing.\n }\n });\n if (emptyOutBoxIndex !== undefined) {\n html[emptyOutBoxIndex] = html[emptyOutBoxIndex].replace(/outbox/, \"outbox empty\");\n }\n html.push(\"</pre></div>\");\n });\n if (html.length == 0) {\n html.push(\"<div class='nooutput'>No console output</div>\");\n }\n $console.html(html.join(\"\"));\n\n redrawConnectors();\n }", "title": "" }, { "docid": "61fcdd252bf12fb398ac3a650b6e7afd", "score": "0.5723173", "text": "function showAnswers(test) {\n\ttest.visibility = true;\n}", "title": "" }, { "docid": "1a7ccc992bb298e4727226a64fbf6c83", "score": "0.56666744", "text": "function displayOverview(transport) {\n\n var contentDiv = $('main_content_div');\n contentDiv.innerHTML = transport.responseText;\n document.body.style.cursor = \"default\";\n initSubtab(\"overview\");\n toggleHypothesis();\n initEditableFields();\n //Update the report-level contextual help content\n theHelpWindow.updateContent($(\"help-dataset-info-overview\"));\n //Make the request button work\n jQuery('.request_link').click(createRequest);\n //For QA testing\n loadedForQA(\"true\");\n}", "title": "" }, { "docid": "d7d131ed7cf98e49a7158d7474305ed3", "score": "0.565053", "text": "function clickedTest() {\n // Update RECORDSET_SBOBJ from the UI.\n\tupdateSBRecordsetObject();\n\tfillAditionalParameters(RECORDSET_SBOBJ, 'test');\n\n\trecordsetDialog.displayTestDialog(RECORDSET_SBOBJ);\n}", "title": "" }, { "docid": "58cbc0f28bd3a43805f2c78e9ecfdd83", "score": "0.5618264", "text": "function showAllSubstepsOfTestspec(imageForTestSpec) {\n\tshowAllSubsteps(locateTestSpecTable(imageForTestSpec));\n}", "title": "" }, { "docid": "03f193cad6ac8a60d206d00d02d8cbb7", "score": "0.55890685", "text": "function displaySamplesContent(transport) {\n var contentDiv = $('main_content_div');\n contentDiv.innerHTML = transport.responseText;\n document.body.style.cursor = \"default\";\n initSubtab(\"samples\");\n jQuery('.sortByColumn').click(requestSamples);\n //Update the report-level contextual help content\n theHelpWindow.updateContent($(\"help-dataset-info-samples\"));\n\n loadedForQA(\"true\");\n}", "title": "" }, { "docid": "3ac0feea80bdfded7dee2ce6a427ea42", "score": "0.5587282", "text": "function setupDisplay()\n{\n //Display the introduction in the console.\n var console = document.getElementById(\"console\");\n console.value = \"\";\n processResponse(\"display_intro_text\");\n\n //Put the focus on the user input text field.\n var userInput = document.getElementById(\"user_input\");\n userInput.focus();\n}", "title": "" }, { "docid": "3504d608033b5bbcb159dd8b33ece5c0", "score": "0.5581074", "text": "static showTests(tests) {\n\t\tconst testsDiv = document.getElementById(\"tests\");\n\t\tconst testDivs = testsDiv.getElementsByClassName(\"test\");\n\t\tconst testTemplate = testDivs.item(0);\n\n\t\tdocument.getElementById(\"noTestsYet\").classList.add(\"hide\");\n\n\t\twhile (testDivs.length > 1)\n\t\t\ttestsDiv.removeChild(testDivs.item(1));\n\n\t\tif (tests && tests.length > 0) {\n\t\t\tfor (const test of tests) {\n\t\t\t\tconst tDiv = testTemplate.cloneNode(true);\n\t\t\t\ttDiv.classList.remove(\"hide\");\n\n\t\t\t\tif (test.hasOwnProperty(\"alert\")) {\n\t\t\t\t\ttDiv.classList.add(\"alert\");\n\t\t\t\t\ttDiv.getElementsByClassName(\"name\").item(0).textContent = \"Observera!\";\n\t\t\t\t\tController.formatTextBody(test.alert, tDiv.getElementsByClassName(\"purpose\").item(0));\n\t\t\t\t} else {\n\t\t\t\t\ttDiv.getElementsByClassName(\"name\").item(0).textContent = test.name;\n\t\t\t\t\tController.formatTextBody(test.purpose, tDiv.getElementsByClassName(\"purpose\").item(0));\n\t\t\t\t}\n\n\t\t\t\ttestsDiv.appendChild(tDiv);\n\t\t\t}\n\t\t} else if (tests && tests.length === 0) {\n\t\t\tdocument.getElementById(\"noTests\").classList.remove(\"hide\");\n\t\t} else {\n\t\t\tdocument.getElementById(\"noTestsYet\").classList.remove(\"hide\");\n\t\t}\n\t}", "title": "" }, { "docid": "04c66480deceb4e730723411d99144c3", "score": "0.5578302", "text": "display() {\n console.log(\"Title: %s\", this.title);\n console.log(\"Author: %s\", this.author);\n console.log(\"Price: %i\", this.price);\n }", "title": "" }, { "docid": "7cef4be77f6169708a7a481d75547059", "score": "0.55731606", "text": "DisplayUI(int, string, string, Variant, IUnknown) {\n\n }", "title": "" }, { "docid": "6d800c8f912ddfeb75df117b474be121", "score": "0.5517247", "text": "function displayStepList(transport) {\n var contentDiv = $('main_content_div');\n contentDiv.innerHTML = transport.responseText;\n document.body.style.cursor = \"default\";\n\n initSubtab(\"stepList\");\n if ($('step_list')) {\n var exportAllowed = \"true\";\n if ($('datasetExportAllowed')) {\n exportAllowed = $('datasetExportAllowed').value;\n }\n options = new Array();\n options['exportCall'] = startExport;\n options['exportAllowed'] = exportAllowed;\n pageGrid = new PageGrid('step_list', 'Step List', 'DatasetInfo', options);\n }\n\n //Update the report-level contextual help content\n theHelpWindow.updateContent($(\"help-dataset-info-step-list\"));\n //For QA testing\n loadedForQA(\"true\");\n}", "title": "" }, { "docid": "7094008a9012a170db2469869fb7430b", "score": "0.5515095", "text": "function printTestInfo(string) {\n casper.echo('INFO: ' + string, 'INFO');\n}", "title": "" }, { "docid": "2cd440907ab596d28acc3cb9536e3167", "score": "0.55110675", "text": "function display() {\n }", "title": "" }, { "docid": "54baaf68e4835a1b53e1d17f3f91e3ab", "score": "0.5504629", "text": "function showResultsTest(data) {\n // Build results HTML\n $(\"#results\").html(data);\n}", "title": "" }, { "docid": "96dae8d03cf3b6283856726430c3faa0", "score": "0.5471225", "text": "function display_result_tab () {\n\n\t\t//Set current view to result tab\n\t\tcurrent_view = \"result-view\";\n\n\t\t/*Pedagogy part*/\n\n\t\t/*Show instructions when clicked for the first time*/\n\t\tresult_show_instruct();\n\t\t/*Append only if results tab is clicked for the first time*/\n\t\tif (result_tab_count == 0) {\n\t\t\t$('#hyp_interpretation').html(\"\");\n\t\t\tvar order = hyp_test_plan_data.length;\n\t\t\tvar temp_hyp = hyp_test_plan_data[order-1];\n\tconsole.log(now_count + \" in the display_result_tab : \");\n\tconsole.log(hyp_test_plan_data);\t\t\t\t\n/*\t\t\tconsole.log(\"Inside display result tab\");\n\t\t\tconsole.log(\"test_no : \" + test_no);\n\t\t\tconsole.log(temp_hyp);*/\n\t\t\t$('<ul/>', {\n\t\t\t\t 'id':'hyp_info_list',\n\t\t\t\t \t'style':'list-style:none;'\n\t\t\t\t}).appendTo('#hyp_interpretation');\n\n\t\t\t$('<li/>', {\n\t\t\t\t 'id':'tested_hyp',\n\t\t\t\t \t'text': 'Hypothesis: ' + cur_hyp_state.hypothesis\n\t\t\t\t}).appendTo('#hyp_info_list');\n\n\t\t\t$('<li/>', {\n\t\t\t\t 'id':'tested_device',\n\t\t\t\t \t'text':'Device: ' + cur_hyp_state.test_plan[test_no].device\n\t\t\t\t}).appendTo('#hyp_info_list');\n\n\t\t\t$('<li/>', {\n\t\t\t\t 'id':'tested_plan',\n\t\t\t\t \t'text':'Plan: ' + cur_hyp_state.test_plan[test_no].plan\n\t\t\t\t}).appendTo('#hyp_info_list');\n\n\t\t\t$('<li/>', {\n\t\t\t\t 'id':'test_prediction',\n\t\t\t\t \t'text':'Prediction: ' + cur_hyp_state.test_plan[test_no].prediction\n\t\t\t\t}).appendTo('#hyp_info_list');\n\n\t\t\tresult_tab_count = 1;\n\t\t}\n\t}", "title": "" }, { "docid": "2628e386fbd11bd1b74449326f2f5ce1", "score": "0.54692614", "text": "function displayResults( ) {\n\tconsole.log( \"Doors:\" , doors );\n\tconsole.log( \"Player 1 : \" , player1Choice );\n\tconsole.log( \"Player 2 : \" , player2Choice );\n\tconsole.log( \"Host : \" , hostChoice );\n}", "title": "" }, { "docid": "950efe72d1b59ad95075599e7644b910", "score": "0.5462699", "text": "function test(test) {\n\t var attrs = {\n\t classname: test.parent.fullTitle()\n\t , name: test.title\n\t , time: (test.duration / 1000) || 0\n\t };\n\n\t if ('failed' == test.state) {\n\t var err = test.err;\n\t console.log(tag('testcase', attrs, false, tag('failure', {}, false, cdata(escape(err.message) + \"\\n\" + err.stack))));\n\t } else if (test.pending) {\n\t console.log(tag('testcase', attrs, false, tag('skipped', {}, true)));\n\t } else {\n\t console.log(tag('testcase', attrs, true) );\n\t }\n\t}", "title": "" }, { "docid": "1ca3118cbbaf204c2624670e22970ef5", "score": "0.54595244", "text": "function showStats () {\n const tests = passed + failed\n if (tests > 0) {\n if (failed === 0) {\n if (passed === 1) {\n console.log('The test passed')\n } else {\n console.log(`All ${tests} tests passed`)\n }\n } else {\n if (tests === 1) {\n console.log(`The test failed`)\n } else {\n console.log(`${failed} of ${tests} tests failed`)\n }\n }\n reset()\n }\n}", "title": "" }, { "docid": "a10a2589d859ef769fc0b46aac065d72", "score": "0.5454413", "text": "function DisplayLibrary() {\n\n\tthis.darkenDisplay = function() {\n\t\t$('*').css(\"background-color\", \"black\");\n\t\t$('*').css(\"border-color\", \"black\");\n\t\t$('*').css(\"color\", \"gray\");\n\t\treturn \"\";\n\t}\n\tthis.lowerConsole = function() {\n\t\t$(WebConsole.instance.formSelector).css(\"height\", \"50px\");\n\t\treturn \"\";\n\t}\n\tthis.standardConsole = function() {\n\t\t$(WebConsole.instance.formSelector).css(\"height\", \"200px\");\n\t\treturn \"\";\n\t}\n\tthis.fullConsole = function() {\n\t\t$(WebConsole.instance.formSelector).css(\"height\", \"100%\");\n\t\t$(WebConsole.instance.formSelector).css(\"z-index\", \"100\");\n\t\t$(WebConsole.instance.formSelector).hide();\n\t\treturn \"\";\n\t}\n\tthis.clearConsole = function() {\n\t\tif(WebConsole.instance) {\n\t\t\tWebConsole.instance.generateInterface();\n\t\t}\n\t\treturn \"\";\n\t}\n\t\n\tthis.definition = {\n\t\tname: \"Display\",\n\t\tcommands: [\n\t\t\t{\n\t\t\t\tpattern: \"^darken display$\",\n\t\t\t\taction: this.darkenDisplay,\n\t\t\t\tsigniture: \"darken display\",\n\t\t\t\tdescription: \"darken the display\"},\n\t\t\t{\n\t\t\t\tpattern: \"^lower console$\",\n\t\t\t\taction: this.darkenDisplay,\n\t\t\t\tsigniture: \"lower console\",\n\t\t\t\tdescription: \"lower the console\"},\n\t\t\t{\n\t\t\t\tpattern: \"^standard console$\",\n\t\t\t\taction: this.darkenDisplay,\n\t\t\t\tsigniture: \"standard console\",\n\t\t\t\tdescription: \"return console to 200px\"},\n\t\t\t{\n\t\t\t\tpattern: \"^full console$\",\n\t\t\t\taction: this.darkenDisplay,\n\t\t\t\tsigniture: \"full console\",\n\t\t\t\tdescription: \"fill screen w/ console\"},\n\t\t\t{\n\t\t\t\tpattern: \"^clear$\",\n\t\t\t\taction: this.clearConsole,\n\t\t\t\tsigniture: \"clear\",\n\t\t\t\tdescription: \"clear the console\"}\n\t\t]\n\t};\n}", "title": "" }, { "docid": "bffe29ea873a6f621a746646f95ab9ab", "score": "0.54438287", "text": "function Display() {\n\n}", "title": "" }, { "docid": "9281a03c8440f4babdbb4e4cc8c20ad4", "score": "0.54410374", "text": "function _drawTest() {\n let template = \"\"\n ProxyState.tests.forEach(t => template += t.Template)\n document.getElementById(\"testsHere\").innerHTML = template\n}", "title": "" }, { "docid": "202edfc54f0868792c71bed3e3cb1d91", "score": "0.5429743", "text": "function runTestSuite() {\n testLiveOrDie();\n testInit();\n // toggleRun will only produce one result without fully init-ed\n // state and living cells on the board - likewise for runForward\n // and stepForward because everything is dead, no updates needed\n }", "title": "" }, { "docid": "e7bc29b95395f24a9d7dfafbc6e73aff", "score": "0.54216224", "text": "printSummary() {\r\n doneCallback();\r\n \r\n const elapsed = process.hrtime(this.startTime);\r\n console.log(`Tests run in ${elapsed[0] + elapsed[1]/1e9} seconds`);\r\n console.log(`${testStats.passed} tests passed`);\r\n console.log(`${testStats.failed} tests failed`);\r\n console.log(`${testStats.missed} tests missed because of failing tests`);\r\n console.log();\r\n \r\n this.errorList.forEach(([title, message]) => {\r\n console.log(\"**Failed:\", title);\r\n console.log(message);\r\n console.log();\r\n });\r\n }", "title": "" }, { "docid": "32cf5adedbd84a87e65283240fabe10e", "score": "0.5410416", "text": "function showAvailableTests() {\n\n\tconst main = document.getElementById(\"main\");\n\tconst ul = document.createElement(\"ul\");\n\n\tlet test, li, a;\n\n\tfor(test of tests) {\n\n\t\tli = document.createElement(\"li\");\n\n\t\ta = document.createElement(\"a\");\n\t\ta.appendChild(document.createTextNode(test));\n\t\ta.setAttribute(\"href\", \"#\" + test);\n\t\ta.setAttribute(\"id\", test);\n\t\ta.addEventListener(\"click\", runTest);\n\n\t\tli.appendChild(a);\n\t\tul.appendChild(li);\n\n\t}\n\n\tmain.appendChild(ul);\n\n}", "title": "" }, { "docid": "3a0d209e8398955350b1827ff9e7bab6", "score": "0.54102266", "text": "function screenTraining() {\n setDescriptionPage();\n\n resetDataField(); // Empty the data so we can put only string.\n Data.filename=\"Subject\"+Data.userID+\"_Header.txt\";\n Data.data[0]=\"Subject ID = \"+Data.userID+\"\\n\"+\n \"Data Set Number = \"+currentDataSet+\"\\n\"+\n \"Start Training Trials: \"+new Date()+\"\\n\";\n\n saveFile(); // Save the Header file.\n changeDataType('training'); // Change from demo to training.\n\n $(\"div#description\").html($(\"div#response\").html());\n reset(\"div#description\");\n}", "title": "" }, { "docid": "d668012debc27481a16ee8e05a371aa0", "score": "0.5405421", "text": "function interfaceExplainer() {\n\tconst messageName = document\n\t\t.getElementById('interface')\n\t\t.selectedOptions[0].dataset.explainer\n\tconst explainer = document.getElementById('interface-explainer')\n\texplainer.innerText = browser.i18n.getMessage(messageName)\n}", "title": "" }, { "docid": "03124bd31791d05cc203db0c2c0b1af2", "score": "0.5393861", "text": "function printDiagnostics(test) {\n console.info('input:');\n console.info(test.input);\n console.info('expected:');\n console.info(test.output);\n console.info('actual:');\n console.info($.getParams(test.input));\n}", "title": "" }, { "docid": "1506b3ebe8429cc8553a452f3992be86", "score": "0.5388772", "text": "function startTest() {\n hideEl(\"js-front\");\n\n showEl(\"js-quiz\");\n showEl(\"js-instructions\");\n\n updateScoreDisplay();\n\n showNewLetter();\n }", "title": "" }, { "docid": "bc9eeacdda42db91b4816497b3d4e8c6", "score": "0.5387715", "text": "function testRunner() {\n body.urn.forEach( function(i) {\n collectScreen(i, renderResults);\n });\n }", "title": "" }, { "docid": "6e6e5d9c201138127f6f570ff41e5ff5", "score": "0.53739434", "text": "function showResults() {}", "title": "" }, { "docid": "24ccf63350ff595ae1c4706233812486", "score": "0.53551143", "text": "function test(test) {\n var attrs = {\n classname: test.parent.fullTitle()\n , name: test.title\n , time: (test.duration / 1000) || 0\n };\n\n if ('failed' == test.state) {\n var err = test.err;\n attrs.message = escape(err.message);\n console.log(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack))));\n } else if (test.pending) {\n console.log(tag('testcase', attrs, false, tag('skipped', {}, true)));\n } else {\n console.log(tag('testcase', attrs, true) );\n }\n}", "title": "" }, { "docid": "24ccf63350ff595ae1c4706233812486", "score": "0.53551143", "text": "function test(test) {\n var attrs = {\n classname: test.parent.fullTitle()\n , name: test.title\n , time: (test.duration / 1000) || 0\n };\n\n if ('failed' == test.state) {\n var err = test.err;\n attrs.message = escape(err.message);\n console.log(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack))));\n } else if (test.pending) {\n console.log(tag('testcase', attrs, false, tag('skipped', {}, true)));\n } else {\n console.log(tag('testcase', attrs, true) );\n }\n}", "title": "" }, { "docid": "b4d95db7dcbe415749e656606a645dd1", "score": "0.5353295", "text": "display() {\n super.display();\n }", "title": "" }, { "docid": "cb2fc346513b7d1fd8e802eea64048b9", "score": "0.53480357", "text": "function testAreaGroup(parent){\r\n\tvar g1 = parent.add(\"group\");\r\n\tg1.key = \"testAreaGroup\";\r\n\tg1.spacing = 4;\r\n\tg1.orientation = \"column\";\r\n\r\n\tvar tp = g1.add(\"tabbedpanel\");\r\n\t\r\n\tfor(var all in TestManager){\r\n\t\tif(typeof TestManager[all] != 'function'){\r\n\t\t\tif(!SESSION.documentExists && all == \"artBindings\"){\r\n\t\t\t\t// don't even make a binding test tab when there's no document open\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\ttp[TestManager[all].key] = TestManager[all].makeTab(tp);\r\n\t\t}\r\n\t}\r\n\r\n\tvar g_btn = g1.add(\"group\");\r\n\tvar btn_refreshTest = g_btn.add(\"button\", undefined, \"Refresh Test\");\r\n\tbtn_refreshTest.size = [250, 30];\r\n\r\n\tbtn_refreshTest.onClick = function(){\r\n\t\tif(DATA.currentVars.length == 0){\r\n\t\t\talert(\"Please import a data file first.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tDATA.getCurrentGrid();\r\n\t\tvar thisTab;\r\n\t\tfor(var i = 0; i < tp.children.length; i++){\r\n\t\t\tthisTab = tp.children[i];\r\n\t\t\tif(thisTab.text != \"Art Bindings\"){\r\n\t\t\t\t// populate all places where image or graph files are listed (Prepend Paths group)\r\n\t\t\t\tthisTab.populateFields();\r\n\t\t\t\tfor (var all in this.window.UITestElements) {\r\n\t\t\t\t\tthisElem = this.window.UITestElements[all];\r\n\t\t\t\t\tif(thisElem.hasOwnProperty(\"key\") && thisElem.key == thisTab.key && typeof thisElem.setValue == 'function'){\r\n\t\t\t\t\t\tthisElem.setValue(thisTab.contents.disp_foundMissingNum.getValue());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if(tp.selection.text == \"Art Bindings\" && SESSION.documentExists){\r\n\t\t\t\t// populate the \"Find Art\" display (Options group)\r\n\t\t\t\tdisplayFoundArtBindings(parent.window.UITestElements);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tparent.window.UITestElements[\"testTabs\"] = tp;\r\n\r\n\treturn g1;\r\n}", "title": "" }, { "docid": "85738596e3ea4315ba93fc963c88b354", "score": "0.5347252", "text": "async function renderTestResults() {\n let content = \"\";\n let nav = \"\";\n let displayIndex = undefined;\n for (let i = 0; i < results.length; i++) {\n const result = results[i];\n if (!result.correct) {\n allCorrect = false;\n if (displayIndex === undefined) displayIndex = i; // Show the first failing test\n }\n const icon = result.correct\n ? `<i class=\"fa fa-check col-green\" aria-label=\"${i18n.get(\"correct\")}\"></i>`\n : `<i class=\"fa fa-times col-light-red\" aria-label=\"${i18n.get(\"incorrect\")}\"></i>`;\n\n content += `<div id=\"test-${i + 1}\" class=\"collapse\" aria-labelledby=\"test-nav-${\n i + 1\n }\" data-parent=\"#query-out-table\">`;\n content += await result.render();\n content += `</div>`;\n\n nav += `<li class=\"nav-item\">\n <button id=\"test-nav-${\n i + 1\n }\" class=\"nav-link mr-1 collapsed\" aria-expanded=\"false\" data-toggle=\"collapse\" data-target=\"#test-${\n i + 1\n }\" aria-controls=\"test-${i + 1}\" onclick=\"preserveTaskBoxHeight()\">\n ${icon} ${i18n.getWith(\"test\", [i + 1])}\n </button>\n </li>`;\n }\n if (displayIndex === undefined) displayIndex = 0; // Make sure something is shown (first test)\n\n // Open the displayed test (chosen by displayIndex)\n content = content\n .split(`id=\"test-${displayIndex + 1}\" class=\"collapse`, 2)\n .join(`id=\"test-${displayIndex + 1}\" class=\"collapse show`);\n nav = nav\n .split(`id=\"test-nav-${displayIndex + 1}\" class=\"nav-link mr-1 collapsed\" aria-expanded=\"false\"`, 2)\n .join(`id=test-nav-${displayIndex + 1}\" class=\"nav-link mr-1\" aria-expanded=\"true\"`);\n return {nav, content};\n }", "title": "" }, { "docid": "dc8330748850da9137cabe68db70848a", "score": "0.5344265", "text": "function printTestReport() {\n print(\"\" + testCount + \" tests were run.\");\n print(\"\" + testPassCount + \" tests passed.\");\n print(\"\" + (testCount - testPassCount) + \" tests failed.\");\n print(\"\");\n}", "title": "" }, { "docid": "5c35083eff7f8903a61a563ab28229f0", "score": "0.5331302", "text": "display(){\n console.log(`Title: ${this.title}`)\n console.log(`Author: ${this.author}`)\n console.log(`Price: ${this.price}`)\n }", "title": "" }, { "docid": "3b2ff1d39173737130fdca5b46f1e174", "score": "0.53240937", "text": "function showResults() {\r\n\t\t$('#testForm,#qtimer, .test-body').hide();\r\n\t\t$('#testResults').html(\"<table class='table table-hover'><thead><tr scope='col'><th colspan= '2'>Test \"+testNum+\" Results</th></tr></thead>\"+\r\n\t\t\"<tbody><tr><th scope='row'>Questions answered:</th><td> \"+numAnswered+\" of 5</td></tr>\"+\r\n\t\t\t\"<tr><th scope='row'>Questions correct:</th><td> \"+numCorrect+\" of 5</td></tr>\"+\r\n\t\t\t\"<tr><th scope='row'>Time elapsed:</th><td>\"+finalTime+\" </td></tr></tbody><tfoot><tr scope='col'><th colspan='2'><a href ='quiz.html' class='btn btn-primary'>Take Again</a></th></tr></tfoot></table>\"\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "d128b031613309574bf1b38b6d75653f", "score": "0.5315742", "text": "function addTestData() {\n displayResult('{\"name\":\"ICGC\",\"status\":200,\"responses\":{\"ICGC\":\"true\"}}');\n displayResult('{\"name\":\"Cosmic\",\"status\":200,\"icon\":\"sanger.png\",\"responses\":{\"Cosmic\":\"true\"}}');\n}", "title": "" }, { "docid": "260e7e5a26ad3873f356446cfbd583a6", "score": "0.5314545", "text": "displayFeatures() {}", "title": "" }, { "docid": "49b3b77a6c35f38e6871afc23503b1b3", "score": "0.5313614", "text": "connectedCallback() {\n\n if (gettestdata.islocal()) {\n console.log('Islocal');\n $(\"#githubdiv\").css({\"visibility\" : \"visible\"});\n } else {\n $(\"#usegithublab\").text('');\n }\n \n let numviewers = parseInt(this.getAttribute('bis-numviewers') || 1);\n\n globalParams.tabset = this.getAttribute('bis-tabset') || null;\n \n globalParams.viewerid=[];\n globalParams.tabid=[];\n for (let i=1;i<=numviewers;i++) {\n globalParams.viewerid.push(this.getAttribute('bis-viewerid'+i));\n globalParams.tabid.push(this.getAttribute('bis-tab'+i));\n }\n\n \n let name=this.getAttribute('bis-testlist') || 'overlay';\n displaytestlist=testmodule[name];\n\n let isconnviewer=false;\n \n webutil.runAfterAllLoaded( () => {\n\n console.log('Name = ',name);\n \n if (name===\"overlay\") {\n webutil.setAlertTop(920);\n } else {\n webutil.setAlertTop(870);\n isconnviewer=true;\n }\n \n globalParams.application = document.querySelector(this.getAttribute(\"bis-application\"));\n globalParams.resdiv=$('#displayresults');\n globalParams.resultImageElement=$('#imgoutput');\n globalParams.goldImageElement=document.querySelector('#imggold');\n globalParams.comparisonTextElement=$('#comparison');\n initialize(displaytestlist);\n \n if (!isconnviewer)\n globalParams.application.getViewer(0).setimage(globalImage);\n\n \n $('#compute').click( (e) => {\n e.preventDefault(); // cancel default behavior\n runTests(true,isconnviewer);\n });\n\n $('#computesingle').click( (e) => {\n e.preventDefault(); // cancel default behavior\n runTests(false,isconnviewer);\n });\n\n });\n }", "title": "" }, { "docid": "bd119f3ccbb8c95473055ac7c96c8b5d", "score": "0.53077245", "text": "function describeAndExecuteTest(test){\n var actualDisplayName = (_.isObject(test.actual)&&test.actual.constructor && test.actual.constructor.name !== 'Object' && test.actual.constructor.name !== 'Array')?test.actual.constructor.name:util.inspect(test.actual, false, null);\n\n describe((function _determineDescribeMsg(){\n var msg = '';\n if (test._meta) {\n msg += '['+test._meta+']';\n }\n if (test.void){\n msg += 'void exit ';\n }\n else {\n msg += 'exit ';\n }\n\n if (!_.isUndefined(test.example)) {\n msg += 'with a '+getDisplayType(test.example)+' example ('+util.inspect(test.example,false, null)+')';\n }\n else {\n msg +='with no example';\n }\n\n return msg;\n })(), function suite (){\n if (test.error) {\n it('should error', function (done){\n testInputValidation(test, done);\n });\n return;\n }\n else {\n it(util.format('should coerce %s', actualDisplayName, 'into '+util.inspect(test.result, false, null)+''), function (done){\n testExitCoercion(test, done);\n });\n }\n });\n}", "title": "" }, { "docid": "334911d85a9b79a8b95a5c1de7b9a8d0", "score": "0.53052425", "text": "function displayResults() {\n var output = document.getElementById(\"output\");\n output.innerHTML = dbgWin.document.getElementById(\"output\").innerHTML;\n}", "title": "" }, { "docid": "635492f562e2ba541b7b76036708225b", "score": "0.52980995", "text": "function display (html) {\n var displayObject = document.getElementById(\"resultOutput\");\n displayObject.innerHTML = html;\n}", "title": "" }, { "docid": "96f9b838c2de2dfc35f0f3ef7aca34ab", "score": "0.52976924", "text": "displayResults(testResults) {\n if (testResults.stdout) {\n const passedResults = testResults.stdout;\n var numTestPassed = 0;\n const testCaseResults = passedResults.trim().split(\"\\n\");\n console.log(testCaseResults);\n const totalTestResults = testCaseResults.length;\n for (var result of testCaseResults) {\n if (result === \"True\") {\n numTestPassed++;\n }\n }\n if (numTestPassed !== totalTestResults) {\n return (\n <h6 className=\"failedResults\">{`${numTestPassed} / ${totalTestResults} Test Passed`}</h6>\n );\n } else {\n return <h6 className=\"passedResults\">All Test Passed</h6>;\n }\n } else if (testResults.stderr) {\n return <h6 className=\"failedResults\">{testResults.stderr}</h6>;\n } else if (!testResults) {\n return (\n <h6 className=\"failedResults\">\n API Failed, Please Submit Again.{\"\\n\"} We're currently optimizing it\n ^_^{\" \"}\n </h6>\n );\n } else {\n console.log(testResults);\n return;\n }\n }", "title": "" }, { "docid": "c437453435169b1d88bbba2eb63f2436", "score": "0.52858996", "text": "function ASCIIDisplay() {\n this.type = digsim.ASCIIDISPLAY;\n this.name = 'ASCIIDisplay';\n\n this.numInputs = 8; // 8 address bits\n this.numOutputs = 0;\n this.dimension = {'row': 8, 'col': 12}; // Height and width of component\n this.previousClockState = 0; // Keep track of clock state to know when it is on rising edge\n\n // Display variables\n this.text = \"\";\n this.numCols = 13; // Number of columns in the display screen\n this.numRows = 4; // Number of rows in the display screen\n\n // Keep track of the clock pulse (CP) connection\n this.namedConnections = {};\n}", "title": "" }, { "docid": "c88a8e9acc8bc138c35f2e994491865e", "score": "0.5278853", "text": "function test(test) {\n var attrs = {\n classname: test.parent.fullTitle()\n , name: test.title\n , time: test.duration / 1000\n };\n\n if ('failed' == test.state) {\n var err = test.err;\n attrs.message = escape(err.message);\n consoleLog(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack))));\n } else if (test.pending) {\n consoleLog(tag('testcase', attrs, false, tag('skipped', {}, true)));\n } else {\n consoleLog(tag('testcase', attrs, true) );\n }\n}", "title": "" }, { "docid": "21b80cfb4897ee99bbd2ea70ee57d227", "score": "0.52617264", "text": "function describe(desc) {\n\tprint()\n\tprint(\"===============================\")\n\tprint(\"Test: \" + desc)\n\tprint()\n\tsaved_desc = desc;\n}", "title": "" }, { "docid": "83acc5db3f43db672f9547e80bb489e5", "score": "0.5259689", "text": "function FPSDisplay() {}", "title": "" }, { "docid": "83acc5db3f43db672f9547e80bb489e5", "score": "0.5259689", "text": "function FPSDisplay() {}", "title": "" }, { "docid": "83acc5db3f43db672f9547e80bb489e5", "score": "0.5259689", "text": "function FPSDisplay() {}", "title": "" }, { "docid": "bd171756e8c6baf59ba2edf447f8a89c", "score": "0.5251132", "text": "function inputTest() {\r\n\r\n\tswitch (testMode) {\r\n\t\tcase tmEnemyImageSwitching:\r\n\t\t\tinputTestImageSwitching();\r\n\t\t\tbreak;\r\n\t\tcase tmCommandSpawnTest:\r\n\t\t\tinputTestCommandSpawn();\r\n\t\t\tbreak;\r\n\t\tcase tmCommandMove:\r\n\t\t\tinputTestCommandMove();\r\n\t\t\tbreak;\r\n\t\tcase tmShotCreation:\r\n\t\t\tinputTestShotCreation();\r\n\t\t\tbreak;\r\n\t\tcase tmPlayerControl:\r\n\t\t\tinputTestPlayerControl();\r\n\t\t\tbreak;\r\n\t\tcase tmShotCollision:\r\n\t\t\tinputTestShotCollision();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tconsolePrint(\"Error with test mode.\", \"exit\");\r\n\t}\r\n}", "title": "" }, { "docid": "6126a1da352e20c767933556b5d002ac", "score": "0.52424043", "text": "function _goToSample()\r\n{\r\n\t TechSpec.show(\"gotosample\",\"sample.do\"); \r\n}", "title": "" }, { "docid": "35d95af3cc662a75ba60f1173235fa33", "score": "0.5225514", "text": "function display (list, path, options) {\n\n\t//console.log('options.handler',options.handler)\n\n\toptions.handler = options.handler ? options.handler.toString() : null//'testx'//options.handler ? JSON.stringify(options.handler) : null;\n\n\t//this.options = options;\n\n\t//handler\n\tthis._properties = ['handler'];\n\n\tthis._nativeType = String; //# dummy: dont save nothing, only display\n\t\n\tdisplay.super_.call(this, list, path, options);\n\n}", "title": "" }, { "docid": "b152a30ff534901a41ad8b61fd5eaffc", "score": "0.52177787", "text": "samDisplay(sectionId, representation) {\n const section = document.getElementById(sectionId);\n section.innerHTML = representation;\n }", "title": "" }, { "docid": "03e106ad848be96e97ea7ba578763db8", "score": "0.5214195", "text": "function setup_ui() {\n if (!localStorage.flags)\n localStorage.flags = 'IVIAAVCAKACAAAAAAAAAAEAA'\n if (!localStorage.retainFlags)\n localStorage.retainFlags = 'AAAAAAAAAAAAAAAAAAAAAAAA'\n ui = new Interface(15);\n ui.addTab('Gameplay');\n ui.addTab('Features');\n ui.addTab('Monsters');\n ui.addTab('Shortcuts');\n ui.addTab('Challenge');\n ui.addTab('Cosmetic');\n ui.addSummaryTab('Summary');\n ui.setActiveTab('Gameplay');\n\n ui.addTriOption('Gameplay', 0, 0, 6, 'Shuffle Chests & Searches',\n 'The items in chests and search locations will be randomized.');\n ui.addTriOption('Gameplay', 2, 0, 4, 'Random Chest Locations',\n 'Chests will be at a random set of predetermined locations.');\n ui.addTriOption('Gameplay', 4, 0, 2, 'Random Growth',\n 'Player statistical growth at each level will be randomized.');\n ui.addTriOption('Gameplay', 6, 0, 0, 'Random Map',\n 'The overworld map will be randomly generated.');\n ui.addTriOption('Gameplay', 8, 1, 6, 'Random Spell Learning',\n 'The order and level you learn spells will be random.');\n ui.addTriOption('Gameplay', 1, 1, 4, 'Random Weapon Shops',\n 'The weapons available in each shop will be randomized.');\n ui.addTriOption('Gameplay', 3, 1, 2, 'Random Weapon Prices',\n 'Pretty self-explanatory.');\n ui.addTriOption('Gameplay', 5, 1, 0, 'Random XP Requirements',\n 'Experience requirements for each level will be randomized.');\n ui.addTriOption('Gameplay', 7, 2, 6, 'Heal/Hurt Before \"More\"',\n 'HEAL must come before HEALMORE; HURT before HURTMORE.');\n ui.addTriOption('Gameplay', 10, 2, 2, 'Stair Shuffle',\n 'Where stairs take you inside dungeons will be randomized.');\n\n ui.addTriOption('Features', 0, 3, 6, 'Enable Menu Wrapping',\n 'This enables cursor wrapping in menus.');\n ui.addTriOption('Features', 2, 3, 4, 'Enable Death Necklace',\n 'Equipping the death necklace will cause +10AP and -25% HP.');\n ui.addTriOption('Features', 4, 3, 2, 'Enable Torches In Battle',\n 'Torches and Fairy water can be thrown at monsters.');\n ui.addTriOption('Features', 1, 4, 6, 'Repel in Dungeons',\n 'Enables REPEL to work in dungeons');\n ui.addTriOption('Features', 3, 4, 4, 'Permanent Repel',\n 'REPEL will always be active.');\n ui.addTriOption('Features', 5, 4, 2, 'Permanent Torch',\n 'At least a 3x3 area will always be lit in dungeons.');\n ui.addTriOption('Features', 6, 4, 0, 'Alternate Running Algorithm',\n 'The run blocking multiplier will depend on where you are.');\n ui.addTriOption('Monsters', 0, 5, 6, 'Random Monster Abilities',\n 'Monster spells and abilities will be randomized.');\n ui.addTriOption('Monsters', 2, 5, 4, 'Random Monster Zones',\n 'Monster encounters in each zone will be randomized.');\n ui.addTriOption('Monsters', 4, 5, 2, 'Random Monster Stats',\n 'Monster strength, agility, and HP will be randomized.');\n ui.addTriOption('Monsters', 6, 5, 0, 'Random Monster XP & Gold',\n 'The XP and GOLD gained from monsters will be randomized.');\n ui.addTriOption('Monsters', 8, 6, 6, 'Make Random Stats Consistent',\n 'This makes the random stats, XP, and GOLD consistent with one another.');\n ui.addTriOption('Monsters', 1, 6, 4, 'Scared Metal Slimes',\n 'Metal Slimes will always have a chance to run.');\n ui.addTriOption('Monsters', 3, 6, 2, 'Scaled Metal Slime XP',\n 'Metal Slime XP will depend on your current level.');\n\n ui.addTriOption('Shortcuts', 0, 7, 6, 'Fast Text',\n 'All text will progress much faster.');\n ui.addTriOption('Shortcuts', 2, 7, 4, 'Speed Hacks',\n 'Various aspects of the game will be much faster.');\n ui.addTriOption('Shortcuts', 4, 7, 2, 'Open Charlock',\n 'No need to create a bridge to enter Charlock Castle.');\n ui.addTriOption('Shortcuts', 6, 7, 0, 'Short Charlock',\n 'Charlock Dungeon will be much shorter.');\n ui.addTriOption('Shortcuts', 8, 8, 6, \"Don't Require Magic Keys\",\n 'All of the doors are unlocked. Just open them.');\n ui.addTriOption('Shortcuts', 10, 13, 2, \"Summer Sale\",\n 'All weapons and armor 35-65% off!');\n ui.addTriOption('Shortcuts', 1, 8, 2, 'Cursed Princess',\n 'Get Gwaelin to take a Cursed Belt when you return her to win.');\n ui.addTriOption('Shortcuts', 3, 8, 0, \"Three's Company\",\n 'Bring Gwaelin to the Dragonlord and accept his offer to win.');\n // leveling speed\n ui.addDropDown ('Shortcuts', 7, 13, 4, 'Leveling Speed', {\n 'Normal' : 0,\n 'Fast' : 1,\n 'Very Fast': 2\n });\n ui.addDropDown ('Shortcuts', 9, 13, 6, 'Random Map Size', {\n 'Normal' : 0,\n 'Small' : 1,\n 'Very Small': 2,\n 'Random': 3\n });\n\n ui.addTriOption('Challenge', 0, 9, 6, 'No Hurtmore',\n 'You will never learn HURTMORE. Monsters can still have it.');\n ui.addTriOption('Challenge', 2, 9, 4, 'No Numbers',\n 'No numbers will be visible until the Dragonlord fight.');\n ui.addTriOption('Challenge', 4, 9, 2, 'Invisible Hero',\n 'Your sprite will be invisible.');\n ui.addTriOption('Challenge', 6, 9, 0, 'Invisible NPCs',\n 'All NPCs will be invisible.');\n ui.addTriOption('Challenge', 1, 13, 0, 'Treasure Guards',\n 'Important items will have a mid-level monster guarding them.');\n ui.addTriOption('Challenge', 3, 10, 0, 'Big Swamp',\n 'Approximately 60% of the overworld will be poisonous swamp.');\n ui.addTriOption('Challenge', 5, 10, 2, 'Randomly Rotate/Mirror Dungeons',\n 'All dungeons will be rotated at random angles and/or mirrored.');\n ui.addTriOption('Challenge', 7, 10, 4, \"No Armor in Charlock\",\n \"Prevent Erdrick's Armor from being in a chest in Charlock Castle.\");\n ui.addTriOption('Challenge', 9, 10, 6, \"Easy Charlock\",\n \"Make it slightly easier to run from high level monsters.\");\n\n ui.addTriOption('Cosmetic', 4, 11, 6, 'Modern Spell Names',\n 'Use spell names from more recent DQ releases.');\n ui.addTriOption('Cosmetic', 7, 11, 4, 'Noir Mode',\n \"It's all black and white baby!\");\n ui.addOption ('Cosmetic', 0, 14, 7, 'Shuffle Music',\n 'Music in each area will be randomized.');\n ui.addOption ('Cosmetic', 2, 14, 6, 'Disable Music',\n 'This disables the game music in most situations.');\n ui.addOption ('Cosmetic', 9, 14, 5, 'Disable Spell Flashing',\n 'Prevents the screen from flashing when you cast spells.', true);\n ui.addOption ('Cosmetic', 6, 14, 4, 'Show Death Counter',\n 'The stats window will also have a death counter.');\n ui.addOption ('Cosmetic', 3, 14, 3, 'Allow Custom Spell Names',\n 'Allow spell names to be changed based on the chosen sprite.', true);\n ui.addOption ('Cosmetic', 5, 14, 2, 'Skip Original Credits',\n 'Skip the original credits and go straight to stat scroll.', true);\n\n // player sprite\n let spriteBox;\n if (!isElectron()) {\n spriteBox = ui.addTextBox('Cosmetic', 1, 'Player Sprite');\n spriteBox.setAttribute('list', 'sprites');\n spriteBox.value = localStorage.getItem('sprite') || 'Random';\n spriteBox.addEventListener('focus', function(event) {\n this.value = '';\n });\n } else {\n spriteBox = ui.addDropDown('Cosmetic', 1, null, null, \n 'Player Sprite', null, true);\n spriteBox.style.marginRight = '0.2em';\n spriteBox.style.width = '190px';\n spriteBox.parentElement.style.marginRight = \"0\";\n }\n spriteBox.getValue = function() {\n if (!sprite_choices.includes(this.value))\n return 'Random';\n return this.value;\n }\n spriteBox.id = \"sprite-box\";\n spriteBox.addEventListener(isElectron() ? 'change' : 'focusout',\n function(event) {\n if (this.value == '') {\n this.value = localStorage.getItem('sprite') || 'Random';\n }\n if (sprite_choices.includes(this.value)) {\n this.classList.remove('invalid');\n localStorage.setItem('sprite', this.value);\n spritePreview.setAttribute('src', 'sprites/' + this.getValue() \n + '.png');\n } else {\n this.classList.add('invalid');\n }\n ui.updateSummary();\n });\n let spritePreview = ui.create('img', null, {\n 'background-color': '#ccc',\n 'border': '2px solid #ccc',\n 'float': 'right',\n 'height': '32px',\n 'width': '32px'\n })\n spritePreview.id = 'sprite-preview';\n spritePreview.setAttribute('src', 'sprites/' \n + (localStorage.getItem('sprite') || 'Random') + '.png');\n spriteBox.parentElement.append(spritePreview);\n ui.updateSummary();\n}", "title": "" }, { "docid": "7050fed9f4dd3cc443a7b81bfd3f44c6", "score": "0.5201851", "text": "function printInterface() {\n return group(\n concat([\n \"interface \",\n printNameAndTypeParams(),\n indent(printMembers()),\n hardline,\n \"end\"\n ])\n );\n }", "title": "" }, { "docid": "e54c37cf9a86065a0a692add6e17c2f6", "score": "0.51970756", "text": "function showInterfaceInfo(payload) {\n var link_text = (payload.link) ? lang_yes : lang_no;\n var speed_text = (payload.speed > 0) ? payload.speed + ' ' + lang_megabits_per_second : lang_unknown;\n\n $('#link_text').html(link_text);\n $('#speed_text').html(speed_text);\n}", "title": "" }, { "docid": "753e5a578ad0c7e1364343eb42d25e67", "score": "0.5195676", "text": "function displayDescription(myName, myCareer, myDescription) {\n console.log(\"Name: \" + myName);\n console.log(\"Career: \" + myCareer);\n console.log(\"Description: \" + myDescription + \".\");\n}", "title": "" }, { "docid": "651b905d09329b05fc5a8685d6702224", "score": "0.51892895", "text": "function getDescription() {\n return \"Displays home interface.\";\n}", "title": "" }, { "docid": "d623f5725e155af781124a87a89eebb8", "score": "0.51648057", "text": "function _showSampleFitEval()\r\n{\r\n //alert(\"showProductOverview called\");\r\n //alert(\"_AttributekeyInfo \" + getComponentKeyInfo() + \"\\n _nColLibRow \" +_nColLibRow);\r\n var url =\"showsamplefiteval&_nColLibRow=\" + _nColLibRow ;\r\n url += \"&keyinfo= \" + getComponentKeyInfo();\r\n //alert(\"url \" + url);\r\n loadWorkArea(\"fitevaloverview.do\", url);\r\n}", "title": "" }, { "docid": "2999df76adb54264fface3d3fe073b1d", "score": "0.5161378", "text": "displayScene() {\n this.displayComponent(this.rootElem, null, null);\n }", "title": "" }, { "docid": "bcabe8c2c5528792abc6c182bc4a2e92", "score": "0.51604015", "text": "function display() {\r\n document.getElementById(\"resultForm\").style.display = \"block\";\r\n document.getElementById(\"sbResults\").innerText = formatter.format(starting_bet);\r\n document.getElementById(\"trResults\").innerText = total_rolls;\r\n document.getElementById(\"haResults\").innerText = formatter.format(max_amount_won);\r\n document.getElementById(\"harResults\").innerText = max_amount_roll;\r\n}", "title": "" }, { "docid": "74a62e643116050fd9b9d8e6faf34d08", "score": "0.5158453", "text": "function visualize(testVisualizerTrace) {\n //var traces = new TraceList(testVisualizerTrace.trace);\n //var code = new StudentCode(testVisualizerTrace.code);\n //var vis = new Visualization(traces, code);\n testTree();\n}", "title": "" }, { "docid": "addc655fa6bb5d409ea113c8a6058886", "score": "0.5151961", "text": "function TesterComponent(hmiService, gaugesManager, testerService) {\n this.hmiService = hmiService;\n this.gaugesManager = gaugesManager;\n this.testerService = testerService;\n this.show = false;\n this.items = [];\n this.output = [];\n this.demoSwitch = true;\n }", "title": "" }, { "docid": "3ef5def7d4533fb6368d5f5bf93fccbb", "score": "0.51505095", "text": "display()\n {\n this.patch.display();\n }", "title": "" }, { "docid": "e23343c94e46d004b4b6fc2e340b38cd", "score": "0.5145137", "text": "function ShowCurrInterface() {\n if (curr_area === \"All\") {\n ShowAll();\n } else if (curr_area === \"Active\") {\n ShowActive();\n } else if (curr_area === \"Completed\") {\n ShowCompleted();\n }\n refresh_count();\n ShowUncompleted();\n ShowClear();\n}", "title": "" }, { "docid": "4ede00ddea3b3930ff4def90cdd3faa8", "score": "0.51436245", "text": "function renderTests(tests){\n if(!tests){\n return '';\n }\n return `## Tests\n\n ${tests}`\n \n}", "title": "" }, { "docid": "46901a13fa9458cd70d515716ab87dc0", "score": "0.51394266", "text": "function CLIDisplay () {}", "title": "" }, { "docid": "4a7daaae822ba7bb0e53f2066d105737", "score": "0.5132633", "text": "function displayExternalAnalyses(transport) {\n var contentDiv = $('main_content_div');\n contentDiv.innerHTML = transport.responseText;\n document.body.style.cursor = \"default\";\n\n initSubtab(\"externalAnalyses\");\n // Update the report-level contextual help content\n theHelpWindow.updateContent($(\"help-files\"));\n loadedForQA(\"true\");\n}", "title": "" }, { "docid": "c321b47b7e5ad184c9949f8c97cfc8ad", "score": "0.5119596", "text": "function display () {\n\tidResults.innerHTML = winner + \"wins!! \" + choiceA +\" beat(s) \" + choiceB;\n\tidPlayerscore.innerHTML = playerScore;\n\tidCompscore.innerHTML = compScore;\n\tidTie.innerHTML = ties;\n}", "title": "" }, { "docid": "6546abeb7a0168e96a435d5b2823724d", "score": "0.51188487", "text": "function generateSmokeTestManualTestingReport(){\n\tadditionalTestResultsObservations = Window.prompt(\"Enter Additional Test Results + Observations\");\n\n\tprint(\"Launching Web Window...\");\n\n\tvar htmlUrl = Script.resolvePath(\"qaTest20stmtr.html\")\n\twebWindow = new OverlayWebWindow('Smoke Test Manual Testing Report', htmlUrl, 800, 700, false);\n\twebWindow.webEventReceived.connect(function(data) {\n\t\tprint(\"JS Side Event Received: \" + data);\n\t});\n\n\tScript.setInterval(function() {\n\t\tMyStats.getUsername = Account.getUsername();\n\t\tif(Menu.isOptionChecked(\"localhost 'createTestBlocks.js' + Move Around + Delete - SUCCESS\")){\n\t\t\tMyStats.createTestBlocks = \"**localhost 'createTestBlocks.js'** SUCCESS\";\n\t\t} else{\n\t\t\tMyStats.createTestBlocks = \"**localhost 'createTestBlocks.js'** FAILURE\";\n\t\t}\n\t\tif(Menu.isOptionChecked(\"localhost ATP Upload + Add To World + Move Around + Delete - SUCCESS\")){\n\t\t\tMyStats.atpUploadEdit = \"**localhost ATP** SUCCESS\";\n\t\t} else{\n\t\t\tMyStats.atpUploadEdit = \"**localhost ATP** FAILURE\";\n\t\t}\n\t\tif(Menu.isOptionChecked(\"Echo Server Audio - SUCCESS\")){\n\t\t\tMyStats.echoServerAudio = \"**Echo Server Audio** SUCCESS\";\n\t\t} else{\n\t\t\tMyStats.echoServerAudio = \"**Echo Server Audio** FAILURE\";\n\t\t}\n\t\tif(Menu.isOptionChecked(\"localhost 'harmonicOscillator.js' - SUCCESS\")){\n\t\t\tMyStats.harmonicOscillator = \"**localhost 'harmonicOscillator.js'** SUCCESS\";\n\t\t} else{\n\t\t\tMyStats.harmonicOscillator = \"**localhost 'harmonicOscillator.js'** FAILURE\";\n\t\t}\n\t\tif(Menu.isOptionChecked(\"localhost 'reverbTest.js' + Adjust Wet And Dry Levels - SUCCESS\")){\n\t\t\tMyStats.reverbTest = \"**localhost 'reverbTest.js'** SUCCESS\";\n\t\t} else{\n\t\t\tMyStats.reverbTest = \"**localhost 'reverbTest.js'** FAILURE\";\n\t\t}\n\t\tif(Menu.isOptionChecked(\"localhost 'playaPerformanceTest.js' + Type 'localhost' In Box + Click RUN Until DISCONNECT Then Click STOP + If Graph Results Under RED Line - SUCCESS\")){\n\t\t\tMyStats.localhostPlayaPerformanceTest = \"**localhost 'playaPerformanceTest.js'** SUCCESS\";\n\t\t} else{\n\t\t\tMyStats.localhostPlayaPerformanceTest = \"**localhost 'playaPerformanceTest.js'** FAILURE\";\n\t\t}\n\t\tif(Menu.isOptionChecked(\"playa 'playaPerformanceTest.js' + Type 'playa' In Box + Click RUN Until DISCONNECT Then Click STOP + If Graph Results Under RED Line - SUCCESS\")){\n\t\t\tMyStats.playaPlayaPerformanceTest = \"**dev-playa 'playaPerformanceTest.js'** SUCCESS\";\n\t\t} else{\n\t\t\tMyStats.playaPlayaPerformanceTest = \"**dev-playa 'playaPerformanceTest.js'** FAILURE\";\n\t\t}\n\t\tif(Menu.isOptionChecked(\"cellscience 'playaPerformanceTest.js' + Type 'cellscience' In Box + Click RUN Until DISCONNECT Then Click STOP + If Graph Results Under RED Line - SUCCESS\")){\n\t\t\tMyStats.cellsciencePlayaPerformanceTest = \"**dev-demo 'playaPerformanceTest.js'** SUCCESS\";\n\t\t} else{\n\t\t\tMyStats.cellsciencePlayaPerformanceTest = \"**dev-demo 'playaPerformanceTest.js'** FAILURE\";\n\t\t}\n\t\tif(Menu.isOptionChecked(\"Smoke Test QA Pass - SUCCESS\")){\n\t\t\tMyStats.smokeTestQAPass = \"**QA Pass** SUCCESS\";\n\t\t} else{\n\t\t\tMyStats.smokeTestQAPass = \"**QA Pass** FAILURE\";\n\t\t}\n\n\t\tMyStats.additionalTestResultsObservations = additionalTestResultsObservations;\n\t\tvar message = JSON.stringify(MyStats);\n\t\tprint(\"JS Side sending: \" + message);\n\t\twebWindow.emitScriptEvent(message);\n\t}, 1 * 1000);\n\n\tvar MyStats = {};\n\tScript.scriptEnding.connect(function(){\n\t\twebWindow.close();\n\t\twebWindow.deleteLater();\n\t});\n}", "title": "" }, { "docid": "d5ee1051983cdd9780aa0a027affe0a7", "score": "0.5104586", "text": "function TIfDefTest(){\n this.FlagSetTestButton=false; // add a test button to node\n }", "title": "" }, { "docid": "b9603959586ea04cbc5b36c3dbe1837d", "score": "0.5103974", "text": "function renderTestSection(test){\n const testingHeading = `## Testing\\n`\n const testingBody = test;\n return testingHeading + testingBody;\n}", "title": "" }, { "docid": "98c3868aa21ba3a88b0ec2cc7a6797f0", "score": "0.5103625", "text": "function displayGame(game){\r\n\tdisplayBoard(game.board);\r\n\tfor (var weapon in game.weapons){\r\n\t\tdisplayWeapon(game.weapons[weapon]);\r\n\t}\r\n\tfor(var player in game.players){\r\n\t\tdisplayPlayer(game.players[player]);\r\n\t\tdisplayHP(game.players[player]);\r\n\t}\r\n}", "title": "" }, { "docid": "ddb42bc114e01acc600138133bd3a843", "score": "0.5089982", "text": "displayScene() {\n this.displayComponent(this.idRoot, null, null, 1, 1);\n }", "title": "" }, { "docid": "9dafbed0cb3ec74d38e384c4cc422f92", "score": "0.5081598", "text": "function printSummary(verbose) {\n global.document.open();\n global.document.write('<kbd>');\n global.document.write(summary);\n global.document.write('<br/><br/>Assertions: ' + assertionsCnt);\n\n if (fails) {\n global.document.write('<br/><br/>' + fails);\n }\n\n if (verbose || false) {\n global.document.write('<br/><br/>' + assertions);\n }\n\n global.document.write('</kbd>');\n global.document.close();\n }", "title": "" }, { "docid": "9ae5c28352f5b40a1818fc352da0d75b", "score": "0.50669044", "text": "function runTests(){\n\t\n\t//testTo24hClock();\n\t\n\t//printTestResults;\n\t\n}", "title": "" }, { "docid": "50107dd314a64e8b29f117f445575858", "score": "0.5062808", "text": "function displayIntro() {\n console.log(H_RULE);\n console.log(\"Welcome to the Zendesk Ticket Viewer\\n\");\n console.log(\"Please enter one of the following commands:\");\n console.log(\" 0 Edit the config\");\n console.log(\" 1 Display a single ticket\");\n console.log(\" 2 Display all tickets\");\n console.log(\" 3 Display last created ticket\");\n console.log(\" 4 Display tickets where subject contains query\");\n console.log(\" 5 Create a new ticket with subject and description\");\n console.log(\" help Display this message\");\n console.log(H_RULE);\n}", "title": "" }, { "docid": "6eb07bb644398d400319c31bde7abc50", "score": "0.50622255", "text": "function displayHelp() {\n ICEUtils.displayHelp(helpID);\n}", "title": "" }, { "docid": "2c9551a0680472c2ffdb6b6013f71e08", "score": "0.5059673", "text": "function test(test) {\n var attrs = {\n classname: test.parent.fullTitle()\n , name: test.title\n , time: test.duration / 1000\n };\n\n if ('failed' == test.state) {\n var err = test.err;\n attrs.message = escape(err.message);\n appendxmlLine(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack))));\n } else if (test.pending) {\n appendxmlLine(tag('testcase', attrs, false, tag('skipped', {}, true)));\n } else {\n appendxmlLine(tag('testcase', attrs, true) );\n }\n}", "title": "" }, { "docid": "9e46163d6ab849b94079eb8823df9683", "score": "0.5057598", "text": "function displayOverview($info) {\n\n\t// title\n\tvar title = `<div class=title>${ _id2text.input[$info.input][_language] } → ${ _id2text.output[$info.output][_language] }&nbsp<span>Simple Work Flow</span></div><hr>`;\t\n\n\t// material\n\tvar material = \"\";\n\t$info.tools.forEach(id => {\n\t\t_tools[id].material.forEach(item => {\n\t\t\tmaterial += `<li>${ _id2text.material[item][_language] }</li>`;\n\t\t});\n\t});\t\n\n\t// needed files\n\tvar prepared = `<p>${ _mainContent.neededFiles[_language] }</p>\n\t\t\t\t\t<ul id=\"needed-files\">\n\t\t\t\t\t\t<li>${ _id2text.input[$info.input][_language] }</li>\n\t\t\t\t\t\t${ material }\n\t\t\t\t\t</ul>`;\n\n\t// flow block parameters\n\tvar toolNum = $info.tools.length;\n\tvar rowNum = Math.ceil(toolNum / 3);\n\tvar rowStyle = \"auto\";\n\n\t// flow block style\n\tfor (let i = 1; i < rowNum; i++) rowStyle += \" 80px auto\";\n\n\t// flow block\n\tvar flow = \"\";\n\tfor (let i = 0; i < rowNum; i++) {\n\n\t\t// positive row: 0 -> 1 -> 2\n\t\tif (i % 2 === 0) {\n\t\t\tfor (let j = 0; j < 3; j++) {\n\t\t\t\tlet toolIndex = i * 3 + j;\n\n\t\t\t\t// tool block\n\t\t\t\tif (toolIndex < toolNum) flow += stageBlockHTML(toolIndex, $info.tools[toolIndex]);\n\t\t\t\telse flow += `<div></div>`;\t\t\t\t// fill of empty entry\n\n\t\t\t\t// arrow\n\t\t\t\tif (j < 2) {\n\t\t\t\t\tif (toolIndex < toolNum-1) flow += dirHTML('right');\n\t\t\t\t\telse flow += `<div></div>`;\t\t\t// fill of empty entry\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if have next row, add (empty) (empty) (empty) (empty) (down)\n\t\t\tif (i < rowNum - 1) flow += `<div></div><div></div><div></div><div></div>` + dirHTML('down');\n\n\t\t// reverse row: 5 <- 4 <- 3\n\t\t} else {\n\t\t\tfor (let j = 2; j >= 0; j--) {\n\t\t\t\tlet toolIndex = i * 3 + j;\n\n\t\t\t\t// tool block\n\t\t\t\tif (toolIndex < toolNum) flow += stageBlockHTML(toolIndex, $info.tools[toolIndex]);\n\t\t\t\telse flow += `<div></div>`;\t\t\t\t// fill of empty entry\n\t\t\t\t\n\t\t\t\t// arrow\n\t\t\t\tif (j > 0) {\n\t\t\t\t\tif (toolIndex < toolNum) flow += dirHTML('left');\n\t\t\t\t\telse flow += `<div></div>`;\t\t\t// fill of empty entry\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if have next row, add (down) (empty) (empty) (empty) (empty)\n\t\t\tif (i < rowNum - 1) flow += dirHTML('down') + `<div></div><div></div><div></div><div></div>`;\n\t\t}\n\t}\n\n\tvar procedure = `<h1>${ _mainContent.procedure[_language] }</h1>\n\t\t\t\t\t <div class=\"flow\" style=\"grid-template-rows: ${ rowStyle };\">\n\t\t\t\t\t \t${ flow }\n\t\t\t\t\t </div>`;\n\t$('#overview').html(title + prepared + procedure);\n}", "title": "" }, { "docid": "76b00c3fdb43124b7a171845183b6b73", "score": "0.5053039", "text": "function myDisplayer(some) {\n document.getElementById(\"demo\").innerHTML = some;\n }", "title": "" }, { "docid": "ac332f0e958906305550226038f28ac8", "score": "0.50497556", "text": "function addTestInfoToAllure(testData) {\n const {title} = testData\n const testId = title.match(/^\\[(.*?)\\]/)[1] // [P001] Returns 200 status code -> P001\n const testName = title.replace(`[${testId}] `, '') // [P001] Returns 200 status code -> Returns 200 status code\n global.allure.reporter.runningTest.name = `Id: ${testId}, Title: ${testName}`;\n\n global.allure.setDescription('Custom description');\n\n const severityOptions = ['blocker', 'critical', 'normal', 'minor'] // available options in allure\n global.allure.setSeverity(severityOptions[Math.floor(Math.random() * severityOptions.length)]);\n \n global.allure.addLink('Link to app', 'https://swapi.co/', 'myLink')\n}", "title": "" }, { "docid": "d96df68c33f4a9a9d7d6b2caabd4641a", "score": "0.504488", "text": "function showSampleEvalList()\r\n{\r\n //alert(\"_AttributekeyInfo \" + getComponentKeyInfo() + \"\\n _nColLibRow \" +_nColLibRow);\r\n var url =\"showsampleeval&_nColLibRow=\" + _nColLibRow ;\r\n url += \"&keyinfo= \" +getComponentKeyInfo();\r\n //alert(\"url \" + url);\r\n loadWorkArea(\"sampleeval.do\", url);\r\n}", "title": "" }, { "docid": "ac429a8f11fab2d06834f23e9ec13392", "score": "0.5044559", "text": "displayInfo(){\n return \"Answer: \" + this.answer + \"\\nHint: \" + this.hint + \"\\nTurn: \" + this.Turn + \"\\nFails: \" + this.nbFail + \"\\nScore: \" + this.score + \"\\nProgress: \" + this.wordToFind + \"\\nFini: \" + this.isFinished() + \"\\nGagné: \" + this.isWon();\n }", "title": "" }, { "docid": "46982a7eae2ef0841e7dccc247335037", "score": "0.5039169", "text": "display (model)\n\t{\n\n\t}", "title": "" }, { "docid": "8fa9d0c84e8c96b1663204c0187f1569", "score": "0.5035589", "text": "function onTesting() {\n if (!TESTING) return;\n\n var x = window.cxa;\n\n x.globalAlpha = 1;\n x.textAlign = \"center\";\n x.fillStyle = \"#000\";\n x.font = font(\"header\");\n\n x.fillText(\"Slide \" + scene.index, measure.half.x, measure.half.y);\n }", "title": "" }, { "docid": "3772d380e0ca04a64097771f91d350fe", "score": "0.502886", "text": "function clickedTest()\n{\n updateSBRecordsetObject(); \n recordsetDialog.displayTestDialog(RECORDSET_SBOBJ);\n}", "title": "" }, { "docid": "55140ab1822561c26d8209193cdb81fa", "score": "0.502268", "text": "function createTestView(test_object){\n console.log(test_object);\n\n // hide my tests\n router.views['/my_test'].element.style.display = 'none';\n\n router.show('/test_view', 'other_views');\n\n //append title to test view\n var test_view = document.getElementById('test_view');\n var test_title = utils.createElement('div','test_title',\n test_object[0].test_name, test_view);\n\n test_object[0].questions.forEach(function(question){\n\n // create an element for each question\n test_view.appendChild(createQuestion(question));\n\n });\n}", "title": "" }, { "docid": "a13fe8e09ff570fdfb5c9fc3e0aa987a", "score": "0.50167274", "text": "function Tests(){\n\n\n\n}", "title": "" }, { "docid": "6750972cb6994e87d6df52918985251d", "score": "0.50132346", "text": "printDetails(){\n\t\tconsole.log(\"Vehicle Name: \" + this.name + \" | Vehicle type: \" + this.type);\n\t}", "title": "" }, { "docid": "454d9c82edc2a0b6500f416950bfb37e", "score": "0.50114775", "text": "function mainDisplay() {\n let mostRecentObservations = Model.get_recent_observations(10);\n let userLeaderboard = Model.get_top_ten_users();\n \n // display ten most recent observations \n // display top ten users leaderboard\n views.homePageView(\"target\", mostRecentObservations, \"target2\", userLeaderboard);\n}", "title": "" }, { "docid": "03a07b0ef684cc3db5424542172c71d4", "score": "0.50073963", "text": "describe() {\n console.log(this.description);\n }", "title": "" }, { "docid": "27b784ad6c146b0c7bfde1df325bb99c", "score": "0.50068825", "text": "function display(input){\n disp.innerText = input\n}", "title": "" }, { "docid": "a246dc5b7fbe432192614b3e34ec3527", "score": "0.50068283", "text": "function sc_display(o, p) {\n if (p === undefined) // we assume not given\n\tp = SC_DEFAULT_OUT;\n p.appendJSString(sc_toDisplayString(o));\n}", "title": "" } ]
a528456747840ab9bea971401a0498a8
Callback for when everything is done It is defined here because jslint complains if it is declared at the end of the function (which would be more logical and readable)
[ { "docid": "0ff27e7eb91108995162f107d6eacfcd", "score": "0.0", "text": "function done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( status >= 200 && status < 300 || status === 304 ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"Last-Modified\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ ifModifiedKey ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"Etag\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ ifModifiedKey ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If not modified\n\t\t\t\tif ( status === 304 ) {\n\n\t\t\t\t\tstatusText = \"notmodified\";\n\t\t\t\t\tisSuccess = true;\n\n\t\t\t\t// If we have data\n\t\t\t\t} else {\n\n\t\t\t\t\tisSuccess = ajaxConvert( s, response );\n\t\t\t\t\tstatusText = isSuccess.state;\n\t\t\t\t\tsuccess = isSuccess.data;\n\t\t\t\t\terror = isSuccess.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( !statusText || status ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = \"\" + ( nativeStatusText || statusText );\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajax\" + ( isSuccess ? \"Success\" : \"Error\" ),\n\t\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" } ]
[ { "docid": "6fa3a4adc60072b58922f74b6cfe5f36", "score": "0.7244063", "text": "defaultDoneCallback() {\n return;\n }", "title": "" }, { "docid": "d057a7c06f50e016904f552d7978fa4d", "score": "0.71994257", "text": "function _finished() {\n // do whatever clean-up you need to here...\n}", "title": "" }, { "docid": "bd0a332194de9886878fa7de9df9df6e", "score": "0.71838015", "text": "complete() { }", "title": "" }, { "docid": "b035de36e358f7516c6547cb656bf2cf", "score": "0.7137615", "text": "onDone() {\n }", "title": "" }, { "docid": "a0eb6b2497f91253a36b6fd84d2f8bdd", "score": "0.71206415", "text": "function doDone() {\n\t\tif (typeof _onDone === 'function') {\n\t\t\t_onDone.apply(this, arguments);\n\t\t}\n\t}", "title": "" }, { "docid": "09c65e5ed702cba03dd9c9fb43cf6c9d", "score": "0.7112381", "text": "doneCallback() { }", "title": "" }, { "docid": "ea0b2bd2d3e373af7a21953ac1ab3f89", "score": "0.70320606", "text": "function onFinish(){}", "title": "" }, { "docid": "d0107b224bcf5fa5b11c903f0693793c", "score": "0.7016239", "text": "endDone() {\n\t\t\n\t}", "title": "" }, { "docid": "1c0d4ba22ae1c10e3a1d3c1ebec743f7", "score": "0.6979808", "text": "function onComplete() {}", "title": "" }, { "docid": "6cdf7047d0b1dcdf3d3f229596af4a62", "score": "0.6932467", "text": "_onEnd() {}", "title": "" }, { "docid": "685a42a44e34f07e29518d35c1846462", "score": "0.6907929", "text": "function done() {\n\n}", "title": "" }, { "docid": "5b8e50d0f60294103a622673e9ed76ec", "score": "0.6788656", "text": "function onDone() {\n masterCallback(req, res);\n }", "title": "" }, { "docid": "509961d89730e748f6d2d0ece3074b8a", "score": "0.67164165", "text": "static onComplete() {}", "title": "" }, { "docid": "9d8de58dadb252c7ba493c9fd8f85f2e", "score": "0.6697004", "text": "function onFinish() {\n// console.log('finished!');\n}", "title": "" }, { "docid": "622f453675c383a5d39173fa372fddf9", "score": "0.6653375", "text": "function finish() {\n if (!done) {\n done = true;\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "2c05917960b6f78f1cff8135c68d4636", "score": "0.6573914", "text": "function onFinish() {\n console.log('finished!');\n}", "title": "" }, { "docid": "49269e27e0b0b6ce69ebca5c77d41e98", "score": "0.6570734", "text": "complete() {\n\t this._done('complete');\n\t }", "title": "" }, { "docid": "f7a6b9eabc95500d18e4ef3ace433602", "score": "0.64863914", "text": "callback() {\n console.log('Done!!!!');\n }", "title": "" }, { "docid": "07b5aeeb02b1c0661cc92960b5f8c3bd", "score": "0.6483542", "text": "function mainCallback() {\r\n\r\n}", "title": "" }, { "docid": "17b2445f8018fcac533b0fb9b37002fd", "score": "0.64612013", "text": "function done() {\n console.debug('done');\n self.begin();\n }", "title": "" }, { "docid": "fe882077a700849d90053a22d12488c7", "score": "0.64440805", "text": "done() {\n this.resetTimer();\n this.facade.triggerNotSorting();\n this.toastr.success('Done !');\n }", "title": "" }, { "docid": "d8ec75cf0899d579d204fcd0c25d25e6", "score": "0.64398086", "text": "done() {\n throw new Error('Not Implement');\n }", "title": "" }, { "docid": "8cb7657a49732a112aefe8b8161a9250", "score": "0.6408951", "text": "function end (done) {\r\n\tdone();\r\n}", "title": "" }, { "docid": "d0c9d798e397c0f0d537004d07a59bdb", "score": "0.6395621", "text": "function checkForCompletion() {\n\t if (queuedObjects.length === 0) {\n\t returnCallback(derezObj);\n\t } \n\t }", "title": "" }, { "docid": "9bc32ca8dcadb739ebb92d72e682c649", "score": "0.6380459", "text": "function done(){\r\n doneCount++;\r\n if (doneCount == 2) {\r\n complete(cbName);\r\n }\r\n }", "title": "" }, { "docid": "d1e737a2281c232e79bebb6a491280c7", "score": "0.63801765", "text": "function done () {\n callback(self, $el);\n }", "title": "" }, { "docid": "985123a674a9cc66c1c86f76fd2303a3", "score": "0.6377986", "text": "function end(){\n \n }", "title": "" }, { "docid": "dd3911bd6bec00b97e6bcf6b0260e4c5", "score": "0.63683563", "text": "function done() {\n alert(\"THIS IS DONE\");\n}", "title": "" }, { "docid": "d61800961a2e0ad9e61f02e93f4013d6", "score": "0.63614017", "text": "function finished() {\n console.log('Finished!');\n}", "title": "" }, { "docid": "b3bce11eecf002bb41d1ec473b9f2258", "score": "0.6351887", "text": "onend() {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.63396996", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.63396996", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.63396996", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.63396996", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "d05e2e9d2846387a661ac696bcf50ebe", "score": "0.6338859", "text": "function __done() {\n if (textureCount == noOfTextures) {\n doneCallback();\n }\n}", "title": "" }, { "docid": "e1912620e66a9e4c9568b70e253028fe", "score": "0.63376874", "text": "done() {\n this.gs = !0;\n }", "title": "" }, { "docid": "e12185f3b994b6921ff1244df29df079", "score": "0.6333393", "text": "function markCompleted() {}", "title": "" }, { "docid": "2ff307d6132e9e850570fc61c7828926", "score": "0.631779", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.6296205", "text": "function callback(){}", "title": "" }, { "docid": "e90f02810bcef74974ec972722a0594e", "score": "0.6289726", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "e90f02810bcef74974ec972722a0594e", "score": "0.6289726", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "e90f02810bcef74974ec972722a0594e", "score": "0.6289726", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "eb6e1b54047b745ed78bc769eb4e3a55", "score": "0.62575394", "text": "function done() {\n self._server = null;\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "93a53ca9004e866eec9bce80347b073e", "score": "0.6254141", "text": "function finish () {\n // display results\n console.log('done');\n}", "title": "" }, { "docid": "602db31a092c190076edbbec8df1abb3", "score": "0.6241809", "text": "function callbackAllSucceeded(){\n self.callback.successAll(loaded.data);\n }", "title": "" }, { "docid": "6c1a5e930541eee7db9cc708909d5a76", "score": "0.62406933", "text": "function onFinish() {\n\t\tclbk();\n\t}", "title": "" }, { "docid": "83c7c8ee8ac96fea72489fca78b4d24c", "score": "0.6226668", "text": "function done() {\n self._server = null;\n\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "397a51a876144bb80c5290b0d1e5b44b", "score": "0.6215926", "text": "function checkDone() { // called after each async call, executes the call back when the last one finishes\n asyncCallsDone++;\n if (asyncCallsDone >= NUM_ASYNC_CALLS) {\n //console.log(\"Finished constructor for \"+JSON.stringify(self, 3));\n callback();\n }\n }", "title": "" }, { "docid": "14bc6439d50ba9a8fa8935f93bc84896", "score": "0.618795", "text": "end() {\n if (this.options.hurry) {\n return;\n }\n\n this.log(`All done; ${this.context.pluginName} is ready to go!`);\n }", "title": "" }, { "docid": "d94f9083845151a6b1a714b4ac5cac2f", "score": "0.6185992", "text": "function onCompletion(err) {\n\tif(err) throw err;\n\tconsole.log('done');\n\tprocess.exit();\n}", "title": "" }, { "docid": "3444e305254a05807916d19d84d2b4f0", "score": "0.6183815", "text": "function onParseFinished() {\n\t\n\t//Write every time - useful in very long processes\n\twriteFile();\n\ttry {\n\t\tnextFile();\n\t} catch(err) {\n\t\t//writeColors();\n\t}\n}", "title": "" }, { "docid": "8990bc4f8fda226e1e7ec5d7d11d56f5", "score": "0.6165565", "text": "function done(){\n\t\ts.working = false;\n\t}", "title": "" }, { "docid": "ce17188c2b1e20a618933a77bc2e4e13", "score": "0.6160495", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n next.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "ce17188c2b1e20a618933a77bc2e4e13", "score": "0.6160495", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n next.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "8f3928e0e6456e74d3397bddff8d73e1", "score": "0.6129457", "text": "static completed () {\n return completed\n }", "title": "" }, { "docid": "5c523e7c26f46780878c3b19d2044f6e", "score": "0.61217946", "text": "function doneFunc(pParams) {\n Util.exec(pParams.callback);\n \n var lNum = done.pop (pParams.number);\n if (!lNum) {\n Util.exec(pCallback);\n }\n }", "title": "" }, { "docid": "d80ed6373c86ff1b4c9300cd9ebc61cf", "score": "0.6119888", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n next.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "d9e4c24344200058cabce4a10eb7358f", "score": "0.6106835", "text": "function completed() {\n\t\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\t\twindow.removeEventListener(\"load\", completed);\n\t\t\tjQuery.ready();\n\t\t}", "title": "" }, { "docid": "d9e4c24344200058cabce4a10eb7358f", "score": "0.6106835", "text": "function completed() {\n\t\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\t\twindow.removeEventListener(\"load\", completed);\n\t\t\tjQuery.ready();\n\t\t}", "title": "" }, { "docid": "d9e4c24344200058cabce4a10eb7358f", "score": "0.6106835", "text": "function completed() {\n\t\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\t\twindow.removeEventListener(\"load\", completed);\n\t\t\tjQuery.ready();\n\t\t}", "title": "" }, { "docid": "d4ceba571bef1c7d5be44dc4302f3aa4", "score": "0.60881686", "text": "function defaultDoneCallback(err) {\n if (err) {\n console.error(err.stack ? err.stack : err);\n console.error('\\nThe tests now halt. You might have unfinished tasks.'.red);\n } else {\n console.log('\\nAll done successfully!'.green);\n }\n}", "title": "" }, { "docid": "04fc138d92d18df069d2a3dccd70dbf9", "score": "0.60591674", "text": "function my_callback(json_result) {\n console.log(\"Done\");\n }", "title": "" }, { "docid": "966953d0e1e7e3fc652197cc2e850dfc", "score": "0.604956", "text": "set done(value) {}", "title": "" }, { "docid": "c4fcf9a3398383dd408fa8a08ffce3fd", "score": "0.6049335", "text": "sequenceDone() { /* place handling code here if needed */ }", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.6033168", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "77e1698a0503e353dec742bcd47f7cd6", "score": "0.6026063", "text": "function finishedAllCallbacks(){\n if(emailSubject.length == config.mail.howManyEmails){\n displayEmails();\n }\n}", "title": "" }, { "docid": "cf346e306101f0294bd904fcd3047f42", "score": "0.60203624", "text": "function finish (err, results) {\n done( );\n }", "title": "" }, { "docid": "a64c0b013e468a174662d59ab4a53829", "score": "0.60162705", "text": "function final1() { console.log('Done', results); }", "title": "" }, { "docid": "3f2b76ef8ac4237bddecd9a5059d861a", "score": "0.6012331", "text": "function done() {\n if (!--remaining && callback) {\n callback();\n }\n }", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "21e8099f83bb6da386fc106496cd3f74", "score": "0.6010257", "text": "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "title": "" } ]
8385a4d0d7f04b987adda18256d8bc5b
Input i. A String, called searchString. ii. A String, called subString. Output: A Boolean.true if the subString is a part of the searchString.
[ { "docid": "c7d310c06598de3de251b67c5572dc75", "score": "0.7425187", "text": "function isSubstring(string, substring) {\n return string.includes(substring);\n}", "title": "" } ]
[ { "docid": "b9bbc5dde6dfe4685068ee34331f76ec", "score": "0.8219155", "text": "function isSubstring(searchString, subString) {\n let searchArr = searchString.split(\" \");\n for (let i = 0; i < searchArr.length; i += 1) {\n let subWod = searchArr[i]; \n if (subWod === subString) {\n return true; \n }\n }\n return false; \n \n}", "title": "" }, { "docid": "42e1a902720765a28f4becfb9d9bcead", "score": "0.8150469", "text": "function isSubstring(searchString, subString) {\n return searchString.includes(subString);\n}", "title": "" }, { "docid": "31f4c71071968a7c467379094d97ee09", "score": "0.8085471", "text": "function isSubstring(searchString, subString) {\n return searchString.split(\" \").includes(subString)\n}", "title": "" }, { "docid": "dd41224b53bc52f17b124b31105ca331", "score": "0.8050977", "text": "function isSubstring(searchString, subString) {\n return (searchString.toLowerCase().indexOf(subString.toLowerCase())) >=0;\n}", "title": "" }, { "docid": "1c7c898abc2b55ceeb988e2df51cfbd5", "score": "0.8006531", "text": "function isSubstring(searchString, subString) {\n let strArr = searchString.split(' ');\n return strArr.includes(subString);\n}", "title": "" }, { "docid": "ee817cec2fe17f715ebcccafd3f62db6", "score": "0.7993309", "text": "function isSubstring(searchString, subString){\n let arr = searchString.split(\" \")\n for(i=0; i<arr.length; i++) {\n if(arr[i].toLowerCase() == subString.toLowerCase()) {\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "1b469dde344e78ac5d9fa2bf3e090357", "score": "0.79629165", "text": "function isSubstring(searchString, subString) {\n // solution 1:\n // return searchString.includes(subString);\n\n const subStrs = []\n for (let i = 0; i < searchString.length; i++) {\n for (let j = i + 1; j <= searchString.length; j++) {\n subStrs.push(searchString.slice(i, j));\n }\n }\n \n // solution 2:\n // return subStrs.includes(subString); // return is mandatory\n\n // solution 3:\n // let isTrue = false;\n // subStrs.forEach(function(subStr) {\n // if (subString === subStr) {\n // isTrue = true;\n // }\n // })\n\n // return isTrue;\n\n // solution 4:\n for (let i = 0; i < subStrs.length; i++) {\n if (subStrs[i] === subString) {\n return true;\n }\n };\n\n return false;\n}", "title": "" }, { "docid": "144d0a5bd449cf58e70acbc34135f765", "score": "0.7401767", "text": "function InStr(strSearch, strFind) \r\n{\r\n strSearch = String(strSearch);\r\n strFind = String(strFind);\r\n for (ix = 0; ix < strSearch.length; ix++) {\r\n if (strFind == Mid(strSearch, ix, strFind.length)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "30b0be3f36b328341745eeb74c7dcd11", "score": "0.7365146", "text": "function isSubstring(fullString, subString) {\n return fullString.indexOf(subString) > -1;\n}", "title": "" }, { "docid": "f0a02d83202625b0478ede82a9a1ebcf", "score": "0.7338055", "text": "function contains(str,sub_str){\n return (str.indexOf(sub_str) > -1);\n}", "title": "" }, { "docid": "29a76460a469cf4509a1f7a06e20ffeb", "score": "0.73112404", "text": "function strContains(str, substring) {\n\treturn str.indexOf(substring) > -1;\n}", "title": "" }, { "docid": "29a76460a469cf4509a1f7a06e20ffeb", "score": "0.73112404", "text": "function strContains(str, substring) {\n\treturn str.indexOf(substring) > -1;\n}", "title": "" }, { "docid": "7d6ff4bbda95aac619bcbd5c94784fc7", "score": "0.72867143", "text": "function isSubStringExist(mainString, substring)\r\n{\r\n if (mainString.indexOf(substring) != -1)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "9d6ecd707defb72c7bbd2dd395aa6256", "score": "0.72379076", "text": "function isSubstring(phrase, subphrase) {\n return phrase.includes(subphrase);\n}", "title": "" }, { "docid": "8f635d65812afec5de2201906b73c321", "score": "0.7232113", "text": "function isSubstring(str, substring) {\n for (let i = 0; i < str.length; i++) {\n let currentSubstring = \"\";\n for (let j = i; j < i + substring.length; j++) {\n currentSubstring += str[j];\n }\n if (currentSubstring === substring) return true;\n }\n return false;\n}", "title": "" }, { "docid": "249572103152b2f48de4db67f4e8e2cb", "score": "0.7173629", "text": "function isSubString(str1,str2){\nif(str1.includes(str2)){\n return true;\n}\nelse return false;\n}", "title": "" }, { "docid": "6fee34045cf1befcbddef3fc352f94ea", "score": "0.71601355", "text": "function contains (baseStr, searchStr) {\n\tif (!isString(baseStr) || !isString(searchStr))\n\t\treturn false;\n\n\tif (baseStr.indexOf(searchStr) > -1)\n\t\treturn true;\n\n\treturn false;\n}", "title": "" }, { "docid": "11b7125154c15d4bb4caad65e3966962", "score": "0.7101238", "text": "function contains (baseStr, searchStr) {\r\n if (!isString(baseStr) || !isString(searchStr))\r\n return false;\r\n\r\n if (baseStr.indexOf(searchStr) > -1)\r\n return true;\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "317d9d8f86849da7d2f68e99587945d5", "score": "0.70929337", "text": "function checkForSubstr(string, substr){\n var index = string.indexOf(substr);\n if(index < 0){\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "c3479f4971779791a5dc24fc7fd00952", "score": "0.7037527", "text": "searchSubString(str, query) {\n return str.toLowerCase().indexOf(query.toLowerCase()) !== -1;\n }", "title": "" }, { "docid": "a622f88c2082cf34fad999395ce8ee7b", "score": "0.69907194", "text": "function isSubstring(in_s, target) {\n var string_arr = in_s.split(' ');\n for (var i = 0; i < string_arr.length; i++) {\n if (string_arr[i] == target) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3ff1563ec6c82fa6cfae501a5b728acc", "score": "0.6986934", "text": "function sc_stringContains(s1,s2,start) {\n return s1.indexOf(s2,start ? start : 0) >= 0;\n}", "title": "" }, { "docid": "2ee349df50c0145d38e4107c6e1435d0", "score": "0.69740576", "text": "function containString(whole, part) {\n return whole.toLowerCase().indexOf(part.toLowerCase()) !== -1;\n}", "title": "" }, { "docid": "474695eb686376fc5eebf5ee6d7d94c2", "score": "0.69413817", "text": "function isSubstring(str, substr) {\n return str.includes(substr);\n}", "title": "" }, { "docid": "2a16773de098dd35b09e472cacd42f50", "score": "0.6876979", "text": "function startsWith(string, searchString) {\n searchstringLength = searchString.length\n for (i = 0; i < searchstringLength; i++) {\n if (searchString[i] !== string[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "f012217e3274b142dbef98fcd74b25ea", "score": "0.68724304", "text": "function containsSubstring(a, b) {\n if(a.toLowerCase().trim().indexOf(b.toLowerCase().trim()) > -1) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "b5eb77f681ee46d504dfa1db602a4848", "score": "0.68372405", "text": "function isSubStringInArray(array,string) {\n var numElements = array.length;\n for(var j = 0; j < numElements; j++) {\n if (stringContains(string,array[j])) { return true; }\n }\n return false;\n}", "title": "" }, { "docid": "03fc441f0979124c8d1b504c62c8a7f2", "score": "0.68308467", "text": "function startsWith(string, searchString) {\n for (let index = 0; index < searchString.length; index += 1) {\n if (string[index] !== searchString[index]) return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "529c4902c773b0369376abf4c7d00013", "score": "0.68080133", "text": "contains(string) {\n let search = this.root;\n for (let i = 0; i < string.length; i += 1) {\n if (!search[string[i]]) {\n return false;\n } else {\n search = search[string[i]];\n }\n }\n return !!search[this.endSymbol];\n }", "title": "" }, { "docid": "6d00b4a1e1fbefbda8236a7a205a6bcc", "score": "0.6805499", "text": "function sc_isSubstring_at(str1, str2, i, len) {\n if (!len) len = str2.length;\n else if (str2.length < len) return false;\n if (str1.length < len + i) return false;\n return str2.substring(0, len) == str1.substring(i, i+len);\n return s2 == s1.substring(i, i+ s2.length);\n}", "title": "" }, { "docid": "676852ad9dbd2b0873c92c4c4bd52cb0", "score": "0.67533875", "text": "function checkForSubstrIgnoreCase(string, substr){\n var index = string.toUpperCase().indexOf(substr.toUpperCase());\n if(index < 0){\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "45c7cc3b042665a52f9384054bb29b63", "score": "0.67354685", "text": "function isSubString_Include(str1,str2){\nreturn str1.includes(str2);\n}", "title": "" }, { "docid": "0836f0ae54c01c7a7f272f3987b049f6", "score": "0.67211336", "text": "function isSubstring(needle, haystack) {\n return haystack.indexOf(needle) > -1;\n}", "title": "" }, { "docid": "af65b644bc4774fddf34ba139214e8d0", "score": "0.670725", "text": "function contains(all, substring) {\n return all.toUpperCase().indexOf(substring.toUpperCase()) != -1;\n}", "title": "" }, { "docid": "d155e08dd01f8948a6da47af4a5f8b5b", "score": "0.67023695", "text": "function contains(str, substr) {\n return !!~(\"\" + str).indexOf(substr);\n }", "title": "" }, { "docid": "89e79aabd358a0e2e6225680581cd721", "score": "0.66762483", "text": "function contains(str, substr) {\n return str.indexOf(substr) >= 0;\n}", "title": "" }, { "docid": "b739f8b0380c3f10b45de728066332e2", "score": "0.6651489", "text": "function contains (data, substring) {\n return string(data) && data.indexOf(substring) !== -1;\n }", "title": "" }, { "docid": "a96298bf61fd7625a9a5aa92f597b954", "score": "0.66301125", "text": "function isSubsequence(sub, str) {\n // DO stuff\n //if substring is longer than the string return false\n if (sub.length > str.length) {\n return false;\n }\n // Create pointers for string1 and string 2\n let pointer1 = 0;\n let pointer2 = 0;\n // Loop through each string checking for order matching\n let letter = sub[pointer1];\n while (pointer2 < str.length) {\n //if the letters match move pointer1 up one\n if (str[pointer2] == sub[pointer1]) {\n pointer1++;\n }\n //if pointer 1 at max return true\n if (pointer1 == sub.length) {\n return true;\n }\n pointer2++;\n }\n // If no match returnfalse\n return false;\n}", "title": "" }, { "docid": "03cde728a9875b4e4a6b8dd56b1ee628", "score": "0.66248536", "text": "function substringExists(array, string) {\n var result = false;\n \n array.forEach(function(element) {\n if(element.toLowerCase().indexOf(string.toLowerCase()) !== -1) {\n result = true;\n }\n });\n \n return result;\n}", "title": "" }, { "docid": "64a64390ba8ef250e3b38722f5b3e8d3", "score": "0.6616432", "text": "function stringContains (haystack, needle){\n\tvar index = haystack.indexOf(needle);\n\tif (index === -1){\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n\n}", "title": "" }, { "docid": "efb272b012b76cfd7d633de57e1f734e", "score": "0.66110975", "text": "function stringIncludes(string, search) {\n if (isArray(search)) {\n for (var i = 0; i < search.length; i++) {\n if (stringIncludes(string, search[i])) {\n return true;\n }\n }\n return false;\n }\n if (string.includes) {\n return string.includes(search);\n }\n return string.indexOf(search) !== -1;\n }", "title": "" }, { "docid": "b768c1ed6e9f13e883cb1ca003a375f7", "score": "0.66002643", "text": "function stringSearch(str, list){\r\n for (let i = 0; i < splitSearchString.length; i++){\r\n if(str.indexOf(list[i]) > -1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "8a4dedc01d3467d1d56502c123b19c74", "score": "0.6585418", "text": "function contains(data, substring) {\n return string(data) && data.indexOf(substring) !== -1;\n }", "title": "" }, { "docid": "e1d94b488390475c6c9f18079ed8bad3", "score": "0.6577253", "text": "function isSubstring(s1, s2) {\n return s1 == s2;\n}", "title": "" }, { "docid": "e6bc7f6d075405e7c80882c44cc95394", "score": "0.6573814", "text": "function isSubstringOf(small ,big){\r\n //! \\todop check\r\n var subLen = small.length;\r\n var flag = false;\r\n for(var i=0; i < ( big.length-subLen ); i++){\r\n if(small == big.substring(i, i+subLen)){\r\n flag = true;\r\n break;\r\n }\r\n \r\n }\r\n \r\n return flag;\r\n}", "title": "" }, { "docid": "e64ecc1285ea917e9644959ac20792aa", "score": "0.65674686", "text": "function contains( str, substr ) {\n\t return !!~('' + str).indexOf(substr);\n\t }", "title": "" }, { "docid": "cfe83922fa92f1c953ebabcba2c96a30", "score": "0.6536042", "text": "function subStringFun_1(str1, str2){\n\tif(typeof str1 === 'string' && typeof str2 === 'string'){\n\t\t// var result = str1.match(/''/g);\n\t\tif(str1.indexOf(str2) !== -1){\n\t\t\tconsole.log('String 1 contains String 2');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ee09cd5589830a19b4812061e27581a2", "score": "0.6534811", "text": "function subStringFinder(str, subStr) {\n var idx = 0,\n i = 0,\n j = 0,\n len = str.length,\n subLen = subStr.length;\n\n for (; i < len; i++) {\n if (str[i] == subStr[j]) j++;\n else j = 0;\n\n //check starting point or a match\n if (j == 0) idx = i;\n else if (j == subLen) return idx;\n }\n\n return -1;\n}", "title": "" }, { "docid": "16e38162ac3b50c73a0d2bdeb289e39a", "score": "0.649569", "text": "function stringContains (haystack, needle) {\n var index = haystack.indexOf(needle);\n if (index === -1) {\n \treturn false;\n } else {\n \treturn true;\n }\n}", "title": "" }, { "docid": "2ac464f50c1545a412a400e698c9bfe3", "score": "0.64956576", "text": "function contains( str, substr ) {\r\n return !!~('' + str).indexOf(substr);\r\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.6493258", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "c509a42e4ebda655e6d01972e6bb6e36", "score": "0.64848435", "text": "function includesAt(text, sub, idx) {\n\tif (typeof(text) === 'string') {\n\t\treturn text.substr(idx, sub.length) == sub;\n\t} else {\n\t\treturn text[idx] == sub;\n\t}\n}", "title": "" }, { "docid": "bbd9eb401ec38281d9eb6d1c435cf950", "score": "0.6484605", "text": "function isSubsequence(targetStr, searchStr) {\n let targetIdx = 0;\n let searchIdx = 0;\n // if targetStr is null or undefined\n if (!targetStr) return true;\n // while search pointer hasn't reached end of searchStr\n while (searchIdx < searchStr.length) {\n // if curr char in searchStr is equal to curr char in targetStr, move target pointer 1 postion\n if (searchStr[searchIdx] === targetStr[targetIdx]) targetIdx++;\n // if found total num of chars equal to targetStr length, you have found the correct subsequence of chars\n if (targetIdx === targetStr.length) return true;\n // always move search pointer 1 position\n searchIdx++;\n }\n return false;\n}", "title": "" }, { "docid": "f6c656a70b75139ae31786d27226b398", "score": "0.64680415", "text": "function strSearch(str1, str2) {\n var contains = false;\n var start = 0;\n var end = 0;\n var count = 0;\n for (i = 0; i < str1.length; i++) {\n var sub = \"\";\n if (str1[i - 1] == \" \") {\n end = i - 1;\n for (j = start; j < end; j++) {\n sub += str1[j];\n }\n start = end + 1;\n }\n if (i == str1.length - 1) {\n for (h = start; h < str1.length; h++) {\n sub += str1[h];\n }\n }\n for (x = 0; x < sub.length; x++) {\n if (str2[x] == sub[x]) {\n count++;\n }\n }\n if (count == sub.length && count == str2.length) {\n contains = true;\n }\n }\n return contains;\n}", "title": "" }, { "docid": "76e1d2d728bc008ecd0bc4e654af931b", "score": "0.64554316", "text": "function contains(str, substr) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "a441ae8f6806d726c918d77637a1154e", "score": "0.6437302", "text": "function sc_stringCIContains(s1,s2,start) {\n return s1.toLowerCase().indexOf(s2.toLowerCase(),start ? start : 0) >= 0;\n}", "title": "" }, { "docid": "fd00ab3ee46bf9cc18eca7a60af74869", "score": "0.63679755", "text": "function isSubsequence(sub, str) {\n if(sub.length > str.length) return false;\n let pointer = 0;\n for(let i = 0; i < str.length; i ++) {\n if(str[i] === sub[pointer]) {\n pointer += 1;\n }\n }\n if(pointer === sub.length) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "8fd00bb860659bd30a41aa62c692750e", "score": "0.6345413", "text": "function isStrInWord(initial_string, word) {\n if (word.includes(initial_string)) {\n return true;\n }\n else{\n return false;\n }\n}", "title": "" }, { "docid": "989cba82652ced33786981b08770d461", "score": "0.63318175", "text": "function startsWith (str, searchStr) {\n if (searchStr == null) {\n searchStr = ''\n }\n\n return str.slice(0, searchStr.length) === searchStr\n}", "title": "" }, { "docid": "3bdab5bcc6f8b9f7133f66ce73cd2f9d", "score": "0.63156044", "text": "function any_has_substr(a, s)\n{\n\tfor (var i = 0; i != a.length; ++i)\n\t\tif (a[i].toLowerCase().indexOf(s) != -1)\n\t\t\treturn true;\n\treturn false;\n}", "title": "" }, { "docid": "3bdab5bcc6f8b9f7133f66ce73cd2f9d", "score": "0.63156044", "text": "function any_has_substr(a, s)\n{\n\tfor (var i = 0; i != a.length; ++i)\n\t\tif (a[i].toLowerCase().indexOf(s) != -1)\n\t\t\treturn true;\n\treturn false;\n}", "title": "" }, { "docid": "09250c17fd2475b13fb822434d2107fe", "score": "0.62925464", "text": "function stringSearch(str, substr){\n let count = 0;\n for(let i = 0; i < str.length; i++){\n for(let j = 0; j < substr.length; j++){\n if(substr[j] !== str[i+j]){\n break;\n }\n if(j === substr.length - 1){\n count++;\n }\n }\n }\n return count;\n}", "title": "" }, { "docid": "f5c930803f2107e429470e9a0e0f200c", "score": "0.62851214", "text": "function contains(c, str) {\r\n\tfor (var i = 0; i < str.length; i++) {\r\n\t\tif (str[i] == c)\r\n\t\t\treturn true;\r\n\t}\r\n\t\r\n\treturn false;\r\n}", "title": "" }, { "docid": "d236b47449a1855f280a47c576d04cce", "score": "0.6267188", "text": "function containsIgnoreCase (baseStr, searchStr) {\n\tif (!isString(baseStr) || !isString(searchStr))\n\t\treturn false;\n\n\tif (baseStr.toLowerCase().indexOf(searchStr.toLowerCase()) > -1)\n\t\treturn true;\n\n\treturn false;\n}", "title": "" }, { "docid": "dd0a48931b04de360e4779d7ba624949", "score": "0.6242333", "text": "function containsIgnoreCase (baseStr, searchStr) {\r\n if (!isString(baseStr) || !isString(searchStr))\r\n return false;\r\n\r\n if (baseStr.toLowerCase().indexOf(searchStr.toLowerCase()) > -1)\r\n return true;\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "3b1b5b23b7bbabbed02bde474680f475", "score": "0.62376237", "text": "function stringOperation(str) {\n if(str.startsWith(\"J\")){\n return true;\n }\n if(str.EndsWith(\"v\")){\n return true;\n }\n}", "title": "" }, { "docid": "78b052c8ce74661b235cef17cfa58525", "score": "0.6222734", "text": "function contains(s, r, start) /* (s : string, r : regex, start : ?int) -> bool */ {\n var start_271 = (start !== undefined) ? start : 0;\n return $std_core.bool_1(find(s, r, start_271));\n}", "title": "" }, { "docid": "e205189fc579a76e43bdc09cf4d26fd1", "score": "0.62026775", "text": "function hasWord(string, word) {\n//create a conditional statement \n//if the string param includes the word param in it return true\n if (string.includes(word)) {\n return true;\n//if not return false\n } else return false;\n\n}", "title": "" }, { "docid": "2c2bf801289083be1627b10e1cf3c72f", "score": "0.6198689", "text": "function contains(string, searchChar){\n if(string.indexOf(searchChar) != -1) return true;\n else return false;\n}", "title": "" }, { "docid": "2929691b1d78845d8be2c9e026b25273", "score": "0.6194073", "text": "function stringSearch (string, substring){\n let count = 0;\n for(let i =0; i< string.length; i++){\n for(let j = 0; j < substring.length; j++){\n console.log(substring[j], string[i+j])\n\n if(substring[j] !== string[i+j]){\n console.log(\"BREAK\")\n break;\n }\n\n if(j === substring.length - 1) {\n console.log(\"FOUND ONE\");\n count++;\n } \n }\n }\n console.log(count)\n return count;\n}", "title": "" }, { "docid": "e1fed2f979a54dde68e5d3f246d03ac2", "score": "0.6186597", "text": "function hasWord(string, word) {\n//return true if argument string contains argument word\n//return false if not\n//check a string for a word\n\nreturn string.includes(word);\n\n}", "title": "" }, { "docid": "e7f3f6a398369bb2dcc93b41790ec82e", "score": "0.6168875", "text": "function findMatch(subString, str) {\n let m = subString.length;\n let n = str.length;\n\n // ex: 'name', 'abcname'\n // take the length of the subString and str\n // loop from 0 --> i <= n-m....i.e: 0 <= 7 - 4\n // while 0 < 4 && str[0] === subString[0]\n // if while loop conditonal isnt fulfilled\n // for loop increments i and checks next letter\n // than increment j\n // continue to check next letter within string\n //\n\n for (let i = 0; i <= n - m; i++) {\n let j = 0;\n while (j < m && str[i + j] === subString[j]) {\n //\n j = j + 1;\n\n if (j === m) return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "3852433ad37ee9740f4e38b9879f1d50", "score": "0.6161751", "text": "function startsWith(string, pattern) {\nreturn string.slice(0, pattern.length) == pattern;\n}", "title": "" }, { "docid": "8272081a56d15294ce268b0be1c3246a", "score": "0.61179596", "text": "function startsWith(string, pattern) {\n\t\treturn string.slice(0, pattern.length) === pattern;\n\t}", "title": "" }, { "docid": "09e062ed00c926705bbf06fa2ea8cb8f", "score": "0.6113356", "text": "function testinput(re, str) {\n var midstring;\n if (str.search(re) != -1) {\n midstring = ' contains ';\n } else {\n midstring = ' does not contain ';\n }\n console.log('data' + midstring + re)\n }", "title": "" }, { "docid": "9eee86470d93f064b771ec64e95ed6e0", "score": "0.6063521", "text": "function stringContains(largeString,smallString) {\n if(largeString.length > smallString.length) {\n if(largeString.indexOf(smallString) != -1) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "877a38f6f6dd359b296ff307659c627d", "score": "0.60608906", "text": "function hasWord(string, word){\n if (string.indexOf(word) != -1){\n return true;\n }else {\n return false;\n }\n}", "title": "" }, { "docid": "fa99b6c85680babf5c9834e3ccbcf8cc", "score": "0.60475576", "text": "function hasWord(string, word){\n return string.indexOf(word) > -1;\n}", "title": "" }, { "docid": "a1660711ea355e2f3ad7694bb4584dd0", "score": "0.60412425", "text": "function startsWith(str, searchString, position) {\n cov_24vn3a78n4.f[0]++;\n cov_24vn3a78n4.s[0]++;\n\n return str.substr((cov_24vn3a78n4.b[0][0]++, position) || (cov_24vn3a78n4.b[0][1]++, 0), searchString.length) === searchString;\n}", "title": "" }, { "docid": "f083d10714f677ccee151fa0c8d8ec61", "score": "0.6035659", "text": "function hasWord(string, word) {\nif(string.includes(word)){\n return true;\n}\nelse {\n return false;\n}\n}", "title": "" }, { "docid": "18dbc1bf17ad52958b5393fcb7f3433d", "score": "0.60201234", "text": "function esSubcadena(texto,subcadena){\n\tvar result = texto.indexOf(subcadena) > -1;\n\treturn result;\n}", "title": "" }, { "docid": "a04e769a4c43dd5742da44f2496f057a", "score": "0.60183156", "text": "function hasWord(string, word) {\n // takes a string of words and a single word\n // should return a boolean\n\n // create an array to hold each word in the string\n // split the string into the array\n var strArr = string.split(' ')\n // create an if statement to search through the string array using the includes method\n if (strArr.includes(word)) {\n // if the array includes the word, return true\n return true;\n }\n else {\n // otherwise return false\n return false;\n }\n}", "title": "" } ]
74a1f80357ea9a504efa90ded2f2bd30
function to format the array of desired characteristics
[ { "docid": "2655d555e0cadd7d1745147e52003878", "score": "0.75889975", "text": "function formatArr (targetArr, characteristic, formattedArr) {\n\t\tfor (var i = 0; i < targetArr.length; i++) {\n\t\t\tvar obj = {};\n\t\t\tobj[characteristic] = targetArr[i];\n\t\t\tformattedArr.push(obj);\n\t\t};\n\t\treturn formattedArr;\n\t}", "title": "" } ]
[ { "docid": "f5fbeebdfdd8561a41d6567f2ac6e640", "score": "0.6123115", "text": "function formatFeatureArray(arr) {\n\tvar output = [];\n\twhile (arr.length > 0) {\n\t\toutput.push(arr.splice(0, 28));\n\t}\n\treturn output;\n}", "title": "" }, { "docid": "1c77f36343b406153051e12928156851", "score": "0.60278034", "text": "function reformat(array) {\n\t\tvar data = [];\n\t\tarray.map(function (d) {\n\t\t\tdata.push({\n\t\t\t\tproperties: {\n\t\t\t\t\t_id: d._id,\n\t\t\t\t\tprice: d.price,\n\t\t\t\t\tarea: d.pow,\n\t\t\t\t\tprice_sq: d.price / d.pow\n\t\t\t\t},\n\t\t\t\ttype: \"Feature\",\n\t\t\t\tgeometry: {\n\t\t\t\t\tcoordinates: [d.data_lon, d.data_lat],\n\t\t\t\t\ttype: \"Point\"\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\treturn data;\n\t}", "title": "" }, { "docid": "38d86cbf29f7a945558a9a7c77e759cf", "score": "0.5855515", "text": "formatArrayOfArrayOfObject(data) {\n if (!this.inputLookup) {\n const lookupTable = new LookupTable(data);\n this.inputLookup = this.outputLookup = lookupTable.table;\n this.inputLookupLength = this.outputLookupLength = lookupTable.length;\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n const array = [];\n for (let j = 0; j < data[i].length; j++) {\n array.push(objectToFloat32Array(data[i][j], this.inputLookup, this.inputLookupLength));\n }\n result.push(array);\n }\n return result;\n }", "title": "" }, { "docid": "92929aeca280a35b9dd6b7ed1516463f", "score": "0.58531433", "text": "getRendering() {\n const res = [];\n for( let row = 0 ; row < this.nrows ; row ++) {\n let s = \"\";\n for( let col = 0 ; col < this.ncols ; col ++ ) {\n let a = this.arr[row][col];\n if( this.exploded && a.mine) s += \"M\";\n else if( a.state === STATE_HIDDEN) s += \"H\";\n else if( a.state === STATE_MARKED) s += \"F\";\n else if( a.mine) s += \"M\";\n else s += a.count.toString();\n }\n res[row] = s;\n }\n return res;\n }", "title": "" }, { "docid": "01cf546c58891708b802dd6ec8fde13e", "score": "0.58504456", "text": "getFormattedData() {\n return $(this.data).map(function(idx, item) {\n let t = new Array();\n\n for (let i in item) {\n t.push(item[i]);\n }\n return [t];\n });\n }", "title": "" }, { "docid": "06713b2f6ef79b759613f458905ab9b5", "score": "0.58027256", "text": "function aw(arr) {\n if (arr.length == 2) {\n return arr[1].trim() + ((arr[0].indexOf('[') > -1) ? '' : '__D') + arr[0].trim();\n }\n else {\n var s = arr.shift();\n return '__v(' + aw(arr) + ',{})' + ((s.indexOf('[') > -1) ? '' : '__D') + s.trim();\n }\n }", "title": "" }, { "docid": "751201817ef14e1f48161e31288f8831", "score": "0.57864904", "text": "function formattingQuestionData (dataArr, format){\r\n console.log(\"formattingQuestionData ran\");\r\n let formattedQ_arr = dataArr.map((item) => format(item));\r\n return formattedQ_arr;\r\n \r\n}", "title": "" }, { "docid": "e7f8a90d184f9adb59a7da8617d57813", "score": "0.5776383", "text": "function formatData(structureArr, data){\n\tvar lines = data.toString().split(\"\\n\"), //lines -> array of strings where each line is an array entry\n\t\tlineSplit, \n\t\tsyllableCount,\n\t\twordsArray = [],\n\t\tsyllablesArray,\n\t\twordToSyllableDictionary = {},\n\t\tsyllableToWordDictionary = {}; //{'1': array of all the words with 1 syllable, \"2\":}\n\n\n\t// as you push words in use objects for key-value mapping for number of syllables in a word better than an array\n\t// especially if you have a lot of words.\n\t// console.log(line[10].split(\" \"));\n\n\n\t// console.log(lines);\n\tlines.forEach(function(line){\n\t\tlineSplit = line.split(\" \");\n\t\twordsArray.push(lineSplit[0]);\n\t\tsyllableCount = countSyllables(lineSplit);\n\t\twordToSyllableDictionary[lineSplit[0]] = syllableCount;\n\n\t\tif(syllableToWordDictionary[syllableCount.toString()] === undefined){\n\t\t\tsyllableToWordDictionary[syllableCount.toString()] = [];\n\t\t\tsyllableToWordDictionary[syllableCount.toString()].push(lineSplit[0]);\n\t\t}\n\t\telse{\n\t\t\tsyllableToWordDictionary[syllableCount.toString()].push(lineSplit[0]);\n\t\t}\n\n\t\t// console.log(\"The word \" + lineSplit[0] + \" has this phoneme layout: \" + lineSplit[1]);\n\t})\n\n\t// console.log(syllableToWordDictionary);\n\t// console.log(lineSplit);\n\n\n\n\tsyllablesArray = generateSyllablesArray(syllableToWordDictionary, structureArr);\n\n\t// console.log(syllablesArray);\n\t// console.log([wordToSyllableDictionary,syllablesArray]);\n\t// console.log(wordsArray);\n\treturn [wordToSyllableDictionary,syllablesArray]\n}", "title": "" }, { "docid": "a83df3fc8920f6532404cd0fee2ad207", "score": "0.57598627", "text": "function mice_data_format( data) {\n var dataFormatted = [];\n for (var i=0; i < data.length; i++) {\n dataFormatted.push( {'name': 'Gen' + i, 'children': data[i]});\n }\n return dataFormatted;\n }", "title": "" }, { "docid": "a640144c639daa81127303b8676f457a", "score": "0.575459", "text": "function formatData(arr) {\n\n var dataFormat = {}\n for(key in arr[0]){\n if(key !== 'name'){\n dataFormat[key] = {}\n }\n }\n\n \n arr.forEach(function(obj, index) {\n\n //getMaxValues\n normalizeData(obj);\n \n //restructure Data\n for(key in obj){\n\n if(key !== 'name'){\n if(typeof dataFormat[key][obj.name] === 'undefined'){\n dataFormat[key][obj.name] = {}\n }\n dataFormat[key][obj.name] = obj[key];\n\n }\n }\n });\n\n //console.log(dataFormat);\n\n\n\n buildDataViz(dataFormat);\n}", "title": "" }, { "docid": "a640144c639daa81127303b8676f457a", "score": "0.575459", "text": "function formatData(arr) {\n\n var dataFormat = {}\n for(key in arr[0]){\n if(key !== 'name'){\n dataFormat[key] = {}\n }\n }\n\n \n arr.forEach(function(obj, index) {\n\n //getMaxValues\n normalizeData(obj);\n \n //restructure Data\n for(key in obj){\n\n if(key !== 'name'){\n if(typeof dataFormat[key][obj.name] === 'undefined'){\n dataFormat[key][obj.name] = {}\n }\n dataFormat[key][obj.name] = obj[key];\n\n }\n }\n });\n\n //console.log(dataFormat);\n\n\n\n buildDataViz(dataFormat);\n}", "title": "" }, { "docid": "57fe0961ceafe4d954e8aa42dd5096df", "score": "0.57394826", "text": "formatArrayOfObject(data) {\n this.requireInputOutputOfOne();\n if (!this.inputLookup) {\n const lookupTable = new LookupTable(data);\n this.inputLookup = this.outputLookup = lookupTable.table;\n this.inputLookupLength = this.outputLookupLength = lookupTable.length;\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n result.push(objectToFloat32Arrays(data[i]));\n }\n return result;\n }", "title": "" }, { "docid": "de5a41e8867d0a11030fbb466b2db82c", "score": "0.56598246", "text": "function formatClassArray(classlist)\n{\n let classArr = classlist.split(\" \");\n if( Array.isArray(classArr) )\n return classArr;\n else\n return [ classArr ];\n\n /*\n\n let classArr = attr.value.includes(\" \") ? attr.value.split(\" \") : attr.value;\n \n if( Array.isArray(classArr) )\n {\n let newClassList = [];\n for( let ii = 0 ; ii < classArr.length; ii++)\n {\n newClassList.push(classArr[ii]);\n }\n\n return newClassList;\n }\n \n return classArr;\n */\n}", "title": "" }, { "docid": "4897a10c4ebe4351f5f06e53a95f1647", "score": "0.5637525", "text": "function MakeDescriptionExportArray() {\n\tvar toExport = [\n\t\t\"PC Name\",\n\t\t\"Player Name\",\n\t\t\"Height\",\n\t\t\"Weight\",\n\t\t\"Sex\",\n\t\t\"Hair colour\",\n\t\t\"Eyes colour\",\n\t\t\"Skin colour\",\n\t\t\"Age\",\n\t\t\"Alignment\",\n\t\t\"Faith/Deity\",\n\t\t\"Personality Trait\",\n\t\t\"Ideal\",\n\t\t\"Bond\",\n\t\t\"Flaw\",\n\t\t\"Background_History\",\n\t\t\"Background_Appearance\",\n\t\t\"Background_Enemies\",\n\t\t\"Background_Organisation\",\n\t\t\"Background_Faction.Text\",\n\t\t\"Background_FactionRank.Text\",\n\t\t\"Background_Renown.Text\",\n\t\t\"Comp.Desc.Name\",\n\t\t\"Comp.Desc.Sex\",\n\t\t\"Comp.Desc.Age\",\n\t\t\"Comp.Desc.Height\",\n\t\t\"Comp.Desc.Weight\",\n\t\t\"Comp.Desc.Alignment\",\n\t\t\"Notes.Left\",\n\t\t\"Notes.Right\"\n\t];\n\tvar tempArray = [];\n\tfor (var F = 0; F < toExport.length; F++) {\n\t\tif (tDoc.getField(toExport[F]).type !== \"checkbox\" && What(toExport[F]) !== tDoc.getField(toExport[F]).defaultValue) {\n\t\t\ttempArray.push(toExport[F]);\n\t\t} else if (tDoc.getField(toExport[F]).type === \"checkbox\" && tDoc.getField(toExport[F]).isBoxChecked(0)) {\n\t\t\ttempArray.push(toExport[F]);\n\t\t}\n\t}\n\treturn tempArray.length > 0 ? tempArray : \"\";\n}", "title": "" }, { "docid": "7907c0461c6499b5df4e6cc347c1a142", "score": "0.5637208", "text": "formatColumnOption() {\n let t = [];\n\n for (let i in this.columns) {\n var def = $.extend({}, this.columns[i]);\n //def.data = i;\n t.push(def);\n }\n\n return t;\n }", "title": "" }, { "docid": "0b57761264f1ad7fe61781d91c584cd7", "score": "0.56262195", "text": "function toStringArray(data) {\n if (!data || data.length < 1) {\n return ['None'];\n }\n var arr = [];\n if (data[0] & (1 << 0)) {\n arr.push('LE Limited Discoverable Mode');\n }\n if (data[0] & (1 << 1)) {\n arr.push('LE General Discoverable Mode');\n }\n if (data[0] & (1 << 2)) {\n arr.push('BR/EDR Not Supported');\n }\n if (data[0] & (1 << 3)) {\n arr.push('Simultaneous LE and BR/EDR to Same Device Capable (Controller)');\n }\n if (data[0] & (1 << 4)) {\n arr.push('Simultaneous LE and BR/EDR to Same Device Capable (Host)');\n }\n return arr;\n}", "title": "" }, { "docid": "7be908a925b13c51fcb9958d35edf561", "score": "0.5606509", "text": "formatArray(data) {\n const result = [];\n this.requireInputOutputOfOne();\n for (let i = 0; i < data.length; i++) {\n result.push(Float32Array.from([data[i]]));\n }\n return [result];\n }", "title": "" }, { "docid": "118f04e308cd9d422056a3d3358d30f8", "score": "0.5577505", "text": "formatArrayOfArrayOfArray(data) {\n const result = [];\n for (let i = 0; i < data.length; i++) {\n result.push(arraysToFloat32Arrays(data[i]));\n }\n return result;\n }", "title": "" }, { "docid": "1e04c4011c6a095f27a3aa3bc58bb316", "score": "0.557183", "text": "function grArr (array, cls) {\n return [signBegin + '((' + array.join(')|(') + '))' + signEnd, cls, new RegExp('((' + array.join(')|(') + '))', 'g')];\n }", "title": "" }, { "docid": "002215517b97543f616d7084429a8160", "score": "0.5560567", "text": "_formatPartData(competitionLadder) {\n var formattedPartData = [];\n\n // add fields part and partNumber to every item\n competitionLadder.forEach(part => {\n part.competitionLadder.forEach(item => {\n item.part = part.part;\n item.partNumber = this.getPartNumberByPart(part.part);\n });\n\n formattedPartData.push(...part.competitionLadder);\n });\n\n return formattedPartData;\n }", "title": "" }, { "docid": "fbcc87f6b02ee1f2da63f6f05feeff92", "score": "0.5556781", "text": "function getFormattedArray(array, keyName) {\n\n var formattedArray = '',\n formattedKey,\n formattedData,\n i = 0;\n\n formattedKey = \"HTML\" + keyName;\n\n for (i; i < array.length; i += 1) {\n\n formattedData = window[formattedKey].replace(\"%data%\", array[i]);\n\n formattedArray = formattedArray + formattedData;\n\n }\n\n return formattedArray;\n }", "title": "" }, { "docid": "71b2efde0273ca4be352452e9f6df10c", "score": "0.5552591", "text": "function arraySupplementsUpdateWhitespace(arToUpdate){\n\n\t\tvar ar = arToUpdate;\n\t\tvar maxBrandSupp = 0, maxDose = 0;\n\t\tvar brandSupp, dose;\n\t\tfor(let a=0; a<ar.length; ++a){\n\t\t\t//if not a spacer\n\t\t\tif(ar[a].brand.indexOf(\"#\") < 0){\n\t\t\t\t//total length of brand plus supplement to be constant\n\t\t\t\tbrandSupp = ar[a].lenBrand + ar[a].lenSupp;\n\t\t\t\t//total length of dose to be constant\n\t\t\t\tdose = ar[a].lenDose;\n\t\t\t\t//store maximum total of brand and supplement so far\n\t\t\t\tif(brandSupp > maxBrandSupp){\n\t\t\t\t\tmaxBrandSupp = brandSupp;\n\t\t\t\t}\n\t\t\t\t//store maximum dose so far\n\t\t\t\tif(dose > maxDose){\n\t\t\t\t\tmaxDose = dose;\n\t\t\t\t}\n\t\t\t}//if not a spacer\n\t\t}//for each element in array of supplements\n\n\t\t//set whitespaces\n\t\tfor(let a=0; a<ar.length; ++a){\n\t\t\tar[a].ws1 = \" \".repeat(maxBrandSupp - ar[a].lenBrand - ar[a].lenSupp);\n\t\t\tar[a].ws2 = \" \".repeat(maxDose - ar[a].lenDose);\n\t\t}\n\t\treturn ar;\n\t}//function arraySupplementsUpdateWhitespace", "title": "" }, { "docid": "2568fe5b64fd75097862cb4b9c1416af", "score": "0.5534374", "text": "formatArrayOfArray(data) {\n const result = [];\n const { inputSize, outputSize } = this.options;\n if (inputSize === 1 && outputSize === 1) {\n for (let i = 0; i < data.length; i++) {\n result.push(arrayToFloat32Arrays(data[i]));\n }\n return result;\n }\n if (inputSize !== data[0].length) {\n throw new Error('inputSize must match data input size');\n }\n if (outputSize !== data[0].length) {\n throw new Error('outputSize must match data output size');\n }\n for (let i = 0; i < data.length; i++) {\n result.push(Float32Array.from(data[i]));\n }\n return [result];\n }", "title": "" }, { "docid": "677c2195df95aa5e8bc30e59f67bd49a", "score": "0.5532547", "text": "function compile_attributes(array) {\n var string = array.join(' ');\n return string;\n }", "title": "" }, { "docid": "5f26c8f8528e6c0e098fad8967b2a9f4", "score": "0.5494831", "text": "function excelprint2darray(a){\nfor (x in a){\n\tif(a[x] instanceof Array){\n\ta[x]=a[x].join(\"\\t\");\n\t}\n\t}\n\treturn a.join(\"\\n\");\n\t\n}", "title": "" }, { "docid": "1e82bf2fb78821a6d46214cadcbd023e", "score": "0.54820246", "text": "function formatData(rest){\n return [parseInt(head(rest), 10), join(\" \", slice(1, Infinity, rest))]\n}", "title": "" }, { "docid": "f6b005f4508cf6946116cf2cfa549c0c", "score": "0.547946", "text": "function showOriginalArray(){\n var elements = document.getElementsByClassName(\"printOrigArr\");\n // this is to prettify the output\n var delimiter = '\"';\n if (customArray == true){\n delimiter = '';\n }\n for (i = 0; i < elements.length; i++){\n\n elements[i].innerHTML = \"Existing array elements are:<span class='new-line'></span>\" + '[' + delimiter +''+recreateArray().join(''+ delimiter +', '+ delimiter +'') + ''+ delimiter +']';\n }\n}", "title": "" }, { "docid": "5ab11573d2e709b8b08efcc2fc6e9b53", "score": "0.547141", "text": "function formatName (arr) {\n if (arr.length === 2) {\n return arr[1] + ' ' + arr[0]\n } else if (arr.length === 3) {\n return arr[1] + '-' + arr[2] + ' ' + arr[0]\n } else if (arr.length === 4) {\n return arr[2] + '-' + arr[3] + ' ' + arr[0] + ' ' + arr[1]\n }\n}", "title": "" }, { "docid": "2bfe2c2700cb6461f819d2c952f95d0d", "score": "0.5438898", "text": "function formatDataToArray (data) {\n var newData = [];\n\n var cat_list = ['title', 'intro', 'result', 'discussion', 'conclusion', 'other']; // preferred sorting order\n\n data.forEach(function (d, i) {\n var row = [];\n var dlit = d.evidence.literature_ref; // data literature - now we use the epmc data\n var pubmedId = dlit.data.pmid || dlit.data.pmcid || dlit.data.id;\n\n\n // 0 - Access level\n row.push((d.access_level === otConsts.ACCESS_LEVEL_PUBLIC) ? otConsts.ACCESS_LEVEL_PUBLIC_DIR : otConsts.ACCESS_LEVEL_PRIVATE_DIR);\n\n // 1 - Disease label\n row.push(\n '<a href=\"/disease/' + (d.disease.efo_info.efo_id.split('/').pop()) + '\">'\n + d.disease.efo_info.label\n + '</a>'\n );\n\n // 3 - Publication (title, abstract etc)\n\n // Authors formatting - now from evidence.literature_ref.data\n var authorStr = '(No authors provided)';\n if (dlit.data.authorList) {\n authorStr = formatAuthor(dlit.data.authorList.author[0]);\n if (dlit.data.authorList.author.length > 2) {\n authorStr += ' <i>et al</i>';\n } else if (dlit.data.authorList.author.length === 2) {\n authorStr += ' and ' + formatAuthor(dlit.data.authorList.author[1]);\n }\n authorStr += '.';\n }\n\n // Abstract\n if (!dlit.data.title && !dlit.data.abstractText && (!dlit.data.journalInfo || !dlit.data.journalInfo.journal)) {\n row.push('N/A');\n } else {\n var abstractSentences = getMatchedSentences(d);\n var abstractSection = 'Abstract';\n var abstractText = dlit.data.abstractText || 'Not abstract supplied.';\n var abId = pubmedId + abstractSection + '--' + i;\n var abstract = '<div id=\\'' + abId + '\\'>' + abstractText + '</div>';\n\n var abstractString = '<p class=\\'small\\'><span onclick=\\'angular.element(this).scope().displaySentences(\"' + abId + '\")\\'style=\\'cursor:pointer\\'><i class=\\'fa fa-chevron-circle-down\\' aria-hidden=\\'true\\'></i>&nbsp;<span class=\\'bold\\'>Abstract</span></p>';\n\n var title = dlit.data.title || '';\n\n if (abstractSentences && abstract) {\n abstractSentences.map(function (f) {\n var pos = abstract.indexOf(f.raw);\n abstract = abstract.replace(f.raw, f.formatted);\n\n // If not in the abstract, try the title\n if (pos === -1) {\n pos = title.indexOf(f.raw);\n title = title.replace(f.raw, f.formatted);\n }\n });\n }\n\n // journal info\n var journalInfo = (dlit.data.journalInfo.journal.medlineAbbreviation || dlit.data.journalInfo.journal.title || '');\n // journal reference\n var jref = dlit.data.journalInfo.volume + '(' + dlit.data.journalInfo.issue + '):' + dlit.data.pageInfo;\n journalInfo += ' ' + jref;\n\n var titleAndSource = '<span class=large><a href=\"http://europepmc.org/abstract/MED/' + pubmedId + '\" target=\"_blank\">' + title + '</a></span>'\n + '<br />'\n + '<span class=small>' + authorStr + ' ' + journalInfo + '</span>';\n\n // PMID\n var pmidStr = '<span class=\"text-lowlight\">PMID: ' + pubmedId + '</span>';\n\n // matched sentences\n dlit.mined_sentences.sort(function (a, b) {\n var a = a.section.toLowerCase();\n var b = b.section.toLowerCase();\n\n var ai = cat_list.length;\n var bi = cat_list.length;\n cat_list.forEach(function (li, i) {\n if (a.substr(0, li.length) === li) {\n ai = i;\n }\n if (b.substr(0, li.length) === li) {\n bi = i;\n }\n });\n\n return +(ai > bi) || +(ai === bi) - 1;\n });\n\n var sectionCount = countSentences(d.evidence.literature_ref.mined_sentences);\n var sectionSentences = prepareSectionSentences(d.evidence.literature_ref.mined_sentences);\n var sectionSentencesSimple = prepareSectionSentencesSimple(d.evidence.literature_ref.mined_sentences);\n var previousSection = null;\n\n var matchedSentences = d.evidence.literature_ref.mined_sentences.map(function (sent) {\n var section = otUpperCaseFirstFilter(otClearUnderscoresFilter(sent.section));\n var sentenceString = '';\n var msId = pubmedId + sent.section + '--' + i;\n if (section !== 'Title' && section !== 'Abstract') {\n if (previousSection !== sent.section) {\n if (previousSection !== null) { // this is not the first section with matched sentences\n sentenceString = sentenceString + '</div>';\n }\n sentenceString += '<p class=\\'small\\'><span onclick=\\'angular.element(this).scope().displaySentences(\"' + msId + '\")\\'style=\\'cursor:pointer\\'><i class=\\'fa fa-chevron-circle-down\\' aria-hidden=\\'true\\'></i>&nbsp;<span class=\\'bold\\'>' + section + ': </span>' + sectionCount[sent.section];\n if (sectionCount[sent.section] === 1) {\n sentenceString += ' matched sentence</span></p>';\n } else {\n sentenceString += ' matched sentences</span></p>';\n }\n previousSection = sent.section;\n }\n\n sentenceString += '<div id=\\'' + msId + '\\' style=\\'display:none\\'><ul style=\\'margin-left: 10px;\\'>' + sectionSentences[sent.section] + '</ul></div>';\n }\n\n return sentenceString;\n }).join('') + '</div>';\n\n\n row.push(\n titleAndSource + '<br/>'\n + pmidStr + '<br/><br/>'\n + abstractString\n + abstract\n + ' <p class=small>'\n + (matchedSentences || 'no matches available')\n + '</p>'\n );\n }\n\n // 4 - Year\n // Note we could use something like year = moment(date).year() if needed to parse a date string\n row.push(dlit.data.pubYear || 'N/A');\n\n newData.push(row);\n });\n\n return newData;\n }", "title": "" }, { "docid": "315de334b7343077461e67c2378198f7", "score": "0.54364455", "text": "function setupFlexiOpsData(array){\n\n var poopArr = array;\n\n var writeArr = [['Date','Company', 'Email', 'Buffer', 'OPP Pax', 'DP Quota', 'DP Usage Total' , 'DP Balance' , 'Credit Quota ', 'Credit Usage Total', 'Credit Balance' , 'Charge']];\n\n var compName = poopArr[0];\n var email = poopArr[1];\n var buffer = poopArr[2];\n var pax = poopArr[3];\n var dpQuota = poopArr[4];\n var dpUsage = poopArr[8];\n var dpBalance = poopArr[6];\n var creditQuota = poopArr[5];\n var creditUsage = poopArr[9];\n var creditBalance = poopArr[7];\n var charge= poopArr[10];\n\n writeArr.push([today.toLocaleDateString('en-MY'),compName,email,buffer,pax,dpQuota,dpUsage,dpBalance,creditQuota,creditUsage,creditBalance,charge]);\n\n return writeArr;\n}", "title": "" }, { "docid": "3cadf6d3bb5cd0194d15087dc36af43e", "score": "0.5420584", "text": "function constructFeatList() {\n var featList = [];\n for (var creature in creature_dict) {\n for (var creature_property in creature_dict[creature]) {\n var property_type = creature_dict[creature][creature_property].type;\n if (property_type === constants.bool) {\n var property_name = util.format('%s-%s', creature, creature_property); \n featList.push(property_name);\n } else if (property_type === constants.color) {\n var creature_colors = creature_to_colors_dict[creature];\n for (var i = 0; i < creature_colors.length; i++) {\n var property_name = util.format('%s-%s-%s', creature, creature_property, creature_colors[i]);\n featList.push(property_name);\n }\n }\n }\n }\n return featList;\n}", "title": "" }, { "docid": "2308a16db70b7eac1d68ea7d562788b5", "score": "0.54123306", "text": "function attributesToPhrase(array) {\n return array.map(function(element) {return `${element.name} is from ${element.hometown}`; });\n}", "title": "" }, { "docid": "b2a4fde9eb258e924f8ee58e6f98d9e0", "score": "0.5411698", "text": "function arrayAwesomenator( array ) {\n\tarray = deleteRubbish( array );\n\tarray = arrangeElements( array );\n\tarray = beautifyLetters( array );\n\tarray = beautifyNumbers( array );\n\tarray = sortArray( array );\n\tarray = arrayToString( array );\n\n\treturn array;\n}", "title": "" }, { "docid": "af5ff13e48e7416261ae056b46a38307", "score": "0.5400847", "text": "function makeArray() {\n for (let i = 0; i < CMC.length; i++) {\n if (CMC[i] === '+') {\n CMC = CMC.slice(0, i + 1) + ',' + CMC.slice(i + 1);\n i++;\n }\n }\n CMC = CMC.split(',');\n }", "title": "" }, { "docid": "40e3672bc3dd00def2756c2f65e139a9", "score": "0.5389149", "text": "formatArrayOfObjectMulti(data) {\n if (!this.inputLookup) {\n const lookupTable = new LookupTable(data);\n this.inputLookup = this.outputLookup = lookupTable.table;\n this.inputLookupLength = this.outputLookupLength = lookupTable.length;\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n result.push([\n objectToFloat32Array(data[i], this.inputLookup, this.inputLookupLength),\n ]);\n }\n return result;\n }", "title": "" }, { "docid": "2df6c12123c2ad0be91ab3e6bb2c5e81", "score": "0.5384192", "text": "toString() {\r\n const arrToString = [this.name];\r\n if (this.optionality === undefined) {\r\n arrToString.push(`${this.asnType.toString()}${sequenceType_1.COMMA_PLACEHOLDER}`);\r\n }\r\n else if (this.optionality !== undefined) {\r\n arrToString.push(this.asnType.toString());\r\n arrToString.push(`${this.optionality.toString()}${sequenceType_1.COMMA_PLACEHOLDER}`);\r\n }\r\n if (this.tag.length > 0) {\r\n arrToString.push(this.tag);\r\n }\r\n return arrToString.join(' ');\r\n }", "title": "" }, { "docid": "4ccf9115d022fba40fac0adbd60482cf", "score": "0.53773123", "text": "function stringifyArray(array) {\n\tlet obj = {};\n\tarray.forEach((element, i) => {\n\t\tif (element === undefined || element === null) {\n\t\t\t// transparent pixel\n\t\t\tobj[i] = null;\n\t\t}\n\t\telse if (element.constructor === Array) {\n\t\t\t// element is an array\n\t\t\t// for multidimensional arrays\n\t\t\tobj[i] = stringifyArray(element);\n\t\t}\n\t\telse {\n\t\t\tobj[i] = element;\n\t\t}\n\t});\n\n\treturn JSON.stringify(obj);\n}", "title": "" }, { "docid": "b1001d5322c69cf6b0c4c33ddeaf8ba9", "score": "0.537444", "text": "function formatPathArr(array){\n\n\tlet pathArr = []\n\n\t_.each(array,(item) => {\n\n\t\tif(item[0] == 'M' || item[0] == 'L'){\n\t\t\tpathArr.push({X: item[1], Y: item[2]})\n\t\t}\n\t})\n\n\treturn pathArr\n}", "title": "" }, { "docid": "90e0a484e1c333ea4fe934876ee02b29", "score": "0.5373573", "text": "function createAsteriskSepListPie(arr)\r\n{\r\n var str = \"\";\r\n\r\n for (var x = 0; x < arr.length; x++)\r\n {\r\n var cut = arr[x].toString().lastIndexOf(\",\");\r\n if(x > 0)\r\n {\r\n str = str + \"*\" + arr[x].toString().substring(0,cut) + \"#\" + arr[x].toString().substring(cut+1);\r\n }\r\n else\r\n {\r\n str = str + arr[x].toString().substring(0,cut) + \"#\" + arr[x].toString().substring(cut+1);\r\n }\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "9602e72033f13947ca16ca6fdc5628f1", "score": "0.5372331", "text": "get formatInfo() {\n\t\t\treturn formatInfo(this.type, this.vector)\n\t\t}", "title": "" }, { "docid": "988b5d67fea48db09b553e3876e44bc9", "score": "0.5370496", "text": "function makeStrings(arr) {\n return arr.map(obj =>\n obj.age > 18\n ? `${obj.name} can go to the matrix`\n : `${obj.name} cant go to the matrix`\n );\n}", "title": "" }, { "docid": "037ae4f60b76d55f80455f803e0e9d6c", "score": "0.53563726", "text": "function formatHTML(array){\n \n var style = '<style type=\"text/css\"> .tftable {font-size:12px;color:#333333;width:100%;border-width: 1px;border-color: #9dcc7a;border-collapse: collapse;} .tftable th {font-size:12px;background-color:#abd28e;border-width: 1px;padding: 8px;border-style: solid;border-color: #9dcc7a;text-align:left;} .tftable tr {background-color:#bedda7;} .tftable td {font-size:12px;border-width: 1px;padding: 8px;border-style: solid;border-color: #9dcc7a;} </style>';\n var tableStart = \"<br><br><html><body>\" + style + \"<table border=\\\"0\\\">\";\n var tableEnd = \"</table></body></html>\";\n var rowStart = \"<tr>\";\n var rowEnd = \"</tr>\";\n var cellStart = \"<td>\";\n var cellEnd = \"</td>\";\n\n for (i in array){\n array[i] = rowStart + cellStart + array[i] + cellEnd + rowEnd;\n }\n\n array = array.join('');\n array = tableStart + array + tableEnd;\n\n return array;\n}", "title": "" }, { "docid": "b28a8f82349b27b22d0d7b2836c1225a", "score": "0.5350007", "text": "get formatInfo() {\n\t\t\tfor (const [constructor, type] of arrayTypes) {\n\t\t\t\tif (this.data instanceof constructor) {\n\t\t\t\t\treturn formatInfo(type, this.vector)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t}", "title": "" }, { "docid": "16e8e7a7ac18cb2a9856033901054290", "score": "0.5345669", "text": "function formatUpdateArray(updateInfo, updatedBy, updateDate) {\n _.forEach(updateInfo, function(v, k) {\n v.infoFormated = \" changed \" + v.field +\n \" from \" + v.old + \" to \" + v.new;\n\n v.userName = updatedBy.name;\n\n v.userImage = updatedBy.userImage || authentication.getUserImage();\n\n //formating for members\n if(v.field === \"idMembers\") {\n if(v.old === \"\") {\n v.infoFormated = \" added a member \";\n v.tooltip = v.new;\n } else {\n v.infoFormated = \" removed a member \";\n v.tooltip = v.old;\n }\n }\n\n //formating for attachemnts\n if(v.field === \"attachments\") {\n if(v.old === \"\") {\n v.infoFormated = \" uploaded an attachment \";\n v.tooltip = v.new;\n } else {\n v.infoFormated = \" removed an attachment \";\n v.tooltip = v.old;\n }\n }\n\n //formating for labels\n if(v.field === \"labels\") {\n if(v.old === \"\") {\n v.infoFormated = \"added a label \";\n v.tooltip = v.new;\n } else {\n v.infoFormated = \"removed a label \";\n v.tooltip = v.old;\n }\n }\n\n //formating for checklists\n if(v.field === \"checklists\") {\n if(v.old === \"\") {\n v.infoFormated = \" added a checklist \";\n v.tooltip = v.new;\n } else {\n v.infoFormated = \" removed a checklist \";\n v.tooltip = v.old;\n }\n }\n\n //formating for checklists item\n if(v.field === \"checkitem\") {\n if(v.old === \"\") {\n v.infoFormated = \" created a checklist item \";\n v.tooltip = v.new;\n } else {\n v.infoFormated = \" removed a checklist item\";\n v.tooltip = v.old;\n }\n }\n\n if(v.field === \"checkitem_complete\") {\n if(v.old === \"\") {\n v.infoFormated = \" completed a checklist item \";\n v.tooltip = v.new;\n } else {\n v.infoFormated = \" uncompleted a checklist item\";\n v.tooltip = v.old;\n }\n }\n\n\n if(v.field === \"checkitem_change\") {\n v.infoFormated = \" changed a checklist item \";\n v.tooltip = v.old;\n }\n\n if(v.field === \"checkitem_remove\") {\n v.infoFormated = \" removed a checklist item \";\n v.tooltip = v.old;\n }\n\n if(v.field === \"checkitem_checked\") {\n v.infoFormated = \" completed a checklist item \";\n v.tooltip = v.new;\n }\n\n if(v.field === \"checkitem_unchecked\") {\n v.infoFormated = \" uncompleted a checklist item \";\n v.tooltip = v.new;\n }\n\n if(v.field === \"comments\") {\n if(v.old === \"\") {\n v.infoFormated = \" added a comment \";\n v.tooltip = v.new;\n } else {\n v.infoFormated = \" removed a comment\";\n v.tooltip = v.old;\n }\n }\n\n if(v.field === \"due\") {\n if(v.old === \"\") {\n v.infoFormated = \" added a due date \" + moment(+v.new).format('MMMM Do YYYY, h:mm:ss a') ;\n } else {\n v.infoFormated = \" removed a due date \" + moment(+v.old).format('MMMM Do YYYY, h:mm:ss a') ;\n }\n }\n\n if(v.field === \"status\") {\n v.infoFormated = \" changed the issue status to \" + v.new ;\n }\n\n if(v.field === \"description\") {\n v.infoFormated = \" changed \" + v.field + \" to \" + v.new;\n }\n\n v.timeDiff = timeDiff(updateDate);\n\n });\n\n return updateInfo;\n }", "title": "" }, { "docid": "da203fe9529a7a74b04c5fd570b1d12d", "score": "0.53429747", "text": "function prepareQuestions(array) {\n var data = \"\";\n array.forEach(item => {\n data += item[0] + \") \" + item[1] + \"<br><hr>\";\n });\n return data;\n }", "title": "" }, { "docid": "83f859f2463c5baee6d5e6f7a5fd2d66", "score": "0.5338089", "text": "convertToArray(musObj){\n\t\tlet cleanedData = [\n\t\t\t{\n\t\t\t\tdirection: 'ups',\n\t\t\t\tcount: musObj.ups\n\t\t\t},\n\t\t\t{\n\t\t\t\tdirection: 'downs',\n\t\t\t\tcount: musObj.downs\n\t\t\t},\n\t\t\t{\n\t\t\t\tdirection: 'unis',\n\t\t\t\tcount: musObj.unis\n\t\t\t},\n\t\t]\n\t\treturn cleanedData;\n\t}", "title": "" }, { "docid": "84b2ddbe9636cd1cbb530ed016011664", "score": "0.53266287", "text": "function tocreateArray () {\n array = output.split('');\n getfinaldisplay () \n\n }", "title": "" }, { "docid": "00e4f22f91309a859eb1d80180361e14", "score": "0.5324583", "text": "function getAttribute(cardArr){\n cardArr.map(card => {\n attribute.push(card.attribute);\n })\n displayAttribute([...attribute]); \n}", "title": "" }, { "docid": "82bc78ea8d18dd529d0db009228530f1", "score": "0.53154325", "text": "formatCharmSplat (groups) {\n const out = super.formatCharmSplat(groups);\n for (const para of out) {\n if (typeof para[0] === 'object') {\n para[0].italics = false;\n }\n }\n return out;\n }", "title": "" }, { "docid": "ce1a0bfe8dee5659693a3d2a9447ee68", "score": "0.5311462", "text": "function createInformativeArray() {\n var Qstops;\n console.log(\"How many stops does your fligth have? \");\n Qstops = insertNumber(Qstops);\n console.log(\"insert stops in this way -->Origin, Stopover-1,Stopover-2,Stopover3,...StopoverN\");\n var infoArray = [];\n infoArray = insertStopover(infoArray, Qstops);\n var informationArray = [];\n for (var i = 0; i < (infoArray.length - 1); i++) {\n var a = infoArray[i];\n var b = infoArray[i + 1];\n var stopoversArray = [];\n stopoversArray.push(a);\n stopoversArray.push(b);\n informationArray.push(stopoversArray);\n }\n return informationArray;\n}", "title": "" }, { "docid": "7f89180761f3b23658fcb9ea74905834", "score": "0.5308522", "text": "function data_to_tabular(rawData) {\n\t\tvar retAr = new Array();\n\t\tconsole.log(rawData.length);\n\t\tvar pos_1 = 0, pos_2 =1;\n\t\tfor(var i =0;\ti\t< parseInt(rawData.length / 2);\ti ++) {\n\t\t\t//retAr[i] = {\"column\" : [rawData[pos_1], rawData[pos_2]] };\n\t\t\tretAr[i] = {\"column\" : [rawData[pos_1], rawData[pos_2]] };\n\t\t\tpos_1 = pos_1 + 2;\n\t\t\tpos_2 = pos_2 + 2;\n\t\t}\n\t\treturn retAr;\t\t\n\t}", "title": "" }, { "docid": "73f1bb22586f2baa593c88b280864378", "score": "0.5297904", "text": "function makeStrings(arr){\n let reFormArr = arr.map(arr =>{\n if(arr.age>=18){\n console.log(arr.name + ' can go to The Matrix') \n }else {\n console.log(arr.name + \" is under age!!\");\n }\n })\n }", "title": "" }, { "docid": "8876ed266b9e5fc66e4a515d19c9701b", "score": "0.52909887", "text": "formatGenres(genres) {\n\n // Convert the object to an array, then get the names\n let genreList = Object.keys(genres).map(function (key) { return genres[key]; });\n let list = genreList.map(genre => \" \" + genre.name);\n\n return list.toString();\n }", "title": "" }, { "docid": "d34288519bbac2085efa0da93db894e7", "score": "0.52874297", "text": "toHandsOnFormat() {\n if (this._handsonEntries) {\n return this._handsonEntries;\n }\n\n var result = [];\n var entries = this.entries.sort((a, b) => a.index - b.index);\n \n for (var i in entries) {\n var row = entries[i];\n var resultRow = [];\n resultRow.push(row.key);\n\n for (var j in row.values) {\n var column = row.values[j];\n\n switch(column.type) {\n case \"pair\":\n {\n resultRow.push(column.value.join(\", \"));\n break;\n }\n default:\n {\n resultRow.push(column.value.toString());\n break;\n }\n }\n }\n\n result.push(resultRow);\n }\n \n this._handsonEntries = result;\n return result;\n }", "title": "" }, { "docid": "8b810b8a86a48f3a4aeaf3a389324a6b", "score": "0.52856797", "text": "function formatData(data){\n\tvar books = [];\n\tconsole.log(data);\n\tdata.forEach((book) => {\n\t\tbooks.push({\n\t\t\tname: book.book, \n\t\t\tvolume: booksInfo[book.book][\"volume\"],\n\t\t\thigh: booksInfo[book.book][\"high\"],\n\t\t\tlow: booksInfo[book.book][\"low\"],\n\t\t\tvmap: booksInfo[book.book][\"vwap\"]\n\t\t});\n\t});\n\treturn books;\n}", "title": "" }, { "docid": "9e016266ac96d4dc863b376fd7d8e6f0", "score": "0.52674896", "text": "function setupFlexiHtmlTable(array){\n\n var poopArr = array;\n var writeArr = [['Date','Company', 'Buffer', 'OPP Pax','Attendance Total','Charge']];\n\n var compName = poopArr[0];\n var email = poopArr[1];\n var buffer = poopArr[2];\n var pax = poopArr[3];\n var dpUsage = poopArr[8];\n var charge= poopArr[10];\n\n writeArr.push([today.toLocaleDateString('en-MY'),compName,buffer,pax,dpUsage,charge]);\n\n return writeArr;\n}", "title": "" }, { "docid": "b07b0f5ff8e111f1527c2b5591c2a881", "score": "0.52571476", "text": "function makingArrayModel(array) {\n let options = [];\n for (let i = 0; i < Object.keys(array).length; i++) {\n options[i] = array[i].nameModel;\n }\n return options;\n }", "title": "" }, { "docid": "3911e2216dc6acaefc17911df254ced4", "score": "0.52567595", "text": "function PrintModificableTagsArray()\r\n{\r\n console.log(\"Dimensione vettore: \" + modificableTagsID.length);\r\n for (var i = 0; i < modificableTagsID.length; i++)\r\n {\r\n console.log(\"ID: \" + modificableTagsID[i]);\r\n console.log(\"Valore: \" + modificableTagsValue[i]);\r\n }\r\n}", "title": "" }, { "docid": "00991f2be5eb894888e6fd0822680dc5", "score": "0.52536166", "text": "toString() {\r\n\t\t\r\n\t\tlet string = [];\r\n\t\t\r\n\t\tthis.array.forEach( (v,k) => { if (v == true) string.push(k+1) } );\r\n\t\t\r\n\t\treturn ('[' + string.join(',') + ']');\r\n\t\t\r\n\t}", "title": "" }, { "docid": "1a92c2a27c66e43c8a0ce5616db2d5f2", "score": "0.5248164", "text": "function arraySupplementsOutput(ar, quantity){\n\n\t\t\tvar strOP = \"\";\n\n\t\t\t//if quantity true, only output objects with a quantity\n\t\t\tif(quantity){\n\t\t\t//for each intake object\t\t\n\t\t\t\tfor(let a=0; a<ar.length; ++a){\n\t\t\t\t\t//if there is a qty \n\t\t\t\t\tif(ar[a].qty != \"\"){\n\t\t\t\t\t\t\t//add the contents of the object to the output string\n\t\t\t\t\t\t\tstrOP += \tar[a].brand + \n\t\t\t\t\t\t\t\t\t\tar[a].ws1 + \n\t\t\t\t\t\t\t\t\t\tar[a].supp + \n\t\t\t\t\t\t\t\t\t\tar[a].ws2 +\n\t\t\t\t\t\t\t\t\t\tar[a].dose +\n\t\t\t\t\t\t\t\t\t\tar[a].qty +\n\t\t\t\t\t\t\t\t\t\t\"\\n\";\n\t\t\t\t\t}//if qty\n\t\t\t\t}//for\n\t\t\t} else {\n\t\t\t//for each intake object\t\t\n\t\t\t\tfor(let a=0; a<ar.length; ++a){\n\t\t\t\t\t//add the contents of the object to the output string\n\t\t\t\t\tstrOP += \tar[a].brand + \n\t\t\t\t\t\t\t\tar[a].ws1 + \n\t\t\t\t\t\t\t\tar[a].supp + \n\t\t\t\t\t\t\t\tar[a].ws2 +\n\t\t\t\t\t\t\t\tar[a].dose +\n\t\t\t\t\t\t\t\t\"\\n\";\n\n\t\t\t\t}//for\n\t\t\t}//else\n\n\t\t\treturn strOP;\n\n\t\t}//function arraySupplementsOutput", "title": "" }, { "docid": "1a9e13dcb4ad39a6fb804489d56150cb", "score": "0.5241401", "text": "function partlist(arr) {\n let final = [];\n for (let i=1; i<arr.length; i++) {\n let temp = arr.slice(i);\n final.push([arr.slice(0,i).join(\" \"), temp.join(\" \")]);\n }\n return final;\n}", "title": "" }, { "docid": "7b457352d5abfa92500171648e953b0b", "score": "0.5241052", "text": "function arrayToString(a) {\r\n return \"[\" + a.join(\", \") + \"]\";\r\n }", "title": "" }, { "docid": "94fcb0cac43c3a56e333d82d7743d8c3", "score": "0.52392787", "text": "serialize() {\n const percent = (this.isPercent || !Stat.mixedTypes.includes(this.displayType)) &&\n !this.type.includes('%') ? '%' : '';\n\n return [this.type, `+${this.rawValue}${percent}`, this.rolls];\n }", "title": "" }, { "docid": "603158d9e4e5e44b24b4ec356f3a619f", "score": "0.52311206", "text": "function e(s){const t=[[],[],[],[],[]],i=s;for(const s of i)for(const i of s.displayRecords)t[i.geometryType].push(i);return t}", "title": "" }, { "docid": "cbee9fc3ac7c6ea98c02c56e924a903c", "score": "0.52309805", "text": "formatData(data) {\n return data.map(d => {\n const t = Object.keys(d);\n return {\n val: d[t][this.state.currencyType],\n name: t[0]\n }\n }, this)\n }", "title": "" }, { "docid": "e3ae0587044271484cea701508ed4466", "score": "0.5228203", "text": "function SpecialArray() {\n //create the array\n var values = new Array();\n //add the values\n values.push.apply(values, arguments);\n //assign the method\n values.toPipedString = function() {\n return this.join(\"|\"); \n };\n return values; \n }", "title": "" }, { "docid": "fc8be486f1c2ddeb6a8a1c1529d18aa7", "score": "0.5224583", "text": "static formatUnit(unit) {\n return unit.map((value) => ({\n value,\n candidates: value === 0 ? Sudoku.DIGIT_SET : [],\n }));\n }", "title": "" }, { "docid": "75ee3267f157c5fe22f500cf1812fe48", "score": "0.5219635", "text": "function buildPersonalArrLikes() {\r\n var newArrLikesString = \"\";\r\n var i;\r\n for (i = 0; i < arrLikes.length - 1; i++) {\r\n newArrLikesString += arrLikes[i] + \"~\";\r\n }\r\n newArrLikesString += arrLikes[i];\r\n return newArrLikesString;\r\n}", "title": "" }, { "docid": "264467c4baa65ff2fa100c37087ba7dd", "score": "0.5211007", "text": "formatArrayOfDatumOfArrayOfObject(data) {\n if (!this.inputLookup) {\n const inputLookup = new ArrayLookupTable(data, 'input');\n this.inputLookup = inputLookup.table;\n this.inputLookupLength = inputLookup.length;\n }\n if (!this.outputLookup) {\n const outputLookup = new ArrayLookupTable(data, 'output');\n this.outputLookup = outputLookup.table;\n this.outputLookupLength = outputLookup.length;\n }\n if (!this.outputLookupLength) {\n throw new Error('this.outputLookupLength not set to usable number');\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n const datum = data[i];\n result.push(inputOutputObjectsToFloat32Arrays(datum.input, datum.output, this.inputLookup, this.outputLookup, this.inputLookupLength, this.outputLookupLength));\n }\n return result;\n }", "title": "" }, { "docid": "9c5416ce2411ef38e08f116f8eceb973", "score": "0.521008", "text": "showItemNamesCosts(arrIn){\r\n let arrItems = [];\r\n for( let i=0; i<arrIn.length; i++) {\r\n arrItems.push(arrIn[i].name + \" - \" + this.currencyFormat(arrIn[i].cost));\r\n }\r\n return arrItems;\r\n }", "title": "" }, { "docid": "a5ccff683bd05bccf097448fe447296b", "score": "0.52019477", "text": "function makeString(my_array) {\n\t\tvar str = \"[\" + my_array[0];\n\t\tfor(var i = 1; i < my_array.length; i++) {\n\t\t\tstr += \", \" + my_array[i];\n\t\t}\n\t\tstr += \"]\";\n\t\treturn str;\n\t}", "title": "" }, { "docid": "3b7a4761f57a8d8c8fdd6a6573653953", "score": "0.5199602", "text": "function outputArray(heading, theArray, output) {\n\toutput.innerHTML = heading + theArray.join(\" \");\n} //end function outputArray", "title": "" }, { "docid": "20aaf4fb60b1366a73f4b2747b84695f", "score": "0.51889926", "text": "function formatArrayValue(v, opts) {\n var _opts$maxElts = opts.maxElts,\n maxElts = _opts$maxElts === void 0 ? 16 : _opts$maxElts,\n _opts$size = opts.size,\n size = _opts$size === void 0 ? 1 : _opts$size;\n var string = '[';\n\n for (var i = 0; i < v.length && i < maxElts; ++i) {\n if (i > 0) {\n string += \",\".concat(i % size === 0 ? ' ' : '');\n }\n\n string += formatValue(v[i], opts);\n }\n\n var terminator = v.length > maxElts ? '...' : ']';\n return \"\".concat(string).concat(terminator);\n}", "title": "" }, { "docid": "e2d71237b4a73a0498529ceb418bab86", "score": "0.5185215", "text": "function makeNumberHeaders() {\n return \"<tr> <th></th>\" + num_array.map(function(num) {\n return \"<th>\" + num + \"</th>\";\n }).join(\"\") + \"</tr>\";\n\n}", "title": "" }, { "docid": "fecc8d459a8a8c464ec8aff3e0dbd09f", "score": "0.5179274", "text": "function processBands(array) {\n return array.map(elm => {\n return {\n name: formatName(elm.name),\n country: 'Canada',\n active: elm.active\n }\n })\n}", "title": "" }, { "docid": "b66f420ac09828f13af699160e388659", "score": "0.51773375", "text": "function arrayToStr(array, width, height, decimals, padding) {\n if (array === undefined || array.length != width*height) {\n console.warn(\"Incorrect usage of arrayToStr\");\n return \"\";\n }\n if (decimals === undefined) decimals = 3;\n let maxDigits = 1;\n if (padding === undefined) {\n for (let i = 0; i < array.length; i++) {\n let digits = numberOfDigits(array[i], decimals);\n if (digits > maxDigits) {\n maxDigits = digits;\n }\n }\n } else {\n maxDigits = padding;\n }\n let str = \"<pre>\";\n for (let i = 0; i < height; i += 1) {\n for (let j = 0; j < width; j += 1) {\n let tmp = array[i*width + j].toFixed(decimals)\n .toString().padStart(maxDigits);\n if (tmp.length != maxDigits) throw Error(\"\");\n str += tmp + \" \";\n }\n str += \"\\n\";\n }\n return str + \"</pre>\";\n}", "title": "" }, { "docid": "c03078114e52e9f704f9420204997e35", "score": "0.517446", "text": "function MakeExportArray() {\n\tvar notExport = [\n\t\t\"Spell DC 1 Mod\",\n\t\t\"Spell DC 2 Mod\",\n\t\t\"Speed Remember\",\n\t\t\"Racial Traits\",\n\t\t\"Class Features\",\n\t\t\"Proficiency Armor Light\",\n\t\t\"Proficiency Armor Medium\",\n\t\t\"Proficiency Armor Heavy\",\n\t\t\"Proficiency Shields\",\n\t\t\"Proficiency Weapon Simple\",\n\t\t\"Proficiency Weapon Martial\",\n\t\t\"Proficiency Weapon Other\",\n\t\t\"Background Feature\",\n\t\t\"Background Feature Description\",\n\t\t\"SheetInformation\",\n\t\t\"SpellSheetInformation\",\n\t\t\"CopyrightInformation\",\n\t\t\"Opening Remember\"\n\t]\n\tvar tempArray = [];\n\tfor (var F = 0; F < tDoc.numFields; F++) {\n\t\tvar Fname = tDoc.getNthFieldName(F);\n\t\tvar Fvalue = What(Fname) !== tDoc.getField(Fname).defaultValue;\n\t\tvar Frtf = tDoc.getField(Fname).type === \"text\" && tDoc.getField(Fname).richText;\n\t\tvar Fcalc = (/Bonus$/i).test(Fname) || tDoc.getField(Fname).calcOrderIndex === -1;\n\t\tif (!Frtf && Fvalue && Fcalc && notExport.indexOf(Fname) === -1 && Fname.indexOf(\"Limited Feature\") === -1 && Fname.indexOf(\"SpellSlots\") === -1 && !(/^(Comp.Use.)?Attack.\\d.(?!Weapon Selection)|^Feat Description \\d$|^Tool \\d$|^Language \\d$|^(bonus |re)?action \\d$|^HD\\d (Used|Level|Die|Con Mod)$|Wildshape.\\d.|^Resistance Damage Type \\d$|^Extra.Exhaustion Level \\d$|^Extra.Condition \\d+$|^Template\\.extras.+$|spells\\..*\\.\\d+|spellshead|spellsdiv|spellsgloss/i).test(Fname)) {\n\t\t\ttempArray.push(Fname);\n\t\t}\n\t}\n\treturn tempArray.length > 0 ? tempArray : \"\";\n}", "title": "" }, { "docid": "5bda982ae68abf5a4da9eae048cd888f", "score": "0.51722515", "text": "formatArrayOfDatumOfArray(data) {\n const result = [];\n this.requireInputOutputOfOne();\n for (let i = 0; i < data.length; i++) {\n const datum = data[i];\n result.push(inputOutputArrayToFloat32Arrays(datum.input, datum.output));\n }\n return result;\n }", "title": "" }, { "docid": "db655b1e5a9a69d43e828e0d30ee843d", "score": "0.5167545", "text": "print() {\n const arrayToString = this.field.map((subarray) => subarray.join(\"\")).join(\"\\n\");\n console.log(arrayToString);\n }", "title": "" }, { "docid": "2f6582f6aade7b50641aec9286140be3", "score": "0.51671046", "text": "function transform(array) {\n return array.map((e) => e.toString()).join(\"\");\n}", "title": "" }, { "docid": "42c8a6eb1fa2c3ce54ab612053233a61", "score": "0.51621956", "text": "function format(array){\n return array.sort()\n .reverse()\n .toString();\n }", "title": "" }, { "docid": "23bbb3184fd9d167f13c0738a449cb05", "score": "0.51589", "text": "convertToString() {\n let scaleString = this.noteArray[0];\n\n for (let i=1; i < this.noteArray.length; i++) {\n scaleString += \" - \";\n scaleString += this.noteArray[i];\n }\n\n return scaleString;\n }", "title": "" }, { "docid": "0075551930577c9b3bdc1311f7d3f14b", "score": "0.5157807", "text": "function formatPredictions( predictions ) {\n var formattedPredictions = [];\n\n predictions.forEach( function( prediction ) {\n var formattedPrediction = {\n days: prediction.days,\n pairs: []\n };\n\n for (var i = 0; i < prediction.prices.length; i++) {\n var pair = {\n price: prediction.prices[i],\n probability: prediction.probabilities[i]\n };\n formattedPrediction.pairs.push(pair);\n };\n formattedPredictions.push(formattedPrediction);\n });\n return formattedPredictions;\n}", "title": "" }, { "docid": "89651f0bf5418a91c486c0d1d6857fb4", "score": "0.5154299", "text": "function MakeEquipmentExportArray() {\n\tvar toExport = [\n\t\t\"Platinum Pieces\",\n\t\t\"Gold Pieces\",\n\t\t\"Electrum Pieces\",\n\t\t\"Silver Pieces\",\n\t\t\"Copper Pieces\",\n\t\t\"Lifestyle\",\n\t\t\"Extra.Other Holdings\"\n\t];\n\tfor (var i = 1; i <= FieldNumbers.gear; i++) {\n\t\ttoExport.push(\"Adventuring Gear Row \" + i);\n\t\ttoExport.push(\"Adventuring Gear Location.Row \" + i);\n\t\ttoExport.push(\"Adventuring Gear Amount \" + i);\n\t\ttoExport.push(\"Adventuring Gear Weight \" + i);\n\t\tif (!typePF && i <= 4) toExport.push(\"Valuables\" + i);\n\t\tif (i <= FieldNumbers.magicitems) {\n\t\t\ttoExport.push(\"Extra.Magic Item \" + i);\n\t\t\ttoExport.push(\"Extra.Magic Item Attuned \" + i);\n\t\t\ttoExport.push(\"Extra.Magic Item Description \" + i);\n\t\t\ttoExport.push(\"Extra.Magic Item Weight \" + i);\n\t\t}\n\t\tif (i <= FieldNumbers.extragear) {\n\t\t\ttoExport.push(\"Extra.Gear Row \" + i);\n\t\t\ttoExport.push(\"Extra.Gear Location.Row \" + i);\n\t\t\ttoExport.push(\"Extra.Gear Amount \" + i);\n\t\t\ttoExport.push(\"Extra.Gear Weight \" + i);\n\t\t}\n\t}\n\tvar tempArray = [];\n\tfor (var F = 0; F < toExport.length; F++) {\n\t\tif (tDoc.getField(toExport[F]).type !== \"checkbox\" && What(toExport[F]) !== tDoc.getField(toExport[F]).defaultValue) {\n\t\t\ttempArray.push(toExport[F]);\n\t\t} else if (tDoc.getField(toExport[F]).type === \"checkbox\" && tDoc.getField(toExport[F]).isBoxChecked(0)) {\n\t\t\ttempArray.push(toExport[F]);\n\t\t}\n\t}\n\treturn tempArray.length > 0 ? tempArray : \"\";\n}", "title": "" }, { "docid": "aaf72704ff21912234e17765aba94802", "score": "0.5150627", "text": "function arrayFlat(styles){for(var result=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],_i99=0,_length2=styles.length,value;_i99<_length2;_i99++){value=styles[_i99];if(Array.isArray(value)){arrayFlat(value,result)}else{result.push(value)}}return result}", "title": "" }, { "docid": "ccc7b4b2a579cdfda5c48d56ccc2a0cf", "score": "0.5149674", "text": "function formatTouchData(touchData){ //map touchIndices to their data (which is[x, y, force])\n var data = {};\n for(var i = 1; i < touchData.length; i += 4){\n data[touchData[i]] = touchData.slice(i+1, i+4);\n }\n return data;\n}", "title": "" }, { "docid": "58e37d9ff0ddec0657f5285e28f59331", "score": "0.5148017", "text": "function formatData(data){\n return data.map((dog) => {\n let formatDog = {};\n if(dog.hID){\n formatDog['id'] = dog.hID;\n formatDog['img'] = dog.img;\n formatDog['name'] = dog.name;\n formatDog['minHeight'] = dog.minHeight;\n formatDog['maxHeight'] = dog.maxHeight;\n formatDog['minWeight'] = dog.minWeight;\n formatDog['maxWeight'] = dog.maxWeight;\n formatDog['lifeSpan'] = dog.lifeSpan;\n formatDog['temperaments'] = dog.Temperaments.map(temperament => temperament.name);\n }else{\n let height = dog.height.metric.split(' - ');\n let weight = dog.weight.metric.split(' - ');\n\n formatDog['id'] = dog.id;\n formatDog['img'] = `https://cdn2.thedogapi.com/images/${dog.reference_image_id}.jpg`;\n formatDog['name'] = dog.name;\n formatDog['minHeight'] = height[0];\n formatDog['maxHeight'] = height[1];\n formatDog['minWeight'] = weight[0];\n formatDog['maxWeight'] = weight[1];\n formatDog['lifeSpan'] = dog.life_span;\n formatDog['temperaments'] = dog.temperament?.split(', ');\n }\n return formatDog;\n })\n}", "title": "" }, { "docid": "77a179953870f8fe20a740dceb685b9f", "score": "0.51469845", "text": "function get2dArray(arr, value) {\n\n\tvar strings = \n\t[\n\t\" ... ... \",\n\t\" ................ \",\n\t\" ... ... \"\n\t];\n\t\n\treturn strings;\n} //end get2dArray", "title": "" }, { "docid": "efbcaf4d5504f84585df0125c4c7fe1e", "score": "0.5141939", "text": "function createFinalArray() {\n if (confirmUppercase) {\n Array.prototype.push.apply(totalCharacters, upperCaseCharacters);\n };\n if (confirmLowercase) {\n Array.prototype.push.apply(totalCharacters, lowerCaseCharacters);\n }; \n if (confirmNumbers) {\n Array.prototype.push.apply(totalCharacters, numbers);\n };\n if (confirmSpecialCharacters) {\n Array.prototype.push.apply(totalCharacters, specialCharacters)\n };\n}", "title": "" }, { "docid": "71f054c1c2cadb86f214c1da3d6cd9cc", "score": "0.5134799", "text": "function displayArr() {\n var joined = keys.join('');\n joined = joined.replace(/multiplied/g, '&#215;');\n joined = joined.replace(/df/g, '-');\n joined = joined.replace(/sum/g, '+');\n joined = joined.replace(/div/g, '&#247;');\n document.getElementById('demo').innerHTML = joined;\n if (keys.length === 0) {\n document.getElementById('demo').style.opacity = 0;\n } else {\n document.getElementById('demo').style.opacity = 1;\n }\n }", "title": "" }, { "docid": "7a58c3014b54ca96db99c3022d9f8456", "score": "0.5129617", "text": "_getTypeArray(arrayOfName) {\n for (const index in arrayOfName) {\n if (arrayOfName.hasOwnProperty(index)) {\n arrayOfName[index] = this._getType(arrayOfName[index]);\n }\n }\n return _.join(arrayOfName, ', ');\n }", "title": "" }, { "docid": "af5ca315eee09f57bac5e4c43cf24e56", "score": "0.5127834", "text": "function arrayToString(arr, display) {\n \tif (display == 'forward') {\n \t\treturn arr.join(' ');\n \t} else if (display == 'backward') {\n \t\treturn arr.reverse().join(' ');\n \t}\n}", "title": "" }, { "docid": "e05d47c07d0f9f5793a44d33d6570cd7", "score": "0.5123058", "text": "getArray() {\n return [this.utilityThreshhold, this.distanceWeighting,\n this.heightWeighting, this.widthWeighting];\n }", "title": "" }, { "docid": "55bda836175e0d56d764c3152ec7830c", "score": "0.5120041", "text": "function formatData(data) {\n\tdata.forEach(function(d) {\n\t\td['gini'] = +d['gini'];\n\t\td['pct_unionized'] = +d['pct_unionized'];\n\t});\n\n\treturn data;\n}", "title": "" }, { "docid": "db2e3800be3aaf16f488130c44cb7903", "score": "0.511949", "text": "function format_output_string() {\n return make_multiples_array().join('+') + \"=\" + sum_array(make_multiples_array()).toString();\n}", "title": "" }, { "docid": "dd92220b5db17e805f8c85b287efd660", "score": "0.510805", "text": "function arrValuePrinter(array) {\n\tvar result = \"\";\n\tfor (var i=0; i<array.length; i++) {\n\t\tresult += array[i] + \" \";\n\t}return result;\n}", "title": "" }, { "docid": "91b65262c0ecd6af09d7a413c706e592", "score": "0.5107799", "text": "function readyToPutInTheDOM(arr){\n let reFormArr = arr.map(arr =>{\n console.log('<h1>'+arr.name+'</h1>'+\"<h2>\"+arr.age+'</h2>')\n })\n }", "title": "" }, { "docid": "ea13b99a14ad5ddf21e7adbbef850da8", "score": "0.51047915", "text": "function createAsteriskSepList(arr)\r\n{\r\n var str = \"\";\r\nif(arr == null)\r\n{\r\n return arr;\r\n}\r\n for (var x = 0; x < arr.length; x++)\r\n {\r\n if(x > 0)\r\n {\r\n str = str + \"*\" + arr[x];\r\n }\r\n else\r\n {\r\n str = str + arr[x];\r\n }\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "bde637bf770a3fa7d3fe4e299298d0f3", "score": "0.5103094", "text": "static getInformationForTransformedShapes(){\n var information_per_shape = [];\n if(ShapesDrawing.#transformation_list.length != 0){\n var transformed_shapes_index = 0;\n var transformed_shapes_array_size = ShapesDrawing.#transformation_list[0].getLegthOfTransformedShapes();\n while(transformed_shapes_index < transformed_shapes_array_size){\n var information_array = [];\n var transformation_information = \"\";\n for(var transformation of ShapesDrawing.#transformation_list){\n var base_shape = transformation.getSpecificTransformedShape(transformed_shapes_index);\n transformation_information += transformation.toString()+\"<br>\";\n information_array.push({basic_shape: base_shape, transformation_info: transformation_information, color: transformation.transformationColor});\n } \n information_per_shape.push(information_array);\n transformed_shapes_index++;\n }\n return information_per_shape;\n }\n return information_per_shape;\n }", "title": "" }, { "docid": "a98927c7a5907b9e0e88a09b1670638e", "score": "0.5101996", "text": "function formatdata(data) {\n newobj = {};\n newdata = [];\n for(var i=0; i < data.length; i++) {\n var st = data[i][\"state\"];\n var dt = data[i][\"date\"];\n\n var ob = {\n \"positive\": data[i][\"positive\"] | 0,\n \"negative\": data[i][\"negative\"] | 0,\n \"death\": data[i][\"death\"] | 0,\n \"total\": data[i][\"total\"] | 0,\n \"positiveIncrease\": data[i][\"positiveIncrease\"] | 0,\n \"deathIncrease\": data[i][\"deathIncrease\"] | 0,\n \"testIncrease\": data[i][\"testIncrease\"] | 0,\n \"hospitalized\": data[i][\"hospitalized\"] | 0\n }\n if(st in newobj){\n newobj[st][dt] = ob; \n \n }else{\n newobj[st] = {};\n newobj[st]['state'] = st;\n newobj[st][dt] = ob;\n \n }\n\n };\n for (const property in newobj) {\n newdata.push(newobj[property]);\n };\n return newdata;\n}", "title": "" } ]
6216df6dd424cf9194c6a6ad80eb7ab5
Updates the name of the remote with the given hostname and causes the remoteManager to save the data to the server if the name has changed.
[ { "docid": "a6e1b4e60fab857e14a6ef0778212156", "score": "0.80566126", "text": "function updateRemoteName(remoteHost, remoteName) {\n\t\tvar changed = false;\n\n\t\tfor (var i = 0; i < remoteManager.remotes.length; i++) {\n\t\t\tvar remote = remoteManager.remotes[i];\n\t\t\tif (remote.host === remoteHost) {\n\t\t\t\tif (remote.name !== remoteName) {\n\t\t\t\t\tremote.name = remoteName;\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (changed) {\n\t\t\tremoteManager.save();\n\t\t\tupdateActiveRemoteTitle();\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "ca517cad85fd2792dc5d1caac255639a", "score": "0.6137134", "text": "function On_Rename(strName, iReplyID, strSessionID, strClientID, userdata) {\n\tstrHostName = strName;\n\tconsole.log('Rename to' + strHostName);\n\tclient.core_action_response(iReplyID, strSessionID, true, strClientID);\n}", "title": "" }, { "docid": "f7adcece3b2b637e20b8b9b886d27f20", "score": "0.5928676", "text": "function setDisplayName(newDisplayName) {\n socket.emit(\"register-display-name\", newDisplayName);\n return \"sending request...\";\n}", "title": "" }, { "docid": "f42eb0e2f37ad8f9c9174b2512c78685", "score": "0.5802482", "text": "function updateActiveRemoteTitle() {\n\t\tvar activeRemote;\n\t\tif (remoteManager) {\n\t\t\tactiveRemote = remoteManager.getActive();\n\t\t}\n\t\tif (activeRemote) {\n\t\t\tvar name = ($.trim(activeRemote.name)) === \"\" ? \"(Box with no name)\" : activeRemote.name;\n\t\t\tactiveRemoteTitle.text(name);\n\t\t\tvar altText = name + \" (\" + activeRemote.host + \")\";\n\t\t\tactiveRemoteTitle.attr(\"alt\", altText);\n\t\t\tactiveRemoteTitle.attr(\"title\", altText);\n\t\t} else {\n\t\t\tvar text = \"(Must set up remote)\";\n\t\t\tactiveRemoteTitle.text(text);\n\t\t\tactiveRemoteTitle.attr(\"alt\", text);\n\t\t\tactiveRemoteTitle.attr(\"title\", text);\n\t\t}\n\t}", "title": "" }, { "docid": "0671118cd4ab95205cc13ec4e1978d14", "score": "0.5654329", "text": "function updateMyPeerName() {\n let myNewPeerName = myPeerNameSet.value;\n let myOldPeerName = myPeerName;\n\n // myNewPeerName empty\n if (!myNewPeerName) return;\n\n myPeerName = myNewPeerName;\n myVideoParagraph.innerHTML = myPeerName + \" (me)\";\n\n signalingSocket.emit(\"cName\", {\n peerConnections: peerConnections,\n room_id: roomId,\n peer_name_old: myOldPeerName,\n peer_name_new: myPeerName,\n });\n\n myPeerNameSet.value = \"\";\n myPeerNameSet.placeholder = myPeerName;\n\n setPeerAvatarImgName(\"myVideoAvatarImage\", myPeerName);\n setPeerChatAvatarImgName(\"right\", myPeerName);\n}", "title": "" }, { "docid": "39a657549bb148b2dfc43b4828574ffe", "score": "0.5595282", "text": "function changeActiveRemote (newActiveRemoteHost) {\n\t\t$.each(remoteManager.remotes, function(index, remote) {\n\t\t\tif (remote.host === newActiveRemoteHost) {\n\t\t\t\tremoteManager.setActive(remote);\n\t\t\t\tupdateActiveRemoteTitle();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "afa936432d96c05265df3e5db97b8921", "score": "0.5518475", "text": "setHostName(hostName) {\n sessionStorage.setItem(this.SessionStorageKeys.HOSTNAME, hostName);\n }", "title": "" }, { "docid": "021b88da72a73b170ca945c40e531d3a", "score": "0.54862493", "text": "function setMyName(){\n\tvar self = this;\n\tvar BODY = self.body;\n\tif(WA_CLIENT){\n\t\tif(BODY['newName']){\n\t\t\tif(WA_CLIENT.TOKEN == self.query['token']){\n\t\t\t\tconsole.log(\"Setting new name: \",BODY['newName']);\n\t\t\t\tWA_CLIENT.CONNECTION.setMyName(BODY['newName']);\n\t\t\t\tself.json({status:true});\n\t\t\t} else {\n\t\t\t\tself.json({status:false, err: \"Wrong token authentication\"});\n\t\t\t}\n\t\t} else {\n\t\t\tself.json({status:false, err: \"newName paramether is mandatory!\"});\n\t\t}\n\t} else {\n\t\tself.json({status:false, err: \"Your company is not set yet\"});\n\t}\n}", "title": "" }, { "docid": "017e6108a2e2253f46827c6865daf9d7", "score": "0.54706424", "text": "function updateHost(msg, cb) {\n HostService.updateHost(msg).\n success(function(data) {\n AlertService.addAlert(\"success\", \"Successfully Updated Host: \"+msg.name);\n if(cb) {\n cb();\n };\n }).\n error(function(data) {\n AlertService.addAlert(\"danger\", \"Error:\\n\" + processErrorData(data));\n if(cb) {\n cb();\n };\n });\n }", "title": "" }, { "docid": "5aa5245e6536992d3b97284652fd67fb", "score": "0.5454672", "text": "function update() {\n\t\tSiad.apiCall('/host', function(result) {\n\t\t\tHost.update(result);\n\t\t});\n\t\tupdating = setTimeout(update, refreshRate);\n\t}", "title": "" }, { "docid": "b2c2709130e82223d694e7514efa5b5b", "score": "0.5389413", "text": "function updateNames(updatedName) {\n socket.name = updatedName;\n\n document.getElementsByClassName(`${socket.id}`)[0].textContent = updatedName;\n\n let names = document.getElementsByClassName('labelname');\n for (let i = names.length - 1; i >= 0; i--){\n names[i].textContent = updatedName;\n }\n}", "title": "" }, { "docid": "06df86ff99a3466f857f8795d3ca3815", "score": "0.5244974", "text": "function maintainHost() {\n firebase.database().ref(`/rooms/${ room }/players/${ host }`).once('value').then( (data) => {\n if (!data.exists() || Date.now() - data.val().lastUpdate > 40000)\n firebase.database().ref(`/rooms/${ room }`).update({ host: username })\n });\n}", "title": "" }, { "docid": "2f85a1782060ce55a3fee05c9347a2e9", "score": "0.520999", "text": "updateFromName() {\n this.id = this.name.substring(0, this.name.lastIndexOf('.')) || this.name;\n }", "title": "" }, { "docid": "53d0e825757f18adb45d030cb153b028", "score": "0.51719564", "text": "function updateNames() {\n io.sockets.emit('usernames', usernames);\n }", "title": "" }, { "docid": "c817349a01214c7f3c77c58d22fd96ee", "score": "0.5095372", "text": "setFileName(e){\n const value = e.target.value;\n if(value.length > 0 && this.file != null){\n const SERVER_URL = localStorage.getItem(\"SERVER_URL\");\n $.ajax({\n url: SERVER_URL + \"/files/rename\",\n method: 'POST',\n beforeSend: (req) => {\n req.setRequestHeader('Access-Control-Allow-Origin', SERVER_URL)\n req.setRequestHeader('Access-Control-Allow-Credentials', 'true')\n },\n data: {\n fileID: this.file,\n nickname: value\n },\n success: (res) => {\n notify(\"File name set successfully.\", {type: \"success\"});\n },\n error: (res) => {\n notify(\"Problem with renaming the file occurred.\", {type: \"danger\"});\n console.error(res);\n }\n })\n }\n }", "title": "" }, { "docid": "b8b66eec9fbec229369ac79d7db79437", "score": "0.5046401", "text": "async function name(authToken, newName, boardId) {\n let responseData = {};\n\n try {\n const address = `${apiConfig.URL_SCHEME}://${apiConfig.IP}:${apiConfig.PORT}${apiConfig.EXT}/changeBoard/name`;\n const payload = {\n name: newName,\n board_id: boardId,\n };\n const settings = {\n headers: {\n Authorization: authToken,\n },\n };\n\n const response = await axios.patch(address, payload, settings);\n\n responseData = response.data;\n } catch (error) {\n responseData = {\n success: false,\n message: 'Error contacting API server.',\n };\n }\n\n return responseData;\n}", "title": "" }, { "docid": "a9d6002ecfbc63e04492ff37058e2e3e", "score": "0.5044158", "text": "function setNewName(){ \n \n //Get the new name and full the object with the new name \n var newName = document.getElementById(\"newname\").value ;\n editedPlayer.name = newName;\n \n //Make the put request\n $.ajax\n ({ \n url: urlRequest,\n type:\"PUT\",\n async: true,\n cache: false, \n processData: false, \n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify(editedPlayer),\n dataType: \"json\", \n success:function(data)\n {\n //Confirm the rename and exit menu\n document.getElementById(\"d1\").innerHTML = \"<p class='blinky'>Name changed</p>\";\n document.getElementById(\"d2\").innerHTML = \"<br><a href='./index.html'>Exit</a>\" \n },\n error:function(xhr, ajaxOptions, thrownError)\n {\n //TODO: control the errors to exit the correct message and end \n var output=\"XD\"; \n switch (xhr.status) \n { \n case 409 :\n //Duplicated name\n output=\"The '\"+editedPlayer.name+\"' name already exists.\"\n break;\n default: \n output = \"<p class='blinkr'>Communications error:</p class='blink'><p class='blinkr'>try later</p>\"\n }\n document.getElementById(\"d1\").innerHTML = \"<p class='blinkr'>\"+output+\"</p>\";\n document.getElementById(\"d2\").innerHTML = \"<br><a href='javascript:renamePlayer();'>Try again</a>\" \n\n }\n}); \n}", "title": "" }, { "docid": "f102a311549f97b06828ad905190b839", "score": "0.5034883", "text": "setName(newName){\n this.set('model.name', newName);\n this.send('saveModel');\n }", "title": "" }, { "docid": "aef223cbb083dd5c6da9c922cc012f7c", "score": "0.50337505", "text": "handleSetName({ name }) {\n this.name = name;\n\n // Send an updated user list to all users\n const users = User.getNamedUsers().map(user => user.getSanitized());\n ServerSocket.broadcast('UserList', { users });\n this.send('RecentPosts', { posts: serverPostHistory.list });\n }", "title": "" }, { "docid": "1bdb77a9868f40072b240191e8653c4b", "score": "0.5024665", "text": "function updateName() {\n const newHeadline = getHeadline(taskController.getSelectedTask());\n if (!isCustomName()) {\n nameElem.value = newHeadline;\n }\n display_task_element.value = newHeadline;\n }", "title": "" }, { "docid": "1563cc9ec81c53eca16549fd34a4a89b", "score": "0.49631685", "text": "async updateOwner(name, newOwner) {\n await axios.put(`http://localhost:3002/client/${name}`, newOwner)\n this.getClients()\n }", "title": "" }, { "docid": "aff17ae8907861e1a9c5dd838ac50f1f", "score": "0.49559703", "text": "async updateHouseName(location, name) {\n await server.database.query(UPDATE_NAME_SETTING_QUERY, name, location.settings.id);\n }", "title": "" }, { "docid": "e0c8ab099fc4214427d1c4f5424a7ade", "score": "0.4926775", "text": "function nameChange() {\n\t \tvar newName = chatuser.val();\n\t \tif (!newName || newName == name) {\n\t \t\treturn;\n\t \t}\n\n\t \tsocket.emit('nameChange', { name: newName });\n\t \tname = newName;\n\t }", "title": "" }, { "docid": "6f9b71a815327da4e043b63b5497ef58", "score": "0.49255", "text": "function setHost(newHost) {\n options.host = newHost;\n}", "title": "" }, { "docid": "997dcb2c9da69660128c7d3869cc47a3", "score": "0.49242374", "text": "function setRemoteDescription(description, success, failure) {\n this.remoteDescription = description\n\n if (this.localDescription && this.readyState === \"new\") {\n open(this)\n }\n\n success && success()\n}", "title": "" }, { "docid": "ef6abee79d5009b3819f5c72baee8d78", "score": "0.4911091", "text": "@action\n commitRename() {\n const target = this.backups.find(backup => backup.id === this.currentId)\n if (target) {\n target.name = this.newBackupName\n }\n this.currentId = undefined\n this.newBackupName = \"\"\n this.renameDialogVisible = false\n }", "title": "" }, { "docid": "7a941ffecf9c24fac61c852980a34dd1", "score": "0.49075803", "text": "setName() {\n const lastPlayed = this.props.name;\n this.props.handleNameUpdate(lastPlayed);\n }", "title": "" }, { "docid": "cb80b80431403b9bd3cad0fc4bc14567", "score": "0.49005243", "text": "handlePeerNicknameSubmit(peerId, nickname) {\n this.state.lc.send('LitRPC.AssignNickname', {\n 'Peer': peerId,\n 'Nickname': nickname,\n })\n .then(reply => {\n this.updateListConnections();\n })\n .catch(err => {\n this.displayError(err);\n });\n }", "title": "" }, { "docid": "b8eaacb860ba6ddb026b73cb69e7e2a6", "score": "0.48966122", "text": "function updateName(uuid) {\n var avatar = _this.avatars[uuid];\n avatar.nametag.destroy();\n\n avatar.nametag = new EntityMaker('local').add(entityProps);\n\n makeNameTag(uuid);\n}", "title": "" }, { "docid": "0aa390104833717c1e08b46f7e5b1e3d", "score": "0.48819926", "text": "set name(newName) {\n this._name = newName;\n this.nameChanged.emit(newName);\n }", "title": "" }, { "docid": "0deb59374b9fd8df78af3633fa6353a2", "score": "0.4881526", "text": "async addName() {\n try {\n await Axios.patch(`http://localhost:5000/user/name/${clientSocket.id}`, \n {name: this.state.currentName}).then(\n // console.log(\"added new name\")\n )\n } catch (error) {\n console.log(\"problem updating the name\")\n }\n }", "title": "" }, { "docid": "0039aa033dc978eba4c4b3c1dd32efc4", "score": "0.4877689", "text": "set name(newName){\n\t\t//Check if this new name already exists. If it does, don't change it.\n\t\tif(MAP_PNAME.has(newName)){ return; }\n\n\t\tlet oldName = P_PRIVATES.get(this).name;\n\n\t\tMAP_PNAME.delete(oldName);\n\n\t\tP_PRIVATES.get(this).name = newName;\n\n\t\tMAP_PNAME.set(newName, this);\n\t}", "title": "" }, { "docid": "b3c96d8c75f85c665862557ad9121d03", "score": "0.48701218", "text": "function updateNicknames() {\n io.emit('usernames', nicknames);\n }", "title": "" }, { "docid": "e779407ce33d1e5229033eb237397e6f", "score": "0.48700047", "text": "set name(newValue){\n if (newValue){\n this._name = newValue;\n } \n }", "title": "" }, { "docid": "35187bc51b41ccc144f7cb985fbed188", "score": "0.48610213", "text": "changeName (name = '') {\n if (name === '') throw new Error('Shouldn\\'t have an empty name')\n return this.deploy().then((instance) => {\n return instance.changeName(name, {from: this.account})\n })\n }", "title": "" }, { "docid": "bc459979611ef7c0e00315cdcc404fce", "score": "0.48280066", "text": "function connectToServer( hostname: String, port: int ) {\n\n var username = playerName.Trim();\n \n if( username.Length < 1 ) {\n username = System.Environment.UserName;\n }\n \n if( username != playerName ) {\n playerName = username;\n PlayerPrefs.SetString(\"Player Name\", playerName);\n }\n\n Network.Connect( hostname, port ); \n}", "title": "" }, { "docid": "d28b483ca416772718e3a88946a1f10d", "score": "0.4816468", "text": "changeNameHandler() {\n const groupId = document.querySelector('#group-name-change').dataset.group_id;\n const newName = changeGroupNameInput.value;\n groupPopMessage.textContent = 'Changing group name';\n groupPopUp();\n const url = `https://epic-mail-2018.herokuapp.com/api/v1/groups/${groupId}/name`;\n const nameObj = { name: newName };\n return setTimeout(() => fetchPatch(url, nameObj), 1000);\n\n }", "title": "" }, { "docid": "fd30c3cd4e79e0480b08b12c2c25625e", "score": "0.48083687", "text": "get hostname() {}", "title": "" }, { "docid": "193a94e4f36a737b59f120dd8ed544c9", "score": "0.47971416", "text": "nameChanged() {\n if (this.proxy instanceof HTMLElement) {\n this.proxy.name = this.name;\n }\n }", "title": "" }, { "docid": "0939b453ca7296c3d687a85dc9f9b68f", "score": "0.4795816", "text": "function setRemoteManager(rm) {\n\t\tremoteManager = rm;\n\t}", "title": "" }, { "docid": "b36d5cb1dfcbac478393e8ab53e2888f", "score": "0.47800487", "text": "handleNameChange(name) {\n this.props.socket.emit(\"change_name\", name);\n }", "title": "" }, { "docid": "571a6892d4598019e7881253cb095ed7", "score": "0.4745329", "text": "nameChanged(previous, next) {\n if (this.proxy instanceof HTMLElement) {\n this.proxy.name = this.name;\n }\n }", "title": "" }, { "docid": "dddb1e51487fe4e3564e22c9cb1b211b", "score": "0.4740439", "text": "sendUpdatedData(name) {\n if (this.hifiCommunicator) {\n this.hifiCommunicator.updateUserDataAndTransmit({\n position: this.mixerPosition,\n orientationQuat: this.mixerOrientation\n });\n }\n }", "title": "" }, { "docid": "96401c51798d53e73b0adfc29357f62e", "score": "0.47362193", "text": "function changeName(token, firstName, lastName) {\n \n // TODO: Implement\n}", "title": "" }, { "docid": "339e9a4326c52b9304ff5c615a63dcd3", "score": "0.4726363", "text": "changeName(newName) {\n this.name = newName;\n }", "title": "" }, { "docid": "f94a141f4fde751314eca5c390af47a3", "score": "0.47210628", "text": "function update_host_status(){ \n\tvar num_pair = get_host_num();\n\tup_num = num_pair[0]; \n\tdown_num = num_pair[1]; \n\tdonut.setData([{\n\t\tlabel: \"Hosts Up\",\n\t\tvalue: up_num\n\t}, {\n\t\tlabel: \"Hosts Down\",\n\t\tvalue: down_num\n\t}]);\n}", "title": "" }, { "docid": "efce4e8be10a4065780af4996730b77b", "score": "0.47132283", "text": "function updateEnemyName(){\n const enemyCard = document.querySelector('.enemy-card')\n const enemyId = parseInt(enemyCard.dataset.id)\n const enemyName = document.getElementById('enemy-name')\n enemyName.innerText += ' Defeated'\n fetch(`https://bossrush-backend.herokuapp.com/enemies/${enemyId}`, {\n method: 'PATCH',\n headers: {\n 'Content-type': 'application/json',\n Accept: 'application/json'\n },\n body: JSON.stringify({\n id: enemyId,\n name: enemyName.innerText\n })\n }).then(() => {raiseEnemyDefeatedToast()})\n\n}", "title": "" }, { "docid": "bc5c16721e77c2c59963cb1b6d408291", "score": "0.47125557", "text": "function handleNameUpdate(newFilenameInputEl, fileId) {\n\t var newName = newFilenameInputEl.value,\n\t origExtension;\n\n\t if (newName !== undefined && qq.trimStr(newName).length > 0) {\n\t origExtension = getOriginalExtension(fileId);\n\n\t if (origExtension !== undefined) {\n\t newName = newName + \".\" + origExtension;\n\t }\n\n\t spec.onSetName(fileId, newName);\n\t }\n\n\t spec.onEditingStatusChange(fileId, false);\n\t }", "title": "" }, { "docid": "909133aa7f99966d1eaafebbd1746e2a", "score": "0.47085345", "text": "set host(serverURL) {\n let objToStore = {};\n if (serverURL) {\n const res = this.app; // this._realm.objects(Constants.App).filtered(`_id = \"${0}\"`);\n objToStore = {\n host: serverURL,\n };\n if (res && res._id === 0) {\n this._realm.write(() => {\n // this._realm.delete(this.app);\n this._realm.create(Constants.App, objToStore, true);\n });\n } else {\n this._realm.write(() => {\n objToStore = {\n host: serverURL,\n };\n this._realm.create(Constants.App, objToStore, true);\n });\n }\n // call to create job from here\n this.connectHost();\n }\n }", "title": "" }, { "docid": "14132712a8f88c0f6acf2958ed492363", "score": "0.4692508", "text": "function updateRemote(path, local, remote) {\n logger.info('UPDATE', path, 'LOCAL -> REMOTE');\n wireClient.set(\n path, local.data, local.mimeType,\n makeErrorCatcher(path, function() {\n var parentPath = util.containingDir(path);\n if(! parentPath) {\n throw \"Node has no parent path: \" + path;\n }\n // update lastUpdatedAt for this node to exact remote time.\n // this is a totally unnecessary step and should be handled better\n // in the protocol (e.g. by returning the new timestamp with the PUT\n // request).\n fetchNode(util.containingDir(path), function(listing) {\n store.clearDiff(path, listing[util.baseName(path)]);\n });\n })\n );\n }", "title": "" }, { "docid": "5e4e325187714d9ad2113ad0632d42c7", "score": "0.4692398", "text": "saveTags() {\n\t\tvar tagsToSave = {};\n\t\tthis.tagsHolder.forEach((tag) => {\n\t\t\ttagsToSave[tag.key] = tag.value;\n\t\t});\n\t\tvar oldTags = this.selectedServer.tags;\n\t\tthis.selectedServer.tags = tagsToSave;\n\t\tthis.$scope.$emit('LOAD');\n\t\tthis.HostService.updateHost(this.selectedServer).then(\n\t\t\t\t(response) => {\n\t\t\t\t\tthis.$scope.$emit('UNLOAD');\n\t\t\t\t\tif (response.config) {\n\t\t\t\t\t\tdelete response.config;\n\t\t\t\t\t}\n\t\t\t\t\tthis.modalAlert(response);\n\t\t\t\t\tthis.cancelEdit();\n\t\t\t\t}, (err) => {\n\t\t\t\t\tthis.$scope.$emit('UNLOAD');\n\t\t\t\t\tif (err.config) {\n\t\t\t\t\t\tdelete err.config;\n\t\t\t\t\t}\n\t\t\t\t\tif (err.data && err.data.length > 100) {\n\t\t\t\t\t\terr.data = err.data.substring(0, 97) + '...';\n\t\t\t\t\t}\n\t\t\t\t\tthis.modalAlert(err);\n\t\t\t\t\t//resume the old tags in case update fails.\n\t\t\t\t\tthis.selectedServer.tags = oldTags;\n\t\t\t\t\tthis.cancelEdit();\n\t\t\t\t});\n\t}", "title": "" }, { "docid": "ac5ae6c4d9637146d9b7179793b7799d", "score": "0.4684034", "text": "function renameRemoteFile(parNode, newName, oldName) {\n //AJAX call to remove file from user directory\n //also delete the file from tree\n //Display the file in the editor\n var parent_path = getRemotePath(parNode).replace('root','.') + '/';\n var remote_path = parent_path + oldName;\n var new_path = parent_path + newName;\n return $.ajax({\n method: 'POST',\n url: \"renameRemoteFile\",\n data: {\n 'remote_path': remote_path,\n 'new_path': new_path\n },\n success: function(data) {\n //this gets called when server returns an OK response\n //now remove menu item from tree\n new $.Zebra_Dialog(data, {\n 'buttons': false,\n 'modal': false,\n 'position': ['right - 20', 'top + 20'],\n 'auto_close': 1500,\n 'type': 'confirmation',\n 'title': newName\n });\n },\n error: function(data) {\n new $.Zebra_Dialog(\"Error occured while renaming: \" + data.responseText, {\n 'buttons': false,\n 'modal': false,\n 'position': ['right - 20', 'top + 20'],\n 'auto_close': 1500,\n 'type': 'error',\n 'title': newName\n });\n }\n });\n}", "title": "" }, { "docid": "b95e23555bb345cb22b0701f91ec3659", "score": "0.4681397", "text": "function doRemoteEdit(name, project, url) {\n _remoteEditClear();\n\n projectname = project;\n setText('editNodeIdent',name);\n\n //create iframe for url\n var ifm = document.createElement('iframe');\n ifm.width = \"640px\";\n ifm.height = \"480px\";\n _remoteEditExpect(url);\n ifm.src = url;\n\n $('remoteEditTarget').appendChild(ifm);\n\n _remoteEditShow();\n}", "title": "" }, { "docid": "ebd0b5403112d3497a4b5dd150daee3d", "score": "0.46795288", "text": "changeName(username) {\n const newUserName = {type: 'postNotification', username: this.state.currentUser.name, content: username};\n // send the message to the server\n this.socket.send(JSON.stringify(newUserName));\n }", "title": "" }, { "docid": "25c613990f1b894e9f871d4d921c120c", "score": "0.46762344", "text": "update(name: string, title: string, contents: string) {\n Url.update({\n title: title,\n contents: contents,\n }, {\n where: {\n name: name\n }\n });\n }", "title": "" }, { "docid": "1c13791a641ac932b0d9d9854e367762", "score": "0.46561033", "text": "function host_joined(socket) {\n var user_info = user_obj(socket);\n remove_host(user_info['id']);\n\n hosts[user_info['room']] = user_info['id'];\n\n join_room(socket);\n}", "title": "" }, { "docid": "327284ca43bc2e6aefbe4fbadf519f5e", "score": "0.46550068", "text": "function renameNode(nodeName) {\n\n\t\t\t\t\t\tif (nodeName !== deviceData.givenName.value) {\n\n\t\t\t\t\t\t\t// do something\n\t\t\t\t\t\t\tdeviceData.givenName.value = nodeName && nodeName !== '' && !!nodeName ? nodeName : deviceData.givenName.value;\n\n\t\t\t\t\t\t\t// console output\n\t\t\t\t\t\t\tconsole.log('#######################', 'Apply postfix #' + nodeId, '################################');\n\t\t\t\t\t\t\tconsole.log('###');\n\t\t\t\t\t\t\tconsole.log('###', 'Change node name to: ', nodeName);\n\t\t\t\t\t\t\tconsole.log('###');\n\t\t\t\t\t\t\tconsole.log('######################################################################################');\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "title": "" }, { "docid": "cf636b1cb01c823935de317ec187f8ef", "score": "0.4653823", "text": "function set(host, name, value) {\n return host[MEMBER_PRIFIX + name] = value;\n}", "title": "" }, { "docid": "4a92a61e74c87d39e9e1317be8c5f8dc", "score": "0.46487826", "text": "function getByRemoteConfig(hostname) {\n var remoteModuleConfig = typeof window !== 'undefined' &&\n window.__fbBatchedBridgeConfig &&\n window.__fbBatchedBridgeConfig.remoteModuleConfig\n if (\n !Array.isArray(remoteModuleConfig) ||\n hostname !== 'localhost' && hostname !== '127.0.0.1'\n ) return hostname\n\n var constants = (\n remoteModuleConfig.find(getConstants) || []\n )[1]\n if (constants) {\n var serverHost = constants.ServerHost || hostname\n return serverHost.split(':')[0]\n }\n return hostname\n}", "title": "" }, { "docid": "02f25466a63b02fb3dc2f4c43555fa13", "score": "0.46455058", "text": "setName(newName) {\n this._name = newName;\n }", "title": "" }, { "docid": "36fad35c4d56e6d06d6e745ed33b4d65", "score": "0.46373028", "text": "async function requestUpdateUsername(newName) {\n fetch(\"http://localhost:4000/users/1\", {\n method: \"PATCH\",\n body: JSON.stringify({\n name: newName.toUpperCase(),\n }),\n headers: {\n \"Content-type\": \"application/json; charset=UTF-8\",\n },\n })\n .then((response) => response.json())\n .then((json) => console.log(json));\n}", "title": "" }, { "docid": "2f2192f045b264deb031c8e50d44b3a6", "score": "0.46351337", "text": "setName(newName) {\n this.name = newName;\n }", "title": "" }, { "docid": "1c70d397a02ef5a38f7a8ceeb26bab15", "score": "0.46341175", "text": "@action changeName(name) {\n this.name = name;\n }", "title": "" }, { "docid": "282c6792a55b0c74aa5facaeed59350e", "score": "0.46330398", "text": "setPlayerName(nName) {\n\t\tthis.mName = nName;\n\t}", "title": "" }, { "docid": "87f165ccad317ef209420e65d459a4ed", "score": "0.46329442", "text": "get name() {\r\n return rapi_helpers.normalizeString(OS.hostname());\r\n }", "title": "" }, { "docid": "57ee079175c1ffaac248e5c46dc1a569", "score": "0.4632706", "text": "update(name, title, contents) {\n Url.update({\n title: title,\n contents: contents\n }, {\n where: {\n name: name\n }\n });\n }", "title": "" }, { "docid": "e38f29b57fe88e2105a744c9f886bd37", "score": "0.4631337", "text": "function updateUserByName(req, res)\n\t {\n\t\tvar userName = req.params.username;\n\t\treq.addListener('data', function(message)\n\t\t{\n\t\t\tvar command = JSON.parse(message);\n\t\t\tuserdbConnection.query(\"UPDATE USER SET user_fname='\" + command.fname + \"',user_lname='\" + command.lname + \"',user_email='\" + command.email + \"',user_organisation='\" + command.organisation + \"',user_phoneNumber='\" + command.mobile + \"',user_address='\" + command.address + \"',user_country='\" + command.country + \"',user_description='\" + command.description + \"' WHERE user_name='\" + userName + \"'\",\n\t\t\t\tfunction(err, rows, fields)\n\t\t\t\t{\n\t\t\t\t\tvar data = JSON.stringify({'message': 'Updated for' + ' ' + command.fname});\n\t\t\t\t\tres.send(data);\n\t\t\t\t}); \n\t\t});\n\t}", "title": "" }, { "docid": "0ed3f99e1eb860f0e33cb1a3758a9288", "score": "0.46261305", "text": "function doMigrateDisplayName() {\n setTimeout(migratePostedFromDisplayNameToName, 300);\n}", "title": "" }, { "docid": "ae49289c843c114d32f8b765f7e8c14c", "score": "0.4607386", "text": "function save(callback) {\n\t\t// Just hack together the JSON this one time...\n\t\tvar json = \"{\\\"remotes\\\":[\";\n\t\tfor (var i = 0; i < this.remotes.length; i++) {\n\t\t\tvar remote = this.remotes[i];\n\t\t\tjson = json + \"{\\\"host\\\":\\\"\" + remote.host + \"\\\",\\\"name\\\":\\\"\" + remote.name +\n\t\t\t\t\"\\\",\\\"port\\\":\\\"\" + remote.port + \"\\\"}\";\n\t\t\tif (i !== (this.remotes.length - 1)) {\n\t\t\t\tjson = json + \",\";\n\t\t\t}\n\t\t}\n\t\tjson = json + \"],\\\"active\\\":\" + this.activeIndex + \"}\";\n\n\t\t$.ajax({url:\"/ajax\", data:{action:\"update\", data:json}, success:function(resp) {\n\t\t\tconsole.log(resp);\n\t\t\tif (callback) {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}});\n\t}", "title": "" }, { "docid": "a062e9e36fe673dfa984d0c4148d1792", "score": "0.46031645", "text": "set name(newName) {\n this._name = newName;\n if (this.element) this.element.title = newName + \", #\" + this.id;\n }", "title": "" }, { "docid": "3ffa34b2f9b4ac3e461b98413992438d", "score": "0.4592791", "text": "function updateByName (name) {\n\tvar url = \"http://api.openweathermap.org/data/2.5/weather?\" + \n\t\t\t\t\"q=\" + name + \"&appid=\" + myId;\n\tsendRequest(url);\n}", "title": "" }, { "docid": "0bbc63335025c807bebb2406a5eaf5e7", "score": "0.45896897", "text": "function changeCharName(user, newName,socket){\n var socket = socket;\n User.findOne({ 'local.characterName' : newName}, function(err, otherUser) {\n //If there's an error, return it.\n if (err)\n return err;\n\n if(otherUser) {\n return io.to('priv/' + user.id).emit('chat message', 'The name ' + newName + ' has already been taken.');\n } else{\n //Change the character's name\n user.local.characterName = newName;\n user.save(function(err) {\n if (err)\n throw err;\n return null;\n });\n console.log('[NAMING]' + user.local.email + ' has named themselves ' + user.local.characterName);\n io.to('priv/' + user.id).emit('chat message', 'You have named yourself ' + user.local.characterName);\n return;\n }\n });\n}", "title": "" }, { "docid": "73622057e11c93ea14c520a7e2ebe16e", "score": "0.45867664", "text": "function updateDisplayName(id){\n // We might receive the screen before the screen itself\n // so check if the object exist before using it, or fallback with empty values\n var display = (peers[id] && peers[id].hasName) ? peers[id].displayName : '';\n var color = (peers[id] && peers[id].color) ? peers[id].color : chooseColor();\n var screenName = (peers[id] && peers[id].hasName) ? sprintf(locale.SCREEN_s, peers[id].displayName) : '';\n $('#name_' + id).html(display).css('background-color', color);\n $('#name_' + id + '_screen').html(screenName).css('background-color', color);\n }", "title": "" }, { "docid": "30474ca06e2973fd49ee55279edf58d9", "score": "0.45781544", "text": "function reload_host_server() {\n var list = $('#host_server_list');\n\n oh.api.admin.hostserver.list.get({\n header: {\n hackathon_name: currentHackathon\n }\n }, function(data) {\n if (!data.error) {\n list.empty().append($('#hostserver_list_template').tmpl(data,{\n getState:function(state){\n if(state == 0){\n return 'VM初始化中'\n }\n if(state == 1){\n return 'Docker初始化中'\n }\n if(state == 2){\n return '就绪'\n }\n return '不可用';\n },\n getIsAuto:function(is_auto){\n if(is_auto == 1){\n return '自动'\n }\n return '手动';\n },\n getDisabled:function(disabled){\n if(disabled == 0){\n return '启用'\n }\n return '禁用';\n }\n }));\n oh.comm.removeLoading();\n }\n });\n }", "title": "" }, { "docid": "d7dcd06aa0894962460b7e151d9a304c", "score": "0.45653695", "text": "setChannelName (callback) {\n\t\t// repo updates comes by the team channel\n\t\tthis.channelName = `team-${this.team.id}`;\n\t\tcallback();\n\t}", "title": "" }, { "docid": "61bfaa81d14e1de23aade03660fa60c4", "score": "0.45645612", "text": "function changeName(oldname, name) {\n if (oldname === username) {\n username = name;\n addCookie(\"chatname\", name);\n $(\"#socketchatbox-username\").text(username);\n }\n }", "title": "" }, { "docid": "5cc9bb768a7e1ec0c6329f2ce6644c6b", "score": "0.45632347", "text": "function performGssapiCanonicalizeHostName(canonicalizeHostName, host, callback) {\n if (!canonicalizeHostName) return callback();\n\n // Attempt to resolve the host name\n dns.resolveCname(host, (err, r) => {\n if (err) return callback(err);\n\n // Get the first resolve host id\n if (Array.isArray(r) && r.length > 0) {\n self.host = r[0];\n }\n\n callback();\n });\n }", "title": "" }, { "docid": "63cce37388fe9f6fb47c16b6ff6256ed", "score": "0.45614633", "text": "addRemote(name) {\n assert(!remotes.has(name), X`already have remote ${name}`);\n const r = getRemote(name);\n const transmitter = Far('transmitter', {\n transmit(msg) {\n const o = r.outbound;\n const num = o.highestAdded + 1;\n // console.debug(`transmit to ${name}[${num}]: ${msg}`);\n D(mailbox).add(name, num, msg);\n o.highestAdded = num;\n },\n });\n const setReceiver = Far('receiver setter', {\n setReceiver(newReceiver) {\n assert(!r.inbound.receiver, X`setReceiver is call-once`);\n r.inbound.receiver = newReceiver;\n },\n });\n return harden({ transmitter, setReceiver });\n }", "title": "" }, { "docid": "d99c052204791ceef6809bc270e2aa4b", "score": "0.45555648", "text": "set name (newName){\n this.#name = newName;\n }", "title": "" }, { "docid": "de4478e25420c460c400f7f52633868c", "score": "0.45450222", "text": "function sendToServer( name ){\n\t\tsocket.json.emit('emit_from_client', name);\n\t}", "title": "" }, { "docid": "61456b4d77a21d26cfe734eda85f8cd1", "score": "0.45440522", "text": "async function _updateDNS() {\n if (!_dnsAccount) {\n return;\n }\n const LOG_PREFIX = 'G_DNS';\n\n const user = _dnsAccount.user;\n const password = _dnsAccount.password;\n const hostname = _dnsAccount.hostname;\n\n log.debug(LOG_PREFIX, 'Updating DNS entry...');\n\n // See https://support.google.com/domains/answer/6147083 for Dynamic DNS API\n const host = `${user}:${password}@domains.google.com`;\n const path = `nic/update?hostname=${hostname}`;\n const url = `https://${host}/${path}`;\n const fetchOpts = {\n method: 'post',\n };\n\n let respTXT;\n try {\n const resp = await fetch(url, fetchOpts);\n if (!resp.ok) {\n log.exception(LOG_PREFIX, 'Server error', resp);\n return;\n }\n respTXT = await resp.text();\n } catch (ex) {\n log.exception(LOG_PREFIX, 'DNS update failed.', ex);\n }\n if (respTXT.includes('good') || respTXT.includes('nochg')) {\n log.log(LOG_PREFIX, 'DNS updated successfully.', respTXT);\n return;\n }\n log.error(LOG_PREFIX, 'DNS update failed.', respTXT);\n }", "title": "" }, { "docid": "10bf8c8c8d7e491364afe6fb3f466029", "score": "0.4540772", "text": "function TellServerOurName(name : String, info : NetworkMessageInfo){\n\tvar newEntry : PlayerNode = new PlayerNode();\n\tnewEntry.playerName=name;\n\tnewEntry.networkPlayer=info.sender;\n\tplayerList.Add(newEntry);\n\t\n\taddGameChatMessage(name+\" joined the chat\");\n}", "title": "" }, { "docid": "61ab9e890bf67456d609009733eb7624", "score": "0.45346916", "text": "function validateHostname(self, rest, hostname) {\n for (var i = 0, lastPos; i <= hostname.length; ++i) {\n var code;\n if (i < hostname.length) code = hostname.charCodeAt(i);\n if (code === 46 /*.*/ || i === hostname.length) {\n if (i - lastPos > 0) {\n if (i - lastPos > 63) {\n self.hostname = hostname.slice(0, lastPos + 63);\n return '/' + hostname.slice(lastPos + 63) + rest;\n }\n }\n lastPos = i + 1;\n continue;\n } else if (\n (code >= 48 /*0*/ && code <= 57) /*9*/ ||\n (code >= 97 /*a*/ && code <= 122) /*z*/ ||\n code === 45 /*-*/ ||\n (code >= 65 /*A*/ && code <= 90) /*Z*/ ||\n code === 43 /*+*/ ||\n code === 95 /*_*/ ||\n /* BEGIN MONGO URI PATCH */\n code === 44 /*,*/ ||\n code === 58 /*:*/ ||\n /* END MONGO URI PATCH */\n code > 127\n ) {\n continue;\n }\n // Invalid host character\n self.hostname = hostname.slice(0, i);\n if (i < hostname.length) return '/' + hostname.slice(i) + rest;\n break;\n }\n}", "title": "" }, { "docid": "0f709333a54ebd5c2ba8520cb02a3477", "score": "0.45307267", "text": "function FireTitleRename_onAccept()\n{\n var sep = document.getElementById(\"FireTitleOptMiscSeparator\").value;\n\n var curname = document.getElementById(\"FireTitleOptWinCurName\").value;\n var curpattern = document.getElementById(\"FireTitleOptWinCurPattern\").value;\n\n var newname = document.getElementById(\"FireTitleOptWinNewName\").value;\n var newpattern = document.getElementById(\"FireTitleOptWinNewPattern\").value;\n\n this.ftManager.update(sep, curname, curpattern, newname, newpattern);\n}", "title": "" }, { "docid": "355137d5c080dceda01b9a8e80f570b7", "score": "0.45219493", "text": "saveName(s, { uri, name }) {\n this._vm.$log('saveName', uri, name);\n s.mappedNames[uri] = name;\n }", "title": "" }, { "docid": "cfb3d1e56f03a59ec9bfbd81e573de56", "score": "0.4518155", "text": "function addAndFetchRemote(owner, name) {\n const remoteName = `${owner}_${name}`;\n exec(`git remote add ${remoteName} https://github.com/${owner}/${name}.git`, true);\n exec(`git fetch ${remoteName}`);\n return remoteName;\n}", "title": "" }, { "docid": "8da14e9c38c5ec7826912dc55430e810", "score": "0.45179123", "text": "function updateUsernames() {\n\t\tio.sockets.emit('get user', users);\n\t}", "title": "" }, { "docid": "23710f5c9e59f5fabc7d76da8a08147d", "score": "0.451514", "text": "function updateUsernames() {\n io.sockets.emit('get users', users);\n }", "title": "" }, { "docid": "f2df66583caaf90d3d87cabac5527671", "score": "0.44974363", "text": "set name (n) {\n this._name = n\n console.log(`New name is now ${n}`)\n }", "title": "" }, { "docid": "84c5b568d9e699be99477dc5c1880819", "score": "0.44967353", "text": "function sendNameChange(){\n var nameChangeField = jQuery('#nameChangeField');\n var newName = jQuery.trim(nameChangeField.val());\n //If text is empty, don't bother sending\n if(newName !== ''){\n chatConnection.outputNameChange(newName);\n\n nameChangeField.val('');\n\n endNameChange();\n }\n }", "title": "" }, { "docid": "f7cca4f595c4c9eddc051e81780ea918", "score": "0.4490711", "text": "function nameSet() {\n var name = document.getElementById(\"nameInput\").value;\n var now = (new Date()).getTime();\n client.setClientName(name, now);\n removeById(\"enternametostarttext\");\n removeById(\"nameInput\");\n removeById(\"buttonInput\");\n}", "title": "" }, { "docid": "f90f98bebcca63599cbdc83d8001ba6e", "score": "0.44663316", "text": "function updateUsernames() {\n\t\tio.sockets.emit(messages.SEND_USERNAMES, {userlist: userNames});\n\t}", "title": "" }, { "docid": "61e5fb97b043f1be01a842a240d764dc", "score": "0.44532225", "text": "function handleNewAgentName() {\n (async () => {\n let nameCapture = await getAgentName();\n if(!nameCapture) return;\n pluginModule.project.agentName = nameCapture[0];\n })()\n}", "title": "" }, { "docid": "f286e57b8f6e8bea99a71e2373ce8c68", "score": "0.44470412", "text": "function setRemoteDescriptionSuccess(peerConnection) {\n setDescriptionSuccess(peerConnection, 'setRemoteDescription')\n}", "title": "" }, { "docid": "c612eabdd316bd28a3ed3bde61414248", "score": "0.44411048", "text": "excute () {\n\t\tthis.object.name = this.newName;\n\t\tSubmitObjPropsApis.submitMapProps(this.object.id, 'name', this.newName);\n\t}", "title": "" }, { "docid": "68e9e3e0fe4e97db7cd7e0c3f5564e87", "score": "0.44389406", "text": "function patchName (req, res, next) {\n return req.targetSeries\n .update({ name: req.query.name || null })\n .then(() => {\n next()\n return Promise.resolve()\n }).catch(error => next(error))\n}", "title": "" }, { "docid": "d7b22671275dac53dadf9eff17d43646", "score": "0.44383046", "text": "set name(value) {\n this._name = value;\n }", "title": "" }, { "docid": "d0b0b958fe41b7d316195c71ac0763a1", "score": "0.44296604", "text": "function updateLocal(path, local, remote) {\n logger.info('UPDATE', path, 'REMOTE -> LOCAL');\n store.setNodeData(path, remote.data, false, remote.timestamp, remote.mimeType);\n }", "title": "" }, { "docid": "5cdea1c8f97bdd764bcce3dc9f38be91", "score": "0.4411651", "text": "renameBoard() {\n let newName = document.getElementById('newBoardName').value;\n if (newName === '') {\n toast.error('❕ Choose a new name or cancel.')\n } else {\n this.saveChangedBoard(false, newName, false);\n this.closeRenameBoardModal();\n document.getElementById('newBoardName').value = '';\n }\n }", "title": "" }, { "docid": "9646b7775555073feb4b7ecc3ee4319c", "score": "0.44106114", "text": "set name(value){\n this.setName(value);\n }", "title": "" }, { "docid": "844ac5bd1fb3bf9a2052e9cdbb4ff441", "score": "0.4409036", "text": "function setRemoteDescriptionSuccess(peerConnection) {\n setDescriptionSuccess(peerConnection, 'setRemoteDescription');\n}", "title": "" } ]
9baedac68df943c3dd12feff4549a5a4
Set the width of the side navigation to 250px and the left margin of the page content to 250px
[ { "docid": "ab9ac7c56f8895eda50e2f6cd05b78ff", "score": "0.63897866", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"300px\";\n document.getElementById(\"main\").style.marginLeft = \"300px\";\n}", "title": "" } ]
[ { "docid": "a83204ebd9a93b5e8ee269b3d60457c2", "score": "0.6658318", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginRight = \"250px\";\n}", "title": "" }, { "docid": "abeaca0930b110f822ee16acd14d9d79", "score": "0.6655759", "text": "function openNav() {\r\n\t\tdocument.getElementById(\"mySidenav\").style.width = \"250px\";\r\n\t\tdocument.getElementById(\"main\").style.marginLeft = \"250px\";\r\n\t}", "title": "" }, { "docid": "5f4f9efabdea5f169c8bef2170c3c638", "score": "0.6644144", "text": "function openNav() {\r\n\tdocument.getElementById(\"mySidenav\").style.width = \"250px\";\r\n\tdocument.getElementById(\"main\").style.marginLeft = \"250px\";\r\n }", "title": "" }, { "docid": "3bf922b386dc83eaf68080b7abbeb6d8", "score": "0.6581011", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n // document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "78ebd09f51e8a6ac6a9b562d3a64a56d", "score": "0.65678006", "text": "function openNav() {\n \n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n \n \n }", "title": "" }, { "docid": "f9a7a69ae6625e49b471e99a4f928271", "score": "0.6565789", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"250px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n}", "title": "" }, { "docid": "4f11809828dc9e7d55343afec668eff3", "score": "0.65491205", "text": "function openNav() {\n\tdocument.getElementById(\"mySidebar\").style.width = \"250px\";\n\tdocument.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "aae8a786aac4f12862aaaf92f17e7f16", "score": "0.65142083", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "aae8a786aac4f12862aaaf92f17e7f16", "score": "0.65142083", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "aae8a786aac4f12862aaaf92f17e7f16", "score": "0.65142083", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "aae8a786aac4f12862aaaf92f17e7f16", "score": "0.65142083", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "1d261d6315c8b3703bfd96b10346722e", "score": "0.6491114", "text": "function openNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"200px\";\r\n document.getElementById(\"main\").style.marginright = \"200px\";\r\n}", "title": "" }, { "docid": "7bc8ba566128204ddde4c8a67642ad00", "score": "0.64871955", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"Main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "19605ca3a723d5049c3c926ff51e993d", "score": "0.64767265", "text": "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "0f58af3c830b344daf2aec438ce4eabf", "score": "0.64606947", "text": "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "706ecfb20d9a113045db13a89cef1cee", "score": "0.64150685", "text": "function openNav() {\n document.getElementById(\"sidebar\").style.width = \"320px\";\n document.getElementById(\"main\").style.left = \"320px\";\n}", "title": "" }, { "docid": "8be453c0df2d442d6700524bfc9b66c3", "score": "0.63865167", "text": "function openSideNav()\n{\n var w = window.innerWidth;\n if(w<600)\n {\n sideNav.style.width = '100%';\n fullScreenSideNav();\n }\n else if(w<992)\n {\n sideNav.style.width = '25%';\n main.style.width = '75%';\n }\n else\n {\n sideNav.style.width = '20%';\n main.style.width = '80%';\n }\n\n}", "title": "" }, { "docid": "055ecb9c3ac0b0185b8b889a57c88e54", "score": "0.63791364", "text": "function openNav() {\n const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n if (vw > 500) {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"header\").style.marginLeft = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.getElementById(\"footer\").style.marginLeft = \"250px\";\n document.getElementById(\"footer\").style.width = \"calc(100% - 250px)\";\n } else {\n document.getElementById(\"mySidebar\").style.width = \"100vw\";\n document.getElementById(\"header\").style.marginLeft = \"100vw\";\n document.getElementById(\"main\").style.marginLeft = \"100vw\";\n document.getElementById(\"footer\").style.marginLeft = \"100vw\";\n document.getElementById(\"footer\").style.width = \"0%\";\n }\n \n}", "title": "" }, { "docid": "7c879fbf81638103d43a30bd7a712097", "score": "0.63575035", "text": "function setMenuLeft() {\n\t\t\n\t\tl1 = $('#the_constructor_webapp').offset().left;\n\t\tw1 = $('#the_constructor_webapp').width();\n\t\t\n\t\t$('#the_constructor_links').css('float', 'left');\n\t\tw2 = $('#the_constructor_links').width();\n\t\t$('#the_constructor_links').css('float', 'none');\n\t\t\n\t\tw3 = $('.tc_wrapper').width();\n\t\t\n\t\tl2 = Math.round(l1 + w1/8 - w2/2);\n\t\t\n\t\t$('#the_constructor_links').css({'padding-left': l2+'px'});\n\t}", "title": "" }, { "docid": "bc151dc1df4ef988efab91a40f6af60b", "score": "0.6340963", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"250px\";\r\n }", "title": "" }, { "docid": "d3df156c36bd6f468bf1a84eb0f12755", "score": "0.63406765", "text": "function openSlideMenu() {\n document.getElementById('side-menu').style.width = '250px';\n document.getElementById('main').style.marginLeft = '250px';\n}", "title": "" }, { "docid": "f0e04a86e59ea22355cb7748082face5", "score": "0.63221526", "text": "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"100%\";\n document.getElementById(\"main\").style.marginLeft = \"100%\";\n}", "title": "" }, { "docid": "44006dd1d2857a39cd73d3b3196d888d", "score": "0.63126045", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n }", "title": "" }, { "docid": "44006dd1d2857a39cd73d3b3196d888d", "score": "0.63126045", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n }", "title": "" }, { "docid": "395e82b872d72a1b7547f3c3681daaba", "score": "0.63092697", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n }", "title": "" }, { "docid": "7b150a772b31dcf49996fde54f129bee", "score": "0.63068515", "text": "function openNav() {\n\t $(\"#side-menu\").css(\"width\", \"400px\");\n\t}", "title": "" }, { "docid": "e40726f6dae90754e71cdc2db6088dd9", "score": "0.630637", "text": "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"35%\";\n document.getElementById(\"main\").style.marginLeft = \"35%\";\n}", "title": "" }, { "docid": "5a8f7c5966885115ba2a8ce8f5a06023", "score": "0.6284821", "text": "function openNav() {\n document.getElementById(\"mySidepanel\").style.width = \"310px\";\n}", "title": "" }, { "docid": "62ecfc41f3bf73a7f7940f664969f23b", "score": "0.6284348", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"260px\";\n document.querySelector(\".main\").style.marginLeft = \"260px\";\n\n}", "title": "" }, { "docid": "105f85d4c13b483df1b8fff0ccc4f7f2", "score": "0.6269591", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n\tdocument.getElementById(\"index\").style.marginLeft = \"250px\";\n\tdocument.getElementById(\"navBar\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "a41b66d0594f088bbf20073c88424c10", "score": "0.6242672", "text": "function openNav() {\r\n if($(window).width()<780){\r\n document.getElementById(\"navigation\").style.width = \"100%\";\r\n document.getElementById(\"contenido-body\").style.marginLeft = \"100%\";\r\n }\r\n else{\r\n document.getElementById(\"navigation\").style.width = \"18%\";\r\n document.getElementById(\"contenido-body\").style.marginLeft = \"18%\";\r\n }\r\n document.getElementById(\"navicon\").style.opacity = \"0%\";\r\n }", "title": "" }, { "docid": "2bc62119d712b1c1dd0025e463e32e3d", "score": "0.62383944", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"260px\";\r\n}", "title": "" }, { "docid": "ca3c68f66c6ccaba32719b0c30da6a05", "score": "0.62114304", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"250px\";\r\n}", "title": "" }, { "docid": "eee2b5aa0ca4ba389b5f0a6ef6c5d341", "score": "0.62076795", "text": "function openNav() {\n document.getElementById(\"sensor-list\").style.width = \"250px\";\n document.getElementById(\"body\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "362fdd776b35a02333ef6506dcdf0482", "score": "0.6200077", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n }", "title": "" }, { "docid": "f4dd56db9a62b0f8450f30c30b78d69f", "score": "0.6190232", "text": "function openNav() {\n document.getElementById(\"mySidepanel\").style.width = \"250px\";\n}", "title": "" }, { "docid": "b8734ef37ab1da8ae9b92ca11f5c0df6", "score": "0.6162923", "text": "openNav() {\n document.getElementById(\"mySidenav\").style.width = \"200px\";\n }", "title": "" }, { "docid": "acbfe658a254e8d94062e93b000af8ea", "score": "0.6152358", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"230px\";\n //document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "title": "" }, { "docid": "e7c24d056c828d531e2b32cff85d86f8", "score": "0.61508405", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "e7c24d056c828d531e2b32cff85d86f8", "score": "0.61508405", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "e7c24d056c828d531e2b32cff85d86f8", "score": "0.61508405", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "e7c24d056c828d531e2b32cff85d86f8", "score": "0.61508405", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "6490c6b85344bfc621bab1a050cd7bd3", "score": "0.6141118", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"275px\";\n}", "title": "" }, { "docid": "4cc07344e36d1cf8f5d55676ea9e03e7", "score": "0.61357087", "text": "function openNav() {\n document.getElementById(\"build\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "701e2464dd70dec3ee4ecc47b6525cd4", "score": "0.6128751", "text": "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n // document.getElementById(\"main\").style.marginLeft = \"250px\";\n // document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "title": "" }, { "docid": "d63a179623e0d29f2bf66bc7ea9f9c9f", "score": "0.6128101", "text": "function navSizer() {\r\n\r\n if ($(window).width() > 900) {\r\n if (window.scrollY >= 170) {\r\n document.getElementById(\"navigation-bar-full\").style.padding = \"2rem 0\";\r\n document.getElementById(\"navigation-bar-full\").style.paddingBottom = \"0.5rem\";\r\n document.getElementById(\"navigation-bar-full\").style.background = \"#000000\";\r\n }\r\n else {\r\n document.getElementById(\"navigation-bar-full\").style.padding = \"3.2rem 0\";\r\n document.getElementById(\"navigation-bar-full\").style.background = \"transparent\";\r\n }\r\n }\r\n else {\r\n document.getElementById(\"navigation-bar-full\").style.padding = \"10px 0\";\r\n document.getElementById(\"navigation-bar-full\").style.background = \"#000000\";\r\n }\r\n\r\n const sideBarWidth = document.getElementById(\"nav-links\").style.width;\r\n\r\n if ((sideBarWidth == \"0px\") || (sideBarWidth == \"100%\")) {\r\n document.getElementById(\"nav-links\").style.width = \"\";\r\n }\r\n}", "title": "" }, { "docid": "9cfabbeb917ad98119acc6f213271a4b", "score": "0.61266863", "text": "function openNav() {\n $('.sidenav').css('width', '250px')\n}", "title": "" }, { "docid": "72f3145cbc481aba28b719de7e3b0182", "score": "0.61180747", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"150px\";\n }", "title": "" }, { "docid": "c51a4389c32a68d61bbedb5eef846199", "score": "0.61144954", "text": "function adjustWidth (x, unit = 'px') {\n setStyle(qs('.sidebar'), { width: x + 'px' })\n setStyle(qs('.main'), { marginLeft: x + 'px' })\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "a1f912dd5b19bc3fec26051b4a6d04d7", "score": "0.6112669", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "25a63d17d67b1259e69f75177e8b4eda", "score": "0.61091113", "text": "function CenterContent(width) {\r\n\tvar content = document.getElementById(\"content\");\r\n\t//if (hasReferences || hasToc || hasSeeAlso || hasExternalLinks) {\r\n\tif (hasCatLinks) {\r\n\t\tif (width == 'full') {\r\n\t\t\tcontent.style.maxWidth = \"\";\r\n\t\t\tcontent.style.marginLeft = \"\";\r\n\t\t\tdocument.getElementById(\"left-navigation\").style.marginLeft = \"\";\r\n\t\t} else if (width >= 0) {\r\n\t\t\tif (width > 0) {\r\n\t\t\t\tcontent.style.maxWidth = width + \"px\";\r\n\t\t\t}\r\n\t\t\t// Keep it center while resize by passing in width = 0\r\n\t\t\tvar offset = (document.body.offsetWidth - content.offsetWidth) / 2;\r\n\t\t\tcontent.style.marginLeft = offset + \"px\";\r\n\t\t\tdocument.getElementById(\"left-navigation\").style.marginLeft = offset + \"px\";\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "a419354413740a191adc215dc37981a9", "score": "0.6106662", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"160px\";\r\n}", "title": "" }, { "docid": "eac8561d62ccceb33fbb217c6517262f", "score": "0.6100544", "text": "function openDashboardSideNav() {\n if ($(document).width() < 991) {\n document.getElementById(\"dashboard-sidenav\").style.width = \"250px\";\n\n } else {\n document.getElementById(\"dashboard-sidenav\").style.width = \"250px\";\n document.getElementById(\"main-content\").style.marginLeft = \"250px\";\n }\n dashboardSieNavOpen = true;\n SetSideNavHeight();\n}", "title": "" }, { "docid": "ed3771208ec808f8c64bd25a4364e70b", "score": "0.60979575", "text": "function openNav() {\n document.getElementById(\"sideBar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "title": "" }, { "docid": "ff4825b69fb66c432349084776f86706", "score": "0.60932857", "text": "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n}", "title": "" }, { "docid": "94838d147fd0eb3044320a1599023b2a", "score": "0.6089776", "text": "function openNav() {\n if (open) {\n closeNav();\n return;\n }\n\n //document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n //document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n //document.getElementById(\"main\").style.backgroundColor = \"rgba(0,0,0,0.4)\";\n //document.getElementById(\"main\").style.left = \"250px\";\n open = true;\n}", "title": "" }, { "docid": "fb9f6034ff26c8fd3aa0d711893e4ed2", "score": "0.60842985", "text": "function openNav() {\n document.getElementById(\"mySidepanel\").style.width = \"120px\";\n}", "title": "" }, { "docid": "43a36bc4ca55805369247abe810c04ed", "score": "0.6067021", "text": "function openNav() {\n document.getElementById(\"side\").style.width = \"250px\";\n \n}", "title": "" }, { "docid": "ddaf7e8de299431da40b0de1e6c69f53", "score": "0.6064547", "text": "function setupMenu(){\r\n\r\n\tMENU = document.getElementById('sideNav');\r\n\tICON = document.getElementById('icon');\r\n\r\n\tMENU.style.width = MENU_WIDTH + 'px';\r\n\tMENU.style.left = (MENU_UNCOVERED - MENU_WIDTH) + 'px';\r\n\r\n}", "title": "" }, { "docid": "65b88f7a9dcc244976fc0b4e9b97e5c4", "score": "0.6060374", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n\n}", "title": "" }, { "docid": "b338f1be306f85655be583cd66472a59", "score": "0.6057422", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "title": "" }, { "docid": "b338f1be306f85655be583cd66472a59", "score": "0.6057422", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "title": "" }, { "docid": "7358d5376836b2dd51663a368706aba6", "score": "0.60570705", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"80px\";\n}", "title": "" }, { "docid": "445e51a0c188398f59ff6a7d1d1955b7", "score": "0.60557586", "text": "function openNav() {\n document.getElementById(\"sidenav\").style.width = \"250px\";\n}", "title": "" }, { "docid": "c8f259762e4f1dd9392ccf1a4baf76f5", "score": "0.60548776", "text": "function openNav() {\n let w = window.innerWidth;\n let dashboardWidth ;\n if (w > 600) dashboardWidth = \"250px\";\n else dashboardWidth = \"100px\";\n document.getElementById(\"mySidebar\").style.width = dashboardWidth;\n document.getElementById(\"main\").style.marginLeft = dashboardWidth;\n let board_tools = document.getElementById(\"btools\");\n board_tools.style.display = \"block\";\n}", "title": "" }, { "docid": "529a8e811a795bfd47caa9ffa3e0c162", "score": "0.60410607", "text": "function handleAside() {\n\n bodyMarginL = '0px';\n\n if (navIsVis == true) {\n bodyWidth = '100vw';\n asideMarginL = '0px';\n aSideWidth = asideSize;\n if (screenIsSmall.matches) {\n bodyWidth = '100vw';\n asideMarginL = '0px';\n aSideWidth = '100vw';\n }\n }else if (navIsVis == false) {\n bodyWidth = '100vw'; //'calc(100vw - '+asideSize+')';\n asideMarginL = '-'+asideSize+'';\n if (screenIsSmall.matches) {\n bodyWidth = '100vw';\n asideMarginL = '-100vw';\n\n }\n }\n if (screenIsBig.matches) {\n bodyWidth = '100vw';\n asideMarginL = '0px';\n aSideWidth = asideSize;\n }\n\n if (navIsVis) {\n aSideZ = 1500;\n } else {\n aSideZ = 500;\n }\n\n document.querySelector(siteClass).style.width = bodyWidth;\n document.querySelector(contentClass).style.marginLeft = bodyMarginL;\n document.querySelector(navClass).style.marginLeft = asideMarginL;\n document.querySelector(navClass).style.width = aSideWidth;\n document.querySelector(navClass).style.zIndex = aSideZ;\n}", "title": "" }, { "docid": "4d032975a8d4d887d5b310026f1edeca", "score": "0.6037286", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "title": "" }, { "docid": "807865d914ddfa7a8f3b5f30ca276d3b", "score": "0.60367644", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"200px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\r\n}", "title": "" }, { "docid": "807865d914ddfa7a8f3b5f30ca276d3b", "score": "0.60367644", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"200px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\r\n}", "title": "" }, { "docid": "39f4f1a29fe4d022325439a275c8e3c0", "score": "0.6035918", "text": "function setMarginRight() {\n\n if (window.matchMedia(\"(min-width: 480px)\").matches) {\n var filtersLeft = $(\"#openFiltersNav\");\n var offsetLeft = filtersLeft.position().left;\n $(\"#toolsNav\").css({\n \"left\": offsetLeft - 16,\n \"top\": \"50px\",\n \"position\": \"absolute\",\n \"display\": \"block\",\n \"overflow-y\": \"auto\"\n });\n }\n }", "title": "" }, { "docid": "1357dbe5a741f2adb875515062cca5be", "score": "0.60233986", "text": "function openMenu() {\n var menuBox, mainBox, headerBox, first, second, leaveMe;\n menuBox = document.getElementsByTagName(\"aside\");\n contentBox = document.getElementById(\"content\");\n mainBox = document.getElementById(\"main\");\n headerBox = document.getElementsByTagName(\"header\");\n first = document.getElementById(\"firstBlock\");\n second = document.getElementById(\"headBlock\");\n leaveMe = document.getElementById(\"leavingWrapper\");\n if (document.documentElement.clientWidth < 769) {\n menuBox[0].style.cssText += \"margin-left: 0px;\";\n first.style.marginLeft = \"0px\";\n second.style.marginLeft = \"0px\";\n\t\t\n } else {\n menuBox[0].style.cssText += \"margin-left: 0px;\";\n first.style.marginLeft = \"0px\";\n second.style.marginLeft = \"0px\";\n mainBox.style.marginLeft = \"300px\";\n leaveMe.style.marginLeft = \"300px\";\n }\n}", "title": "" }, { "docid": "481b9d789e1114266028f2625d189220", "score": "0.60152435", "text": "function adjustMainContentsDiv() {\r\n var navPane = $('[id$=\"leftPane\"]')[0],\r\n dW = $('[id$=\"mainContents\"]')[0];\r\n if (navPane) {\r\n dW.style.width = 'auto';\r\n }\r\n else {\r\n dW.style.width = '100%';\r\n dW.style.margin = '0 auto';\r\n dW.style.textAlign = 'center';\r\n }\r\n}", "title": "" }, { "docid": "0d770535dcefd0293783e9eba46636f8", "score": "0.6012593", "text": "function openNav() {\n // alert('ya')\n document.querySelector('.irene-side-nav').style.width = '250px'\n }", "title": "" }, { "docid": "bb79eecd09715f76c37a2de22af6fab5", "score": "0.60114855", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"300px\";\n}", "title": "" }, { "docid": "45896a2a0e27eaffca79aed573fd36bf", "score": "0.59956354", "text": "function navOpen() {\r\n nav.style.width = '250px';\r\n}", "title": "" }, { "docid": "88500bff23f7993dea8a0b69031eda1a", "score": "0.5992245", "text": "function openSlideMenu() {\n elements.sideMenu.style.width = '200px';\n}", "title": "" }, { "docid": "b2dea10aff58b84344be8f6f849327c0", "score": "0.5985869", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"mainnav\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "title": "" }, { "docid": "bc8be0086db80520e3a3439c8da3b875", "score": "0.59617", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"350px\";\n\n}", "title": "" }, { "docid": "083499e6554cf5e2b4b447f5e092b65b", "score": "0.59598863", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"70%\";\n\n\n }", "title": "" }, { "docid": "357b833409189c8c3a9f186990638a0d", "score": "0.59558064", "text": "function openNav() {\n document.getElementById(\"sidebar\").style.width = \"250px\";\n document.getElementById(\"sidebar\").style.marginLeft = \"0\";\n // document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "title": "" }, { "docid": "cc559f1aff327e25d720d5fc33649c1c", "score": "0.5945096", "text": "function openNav() {\n $(\"#mySidenav\").removeClass(\"sidenav-hidden\").addClass(\"sidenav-visible\");\n $(\"#main\")[0].style.marginLeft = \"20%\";\n}", "title": "" }, { "docid": "ae3807c08edc1ce4a4668c34e9ad5106", "score": "0.59267986", "text": "function setStaticSidebar() {\n sticky.el.css({\n 'position': 'static',\n 'margin-left': '0px'\n });\n settings.contentID.css('margin-left', '0px');\n }", "title": "" }, { "docid": "515e35cb6364aeef3f1c181c23bc332b", "score": "0.5922204", "text": "function navigationStikcy(){\r\n \r\n var offsetByWidth = 0;\r\n \r\n if(width < widthIPad)\r\n offsetByWidth = 60;\r\n $(\"#navigation\").containedStickyScroll({\r\n duration: 0,\r\n unstick: true, \r\n closeChar: '',\r\n stickElementOffset : 120 - offsetByWidth, \r\n }); \r\n if($(\"#brands\").length){ \r\n $(\"#brands\").containedStickyScroll({\r\n duration: 0,\r\n unstick: true,\r\n closeTop : 200, \r\n closeChar: '', \r\n stickElementOffset : 120 - offsetByWidth,\r\n });\r\n }\r\n\r\n }", "title": "" }, { "docid": "ae1cccf3436bca0ecbec22f188514497", "score": "0.59202754", "text": "function MessagesMenuWidth(){\n\tvar W = window.innerWidth;\n\tvar W_menu = $('#sidebar-left').outerWidth();\n\tvar w_messages = (W-W_menu)*16.666666666666664/100;\n\t$('#messages-menu').width(w_messages);\n}", "title": "" }, { "docid": "ae1cccf3436bca0ecbec22f188514497", "score": "0.59202754", "text": "function MessagesMenuWidth(){\n\tvar W = window.innerWidth;\n\tvar W_menu = $('#sidebar-left').outerWidth();\n\tvar w_messages = (W-W_menu)*16.666666666666664/100;\n\t$('#messages-menu').width(w_messages);\n}", "title": "" }, { "docid": "733b506af614031a56bc49b55da0234f", "score": "0.58952427", "text": "function openSidebar() {\r\n document.getElementById(\"mySidebar\").style.width = \"500px\";\r\n getPreferences();\r\n}", "title": "" }, { "docid": "a9c170a3a35846d43bf945a487cfe3e8", "score": "0.58942115", "text": "function openNav() {\n $(\"#mySidenav\").css(\"width\", \"100%\");\n}", "title": "" }, { "docid": "2ca3a219715f97c76116d9a730727c85", "score": "0.5891504", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"60%\";\n}", "title": "" }, { "docid": "81717d338121797b99d16204cbd044bc", "score": "0.5890469", "text": "function centerPage() {\n if (style) {\n head.removeChild(style);\n style = null;\n }\n\n var windowWidth = window.innerWidth;\n if (windowWidth <= mobileScreenWidth) {\n return;\n }\n\n var leftMargin = Math.max(0, (windowWidth - sideWidth - contentWidth) / 2);\n var scrollbarWidth = document.body ? windowWidth - document.body.clientWidth : 0;\n var css = '';\n\n css += '.wy-nav-side { left: ' + leftMargin + 'px; }';\n css += \"\\n\";\n css += '.wy-nav-content-wrap { margin-left: ' + (sideWidth + leftMargin) + 'px; }';\n css += \"\\n\";\n css += '.github-corner > svg { right: ' + (leftMargin - scrollbarWidth) + 'px; }';\n css += \"\\n\";\n\n var newStyle = document.createElement('style');\n newStyle.type = 'text/css';\n if (newStyle.styleSheet) {\n newStyle.styleSheet.cssText = css;\n } else {\n newStyle.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(newStyle);\n style = newStyle;\n }", "title": "" }, { "docid": "8071a8b254eb71b1f1bece0d126e87e6", "score": "0.5888311", "text": "function show()\n {\n _$divSideNav.width(250);\n }", "title": "" }, { "docid": "64adcc8e61c161c11238d8acebfe188b", "score": "0.5869636", "text": "function openNav() \n{\n document.getElementById(\"mySidenav\").style.width = \"32%\";\n document.getElementById(\"push\").style.marginLeft = \"32%\";\n document.getElementById(\"menuImage\").style.display = \"none\";\n document.getElementById(\"titleText\").style.display = \"none\";\n}", "title": "" } ]
8b915bf30bb3ad59f994e84612a5c700
callback function that receives our data
[ { "docid": "7c7a3c89f8d5820bab02f2091fa5a42e", "score": "0.0", "text": "function gotPageOfWines(records, fetchNextPage) {\r\n console.log(\"gotPageOfWines() ---> 1\");\r\n // add the records from this page to our array\r\n wines.push(...records);\r\n // request more pages\r\n fetchNextPage();\r\n }", "title": "" } ]
[ { "docid": "bfe93ff504267a106d5d1eeb711f3baa", "score": "0.7858733", "text": "function callback(data) {\n\t\t\t\n\t}", "title": "" }, { "docid": "1e2615063fb4c419779092175b5e0e11", "score": "0.7775853", "text": "function gotData() {\n \n}", "title": "" }, { "docid": "1001c3e9fdd209520c53d1374d765c13", "score": "0.7449657", "text": "function getDataCallback(data, init) {}", "title": "" }, { "docid": "5001fb3ee098f38bddc32bdf622ad951", "score": "0.7362156", "text": "makeData (callback) {\n\t\tcallback();\n\t}", "title": "" }, { "docid": "565e445522c1d962db95013b41bd458b", "score": "0.7360463", "text": "onData(data) { }", "title": "" }, { "docid": "c54016257fda576bbd4d2d4a6af51edd", "score": "0.73013", "text": "function readCallback(data) {\n return \"Data: \" + data.toString();\n}", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.71145755", "text": "function callback(){}", "title": "" }, { "docid": "f11d710e6351fbad22aa67d3f042f4cc", "score": "0.7093339", "text": "function update_data(callback) {\n \n callback();\n }", "title": "" }, { "docid": "17489a0e180c121bbbb59c156632650a", "score": "0.7056422", "text": "recieveData(data){}", "title": "" }, { "docid": "f096e9549866e314a2263129c630de4d", "score": "0.6812727", "text": "function onData(data) {\n console.log(\"onData\", data);\n}", "title": "" }, { "docid": "da95cf568f7741a0a6a28762a5ed2549", "score": "0.6690303", "text": "function callback(data) {\n\n\t latlng = data; // store the array of data in a global for later use\n\t fitBounds(latlng); // then invoke fitBounds to zoom and display markers\n\t setInfoWindowListener(latlng);\n\t populateTable();\n\t}", "title": "" }, { "docid": "8ae79ee1d80c0df79339c8b8d25f2f0d", "score": "0.66521907", "text": "function callBack(myData){\n\n\t//print the entire data object\n\tconsole.log(myData);\n\n\t//find a specific piece of data\n\tvar movieTitle = myData[0].title;\n\tconsole.log(movieTitle);\n\tvar movieDesc = myData[0].description;\n\tconsole.log(movieDesc);\n\tvar movieDate = myData[0].release_date;\n\tconsole.log(movieDate);\n\n}", "title": "" }, { "docid": "c0453270c31ec693f5a05ab0d5fb9c85", "score": "0.6630135", "text": "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "title": "" }, { "docid": "c0453270c31ec693f5a05ab0d5fb9c85", "score": "0.6630135", "text": "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "title": "" }, { "docid": "507f77a19de42f6e83db2d135e1010c4", "score": "0.6576518", "text": "function dataProcessed(data) {\n // Todo Start: Add Codes Here\n\n // Todo End\n\n return data;\n }", "title": "" }, { "docid": "d0d3076e5213b541037bde6273863566", "score": "0.6570529", "text": "function dataCallBackUmbrella(data) \n{\n\tconsole.log(\"Umbrella Data received\", data);\n\tdisplayUmbrellas(data);\n}", "title": "" }, { "docid": "d1bed573accb67ff33fa3a8ea07d08f4", "score": "0.6550584", "text": "onDataReceivedHandler(data) {\n /*\n All received data is appended to a ReceiveBuffer.\n This makes sure that all the data we need is received before we attempt to process it.\n */\n this.receiveBuffer.append(data);\n // Process data that we have.\n this.processData();\n }", "title": "" }, { "docid": "d1bed573accb67ff33fa3a8ea07d08f4", "score": "0.6550584", "text": "onDataReceivedHandler(data) {\n /*\n All received data is appended to a ReceiveBuffer.\n This makes sure that all the data we need is received before we attempt to process it.\n */\n this.receiveBuffer.append(data);\n // Process data that we have.\n this.processData();\n }", "title": "" }, { "docid": "4d3d67b18de84164652e3a97a330bffe", "score": "0.6523723", "text": "onData(name, data) {\n this._loaded += 1;\n this._data[name] = data;\n let total = Object.keys(this._data).length;\n let loaded = (total && this._loaded === total);\n let hascb = (typeof this._cb === 'function');\n if (loaded && hascb) this._cb(total);\n }", "title": "" }, { "docid": "dd4bcfa7f9cdf8b395f342f1e10a52b3", "score": "0.65054953", "text": "function collectData() {}", "title": "" }, { "docid": "8b5bbbeb23b442a048e8d426518c8fc8", "score": "0.65041476", "text": "function receiveData(data) {\n console.log('data was received succefuly');\n console.log(data);\n visualiseData_1(data[0]);\n visualiseData_2(data[1]);\n visualiseData_3(data[2]);\n visualiseData_4(data[3]);\n}", "title": "" }, { "docid": "68d2cc2709b278d783d2acdb667f0db2", "score": "0.6503605", "text": "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "title": "" }, { "docid": "41f6d5939d5dc5a9f0bb074b804d5bd1", "score": "0.6499843", "text": "function callbackFunction(){\n const data = {\n name: 'Ralf Machio', \n age: 66, \n occupation: 'kickboxing'\n }\n return data;\n}", "title": "" }, { "docid": "476315a5a820da70c21d6d0da163b800", "score": "0.6499425", "text": "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "title": "" }, { "docid": "476315a5a820da70c21d6d0da163b800", "score": "0.6499425", "text": "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "title": "" }, { "docid": "476315a5a820da70c21d6d0da163b800", "score": "0.6499425", "text": "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "title": "" }, { "docid": "476315a5a820da70c21d6d0da163b800", "score": "0.6499425", "text": "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "title": "" }, { "docid": "476315a5a820da70c21d6d0da163b800", "score": "0.6499425", "text": "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "title": "" }, { "docid": "476315a5a820da70c21d6d0da163b800", "score": "0.6499425", "text": "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "title": "" }, { "docid": "c78893831a776b750bf070babd2b273d", "score": "0.6496704", "text": "function printDataCallback() {\n callbackFunction((err, data) => {\n console.log(data);\n });\n}", "title": "" }, { "docid": "e7d72c4e1ef6d2ea9ee289cdf33e4252", "score": "0.6489311", "text": "_onData(data) {\n while (this._process) {\n switch (this._state) {\n case STATE_HEADER:\n this._getHeader();\n break;\n case STATE_PAYLOAD:\n this._getPayload();\n break;\n }\n }\n }", "title": "" }, { "docid": "d971e7f649ee58a313baee647cb58efc", "score": "0.64859104", "text": "onReceiveSeriesData() {}", "title": "" }, { "docid": "082ae5c0cf9b9d308ec8bf6f2ad7643b", "score": "0.6479625", "text": "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "title": "" }, { "docid": "cb66cef4f589c85cdb4f65845bef7f4a", "score": "0.64751995", "text": "function callback(data) {\n callback_reached = true;\n clearTimeout(timer_handle);\n $('#callback_check').html('<span class=\"j-success\">PASSED</span>. Callback has executed.');\n try {\n var resulting_Json;\n if ( typeof data === 'function' ) {\n throw new Error('Cannot pass function into callback.')\n }\n else if ( typeof data === 'undefined') {\n throw new Error('No data passed to callback.')\n }\n else if ( typeof data === 'string' ) {\n try {\n resulting_Json = JSON.parse(data);\n }\n catch (err) {\n throw new Error(\"Invalid JSON data passed to callback. \"+err);\n }\n }\n else {\n resulting_Json = data;\n }\n\n // display output\n $('#tx_output').val(JSON.stringify(data, null, 2));\n \n\n // validate activity stream JSON\n validateSchema(data);\n\n // if we got here, then we passed\n $('#validation_check').html('<span class=\"j-success\">PASSED</span>. Data format is valid.');\n\n } catch (err) {\n $('#validation_check').html('<span class=\"j-fail\">FAILED</span>. '+err+\n '<br/><br/>For help, refer to <a href=\"https://community.jivesoftware.com/docs/DOC-157511\">Developing Simple Stream Integrations</a> in the Jive Community. This document provides the JSON schema for simple stream integrations.');\n }\n }", "title": "" }, { "docid": "47db1c4221b6466cc26f5d3cb9c62bfc", "score": "0.64705527", "text": "function callback(err, data) {\n if (_callback) {\n _callback(err, data);\n _callback = null;\n }\n }", "title": "" }, { "docid": "cea47ec39ad51b01afd13592adb18dfa", "score": "0.6447613", "text": "function callbackFunction(){\n const data = {\n name: 'Ralf Machio',\n age: 66,\n occupation: 'kickboxing'\n }\n return data;\n}", "title": "" }, { "docid": "d1aa8f63d270178ec6f6c4409841cfff", "score": "0.6430211", "text": "function gotData(data) {\n //print(data);\n //hold our data so we can use it in draw\n temp = data;\n\n}", "title": "" }, { "docid": "8bd28d89f1255c491a8001ae2e3879b0", "score": "0.6428075", "text": "function collectData( callback ) {\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"php/library/urenoverzicht-api.php\",\r\n data: {},\r\n success: function( data ) {\r\n var result = JSON.parse( data );\r\n callback( result );\r\n }\r\n });\r\n}", "title": "" }, { "docid": "e2d1bc6f2f203c48d77de91d415e691d", "score": "0.6422838", "text": "function callback(data) {\n data.split('\\n').forEach(function(n) {\n var row = n.split(',');\n if (row[0] === 'S') {\n Station.idToName[row[1]] = row[3];\n if (Station.list[row[3]]) {\n Station.list[row[3]].id = row[1];\n }\n } else if( row[0] === 'M' ) {\n Station.chanellIdtoName[row[1]] = row[2];\n var but = $('<li channelID='+row[1]+'><a href=\"#\">'+row[2]+'</a></li>');\n but.on('click', function(){\n var channelID = $(this).attr('channelID');\n $(this).parent().find('.active').removeClass('active');\n $(this).addClass('active');\n Station.activChanelId = +channelID;\n getStationMetrics();\n $('#metric-title').html(Station.chanellIdtoName[channelID]);\n })\n $('#metrics-channals').append(but);\n\n if (Station.list[row[3]]) {\n Station.list[row[3]].id = row[1];\n }\n }\n });\n console.log(data);\n getStationMetrics();\n }", "title": "" }, { "docid": "5d576e8fb9c7ecd4360e29b007ab82dc", "score": "0.6417295", "text": "function callback(error, data){\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t} else {\n\t\t\t\tconsole.log(data);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "843693765d2a9d54f7961935a88f78b9", "score": "0.63856626", "text": "_doOnData(data) {\n\t\tthis.options.onData(data);\n\n\t\tfor (var i = this.callbacks.onData.length - 1; i >= 0; i--) {\n\t\t\tthis.callbacks.onData[i](data);\n\t\t}\n\t}", "title": "" }, { "docid": "de210cf6c33b7bfa15a895df536d0878", "score": "0.6382848", "text": "function readCallback(error, data){\n if(error){\n return console.error(error);\n }\n console.log(data);\n}", "title": "" }, { "docid": "68da813d556ac6d6db064332bb2d1920", "score": "0.6377431", "text": "function callback(data)\n \t {\n\n \t \t latlng = data; // store the array of data in a global for\n\t\t\t\t\t\t\t\t\t// later use\n \t \t fitBounds(latlng); // then invoke fitBounds to zoom and\n\t\t\t\t\t\t\t\t\t\t// display markers\n \t \t setInfoWindowListener(latlng);\n \t }", "title": "" }, { "docid": "42400ef48887c9a170bee01ca8cda792", "score": "0.63482904", "text": "function readInDataCallback() {\n createMap(function() {\n console.log(\"createMap for POI callback\");\n });\n setDataSpecificDOM();\n svgChart = d3.select(chartSelector);\n //updateCurrentTripModeOrClassification();\n createEmptyChart();\n initializeMuchOfUI();\n } //end readInDataCallback", "title": "" }, { "docid": "a790a928eb8786067e26adad58e37618", "score": "0.63435304", "text": "function reachabilityNotificationProcessor(data){\n\n reachabilityData=data;\n console.log(\"Reachablitliy callback: \", data)\n}", "title": "" }, { "docid": "075f0ef9798c884148e5dfad4b7aaf4d", "score": "0.6328918", "text": "function callback() {\n\t}", "title": "" }, { "docid": "81f570e6ae715ce593e4f9bc0d98278c", "score": "0.6322553", "text": "function process(data) {}", "title": "" }, { "docid": "4b2d8255aec8732459651b3d943551c2", "score": "0.6302198", "text": "function dataCallBackSunGlasses(data)\n{\n\tconsole.log(\"Sunglasses Data received\", data);\n\tdisplaySunglasses(data);\n}", "title": "" }, { "docid": "a10d81de6b302e11711a8476524fc0ef", "score": "0.6286023", "text": "function appxsocket_onDataCallback(data) {\r\n\t\t\t\t// push data from the server onto the clients buffer(an array)\r\n\t\t\t\tif (appxIsToJsonAnArray) {\r\n\t\t\t\t\tappxprocessor.rtndata = appxprocessor.rtndata.concat(data.toJSON(), new Array());\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tarrayPush.apply(appxprocessor.rtndata, Buffer.from(data));\r\n\t\t\t\t}\r\n\t\t\t\t// if we have received enough bytes to satify the next parser request\r\n\t\t\t\t// run the parser before receiving any more data.\r\n\t\t\t\tif (appxprocessor.needbytes <= appxprocessor.rtndata.length || appxprocessor.rtndata.length >= appxprocessor.maxByteSize || (appxprocessor.rtndata.length + appxprocessor.byteCount) >= appxprocessor.needbytes ) {\r\n\t\t\t\t\tvar prcd;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tprcd = appxprocessor.appxprocessmsg();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (ex) {\r\n\t\t\t\t\t\tlogactivity(\"appxprocessmsg() failed, ex=\" + ex);\r\n\t\t\t\t\t\tdlog(ex.stack);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "title": "" }, { "docid": "55c7f28b08471b20a08f620336c9adeb", "score": "0.62633115", "text": "getData() {}", "title": "" }, { "docid": "e83757c7b064f747de65a5bdf261fba4", "score": "0.6261889", "text": "function cb_got_data(e, index){\n\t\tif(e !== null) console.log('[ws error] did not get index:', e);\n\t\telse{\n\t\t\ttry{\n\t\t\t\tvar json = JSON.parse(index);\n\t\t\t\tvar keys = Object.keys(json);\n\t\t\t\tvar concurrency = 1;\n\n\t\t\t\t//serialized version\n\t\t\t\tasync.eachLimit(keys, concurrency, function(key, cb) {\n\t\t\t\t\tconsole.log('!', json[key]);\n\t\t\t\t\tchaincode.query.read([json[key]], function(e, data) {\n\t\t\t\t\t\tif(e != null) console.log('[ws error] did not get data:', e);\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif(marble) sendMsg({msg: 'data', e: e, data: JSON.parse(data)});\n\t\t\t\t\t\t\tcb(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, function() {\n\t\t\t\t\tsendMsg({msg: 'action', e: e, status: 'finished'});\n\t\t\t\t});\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\tconsole.log('[ws error] could not parse response', e);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "f75cbd3571151a6ab24db65ff387ef96", "score": "0.6253938", "text": "function callback(data) {\n\n latlng = data; // store the array of data in a global for later use\n fitBounds(latlng); // then invoke fitBounds to zoom and display markers\n setInfoWindowListener(latlng);\n allResidences();\n}", "title": "" }, { "docid": "8d6d1bb7399f6254ad9b077a5088550e", "score": "0.6244374", "text": "function callback2(data_event){\n // console.log('data callback2',data_event.toString());\n console.log(data_event.toString());\n}", "title": "" }, { "docid": "ec6ad0c7ec2d07dd9a783f8c4e00aabe", "score": "0.62368214", "text": "static ReceiveData(obj) {\n if (viewer) {\n\n if (obj.action == \"rotate\") {\n PanoramaLoader.Rotate(obj.position);\n }\n\n if (obj.action == \"zoom\") {\n PanoramaLoader.Zoom(obj.level);\n }\n\n if (obj.action == \"markerClicked\") {\n PanoramaLoader.OnMarkerClicked(obj.data);\n }\n\n if (obj.action == \"closePanel\") {\n PanoramaLoader.HidePanel();\n }\n }\n }", "title": "" }, { "docid": "616a0918ddd93b636d2b7994724001b0", "score": "0.6231276", "text": "function Setreponse_callback(res) {\r\n\tsetData(res); \r\n}", "title": "" }, { "docid": "8856f12656a76fed3ecb65aeeac54eca", "score": "0.6224948", "text": "getData(){}", "title": "" }, { "docid": "1d66fd9407090387198b3fefbb5e6c1d", "score": "0.622006", "text": "function gotRawData(thedata) {\n\tprintln(\"gotRawData\" + thedata);\n}", "title": "" }, { "docid": "3884f982ba77d0325a7e818036e3d321", "score": "0.6172099", "text": "function onDataReceived(data){\r\n\t\t\t\t\tintermediateResults = intermediateResults.concat(data.results);\r\n\t\t\t\t\tjobFinish++;\r\n\t\t\t\t\tdownloadTime += data.time.download;\r\n\t\t\t\t\tmapTime += data.time.map;\r\n\t\t\t\t\tevents.progress(jobFinish / jobs.length * 100, {\r\n\t\t\t\t\t\ttime : (new Date() - timeStart),\r\n\t\t\t\t\t\tdownload : downloadTime,\r\n\t\t\t\t\t\tmap : mapTime\r\n\t\t\t\t\t});\r\n\t\t\t\t\tif(jobs.length == jobFinish){\r\n\t\t\t\t\t\tfunction groupBy(list) {\r\n\t\t\t\t\t\t\tvar ret = [];\r\n\t\t\t\t\t\t\tfor (var i in list) {\r\n\t\t\t\t\t\t\t\tvar key = list[i].key;\r\n\t\t\t\t\t\t\t\tvar value = list[i].value;\r\n\t\t\t\t\t\t\t\tif (!ret[key]) {\r\n\t\t\t\t\t\t\t\t\tret[key] = [];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tret[key].push(value);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn ret;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar groups = groupBy(intermediateResults);\r\n\t\t\t\t\t\tfor(var key in groups) {\r\n\t\t\t\t\t\t\tvar values = groups[key];\r\n\t\t\t\t\t\t\tresults.push(args.reduce(key, values));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tevents.finish(results);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "title": "" }, { "docid": "f49e9e56f5a722d649c2aefee3b4c543", "score": "0.6154018", "text": "function callback(data)\n{\n\n\t latlng = data; // store the array of data in a global for later use\n\t fitBounds(latlng); // then invoke fitBounds to zoom and display markers\n\t setInfoWindowListener(latlng);\n}", "title": "" }, { "docid": "0dd8c945d023d7b80ef8ce0602ee26f7", "score": "0.61532474", "text": "function onDataLoaded(data) {\r\n\t\tfor(var i=0; i<data.length; i++) {\r\n\t\t\tself.messages.push(data[i]);\r\n\t\t\tself.writeItem(data[i]);\r\n\t\t}\r\n\t\tdispatchCall();\r\n\t}", "title": "" }, { "docid": "ef18bad3d97005d8a232391f9dbcbdee", "score": "0.6149219", "text": "function getJSONDataCallback( readResult ) {\n fsDebug && console.log( \"LocalFS.getJSONDataCallback: Returning JSON data\" );\n readJSONSuccessCallback( readResult.target.result );\n }", "title": "" }, { "docid": "3f7937d87982c7752750f6d32985fc63", "score": "0.6113794", "text": "function callback ( data ) {\n\tlatlng = data; // store the array of data in a global for later use\n\tfitBounds( latlng ); // then invoke fitBounds to zoom and display markers within view\n\tsetInfoWindowListener( latlng );\n}", "title": "" }, { "docid": "adae44fa0e666288cd3c19807a5f6933", "score": "0.61111385", "text": "function getData( args, callback ) {\r\n\t\t$('.msgUpdateSeatingChart').html(\"Processing...\");\r\n\t\t$.ajax({\r\n\t\t\turl: googleScriptURL,\r\n\t\t\tdata: args,\r\n\t\t\ttype: 'POST',\r\n\t\t\tdataType: 'json'\r\n\t\t}) \r\n\t\t.done(function( studentInfoArray ) {\r\n\t\t\tcallback( studentInfoArray );\r\n\t\t\t$('.msgUpdateSeatingChart').html(\" &nbsp; \");\t\t\r\n\t\t})\r\n\t\t.fail(function( studentInfoArray ){\r\n\t\t\t$('.msgUpdateSeatingChart').html(\"Error - reload Page.\");\r\n\t\t});\r\n\t\r\n\t}", "title": "" }, { "docid": "c0c2df22346b66166fec9bd248bfb48d", "score": "0.6110777", "text": "function mycallback(JSONdata) {\n /* In order to parse data, we have to know the structure of data from server in advance */\n\n /* show returned data */\n var infoElm = document.getElementById('info');\n infoElm.innerHTML = 'input1: ' + JSONdata[0]['input1'] + '<br />';\n infoElm.innerHTML += 'input2: ' + JSONdata[1]['input2'] + '<br />';\n infoElm.innerHTML += JSONdata[2] + '<br />';\n infoElm.innerHTML += JSONdata[3] + '<br />';\n}", "title": "" }, { "docid": "c2bed33791d02cec70da51b70343d446", "score": "0.61062014", "text": "function handleGetData(data) {\n if (data == undefined) {\n return;\n }\n console.log(data);\n addFlights(data);\n addRows(data);\n\n}", "title": "" }, { "docid": "2df166030e0c07feaf9bad33c45101f2", "score": "0.6088342", "text": "function dataChangeCallback(){\n\t// set color scale\n\tColor.updateScale();\n\t// update chart (and eventually map, from chart.js)\n\tChart.updateChart();\n\t// resize chart once data is loaded\n\tChart.resizeTable();\n\t// update meta\n\tMenu.updateDownloadLinkMeta();\n}", "title": "" }, { "docid": "a42834546fc69a9fe68763068e8cbe5a", "score": "0.60786337", "text": "processCallbackData() {\n\t\tconst {\n\t\t\tdata,\n\t\t\trequestDataToState,\n\t\t} = this.props;\n\n\t\tif ( data && ! data.error && 'function' === typeof requestDataToState ) {\n\t\t\tthis.setState( requestDataToState );\n\t\t}\n\t}", "title": "" }, { "docid": "f118bf5d7b941117faa10a717c071d96", "score": "0.6072917", "text": "function callback(result) { \n}", "title": "" }, { "docid": "17ccebe6476950c05497341f1f0b4cd9", "score": "0.604967", "text": "loadData () {}", "title": "" }, { "docid": "0a9aced01621e8f0b396af269d4fcce0", "score": "0.6047523", "text": "handler(data, connection, next) {\n next();\n }", "title": "" }, { "docid": "e02baead582768a1db8eec2d7af23a51", "score": "0.6044545", "text": "function receive (err, data) {\n // Define what happens in case of error\n if (this.readyState != XMLHttpRequest.DONE)return;\n if (neatReport || this.status == 200) {\n funcRef(this);\n } else {\n // Define what happens in case of error\n alert('Oops! Something went wrong.');\n }\n }", "title": "" }, { "docid": "c7bd3bcf1d483fce9b3109136c617042", "score": "0.604213", "text": "function callback (response) {\n response.on(\"data\", callback2);\n}", "title": "" }, { "docid": "472079a163285ab8966f71f89df259c6", "score": "0.6033373", "text": "detail(...args) {\n callback(...args);\n }", "title": "" }, { "docid": "5729c59a29d68f8462b09828bee7fd57", "score": "0.60333097", "text": "makeTestData (callback) {\n\t\tthis.modifiedAfter = Date.now();\n\t\tthis.marker = this.postData[0].markers[this.deletedMarkerIndex];\n\t\tthis.codemark = this.postData[0].codemark;\n\t\tthis.path = `/markers/${this.marker.id}`;\n\t\tcallback();\n\t}", "title": "" }, { "docid": "f834a6adfeaa62ffc9502c8bd1125ef8", "score": "0.60304445", "text": "function onLoadedData() {\n\t\tonTimeChange();\n\t\tonVolumeChange();\n\t}", "title": "" }, { "docid": "58aa966d0b902b13ac523e99c53fabb6", "score": "0.6021054", "text": "function processData(input) {\n //Enter your code here\n parse(input);\n}", "title": "" }, { "docid": "4b49347bd734446f1ed1e6f9d90cf7b7", "score": "0.6020435", "text": "received(data) {\n messages.append(data['message']);\n return messages_to_bottom();\n }", "title": "" }, { "docid": "3a782c9e0ee1d70b69a573ae30da64e0", "score": "0.60126495", "text": "function callbackPapaparse( results) {\n\t /*maxIndex = results.data.length; \n\t dataArray = results.data;\n\t for (var i=0;i<maxIndex;i++)\n\t {\n\t\tvar element = dataArray[i];\n\t\tvar dest = element.Adresse + \",\" + element.CODPOST + \" \" + element.Ville;\n\t\t calculateDistances(myorigin);\n\t }*/\n\t \n\t maxIndex = results.data.length; \n\t dataArray = results.data;\n\t console.log(dataArray);\n\t callASyncCalDistance();\n\n}", "title": "" }, { "docid": "5dfefd73a31b7045db954c1c8ff9c897", "score": "0.60059613", "text": "get_new_data() {\n return data\n }", "title": "" }, { "docid": "fecae63842ff73f3c40f4d0c0988eba6", "score": "0.5999499", "text": "function cb(error,response,data){\nconsole.log(data);\n}", "title": "" }, { "docid": "d0f3a21b0a7dae0f66286bbec80ea148", "score": "0.5989072", "text": "function receiveAsynchInfo(data){ \n if(data.courseInfo!=undefined){ \n courseId = data.courseInfo.courseID; \n } else if(data.userInfo!=undefined){ \n userId = data.userInfo.userID; \n } \n LoadFacebookButtons(); \n }", "title": "" }, { "docid": "aaf89e674f75bf5ec88c35e4516a4d91", "score": "0.59858143", "text": "function getData() {\n\t\tpubnub.history({\n\t \tchannel: channel,\n\t \tcount: 1000,\n\t \tcallback: function(messages) {\n\t \t\tpubnub.each( messages[0], processData );\n\t \t\tgetStreamData();\n\t \t},\n\t \terror: function(error) {\n\t \t\tconsole.log(error);\n\t \t\tif(error) {\n\t \t\t\tgetStreamData();\n\t \t\t}\n\t \t}\n\t });\n\t}", "title": "" }, { "docid": "257904e932035ff338506d756e203b1e", "score": "0.5981916", "text": "function CallBack() {\n ShowProgressBar(true);\n isResetCallback = 1; // variable to reset callback\n\n\n // Data is uploaded via file(CSV/XLS)\n if (OATfilePath != '') FileUpload_Callback();\n // Qds search is used to generate dataview\n else if (z('hdsby').value == \"qds\") {\n if (QdsDataNIds == '') {\n NonQDS_Callback();\n }\n else {\n QDS_Callback();\n }\n }\n // Advanced search flow is used to reach on DataView page\n else NonQDS_Callback(); // if (z('hdsby').value == \"as\")\n\n\n}", "title": "" }, { "docid": "09c65e5ed702cba03dd9c9fb43cf6c9d", "score": "0.5980134", "text": "doneCallback() { }", "title": "" }, { "docid": "3ecf33e9229efcbbd6f3d804dd9b94f5", "score": "0.59782773", "text": "function callback(data) {\n data.trim().split('\\n').forEach(function(n) {\n var n = n.split(','),\n name = Station.idToName[n[0]],\n st = Station.list[name];\n if(st){\n st.addMetrics({\n value: n[1] || 0,\n percentage: n[2] || 0\n }).setMarkerColor();\n } else {\n console.log('Station id:' + n[0] + ' name: ' + name + ' does not exist');\n }\n\n });\n console.log(data);\n }", "title": "" }, { "docid": "90581bee5d463a3d2122664d5291c477", "score": "0.59778184", "text": "_fetchData(callback) {\n // main fetch method\n this.props.onFetch && this.props.onFetch(this.state._pageNum, callback);\n }", "title": "" }, { "docid": "8247dec60067d52f7e09c58d857e3410", "score": "0.5975423", "text": "function cb(data)\n{\n console.log('I got called because of jsonp request');\n console.log(data);\n}", "title": "" }, { "docid": "501435b79491d01721820eaf51440e31", "score": "0.5973414", "text": "function serverData() {}", "title": "" }, { "docid": "296c1ac06ee2958b097a5de219501ff8", "score": "0.5947726", "text": "function callback_all_user(data){\n\t/* A remplir par l'utilisateur */\n\tconsole.log(\"User recus\");\n\tconsole.log(data);\n}", "title": "" }, { "docid": "698a2d69112c82391245b5f4e5d4c341", "score": "0.5936811", "text": "function myCallback(data){\n expect(typeof data).toBe('string')\n done(); //Here's the indicator\n }", "title": "" }, { "docid": "06d0b001b1191bf6c081778932960b92", "score": "0.59355134", "text": "function loadData(err, data) {\n // forgot to handle error\n}", "title": "" }, { "docid": "07b5aeeb02b1c0661cc92960b5f8c3bd", "score": "0.59353113", "text": "function mainCallback() {\r\n\r\n}", "title": "" }, { "docid": "ea56bbb062b582b5edb04c35dc90c7b0", "score": "0.5934465", "text": "done( eventName, id, data ){\n const varName = storageVariables.event( this.catergory, eventName );\n\n // Trigger Callback\n const event = { id, type: types.event.CALLBACK }\n if( data ){ event.data = data; }\n GM_setObjValue( varName, event );\n }", "title": "" }, { "docid": "37d43a6024b50857d6504844d514724d", "score": "0.59266293", "text": "function onSuccess(data) {\n console.log(data);\n }", "title": "" }, { "docid": "6808f72c0839e26169d21da73facc5f6", "score": "0.5926081", "text": "handler(data) {\n console.log(`1`)\n this.props.callback(data, true, false)\n }", "title": "" }, { "docid": "556cb4dd4498f80e793da59af29ff267", "score": "0.5912745", "text": "loadingData() { }", "title": "" }, { "docid": "556cb4dd4498f80e793da59af29ff267", "score": "0.5912745", "text": "loadingData() { }", "title": "" }, { "docid": "166c4e4a3c06ba778138ed48b76b92eb", "score": "0.591111", "text": "function _sensorDataCB(handle,data) {\n\twindow.console.log(\"Handle Received: \" + handle);\n\t\n\t// Obtain the connection object and then invoke the onsensordata handler\n\tvar connection = connections[handle.toString()];\n\t\n\tif(connection.onsensordata) {\n\t\tconnection.onsensordata(data);\n\t}\n}", "title": "" }, { "docid": "95d411c6f8fa7c0a9753c14d94976f2e", "score": "0.589822", "text": "function getDetails(callback){\n\n}", "title": "" }, { "docid": "46648b909346965e568ebce7cd4b960b", "score": "0.5895317", "text": "function process_data() {\n if (usd_clp != null && international_price != null && !exchanges.includes(null)) {\n callback(false, usd_clp, international_price, exchanges);\n }\n }", "title": "" }, { "docid": "46648b909346965e568ebce7cd4b960b", "score": "0.5895317", "text": "function process_data() {\n if (usd_clp != null && international_price != null && !exchanges.includes(null)) {\n callback(false, usd_clp, international_price, exchanges);\n }\n }", "title": "" } ]
ea44d955bcef9963366b090fd6a0fd95
toggle between "Most Viewed" and "Most Recent" ComplaintCard posts.
[ { "docid": "28c88d30bfa59d79f8bb8d4902d5714d", "score": "0.5357021", "text": "toggleFilter() {\n\t\t// grab the utl for when the position is changed to 1. The position is changed to one when we want to make a fetch call for the URL holding the \"Most Viewed\" data\n\t\t// what's the position at the moment? let's change it.\n\t\tlet newPosition = (this.state.position === 0) ? 1 : 0\n\t\t// okay now the postion is changed to one, therefore grab the url for \"Most Viewed\"\n\t\tlet sortOptions = complaint_sort_options[newPosition]\n\n\t\t// fetch stored in a variable\n\t\tlet urlData = fetch(sortOptions.url, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t}\n\t\t})\n\n\t\t// response from urlData object\n\t\turlData.then(res => {\n\t\t\t// store response as a json\n\t\t\tlet resData = res.json() // this is the Response object - looking for 200 status\n\n\t\t\t// promise object from successful response object\n\t\t\tresData.then(data => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcomplaint_data: data,\n\t\t\t\t\tposition: newPosition\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t\t.catch(error => console.log(\"Error:\", error))\n\t}", "title": "" } ]
[ { "docid": "cd5501e908bbda3e060b16abc452bfa9", "score": "0.57300603", "text": "function updateupdownvotesonscreen(signin) {\n var cards;\n if(signin){\n cards = $(\"#topnews\").find(\"div.col\");\n cards = $.merge(cards,$(\"#latestnews\").find(\"div.col\"));\n $.each(cards, function(i, card) {\n var newsId = Number($(card).find(\"div.card div.card-action\")[0].dataset.id);\n var upVote = (userInfo.votes.up.indexOf(newsId) !== -1);\n var downVote = (userInfo.votes.down.indexOf(newsId) !== -1);\n if (upVote) {\n $(card).find(\"div.card div.card-action a.thumbup i.material-icons\").toggleClass(\"black-text\");\n $(card).find(\"div.card div.card-action a.thumbup i.material-icons\").toggleClass(\"blue-text\");\n }\n if (downVote) {\n $(card).find(\"div.card div.card-action a.thumbdown i.material-icons\").toggleClass(\"black-text\");\n $(card).find(\"div.card div.card-action a.thumbdown i.material-icons\").toggleClass(\"red-text\");\n }\n });\n } else {\n cards = $(\"#topnews\").find(\"div.col\");\n $.each(cards, function(i, card) {\n $(card).find(\"div.card div.card-action a.thumbup i.material-icons\").toggleClass(\"black-text\",true);\n $(card).find(\"div.card div.card-action a.thumbup i.material-icons\").toggleClass(\"blue-text\",false);\n $(card).find(\"div.card div.card-action a.thumbdown i.material-icons\").toggleClass(\"black-text\",true);\n $(card).find(\"div.card div.card-action a.thumbdown i.material-icons\").toggleClass(\"red-text\",false);\n });\n }\n}", "title": "" }, { "docid": "b5abf6cf4b54979f340aa82fafe6618f", "score": "0.569208", "text": "function mergeRecentCards() {\n clearAllUI();\n\n recentUpdates = [];\n requests.forEach((card) => {\n recentUpdates.push(card);\n });\n bookings.forEach((card) => {\n recentUpdates.push(card);\n });\n notifications.forEach((card) => {\n recentUpdates.push(card);\n });\n}", "title": "" }, { "docid": "5fca8f9286723637c2f60b4277b62180", "score": "0.5679642", "text": "function updateMyPost() {\n document.getElementById(\"most_recent\").innerHTML = myPost.pop();\n}", "title": "" }, { "docid": "53d1ebb5999a153a44b20d9592d6b970", "score": "0.56429124", "text": "blogPostsCards(state) {\n return state.blogPosts.slice(2, 6);\n }", "title": "" }, { "docid": "003e9eeadfb9cda90be6f4172340eb2e", "score": "0.56183743", "text": "function handleCardClick(e, x, i) {\n setCurrentPost(x);\n if (i > 0) {\n setPreviousPost(filteredPosts[i - 1]);\n }\n if (i < filteredPosts.length - 1) {\n setNextPost(filteredPosts[i + 1]);\n }\n setDialogOpen(true);\n }", "title": "" }, { "docid": "83eeea1c5387f172706171fcc0e51611", "score": "0.5616638", "text": "function ToggleLastComments(post) {\n var postTarget = (\"current-comments-\" + post);\n var moreTarget = (postTarget + \"-more\");\n var x = document.getElementById(postTarget).getElementsByTagName(\"td\");\n var moreClick = document.getElementById(moreTarget); \n var i;\n for (i = 5; i < x.length; i++) {\n if (x[i].style.display == \"none\") {\n x[i].style.display = \"flex\";\n moreClick.innerHTML = \"Less Comments\";\n }\n else { x[i].style.display = \"none\"; \n moreClick.innerHTML = \"More Comments\";\n }\n }\n\n}", "title": "" }, { "docid": "e26c3b60724d5ec0de9ddc08ad7ec0d2", "score": "0.56140155", "text": "function dscDate()\n {\n \n setActiveButton(\"dscDate\");\n let data = posts;\n\n\n // bubble sort for shorting time complexity = O(n * n)\n\n for(let i = 0 ; i < data.length ; i++)\n {\n for(let j = 0 ; j < data.length - i - 1 ; j++)\n {\n if(data[j].datePublished > data[j+1].datePublished)\n {\n let temp = data[j];\n data[j] = data[j+1];\n data[j+1] = temp;\n }\n }\n }\n\n setPosts(data.reverse())\n\n }", "title": "" }, { "docid": "6a947657f270377ae8b686359b0cc1ad", "score": "0.55202895", "text": "function displayCards() {\n if (amountOfDataToDisplay === 0) {\n SetDataToDisplay(overallData);\n } else {\n const maxNumber = () => {\n\n if (amountOfDataToDisplay > overallData.length) {\n return overallData.length\n } else {\n return amountOfDataToDisplay\n }\n\n\n }\n\n SetDataToDisplay(overallData.splice(0, maxNumber()))\n\n }\n\n SetCardToggle(true);\n\n\n }", "title": "" }, { "docid": "077e342836067a5afdc19a2851f55072", "score": "0.550455", "text": "function toggleRestOfPost( postId)\n{\n var restOfPostId = postId + \"_rest_of_post\";\n var readMoreId = postId + \"_read_more\";\n var readLessId = postId + \"_read_less\";\n\n toggleDisplay( document.getElementById( restOfPostId));\n toggleDisplay( document.getElementById( readMoreId));\n toggleDisplay( document.getElementById( readLessId));\n}", "title": "" }, { "docid": "d6e24c50f4f381cffa7e1e125da6c3a0", "score": "0.54704756", "text": "function cardLimit(card){\n cardsOpened.pop();\n !toggleCard(card);\n card.classList.remove('animated', 'fast', 'flipInY');\n}", "title": "" }, { "docid": "fd68fb414cdcc2a80b7574b4ede060e9", "score": "0.53816384", "text": "function displayCard(clikedCard) {\n clikedCard.classList.toggle(\"open\");\n clikedCard.classList.toggle(\"show\");\n}", "title": "" }, { "docid": "73e95ff8f772e1fb01e5de92b0e1232e", "score": "0.5342212", "text": "function dscLike()\n {\n \n setActiveButton(\"dscLike\");\n let data = posts;\n\n\n // bubble sort for shorting time complexity = O(n * n)\n\n for(let i = 0 ; i < data.length ; i++)\n {\n for(let j = 0 ; j < data.length - i - 1 ; j++)\n {\n if(data[j].numLikes > data[j+1].numLikes)\n {\n let temp = data[j];\n data[j] = data[j+1];\n data[j+1] = temp;\n }\n }\n }\n\n setPosts(data.reverse())\n\n }", "title": "" }, { "docid": "5fa1f1f6bff2df339d1b10b917e1c33f", "score": "0.531635", "text": "updateCards () {\n this.hideButtons();\n this.cardTargets.filter(card => !card.classList.contains('draggable-mirror')).forEach((card, i) => {\n const originalPosition = parseInt(card.getAttribute('data-entry-position-original'), 10);\n const position = i + 1;\n let publish_date;\n if (this.publishSchedulesCount === 0) {\n publish_date = 'TBD';\n } else {\n const days = Math.floor((position - 1 + this.pastPublishSchedulesTodayValue)/this.publishSchedulesCountValue);\n publish_date = moment().tz(this.timeZoneValue).add(days, 'days').format('dddd, MMMM D, YYYY');\n }\n card.setAttribute('data-entry-position', position);\n card.querySelector('[data-timestamp]').innerHTML = publish_date;\n if (position !== originalPosition) {\n this.showButtons();\n }\n });\n }", "title": "" }, { "docid": "ca498cf92a6b7d1680807acd163cd9ab", "score": "0.52951866", "text": "function filterPosts() {\n\t\tvar numVisible = 0, numHidden = 0;\n\t\t$.each(blogData.posts, function(index, post) {\n\t\t\tvar show = filterSports(post.subjects) && filterDate(post.date) && filterAuthors(post.authors);\n\t\t\tshow ? numVisible++ : numHidden++;\n\t\t\t$(\"#\" + post.id).toggle(show);\n\t\t\t$(\"#\" + post.id + \"-recent\").toggleClass(\"recent-post-disabled\", !show);\n\t\t});\n\n\t\t// show the number that are filter\n\t\t$(\"#filter-tool-num\").text(\"(\" + numVisible + \"/\" + blogData.posts.length + \")\");\n\n\t\t// if there are no visible, then explain in the document\n\t\tif (numVisible === 0) {\n\t\t\t$(\"#empty-note\").text(\"The current filter settings do not return any posts\");\n\t\t} else {\n\t\t\t$(\"#empty-note\").text(\"\");\n\t\t}\n\t}", "title": "" }, { "docid": "1bc590e1f6ce19c90d71b5b63370d89e", "score": "0.5250303", "text": "function ascDate()\n {\n \n setActiveButton(\"ascDate\");\n let data = posts;\n\n\n // bubble sort for shorting time complexity = O(n * n)\n\n for(let i = 0 ; i < data.length ; i++)\n {\n for(let j = 0 ; j < data.length - i - 1 ; j++)\n {\n if(data[j].datePublished > data[j+1].datePublished)\n {\n let temp = data[j];\n data[j] = data[j+1];\n data[j+1] = temp;\n }\n }\n }\n\n setPosts(data)\n\n }", "title": "" }, { "docid": "f7603acc2cf6998398ccebcf00aac6d5", "score": "0.5180221", "text": "function upcoming_post_preview_toggle_display(){\n\t\t\n\t\t//get current state, if we have enabled it, slide down else slide up\n\t\tchosen_preview_status = preview_status.filter(':checked').val();\n\t\tif(chosen_preview_status == 'true'){\n\t\t\tpreview_content_settings.slideDown('fast');\n\t\t}else if(chosen_preview_status == 'false'){\n\t\t\tpreview_content_settings.slideUp('fast');\n\t\t\t//reset the X number of characters to display \n\t\t\tpreview_container.find('')\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "0734ab529de9b212bdfb3adf3a56e076", "score": "0.51738554", "text": "function showMorePost2() {\n var toggleButton = $('#read-more-post-2');\n var postExerpt = $(toggleButton).parent().find('.exerpt');\n\n if ($(postExerpt).data('state') === 'hidden') {\n $(postExerpt).data('state', 'show');\n $(postExerpt).slideDown();\n $(toggleButton).text('Read less <');\n } else {\n $(postExerpt).data('state', 'hidden');\n $(postExerpt).slideUp();\n $(toggleButton).text('Read more >');\n }\n }", "title": "" }, { "docid": "f2fecd8b3c253989e9126eb68969cc53", "score": "0.51466876", "text": "function blogPost(){\n\n\t\tif ( $('.blog-category-filter').length ) {\n\t\t\t$('.blog-post').mixItUp({\n\t\t\t\tanimation: {\n\t\t\t\t\tduration: 550,\n\t\t\t\t\teffects: 'fade stagger(20ms) translateZ(-300px)',\n\t\t\t\t\teasing: 'cubic-bezier(0.645, 0.045, 0.355, 1)'\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t}", "title": "" }, { "docid": "99b096f308173214105579f3627103a1", "score": "0.512022", "text": "async function displayCards(status = '') {\n let posts;\n\n if ((status == 'total') || (localStorage.getItem('posts') === null)) {\n posts = await getPosts();\n posts = addIdsToPosts(posts);\n updateLocalStorage(posts);\n } else {\n posts = JSON.parse(localStorage.getItem('posts'));\n }\n\n if (sortState.sortByTitle == 'asc') sortAsc(posts, 'image');\n if (sortState.sortByTitle == 'desc') sortDesc(posts, 'image');\n if (sortState.sortByCategory == 'asc') sortAsc(posts, 'category');\n if (sortState.sortByCategory == 'desc') sortDesc(posts, 'category');\n if (sortState.sortByDate == 'asc') sortAsc(posts, 'timestamp');\n if (sortState.sortByDate == 'desc') sortDesc(posts, 'timestamp');\n if (sortState.sortBySize == 'asc') sortAsc(posts, 'filesize');\n if (sortState.sortBySize == 'desc') sortDesc(posts, 'filesize');\n\n let data = pagination(posts, currentPage, rows);\n let currentPosts = data.currentPosts;\n let pages = data.pages;\n\n createGrid(posts, currentPosts, pages);\n}", "title": "" }, { "docid": "baa7833a7b8770e2c5fcfb6271ce6fb3", "score": "0.51111585", "text": "async function sortDisplay(currentSelect) {\n await loadDB();\n recentUpdates.forEach(function (items) {\n obj = items.onDate;\n if (\n obj.toDate().getFullYear() === new Date(currentSelect).getUTCFullYear() &&\n obj.toDate().getMonth() === new Date(currentSelect).getUTCMonth() &&\n obj.toDate().getDate() === new Date(currentSelect).getUTCDate()\n ) {\n currentDateCards.push(items);\n }\n });\n\n if (currentDateCards.length > 0) {\n document.querySelector(\".no_events\").classList.add(\"hidden\");\n\n currentDateCards.sort(function (a, b) {\n if (a.onDate < b.onDate) return 1;\n if (a.onDate > b.onDate) return -1;\n return 0;\n });\n for (i = 0; i < currentDateCards.length; i++) {\n displayRecenttUI(i);\n }\n } else {\n document.querySelector(\".no_events\").classList.remove(\"hidden\");\n isOnline();\n }\n}", "title": "" }, { "docid": "dfa236f43e2c6f9d7ee0d053d7a3b52a", "score": "0.50731695", "text": "function RetweetsButton(){\n if (checkRetweetsSorted()==false){\n sortByRetweets();\n sortRev(\"Retweets\");\n }else{\n sortRev(\"Retweets\");\n }\n convertToTemplate();\n}", "title": "" }, { "docid": "92901dab831784bf5b64ea0a2b67b684", "score": "0.50636536", "text": "function HideLastComments(post) {\n var postTarget = (\"current-comments-\" + post); \n var hideMe = document.getElementById(postTarget).getElementsByTagName(\"td\");\n var i;\n for (i = 5; i < hideMe.length; i++) { \n hideMe[i].style.display = \"none\";\n }\n $(postTarget).animate({ scrollTop: 0 }, 'slow'); \n}", "title": "" }, { "docid": "b1c09c9c7b8c8c07bc57000cd5c3a4d8", "score": "0.5051585", "text": "function handlePostClick(post) {\n\t\tupdateCurrentPost(post);\n\t}", "title": "" }, { "docid": "41ab39eeb029002418bf163f3b2c9e3e", "score": "0.5049143", "text": "function boardStatusCustomSort( el, index ) {\n\tvar isRead,\n\t\tstatusIcon = el.firstElementChild;\n\n\tswitch ( true ) {\n\t\tcase statusIcon.classList.contains( 'board_icon_topic_read' ):\n\t\t\tisRead = '0';\n\t\t\tbreak;\n\n\t\tcase statusIcon.classList.contains( 'board_icon_topic' ):\n\t\t\tisRead = '1';\n\t\t\tbreak;\n\n\t\tcase statusIcon.classList.contains( 'board_icon_topic_unread' ):\n\t\t\tisRead = '2';\n\t\t\tbreak;\n\t}\n\n\t// Prefix post date with \"0\" if read, otherwise \"1\" for unread\n\tel.dataset.customSort = isRead + el.parentNode.querySelector( '.lastpost' ).dataset.customSort;\n}", "title": "" }, { "docid": "1a2bd8a960004b8e244ad2ecd84919aa", "score": "0.50357217", "text": "function updateMostRecentID(){\n if (scopeFeed.length > 0){\n lastPostID = scopeFeed[0].id;\n }\n }", "title": "" }, { "docid": "2d43ca8a46253f59600a72edcaa6b444", "score": "0.50338185", "text": "function hideCardByCount(count) {\n\tcard[count].className = \"card\";\n}", "title": "" }, { "docid": "c2e56bc3616adaec788ff830e3fe72bc", "score": "0.5027203", "text": "sortByTag() {\n var users;\n dbRef.child(\"User\").on(\"value\", (snap) => {\n users = snap.val();\n });\n let cardCollected = [];\n for (let user in users) {\n let cards = users[user].cards;\n\n if (this.state.tag !== \"all\") {\n for (let card in cards) {\n let commentNumber = this.countComments(cards[card].comments);\n\n if (cards[card].tag === this.state.tag) {\n cardCollected.push({\n id: card,\n background: cards[card].imgOption,\n text: cards[card].text,\n comments: cards[card].comments,\n numComments: commentNumber,\n timestamp: cards[card].timestamp,\n upvote: this.countUpvotes(cards[card].upvote),\n downvote: this.countDownvotes(cards[card].downvote),\n });\n }\n }\n } else if (this.props.tag === \"all\") {\n for (let card in cards) {\n let commentNumber = this.countComments(cards[card].comments);\n\n cardCollected.push({\n id: card,\n background: cards[card].imgOption,\n text: cards[card].text,\n comments: cards[card].comments,\n numComments: commentNumber,\n timestamp: cards[card].timestamp,\n upvote: this.countUpvotes(cards[card].upvote),\n downvote: this.countDownvotes(cards[card].downvote),\n });\n }\n }\n }\n this.sortByTimestamp(cardCollected);\n return cardCollected;\n }", "title": "" }, { "docid": "470c917106cce7b4d4f4f070e895cd30", "score": "0.50241446", "text": "function hideCard(){\n\tif(openCard.length>0){\n\t\topenCard[0].classList.remove(OPEN_CARD);\n\t\topenCard[0].classList.remove(SHOW_CARD);\n\t\tif(openCard.length == 2){\n\t\t\topenCard[1].classList.remove(OPEN_CARD);\n\t\t\topenCard[1].classList.remove(SHOW_CARD);\n\t\t\topenCard.pop();\n\t\t}\n\t\topenCard.pop();\n\t}\n\treturn;\n}", "title": "" }, { "docid": "bea94628e589f0bcfb27be5b211cd574", "score": "0.50196904", "text": "function cleanPosts(posts, currentUserId, viewContext, request, thread) {\n var authedUserPriority = request.server.plugins.acls.getUserPriority(request.auth);\n var hasPriority = request.server.plugins.acls.getACLValue(request.auth, 'posts.byThread.bypass.viewDeletedPosts.priority');\n var hasSelfMod = request.server.plugins.acls.getACLValue(request.auth, 'posts.byThread.bypass.viewDeletedPosts.selfMod');\n var authedId = request.auth.credentials ? request.auth.credentials.id : null;\n var isModerator = thread ? (thread.user.id === authedId && thread.moderated) : false;\n\n posts = [].concat(posts);\n var viewables = viewContext;\n var viewablesType = 'boolean';\n var boards = [];\n if (_.isArray(viewContext)) {\n boards = viewContext.map(function(vd) { return vd.board_id; });\n viewablesType = 'array';\n }\n return posts.map(function(post) {\n var postHiddenByPriority = post.metadata ? post.metadata.hidden_by_priority : null;\n var postHiddenById = post.metadata ? post.metadata.hidden_by_id : null;\n var authedUserHasPriority = authedUserPriority <= postHiddenByPriority;\n var authedUserHidePost = postHiddenById === authedId;\n\n // if currentUser owns post, show everything\n var viewable = false;\n if (currentUserId === post.user.id) { viewable = true; }\n // if viewables is an array, check if user is moderating this post\n else if (viewablesType === 'array' && _.includes(boards, post.board_id)) { viewable = true; }\n // if viewables is a true, view all posts\n else if (viewables) { viewable = true; }\n\n // Allow self mods to view posts hidden by users of the same or lesser role\n // post is hidden, only show users posts hidden by users of the same or greater priority\n if (((isModerator === true && selfMod) || hasPriority) && post.deleted && authedId && authedUserPriority !== null) {\n viewable = (authedUserHasPriority || authedUserHidePost);\n }\n\n\n // remove deleted users or post information\n var deleted = false;\n if (post.deleted || post.user.deleted || post.board_visible === false) {\n deleted = true;\n }\n\n // format post\n if (viewable && deleted) { post.hidden = true; }\n else if (deleted) {\n post = {\n id: post.id,\n hidden: true,\n _deleted: true,\n position: post.position,\n thread_title: 'deleted',\n user: {}\n };\n }\n\n if (!post.deleted) { delete post.deleted; }\n delete post.board_visible;\n delete post.user.deleted;\n return post;\n });\n}", "title": "" }, { "docid": "4eb439d6a618b81447671f3d730dd8b9", "score": "0.5009935", "text": "function toggleAll(){\n\t\t\tif (ddd==0){\n\t\t\t\t$('.post').addClass('collapsed');\n\t\t\t\tddd=1;\n\t\t\t\t$('#plusbutton')[0].title=\"Expands all posts\";\n\t\t\t\t$('#plusbutton')[0].innerHTML=\"Exp. Posts\";\n\t\t\t\ta=$('.post')\n\t\t\t\ta.find('button.invisPost').show()\n\t\t\t\t//$('ul.children').show()\n\t\t\t} else{\n\t\t\t\t$('.post').removeClass('collapsed');\n\t\t\t\tddd=0;\n\t\t\t\t$('#plusbutton')[0].title=\"Collapses all posts\";\n\t\t\t\t$('#plusbutton')[0].innerHTML=\"Coll. Posts\";\n\t\t\t\ta=$('.post')\n\t\t\t\ta.find('button.invisPost').hide()\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dd53d1eddaac622a75297c4e26d1ff92", "score": "0.50091857", "text": "function display(card){\n // Add 'open' and 'show' class name\n card.classList.add('open','show');\n // Push the card to openCardList\n openCardList.push(card);\n}", "title": "" }, { "docid": "950b5c17d95da34792f3f21182db9ee1", "score": "0.500412", "text": "function inverseTriPosts(state) {\n if (state.sortContrib.slice(-4) == \"Desc\") \n state.sortContrib = state.sortContrib.slice(0,-4);\n else \n state.sortContrib += \"Desc\";\n return state;\n}", "title": "" }, { "docid": "b0b3a53116c9ac549de8bc031f2898c8", "score": "0.4986128", "text": "function ascLike()\n {\n \n setActiveButton(\"ascLike\");\n let data = posts;\n\n\n // bubble sort for shorting time complexity = O(n * n)\n\n for(let i = 0 ; i < data.length ; i++)\n {\n for(let j = 0 ; j < data.length - i - 1 ; j++)\n {\n if(data[j].numLikes > data[j+1].numLikes)\n {\n let temp = data[j];\n data[j] = data[j+1];\n data[j+1] = temp;\n }\n }\n }\n\n setPosts(data)\n\n }", "title": "" }, { "docid": "a8e54b553451ebe9ae5b866b6598b887", "score": "0.49851936", "text": "function filterPosts(filter) {\n// This function changes the filter\n// and displays the filtered list of posts\n // document.getElementById(\"bp_toc\").scrollTop = document.getElementById(\"bp_toc\").offsetTop;;\n postFilter = filter;\n displayToc(postFilter);\n} // end filterPosts", "title": "" }, { "docid": "56680bc949daccf70de4ba99b45cc273", "score": "0.49813506", "text": "changePostView(newPost) {\n this.setState({\n selectedPost: newPost,\n view: 'post-view'\n })\n }", "title": "" }, { "docid": "169fcc8139129bd6a532d6a94b958cb5", "score": "0.4979137", "text": "function toggle_cards() {\n if (typeof data === \"undefined\") {\n loadData();\n }\n flashcards.removeClass(showing ? 'cards-show' : 'cards-hide');\n flashcards.addClass(showing ? 'cards-hide' : 'cards-show');\n showing = !showing;\n }", "title": "" }, { "docid": "e7cf7f370ad1bdf63b7bb82b960e4373", "score": "0.49687392", "text": "function twoCards(card) {\r\n openCards.unshift(card.target.lastElementChild.className);\r\n}", "title": "" }, { "docid": "44b397daf5aad11d1ccde663f00b0fef", "score": "0.4968352", "text": "_onEntityFeedUpdate(entity) {\n const list = entity.options.filter(option => entity.display[option.id] && !entity.hidden[option.id]);\n if (!entity.allSelected) {\n list.sort((a, b) => {\n if (entity.selected[a.id] && !entity.selected[b.id])\n return -1;\n if (!entity.selected[a.id] && entity.selected[b.id])\n return 1;\n });\n }\n entity.feed.next(list);\n }", "title": "" }, { "docid": "36385474de57f0bad6ddb0db4919f4c7", "score": "0.49673358", "text": "decPopularCityIdx(){\n this.setState({\n popularCitiesIdx: this.state.popularCitiesIdx-5 <0? 0 :this.state.popularCitiesIdx-5\n });\n const popularCityDivs = this.state.allPopularCities.slice(this.state.popularCitiesIdx, this.state.popularCitiesIdx+5).map(\n (cityObj, i) => (\n <Card className=\"card_item\" key={i}>\n <Card.Body>\n <Card.Title className=\"shopTitle\">{cityObj.CITY}</Card.Title>\n <div>\n <Button type=\"submit\" bsStyle=\"primary\" value={cityObj.CITY} onClick={this.submitUsr}>Go!</Button>\n </div>\n </Card.Body>\n </Card>\n )\n );\n this.setState({popularCities: popularCityDivs});\n }", "title": "" }, { "docid": "23b36d9462a2a59be3e46ababe1047e3", "score": "0.49585095", "text": "function toggle_post_hidden(post_date, hide_button) {\n $.post('/toggle_post_hidden', { post_date: post_date }, function(data) {\n d = JSON.parse(data);\n if (d['entry_hidden']) {\n hide_button.addClass('activated_control');\n }\n else {\n hide_button.removeClass('activated_control');\n }\n });\n}", "title": "" }, { "docid": "e6b677ced26d083f52c7c142adb5afea", "score": "0.49578792", "text": "function olderButtonVisible() {\n let style\n if (sliceTo >= allPosts.length) {\n style = \"unavailable\"\n }\n return (\n <a href=\"/allPosts\">\n <div onClick={() => getOlderPosts()}>\n <b className=\"blackLink\" id={style}>\n Older posts\n </b>\n </div>\n </a>\n )\n}", "title": "" }, { "docid": "ca5bad4cc075f60f59410da1a32850ac", "score": "0.49492705", "text": "function togglePriority(event){\n event.target.classList.toggle(\"is-priority\");\n dataCards.cards.forEach(card=>{\n if(event.target.id.split('-')[1] === card.id.toString()){\n card.priority=card.priority?false:true;\n }\n });\n}", "title": "" }, { "docid": "0fb908743fdef5adc629401b93f4c034", "score": "0.49398968", "text": "function hideCard(){\n\topenCardList.forEach(function(elem){\n\t\telem.classList.remove('show', 'open');\t//hides card\n\t});\n\tremoveCard(); \t//clears out open card list\n}", "title": "" }, { "docid": "36e1c548ea07ddaeb8b40981fb45d580", "score": "0.49183428", "text": "getLatestPost() {\n return Responses.findOne({\n ask: this._id\n }, {\n sort: {\n creationDate: -1\n }\n });\n }", "title": "" }, { "docid": "b41aa239c0ceea8d6a1c3463abc72eb4", "score": "0.49172854", "text": "function toggleAnswer() {\n var classes = angular.element(this).attr('class');\n if (classes.search('btn0') > 0) {\n swapContent(cards[0]);\n }\n else if (classes.search('btn1') > 0) {\n swapContent(cards[1]);\n } \n else {\n swapContent(cards[2]);\n }\n }", "title": "" }, { "docid": "4743c6fdcea289d9368c466f35e24c88", "score": "0.49101153", "text": "function cardFlipBack (){\n//Loop over the cards and remove the open and show classes\nfor(let i = 0; i < cardSelector.length; i++) {\n cardSelector[i].classList.remove('open', 'show');\n}\nopenCards = []; //Set open cards back to empty\nmoves++ //Increment move number\ndisplayMoves(); //Display new move number\nstarRating(moves);\n}", "title": "" }, { "docid": "f8a39831a039fb24ee01b84be3de5888", "score": "0.49015433", "text": "@discourseComputed(\"new_posts\", \"id\")\n displayNewPosts(newPosts, id) {\n const highestSeen = Session.currentProp(\"highestSeenByTopic\")[id];\n if (highestSeen) {\n const delta = highestSeen - this.last_read_post_number;\n if (delta > 0) {\n let result = newPosts - delta;\n if (result < 0) {\n result = 0;\n }\n return result;\n }\n }\n return newPosts;\n }", "title": "" }, { "docid": "bcf40dd9bf8aebc00f2c1237b7e45a4d", "score": "0.49014762", "text": "function displayPopularTv() {\n let shows = state.popularTv.map(function(show) {\n return posterTemplate(show);\n });\n $(POPULAR_TV_CONTENT).append(shows.slice(-20).join(''));\n}", "title": "" }, { "docid": "88fe413a776a349948d8b48fdb592d04", "score": "0.49000484", "text": "function postList(selector) {\n forEach(document.querySelectorAll(selector), (action) => {\n let posts = document.querySelectorAll('.PostList-item')\n\n action.addEventListener('click', (e) => {\n e.preventDefault()\n expand()\n })\n\n function expand() {\n action.classList.add('is-hidden')\n\n forEach(posts, (post) => {\n post.classList.remove('is-hidden')\n })\n }\n })\n}", "title": "" }, { "docid": "b463d574c5fd3ff5c98b39e9fae0d0ec", "score": "0.4898557", "text": "function displayCard(card){\n\tcard.classList.add(OPEN_CARD);\n\tcard.classList.add(SHOW_CARD);\n\topenCard.push(card);\n\tgamecounter+=1;\n\tcreateRating();\n\tisOpen=!isOpen;\n\treturn;\n}", "title": "" }, { "docid": "a85b284d61a8d89fff60559597757f2d", "score": "0.48943898", "text": "function onReverse() {\r\n allPosts.reverse();\r\n drawPosts(allPosts);\r\n}", "title": "" }, { "docid": "16185a3127fe1a8ff41050849a3015ae", "score": "0.48864287", "text": "function toggleCards(clickedCard) {\n clickedCard.classList.toggle('open');\n clickedCard.classList.toggle('show');\n}", "title": "" }, { "docid": "33b9d3fd722e0e2efe00cd42976725a1", "score": "0.48858222", "text": "function seeCards() {\n document.querySelector(\"body\").style.overflow = \"hidden\";\n document.querySelector(\".cards-screen\").classList.add(\"cards-screen-open\");\n}", "title": "" }, { "docid": "793064927ba885316c5fcb1f0257f8dc", "score": "0.48774958", "text": "toggleCensor() {\n let post = this.state.post;\n\n post.censored = !post.censored;\n\n this.setState({\n post: post,\n });\n\n console.log('Censor Toggle', post.censored);\n }", "title": "" }, { "docid": "d09dac8aaa2acfa0a34c7b36d3c1741e", "score": "0.48763025", "text": "function onSortDescending() {\r\n allPosts.sort(function(a, b) {\r\n var usernameA = a.username.toLowerCase();\r\n var usernameB = b.username.toLowerCase();\r\n\r\n if (usernameB < usernameA) {\r\n return -1;\r\n }\r\n\r\n if (usernameB > usernameA) {\r\n return 1;\r\n }\r\n\r\n return 0;\r\n });\r\n\r\n drawPosts(allPosts);\r\n}", "title": "" }, { "docid": "67319f80046bd12430976e83107894d1", "score": "0.48734987", "text": "function toggleCards(card) {\n card.classList.toggle(\"open\");\n card.classList.toggle(\"show\");\n}", "title": "" }, { "docid": "768fdc8912e0b36b1e22528ce9c6ea21", "score": "0.48573124", "text": "clearPost() {\n\t\tthis.updateState(state => state\n\t\t\t.set(\"postRich\", [])\n\t\t\t.set(\"cursor\", -1)\n\t\t\t.set(\"selected\", null)\n\t\t\t.set(\"cost\", 0)\n\t\t\t.set(\"references\", {})\n\t\t)\n\t}", "title": "" }, { "docid": "87eb5b03c0487648a3576eb6fd4202ef", "score": "0.48557147", "text": "function loadTopPosts(count) {\n\n}", "title": "" }, { "docid": "11d45afcc2c8aefdc71bcf41a79d4ba8", "score": "0.4851512", "text": "function showAll() {\n card1Back.classList.add('hiddenLeft');\n card2Back.classList.add('hiddenRight');\n}", "title": "" }, { "docid": "19c1e00a39102dbbc8fdc8c7130bcc83", "score": "0.48506", "text": "function _mash_feeds() {\n var all_items = [].concat.apply([], _.pluck(mb.services, \"content\"));\n pub.all_activities = _.sortBy(all_items, \"pubDate\").reverse();\n }", "title": "" }, { "docid": "be07e78dc68abffd18b3e388c3bcca50", "score": "0.48423186", "text": "function collectionPostEditDropdown() {\n $('[data-behavior=\"edit-post-dropdown-button\"]').each(function(index) {\n if ($(this).data('postauthorid') == $('#body-current-user').data('currentuserid')) {\n $(this).removeClass('hidden');\n };\n });\n}", "title": "" }, { "docid": "7d44a28e0f2801bbd097b4202aedb19b", "score": "0.48356137", "text": "function removefromOpenCards(card) {\n const classes = card.querySelector('i').classList;\n openCards.pop(classes[1]);\n lastCard = '';\n}", "title": "" }, { "docid": "6215a3a6721a2a27eb966415f80da752", "score": "0.48352253", "text": "function display_posts(){\n\n let choosen_interest= document.getElementById(\"interest\").value;\n let displayed_posts = [];\n let number_comments = [];\n //getting the rows based on the interest choosen\n for (let i = 0; i < posts.length; i++){\n let post = posts[i];\n let post_interest = post.interest;\n\n for (let i = 0; i < post_interest.length; i++) {\n if (choosen_interest == post_interest[i]){\n displayed_posts.push(post);\n }\n }\n }\n\n //getting the no. of comments based on each post\n for (let j = 0; j <displayed_posts.length; j++){\n let count = 0;\n for(let i = 0; i < comments.length; i++){\n if(comments[i].postID == displayed_posts[j].id){\n count += 1;\n }\n }\n number_comments.push([count, j]);\n }\n\n // sorting the array\n number_comments.sort();\n number_comments.reverse();\n console.log(number_comments);\n\n\n //outputing the rows of posts\n let display_table = document.getElementById(\"posts-rows\");\n let output_rows = \"<table class='pure-table' id='historyTable'><thead><th>Post Id</th><th>Post Title</th><th>No. of likes</th><th>No. of dislikes</th><th>No. of comments</th><th>Post link</th></thead><tbody>\";\n for (let i = 0; i < number_comments.length; i++){\n let post = displayed_posts[number_comments[i][1]];\n output_rows += \"<tr><td>\" + post.id + \"</td><td> \" + post.title + \" </td><td>\" + post.likes + \"</td><td>\" + post.dislikes + \"</td><td>\" + number_comments[i][0] + \"</td><td>\";\n output_rows += `<div> <button class='btn btn-primary' id='more_btn' onclick=\"transfer_admin_post('${post.id}');\"> View More </button> </div>`;\n output_rows += \"</td></tr>\";\n\n }\n\n output_rows += \"</tbody></table>\";\n display_table.innerHTML = output_rows;\n\n}", "title": "" }, { "docid": "f67fceeb55ad685a032eae06dcf76043", "score": "0.4833041", "text": "function toggleTopbar() {\n if (document.getElementById('postflow') !=null) {\n firstPostY = posts[0].offsetTop - scrollTop;\n if (firstPostY <=65) {\n topBar.classList.add('slide');\n }\n else {\n topBar.classList.remove('slide');\n }\n }\n else if (scrollTop > scrollOrig && scrollTop >= 10) {\n topBar.classList.add('slide');\n }\n else if (scrollTop < scrollOrig && scrollTop < 10) {\n topBar.classList.remove('slide');\n }\n}", "title": "" }, { "docid": "96e55f450afd692d60c6636b5bb0b64e", "score": "0.4832312", "text": "function view_change(next) {\n cards.forEach(card => {card.classList.remove('is-show');});\n next.classList.add('is-show');\n}", "title": "" }, { "docid": "1c3ff8b3bd3aff262c253b2ea8c393d8", "score": "0.48224735", "text": "function flipBack() {\n let selected = document.querySelectorAll('.selected');\n selected.forEach(card => { card.classList.add('nomatch'); }); \n selected.forEach(card => { card.classList.remove('selected'); }); \n let unmatched = document.querySelectorAll('.nomatch');\n unmatched.forEach(card => { card.classList.remove('nomatch'); }); \n cardID = []; // refresh cardsIds array\n cardName = [];\n}", "title": "" }, { "docid": "a0d9b97ece24898af3d3d65ca9f8b324", "score": "0.4820325", "text": "function displayCard(card) {\n\t$(card).addClass('open show');\n}", "title": "" }, { "docid": "0a150e6c9b3b75e55e242d7ecd2e6ba2", "score": "0.4812581", "text": "function getSelectedPosts(cat) {\n if(cat === \"Latest\") {\n getPost(db[0].articleUrl); // sets the articleUrl for Latest\n window.scrollTo(0, 0);\n } else if(cat === \"All\") {\n window.scrollTo(0, 0);\n return db;\n } else {\n var res = [];\n for(var i = 0; i < db.length; i++) {\n \tif(db[i].categories.includes(cat)) {\n \tres.push(db[i]);\n \t}\n }\n window.scrollTo(0, 0);\n return res;\n }\n}", "title": "" }, { "docid": "a3f0d4cd2624dc12c35bf8c5bbd69688", "score": "0.480827", "text": "function showCard(count) {\n\t\n\tif (card[count].className != \"card match\" && card[count].className != \"card open show\")\n\t{\n\t\tcard[count].className = \"card open show\";\n\t\taddMoves();\n\t\taddOpenCard(count)\n checkStarRating();\n\t}\n}", "title": "" }, { "docid": "7f2376d846e42ffc49d22cf28a548277", "score": "0.48054227", "text": "function hideCardShowReverse(number){\r\n\t\t$('#card' + number).show();\r\n\t\t$('#reverse' + number).hide();\r\n\t}", "title": "" }, { "docid": "ef9e5f16f33f25d3d39f68331d4b8e9e", "score": "0.48046246", "text": "function recountColumnTodos(filter) {\n $('.last-content').each(function() {\n var _this = $(this);\n var columnValue = $('.openlucius-board-item:not(.hidden-task)', _this).length;\n\n $('.board-column-counter', _this).text(columnValue > 0 ? columnValue : '');\n\n // If filtering open empty and add closed.\n if (filter === true) {\n // If empty and not closed close.\n if (columnValue == 0 && !_this.hasClass('collapsed')) {\n $('h2', _this).click();\n }\n // If not empty and closed open.\n else if (columnValue > 0 && _this.hasClass('collapsed')) {\n $('h2', _this).click();\n }\n }\n });\n }", "title": "" }, { "docid": "f16ce34db87585a94d036740567c491a", "score": "0.48037952", "text": "function displayCard(){\n if (!this.classList.contains('show') && openCard.length < 2) {\n this.classList.toggle('show');\n\n openCard.push(this);\n\n if (openCard.length === 2) {\n moveCounter();\n checkMatch();\n }\n }\n result();\n}", "title": "" }, { "docid": "2f9373ac81fa863c031bc749a0d04e3b", "score": "0.48025003", "text": "function flipBackForReal() {\n document.querySelectorAll(\".card-flipped\").forEach(element => {\n element.classList.remove(\"card-flipped\");\n })\n }", "title": "" }, { "docid": "5ed209d6396e782c0a1cda0966951e24", "score": "0.48013157", "text": "function clearAllClicked(callback) {\n if ( clearHiddenPostsFromBg() && clearHiddenPostsFromCs() ) {\n $('.post').remove();\n displayStatus([]);\n callback();\n }\n}", "title": "" }, { "docid": "621429e3690e5d045fb9a43787f6fa36", "score": "0.48010463", "text": "getLatestPosts(){\n const NUMBER_LATEST_POSTS = -20;\n this.setState({\n posts : { loading: true }\n });\n //service get function and url are passed to the component\n this.props.service.get(this.props.url.url)\n .then( posts => {\n this.setState({ posts: posts.data.slice(NUMBER_LATEST_POSTS) });\n }, error => {\n this.setState({ errorMessage: 'Unexpected error occurred' });\n });\n }", "title": "" }, { "docid": "7d4bd17efe0b62b39f7b52bda0290ce6", "score": "0.4792172", "text": "function getHeader(){\n\tvar timer4 = setTimeout(function(){\n\t\ta=$('.collapsed')\n\t\ta.find('button.invisPost').show()\n\n\t\ta=$('.post').filter(\":not('.collapsed')\")\n\t\t//a.find('button.invisPost').hide()\t\t\n\t\tfor(i=0;i<a.length;i++)\n\t\t\ta[i].children[1].children[3].children[0].children[1].children[2].style.display=\"none\"\n\t\tconsole.log(\"getHeader\")\n\t},250)\n}", "title": "" }, { "docid": "d1474d5e83f280230963c8aac463c521", "score": "0.47899356", "text": "function FacultyCard({ count, title, desc, img, post }) {\n AOS.init();\n\n return (\n <Card reversed={count % 2 === 1}>\n <Details style={({ textAlign: \"center\" }, { width: \"800px\" },{right:\"200px\"})}>\n {/* <Typewriter\n onInit={(typewriter) => {\n typewriter.typeString(desc).start();\n }}\n /> */}\n <Description>{desc}</Description>\n </Details>\n </Card>\n );\n}", "title": "" }, { "docid": "79db0dd4de849b4e2fc36bec2d958b3e", "score": "0.4784049", "text": "function undoDeletePrePop(cardType) {\n var myDiv = \"#\" + cardType + \"-summary-deleted\";\n $(myDiv).hide();\n var myDiv = \"#\" + cardType + \"-summary\";\n $(myDiv).find(\"#date-container\").show();\n $(myDiv).show();\n var myDiv = \"#\" + cardType + \"-card\";\n $(myDiv)\n .find(\".delete-content\")\n .hide();\n $(myDiv)\n .find(\".edit-content\")\n .show();\n}", "title": "" }, { "docid": "a1ddf514bb21b9db1fd24c2c0c137acd", "score": "0.47839105", "text": "turnCardBack() {\n this.cardArray.forEach((card) => {\n card.classList.remove(\"visible\");\n });\n }", "title": "" }, { "docid": "3b08fbe65aabd0c1b99b9818f896c2a1", "score": "0.4779166", "text": "showOnePost(post) {\n if (post.imageURL) {\n this.tagImg = `<img class=\"card-img-top\" src=\"${HOST + post.imageURL}\" alt=\"photo de l'utilisateur\">`;\n } else {\n this.tagImg = '';\n }\n let date = new Date(post.updateAt);\n insertOnePost.innerHTML += `\n <div class=\"card mb-3\">\n ${this.tagImg}\n <div class=\"card-body\">\n <h5 class=\"card-title\">${post.pseudo} a publié le ${new Intl.DateTimeFormat('fr-FR', { dateStyle: 'full' }).format(date)} </h5>\n <p class=\"card-text\">${post.content}</p>\n <div class=\"d-grid gap-2 d-md-flex justify-content-md-end\">\n <button type=\"button\" class=\"btn btn-secondary btn-sm\" onclick=\"new PostController().getOnePost(${post.id});\">Modifier</button>\n <button type=\"button\" class=\"btn btn-secondary btn-sm\" onclick=\"new PostController().deletePost(${post.id});\">Supprimer</button>\n </div>\n </div>\n </div>`;\n }", "title": "" }, { "docid": "5f63559c48fa484cdfaeb85efd4076e1", "score": "0.4778852", "text": "function displayCard(e) {\r\n if (openCards.length < 2) {\r\n // card.classList.remove('match');\r\n if (e.target.classList.contains('card')\r\n && e.target.classList.contains('open') === false) {\r\n e.target.classList.add('open');\r\n e.target.classList.add('show');\r\n addToOpen(e);\r\n moveCounter();\r\n \r\n }\r\n \r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "cfbd738156048ef6b1e0a24583db583d", "score": "0.47780323", "text": "getTopCard() {\n return this.cards[this.cards.length - 1];\n }", "title": "" }, { "docid": "71894ee3ee7f584a61fc084556def850", "score": "0.47714686", "text": "function renderPosts(){\n let sortedPosts = [...posts];\n sortedPosts = sortedPosts.sort((a, b)=>{\n return new Date(b.createdAt) - new Date(a.createdAt)\n })\n return sortedPosts.map((post, i)=>{\n return <Post key={i} post={post} defaultUrl = {defaultPosts} getPosts={getPosts} editPost={editPost} user={user} myPosts={myPosts} setMyPosts={setMyPosts}/>\n })\n }", "title": "" }, { "docid": "5efc48f58892a97fbbe147fd1342d5a1", "score": "0.47607234", "text": "function myVisionPage() { \n$('.secondView').remove();\n$('.thirdView').show();\n$('.hiddenForm').css('display', 'block');\ngetPosts();\n}", "title": "" }, { "docid": "db89e1e87e95d5243778c0584d8f8340", "score": "0.4755479", "text": "function activeCategory() {\n\tif (topRatedWeek.checked || topRatedMonth.checked || topRatedYear.checked) {\n\t\tsorting = ratedCat;\n\n\t\tspanCategory.innerHTML = 'Top 5 rated videogames';\n\t\tliRated.classList.add('active');\n\t\tliPop.classList.remove('active');\n\t\tliReleased.classList.remove('active');\n\t} else if (topPopWeek.checked || topPopMonth.checked || topPopYear.checked) {\n\t\tsorting = popCat;\n\n\t\tspanCategory.innerHTML = 'Top 5 popular videogames';\n\t\tliRated.classList.remove('active');\n\t\tliPop.classList.add('active');\n\t\tliReleased.classList.remove('active');\n\t} else if (best2012.checked || best2008.checked) {\n\t\tsorting = popCat;\n\n\t\tspanCategory.innerHTML = 'Best 5 videogames in';\n\t\tliRated.classList.remove('active');\n\t\tliPop.classList.remove('active');\n\t\tliReleased.classList.add('active');\n\t}\n}", "title": "" }, { "docid": "233b539322d1bb2ac7f24b86c30be1a0", "score": "0.47536877", "text": "function generateTopPosts(response)\n{\n\tvar results = response.results;\n\n\tif(results.length==0)\n\t{\n\t\t\tnewHTML = \"<div id='EmptyPosts'>No posts yet. Why don't you submit one?</div>\";\n\t\t\tdocument.getElementById(\"TopPosts\").innerHTML = newHTML;\t\t\n\t}\n\telse if(results[0])\n\t{\n\t\t\n\t\t// first we need to sort the list so it's actually a \"top\" listing, because\n\t\t// they come in being sorted by time.\n\t\tresults.sort(sortPosts);\n\t\tresults.reverse();\n\t\t\n\t\tvar newHTML = \"\";\n\t\t\n\t\tvar numPosts;\n\t\t\n\t\tif(results.length > NUM_TOP_POSTS_TO_SHOW)\n\t\t\tnumPosts = NUM_TOP_POSTS_TO_SHOW;\n\t\telse\n\t\t\tnumPosts = results.length;\n\t\t\n\t\t\n\t\t// If there's no posts, put up a message that says that nothing has been posted yet.\n\t\t// This also serves to space out the TopPosts and Recent Posts sections so the images\n\t\t// don't overlap in an ugly way.\n\t\t\n\t\t\t\t\n\t\tfor(var i=0; i< numPosts; i++)\n\t\t{\n\t\t\t// For each set, generate a bunch of HTML.\n\t\t\tvar post = results[i];\n\t\t\tvar postHTML = \"\";\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(!post['Post.id'])\n\t\t\t{\n\t\t\t\t// convert over all the pieces of information we need to the other format.\n\t\t\t\t// The core issue here is that when the data comes in from the datasource, it's\n\t\t\t\t// of the form post['Post.id'], etc. But when it comes in direct from the controller,\n\t\t\t\t// it's of the form post['Post']['id']. I'm not sure why this is, but this seems to\n\t\t\t\t// be a reasonable way to fix it.\n\t\t\t\tpost['Post.id'] = post['Post']['id'];\n\t\t\t\tpost['Post.pos_votes'] = post['Post']['pos_votes'];\n\t\t\t\tpost['Post.neg_votes'] = post['Post']['neg_votes'];\n\t\t\t\tpost['Post.body'] = post['Post']['body'];\n\t\t\t\tpost['User.name'] = post['User']['name'];\n\t\t\t\tpost['User.affiliation'] = post['User']['affiliation'];\n\t\t\t\tpost['Post.age'] = post['Post']['age'];\n\t\t\t\tpost['Post.isDemoted'] = post['Post']['isDemoted'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(post['Post.isDemoted']) {\n // Skip this one if it's demoted - we don't want to show\n // demoted posts in the top listing.\n\t\t\t continue;\n\t\t\t}\n\t\t\t\n\t\t\t// TODO Convert this over to DOM scripting. Will make button addition\n\t\t\t// more graceful, as well as being a little less rigid.\n\t\t\t\n\t\t\t// This is going to need some IDs for scriptability.\n\t\t\tpostHTML += \"<div class='post-container'>\";\n\t\t\tpostHTML += \"<div class='voting'>\";\n\t\t\tpostHTML += '<span id=\"VoteUp-' + post['Post.id'] + '\" class=\"yui-button vote-up\"><span class=\"first-child\"><button type=\"button\">'+ post['Post.pos_votes']+'</button></span></span>';\n\t\t\tpostHTML += '<span id=\"VoteDown-' + post['Post.id'] + '\" class=\"yui-button vote-dn\"><span class=\"first-child\"><button type=\"button\">'+ post['Post.neg_votes']+'</button></span></span>';\n\t\t\t\n\t\t\tif(showAdmin)\n\t\t\t{\n\t\t\t\tpostHTML += '<span id=\"Answered-' + post['Post.id'] + '\" class=\"yui-button answered\"><span class=\"first-child\"><button type=\"button\"></button></span></span>';\n\t\t\t\tpostHTML += '<span id=\"Delete-' + post['Post.id'] + '\" class=\"yui-button delete\"><span class=\"first-child\"><button type=\"button\"></button></span></span>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Was having troubles getting this to go behind the moderation buttons when they're shown.\n\t\t\t\t// Now, just don't print it if we're in admin mode.\n\t\t\t\tpostHTML += '<div class=\"rank\">' + (i+1) + \"</div>\";\n\t\t\t}\n\t\t\t\n\t\t\tpostHTML += '</div>';\n\t\t\t\n\t\t\tpostHTML += '<div class=\"post\">';\n\t\t\tpostHTML += '<div class=\"content\">';\n\t\t\tpostHTML += post['Post.body'];\n\t\t\tpostHTML += \"</div>\";\n\t\t\t\n\t\t\tpostHTML += '<div class=\"footer\">';\n\t\t\tpostHTML += '<div class=\"attribution\">';\n\t\t\tpostHTML += '<span class=\"name\">' + post['User.name'] + '</span> ';\n\t\t\tpostHTML += '<span class=\"affiliation\">' + post['User.affiliation'] + '</span>';\n\t\t\tpostHTML += '</div>';\n\t\t\tpostHTML += \"<div class='age'>posted \"+ post['Post.age']+\" ago</div>\";\n\t\t\tpostHTML += \"</div></div></div></div>\";\n\t\t\t\n\t\t\t\n\t\t\tnewHTML += postHTML;\n\t\t}\n\t\t\n\t\tdocument.getElementById(\"TopPosts\").innerHTML = newHTML;\n\t\t\n\t\taddTopPostVoteButtons();\n\t}\n}", "title": "" }, { "docid": "b4a60b6f1811cf79559b5c0599f2d977", "score": "0.47524923", "text": "function GetRecentPosts() {\n const context = React.useContext(SidebarContext)\n if (context) {\n if (context.data.length > 0) {\n return context.data.reverse().map (selectedLink => {\n return <div> <a href={\"/blog/\"+selectedLink._id}> {selectedLink.title} </a> </div>\n })\n }\n }\n return <div/>\n }", "title": "" }, { "docid": "d3a0e562116aa6b347e7f4b77c1b8e41", "score": "0.47501227", "text": "function adjustPostCardsHeight() {\n if (!isMobile) { // no need to adjust height for mobile devices\n let postCardHolder = document.getElementById(\"post-cards\");\n if (postCardHolder == null ){\n return\n }\n let el = postCardHolder.children;\n let maxHeight = 0;\n for (let i = 0; i < el.length; i++) {\n if (el[i].children[1].clientHeight > maxHeight) {\n maxHeight = el[i].children[1].clientHeight;\n }\n }\n for (let i = 0; i < el.length; i++) {\n el[i].children[1].setAttribute(\"style\", \"min-height: \" + maxHeight + \"px;\")\n }\n }\n }", "title": "" }, { "docid": "9d2e3cdbfcf953386e19353093cc1851", "score": "0.4745047", "text": "function changeCardDisplayDimension() {\n $(\".popup-box\").toggleClass(\"cardDisplayFull\");\n}", "title": "" }, { "docid": "a98e77b70af5ee5abf8164b056eb4ddd", "score": "0.47441086", "text": "_renderCardsList(incomeCards) {\n const filmCardsCount = this._getFilmCards().length;\n\n const filmCards = incomeCards ? incomeCards\n : this._getFilmCards()\n .slice(0, Math.min(filmCardsCount, FILM_CARD_AMOUNT_PER_STEP));\n\n this._renderCards(filmCards);\n\n if (filmCardsCount > this._renderedFilmCards) {\n this._renderLoadMoreButton();\n }\n }", "title": "" }, { "docid": "d1b04bb1f54ddbc66ef522747ac15ac8", "score": "0.47425973", "text": "function displayCard(card) {\n $(card).addClass(\"open show animated flip\");\n}", "title": "" }, { "docid": "f281693ac410a05c6bc870d437a9006b", "score": "0.47389105", "text": "fetchMorePosts() {\n const { fetchMorePosts, currentGallery, postsByCategory } = this.props\n const { lastItemFetchedId } = postsByCategory[currentGallery]\n fetchMorePosts(currentGallery, lastItemFetchedId)\n }", "title": "" }, { "docid": "0fc390a4e66cdda6aa2e5fc375b9538f", "score": "0.47388116", "text": "function cardSwitch(){\n\tvar $caseList = $('.case__list');\n\tif(!$caseList.length){return;}\n\n\t$('.card-switcher-js').on('click', function () {\n\t\tvar $switcher = $(this);\n\t\tvar $itemCard = $switcher.closest('.case__item').siblings();\n\t\t$itemCard.removeClass('contacts-opened');\n\n\t\tvar $itemCardCurrent = $switcher.closest('.case__item');\n\t\tif($itemCardCurrent.hasClass('contacts-opened')){\n\t\t\t$itemCardCurrent.removeClass('contacts-opened');\n\t\t\treturn;\n\t\t}\n\n\t\t$itemCardCurrent.addClass('contacts-opened');\n\t})\n}", "title": "" }, { "docid": "06389a49e13b2af41b064adbaa3ea528", "score": "0.47380862", "text": "function toggleCard(card){\n card.classList.toggle('open');\n card.classList.toggle('show');\n }", "title": "" }, { "docid": "56290a67efcd88ac2c54b1bb09fcbc87", "score": "0.47352177", "text": "postList() {\r\n return this.state.list_of_posts.map(post =>\r\n <div class=\"card row post_items m-2\" key={post._id}>\r\n <div class=\"col-md-12\">\r\n <div class=\"bg-white p-4 d-block d-md-flex align-items-center\">\r\n <div class=\"mb-4 mb-md-0 mr-5\">\r\n <div class=\"d-flex align-items-center\">\r\n <h2 class=\"mr-3 text-black\"><Link to={\"/view/\" + post._id}>{post.post_title}</Link></h2>\r\n <div class=\"badge-wrap\">\r\n <span class=\"bg-primary text-white badge\">{post.post_catagories}</span>\r\n </div>\r\n <div class=\"ml-4\">${post.post_budget}</div>\r\n </div>\r\n <div class=\"d-block d-md-flex\">\r\n <div class=\"mr-3 overflow ellipsis\"><span class=\"icon-layers\"></span>{post.post_description} </div>\r\n <div><i class=\"fa fa-map-marker\"></i><span> {post.province}, {post.country}</span></div>\r\n </div>\r\n </div>\r\n <div class=\"ml-auto d-flex\">\r\n <Moment format=\"DD/MM/YYYY\" className=\"mr-2\">{post.post_date}</Moment>\r\n <div><Link to={\"/update/\" + post._id} className=\"btn btn-primary mr-2\">Edit</Link>\r\n <button onClick={() => this.deletePost(post._id)} className=\"btn btn-danger\">Delete</button></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "bf97bd5bd3c1bda391a42dac595c34a2", "score": "0.4727252", "text": "function closeCard() {\n openCard[0].classList.toggle('show');\n openCard[1].classList.toggle('show');\n openCard = [];\n }", "title": "" }, { "docid": "aa204deba68338fc69a8a506a0332d13", "score": "0.47258157", "text": "function flipCard() {\n\n let $this = $(this);\n\n // Unless under these conditions,\n // fixed card should be the center one when easy or hard modes are chosen (odd total number of cards)\n if ($this.hasClass('show') || $this.hasClass('match') || $this.html() === '<i class=\"fa fa-fixed\"></i>') {\n return true;\n }\n\n card = $this.html();\n $this.addClass('open show');\n // The openCards array stores added cards facing up for the upcoming comparison with checkMatch function\n openCards.push(card);\n checkMatch();\n }", "title": "" }, { "docid": "bdf899c45a22fc749304adcea90aaa0e", "score": "0.47244036", "text": "toggleMore() {\r\n this.setState({\r\n show: !this.state.show,\r\n currentReview: this.props.review.review\r\n });\r\n }", "title": "" }, { "docid": "1a164d12407484a7021927cee64e8f1e", "score": "0.4718002", "text": "sortByMostActive () {\n this.chainData = this.chainData.sort((a, b) => {\n return a.pullRequests.length > b.pullRequests.length ? -1 : 1\n })\n\n return this\n }", "title": "" }, { "docid": "812c4fd7373366fa53cbca7a6094e312", "score": "0.47154087", "text": "function sortPosts(feed) {\n //Remove all post children and add them to an array\n //The first child in the feed div on a profile page is the profile info so ignore that\n let posts = []\n while (feed.firstChild.nextSibling) {\n posts.push(feed.lastChild)\n feed.removeChild(feed.lastChild);\n }\n\n //Sort the posts based on their ID (higher id = newer post)\n posts.sort(function(a,b ){\n let aId = parseInt(a.getElementsByClassName(\"id\")[0].textContent)\n let bId = parseInt(b.getElementsByClassName(\"id\")[0].textContent)\n return bId - aId\n })\n\n //Re-append the sorted posts in order\n for (let i = 0; i < posts.length; i++) {\n feed.append(posts[i])\n }\n}", "title": "" } ]
4f46731a405befa80c882be2098b55ca
function for reseting password field
[ { "docid": "675d90ca4c3f9593d9f8ccd484f1ce6b", "score": "0.0", "text": "function check2() {\n if (password.value !== \"\") {\n password.style.borderColor = 'lightgray';\n passwordIcon1.style.display = 'none';\n passwordIcon2.style.display = 'none';\n passwordError.style.display = 'none';\n enterPassword.style.display = 'none';\n }\n}", "title": "" } ]
[ { "docid": "f6ca6bfad43c7b9cdbacada5203066b8", "score": "0.78929174", "text": "resetPassword(token) {\n\n\t}", "title": "" }, { "docid": "3e704db4610498478443c27beb5cbc3f", "score": "0.77680534", "text": "function resetPassword() {\n var password = newPassword;\n var passwordText = document.querySelector(\"#password\");\n console.clear();\n var password = newPassword;\n passwordText.value = password;\n // location.reload();\n }", "title": "" }, { "docid": "78edda446d90a70ab3dc1c6e2b634ae4", "score": "0.7705935", "text": "localResetPassword() {\r\n resetPassword(this.state.email);\r\n }", "title": "" }, { "docid": "1d0194e2877e842044cfc9d5a858524f", "score": "0.7594175", "text": "function passwordReset(req, res) {\n _passwordReset(req, res, _render, _redirect);\n}", "title": "" }, { "docid": "956d8dafaea3b79fbdb8a4bb6c7554ec", "score": "0.7501165", "text": "function changePassword() {\n\n}", "title": "" }, { "docid": "ee935752d868df69cc43ddac66f503c4", "score": "0.749359", "text": "function resetPassword() {\n vm.objData.strToken = $state.params.strToken;\n $rootScope.isProcessing = true;\n\n return AuthService.resetPassword(vm.objData, function(objErrs) {\n $rootScope.isProcessing = false;\n if (objErrs) {\n return (vm.objErrs = objErrs);\n }\n vm.objData = {};\n return $state.go('resetPasswordComplete');\n });\n }", "title": "" }, { "docid": "ea631789dbe1687db4d9dd805877f93e", "score": "0.74924517", "text": "function reset() {\n setCriteria = \"\";\n password = \"\";\n passwordLength = \"\";\n}", "title": "" }, { "docid": "0c2ff8ef2720c06c6cc1e93619a2d8d8", "score": "0.7476066", "text": "function resetHandlerPass(name) {\r\n\r\n var password = document.getElementById('password').value;\r\n var newPassword = document.getElementById('newPassword').value;\r\n var confirmPassword = document.getElementById('confirmPassword').value;\r\n\r\n\r\n\r\n if (password != '' || newPassword != '' || confirmPassword != '') {\r\n document.getElementById('password').innerHTML = '';\r\n document.getElementById('newPassword').innerHTML = '';\r\n document.getElementById('confirmPassword').innerHTML = '';\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "8090e91345e8b5b9cf558fe78a81f50e", "score": "0.7324765", "text": "resetPin() {\n if (!this.passwordDecrypted) {\n this.set('password.frontendCrypted', false)\n }\n this.send('setPassword');\n }", "title": "" }, { "docid": "f21afee0cf377dc5041591e1eb74b221", "score": "0.73121566", "text": "ChangePassword(string, string) {\n\n }", "title": "" }, { "docid": "2894c2c0a1edc6a5f930107b6af211f7", "score": "0.7297388", "text": "function reset() {\n passwordText.value = \"\";\n passwordArray = [];\n fullArray = [];\n passwordNumbers = false;\n passwordCharacters = false;\n passwordUppercase = false;\n passwordLowercase = false;\n}", "title": "" }, { "docid": "549820684b1f6860e2c25128a393a282", "score": "0.72901094", "text": "function reset() {\n console.log(\"function: reset\");\n\n // Reset password variable\n password = [];\n\n // Reset dots in entry area\n $(\"#entryText\").html(\"\");\n}", "title": "" }, { "docid": "0a1f048ac598b45d61f3a6a44f038b89", "score": "0.7238677", "text": "function resetPassword(email, newPassword, resetkey, callback)\n {\n var serviceUrl = \"/perc-membership-services/membership/pwd/reset/\" + resetkey;\n var pwResetObj = {\"email\":email, \"password\":newPassword};\n\n $.PercServiceUtils.makeXdmJsonRequest(null, serviceUrl, $.PercServiceUtils.TYPE_POST, function(status, results)\n {\n \tif(status == $.PercServiceUtils.STATUS_SUCCESS)\n \t{\n \t\tcallback(status,results.data);\n \t\t}\n else\n {\n \tvar defMsg = $.PercServiceUtils.extractDefaultErrorMessage(results.request);\n callback(status, defMsg);\n }\n }, pwResetObj);\n }", "title": "" }, { "docid": "0e244c846239b9e71c155ececcd97512", "score": "0.72386575", "text": "forgotPassword() {\n\n }", "title": "" }, { "docid": "86d993115f1782cfa74b024c1f59d66b", "score": "0.7225763", "text": "function _resetPassword(barePassword,next){\n if(_.isFunction(barePassword)){\n next = barePassword\n barePassword = crypto.randomBytes(24).toString('base64')\n }\n return ssha.ssha_pass(barePassword,function(err,hash){\n return next(err,hash,barePassword)\n });\n}", "title": "" }, { "docid": "d534bc5834300be95ef245dc822b35bd", "score": "0.7210918", "text": "function resetPassSetUp(username, email) {\n $(\"#email-field\").attr(\"value\", email);\n $(\"#customer-no-field\").attr(\"value\", username);\n}", "title": "" }, { "docid": "d8e7105861a1ea61828eb037218a9897", "score": "0.715305", "text": "function reset(){\n $('input[type=text]').val(''); \n $('input[type=password]').val('');\n \n}", "title": "" }, { "docid": "7b9eb9a1834a6abfed5ddf2d3a271fa7", "score": "0.7119107", "text": "resetPassword(token, password) {\n return instance.put(`/users/forgotPassword?token=${token}`, {password: password});\n }", "title": "" }, { "docid": "e694856f696d54400764931c054541c4", "score": "0.7110885", "text": "static async resetPassword(req, res) {\n const userPresent = await UserController.findUser('resettoken', req.body.token);\n if (!userPresent) {\n return res.status(404).json({\n status: 404,\n error: 'password has already been reset',\n });\n }\n const salt = await bcrypt.genSalt(10);\n const password = await bcrypt.hash(req.body.password, salt);\n await db.query(`UPDATE users SET resettoken = $1, resetexpire = $2, password = $3\n WHERE id = $4`, ['', '', password, userPresent.id]);\n return res.status(200).json({\n status: 200,\n data: [{ message: 'Password has been suucessfully reset' }],\n });\n }", "title": "" }, { "docid": "f68198794a72f63f2780b633f3c0a6e7", "score": "0.7098023", "text": "function Clear_User_After_Password_Reset() {\n $(\"#txtNewPassword\").removeClass('is-invalid');\n $(\"#txtNewPassword\").removeClass('is-valid');\n }", "title": "" }, { "docid": "e09b5e832ad4010c60cf9577efed60a5", "score": "0.7097903", "text": "resetPassword() {\n\t\tconst { email } = this.state;\n\t\tFirebaseFunctions.resetPassword(email);\n\t\tthis.setState({ emailSent: true });\n\t}", "title": "" }, { "docid": "9e62332a7d7680d920bf1c62936ce387", "score": "0.70900214", "text": "function resetPassword(req,next){\n loadUser(req,function(err,user){\n if(err) return next(err);\n _resetPassword(function(err,hash,barePassword){\n if(err){\n console.log(err)\n return next(err);\n }\n user.userpassword=hash;\n var change = new ldap.Change({\n operation: 'replace',\n modification: {\n userpassword: hash\n }\n });\n async.series([function(cb){\n _saveChange(getDSN(user),change,cb)\n }\n ]\n ,function(err){\n next(err,user,barePassword)\n });\n return null;\n });\n return null\n });\n}", "title": "" }, { "docid": "937fea6187058b192fa5ff58ee4511a0", "score": "0.70859355", "text": "function handleResetPassword(e) {\n e.preventDefault();\n var self = $(this);\n if (self.validate().form()) {\n var email = $(\"#perc-registration-email-field\").val();\n var password = $(\"#perc-registration-password-field\").val();\n var resetKey = self.data(\"key\");\n $.PercMembershipService.resetPassword(email, password, resetKey, function(status, data) {\n if(status == $.PercServiceUtils.STATUS_SUCCESS)\n {\n // If successful login, store the ID session in a cookie and redirect to corresponding page\n $.cookie('perc_membership_session_id'\n , data.sessionId\n , { \"path\": \"/\", \"expires\": \"null\" });\n // After successfully resetting the password - take user to home page fo website. \n window.location.replace(\"/\");\n\n }\n else\n {\n alert(data.message);\n }\n });\n }\n return false;\n }", "title": "" }, { "docid": "dd08ab0f8f2a915c0cb0a8e084b7a0dd", "score": "0.7074228", "text": "function resetPassword(req, res, next){\n const data = new User({\n password: '',\n });\n\n User.updatePassword(req.params.id, data, next, (err, object)=>{\n if(err){return next(err);}\n\n res.status(200).json({'message': 'Password restarted successfully'});\n })\n}", "title": "" }, { "docid": "074a62a02391890ef315fde686a98368", "score": "0.70125", "text": "resetPassword({ username, password }, callback) {\n const db = DB.connect();\n\n db.serialize(() => {\n this._tablesChecker(db);\n\n db.run(`\n UPDATE ${UserAccount.schema.tableName}\n SET faltyAccess=0, password=?, login_secrete=NULL\n WHERE username=?\n `, [password, username], err => {\n if (err) {\n callback(new DBError.DBError(500, `${err.code} (${err.errno})`));\n } else {\n callback(null, \"Success!\");\n }\n });\n });\n\n db.close();\n }", "title": "" }, { "docid": "0ce79249f2adc4219d41b8b09a35ef1a", "score": "0.69965565", "text": "function savePasswordReset(req,res) {\n\n var args = utils.copy( { acct: loginstate.getID(req) }, req.body );\n \n var resetPW = profile.resetPasswordForLoggedInUser( args, function(code,err) { \n var title = \"Password\";\n if( code == CODES.SUCCESS )\n {\n res.outputMessage( \n page.MESSAGE_LEVELS.success,\n title,\n \"Password successfully reset.\"\n ); \n }\n else if( code == CODES.NO_RECORDS_UPDATED )\n {\n res.outputMessage( \n page.MESSAGE_LEVELS.error,\n title,\n \"Invalid current password for account. Passord not reset.\"\n ); \n }\n \n res.render( page.MESSAGE_VIEW, {pageTitle:title} );\n \n } );\n \n resetPW.handleErrors( req, res ).perform();\n}", "title": "" }, { "docid": "2c7c8386d258e4f6b462340d94b22429", "score": "0.6993538", "text": "clearPasswordFields() {\n document.querySelector(\"#newPassword\").value = \"\";\n document.querySelector(\"#confirmPassword\").value = \"\";\n }", "title": "" }, { "docid": "bdbb7f1fefa10bc4c36e233d911e338f", "score": "0.6984898", "text": "async resetPasswd() {\n\n let password = this.ctx.request.body.password;\n const token = this.ctx.query.token;\n\n // validate token is right or not\n const tokLen = token.toString().length;\n if (tokLen !== 32 && tokLen !== 64 && token !== 128 && token !== 256) {\n this.response(403, 'token error');\n return;\n }\n\n const email = this.service.crypto.decrypto(token);\n \n // Token error\n if (!await this.service.users.exists(email)) {\n this.response(403, 'token error');\n return;\n }\n\n // reset password\n password = this.service.crypto.encrypto(password);\n if (!await this.service.users.update({ password }, { email })) {\n this.response(403, 'reset password failed');\n return;\n }\n\n // set email and password to cookies and redirect to ico dashbord\n this.setCookies(email, password);\n this.ctx.redirect('/public/ico/dashbord.html');\n }", "title": "" }, { "docid": "b3b8507451896afcdd2637389784f0ce", "score": "0.69121706", "text": "function reset_password( id, name )\n{\n var input_box=confirm(\"Do you really want to reset the password for '\" + name + \"'?\");\n if (input_box==true) \n { \n // Set the hidden value this data\n var hiddenfield = document.getElementById('admin_user_reset');\n hiddenfield.value = id;\n \n // Submit this\n document.itemNavForm.submit();\n }\n\t\n\t// Return false to prevent another return trip to the server\n return false;\n}", "title": "" }, { "docid": "de55c75b222b124020e9df924bbdc406", "score": "0.6902376", "text": "function reset() {\n length = '';\n isLower = false;\n isUpper = false;\n isNumbers = false;\n isSymbols = false;\n password = '';\n writePassword();\n}", "title": "" }, { "docid": "d71f8fcf913b77c046e5be40443711f8", "score": "0.6896416", "text": "function handleResetPwdRequest(e) {\n e.preventDefault();\n var self = $(this);\n if (self.validate().form()) {\n var email = $(\"#perc-registration-email-field\").val();\n var redirectUrl = $(\"input[name='perc_password_reset_page']\").val();\n $.PercMembershipService.resetPwRequest(email, redirectUrl, function(status, data) {\n if(status == $.PercServiceUtils.STATUS_SUCCESS)\n {\n if(data.status == \"AUTH_FAILED\") {\n $(\".perc-reg-error-message\").show().html(data.message);\n }\n else {\n //On Reset Request Successful show the confirmation message.\n $(\".perc-confirmation-message\").show();\n $(\"#perc-password-request\").remove();\n $(\".perc-reg-error-message\").hide(); \n }\n \n }\n else\n {\n alert(data.message);\n }\n });\n }\n return false;\n }", "title": "" }, { "docid": "02c09b52d59ac301f39db81c0930cc7e", "score": "0.68668705", "text": "resetPassword() {\n this.$http.post('/api/v1/password/reset', {token: this.ui.token, password: this.ui.password})\n .then(() => {\n this.$state.go('signin');\n\n this.Messages.showInfo('Password successfully changed');\n })\n .catch(({data, state}) => {\n if (state === 503)\n this.$state.go('signin');\n\n this.Messages.showError(data);\n });\n }", "title": "" }, { "docid": "1c51f8502392fb7907b630c4118076c8", "score": "0.68606347", "text": "function ResetModalMK() {\n $(\"#txtTK_ID_editMK\").val(\"\");\n $(\"#txtTK_PASSWORD_editMK\").val(\"\");\n}", "title": "" }, { "docid": "c400db7d63f647b181fb8c8c5b0e5373", "score": "0.68405074", "text": "resetForm() {\n this.form.reset();\n this.usernameField.value = \" \";\n this.passwordField.placeholder = \" \";\n this.alertMessage.classList.add('hide-alert');\n }", "title": "" }, { "docid": "65c5d2d5d08fe03149c8b4f50f3e91b9", "score": "0.6836716", "text": "function handlePwReset() {\n\t\tEventEmitter.emit('LoginForm:unmount');\n\t\tEventEmitter.emit('pwResetForm:mount');\n\t}", "title": "" }, { "docid": "84240608722609e90b198ffd1f209671", "score": "0.68338674", "text": "function clearPasswordResetForm()\n{\n\t$(\"#passwordResetUserName\").val(\"\");\n $(\"#passwordResetAnswer1\").val(\"\");\n $(\"#passwordResetAnswer2\").val(\"\");\n $(\"#newPassword\").val(\"\");\n $(\"#newPassword2\").val(\"\");\n $(\"#userID\").val(\"\");\n $(\"#PasswordResetMsg\").val(\"\");\n}", "title": "" }, { "docid": "6e8ddc54258c4a7f307d9ee05271dec9", "score": "0.68172973", "text": "function getpassword_pwdreset() {\n\t$('.password-verdict, .progress').show();\n}", "title": "" }, { "docid": "93d4301d8a14a45cc9df0c71d44107a6", "score": "0.6804808", "text": "function resetPasscodeInputs() {\n $scope.inputs.passcode = null;\n $scope.inputs.passcodeConfirm = null;\n }", "title": "" }, { "docid": "98ad72db4d2ebbfddcffa71b657a8394", "score": "0.68038803", "text": "function resetViaEmail() {\n\t//clear .errorMsg area\n\t$('#resetForm .errorMsg').text('');\n\t\t\n\t//get form values\n\tvar error_flag = false;\n\tvar email = $('#resetForm input[name=reset_email]').val();\n\tif(email === \"\") {\n\t\t$('#resetForm .errorMsg').text(\"Email address is required\");\n\t\terror_flag = true;\n\t}else if( !/^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/.test(email) ) {\n\t\t$('#resetForm .errorMsg').text(\"Please enter a valid email address\");\n\t\terror_flag = true;\n\t}else if(error_flag == false) {\n\t\tFUNCTION_NAME = 'resetPasswordAjax';\n\t\tPARAM = {email:email};\n\t\txajax_MGRequestAjax(FUNCTION_NAME,PARAM);\n\t}\n}", "title": "" }, { "docid": "1e552c6d625a2196ebbfb26e35f3df1c", "score": "0.6801387", "text": "function resett() {\n event.preventDefault();\n var emm = getVal('email2');\n console.log(emm);\n window.alert(\"Are you sure that you want to reset your password\");\n //Transfer control to firebase-auth SDK\n fireAuth.sendPasswordResetEmail(emm).then(function() {\n // Email sent, display notification to users\n window.alert(\"Request Accepted Successfully\" + '\\n' +\n \"Instruction had been sent to your requested email address\" + '\\n' +\n \"Click OK to proceed to login page\");\n window.location.replace('auth.html');\n }).catch(function(error) {\n //Some error occured, handle below\n console.log(error.code + '\\n' + error.message);\n window.alert(error.message);\n });\n}", "title": "" }, { "docid": "9964bcaf615ead16b22c4406e7af0eec", "score": "0.6798751", "text": "function resetPassword(id) {\n var textField = document.getElementById(\"hiddenResetPwd\");\n var button = document.getElementById(\"resetPasswordButton\")\n textField.style.display = \"block\";\n button.style.display = \"none\";\n}", "title": "" }, { "docid": "165506ceadf8e96fc5b90633081cd79e", "score": "0.67820126", "text": "resetPassword(nonce, password) {\n return axios.post('backend://set-new-password', { nonce, password });\n }", "title": "" }, { "docid": "204154912f782c745175b3d5913eafc5", "score": "0.67815965", "text": "function forgotPassword() {\n $rootScope.isProcessing = true;\n\n return AuthService.forgotPassword(vm.strEmail, function(objErrs) {\n $rootScope.isProcessing = false;\n if (objErrs) {\n return (vm.objErrs = objErrs);\n }\n vm.strEmail = '';\n return $state.go('resetPassword');\n });\n }", "title": "" }, { "docid": "4b04ae64c6eaadd5de7340081df6de65", "score": "0.6771935", "text": "refreshPassword() {\n this.send('GeneratorPassword');\n }", "title": "" }, { "docid": "18ab04890dfd27b09c44eb08ec557305", "score": "0.677144", "text": "function resetPassword() {\n var emailFilter = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9-])+.+([a-zA-Z0-9]{2,4})+$/; //requirements for writing a email\n var txt;\n var email = prompt(\"If you want a new password sent to your email, please enter your email below:\"); //this text appears in the pop-up box\n if (email == null || email == \"\"){\n txt = \"No email was sent\"; //if the users doesn't fill in text or closes the pop-up box, a text with 'no mail was sent' will appear\n } else if (!emailFilter.test(email)) {\n alert(\"Please enter a valid email address.\")\n txt = \"No email was sent\"; //if the user don't meet the email requirements, the text will also say no email was sent\n } else {\n txt = \"An email was sent to \" + email; //if the user fill in the email, this text will appear + the email the user wrote\n }\n document.getElementById(\"passwordReset\").innerHTML = txt;\n }", "title": "" }, { "docid": "76bb20c7b14c1f6d6aa04a1d43f73dd6", "score": "0.67619956", "text": "async resetPassword(password) {\n let code = getParameterByName(\"code\")\n return await fetch('https://api.hayatemoon.com/auth/reset-password', {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n code,\n password,\n passwordConfirmation: password\n }),\n }).then(r => r.json())\n }", "title": "" }, { "docid": "6575e58478db3398855883af3d446030", "score": "0.6743875", "text": "async function DoResetPassword() {\n LoaderShow();\n var token = $('#txt_reset_token').val();\n if (token === null || token === undefined)\n ShowError(\"Token is required.\");\n var password = $('#txt_reset_password').val();\n if (password === null || password === undefined)\n ShowError(\"Password is required.\");\n var confirmPassword = $('#txt_reset_confirm_password').val();\n if (confirmPassword === null || confirmPassword === undefined)\n ShowError(\"Token is required.\");\n var model = {\n token: token,\n password: password,\n confirmPassword: confirmPassword\n };\n let res = await PostMethodWithoutToken(apiEndPoints.resetPassword, model);\n if (res !== null && res !== undefined) {\n ShowSuccess(res.message);\n }\n LoaderHide();\n}", "title": "" }, { "docid": "955939015a3cd3dd1604ea7995f2ca5b", "score": "0.67108", "text": "function matchNewPasswordBeforeSubmit() {\r\n\r\n}", "title": "" }, { "docid": "2357f8eba57a7d05267ba377fea7e308", "score": "0.67016673", "text": "function resetPassword( )\n{\n if ($('#useracct_resetpass').valid() == false)\n return;\n\n var userKey = $(\"#EmailAddress\").val();\n var regnKey = $(\"#regnkey\").val();\n\n var oldPass = $('#currentpasstxtid').val();\n var newPass = $('#newpasstxtid').val();\n\n showAjaxLoader();\n\n $.ajax({\n type: \"POST\",\n url: getBaseURL() + \"/UserAcctMgmtServlet\",\n data:\n {\n 'RequestType': 'ResetPassword',\n 'UserKey': userKey,\n 'RegnKey': regnKey,\n 'OldPassword': oldPass,\n 'NewPassword': newPass,\n },\n cache: false,\n success: function(notifydata)\n {\n hideAjaxLoader();\n\n if (notifydata.result == \"success\")\n {\n ShowToast(notifydata.message, 2000);\n\n //$(\"#user_acct_mgmt_err\").text(\"\");\n }\n\n else\n {\n //alert(\"failed\");\n $(\"#pass_err\").text(notifydata.message);\n $(\"#pass_err\").show();\n }\n },\n error: function(xhr, textStatus, errorThrown)\n {\n $(\"#pass_err\").show();\n $(\"#pass_err\").text(\"Unexcepted error occur. Please try again.\");\n\n hideAjaxLoader();\n }\n });\n}", "title": "" }, { "docid": "f42185989e097e3a4109e0cb6429f4c2", "score": "0.6693431", "text": "function sendPwdReset(){\n\t$.ajax({\n\t\tmethod: 'POST',\n\t\tdataType: \"json\",\n\t\turl: actions.user.ActPwdRst,\n\t\tdata: $(\"#frmPwdRst\").serialize(),\n\t\tsuccess: function(data) {\n\t\t\tactions.Error(\"Debug\", data);\n\t\t\t\t\n\t\t\t},\n\t\t\terror: function (xhr, ajaxOptions, thrownError){\n\t\t\t\tactions.Error(\"Debug\", xhr.statusText);\n\t\t\t\tactions.Error(\"Debug\", ajaxOptions);\n\t\t\t\tactions.Error(\"Debug\", thrownError);\n\t\t\t},\n\t\t});\n}", "title": "" }, { "docid": "e2f822b9460398fcbcbadf583f031684", "score": "0.66889614", "text": "function resetform(){\n\t\t\tdocument.getElementById(\"username\").value=\"\";\n\t\t\tdocument.getElementById(\"one\").innerHTML=\"\";\n\t\t\tdocument.getElementById(\"pwd\").value=\"\";\n\t\t\tdocument.getElementById(\"two\").innerHTML=\"\";\n\t\t\tdocument.getElementById(\"yzm\").value=\"\";\n\t\t\tdocument.getElementById(\"three\").innerHTML=\"\";\n\t\t\t\n\t\t}", "title": "" }, { "docid": "e6e4278782e5d8398e63e4a91e9ba022", "score": "0.6682384", "text": "function resetPwRequest(email, pwResetPageUrl, callback)\n {\n var serviceUrl = \"/perc-membership-services/membership/pwd/requestReset\";\n //TODO needs to be fixed...\n pwResetPageUrl = window.location.protocol + '//' + window.location.host + pwResetPageUrl;\n \n var pwResetObj = {\"email\":email, \"redirectPage\":pwResetPageUrl};\n\n $.PercServiceUtils.makeXdmJsonRequest(null, serviceUrl, $.PercServiceUtils.TYPE_POST, function(status, results)\n {\n \tif(status == $.PercServiceUtils.STATUS_SUCCESS)\n \t{\n \t\tcallback(status,results.data);\n \t\t}\n else\n {\n \tvar defMsg = $.PercServiceUtils.extractDefaultErrorMessage(results.request);\n callback(status, defMsg);\n }\n }, pwResetObj);\n }", "title": "" }, { "docid": "4ccb9ba3ca100df275c07f14678cb68c", "score": "0.66823506", "text": "function changeAdminPassword(){\n $('.AdminPassword').val(null); \n $('#ChangeAdminPassword').modal({\n show: true,\n keyboard: false,\n backdrop: 'static'\n }); \n }", "title": "" }, { "docid": "f582e796c84c0d798615272b9f259fbc", "score": "0.6679912", "text": "function generatePassword(){\n\n}", "title": "" }, { "docid": "264f90bc46d7fe8d5cf29f2c278ae64f", "score": "0.666871", "text": "fillPassword(value)\n\t{\n\t\tconst field=cy.get('#dwfrm_login_password')\n\t\tfield.clear()\n\t\tfield.type(value)\n\t\treturn this\n\t}", "title": "" }, { "docid": "80895ff4469ce9858759eface6da9362", "score": "0.66499037", "text": "async resetPassword(parent, args, ctx, info) {\n // 1. check if the passwords match\n if (args.password !== args.confirmPassword) {\n throw new Error(\"Yo Passwords don't match!\");\n }\n // 2. check if its a legit reset token\n // 3. Check if its expired\n const [user] = await ctx.db.query.users({\n where: {\n resetToken: args.resetToken,\n resetTokenExpiry_gte: Date.now() - 3600000\n }\n });\n if (!user) {\n throw new Error('This token is either invalid or expired!');\n }\n\n const sizedFields = {\n password: {\n min: 8,\n max: 72\n }\n };\n\n const tooSmallField = Object.keys(sizedFields).find(\n field =>\n 'min' in sizedFields[field] &&\n args.password.trim().length < sizedFields[field].min\n );\n const tooLargeField = Object.keys(sizedFields).find(\n field =>\n 'max' in sizedFields[field] &&\n args.password.trim().length > sizedFields[field].max\n );\n\n if (tooSmallField) {\n throw new Error(\n `Must be at least ${sizedFields[tooSmallField].min} characters long`\n );\n }\n if (tooLargeField) {\n throw new Error(\n `Must be at most ${sizedFields[tooLargeField].max} characters long`\n );\n }\n\n if (args.password.search(/[a-z]/) == -1) {\n throw new Error('Your password needs at least one lower case letter. ');\n }\n\n if (args.password.search(/[A-Z]/) == -1) {\n throw new Error('Your password needs at least one upper case letter. ');\n }\n\n if (args.password.search(/[0-9]/) == -1) {\n throw new Error('password needs a number.');\n }\n // 4. Hash their new password\n const password = await bcrypt.hash(args.password, 10);\n // 5. Save the new password to the user and remove old resetToken fields\n const updatedUser = await ctx.db.mutation.updateUser({\n where: { email: user.email },\n data: {\n password,\n resetToken: null,\n resetTokenExpiry: null\n }\n });\n // 6. Generate JWT\n const token = jwt.sign({ userId: updatedUser.id }, process.env.APP_SECRET);\n // 7. Set the JWT cookie\n ctx.response.cookie('token', token, {\n domain: domain,\n httpOnly: true,\n maxAge: 1000 * 60 * 60 * 24 * 365\n });\n // 8. return the new user\n return updatedUser;\n }", "title": "" }, { "docid": "a9761d1b5fb8f6c934e741914aa53447", "score": "0.6645894", "text": "function passwordReset(){\n\tshowWaiting();\n\tvar email=$(\"#email2\").val();\n\t//alert(email);\n\tif(email==\"\"){\n\t\t$(\"#alertContent\").text(\"Email field cannot be empty!\");\n\t\thideWaiting();\n\t\t$(\"#alertDiv\").modal('show');\n\t}\n\telse{\n\t\t$.ajax({\n\t\t\tmethod:\"POST\",\n\t\t\turl:\"includes/checklogin.php\",\n\t\t\tdata:{email:email,reset:true}\n\t\t}).success(function(msg){\n\t\t\t//alert(msg);\n\t\t\tif(msg==\"24\"){\n\t\t\t\t$(\"#alertContent\").text(\"Reset Email successfully sent. Check your Email to reset password! \");\n\t\t\t\thideWaiting();\n\t\t\t\t$(\"#alertDiv\").modal('show');\n\t\t\t}\n\t\t\telse if(msg==\"25\"){\n\t\t\t\t$(\"#alertContent\").text(\"EMail Address not Registered\");\n\t\t\t\thideWaiting();\n\t\t\t\t$(\"#alertDiv\").modal('show');\n\t\t\t}\n\t\t})\n\t}\n\thideWaiting();\n}", "title": "" }, { "docid": "b23bbee17e9caf9b33f0bd917efd60b1", "score": "0.66316265", "text": "function shPassword() {\n\n var x = document.getElementById(\"ex-pass\");\n \n if (x.type === \"password\") {\n\n x.type = \"text\";\n\n } else {\n\n x.type = \"password\";\n\n }\n\n }", "title": "" }, { "docid": "f567cf4f29b86b0bdd66a4a294471686", "score": "0.663047", "text": "_restorePassword(req, res, next) {\n let newPassword = randomstring.generate(10);\n let queryData = {\n password: Password.hash(newPassword)\n };\n\n Models.users.update(queryData, {\n where: {\n id: req.local.id\n }\n })\n .then(function(user) {\n req.payload = Models.users.format().short(req.local);\n\n next();\n })\n .catch(next);\n }", "title": "" }, { "docid": "310fc0518c630f791f230c1daf246bc4", "score": "0.6625627", "text": "function generatePassword() {\n var pass = createRandomPassword();\n _dom.mainInput.value = pass;\n if (_dom.clearInput) {\n _dom.clearInput.value = pass;\n }\n triggerEvent(\"generated\", pass);\n toggleMasking(false);\n\n if (_validateTimer) {\n clearTimeout(_validateTimer);\n _validateTimer = null;\n }\n validatePassword();\n\n if (_dom.placeholder) {\n _dom.placeholder.style.display = \"none\";\n }\n }", "title": "" }, { "docid": "e110683ab76c1e31e4eb560c42df1c75", "score": "0.6623559", "text": "function check() {\r\n\tvar pwd = document.getElementById(\"pwd\").value;\r\n\tvar rpassword = document.getElementById(\"rpwd\").value;\r\n\tif (pwd != rpassword) {\r\n\t\tdocument.getElementById(\"pwd\").value = \"\";\r\n\t\tdocument.getElementById(\"rpwd\").value = \"\";\r\n\t\tdocument.getElementById(\"password-strength\").innerHTML = \"Enter new password\";\r\n\t\tdocument.getElementById(\"confirm-password-strength\").innerHTML = \"\";\r\n\t}\r\n}", "title": "" }, { "docid": "96b0a00a8a545c45cc3246a28d6cd4ac", "score": "0.66194284", "text": "function _clearPass() {\n $('#uEmail').val('');\n $('#uEmailNew').val('');\n $('#uPassword').val('');\n $('#uPasswordNew').val('');\n $('#firstName').val('');\n $('#lastName').val('');\n $('#uPasswordConfirmation').val('');\n }", "title": "" }, { "docid": "4b5d3f77e4df6c12720ee88e43572e16", "score": "0.66164577", "text": "function resetPassword(req, res) {\n async function resetPassword() {\n try {\n if (req.body && req.body.resetkey) {\n let condition = { resetkey: req.body.resetkey };\n let isResetkey = await commonQuery.findData(users, condition);\n\n if (!isResetkey) {\n return res.json(\n Response(constant.ERROR_CODE, constant.REQURIED_FIELDS_NOT, error)\n );\n } else {\n let id = isResetkey.data[0][\"_id\"];\n\n users.findById(id, function(err, result) {\n if (err) {\n res.json(\n Response(constant.ERROR_CODE, constant.FAILED_TO_RESET, null)\n );\n } else {\n result.password = req.body.password;\n result.resetkey = null;\n result.save();\n\n res.json(\n Response(constant.SUCCESS_CODE, constant.PASSWORD_RESET, result)\n );\n }\n });\n }\n }\n } catch (error) {\n return res.json(\n Response(constant.ERROR_CODE, constant.REQURIED_FIELDS_NOT, error)\n );\n }\n }\n\n resetPassword().then(function() {});\n}", "title": "" }, { "docid": "0316608e5a9c8eaca86be503d9880f22", "score": "0.66134125", "text": "function resetPassword(email) {\n return sendPasswordResetEmail(auth, email);\n }", "title": "" }, { "docid": "ff5aaca04f0493bc6e03e1eb095b3d23", "score": "0.6609661", "text": "function PassKeyDown()\n {\n document.getElementById('passwordval').innerHTML = '';\n document.getElementById('repeatpass').innerHTML = '';\n}", "title": "" }, { "docid": "e2f3890babe562be7ba4de2c596399bf", "score": "0.6606382", "text": "function resetPassword()\n{\n //se obtiene id de usuario a resetear el password\n var userId = $('#userIdEdit').val();\n //se obtiene nombre de usuario para utilizar en mensaje de confirmacion\n var name = $('#nameEdit').val();\n //se solicita confirmacion para resetear el password del usuario\n notie.confirm({\n text: 'Are you sure you want to reset password from user '+ name +'?<br><b>That\\'s a bold move...</b>',\n cancelCallback: function () {\n //notie.alert({ type: 3, text: 'Aw, why not? :(', time: 2 })\n },\n submitCallback: function () {//si se confirma el reseteo se llama al servidor\n alert(\"Funcionalidad no implementada...\");\n //notie.alert({ type: 1, text: 'El reseteo se realizo de forma correcta.', time: 2 })\n }\n })\n}", "title": "" }, { "docid": "e7fe6d0def22be2dfe8078892a5b69e9", "score": "0.65996426", "text": "async resendEmailPW() {\n\n // email doesn't exist in table users\n const email = this.ctx.request.body.email;\n if (!await this.service.users.exists(email)) {\n this.response(403, `user doesn't exist`);\n return;\n }\n\n // generate email token and url of password page\n const token = this.service.crypto.encrypto(email);\n const url = `http://${this.config.dns.host}:${this.config.dns.port}/api/v1/users/sign/signIn/resetPWPage?token=${token}`;\n await this.service.email.resetPassword(email, url);\n this.response(203, 'Please check your email and reset your password');\n }", "title": "" }, { "docid": "3f99da8c49d7f6f9fd7e74ed11d49d9e", "score": "0.65870786", "text": "function reset() {\r\n inputEmail.value = '';\r\n}", "title": "" }, { "docid": "754ec2b01792d86ad6c359ff049d1557", "score": "0.65785253", "text": "function showPassword() {\n var oldpass = document.getElementById(\"oldpass\");\n if (oldpass.type === \"password\") {\n oldpass.type = \"text\";\n } else {\n oldpass.type = \"password\";\n }\n }", "title": "" }, { "docid": "c492766eded5d8307abf58eef030f4be", "score": "0.6578393", "text": "function controlReturnPassword (returnPassword) {\n\t\n\tif (returnPassword){\n\t\tdocument.getElementById(\"alertPassword\").style.color=\"green\";\n\t\tdocument.getElementById(\"alertPassword\").innerHTML=\"✔\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"alertPassword\").style.color=\"rgb(255, 81, 0)\";\n\t}\n\t\n}", "title": "" }, { "docid": "20e3fe5620b380345ef2824738537ad4", "score": "0.657616", "text": "function resetLogin() {\n $(`#login-username`).val(``);\n $(`#login-password`).val(``);\n}", "title": "" }, { "docid": "8b79f28e2b4fd729b2501bcb46ae1e36", "score": "0.6560253", "text": "onnoPassword() {\n this.passwordValidationState = 'has-error';\n this.helpBlock = 'Please enter a password';\n }", "title": "" }, { "docid": "1b3caebf0edeef102720188c14955900", "score": "0.654106", "text": "function lostPasswordStart(req,res){\n\t\n var email = req.body.email;\n var rpe = resetPasswordEmail( req, res, email );\n\tvar init = profile.initPasswordReset( email, function( c, resetSecret ) { \n\t if( c == CODES.OK )\n\t {\n\t this.resetSecret = resetSecret;\n\t }\n\t else if( c == CODES.NO_RECORDS_UPDATED )\n\t {\n var title = \"Unknown email\";\n res.outputMessage( \n page.MESSAGE_LEVELS.error,\n title,\n utils.gettext(\"Sorry, don't know that email address\")\n );\n \n res.render( 'profile/lostpassword.html', {pageTitle:title} );\n\t }\n\t } );\n\n\tinit\n\t .handleErrors(req,res)\n\t .chain( rpe )\n\t .perform();\n}", "title": "" }, { "docid": "039c8c81f97f31c6e3a511b83f610228", "score": "0.6535312", "text": "onnewPassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "title": "" }, { "docid": "e913f06d1d4654138b57b9f389017970", "score": "0.65322864", "text": "resetForm(){\n this.setState({ email: '', password: ''}) \n }", "title": "" }, { "docid": "6306afd746d9473edc42e61fe67196b8", "score": "0.65203893", "text": "function showPasswordReset(req, res) {\n _showPasswordReset(req, res, _render);\n}", "title": "" }, { "docid": "d93320d2397e298929f83d8659c2cfe3", "score": "0.65092605", "text": "function resetUserListener() { \n // Used to minimize and shortify this script\n let values = [ \n getElementValue(\"reset-pass\"),\n getElementValue(\"reset-token\")\n ];\n\n // Terminate if password is not the same\n if (values[0] == \"\") {\n if (values[1] == \"\") \n alert(\"Kan inte återställa lösenord\");\n else\n alert(\"Vänligen fyll i all fält korrekt\");\n\n return;\n }\n \n // Adds login function to this function\n let result = resetUser(values[0], values[1]);\n\n // If result is successful, proceed, else alert user\n if (result != null) {\n // Re-render user table if succeeded\n if (result[\"success\"]) {\n // Re-render actual user table\n refreshUserTable(\"user-table\");\n\n // All popup boxes\n closeAllPopups();\n } else alert(\"Kan inte återställa lösenord\");\n } else alert(\"Kan inte återställa lösenord\");\n}", "title": "" }, { "docid": "c5525976f4265f088ec77f3dfa7c8821", "score": "0.6500528", "text": "_changePassword(evt) {\n var newState = this._mergeWithCurrentState({\n password: evt.target.value\n });\n\n this._emitChange(newState);\n }", "title": "" }, { "docid": "c5525976f4265f088ec77f3dfa7c8821", "score": "0.6500528", "text": "_changePassword(evt) {\n var newState = this._mergeWithCurrentState({\n password: evt.target.value\n });\n\n this._emitChange(newState);\n }", "title": "" }, { "docid": "d358f5a825ecc5caa35284247646114b", "score": "0.6496285", "text": "updatePassword(idLogin) {\r\n }", "title": "" }, { "docid": "f3f156bd7a92ea9838ace85e978be883", "score": "0.64952445", "text": "function validatePassword(){\n if(password.value !== verifyPassword.value) {\n verifyPassword.setCustomValidity(\"Passwords Don't Match\");\n } else {\n verifyPassword.setCustomValidity('');\n }\n }", "title": "" }, { "docid": "683c673d7accb11e4ac62a4d8a86a014", "score": "0.6494403", "text": "resetPassword(data) {\n try {\n return this.http.post(`${this.apiUrl}users/resetPassword`, data);\n }\n catch (error) {\n this.handleError(error);\n }\n }", "title": "" }, { "docid": "142b4e1a5ff407b1ba2c0a33a178a2b1", "score": "0.6491071", "text": "async resetPassword(email){\n await this.auth.sendPasswordResetEmail(email)\n}", "title": "" }, { "docid": "391c9f2d609c768bc633de1073985f7a", "score": "0.6482777", "text": "function _reset() {\n FocusOnService.focus('username');\n\n // Initialize credentials\n $scope.credentials = {\n identifier: '',\n password: ''\n };\n }", "title": "" }, { "docid": "5eee6c44634d4b322d8b27458d000bed", "score": "0.64810276", "text": "async function resetPassword (t, resetToken, password, passwordConfirm) {\n return tonicAxios.put(t.config.apiUrl + apiVersion + '/users/password/reset', { token: resetToken, password: password, password_confirm: passwordConfirm }, getOptions(t))\n}", "title": "" }, { "docid": "dacf5adcacbfa62c143bcb8ef6df7e2d", "score": "0.6479576", "text": "updatePasswordMismatch() {\n this.isPasswordMismatch = false;\n }", "title": "" }, { "docid": "7931914d05056d7faa1b1dde98acb716", "score": "0.6476241", "text": "resetPassword(data) {\n data = this._utilityService.trim(data);\n return this._http.post(`${_constant_url__WEBPACK_IMPORTED_MODULE_11__[\"RESET_PASSWORD\"]}?accessToken=${data.token}`, { password: data.password }).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__[\"map\"])(response => {\n this.resetPasswordSuccess();\n return response;\n }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__[\"catchError\"])(error => {\n if (error.error.statusCode === 400 && error.error.responseType === 'INVALID_TOKEN') {\n this._router.navigate([`/${src_app_constant_routes__WEBPACK_IMPORTED_MODULE_12__[\"LINK_EXPIRED\"]}`]);\n }\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_7__[\"throwError\"])(error);\n }));\n }", "title": "" }, { "docid": "fa6a0eea931ed5d2fc55b4617f5e4221", "score": "0.6475684", "text": "function changePassword() {\n $state.go('change_password');\n }", "title": "" }, { "docid": "fa9f5a4eea7cf85346c0ef67e67a143a", "score": "0.6474387", "text": "function togglePassword() { \n const password = document.getElementById('stamp-password');\n if (password.type === 'password') {\n password.type = 'text';\n } else {\n password.type = 'password';\n }\n }", "title": "" }, { "docid": "5c2304af782dc079266aa9964402a9a3", "score": "0.64728266", "text": "setretypePassword(retypepassword) {\n if (!retypepassword || retypepassword.length <= 0) {\n return this.setState({ retypePassworderror: 'retype Password cannot be empty' });\n }\n this.matchNewPassword(retypepassword);\n return this.setState({ retypePassword: retypepassword, retypePassworderror: null });\n }", "title": "" }, { "docid": "f7297b9b2d5d7ac013f353c9448495ec", "score": "0.6468456", "text": "forgetPasswd() {\n\t\tconst { changeTitle } = this.props;\n\n\t\tchangeTitle('Forget Username or Password ?');\n\t\treturn this.setState({ forget: true });\n\t}", "title": "" }, { "docid": "b7bf3e70f78eeddbcbdeeded745bb557", "score": "0.6464582", "text": "function resetPassword(uname) {\n\n $(modalPopupContent).html($('#reset-password-window').html());\n showPopup();\n\n $(\"a#reset-password-yes-link\").click(function () {\n var newPassword = $(\"#new-password\").val();\n var confirmedPassword = $(\"#confirmed-password\").val();\n var user = uname;\n\n var errorMsgWrapper = \"#notification-error-msg\";\n var errorMsg = \"#notification-error-msg span\";\n if (!newPassword) {\n $(errorMsg).text(\"New password is a required field. It cannot be empty.\");\n $(errorMsgWrapper).removeClass(\"hidden\");\n } else if (!confirmedPassword) {\n $(errorMsg).text(\"Retyping the new password is required.\");\n $(errorMsgWrapper).removeClass(\"hidden\");\n } else if (confirmedPassword != newPassword) {\n $(errorMsg).text(\"New password doesn't match the confirmation.\");\n $(errorMsgWrapper).removeClass(\"hidden\");\n } else if (!inputIsValid(/^[\\S]{5,30}$/, confirmedPassword)) {\n $(errorMsg).text(\"Password should be minimum 5 characters long, should not include any whitespaces.\");\n $(errorMsgWrapper).removeClass(\"hidden\");\n } else {\n var resetPasswordFormData = {};\n resetPasswordFormData.username = user;\n resetPasswordFormData.newPassword = window.btoa(unescape(encodeURIComponent(confirmedPassword)));\n\n invokerUtil.post(\n resetPasswordServiceURL,\n resetPasswordFormData,\n function (data) { // The success callback\n data = JSON.parse(data);\n if (data.statusCode == 201) {\n $(modalPopupContent).html($('#reset-password-success-content').html());\n $(\"a#reset-password-success-link\").click(function () {\n hidePopup();\n });\n }\n }, function (data) { // The error callback\n if (data.statusCode == 400) {\n $(errorMsg).text(\"Old password does not match with the provided value.\");\n $(errorMsgWrapper).removeClass(\"hidden\");\n } else {\n $(errorMsg).text(\"An unexpected error occurred. Please try again later.\");\n $(errorMsgWrapper).removeClass(\"hidden\");\n }\n }\n );\n }\n });\n\n $(\"a#reset-password-cancel-link\").click(function () {\n hidePopup();\n });\n}", "title": "" }, { "docid": "d8b059392b295220a49f0c36537b185d", "score": "0.64452595", "text": "validateReEnterNewPasswordUnmasked() {\n return this\n .waitForElementVisible('@reEnterNewPasswordTxtBox')\n .assert.attributeContains('@reEnterNewPasswordTxtBox', 'type', 'text');\n }", "title": "" }, { "docid": "d6bc02351ad9f952d25c5958832ddc27", "score": "0.6441547", "text": "function resetUniversalIDPassword(resetFunction) {\n bc.brainCloudClient.authentication.initialize(\"\", bc.brainCloudClient.authentication.generateAnonymousId());\n\n bc.brainCloudClient.authentication.authenticateUniversal(UserA.name,\n UserA.password, true, function (result) {\n\n // If authentication fails, the password reset will fail as well: \"No session\"\n if (result.status == 200) {\n\n // For universal reset, must ensure that user has a valid email ID\n bc.brainCloudClient.playerState.updateContactEmail(UserC.email, function (result) {\n if (result.status == 200) {\n resetFunction(); // specified variation of the resetUniversalId call\n }\n else {\n ok(false, \"Update contact email failed\");\n resolve_test();\n }\n });\n }\n else {\n ok(false, \"Authentication failed\");\n resolve_test();\n }\n });\n }", "title": "" }, { "docid": "a91cdc42434aa74d5bc34fb727e00a96", "score": "0.64373934", "text": "onPressForgetPassword() {\n this.navigate('ResetPassword');\n }", "title": "" }, { "docid": "1d7add16d3a43b0346a55cacbeced784", "score": "0.6436177", "text": "function generatePassword() {\n var randPass = password_generator(6);\n $(\"#password\").val(randPass).focus();\n}", "title": "" }, { "docid": "588fb9d18030425c82256bf2340f1cfb", "score": "0.6432836", "text": "resetDefaults() {\n this.setState({\n errorStatusPassword: false,\n errorStatusEmail: false,\n errorMsgEmail: \"\",\n errorMsgPassword: \"\"\n });\n }", "title": "" }, { "docid": "4e8c3e503f33960d77f08c3ecd546fcc", "score": "0.64313996", "text": "function iapiForgotPassword(username, email, birthDate, realMode, verificationAnswer) {\n var requestUrl = 'ForgotPassword.php?' + 'casinoname=' + iapiConf['casinoname'] + '&realMode=' + realMode;\n\n var params = [];\n params['username'] = username;\n params['email'] = email;\n params['birthDate'] = birthDate;\n\n if (verificationAnswer) {\n params['verificationAnswer'] = verificationAnswer;\n }\n\n iapiMakeRedirectRequest(requestUrl, params, iapiCALLOUT_FORGOTPASSWORD);\n\n return iapiERR_OK;\n}", "title": "" }, { "docid": "9e088c71079a0d97909ff2cb655f665e", "score": "0.643104", "text": "function clear_user_data() {\n $('#current_password').val('');\n $('#new_password').val('');\n $('#confirm_password').val('');\n $('#modal_close').click();\n}", "title": "" }, { "docid": "3f694366c56c4f40839f9d7c6c4db75f", "score": "0.6430337", "text": "onSubmit() {\n this.$showLoader();\n\n ApiClient.Auth.resetPassword(this.resetHash, this.password, this.passwordConfirm).then((response) => {\n \tthis.$notify('Your password was successfully reseted.', 'success');\n\n \tthis.$router.push({ name: 'login' })\n\n this.$hideLoader();\n }).catch((err) => {\n this.$hideLoader();\n\n this.$errResponseHandler(err);\n });\n }", "title": "" }, { "docid": "3235a988b3577d5a745e4b51ac0c8a19", "score": "0.64284176", "text": "function SendPasswordReset(){\nvar emailAddress = \"[email protected]\";auth.sendPasswordResetEmail(emailAddress).then(function() {\n // Email sent.\n console.log('Email Sent');\n}).catch(function(error) {\n // An error happened.\n});\n}", "title": "" } ]
6e38c5fbba24cf81fcae81c006be1d88
objSearch =============== Constructor function for Search objects Parameters in strImageName Image Name of Section Only of Search instrRadioValue Value for the Section Radio btn in Search bar Return value
[ { "docid": "59330dd93fc7aced318da23ad34f5149", "score": "0.8253509", "text": "function objSearch(strImageName, strRadioValue)\r\n{\r\n\tthis.imagesrc = strImageName;\r\n\tthis.value = strRadioValue;\r\n}", "title": "" } ]
[ { "docid": "2cfc9585e80218f522d5117e385273d7", "score": "0.7192201", "text": "function fncBuildSearchBar()\r\n{\r\n\t// create array for radio values for section only searches with image names and values\r\n\tvar arrSearchValue = new Array(13);\r\n\t\r\n\tarrSearchValue[0] = new objSearch(\"hdr_wiremobonly_gy.gif\",\"mob\");\r\n\tarrSearchValue[1] = new objSearch(\"hdr_homeofficeonly_gy.gif\",\"home\");\r\n\tarrSearchValue[2] = new objSearch(\"hdr_smallbusonly_gy.gif\",\"smbiz\");\r\n\tarrSearchValue[3] = new objSearch(\"hdr_enterpriseonly_gy.gif\",\"entrp\");\r\n\tarrSearchValue[4] = new objSearch(\"hdr_educationonly_gy.gif\",\"edu\");\r\n\tarrSearchValue[5] = new objSearch(\"hdr_governonly_gy.gif\",\"govt\");\r\n\tarrSearchValue[6] = new objSearch(\"hdr_productsonly_gy.gif\",\"prod\");\r\n\tarrSearchValue[7] = new objSearch(\"hdr_profservonly_gy.gif\",\"serv\");\r\n\tarrSearchValue[8] = new objSearch(\"hdr_techonly_gy.gif\",\"news\");\r\n\tarrSearchValue[9] = new objSearch(\"hdr_newsonly_gy.gif\",\"tech\");\r\n\tarrSearchValue[10] = new objSearch(\"hdr_support_gy.gif\",\"supp\");\r\n\tarrSearchValue[11] = new objSearch(\"hdr_quickcourse_gy.gif\",\"quick\");\r\n\tarrSearchValue[12] = new objSearch(\"hdr_downloads_gy.gif\",\"dwnld\");\r\n\r\n\t\r\n\t// radio buttons for search zone selection are displayed\r\n\tif (gobjLayout.searchbar == 1)\r\n\t{\r\n\t\tvar strRadioValue = \"\";\r\n\t\tvar strTemp = \"\"\r\n\t\t// find appropriate Search type and assign radio button value for section-specific based on searchalt tag\r\n\t\tfor (i = 0; i < arrSearchValue.length; i++)\r\n\t\t{\r\n\t\t\t// test for image name and assign proper value to Radio btn for Search Section\r\n\t\t\tif (gobjLayout.searchimage.indexOf(arrSearchValue[i].imagesrc) != -1)\r\n\t\t\t{\r\n\t\t\t\tstrRadioValue = arrSearchValue[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tgobjSearchSectionImage = new objRollover(gobjLayout.searchimage, gobjLayout.searchimage, gobjDIProject);\r\n\t\tstrTemp += '<form name=\"frmSearch\" action=\"' + gobjNavArray[3].href + '\">';\r\n\t\tstrTemp += '<td valign=\"middle\"><nobr>&nbsp;<input type=\"text\" name=\"qt\" size=\"16\">&nbsp;&nbsp;<a name=\"searchlink\" href=\"javascript:document.frmSearch.submit();\" onmouseover=\"fncSwitch(-1,3,1);\" onmouseout=\"fncSwitch(-1,3,0);\"><img src=\"' + gobjNavArray[3].rollover.off.src + '\" width=\"5\" height=\"16\" border=\"0\" name=\"' + gobjNavArray[3].rollovername + '\" id=\"' + gobjNavArray[3].rollovername + '\"><img src=\"' + gobjSearch.on.src +'\" width=\"57\" height=\"16\" border=\"0\" alt=\"' + gobjNavArray[3].label + '\"></a>&nbsp;&nbsp;<input type=\"radio\" name=\"col\" value=\"' + strRadioValue + '\" checked>&nbsp;<img src=\"' + gobjSearchSectionImage.on.src + '\" height=\"16\" border=\"0\" alt=\"' + gobjLayout.searchalt + '\">&nbsp;&nbsp;<input type=\"radio\" name=\"col\" value=\"all\">&nbsp;<img src=\"' + gobjEntireSite.on.src +'\" width=\"114\" height=\"16\" border=\"0\" alt=\"Entire Site\"></nobr></td>';\r\n\t\tstrTemp += '</form>';\r\n\t\tdocument.write(strTemp);\r\n\t}\r\n\t// only search text field and button are displayed\r\n\t\r\n\tif (gobjLayout.searchbar == 2)\r\n\t{\r\n\t\tvar strTemp = \"\"\r\n\t\tstrTemp += '<form name=\"frmSearch\" action=\"' + gobjNavArray[3].href + '\">';\r\n\t\tstrTemp += '<td valign=\"middle\"><nobr>&nbsp;<input type=\"text\" name=\"qt\" size=\"16\">&nbsp;&nbsp;<a name=\"searchlink\" href=\"javascript:document.frmSearch.submit();\" onmouseover=\"fncSwitch(-1,3,1);\" onmouseout=\"fncSwitch(-1,3,0);\"><img src=\"' + gobjNavArray[3].rollover.off.src + '\" width=\"5\" height=\"16\" border=\"0\" name=\"' + gobjNavArray[3].rollovername + '\" id=\"' + gobjNavArray[3].rollovername + '\"><img src=\"' + gobjSearch.on.src +'\" width=\"57\" height=\"16\" border=\"0\" alt=\"' + gobjNavArray[3].label + '\"><input type=\"hidden\" name=\"col\" value=\"all\"></a></td>';\r\n\t\tstrTemp += '</form>';\r\n\t\tdocument.write(strTemp);\r\n\t}\r\n\t// search bar is not displayed\r\n\tif (gobjLayout.searchbar == 3)\r\n\t{\r\n\t\tvar strTemp = \"\"\r\n\t\tstrTemp += '<td valign=\"middle\" height=\"16\"></td>';\r\n\t\tdocument.write(strTemp);\r\n\t}\r\n}", "title": "" }, { "docid": "47f5a5f93c1ae0669f21ce1d14065e17", "score": "0.6050914", "text": "function Image_Search(query) {\n\t\n\tthis.query = query;\n\tthis.imgs = [];\n\tthis.sets = [];\n\tthis.setOn = 0;\n\tthis.pages = 0;\n\tthis.prevBtn;\n\tthis.nextBtn;\n\tthis.slideBtn;\n\tthis.slideshow = popupManager.newSlideShow();\n\tthis.div;\n\t\n\tthis.draw = function (parentNode) {\n\t\t\n\t\tthis.div = $create('div', {\n\t\t\t'id' : 'imageList',\n\t\t\t'className' : 'rBox'\n\t\t});\n\t\t\n\t\tvar SR = this;\n\t\tthis.prevBtn = new button('<', function () { SR.prev(); });\n\t\tthis.prevBtn.draw(this.div);\n\t\tthis.prevBtn.btn.disabled = true;\n\t\t\n\t\tif(options.sldshw) {\n\t\t\tthis.slideBtn = new button('Play', function () { SR.startSlides(); this.btn.blur(); });\n\t\t\tthis.slideBtn.draw(this.div);\n\t\t\tthis.slideBtn.btn.disabled = true;\n\t\t}\n\t\t\n\t\tthis.nextBtn = new button('>', function () { SR.next(); });\n\t\tthis.nextBtn.draw(this.div);\n\t\tthis.nextBtn.btn.disabled = true;\n\t\t\n\t\tif(options.styl == 'dock') {\n\t\t\tthis.nextBtn.undraw();\n\t\t\tthis.prevBtn.undraw();\n\t\t}\n\t\t\n\t\tparentNode.appendChild(this.div);\n\t\t\n\t\tthis.search();\n\t};\n\t\n\tthis.undraw = function () {\n\t\t\n\t\tthis.slideshow.undraw();\n\t\tif(this.div.parentNode) this.div.parentNode.removeChild(this.div);\n\t\t\n\t};\n\t\n\tthis.next = function () {\n\t\tif(this.setOn < this.sets.length - 1) {\n\t\t\tif(this.setOn == 0) {\n\t\t\t\tthis.prevBtn.btn.disabled = false;\n\t\t\t}\n\t\t\t\n\t\t\tthis.sets[this.setOn].undraw();\n\t\t\tthis.sets[++this.setOn].draw(this.div);\n\t\t\t\n\t\t\tif (this.setOn == this.sets.length - 1) {\n\t\t\t\tthis.nextBtn.btn.disabled = true;\n\t\t\t}\n\t\t}\n\t};\n\t\n\tthis.prev = function () {\n\t\tif(this.setOn > 0) {\n\t\t\tif(this.setOn == this.sets.length - 1) {\n\t\t\t\tthis.nextBtn.btn.disabled = false;\n\t\t\t}\n\t\t\t\n\t\t\tthis.sets[this.setOn].undraw();\n\t\t\tthis.sets[--this.setOn].draw(this.div);\n\t\t\t\n\t\t\tif (this.setOn == 0) {\n\t\t\t\tthis.prevBtn.btn.disabled = true;\n\t\t\t}\n\t\t}\n\t};\n\t\n\tthis.clickImage = function (indx) {\n\t\tif(indx < 0) {\n\t\t\tindx = this.imgs.length - 1;\n\t\t} else if (indx >= this.imgs.length) {\n\t\t\tindx = 0;\n\t\t}\n\t\tthis.imgs[indx].clicked();\n\t};\n\t\n\tthis.startSlides = function (startOn) {\n\t\tif (!this.slideshow.is_drawn()) {\n\t\t\tpopupManager.closeAll();\n\t\t\tthis.slideshow.draw(startOn);\n\t\t} else if (this.slideshow && this.slideshow.is_drawn()) {\n\t\t\tthis.slideshow.undraw();\n\t\t}\n\t};\n\t\n\tthis.buildSets = function () {\n\t\tvar perSet;\n\t\tif (options.styl == 'media') {\n\t\t\tperSet = options.mdaimgnum;\n\t\t} else if (options.imgSize == 'large') {\n\t\t\tperSet = 7;\n\t\t} else if (options.imgSize == 'medium') {\n\t\t\tperSet = 14;\n\t\t} else if (options.imgSize == 'small') {\n\t\t\tperSet = 28;\n\t\t} else if (options.imgSize == 'title') {\n\t\t\tperSet = 21;\n\t\t} else { // Details\n\t\t\tperSet = 14;\n\t\t}\n\t\tfor(var setCreator = 0; setCreator < this.imgs.length; setCreator++) {\n\t\t\tif((setCreator % perSet == 0 && options.styl != 'dock') || setCreator == 0) {\n\t\t\t\tthis.sets.push(new img_set());\n\t\t\t}\n\t\t\tvar dockWorker = options.styl == 'dock' ? 0 : Math.floor(setCreator / perSet);\n\t\t\tthis.sets[dockWorker].addImg(this.imgs[setCreator]);\n\t\t}\n\t};\n\t\n\tthis.processPage = function (response) {\n\t\tvar na;\n\t\teval('na = ' + response.responseText);\n\t\t\n\t\t/*\n\t\t\tvar link = $create(\"a\");\n\t\t\tlink.href = na[0][i][3];\n\t\t\tlink.className = \"imgLink\";\n\t\t\t\n\t\t\tvar img = $create(\"img\");\n\t\t\timg.src = na[0][i][14] + \"?q=tbn:\" + na[0][i][2] + na[0][i][3];\n\t\t\timg.alt = na[0][i][6];\n\t\t\timg.title = na[0][i][6];\n\t\t*/\n\t\t\n\t\tvar res = na.responseData.results;\n\t\t\n\t\tif(res.length > 0) {\n\t\t\tfor(var nao = 0; nao < res.length; nao++) {\n\t\t\t\tvar img = new indiv_img_result(res[nao].tbUrl, res[nao].unescapedUrl, res[nao].title, res[nao].width + 'x' + res[nao].height, res[nao].visibleUrl, this.imgs.length);\n\t\t\t\tthis.imgs.push(img);\n\t\t\t\tthis.slideshow.dialog.add_image(img);\n\t\t\t}\n\t\t\t\n\t\t\tif(this.pages * 8 < options.imgPgs) {\n\t\t\t\tthis.search();\n\t\t\t} else {\n\t\t\t\tthis.buildSets();\n\t\t\t\tthis.sets[0].draw(this.div);\n\t\t\t\tthis.slideBtn.btn.disabled = false;\n\t\t\t\t\n\t\t\t\tif(this.sets.length > 1) {\n\t\t\t\t\tthis.nextBtn.btn.disabled = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t};\n\t\n\tthis.errorPage = function (response) {\n\t\t\n\t};\n\t\n\tthis.search = function () {\n\t\tvar SR = this;\n\t\tget(\"http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=\" + encodeURIComponent(this.query) + \"&gbv=2&rsz=\" + (Math.min(8, options.imgPgs - (8 * this.pages))) + \"&start=\" + (8 * this.pages), function (r) { SR.processPage(r) }, function (r) { SR.errorPage(r) });\n\t\tthis.pages++;\n\t};\n\t\n}", "title": "" }, { "docid": "7ad3c32ebf37903b81da3f98df069d5e", "score": "0.5976133", "text": "function createSearchConditions() {\n\t\treturn {\n\t\t\tkindName: $.trim($(\"#txtKindName\").val()).replace(/\\\\/g, \"\\\\\\\\\").replace(/%/g, \"\\\\%\"),\n\t\t\t//deleteFlag: $(\"#delete_flag_sl\").val(),\n\t\t\tfromRow: from,\n\t\t\titemCount: ITEM_IN_ONE_PAGE\n\t\t};\n\t}", "title": "" }, { "docid": "a74ec36624ec5f4570c98e14231ad05c", "score": "0.59388715", "text": "function mediaSearchCriteria() {\n this.fieldName = '';\n this.fieldValue = '';\n this.operator = ''; // either AND for +, OR for |\n\n}", "title": "" }, { "docid": "5d2483264dcd3591aa173ba1bfdb9440", "score": "0.5792184", "text": "function find() {\n\n let searchName = $('#searchItems').val(); //getting search values, default value as starting value\n let countryName = \"\"; //using default country values\n let explicitContent = \"\"; //explicit content value default\n let limits = \"\"; //limit of songs default\n let songType=$('#songType').val(); //the type of song looking for default value as starting value\n\n //instantiate a new search box \n let inputSearch = new searchbox(); //\n\n //checking if the checkboxes are checked or not\n var x = document.getElementById('countryCheck').checked;\n var y = document.getElementById('explicitCheck').checked;\n var z = document.getElementById('limitCheck').checked;\n\n if(x){\n countryName = $('#country').val(); \n }\n if(y){\n explicitContent = $('#explicitContent').val(); \n }\n if(z){\n limits = $(songlimit).val(); \n }\n //put the values of search items in the seachbox object\n inputSearch.country=countryName; //adding the country name to searhc object\n inputSearch.content= explicitContent;//adding explicit content\n inputSearch.limit = limits;//adding limits\n inputSearch.term= searchName;//adding search term\n inputSearch.type= songType;//adding the songtype\n\n return inputSearch;\n}", "title": "" }, { "docid": "405444425086a681f988ea4e0d854645", "score": "0.5730204", "text": "function getSearchCriteria()\n{\n var searchValue;\n if (document.getElementById('artist-radio').checked)\n {\n console.log(\"artist\");\n searchValue = \"artist\";\n return searchValue;\n }\n if (document.getElementById('song-radio').checked)\n {\n console.log(\"song\");\n searchValue = \"song\";\n return searchValue;\n }\n}", "title": "" }, { "docid": "7f4a035656381e2d02bb825e94ae1dee", "score": "0.5711979", "text": "function createSearchConditions() {\n\t\t// FarmId\n\t\tvar farmId = $(\"#cbbFarmName\").val();\n\t\t// kindId\n\t\tvar kindId = $(\"#cbbKindName\").val();\n\t\t// processId\n\t\tvar processId = $(\"#cbbProcessName\").val();\n\t\t// taskId\n\t\tvar taskId = $(\"#cbbTaskName\").val();\n\t\treturn {\n\t\t\tfarmId: farmId,\n\t\t\tkindId: kindId,\n\t\t\tprocessId: processId,\n\t\t\ttaskId: taskId,\n\t\t\tfromRow: from,\n\t\t\titemCount: ITEM_IN_ONE_PAGE\n\t\t};\n\t\t\n\t}", "title": "" }, { "docid": "6d6556e4c1c042d6839b9ae12cc79123", "score": "0.5711342", "text": "function getSearchCriteria() {\n\n var inputValue = \"\";\n var subvalue = \"\";\n \n var s1 = \"\";\n \n for ( i = 0; i < currentSearchTableRow; i++) {\n\n var ithFieldHasValueMap = false;\n \n if ((connectionOn ==\"EEL\") && getQualifierValueArray(connectionOn,FieldInput.options(searchFieldNames[i]).value , \"Values\") != null ) {\n \n ithFieldHasValueMap = true;\n }\n \n inputValue = searchFieldValues[i] + \"\\n\";\n while((orPositionInValue = inputValue.indexOf(\" OR \")) != -1) {\n inputValue = inputValue.substr(0,orPositionInValue) + \"\\n\" + inputValue.substr(orPositionInValue+4,inputValue.length);\n }\n \n s1 = s1 + \"(\";\n valueSeperatorIndex = inputValue.indexOf(\"\\n\");\n s3 = \"\";\n while( valueSeperatorIndex != -1) {\n \n subvalue = inputValue.substr(0,valueSeperatorIndex);\n inputValue = inputValue.substr(valueSeperatorIndex+1, inputValue.length);\n \n if(ithFieldHasValueMap == true)\n subvalue = convertValueToValueMap(FieldInput.options(searchFieldNames[i]).value, subvalue);\n \n if ( (subvalue != \"\") && (subvalue != \"\\n\") && (subvalue != \" \")) {\n \n switch (SearchTable.rows(i).cells(1).innerText) {\n case L_Contains_TEXT:\n \n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).value + \" LIKE '%\" + subvalue + \"%' ) \";\n break ;\n \n case L_NotContains_TEXT:\n s2 = \"not ( (\" + FieldInput.options(searchFieldNames[i]).value + \" LIKE '%\" + subvalue + \"%' )) \";\n break ;\n case L_StartsWith_TEXT:\n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).value + \" LIKE '\" + subvalue + \"%' ) \";\n break ;\n case L_Equals_TEXT\t:\n if(subvalue.toLowerCase() != 'null')\n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" = '\" + subvalue + \"') \";\n else\n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" = \" + subvalue + \") \";\n break ;\n case L_NotEquals_TEXT:\n if(subvalue.toLowerCase() != 'null')\n s2 = \"not (\" + \"(\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" = '\" + subvalue + \"' ) )\";\n else\n s2 = \"not (\" + \"(\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" = \" + subvalue + \" ) )\"; \n break ;\n case L_GreaterThan_TEXT:\n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" > \" + subvalue + \" ) \";\n break ;\n case L_LesserThan_TEXT:\n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" < \" + subvalue + \" ) \";\n break ;\n case L_DatedOn_TEXT:\n s2 = \"((\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" > '\" + subvalue + \"' ) \" + \" and \" +\n \"(\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" < '\" + subvalue + \" \" + L_LastSecInDay_TEXT+ \"' ) )\";\n break ;\n case L_DatedAfter_TEXT:\n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" > '\" + subvalue + \"' ) \";\n break ;\n case L_DatedBefore_TEXT:\n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).value + \" \" +\" < '\" + subvalue + \"' ) \";\n break ;\n }\n if ( s3 == \"\")\n s3 = s2;\n else\n s3 = s3 + \" or \" + s2;\n }\n valueSeperatorIndex = inputValue.indexOf(\"\\n\");\n \n }\n s1 = s1 + s3 + \")\";\n \n \n if ( i != (currentSearchTableRow-1)) \n s1 = s1+ \" and \";\n }\n \n\n return s1;\n}", "title": "" }, { "docid": "7616379c7111e567bd8c25ced9f33cf2", "score": "0.57082963", "text": "function initSearchMethod() {\n if(window.subAreaMode) return;\n var method = $.urlParam('t');\n var orderId = 0;\n\n switch(method) {\n case 'mixed': orderId = 0; break;\n case 'title': orderId = 1; break;\n case 'tag': orderId = 2; break;\n case 'author': orderId = 3; break;\n default: orderId = 0;\n }\n maRadio_init(\".radio-method\", orderId, \"#input-method\");\n }", "title": "" }, { "docid": "1a58e930073438005c9709c995ca0232", "score": "0.57031", "text": "search() {\n // vymazanie predchadzajucich hladanych vysledkov\n document.getElementById('image_results').innerHTML = '<h4>Image results</h4>'\n document.getElementById('web_results').innerHTML = '<h4>Web results</h4>'\n\n // po zavolani funkcie sa nacita hodnota z inputboxu do premennej\n var search_expression = document.getElementById('input_search').value;\n\n if (search_expression == '') {\n alert('Musíte zadať hladaný výraz.')\n }\n else {\n document.getElementsByTagName('body')[0].setAttribute('class', 'loading')\n // zavolanie funkcii web_search a images_search ktore, dostanu ako vstupny parameter hodnotu z inputboxu(hladana hodnota)\n this.web_search(search_expression, 1);\n this.images_search(search_expression, 1);\n document.getElementsByTagName('body')[0].removeAttribute('class', 'loading')\n }\n }", "title": "" }, { "docid": "b63205edd7a9c2e7c99fa809071e6513", "score": "0.562767", "text": "function search() {\r\n var search_value = $(this).find(\"input[type=text]\").val();\r\n load(\"/Music/Search/\" + search_value, null, function(data) {\r\n $(config.resultsTab).show().find(\"a\").html('<span id=\"lblSearchResults\">' + language.SearchResults + '</span>: ' + search_value);\r\n tabs.tabs(\"select\", 4);\r\n if (searchTable == null) {\r\n var searchDiv = $(config.searchDiv);\r\n searchDiv.empty();\r\n searchTable = $(\"<table></table>\").appendTo(searchDiv);\r\n }\r\n searchTable.empty();\r\n for (var i = 0; i < data.Tracks.length; i++) {\r\n var item = data.Tracks[i];\r\n var row = $(\"<tr />\");\r\n row.append(createTrackTd(item));\r\n row.append(createTrackLengthTd(item));\r\n row.append(createArtistTd(item.Artist));\r\n row.append(createAlbumTd(item.Album));\r\n row.appendTo(searchTable);\r\n }\r\n });\r\n return false;\r\n }", "title": "" }, { "docid": "940721e1a3d6c7d622a9953dc562227b", "score": "0.55641377", "text": "function pageSearch()\n{\n \n result( id, \"challange\", createPage);\n\tresult( id, \"challangeimg\", addImages);\n \n}", "title": "" }, { "docid": "a334934aeb213e797fdae7b296f69ba3", "score": "0.5558525", "text": "function search() {\n var searchVal = ($('#search').val()).toLowerCase();\n var i = 0;\n searchResult = currentMesh;\n var min = searchVal.length;\n for (i = 0; i < allMeshes.length; i++) {\n var editDist = levenshtein(searchVal, allMeshes[i][2], 0);\n if (editDist < min && (searchVal.charAt(0) == (allMeshes[i][2].charAt(0)).toLowerCase())) {\n min = editDist;\n searchResult = i;\n }\n }\n $('#meshDescriptionText').text(\"Search result: \" + allMeshes[searchResult][2]);\n updateDisplayArray(2);\n var prefix = \"#img\";\n for (var i = 0; i < numChoices; i++) {\n var name = prefix + i;\n $(name).attr(\"src\", formSource(allMeshes[(displayArray[i])][0]));\n }\n $('#search').val('');\n\n\n }", "title": "" }, { "docid": "dc350fd41540484a99380bd4532c70f0", "score": "0.5554983", "text": "function page_startSearch(request) {\r\n var LOG_TITLE = 'page_startSearch';\r\n\r\n var stUser = nlapiGetUser();\r\n var objEmpLocation = 'customrecord_rtf_course_group';\r\n // var objEmpLocationLabel = nlapiLookupField('employee', stUser, ['location', 'custentity_lbc_default_from_loc'], true);\r\n \r\n //if (!objEmpLocationLabel['location']) {\r\n // objEmpLocationLabel['location'] = 'To Location';\r\n //}\r\n\r\n // if (!objEmpLocationLabel['custentity_lbc_default_from_loc']) {\r\n // objEmpLocationLabel['custentity_lbc_default_from_loc'] = 'From Location';\r\n // }\r\n\r\n var _SEARCHFORM = nlapiCreateForm('Search Item(s)');\r\n\r\n //buttons for choosing on how the searching for the items will execute\r\n _SEARCHFORM.addSubmitButton('Load Item(s)');\r\n\r\n //the search field for the item\r\n // _SEARCHFORM.addField('custpage_lcb_from_date', 'date', 'From').setDisplayType('normal');\r\n // _SEARCHFORM.addField('custpage_lcb_to_date', 'date', 'To').setDisplayType('normal');\r\n // _SEARCHFORM.addField('custpage_lcb_location', 'select', 'To Location: ', 'location').setDisplayType('normal').setDefaultValue(objEmpLocation['location']);\r\n _SEARCHFORM.addField('custpage_lbc_from_location', 'select', 'Course Group: ', 'customrecord_rtf_course_group').setDisplayType('normal');\r\n // _SEARCHFORM.addField('custpage_lbc_to_location_label', 'text', 'To Location Label').setDisplayType('hidden').setDefaultValue(objEmpLocationLabel['location']);\r\n // _SEARCHFORM.addField('custpage_lbc_from_location_label', 'text', 'From Location Label').setDisplayType('hidden').setDefaultValue(objEmpLocationLabel['custentity_lbc_default_from_loc']);\r\n // _SEARCHFORM.addField('custpage_lcb_ship_date', 'date', 'Ship Date').setDisplayType('normal').setMandatory(true);\r\n\r\n //store in a parameter the values needed for processing the records\r\n _SEARCHFORM.addField('custpage_action', 'text', 'Action').setDisplayType('hidden').setDefaultValue('GET_ITEMS');\r\n\r\n return _SEARCHFORM;\r\n}", "title": "" }, { "docid": "b93e0de2a5c2268ba567a7aa1d8bd0e8", "score": "0.553687", "text": "searchImages() {\n const searchTerm = document.getElementById(\"search-terms\").value;\n this.photoGallery.innerHTML = \"\";\n this.showLoader(true);\n if (searchTerm.trim()) {\n imageCollection.searchImages(searchTerm, false, []);\n } else {\n imageCollection.fetchRecent(false, []);\n }\n }", "title": "" }, { "docid": "2f7ec282ce8304e237d4e7f242c445d6", "score": "0.5525856", "text": "function getSearch(event,id,mode) {\n var cont = \"<fieldset><legend><b>Search</b></legend>\";\n cont += \"<input id='invSearch' type='text' onkeypress=\\\"if(getKey(event)==13){searchSpec('invSearch','\"+id+\"','\"+mode+\"');} else {return tanpa_kutip(event)}\\\" />\";\n cont += \"<img src='images/search.png' onclick=\\\"searchSpec('invSearch','\"+id+\"','\"+mode+\"')\\\" style='cursor:pointer'>\";\n cont += \"</fieldset>\";\n \n cont += \"<fieldset><legend><b>Result</b></legend><div id='sResult' style='height:315px;overflow:auto'>\";\n cont += \"</div></fieldset>\";\n showDialog2('Search',cont,'500','400',event);\n}", "title": "" }, { "docid": "66630b2533607e5538a9f1c190181e53", "score": "0.5494817", "text": "function searchBar(){\r\n \r\n var form, str, str2, trueval, searchfor;\r\n var result1=\"\";\r\n\r\n searchfor = document.getElementById(\"searchbar\").value;\r\n \r\n \r\n if(searchfor != \"\"){\r\n \t\r\n searchTerm = searchfor.toLowerCase();\r\n result18 = 'Sorry no results found';\r\n \r\n \r\n\r\n\t for(i=0; i<books.length; i++){\r\n\t \r\n\t str=books[i].title.toLowerCase();\r\n\t str2=books[i].author.toLowerCase();\r\n\t trueval = str.includes(searchTerm);\r\n\r\n\r\n\t if(str.includes(searchTerm) || str2.includes(searchTerm))\r\n\t {\r\n\r\n\t \tresult1 = result1 + \"<a href=\\\"#\\\" id = \\\"picture\\\" onclick =\\\"titleSearch('\"+books[i].title+\"')\\\">\"+books[i].cover+\"</a>\";\r\n\t \r\n\t }\r\n\t \r\n\t \r\n\t }\r\n\t \r\n\t } \r\n if(result1 == \"\"){\r\n \r\n document.getElementById(\"results_img\").innerHTML = result18; \r\n\r\n \r\n \t $(\"#noresult\").hide();\r\n \t $(\"#center\").hide();\r\n $(\"#results_img\").show();\r\n $(\"#center_left\").hide();\r\n $(\"#center_right\").hide();\r\n $(\"#desc_heading\").hide();\r\n $(\"#about_page\").hide();\r\n $(\"#contact_page\").hide();\r\n \t$(\"#description\").hide(); \r\n\r\n }else {\r\n\r\n\t document.getElementById(\"results_img\").innerHTML = result1; \r\n\r\n\r\n\t //hide other pages(divs) upon search results display\r\n $(\"#center\").hide();\r\n $(\"#results_img\").show();\r\n $(\"#center_left\").hide();\r\n $(\"#center_right\").hide();\r\n $(\"#desc_heading\").hide();\r\n $(\"#about_page\").hide();\r\n $(\"#contact_page\").hide();\r\n $(\"#noresult\").hide();\r\n \t\t$(\"#description\").hide(); \r\n\r\n\r\n\r\n \r\n } \r\n \r\n \r\n \r\n}//end of current function", "title": "" }, { "docid": "5dbb314a2171f48138086e0940647542", "score": "0.54631805", "text": "function SearcherAsset() {\n $(\"#searchValue\").bind('input', function () {\n CaseSearch();\n });\n\n function CaseSearch() {\n var searchBy = $(\"#searchBy option:selected\").val();\n var searchValue = $(\"#searchValue\").val();\n switch (searchBy) {\n case \"Inventory number\": {\n ShowOnlySearched(\"inventoryNumber\", searchValue)\n break;\n };\n case \"Brand\": {\n ShowOnlySearched(\"brand\", searchValue)\n break;\n };\n case \"Model\": {\n ShowOnlySearched(\"model\", searchValue)\n break;\n };\n }\n }\n\n function ShowOnlySearched(className, searchValue) {\n\n var elements = $(\"tr\");\n elements.each(function (index, element) {\n\n var item = $(this).children(\".\" + className).first();\n var classSearch = \".\" + className;\n var value = $(this).children(classSearch).prop('innerHTML');\n\n if (typeof (value) == \"string\") {\n\n if (value.indexOf(searchValue) == -1) {\n item.parent().addClass(\"hidden\");\n }\n\n if (value.indexOf(searchValue) > -1 || searchValue == \"\") {\n item.parent().removeClass(\"hidden\");\n }\n }\n\n });\n }\n }", "title": "" }, { "docid": "b234a4b4468c9ef340e43b2202e6bfda", "score": "0.5461259", "text": "search_Doc()\n {\n let search = ValInput.question(\"select 1 search doctor by id.\\nselect 2 search doctor by name.\\nselect 3 search doctor by specialization.\\nselect 4 search doctor by availability.\\n\")\n // search by id\n if(search == 1)\n {\n let id = ValInput.questionInt(\"enter doc id for search.\\n\")\n for(let i =0; i < this.AssDoc.length;i++)\n {\n if(this.AssDoc[i].Did === id)\n {\n console.log(\"your doctor.\")\n console.log(\"id Dr. Name specilization availibility\")\n console.log(`${this.AssDoc[i].Did} --------- ${this.AssDoc[i].Dname} --------- ${this.AssDoc[i].special} --------- ${this.AssDoc[i].avalible}`)\n }\n }\n }\n // search by name\n else if(search == 2)\n {\n let name = ValInput.question(\"enter doc Name for search.\\n\")\n for(let i =0; i < this.AssDoc.length;i++)\n {\n if(this.AssDoc[i].Dname === name)\n {\n console.log(\"your doctor.\")\n console.log(\"id Dr. Name specilization availibility\")\n console.log(`${this.AssDoc[i].Did} --------- ${this.AssDoc[i].Dname} --------- ${this.AssDoc[i].special} --------- ${this.AssDoc[i].avalible}`)\n }\n }\n }\n // search by specialization\n else if(search == 3)\n {\n let speciality = ValInput.question(\"enter specialization\\n\")\n for(let i =0; i < this.AssDoc.length;i++)\n {\n if(this.AssDoc[i].special === speciality)\n {\n console.log(\"your doctor.\")\n console.log(\"id Dr. Name specilization availibility\")\n console.log(`${this.AssDoc[i].Did} --------- ${this.AssDoc[i].Dname} --------- ${this.AssDoc[i].special} --------- ${this.AssDoc[i].avalible}`)\n }\n }\n }\n //// search by availibility\n else if(search == 4)\n {\n let avail = ValInput.question(\"enter availibility\\n\")\n for(let i =0; i < this.AssDoc.length;i++)\n {\n if(this.AssDoc[i].avalible === avail)\n {\n console.log(\"your doctor.\")\n console.log(\"id Dr. Name specilization availibility\")\n console.log(`${this.AssDoc[i].Did} --------- ${this.AssDoc[i].Dname} --------- ${this.AssDoc[i].special} --------- ${this.AssDoc[i].avalible}`)\n }\n }\n }\n\n }", "title": "" }, { "docid": "bb95d32e73b34b369433570d6a4d1b43", "score": "0.54543966", "text": "function searchHelp(parentDiv, strId, rcType){\n //add search box with helper buttons\n let zIndex = gbl_Z_Index;\n\n //Need to pass the edit button IDs to the filter function\n const strId_btnAdd = strId + \"_btnAdd\";\n const strId_btnUpdate = strId + \"_btnUpdate\";\n const strId_btnDelete = strId + \"_btnDelete\";\n const btnIdsObj = {strId_btnAdd, strId_btnUpdate, strId_btnDelete}\n\n let strSearch = document.createElement(\"input\");\n strSearch.placeholder = \"Search...\"; \n strSearch.classList.add(\"txtInput\", \"txtSearch\", \"fill-width\");\n let txtSearchId = strId + \"Search\";\n strSearch.id = txtSearchId;\n strSearch.onkeyup = function (event){\n //pass the strID not txtSearchId\n //filterFunction(txtSearchId, parentDiv, btnIdsObj);\n filterFunction(strId, parentDiv, btnIdsObj);\n }\n strSearch.style.zIndex = zIndex;\n \n let btnClear = document.createElement(\"button\");\n btnClear.innerHTML = '<i class=\"fa fa-eraser\" title=\"Clear Text\"></i>'; //\"Clear Text\";\n btnClear.className = \"button\";\n btnClear.id = strId + \"_btnClear\";\n btnClear.onclick = function (event){\n clearTextSearch(strId, parentDiv);\n }\n btnClear.style.zIndex = zIndex;\n\n\n let btnShowSelected = document.createElement(\"button\");\n btnShowSelected.innerHTML = '<i class=\"fa fa-check-circle\" title=\"Show Selected\"></i>'; //\"Show Selected\";\n btnShowSelected.className = \"button\";\n btnShowSelected.id = strId + \"_btnShowSelected\";\n btnShowSelected.onclick = function (event){\n let selectedItems;\n selectedItems = showSelected(strId, parentDiv, rcType);\n enableButtons_UpdateDelete(strId);\n }\n btnShowSelected.style.zIndex = zIndex;\n\n let btnShowAll = document.createElement(\"button\");\n btnShowAll.innerHTML = '<i class=\"fa fa-tasks\" title=\"Show All\"></i>'; //\"Show All\";\n btnShowAll.className = \"button\";\n btnShowAll.id = strId + \"_btnShowAll\";\n btnShowAll.onclick = function (event){\n showAllRcBoxes(strId, parentDiv);\n enableButtons_UpdateDelete(strId);\n };\n btnShowAll.style.zIndex = zIndex;\n\n let btnReset = document.createElement(\"button\");\n btnReset.innerHTML = '<i class=\"fa fa-undo-alt\" title=\"Reset\"></i>'; //\"Reset\";\n btnReset.className = \"button\";\n btnReset.id = strId + \"_btnReset\";\n btnReset.onclick = function (event){\n //use strID and not txtSearchId\n //resetAll(txtSearchId, parentDiv, rcType);\n resetAll(strId, parentDiv, rcType);\n disableButtons_AddDeleteUpdate(strId);\n };\n btnReset.style.zIndex = zIndex;\n\n //ADD EDIT BUTTONS AND EDIT DIV ---------------\n //Add new option \n const btnAdd = document.createElement(\"button\");\n btnAdd.id = strId_btnAdd;\n btnAdd.innerHTML = '<i class=\"fa fa-plus-circle\" title=\"Add\"></i>'; //\"Add\";\n btnAdd.className = \"button\";\n btnAdd.onclick = function (event){\n //resetAll(txtSearchId, parentDiv, rcType)\n //Get count of fieldsOptions and add 1 then set as idx\n let optsList = parentDiv.querySelectorAll('input[type=\"' + rcType + '\"]');\n let lastOptsIdx = lastIdIndex(optsList) + 1;\n if (window.confirm(`Are you sure you want to add: \"${strSearch.value.toProperCase()}\" as an option!`)) {\n let rcInput_Id;\n rcInput_Id = addOption(parentDiv, rcType, strSearch.value, strId, lastOptsIdx, zIndex, true);\n document.getElementById(rcInput_Id).checked = true;\n strSearch.value = \"\";\n //Disable the button after addition of new option\n this.disabled = true;\n //console.log(rcInput_F);\n\n //Now that we have added the option, you can edit or delete it, so \n //enable those buttons\n enableButtons_UpdateDelete(strId);\n } else {\n //show all options, clear search text box\n //Do nothing.\n }\n //showAllRcBoxes(txtSearchId, parentDiv);\n };\n btnAdd.style.zIndex = zIndex;\n //Disable button, only enable it when the search filters dont bring up anything\n //Can only add a new option if it doesnt exist already!\n btnAdd.disabled = true;\n\n\n //Delete option\n let btnDelete = document.createElement(\"button\");\n btnDelete.innerHTML = '<i class=\"fa fa-trash-alt\" title=\"Delete\"></i>'; //\"Delete\";\n btnDelete.className = \"button\";\n btnDelete.id = strId_btnDelete;\n btnDelete.onclick = function (event){\n Promise.resolve().then(deleteOptions(parentDiv, strId, rcType));\n //deleteOptions(parentDiv, strId, rcType)\n enableButtons_UpdateDelete(strId);\n };\n btnDelete.style.zIndex = zIndex;\n btnDelete.disabled = true; //Only enable when selections are made\n\n //Update Option\n let btnUpdate = document.createElement(\"button\");\n btnUpdate.innerHTML = '<i class=\"fa fa-pen\" title=\"Update\"></i>'; //\"Update\";\n btnUpdate.className = \"button\";\n btnUpdate.id = strId_btnUpdate; \n btnUpdate.onclick = function (event){\n //console.log(\"btnUpdate: line 938\")\n //console.log(parentDiv);\n //console.log(txtSearchId);\n //console.log(rcType);\n updateOption(parentDiv, strId, rcType);\n };\n btnUpdate.style.zIndex = zIndex;\n btnUpdate.disabled = true; //Only enable when selections are made\n\n //Exit Edit Mode for Option\n let btnExitedit = document.createElement(\"button\");\n btnExitedit.innerHTML = '<i class=\"fa fa-times-circle\" title=\"Exit\"></i>'; //\"Exit\";\n btnExitedit.className = \"button\";\n btnExitedit.id = strId + \"_btnExitedit\";\n btnExitedit.onclick = function (event){\n exitEditMode(parentDiv, strId);\n };\n btnExitedit.style.zIndex = zIndex;\n\n //SEARCH DIV\n let qDiv = document.createElement(\"div\");\n qDiv.appendChild(btnClear);\n qDiv.appendChild(btnShowSelected);\n qDiv.appendChild(btnShowAll);\n qDiv.appendChild(btnReset);\n qDiv.name = \"searchButtonsDiv\";\n qDiv.id = strId + \"_\" + qDiv.name;\n qDiv.style.zIndex = zIndex;\n //Add the above components to the form\n parentDiv.appendChild(qDiv);\n\n qDiv = document.createElement(\"div\");\n qDiv.appendChild(strSearch);\n qDiv.name = \"optSearchTextDiv\"; \n qDiv.id = strId + \"_\" + qDiv.name;\n qDiv.style.zIndex = zIndex;\n parentDiv.appendChild(qDiv);\n\n //EDIT DIV\n qDiv = document.createElement(\"div\");\n //Add the above components to the form\n qDiv.appendChild(btnAdd);\n qDiv.appendChild(btnUpdate);\n qDiv.appendChild(btnDelete);\n qDiv.appendChild(btnExitedit);\n qDiv.name = \"editOptionsDiv\"; //.style.display = \"none\";\n qDiv.id = strId + \"_\" + qDiv.name;\n qDiv.className = \"divEdit\";\n qDiv.style.zIndex = zIndex;\n qDiv.style.display = \"none\"; //make sure edit div is hidden\n //Add the above components to the form\n parentDiv.appendChild(qDiv);\n \n }", "title": "" }, { "docid": "022bb55a6427886beb9886f972cc4925", "score": "0.5432896", "text": "function getDisplayableSearchCriteria() {\n\n var inputValue = \"\";\n var subvalue = \"\";\n \n var s1 = \"\";\n \n for ( i = 0; i < currentSearchTableRow; i++) {\n\n inputValue = searchFieldValues[i] + \"\\n\";\n while((orPositionInValue = inputValue.indexOf(\" OR \")) != -1) {\n inputValue = inputValue.substr(0,orPositionInValue) + \"\\n\" + inputValue.substr(orPositionInValue+4,inputValue.length);\n }\n \n s1 = s1 + \"(\";\n valueSeperatorIndex = inputValue.indexOf(\"\\n\");\n s3 = \"\";\n while( valueSeperatorIndex != -1) {\n \n subvalue = inputValue.substr(0,valueSeperatorIndex);\n inputValue = inputValue.substr(valueSeperatorIndex+1, inputValue.length);\n\n if ( (subvalue != \"\") && (subvalue != \"\\n\") && (subvalue != \" \")) {\n if (FieldInput.options(searchFieldNames[i]).className != \"integer\")\n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).text + \" \" + SearchTable.rows(i).cells(1).innerText + \" '\" + subvalue + \"') \"; \n else\n s2 = \"(\" + FieldInput.options(searchFieldNames[i]).text + \" \" + SearchTable.rows(i).cells(1).innerText + \" \" + subvalue + \") \"; \n }\n if ( s3 != \"\")\n s3 = s3 + \" or \";\n \n s3 = s3 + s2;\n \n valueSeperatorIndex = inputValue.indexOf(\"\\n\");\n }\n s1 = s1 + s3 + \")\";\n \n if ( i != (currentSearchTableRow-1)) \n s1 = s1+ \" and \\n\";\n }\n \n\n return s1;\n}", "title": "" }, { "docid": "fea6cffd851e0aa2582c5fc45290d879", "score": "0.5418276", "text": "function onSearchInput(e) {\r\n searchStr = e.control.value();\r\n var iconspanel = dialogApi.find('#iconspanel');\r\n iconspanel[0].getEl().innerHTML = filterIcons();\r\n }", "title": "" }, { "docid": "b8f9f15b46bf6bf0b176ac9101f9b837", "score": "0.54033107", "text": "function SearchResaultsBuilder(i_parent, i_template){\n\t\t//--/ 0 = id, 1 = img, 2 = item name, 3 = price\n\t\tthis.m_defaultResaultTemplate = (i_template != '' || i_template != undefined) ? i_template : '';\n\t\tthis.m_resaultTemplate = this.m_defaultResaultTemplate;\n\t\tthis.m_parent = (i_parent != '' || i_parent != undefined) ? i_parent : '';\n\t\tthis.m_resaultsArr = [];\n\t}", "title": "" }, { "docid": "52a11b5e980e664c28b02feb67ea236a", "score": "0.5375447", "text": "function searchRadio() {\n $('#searchForDrop').change(function() {\n // RESET SEARCH INPUT TEXT\n $(\".searchInput\").val(\"\");\n // RESET SEARCH FOR TEXT\n $('.searchFor').text('');\n // SHOW ALL PERSONNEL\n $('.personnel-item').show();\n $('.letter-divider').show()\n // HIDE ALL PERSONNEL CARD INFO\n $('.personDep').addClass('d-none')\n $('.personLoc').addClass('d-none')\n $('.personJob').addClass('d-none')\n\n if (this.value === 'FN') {\n changeSearchVal('#searchForDrop', 'FN', \"First Name...\", 'First Name',\n '.personFName')\n } \n else if (this.value === 'LN') {\n changeSearchVal('#searchForDrop', 'LN', \"Last Name...\", 'Last Name',\n '.personFName')\n }\n else if (this.value === 'DP') {\n changeSearchVal('#searchForDrop', 'DP', \"Department Name...\", \n 'Department Name','.personDep', '.personDep')\n }\n else if (this.value === 'LC') {\n changeSearchVal('#searchForDrop', 'LC', \"Location Name...\", 'Location Name',\n '.personLoc', '.personLoc')\n }\n else if (this.value === 'JT') {\n changeSearchVal('#searchForDrop', 'JT', \"Job Title...\", 'Job Title',\n '.personJob', '.personJob')\n }\n });\n\n $('#searchDepForDrop').change(function() {\n // RESET SEARCH INPUT TEXT\n $(\".searchInput\").val(\"\");\n // RESET SEARCH FOR TEXT\n $('.searchFor').text('');\n // SHOW ALL PERSONNEL\n $('.personnel-item').show();\n $('.letter-divider').show()\n\n if (this.value === 'DN') {\n changeSearchVal('#searchDepForDrop', 'DN', \"Department Name...\", 'Department Name',\n '.cardDepName')\n } \n else if (this.value === 'LC') {\n changeSearchVal('#searchDepForDrop', 'LC', \"Location Name...\", 'Location Name',\n '.searchLocation')\n }\n });\n\n $('#searchLocForDrop').change(function() {\n // RESET SEARCH INPUT TEXT\n $(\".searchInput\").val(\"\");\n // RESET SEARCH FOR TEXT\n $('.searchFor').text('');\n // SHOW ALL PERSONNEL\n $('.personnel-item').show();\n $('.letter-divider').show()\n\n if (this.value === 'LN') {\n changeSearchVal('#searchLocForDrop', 'LN', \"Location Name...\", 'Location Name',\n '.cardLocName')\n } \n else if (this.value === 'DN') {\n changeSearchVal('#searchLocForDrop', 'DN', \"Department Name...\", 'Department Name',\n '.searchDepartment')\n }\n });\n}", "title": "" }, { "docid": "39bb0c3ad2c1bf06b83a79f7113dbc1e", "score": "0.53585917", "text": "function doSearchRequest(imageInputControl, callback){\n\tif(imageInputControl.files.length == 0)\n\t\treturn;\n\t\n\tvar data = new FormData(document.getElementById('searchForm'));\n\t\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('POST', 'rest/search/', true);\n\txhr.onerror = function(err){\n\t\tcallback();\n\t}\n\txhr.onload = function(){\n\t\tif(xhr.status == 200){\n\t\t\tvar searchResult = JSON.parse(xhr.responseText);\n\t\t\tcallback(searchResult);\n\t\t}\n\t\telse{\n\t\t\tcallback();\n\t\t}\n\t};\n\txhr.send(data);\n\t\n\t// return dummy data to be used in implementation\n\t// extractedImageUrl should be added after splitting images, it is put here so that search-results work don't wait for image-split work\n//\tcallback({\n//\t\t'foundObjects': [ {\n//\t\t\t'className': 'apple',\n//\t\t\t'x': 600,\n//\t\t\t'y': 600,\n//\t\t\t'width': 500,\n//\t\t\t'height': 500,\n//\t\t\t'extractedImageUrl': 'dummyImages/appleExtracted.jpg',\n//\t\t\t'similarImagesPaths': [\n//\t\t\t\t\"dummyImages/apple1.png\",\n//\t\t\t\t\"dummyImages/apple2.png\"\n//\t\t\t]\n//\t\t},{\n//\t\t\t'className': 'bike',\n//\t\t\t'x': 0,\n//\t\t\t'y': 0,\n//\t\t\t'width': 300,\n//\t\t\t'height': 400, \n//\t\t\t'extractedImageUrl': 'dummyImages/bikeExtracted.jpg',\n//\t\t\t'similarImagesPaths': [\n//\t\t\t\t\"dummyImages/bike1.png\",\n//\t\t\t\t\"dummyImages/bike2.png\"\n//\t\t\t]\n//\t\t}]\n//\t});\n}", "title": "" }, { "docid": "fff70689a8ed2dbef31f387e9a08e7fc", "score": "0.5347253", "text": "function page_startSearch(request) {\r\n var LOG_TITLE = 'page_startSearch';\r\n\r\n var stUser = nlapiGetUser();\r\n var objEmpLocation = '';\r\n var objEmpLocationLabel = nlapiLookupField('employee', stUser, ['location', 'custentity_lbc_default_from_loc'], true);\r\n\r\n if (!objEmpLocationLabel['customrecord_rtf_course_group']) {\r\n objEmpLocationLabel['customrecord_rtf_course_group'] = 'Courses';\r\n }\r\n if (!objEmpLocationLabel['custentity_lbc_default_from_loc']) {\r\n objEmpLocationLabel['custentity_lbc_default_from_loc'] = 'From Location';\r\n }\r\n\r\n objEmpLocationLabel = 'to';\r\n var _SEARCHFORM = nlapiCreateForm('Search Item(s)');\r\n\r\n //buttons for choosing on how the searching for the items will execute\r\n _SEARCHFORM.addSubmitButton('Load Item(s)');\r\n\r\n //the search field for the item\r\n //_SEARCHFORM.addField('custpage_lcb_from_date', 'date', 'From').setDisplayType('normal');\r\n //_SEARCHFORM.addField('custpage_lcb_to_date', 'date', 'To').setDisplayType('normal');\r\n //_SEARCHFORM.addField('custpage_lcb_location', 'select', 'ToLoc', 'location').setDisplayType('normal').setDefaultValue(objEmpLocation['location']);\r\n _SEARCHFORM.addField('custpage_lbc_from_location', 'select', 'customrecord_rtf_course_group', 'customrecord_rtf_course_group').setDisplayType('normal');\r\n _SEARCHFORM.addField('custpage_lbc_to_location_label', 'text', 'x').setDisplayType('normal').setDefaultValue(objEmpLocationLabel['customrecord_rtf_course_group']);\r\n //_SEARCHFORM.addField('custpage_lbc_from_location_label', 'text', 'From Location Label').setDisplayType('normal').setDefaultValue(objEmpLocationLabel['custentity_lbc_default_from_loc']);\r\n //_SEARCHFORM.addField('custpage_lcb_ship_date', 'date', 'Ship Datewee').setDisplayType('normal').setMandatory(true);\r\n\r\n //store in a parameter the values needed for processing the records\r\n //_SEARCHFORM.addField('custpage_action', 'text', 'Action').setDisplayType('hidden').setDefaultValue('GET_ITEMS');\r\n\r\n return _SEARCHFORM;\r\n}", "title": "" }, { "docid": "bed8576d88da4bb5393267baafd1f487", "score": "0.53437614", "text": "function search(deselect) {\t\t\t\t\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\tvm.hideLoadingHeader = false;\n\t\t\t\n\t\t\t// save off old request\n\t\t\tvm.oldRequest = vm.apiDomain;\n\t\n\t\t\t// call API to search; pass query params (vm.selected)\n\t\t\tImageSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\t\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.hideLoadingHeader = true;\n\t\t\t\tvm.selectedIndex = 0;\n vm.journalLicenses = [];\n\t\t\t\tvm.needsDXDOIid = false;\n\n\t\t\t\t// after add/create, search/by J: is run & results returned\n\t\t\t\t// then deselect so form is ready for next add\n\t\t\t\tif (deselect) {\n\t\t\t\t\tdeselectObject();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (vm.results.length > 0) {\n\t\t\t\t\t\tvm.queryMode = false;\n\t\t\t\t\t\tloadObject();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvm.queryMode = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocusFigureLabel();\n\n\t\t\t}, function(err) { // server exception\n\t\t\t\tpageScope.handleError(vm, \"Error while searching\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "0b7de627abaa21fcd962c314b4278abd", "score": "0.5336558", "text": "function advSearch(event) {\n\n\tevent.preventDefault();\n\t//empty content string\n var tableContent = '';\n\tvar headers = '';\n\t\n\t//extract our search strings from each input box\n\tvar appnameVal = $('#advSearchBar fieldset input#inputSearchAppname').val();\n\tvar ownerVal = $('#advSearchBar fieldset input#inputSearchOwner').val();\n\tvar instanceVal = $('#advSearchBar fieldset input#inputSearchInstance').val();\n\tvar hostnameVal = $('#advSearchBar fieldset input#inputSearchHostname').val();\n\tvar portVal = $('#advSearchBar fieldset input#inputSearchPort').val();\n\tvar environmentVal = $('#advSearchBar fieldset input#inputSearchEnvironment').val();\n\tvar DRVal = $('#advSearchBar fieldset input#inputSearchDR').val();\t\n\tvar OSVal = $('#advSearchBar fieldset input#inputSearchOS').val();\t\n\tvar descriptionVal = $('#advSearchBar fieldset input#inputSearchDescription').val();\t\n\tvar locationVal = $('#advSearchBar fieldset input#inputSearchLocation').val();\t\n\tvar personaldataVal = $('#advSearchBar fieldset input#inputSearchPersonalData').val();\n\tvar sensitivedataVal = $('#advSearchBar fieldset input#inputSearchSensitiveData').val();\n\tvar healthdataVal = $('#advSearchBar fieldset input#inputSearchHealthData').val();\t\n\tvar rardataVal = $('#advSearchBar fieldset input#inputSearchRarData').val();\t\n\tvar restricteddataVal = $('#advSearchBar fieldset input#inputSearchRestrictedData').val();\t\n\tvar publicdataVal = $('#advSearchBar fieldset input#inputSearchPublicData').val();\t\n\t\n\t//NOTE: need to add another variable declaration above this comment for each additional field you want to add\n\n\t//construct our query with the values above\n\tvar searchQuery = {};\n\tif (appnameVal != \"\") searchQuery['appname'] = appnameVal;\n\tif (ownerVal != \"\") searchQuery['owner'] = ownerVal;\n\tif (instanceVal != \"\") searchQuery['instance'] = instanceVal;\n\tif (hostnameVal != \"\") searchQuery['hostname'] = hostnameVal;\n\tif (environmentVal != \"\") searchQuery['environment'] = environmentVal;\n\tif (DRVal != \"\") searchQuery['DR'] = DRVal;\t\n\tif (OSVal != \"\") searchQuery['OS'] = OSVal;\t\n\tif (parseInt(portVal,10)) { // <-- integer value fields have a different format\n\t\tsearchQuery['port'] = parseInt(portVal,10);\n\t}\n\tif (descriptionVal != \"\") searchQuery['description'] = descriptionVal;\t\n\tif (locationVal != \"\") searchQuery['location'] = locationVal;\t\n\tif (personaldataVal != \"\") searchQuery['personaldata'] = personaldataVal;\n\tif (sensitivedataVal != \"\") searchQuery['sensitivedata'] = sensitivedataVal;\n\tif (healthdataVal != \"\") searchQuery['healthdata'] = healthdataVal;\n\tif (rardataVal != \"\") searchQuery['rardata'] = rardataVal;\n\tif (restricteddataVal != \"\") searchQuery['restricteddata'] = restricteddataVal;\t\n\tif (publicdataVal != \"\") searchQuery['publicdata'] = publicdataVal;\t\n\t\n\t//NOTE: need to add another IF statement above this comment for each additional field you want to add, remember that integer value fields have a different format of statement\n\t\n\t//make an AJAX call to post our query, and get the response containing the result of the query\n\t$.ajax({\n type: 'POST',\n data: searchQuery,\n url: '/assets/advsearch',\n dataType: 'JSON'\n }).done(function( data ) {\t\n\t\tif (data.entries == \"\") {\n\t\t\ttableContent = \"Your search returned no results...\"\n\t\t}else\n\t\t{\n\n\t\t\t//convert our JSON data into html content for the table\n\t\t\ttableContent = createTableRows(data.entries);\n\n\t\t\t//create html table headers by looking at the fields in our data\n\t\t\theaders = createTableHeaders(data.entries);\t\n\t\t}\t\n\t\t// Inject the whole content string into our existing HTML table\n\t\t$('#assetList table tbody').html(tableContent);\n\t\t$('#assetList table thead').html(headers);\n\t\t\n\t\tpopulatePageInfo(1, data.pages);\n\n });\t\n\n}", "title": "" }, { "docid": "43fb125f98926d66fb69076743215d38", "score": "0.53313005", "text": "function woZipcodewRadioButton() {\n var empty_info = [];\n if ($scope.searchIncentives.incentiveProgram != undefined && $scope.searchIncentives.incentiveCategory != undefined) {\n\n var iData = $window.incentiveData;\n\n for (var i = 0; i < iData.length; i++) {\n if (iData[i].incentiveCategory == $scope.searchIncentives.incentiveCategory && iData[i].incentiveProgram == $scope.searchIncentives.incentiveProgram) {\n empty_info.push(iData[i]);\n }\n }\n\n } else if ($scope.searchIncentives.incentiveProgram == undefined && $scope.searchIncentives.incentiveCategory != undefined) {\n\n var iData = $window.incentiveData;\n\n for (var i = 0; i < iData.length; i++) {\n if (iData[i].incentiveCategory == $scope.searchIncentives.incentiveCategory) {\n empty_info.push(iData[i]);\n }\n }\n\n } else if ($scope.searchIncentives.incentiveProgram != undefined && $scope.searchIncentives.incentiveCategory == undefined) {\n var iData = $window.incentiveData;\n\n for (var i = 0; i < iData.length; i++) {\n if (iData[i].incentiveProgram == $scope.searchIncentives.incentiveProgram) {\n empty_info.push(iData[i]);\n }\n }\n }\n $scope.tableData3 = empty_info;\n }", "title": "" }, { "docid": "40e2e9c59aa7b51fa6ff7092593fac26", "score": "0.5316032", "text": "function coverSearch(id){\r\n \r\n \r\n \r\n var searchTerm = document.getElementById(id).getAttribute(\"name\");\r\n var result1=\"\"; //= \"<a href=\\\"#\\\" id = \\\"picture\\\" onclick =\\\"titleSearch('\"+books[0].title+\"')\\\">\"+books[0].cover+\"</a>\";\r\n \r\n groupSearch(searchTerm);\r\n\r\n for(i=0; i<books.length; i++){\r\n \r\n if(searchTerm === books[i].category || searchTerm === books[i].parentCategory){\r\n \r\n result1 = result1 + \"<a href=\\\"#\\\" id = \\\"picture\\\" onclick =\\\"titleSearch('\"+books[i].title+\"')\\\">\"+books[i].cover+\"</a>\"\r\n \r\n }\r\n document.getElementById(\"results_img\").innerHTML = result1;\r\n \r\n }\r\n}//end of current function", "title": "" }, { "docid": "6698261d0b8c3f0a21a3a6101f63f416", "score": "0.5311233", "text": "function InvInitSearch(name, type, text,filtertext) {\n this.PADDING_LEFT = 10;\n this.TAB = 15;\n this.number = name == null ? \"\" : name;\n this.type = type == null ? \"\" : type;\n this.text = text == null ? \"\" : text;\n this.filtertext= filtertext;\n this.id = this.number == null ? \"notDefinedYet\" : \"is\" + this.number;\n this.counter = treeItemsCounter++;\n this.show = function ()\n {\n if (document.getElementById(this.id) == null) {\n var imgDir = \"/activator/images/inventory-gui/tree/\";\n var oSpan = document.createElement(\"div\");\n oSpan.setAttribute(\"id\", this.id);\n oSpan.className = \"scroll_branch\";\n var oSp;\n if (expandedNode.nextNodeIndexWithSameLevel == null) {\n oSp = document.body.appendChild(oSpan);\n } else {\n var node = treeItemsList.get(expandedNode.nextNodeIndexWithSameLevel);\n oSp = document.body.insertBefore(oSpan, document.getElementById(node.id));\n }\n oSp.style.whiteSpace = \"nowrap\";\n oSp.style.width = \"100%\";\n oSp.style.height = \"16px\";\n oSp.style.padding = \"0px\";\n oSp.style.margin = \"0px\";\n var html = \"<div style=\\\"margin-left:\" + (this.TAB * this.level) + \"px;\\\">\";\n html += \"<img id=\\\"ascr\" + this.id + \"\\\" src=\\\"\" + imgDir + \"top.gif\\\" align=\\\"top\\\" style=\\\"cursor:pointer; width:16px; height:16px;\\\" \";\n html += \"oncontextMenu=\\\"return false;\\\" onclick=\\\"this.treeObject.scrollTo('top');\\\">\";\n html += \"<img id=\\\"rscr\" + this.id + \"\\\" src=\\\"\" + imgDir + \"topscroll.gif\\\" align=\\\"top\\\" style=\\\"cursor:pointer; width:16px; height:16px;\\\" \";\n html += \"oncontextMenu=\\\"return false;\\\" onclick=\\\"this.treeObject.scrollTo('previous');\\\">\";\n html += \"<span style=\\\"position:relative; top:1px;\\\">&nbsp;\" + this.text + \"</span>\";\n if (this.filtertext != \"null\") {\n html += \"<img id=\\\"fscr\" + this.id + \"\\\" src=\\\"\" + imgDir + \"filterhint.gif\\\" align=\\\"top\\\" style=\\\"cursor:pointer; width:16px; height:16px;\\\" \";\n html += \"title=\\\"filter \" + this.filtertext + \"\\\" \";\n html += \"oncontextMenu=\\\"return false;\\\" onclick=\\\"this.treeObject.fillinputtext(\\'\" + this.filtertext + \"\\');\\\">\";\n }\n html += \"</div>\";\n html += \"</span>\";\n document.getElementById(this.id).innerHTML = html;\n document.getElementById(\"ascr\" + this.id).treeObject = this;\n document.getElementById(\"rscr\" + this.id).treeObject = this;\n if (this.filtertext!=\"null\"){\n document.getElementById(\"fscr\" + this.id).treeObject = this;\n }\n }\n }\n this.fillinputtext = function (filtertext)\n {\n if (document.getElementById(\"ines\" + this.number) != null) {\n document.getElementById(\"ines\" + this.number).value = filtertext;\n }\n }\n this.getParent = function ()\n {\n var i = treeItemsList.indexOf(this) - 1;\n return treeItemsList.get(i);\n }\n this.scrollTo = function (scroll)\n {\n var scrLeft = $(document).scrollLeft();\n var scrTop = $(document).scrollTop();\n hideFlyingMenu();\n this.getParent().removeChidren();\n var url = \"/activator/ScrollBranchAction.do?scroll=\" + scroll;\n url += \"&name=\" + this.number + \"&type=\" + this.type + \"&rmn=\" + rmn+\"&rimid=\" + rid;\n url += \"&scrLeft=\" + scrLeft + \"&scrTop=\" + scrTop + \"&instance=\" + instance;\n window.open(url, \"treeResult\");\n }\n this.remove = function ()\n {\n document.body.removeChild(document.getElementById(this.id));\n }\n if (expandedNode.expandedNodeIndex == null || expandedNode.nextNodeIndexWithSameLevel == null) {\n treeItemsList.add(this);\n } else {\n treeItemsList.insertAt(expandedNode.nextNodeIndexWithSameLevel, this);\n expandedNode.nextNodeIndexWithSameLevel++;\n }\n this.level = this.getParent().level + 1;\n invInitSearchArray[invInitSearchArray.length] = this;\n}", "title": "" }, { "docid": "926313c6283d03c01f278fb9a7a6185a", "score": "0.5309475", "text": "function onSearch() {\n\n \n var nameFindVal = document.forms[0].findVal.value;\n var nameFindIn = document.forms[0].findIn.value;\n \n //Show error message to the user if he has select only findVal and not find In.\n if(nameFindVal !=\"\" && nameFindIn == \"\"){\n showBarMessage('Please specific find value.', ERROR_MSG);\n return false;\n }\n \n //Show error message to the user if he has select only findVal and not find In.\n if(nameFindVal ==\"\" && nameFindIn != \"\"){\n showBarMessage('Please specific find in.', ERROR_MSG);\n return false;\n }\n \n //Clear the Data Table\n// clearDiv('search_result');\n \n \n //set the action\n document.forms[0].currPageNo.value = 1;\n document.forms[0].action = BROWSE_FSC_LOOKUP;\n \n document.forms[0].submit();\n return false;\n}", "title": "" }, { "docid": "4be9145f4f901b4a4f5a0cc99a4851c3", "score": "0.5287646", "text": "function newSearchWidget(id,w,searchCB,helpText)\n{\n\tvar o=newWidget(id)\n\t\t\t\t\t\t\t\t\t\n\to.bMatchCase\t\t\t= false;\t\n\t\n\to.searchField\t\t\t= newTextFieldWidget(id+\"_searchVal\",null,50,SearchWidget_keyUpCB,SearchWidget_searchCB,true,_lovSearchFieldLab,w?(w-40):null);\n\to.searchField.par\t\t= o;\n\to.searchField.setHelpTxt(helpText?helpText:_lovSearchFieldLab);\n\t\n\to.searchIcn\t\t\t\t= newIconMenuWidget(id+\"_searchIcn\",_skin+'../lov.gif',SearchWidget_searchCB,null,_lovSearchLab,16,16,0,0,0,0)\n\to.searchIcn.par\t\t\t= o\n\to.searchMenu\t\t\t= o.searchIcn.getMenu()\n\to.normal\t\t\t\t= o.searchMenu.addCheck(id+\"normal\",_lovNormalLab,SearchWidget_normalClickCB)\n\to.matchCase\t\t\t\t= o.searchMenu.addCheck(id+\"matchCase\",_lovMatchCase,SearchWidget_matchCaseClickCB)\n\t\t\n\to.oldInit\t\t\t\t= o.init\n\to.searchCB\t\t\t\t= searchCB\n\to.init\t\t\t\t\t= SearchWidget_init\n\to.getHTML\t\t\t\t= SearchWidget_getHTML\n\to.setCaseSensitive\t\t= SearchWidget_setCaseSensitive\n\to.isCaseSensitive\t\t= SearchWidget_isCaseSensitive\n\to.updateMatchCase\t\t= SearchWidget_updateMatchCase\n\to.getSearchValue\t\t= SearchWidget_getSearchValue;\n\to.setSearchValue\t\t= SearchWidget_setSearchValue;\n\to.resize\t\t\t\t= SearchWidget_resize;\t\t\n\t\n\treturn o;\n}", "title": "" }, { "docid": "7b7e9d22ab7557e73a32deb980a45f89", "score": "0.5285785", "text": "function Search_Photos() {\n\tvar search_key = document.getElementById(\"photos-search-input\").value;\n\tShow_Photos(search_key);\n}", "title": "" }, { "docid": "e1fa7adbddb17284a16ab8fcd42c7c58", "score": "0.52794874", "text": "function search() {\n $(\"search-results\").html(\"\");\n gadgets.window.adjustHeight();\n var types = [];\n $(\"input:checked\").each(function() {\n types.push(this.id);\n });\n var params = {\n limit : $(\"#limit\").val(),\n query : $(\"#query\").val(),\n sort : $(\"#sort-type\").val(),\n sortOrder : $(\"#sort-order\").val()\n };\n if (types.length > 0) {\n params.type = types;\n }\n console.log(\"searching for \" + JSON.stringify(params));\n osapi.jive.core.searches.searchContent(params).execute(function(response) {\n console.log(\"searching response is \" + JSON.stringify(response));\n if (response.error) {\n alert(response.error.message);\n }\n else {\n var html = \"\";\n var rows = response.data;\n $.each(rows, function(index, row) {\n html += \"<tr>\";\n html += \"<td>\" + row.type + \"</td>\";\n html += \"<td>\" + row.resources.self.ref + \"</td>\";\n html += \"<td>\" + row.modificationDate + \"</td>\";\n html += \"<td>\" + row.subject + \"</td>\";\n html += \"</tr>\";\n });\n $(\"#search-results\").html(html);\n gadgets.window.adjustHeight();\n }\n });\n}", "title": "" }, { "docid": "79b4b090d24adbac930a73ed872e04ac", "score": "0.52639294", "text": "function search(){\r\n\t\r\n\t// topical keywords\r\n\tkeywords = document.getElementById('keyword').value;\r\n\t\r\n\t// query geographic extent\r\n\tlatmin = document.getElementById('latmin').value;\r\n\tlatmax = document.getElementById('latmax').value;\r\n\tlongmin = document.getElementById('longmin').value;\r\n\tlongmax = document.getElementById('longmax').value;\r\n\textent = [longmin, latmin, longmax, latmax];\r\n\tsearchExtent = \"searchExtent=[\" + extent + \"]\";\r\n\t\r\n\t// maximum number of records returned\r\n\tmaxRecs = 20;\r\n\r\n\t// limit category to \"Data\"\r\n\tcategory = \"filter=browseCategory=Data\";\r\n\t\r\n\t// limit type to \"Shapefile\" OR \"GeoTIFF\"\r\n\ttype = \"filter=browseType=Shapefile&filter=browseType=GeoTIFF&conjunction=browseType=OR\"\r\n\t\r\n\t// limit extention to \"Shapefile\" OR \"Raster\"\r\n\textention = \"filter=facets.facetName=Raster&filter=facets.facetName=Shapefile&conjunction=facets.facetName=OR\";\t\r\n\t\r\n\t// retrieve title in query\r\n\tfields = \"fields=title\";\r\n\t\r\n\t// query results returned in json format\r\n\tformat = \"format=json\";\t\r\n\t\r\n\t// concatenate query parameters into a single string\r\n\tparastring = \"q=\" + keywords\r\n\t\t\t\t + \"&\" + searchExtent\r\n\t + \"&max=\" + maxRecs\r\n\t + \"&\" + category\r\n\t + \"&\" + type\r\n\t + \"&\" + extention\r\n\t + \"&\" + fields \r\n\t + \"&\" + format;\r\n\t\r\n\t// use HTTP GET to perform query\r\n\t$.get(\"https://www.sciencebase.gov/catalog/items?\"+parastring, showList);\t\r\n}", "title": "" }, { "docid": "cd1af5b5dda3214b4d9968a6a6b4c9db", "score": "0.526086", "text": "function sparqlQuery() {\n $(\"#errorPanel\").addClass('hidden');\n $(\"#infoPanel\").addClass('hidden');\n $(\"#results\").addClass('hidden');\n $(\"#noResultPanel\").addClass('hidden');\n var ISEARCH = document.getElementById('isearch').value;\n var SSEARCH = document.getElementById('ssearch').value;\n var ASEARCH = document.getElementById('asearch').value;\n var RSEARCH = document.getElementById('search-result').value;\n if (ISEARCH != '' || SSEARCH != '' || ASEARCH != '') {\n if(STORAGETYPE === \"SEEK\"){\n var query = \n \"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \" +\n \"PREFIX dcterms: <http://purl.org/dc/terms/> \" +\n \"PREFIX jerm: <http://jermontology.org/ontology/JERMOntology#> \" +\n \"SELECT DISTINCT (COALESCE(?fileurl, \\\"NA\\\") as ?fileurl) (COALESCE(?filetitle, \\\"NA\\\") as ?filetitle) ?investigation ?study ?assay WHERE {\" +\n \"?i dcterms:title ?investigation ; \" +\n \"rdf:type jerm:Investigation .\" +\n \"?i jerm:itemProducedBy ?projectid . \" +\n \"?projectid dcterms:title ?project . \" +\n \"?i jerm:hasPart ?studyid . \" +\n \"?studyid dcterms:title ?study . \" +\n \"?studyid jerm:hasPart ?assayid . \" +\n \"?assayid dcterms:title ?assay . \" +\n \"OPTIONAL {\" +\n \"?fileurl jerm:isPartOf ?assayid . \" + \n \"?fileurl dcterms:title ?filetitle .\" +\n \"}\" +\n \"FILTER regex(?investigation, '\" + ISEARCH + \"', 'i') . \" +\n \"FILTER regex(?study, '\" + SSEARCH + \"', 'i') . \" +\n \"FILTER regex(?assay, '\" + ASEARCH + \"', 'i') . \" +\n \"FILTER (!regex(?assay, '__result__', 'i')) . \" +\n \"FILTER (!regex(?fileurl, 'samples', 'i')) . \" +\n \"}\";\n } \n }\n if (RSEARCH != '') {\n var query = \n \"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \" +\n \"PREFIX dcterms: <http://purl.org/dc/terms/> \" +\n \"PREFIX jerm: <http://jermontology.org/ontology/JERMOntology#> \" +\n \"SELECT DISTINCT ?assayid (?assay AS ?result_assay) ?investigation ?study ?date WHERE {\" +\n \"?i dcterms:title ?investigation ; \" +\n \"rdf:type jerm:Investigation .\" +\n \"?i jerm:itemProducedBy ?projectid . \" +\n \"?projectid dcterms:title ?project . \" +\n \"?i jerm:hasPart ?studyid . \" +\n \"?studyid dcterms:title ?study . \" +\n \"?studyid jerm:hasPart ?assayid . \" +\n \"?assayid dcterms:title ?assay . \" +\n \"?assayid dcterms:created ?date . \" +\n \"?file jerm:isPartOf ?assayid . \" + \n \"?file dcterms:title ?filetitle . \" +\n \"FILTER regex(?study, '\" + RSEARCH + \"', 'i') .\" +\n \"FILTER regex(?assay, '__result__', 'i')} ORDER BY DESC(?date)\";\n }\n var isValueMissing = false;\n if (ISEARCH === '' && SSEARCH === '' && ASEARCH === '' && RSEARCH === '') {\n var errorMessage = (\"<strong>Input error : \" +\n \"</strong>Please enter a value \")\n isValueMissing = true;\n $(\"#errorPanel\").html(errorMessage);\n $(\"#errorPanel\").removeClass('hidden');\n return false;\n }\n if (!isValueMissing) {\n $('#process').buttonLoader('start');\n console.log(\"SPARQL query \\n\" + query);\n var service = encodeURI(SPARQL_ENDPOINT + query + '&format=json').\n replace(/#/g, '%23').replace('+', '%2B');\n $(\"#infoPanel\").html(\n '<strong>Info :</strong> Some queries take more time to process,' +\n 'thanks for being patient');\n $.ajax({\n url: service, dataType: 'jsonp', success: function (result) {\n document.getElementById('isearch').value = '';\n document.getElementById('ssearch').value = '';\n document.getElementById('asearch').value = '';\n document.getElementById('search-result').value = ''; \n if (ASEARCH != '') {\n SEARCH_ASSAY = ASEARCH;\n } else {\n try {\n result.results.bindings.forEach(function (value) {\n SEARCH_ASSAY = value.assay.value;\n });\n } catch (error) {\n console.log('No value');\n SEARCH_ASSAY = '';\n }\n }\n fillTable(result);\n },\n error: function (xhr) {\n alert(\"An error occured: \" + xhr.status + \" \" +\n xhr.statusText);\n }\n });\n }\n}", "title": "" }, { "docid": "462299f263c5336adcb376062cf87522", "score": "0.5260773", "text": "function SearchResaultsDirector(){ }", "title": "" }, { "docid": "45ae9ca5a536070cbd1b5cb2d4b53d1b", "score": "0.52560353", "text": "function search1() {\n searchBtn.search();\n}", "title": "" }, { "docid": "663b7f7d1250cce4ca16b0ef199fb752", "score": "0.52403474", "text": "function initSearch() \n{\n\n\tsetLocale();\n\tbrowser.detect();\t\n\n\tif (!document.getElementById) { return; }\n\tvar search = document.getElementById('search');\n\tif (search === null) {return;}\n\t\n\t// set method and action for search\n\tsearch.method = 'get';\n\tsearch.action = searchurl; \n\t\n\t// append query string\n\tvar query = document.createElement('input');\n\t// set to type search if available\n\ttry {\n\t\tquery.setAttribute('type','search');\n\t} \n\tcatch(e) {\n\t\tquery.setAttribute('type','input');\n\t}\n\tquery.name = 'q';\n\tquery.value = '';\n\tquery.setAttribute('title',localeStringForKey('search'));\n\tquery.className = 'searchtext';\n\tsearch.appendChild(query);\n\t\n\t//locale\n\tvar lang = document.createElement('input');\n\tlang.type = 'hidden';\n\tlang.name = 'lang';\n\tlang.value = locale;\n\tsearch.appendChild(lang);\n\t\n\t// GUID\n\tvar blogid = document.createElement('input');\n\tblogid.type = 'hidden';\n\tblogid.name = 'GUID';\n\tblogid.value = GUID;\n\tsearch.appendChild(blogid);\n\t\n\t// Path\n\tvar path = document.createElement('input');\n\tpath.type = 'hidden';\n\tpath.name = 'path';\n\tpath.value = location.pathname;\n\tsearch.appendChild(path);\n\n\t// Serve static search page for custom domain name \n\tvar domain = document.createElement('input');\n\tdomain.type = 'hidden';\n\tdomain.name = 'static';\n\tdomain.value = (document.domain != 'web.mac.com');\n\tsearch.appendChild(domain);\n\t\n\t// First look at the parent div to get placement\n\tvar position = 'right';\n\tvar classString = search.parentNode.className;\n\tif (classString.lastIndexOf('left') > -1) { position = 'left'; }\n\telse if (classString.lastIndexOf('right') > -1) { position = 'right'; }\n\t\n\t// Override height of parent\n\tsearch.parentNode.height = 'auto';\n\t\n\t// Now create and insert the Search Glyph as a input type=\"image\"\n\tvar glyph = document.createElement('input');\n\tglyph.setAttribute('type','image');\n\tglyph.src = 'http://www.mac.com/1/up/comments/images/search.png';\n\tglyph.alt = localeStringForKey('search');\n\tglyph.style.background = 'transparent';\n\tglyph.style.border = '0';\n\tglyph.align = 'top';\n\tglyph.id = 'searchGlyph';\n\tswitch(position) {\n\t\tcase 'left':\n\t\t\tsearch.insertBefore(glyph,query);\n\t\t\tbreak;\n\t\tcase 'right':\n\t\t\tsearch.insertBefore(glyph,blogid);\n\t\t\tbreak;\n\t}\n\n\tfixQueryBoxWidth(position);\n\t\t\n\tpngs.add('searchGlyph');\n\tpngs.fix();\n}", "title": "" }, { "docid": "88145ab6b250a238a24fdcb80d157da6", "score": "0.5231246", "text": "onSearch(value) {\n let imagesTemp = [];\n for (let i = 0; i < this.state.tempImages.length; i++) {\n // If the contact's name contains the name entered then add it\n if (this.state.tempImages[i].name.toLowerCase().includes(value.toLowerCase())) {\n imagesTemp.push(this.state.tempImages[i]);\n }\n }\n this.setState({ images: imagesTemp }); // Render contacts matching criteria\n }", "title": "" }, { "docid": "d58cbe3080d3cd177f0758afcddbe37e", "score": "0.5225453", "text": "function search_params()\n{\n filtros={};\n if (current_url_info.has_search) jQuery.extend(filtros, current_url_info.search);\n if (current_url_info.has_download) jQuery.extend(filtros, current_url_info.download);\n\n //colocar la informacion y activar botones\n $('#src>ul>li, #type li').removeClass(\"active\");\n if(\"q\" in filtros)\n $(\"#q\").val(filtros[\"q\"]);\n\n if(\"type\" in filtros)\n {\n var tipos=filtros[\"type\"].split(\",\");\n for(var type in tipos)\n $(\"#type a[data-filter=\"+tipos[type]+\"]\").parent(\"li\").addClass(\"active\");\n }\n if(\"src\" in filtros)\n {\n\n var sources=filtros[\"src\"].split(\",\");\n for(var src in sources)\n $('#src a[data-filter=\"'+sources[src]+'\"]').parents(\"li\").addClass(\"active\");\n }\n if(\"size\" in filtros)\n if(filtros[\"size\"].indexOf(\",\")==-1) //si viene de buscar un tamaño en la busqueda clasica se ignora\n delete(filtros[\"size\"]);\n else\n $(\"#size div\").slider(\"values\",filtros[\"size\"].split(\",\"));\n else\n $(\"#size div\").slider(\"values\",[17,34]);\n}", "title": "" }, { "docid": "727cd44159387aec563930f3edd0db3f", "score": "0.5223018", "text": "function CustomSearchService() {\n var ListBoxCustomSearchValue = HomeScreen.ListBoxCustomSearch.selectedKey;\n if (ListBoxCustomSearchValue === \"none\") {\n searchProduct = searchWord;\n } else {\n searchProduct = searchWord + \" & \" + ListBoxCustomSearchValue;\n }\n ProductListScreen.LblResult.text = \"Results for: \" + searchWord;\n SearchCancelButton();\n customSearchOperations();\n ProductListScreen.show();\n}", "title": "" }, { "docid": "cdc04c0935b2b18c6c546b23ce81b03d", "score": "0.52208054", "text": "function search (event)\n {\n event.stopPropagation ();\n event.preventDefault ();\n let text;\n if (null != CIM_Data)\n if (\"\" !== (text = document.getElementById (\"search_text\").value.trim ()))\n {\n const match = [];\n for (let id in CIM_Data.Element)\n if (CIM_Data.Element.hasOwnProperty (id))\n {\n const obj = CIM_Data.Element[id];\n if (!deleted (obj))\n {\n if (obj.id === text)\n match.push (id);\n else if (obj.mRID === text)\n match.push (id);\n else if (obj.name === text)\n match.push (id);\n else if (obj.aliasName === text)\n match.push (id);\n }\n }\n if (match.length > 0)\n {\n match.sort ();\n const list = match;\n let mrid = match[0];\n let current = null;\n let bb = null;\n for (let i = 0; i < list.length; i++)\n {\n bb = get_bounding_box (match[i]);\n if (null != bb)\n {\n current = match[i];\n break;\n }\n }\n if (null != current)\n {\n mrid = current;\n const bounds = TheMap.getBounds ();\n const zoom = TheMap.getZoom ();\n const x = (bb[1][0] - bb[0][0]) / 2.0 + bb[0][0];\n const y = (bb[1][1] - bb[0][1]) / 2.0 + bb[0][1];\n // resolution (meters/pixel) = (Math.cos (y * Math.PI / 180.0) * 2.0 * Math.PI * 6378.137e3) / (512 * Math.pow (2, zoom));\n // zoom = Math.log2 ((Math.cos (y * Math.PI / 180.0) * 2.0 * Math.PI * 6378.137e3) / (512 * resolution)) ;\n const margin = 20; // pixels\n const pixels = TheMap.getContainer ().clientHeight - 2 * margin;\n const height = measure (bb[0][0], bb[0][1], bb[0][0], bb[1][1]);\n let new_zoom = Math.log2 ((Math.cos (y * Math.PI / 180.0) * 2.0 * Math.PI * 6378.137e3) / (512 * (height / pixels)));\n // if we're not zoomed in already (showing symbols icons from 17 and deeper)\n // or the object bounds are not within the map bounds,\n // refocus the map\n new_zoom = Math.min (Math.max (17, zoom), new_zoom);\n if ((bb[0][0] < bounds.getWest ()) ||\n (bb[1][0] > bounds.getEast ()) ||\n (bb[0][1] < bounds.getSouth ()) ||\n (bb[1][1] > bounds.getNorth ()) ||\n (new_zoom !== zoom))\n {\n TheMap.easeTo\n (\n {\n center: [x, y],\n zoom: new_zoom\n }\n );\n }\n }\n select (mrid, list);\n }\n else\n alert (\"No matches found for '\" + text + \"'\");\n }\n else\n alert (\"No search text\");\n else\n alert (\"No CIM data loaded\");\n }", "title": "" }, { "docid": "b6d505b40385c78bebd35e13c5b48075", "score": "0.5220642", "text": "function ACXSearch(){\n\t\tvar action = \"search\";\n\t\tvar actiontemp = getActionTemp(action)\n\t\tvar dbname = getDBName(action)\n\t\tsetCookie(\"PagingMove\" + MainWindow.dbname + MainWindow.formgroup ,\"first_record\",1)\n\t\tgetStructureFields()\n\t\tgetFormulaFields()\n\t\tgetMolWeightFields()\n\t\tgetRelationalFields()\n\t\tmissingfields = getSearchStrategy()\n\t\tif (needToAuthenticate){\n\t\t\tMainWindow.document.cows_input_form.action = \"../postrelay.asp?dataaction=search&formmode=list\" + \"&formgroup=\" + formgroup + \"&dbname=\" + dbname \n\t\t}\n\t\telse{\n\t\t\tMainWindow.document.cows_input_form.action = actiontemp + \"?formmode=\" + formmode + \"&formgroup=\" + formgroup + \"&dataaction=\" + action + \"&dbname=\" + dbname\n\t\t}\n\t\tMainWindow.document.cows_input_form.submit();\t\n}", "title": "" }, { "docid": "e7d7ce01b3deec4034fba85da69243d7", "score": "0.52180654", "text": "function searchContact(){\n\t\t\t\tvar contNo = new contactNumber('output');\n\t\t \tcontNo.searchContact($('#mobileNoSr').val());\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "059416db259af99426d203e8b6c28c38", "score": "0.52163154", "text": "BeginSearch(string, IUnknown, Variant) {\n\n }", "title": "" }, { "docid": "a25790fad99d171e4fee82184211574a", "score": "0.52153134", "text": "function complexSelectionField(parentDiv, fieldType, strIdentifier, strTitle, arrayOptions){\n let tDiv = document.createElement(\"div\");\n let zIndex = gbl_Z_Index;\n tDiv.className = \"divField\";\n //tDiv.classList.add(\"divField\", \"flex-container\");\n tDiv.style.zIndex = zIndex;\n parentDiv.appendChild(tDiv);\n //strIdentifier will be the key to this object and should be unique.\n let lblTitle = document.createElement(\"label\");\n tDiv.appendChild(lblTitle);\n lblTitle.innerHTML = strTitle + \": \";\n lblTitle.className = \"lblTitle\";\n lblTitle.style.zIndex = zIndex;\n let bAddEventListener = false;\n if(arrayOptions.length > 5){\n //THIS ADDS THE SEARCH HELP\n //Add event listener to the options\n bAddEventListener = true;\n //Change the div class to be tab-inner\n tDiv.className = \"tab-inner\";\n //Add the checkbox\n let cbxInner = document.createElement(\"input\"); //not a radio for sure\n cbxInner.type = \"checkbox\";\n cbxInner.name = \"ddc_rc_inner\";\n cbxInner.id = cbxInner.name + \"_\" + strIdentifier\n cbxInner.style.zIndex = -1; //dont want these visible\n tDiv.prepend(cbxInner); //so it appears before the label\n //Assign the label to the checkbox\n lblTitle.htmlFor = cbxInner.id;\n //Also change the class of the label\n lblTitle.className = \"tab-inner-label\"\n\n //Need to create a new element for tab inner content, then reassign tDiv to that \n //div for all the options in arrayOptions\n let tabInnerContenDiv = document.createElement(\"div\");\n tabInnerContenDiv.className = \"tab-inner-content\";\n tabInnerContenDiv.style.zIndex = zIndex;\n tDiv.appendChild(tabInnerContenDiv);\n tDiv = tabInnerContenDiv;\n //Add the search helpers (search text box, with buttons to show\n //selected only, show all, reset)\n searchHelp(tDiv, strIdentifier, fieldType)\n }\n\n //let containsOtherOption = false;\n\n arrayOptions.forEach(function(opt, idx){\n let rcInputField = addOption(tDiv, fieldType, opt, strIdentifier, idx, zIndex, bAddEventListener);\n });\n }", "title": "" }, { "docid": "77feb58b7acf93cf983d1139f2cb0ec1", "score": "0.5205302", "text": "function basic_search()\n{\n\n //advanced search is what actually does the seraching\n\tadvanced_search(1);\n}", "title": "" }, { "docid": "f9972e277658fd3f2e5ab8547afc887c", "score": "0.5198096", "text": "function search() {\n calculateOffset_Limit();\n /*if(_progressBar) _progressBar.start();*/\n UtilsService.showProgressBar('library_progress');\n DataService.CI\n .search(makeSearchCriteria())\n .then(function (data) {\n /*if(_progressBar) _progressBar.done();*/\n //$log.debug('Search Results returned: ' + cis.length);\n //reset the flags\n $scope.pagination.FILTERS_CHANGED = false;\n $scope.pagination.SORTBY_CHANGED = false;\n\n $scope.cis = data.cis;\n $scope.pagination.totalItems = data.totalCount;\n $scope.hideTotals = false;\n //update the count of pagination\n //$scope.pagination.totalItems = cis.length;\n UtilsService.hideProgressBar('library_progress');\n })\n .catch(function (e) {\n /*if(_progressBar) _progressBar.done();*/\n //$log.debug(e);\n UtilsService.hideProgressBar('library_progress');\n });\n }", "title": "" }, { "docid": "ceb84ca26451695efb0d4bdfd6a7a592", "score": "0.5196017", "text": "function search(flatObjectArrayList) {\n try {\n\n // set order by moduleName, page name , section\n flatObjectArrayList = Enumerable.From(flatObjectArrayList).Where(function (x) {\n return x;\n }).OrderBy(\"$.moduleName\").ThenBy(\"$.pageName\").ThenBy(\"$.sectionName\").ToArray();\n\n vm.paging.total = flatObjectArrayList.length;\n if (!vm.isPaginationOptionChange)\n vm.criteria.pagesize = 10; // set default page size #3#\n\n vm.paging.totalpages = (Math.ceil(flatObjectArrayList.length / vm.criteria.pagesize)) == 0 ? 1 : (Math.ceil(flatObjectArrayList.length / vm.criteria.pagesize));\n\n // set pagination option \n if (!vm.isPaginationOptionChange) {\n vm.paging.pagingOptions.length = 0;\n for (var i = 0; i < vm.paging.totalpages; i++) {\n if (vm.paging.tempPaginationOption.length > i)\n vm.paging.pagingOptions.push(vm.paging.tempPaginationOption[i]);\n }\n vm.isPaginationOptionChange = true;\n }\n\n // \n _getGridViewList(flatObjectArrayList, vm.criteria);\n } catch (e) {\n showErrorMsg(e);\n }\n }", "title": "" }, { "docid": "e5fc9af06b6b29eada4b46f33c395937", "score": "0.5174571", "text": "function searchAction(petitionName){\n\n\t\tgetSongs(petitionName, numSongs);\n\t\tgetAlbums(petitionName,numAlbums);\n\t\tgetArtists(petitionName,numArtists);\n\n}", "title": "" }, { "docid": "9aafb618810b99fbe3317af89724184d", "score": "0.5171935", "text": "function showSelected(strId, pDiv, rcInputType, boolResetSearchText = true) {\n //Clear The text in the search text box\n let a, rc_bx;\n if(boolResetSearchText){\n //let searchTxt;\n //searchTxt = document.getElementById(txtSearchId);\n //searchTxt.value = \"\";\n clearTextSearch(strId);\n } \n \n //Get all the label elements in the parent div\n a = pDiv.querySelectorAll('.lblRcInput'); //Selecting by classname\n //console.log(`a.length = ${a.length}`)\n let optsDivs = pDiv.querySelectorAll(\".optDiv\");\n\n //let selectedRC = [];\n let selectedOptDivs = [];\n for (i = 0; i < a.length; i++) {\n //chk_bx = a[i].getElementsByTagName(\"input\")\n //was ... chk_bx = a[i].querySelectorAll('input[type=\"checkbox\"]:checked');\n rc_bx = a[i].querySelectorAll('input[type=\"' + rcInputType + '\"]:checked');\n if (rc_bx.length !== 0 ){\n //console.log(\"i: \" + i + \"; rc_bx.length: \" + rc_bx.length);\n //console.log(\"rc_bx.checked: \" + rc_bx.checked);\n //console.log(\"a[\" + i +\"].innerHTML: \" + a[i].innerHTML);\n //console.log(\"rc_bx.length: \" + rc_bx.length);\n //console.log(\"rc_bx.item: \" + rc_bx.item(0));\n //console.log(\"rc_bx.nameditem: \" + rc_bx.namedItem);\n //console.log(\"rc_bx.tagName: \" + rc_bx.tagName);\n \n //a[i].style.display = \"\";\n optsDivs[i].style.display = \"\";\n //selectedRC.push(a[i]);\n selectedOptDivs.push(optsDivs[i]);\n } \n else {\n //a[i].style.display = \"none\";\n optsDivs[i].style.display = \"none\";\n }\n }\n //return selectedRC;\n return selectedOptDivs;\n }", "title": "" }, { "docid": "c697a125b4643aa2f29fcc30883d24be", "score": "0.51644516", "text": "function search() {}", "title": "" }, { "docid": "02764f9044704d33f9f80702653bd4c0", "score": "0.5162171", "text": "function getSearchFilter() {\r\n filter = initFilter;\r\n for (i = 0; i < searchFields.length; i++) {\r\n var fname = 'search_' + dotToDolar(searchFields[i]);\r\n if (document.getElementById(fname) == null) {\r\n continue;\r\n }\r\n var val = document.getElementById(fname).value;\r\n if (val != null && val != '-1' && val != '') {\r\n var template = document.getElementById(fname + '_template').value;\r\n if (template == null || template.length < 2)\r\n template = \"fname = 'value'\";\r\n addFilter(template, searchFields[i], val);\r\n }\r\n }\r\n if (filter.length == 0) {\r\n $('#filteredIcon').css('display', 'none');\r\n if ($('#simpleSearch') != null)\r\n $('#simpleSearch').css('display', 'block');\r\n }\r\n else {\r\n $('#filteredIcon').css('display', 'block');\r\n if ($('#simpleSearch') != null)\r\n $('#simpleSearch').css('display', 'none');\r\n }\r\n return toFarsi(filter);\r\n}", "title": "" }, { "docid": "f5c074b36a83534b94eebd27e4086383", "score": "0.5159308", "text": "function searchItemButton() {\n if (table && validate() === true) { // Make sure a value has been selected in the drop down and text box\n let search = null;\n search = (hasOwnProperty(props,'ignorecase') === true) ?\n searchItem.toUpperCase() : // Convert to upper case to ignore case\n searchItem;\n // Find a match in the correct column of the data\n let tableIndex = table.map(function(e) { return e.header; }).indexOf(searchHeader); // Column match\n if (hasOwnProperty(table[tableIndex], 'dataDate') && hasOwnProperty(table[tableIndex], 'searchDate')) {\n searchDate(search, tableIndex);\n } else if (hasOwnProperty(props,'searchstart') === true) {\n searchStart(search, table[tableIndex].name);\n } else {\n searchAny(search, table[tableIndex].name);\n }\n// let index = props.data.findIndex(val => val[table[tableIndex].name].toString().startsWith(search)); // Text match\n// setStartEnd(index); // Set the start and end to show the found text\n }\n }", "title": "" }, { "docid": "ecf5c9164abdedcfc36bd78688af2ddb", "score": "0.5157579", "text": "Search () {\n const O = this,\n cc = O.CaptionCont.addClass('search'),\n P = $('<p class=\"no-match\">'),\n fn = (options.searchFn && typeof options.searchFn === 'function') ? options.searchFn : settings.searchFn;\n\n O.ftxt = $('<input type=\"text\" class=\"search-txt\" value=\"\" autocomplete=\"off\">')\n .on('click', (e) => {\n e.stopPropagation();\n });\n O.ftxt.placeholder = settings.searchText;\n cc.append(O.ftxt);\n O.optDiv.children('ul').after(P);\n\n O.ftxt.on('keyup.sumo', () => {\n const hid = O.optDiv.find('ul.options li.opt').each((ix, e) => {\n const el = $(e),\n {0: opt} = el.data('opt');\n opt.hidden = fn(el.text(), O.ftxt.val());\n el.toggleClass('hidden', opt.hidden);\n }).not('.hidden');\n\n // Hide opt-groups with no options matched\n O.optDiv[0].querySelectorAll('li.group').forEach(optGroup => {\n if (optGroup.querySelector('li:not(.hidden)')) {\n optGroup.classList.remove('hidden');\n } else {\n optGroup.classList.add('hidden');\n }\n });\n\n P.html(settings.noMatch.replace(/\\{0\\}/g, '<em></em>')).toggle(!hid.length);\n P.find('em').text(O.ftxt.val());\n O.selAllState();\n });\n }", "title": "" }, { "docid": "296d76df6a3b6b7f2b2cc40e89a43b2d", "score": "0.51544917", "text": "searchByName() {\n if (this.searchRecipies != \"\") {\n this.getRecipesByNe(this.searchRecipies.replace(\" \", \"\"));\n }\n }", "title": "" }, { "docid": "2dce32200c3bf76633cf4bd0d1b97ead", "score": "0.5130515", "text": "function filterSearch() {\n if (vegetarianBox) {searchArray.vegetarian = 1;}\n if (veganBox) {searchArray.vegan = 1;}\n if (glutenFreeBox) {searchArray.glutenFree = 1;}\n if (dairyFreeBox) {searchArray.dairyFree = 1;}\n if (nutAllergyBox) {searchArray.nutAllergy = 1;}\n if (kosherBox) {searchArray.kosher = 1;}\n }", "title": "" }, { "docid": "773e7bd487e3760ae877d0f5e6f1f848", "score": "0.51289505", "text": "function SearchparamsProvider() {\n this.searchInput = \"\"; //added a field to hold the input for the search page (seperated by commas) Brona\n //checklist options for allergies.html\n this.optionsAllergies = new Array();\n this.optionsDietary = new Array();\n this.optionsBlockedAllergies = new Array();\n this.optionsBlockedDietary = new Array();\n //user choices arrays\n this.searchAllergies = new Array();\n this.searchDietary = new Array();\n this.searchIngredients = new Array();\n this.searchIngredientsString = \"\";\n this.searchHealthString = \"\";\n this.optionsAllergies = [\n //\"celery-free\",\n //\"crustacean-free\",\n //\"dairy-free\",\n //\"egg-free\",\n //\"fish-free\",\n //\"gluten-free\",\n //\"lupine-free\",\n //\"mustard-free\",\n \"peanut-free\",\n //\"sesame-free\",\n //\"shellfish-free\",\n //\"soy-free\",\n \"tree-nut-free\",\n ];\n this.optionsBlockedAllergies = [\n \"celery-free\",\n \"crustacean-free\",\n \"dairy-free\",\n \"egg-free\",\n \"fish-free\",\n \"gluten-free\",\n \"lupine-free\",\n \"mustard-free\",\n \"sesame-free\",\n \"shellfish-free\",\n \"soy-free\",\n \"wheat-free\"\n ];\n this.optionsDietary = [\n //\"kosher\",\n //\"paleo\",\n //\"pescatarian\",\n \"vegan\",\n \"vegetarian\",\n \"sugar-conscious\",\n \"alcohol-free\"\n ];\n this.optionsBlockedDietary = [\n \"kosher\",\n \"paleo\",\n \"pescatarian\"\n ];\n }", "title": "" }, { "docid": "7207620678b9422401e1af9e979adcf5", "score": "0.51240367", "text": "function SearchResultsDisplayFilter(SearchResultsArray){\n // Results \n $('.searchResultsHolder').show(); \n\t\twithinZipRange = $('#within option:selected').text();\n\t\t//alert(withinZipRange);\n\t\t//hideSpinner();\n\t\tif (SearchResultsArray!=undefined && SearchResultsArray.length!=undefined && SearchResultsArray.length>0 ) {\n\t\t resultsLength = SearchResultsArray.length;\n\t\t //alert(resultsLength);\n\t\t if(SearchResultsArray.length > 0 && SearchResultsArray[0] != null && SearchResultsArray[0] != '' && SearchResultsArray[0] != [] ){\n\t\t // $('#totalResultsFound').text(SearchResultsArray.length);\n\t\t }\n\t\t $('.searchResultsHolder').empty();\n\t\t\n\t\t if(SearchResultsArray.length > 0 && SearchResultsArray[0] != null && SearchResultsArray[0] != '' && SearchResultsArray[0] != []){\n\t\t \n\t\t \n\t\t\t var res = '';\n\t\t\t $('.searchResultsHolder').empty();\t\t\t\n\t\t\t \n\t\t\t var m = '';\n\t\t\t m+= \"<ul></ul>\";\n\t\t\t var resCount = 1;\t\t \n\t\t\t \n\t\t\t $('.searchResultsHolder').append(m);\n\t\t\t \n\t\t\t for(i=0;i<SearchResultsArray.length;i++){\n\t\t\t\t \n\t\t\t m = '';\n\t\t\t resCount ++;\n\t\t\t if(resCount == 5){ \n\t\t\t m += \"<li><div class='gAd1'></div></li>\";\n\t\t\t resCount = 1;\t\t \n\t\t\t }\n\t\t\t \n\t\t\t var path = ''\n\t\t\t var withinZIp1 = $('#within option:selected').val();\n\t\t\t var zip1 = $('#yourZip').val();\n\t\t\t var resPath = '\"'+SearchResultsArray[i]['Carid']['#text']+'\",\"'+SearchResultsArray[i]['Make']['#text']+'\",\"'+SearchResultsArray[i]['Model']['#text']+'\",\"'+zip1+'\",\"'+withinZIp1+'\"';\n\t\t\t var thumb1='';\n\t\t\t if(SearchResultsArray[i]['PIC0']['#text'] != 'Emp'){\n\t\t\t path = SearchResultsArray[i]['PICLOC0']['#text']+\"/\"+SearchResultsArray[i]['PIC0']['#text'];\n\t\t\t for(k=0;k<3;k++){\n\t\t\t path = path.replace(\"\\\\\", \"/\");\n\t\t\t }\n\t\t\t path = path.replace(\"//\", \"/\");\n\t\t\t thumb1 = \"<img src='http://images.unitedcarexchange.com/\"+path+\"' />\";\n\t\t\t }else{\n\t\t\t //path = \"images/stockMakes/\"+SearchResults[i]['Make']['#text']+\".jpg\";\n\t\t\t \n\t\t\t var carMake = SearchResultsArray[i]['Make']['#text'];\t\t\t \n\t\t\t var carModel = SearchResultsArray[i]['Model']['#text'];\n\t\t\t carMake = carMake.replace(' ','-');\n\t\t\t carModel = carModel.replace(' ','-');\n\t\t\t if(carModel.indexOf('/')>0){\n\t\t\t carModel='Other';\n\t\t\t }\n\t\t\t var MakeModel = carMake+\"_\"+carModel;\n\t\t\t MakeModel = MakeModel.replace(' ','-');\n\t\t\t path = \"images/MakeModelThumbs/\"+MakeModel+\".jpg\";\n\t\t\t \n\t\t\t thumb1 = \"<img src='http://images.unitedcarexchange.com/\"+path+\"' /><div class='stockPhoto1' >Stock Photo</div>\";\n\t\t\t \n\t\t\t \n\t\t\t }\n\t\t\t \n\t\t\t m+= \"<li><a href='javascript:EncryptedCarID(\"+resPath+\");'>\"+thumb1+\" <h4>\"+SearchResultsArray[i]['YearOfMake']['#text']+\" \"+SearchResultsArray[i]['Make']['#text']+\" \"+SearchResultsArray[i]['Model']['#text']+\"</h4>\";\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t if(SearchResultsArray[i]['Price']['#text'] != 'Emp' && SearchResultsArray[i]['Price']['#text'] != '0' && SearchResultsArray[i]['Price']['#text'] != 'Unspecified'){\n\t\t\t m+= \"<strong>Price: </strong><label class='price'>\"+parseInt(SearchResultsArray[i]['Price']['#text'])+\"</label><br>\";\n\t\t\t }else{\n\t\t\t m+= \"<strong>Price: </strong><br>\"\n\t\t\t }\n\t\t\t \n\t\t\t if(SearchResultsArray[i]['Mileage']['#text'] != 'Emp' && SearchResultsArray[i]['Mileage']['#text'] != '0' && SearchResultsArray[i]['Mileage']['#text'] != 'Unspecified'){\n\t\t\t m+= \"<strong>Mileage: </strong><label class='mileage'>\"+parseInt(SearchResultsArray[i]['Mileage']['#text'])+\"</label> mi<br>\";\n\t\t\t }else{\n\t\t\t m+= \"<strong>Mileage: </strong><br>\"\n\t\t\t }\n\t\t\t \n\t\t\t if(SearchResultsArray[i]['ExteriorColor']['#text'] != 'Emp' && SearchResultsArray[i]['ExteriorColor']['#text'] != '0' && SearchResultsArray[i]['ExteriorColor']['#text'] != 'Unspecified' && SearchResultsArray[i]['ExteriorColor']['#text'] != '' && SearchResultsArray[i]['ExteriorColor']['#text'] != ' ' && SearchResultsArray[i]['ExteriorColor']['#text'] != null && SearchResultsArray[i]['ExteriorColor']['#text'] != 'undefined' ){\n\t\t\t m+= \"<strong>ExteriorColor: </strong>\"+SearchResultsArray[i]['ExteriorColor']['#text']+\"<br>\";\n\t\t\t }else{\n\t\t\t m+= \"<strong>ExteriorColor: </strong><br>\"\n\t\t\t }\n\t\t\t \n\t\t\t \tif(SearchResultsArray[i]['City']['#text'] != 'Emp'){\n var city = SearchResultsArray[i]['City']['#text'];\n city = $.trim(city);\n m+= city+\", \";\n }\n\n if(SearchResultsArray[i]['State']['#text'] != 'Emp'){\n m+= SearchResultsArray[i]['State']['#text']\n }\n \n if(SearchResultsArray[i]['Zip']['#text'] != 'Emp'){\n m+= \" \"+SearchResultsArray[i]['Zip']['#text']\n }\n \n \n\t\t\t \n\t\t\t if(SearchResultsArray[i]['Phone']['#text'] != 'Emp'){\n\t\t\t \n\t\t\t var phone= SearchResultsArray[i]['Phone']['#text'];\n\t\t\t \n m+= \"<br><label class='phone'>\"+phone[9]+\"\"+phone[8]+\"\"+phone[7]+\"-\"+phone[6]+\"\"+phone[5]+\"\"+phone[4]+\"-\"+phone[3]+\"\"+phone[2]+\"\"+phone[1]+\"\"+phone[0]+\"</label>\";\n }\t\t\t \n\t\t\t \n\t\t\t m+= \"</a><div class='clear' style='height:1px;'>&nbsp;</div></li>\"\t\n\t\t\t \n\t\t\t $('.searchResultsHolder ul').append(m);\n\t\t\t}\n\t\t\t\n\t\t\t $('.price').formatCurrency();\n\t\t\t $('.mileage').formatCurrency({symbol: ' '});\n\t\t\t $('#PaginationBlock, #botNav1').show();\n\t\t\t onTime();\n\t\t\t //$('#totalResultsFound').text(SearchResultsArray.length+' Used Cars');\n\t\t }else{\n\t\t $('#totalResultsFound').text('0');\t\t \n\t\t $('.searchResultsHolder').empty();\n\t\t $('.searchResultsHolder').append(\"<h4 style='color:#FF9900; text-align:center; line-height:100px;'>No records found..!</h4>\");\n\t\t $('#PaginationBlock, #botNav1').hide();\n\t\t \n\t\t //alert('No records found..!');\t\t \n\t\t }\n\t\t}else{\t\t\n\t\t $('#totalResultsFound').text('0');\n\t\t $('#PaginationBlock, #botNav1').hide();\n\t\t $('.searchResultsHolder').empty();\n\t\t $('.searchResultsHolder').append(\"<h4 style='color:#FF9900; text-align:center; line-height:100px;'>No records found..!</h4>\");\n\t\t \n\t\t //alert('No records found..!');\t\t\t\n\t\t}\n hideSpinner();\n \n //onTime();\n \n /* $('#botAd iframe, #botAd table, #botAd img, #botAd td').width('642')\n $('#botAd iframe, #botAd table, #botAd img').width('642'); \n $('#botAd td').width('209'); \n $('#botAd img').height('90');\n */ \n }", "title": "" }, { "docid": "800a71cfd0374c03aa3b7d7ba90c3b1f", "score": "0.51195693", "text": "function search() {\t\t\t\t\n\t\t\tconsole.log(vm.apiDomain);\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n if (vm.dataSetRef.dataSets[0].refsKey.length > 0) {\n console.log(\"getByRef: \" + vm.dataSetRef.dataSets[0].refsKey);\n\t\t\t StrainGetByRefAPI.query({key: vm.dataSetRef.dataSets[0].refsKey}, function(data) {\n\t\t\t\t vm.results = data;\n\t\t\t\t vm.selectedIndex = 0;\n\t\t\t\t if (vm.results.length > 0) {\n vm.searchByJDataSet = true;\n\t\t\t\t\t loadObject();\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t clear();\n\t\t\t\t }\n\t\t pageScope.loadingEnd();\n\t\t\t setFocus();\n\t\t\t }, function(err) {\n\t\t\t\t pageScope.handleError(vm, \"API ERROR: StrainSearchAPI.search\");\n\t\t pageScope.loadingEnd();\n\t\t\t setFocus();\n\t\t\t });\n }\n else {\n\t\t\t StrainSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\t vm.results = data;\n\t\t\t\t vm.selectedIndex = 0;\n\t\t\t\t if (vm.results.length > 0) {\n\t\t\t\t\t loadObject();\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t clear();\n\t\t\t\t }\n\t\t pageScope.loadingEnd();\n\t\t\t setFocus();\n\t\t\t }, function(err) {\n\t\t\t\t pageScope.handleError(vm, \"API ERROR: StrainSearchAPI.search\");\n\t\t pageScope.loadingEnd();\n\t\t\t setFocus();\n\t\t\t });\n }\n\t\t}", "title": "" }, { "docid": "560ad29146444f5eecaa57331b93fceb", "score": "0.5113541", "text": "function ccpsPMSearchSetup(_ctrlPMSearch, _btnPMSearch, _btnPMRemove, _PMSearchMode, _PMSelectMode, _PMCtrlDataset)\r\n\r\n{\r\n\r\n ctrlPMResults = _ctrlPMSearch;\r\n\r\n btnPMSearch = _btnPMSearch;\r\n\r\n btnPMRemove = _btnPMRemove;\r\n\r\n formMultiSelectMode = _PMSelectMode;\r\n\r\n ctrlPMResultsDataset = _PMCtrlDataset;\r\n\r\n \r\n\r\n var host = theForm.getHostName();\r\n\r\n \r\n\r\n if (host != null)\r\n\r\n {\r\n\r\n var hostParts = host.split(\" \");\r\n\r\n \r\n\r\n if (hostParts[0] != \"win32\")\r\n\r\n {\r\n\r\n alert(\"The person search control can only run on Windows.\");\r\n\r\n return;\r\n\r\n }\r\n\r\n }\r\n\r\n \r\n\r\n // Set the event handlers\r\n\r\n ctrlPMResults.onValidate = validateResultList;\r\n\r\n ctrlPMResults.onChange = validateResultList;\r\n\r\n btnPMSearch.onClick = onPMSearchClick;\r\n\r\n btnPMRemove.onClick = onPMRemoveClick;\r\n\r\n \r\n\r\n \r\n\r\n // Setup the PM Search object\r\n\r\n pmSearch = new ActiveXObject(pmSearchConst.SearchDlg);\r\n\r\n pmSearch.Initialize(theForm.appHandle);\r\n\r\n \r\n\r\n pmSearch.Mode = _PMSearchMode;\r\n\r\n pmSearch.AddPersonButton = false;\r\n\r\n pmSearch.AddEncounterButton = false;\r\n\r\n \r\n\r\n \r\n\r\n if (pmSearch.Mode == pmSearch.pmPersonMode)\r\n\r\n {\r\n\r\n // Define list dataset if not passed in\r\n\r\n // Format is: <column header>, <internal name>, <visible>, <width>\r\n\r\n if (ctrlPMResultsDataset == null)\r\n\r\n ctrlPMResultsDataset = [[\"Person ID\", \"PERSON_ID\", false, 20],\r\n\r\n [\"MRN\", \"MRN\", true, 20],\r\n\r\n [\"Patient Name\", \"NAME_FULL_FORMATTED\", true, 100]];\r\n\r\n \r\n\r\n \r\n\r\n pmSearch.ReturnPersonInfo = pmSearch.pmReturnAllPerson;\r\n\r\n \r\n\r\n }\r\n\r\n else // pmSearch.pmEncounterMode\r\n\r\n {\r\n\r\n // Define list dataset if not passed in\r\n\r\n // Format is: <column header>, <internal name>, <visible>, <width>\r\n\r\n if (ctrlPMResultsDataset == null)\r\n\r\n ctrlPMResultsDataset = [[\"Encounter ID\", \"ENCNTR_ID\", false, 20],\r\n\r\n [\"FIN\", \"FIN\", true, 20],\r\n\r\n [\"Patient Name\", \"NAME_FULL_FORMATTED\", true, 100]];\r\n\r\n \r\n\r\n \r\n\r\n pmSearch.ReturnEncounterInfo = pmSearch.pmReturnAllEncounter;\r\n\r\n \r\n\r\n // Only allow 1 encounter for now, need to look into supporting multiple\r\n\r\n // pmSearch.EncounterMultiSelect = true;\r\n\r\n // pmSearch.AllEncountersButton = true;\r\n\r\n \r\n\r\n }\r\n\r\n \r\n\r\n \r\n\r\n // Build the dataset and update the control\r\n\r\n createDataset(ctrlPMResults, ctrlPMResultsDataset);\r\n\r\n ctrlPMResults.updateDisplay();\r\n\r\n validateResultList(btnPMRemove);\r\n\r\n}", "title": "" }, { "docid": "382fb92caabf2c199928ceffa946d34d", "score": "0.51119125", "text": "function makeSearch(search,students) {\n noResultDiv.innerHTML = ''; \n const filter = search.value.toLowerCase();\n const arr = []; \n if (!search.value){ \n return pageRestart(ulListChildren);\n }\n for (let i = 0; i < students.length; i++) {\n const listItemName = students[i].querySelector('h3').textContent;\n students[i].style.display = 'none';\n if (listItemName.toLowerCase().includes(filter)) {\n students[i].style.display = '';\n arr.push(students[i]);\n } \n }\n if(arr.length === 0){\n noResultDiv.innerHTML = 'Your search is not existing. Please try again !'\n mainDiv.appendChild(noResultDiv);\n };\n pageRestart(arr);\n}", "title": "" }, { "docid": "6c45e8575aee5d9c0cfc6dcdb1ec9a2c", "score": "0.51028275", "text": "function searchButtonClicked(event) {\n event.preventDefault();\n clickedSearchButton = true;\n commonToSearch();\n\n // gather inputs\n var searchGuy = $(\"#searchid\").val().trim();\n var searchControl = $(\"#searchid\");\n searchControl.removeClass(\"errorSign\");\n var errordiv = $(\"#errorDiv\");\n errordiv.text(\"\");\n\n var genreGuy = $(\"#genreid :selected\").attr(\"data-id\");\n var platformGuy = $(\"#platformid :selected\").attr(\"data-id\");\n\n selectedsearch = false;\n selectedplatform = false;\n selectedgenre = false;\n\n if (searchGuy !== \"\") {\n selectedsearch = true;\n }\n if (genreGuy !== undefined) {\n selectedgenre = true;\n }\n if (platformGuy !== undefined) {\n selectedplatform = true;\n }\n\n if (!selectedsearch && !selectedgenre && !selectedplatform) {\n searchControl.addClass(\"errorSign\");\n\n errordiv.text(\"Enter at least one search parameter\");\n\n return;\n }\n\n getListOfGames(searchGuy, genreGuy, platformGuy, selectedsearch, selectedgenre, selectedplatform);\n }", "title": "" }, { "docid": "f79de36e7d59065fc3d10957135c4e02", "score": "0.5102038", "text": "'radios' (val, oldVal) {\n this.searchByCategory(val)\n }", "title": "" }, { "docid": "a80d03e899f6075524d5f09b67965791", "score": "0.50990367", "text": "onSearchButtonPressed(oEvent){\n // Get the Data from the Inputs\n var isbn = this.byId(\"inputISBN\").getValue();\n var title = this.byId(\"inputTitle\").getValue();\n var author = this.byId(\"inputAuthor\").getValue();\n var language = this.byId(\"inputLanguage\").getValue();\n var dateStart = this.byId(\"inputDateStart\").getValue();\n var dateEnd = this.byId(\"inputDateEnd\").getValue();\n\n var aFilter = [];\n var oList = this.getView().byId(\"idBooksTable\");\n var oBinding = oList.getBinding(\"items\");\n\n // Push set filters\n if (isbn) {\n aFilter.push(new Filter(\"Isbn\", FilterOperator.EQ, isbn))\n }\n if (author) {\n aFilter.push(new Filter(\"Author\", FilterOperator.EQ, author));\n }\n if (title) {\n aFilter.push(new Filter(\"Title\", FilterOperator.EQ, title));\n }\n if (dateStart && dateEnd) {\n var filter = new Filter(\"PublishDate\", FilterOperator.BT, dateStart, dateEnd);\n aFilter.push(filter);\n }\n if (language) {\n aFilter.push(new Filter(\"Language\", FilterOperator.EQ, language));\n }\n oBinding.filter(aFilter);\n }", "title": "" }, { "docid": "1e07e9f0bdfbc68a02cb65e9caa48449", "score": "0.50954324", "text": "function searchInput(search){\n noresult.getElementsByTagName(\"h4\").item(0).style.display=\"none\";\n searchData=search.value.toLowerCase().split(\" \")\n var finalBool=false;\n for(var i=3;i<couriers.childNodes.length;i+=4){\n courier=\"\";\n for(var j=1;j<couriers.childNodes[i].childNodes.length;j+=2){\n if(couriers.childNodes[i].childNodes[j].childNodes[0])\n courier+=couriers.childNodes[i].childNodes[j].childNodes[0].textContent.toLowerCase()+\" \";\n }\n var found=true;\n for(var k=0;k<searchData.length;k++){\n if(!courier.includes(searchData[k])){\n found=false;break;\n }\n }\n if(found){\n couriers.childNodes[i-2].style.display=\"\";\n finalBool=true;\n }\n else{\n couriers.childNodes[i-2].style.display=\"none\";\n }\n }\n if(!finalBool){\n noresult.getElementsByTagName(\"h4\").item(0).style.display=\"\";\n }\n}", "title": "" }, { "docid": "49da36026cf8179f8379c4d35db884ba", "score": "0.508743", "text": "function BMLTQuickSearch ( inID, inAjaxURI, inOptionsID, inValueFieldName, inValueFilter, am_pm_array, map_link_format, weekday_long_name_array, week_start, military_time )\n{\n this.m_am_pm_array = am_pm_array;\n this.m_map_link_format = map_link_format;\n this.m_weekday_long_name_array = weekday_long_name_array;\n this.m_week_start = week_start;\n this.m_military_time = military_time;\n this.m_differentiatorID = inID.toString();\n this.m_ajaxURI = inAjaxURI.toString();\n this.m_optionsID = inOptionsID.toString();\n this.m_main_container = document.getElementById ( 'quicksearch_div_' + inID );\n this.m_main_form_container = document.getElementById ( 'quicksearch_form_container_' + inID );\n this.m_too_large_div = document.getElementById ( 'quicksearch_too_large_div_' + inID );\n this.m_town_select = document.getElementById ( 'quicksearch_form_town_select_' + inID );\n this.m_town_select.handler = this;\n this.m_town_select.onchange = BMLTQuickSearch.prototype.reactToTownPopup;\n this.m_weekdays_container = document.getElementById ( 'quicksearch_form_weekdays_container_' + inID );\n this.m_select_container = document.getElementById ( 'quicksearch_form_select_container_' + inID );\n this.m_throbber_container = document.getElementById ( 'quicksearch_throbber_div_' + inID );\n this.m_search_text_field = document.getElementById ( 'quicksearch_form_search_text_' + inID );\n this.m_submit_button = document.getElementById ( 'quicksearch_form_submit_button_' + inID );\n this.m_submit_button.handler = this;\n this.m_submit_button.onclick = BMLTQuickSearch.prototype.reactToSearchButton;\n this.m_no_results_div = document.getElementById ( 'quicksearch_no_results_div_' + inID );\n this.m_search_results_div = document.getElementById ( 'quicksearch_search_results_div_' + inID );\n this.m_search_results_container_div = document.getElementById ( 'quicksearch_results_container_' + inID );\n this.m_print_header_div = document.getElementById ( 'quicksearch_print_header_' + inID );\n this.m_value_filter = inValueFilter;\n this.m_value_field_name = inValueFieldName;\n var id = this.m_differentiatorID;\n this.m_main_container.onkeypress = function () { BMLTQuickSearch.prototype.reactToKeyDown ( id ); };\n this.m_search_text_field.onfocus = function () { BMLTQuickSearch.prototype.reactToKeyDown ( id ); };\n this.m_search_text_field.onblur = function () { BMLTQuickSearch.prototype.reactToKeyDown ( id ); };\n this.m_weekday_objects = new Array();\n \n for ( var index = 0; index < 8; index++ )\n {\n var checkboxID = 'quicksearch_form_weekday_checkbox_' + inID.toString() + '_' + index.toString();\n var weekdayCheckboxObject = document.getElementById ( checkboxID );\n weekdayCheckboxObject.handler = this;\n weekdayCheckboxObject.onchange = BMLTQuickSearch.prototype.reactToWeekdayCheckboxChange;\n this.m_weekday_objects.push ( weekdayCheckboxObject );\n };\n\n this.m_main_container.style.display=\"block\";\n var baseURI = this.m_ajaxURI + \"?bmlt_settings_id=\" + this.m_optionsID + \"&redirect_ajax_json=\";\n var weekdayURI = baseURI + encodeURI ( 'switcher=GetFieldValues&meeting_key=weekday_tinyint' );\n var ajax_request1 = BMLTPlugin_AjaxRequest ( weekdayURI, BMLTQuickSearch.prototype.ajaxCallbackWeekdays, 'get', this.m_differentiatorID );\n\n if ( !inValueFieldName )\n {\n var townURI = baseURI + encodeURI ( 'switcher=GetFieldValues&meeting_key=location_municipality' );\n var boroughURI = baseURI + encodeURI ( 'switcher=GetFieldValues&meeting_key=location_city_subsection' );\n var ajax_request2 = BMLTPlugin_AjaxRequest ( townURI, BMLTQuickSearch.prototype.ajaxCallbackTowns, 'get', this.m_differentiatorID );\n var ajax_request3 = BMLTPlugin_AjaxRequest ( boroughURI, BMLTQuickSearch.prototype.ajaxCallbackBoroughs, 'get', this.m_differentiatorID );\n }\n else\n {\n var uri = baseURI + encodeURI ( 'switcher=GetFieldValues&meeting_key=' + inValueFieldName );\n var ajax_request4 = BMLTPlugin_AjaxRequest ( uri, BMLTQuickSearch.prototype.ajaxCallbackField, 'get', this.m_differentiatorID );\n };\n}", "title": "" }, { "docid": "6d6b8c5c7934e216b71a79d2892cbdde", "score": "0.5087327", "text": "function drawSearchFields(){\n\tvar someoneChecked = false;\n\tvar searchFields = criteriaParam.searchFields;\n\tvar searchFieldArr = searchFields.split(\",\");\n\tif(\"undefined\" != typeof operation_searchMyPlan && operation_searchMyPlan == 'searchMyPlan'){\n\t\tif(roleClickFlag == master_contant){\n\t\t\tisNoSelectedflag = masterSearchCache.isNoSelectedflag;\n\t\t}\n\t\tif(roleClickFlag == trainer_contant){\n\t\t\tisNoSelectedflag = trainerSearchCache.isNoSelectedflag;\n\t\t}\n\t\tif(roleClickFlag == trainee_contant){\n\t\t\tisNoSelectedflag = traineeSearchCache.isNoSelectedflag;\n\t\t}\n\t}\n\tif(isNoSelectedflag != 1){\n\t\tvar searchFieldDoms = $(\".first_single_condition #searchFields p\");\n\t\tvar allFlag = true;\n\t\tsearchFieldDoms.each(function(){\n\t\t\tvar searchFieldValue = $(this).children(\"input\")[0].value;\n\t\t\tif (searchFieldValue != \"all\") {\n\t\t\t\t\n\t\t\t\tvar flag = isInArray(searchFieldValue, searchFieldArr);\n\t\t\t\tif (flag) {\n\t\t\t\t\t$(this).children(\"input\").each(function(){\n\t\t\t\t\t\t$(this).attr(\"checked\", \"checked\");\n\t\t\t\t\t});\n\t\t\t\t\t$(this).children(\"span\").each(function(){\n\t\t\t\t\t\t$(this).addClass(\"span_checked\");\n\t\t\t\t\t\tsomeoneChecked = true;\n\t\t\t\t\t});\n\t\t\t\t}else {\n\t\t\t\t\tallFlag = false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tif (allFlag) {\n\t\t\tsearchFieldDoms.each(function(){\n\t\t\t\tvar searchFieldValue = $(this).children(\"input\")[0].value;\n\t\t\t\tif (searchFieldValue == \"all\") {\n\t\t\t\t\t$(this).children(\"input\").each(function(){\n\t\t\t\t\t\t$(this).attr(\"checked\", \"checked\");\n\t\t\t\t\t});\n\t\t\t\t\t$(this).children(\"span\").each(function(){\n\t\t\t\t\t\t$(this).addClass(\"span_checked\");\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn someoneChecked;\n}", "title": "" }, { "docid": "e8a29887ddb60be281a99eaa131db71b", "score": "0.5081427", "text": "function SearchClass() {\n\tvar me = this;\n\tvar _node = document.getElementById(\"fldSearch\");\n\t\n\t_node.focus();\n\t//_node.onkeydown = me.CheckKey;\n\t\n\tthis.Execute = function() {\n\t\tvar text = _node.value.replace(/\\s+$/,\"\");\n\t\tif (text != \"\") {\n\t\t\tlocation.href = \"search.aspx?text=\" + escape(text);\n\t\t}\t\t\n\t}\n\tthis.CheckKey = function(e) {\n\t\tif ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {\n\t\t\te.returnValue = false; e.cancel = true; me.Execute();\n\t\t}\n\t}\n\tthis.Focus = function() { _node.focus(); }\n}", "title": "" }, { "docid": "368d191a060a8df3e9ab55296e16fced", "score": "0.5079254", "text": "function _fnBuildSearchRow( oSettings, aData )\r\n\t\t{\r\n\t\t\tvar sSearch = '';\r\n\t\t\tif ( typeof oSettings.__nTmpFilter == 'undefined' ) {\r\n\t\t\t\toSettings.__nTmpFilter = document.createElement('div');\r\n\t\t\t}\r\n\t\t\tvar nTmp = oSettings.__nTmpFilter;\r\n\t\t\t\r\n\t\t\tfor ( var j=0, jLen=oSettings.aoColumns.length ; j<jLen ; j++ )\r\n\t\t\t{\r\n\t\t\t\tif ( oSettings.aoColumns[j].bSearchable )\r\n\t\t\t\t{\r\n\t\t\t\t\tvar sData = aData[j];\r\n\t\t\t\t\tsSearch += _fnDataToSearch( sData, oSettings.aoColumns[j].sType )+' ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* If it looks like there is an HTML entity in the string, attempt to decode it */\r\n\t\t\tif ( sSearch.indexOf('&') !== -1 )\r\n\t\t\t{\r\n\t\t\t\tnTmp.innerHTML = sSearch;\r\n\t\t\t\tsSearch = nTmp.textContent ? nTmp.textContent : nTmp.innerText;\r\n\t\t\t\t\r\n\t\t\t\t/* IE and Opera appear to put an newline where there is a <br> tag - remove it */\r\n\t\t\t\tsSearch = sSearch.replace(/\\n/g,\" \").replace(/\\r/g,\"\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn sSearch;\r\n\t\t}", "title": "" }, { "docid": "fec6cf43a76a09b7e8c0f5b17347d578", "score": "0.5079122", "text": "function searchSub() {\n var searchTerm = document.getElementById(\"searchBar\").value\n var tempTerm = \"\"\n var searchResult = \"\"\n\n //Sorts subjects alphabetically prior to binary search\n subjectsCode = sortsubjects()\n\n //Convert search term to its relative subject code for use in binary search\n tempTerm = simpTerm(searchTerm)\n\n //Validates search term\n if (tempTerm == \"invalid\") {\n searchResult = \"null\";\n } else {\n //Executes binary Search Function\n searchResult = binarySearch(subjectsCode, tempTerm)\n }\n\n //Displays search results\n if (searchResult == \"null\") {\n alert(\"No Results\")\n showDivs()\n } else {\n hideDivs()\n\n document.getElementById(subjectsCode[searchResult].name).style.display = \"Block\"\n }\n\n\n}", "title": "" }, { "docid": "672dbcf87c4a438211ddfa79449e7a13", "score": "0.5076138", "text": "function search(){\n\n\t//save courses\n\tprofile.courseCodes = [document.getElementById(\"courseCode1\").value,\n\t\t\t\t\tdocument.getElementById(\"courseCode2\").value,\n\t\t\t\t\tdocument.getElementById(\"courseCode3\").value,\n\t\t\t\t\tdocument.getElementById(\"courseCode4\").value,\n\t\t\t\t\tdocument.getElementById(\"courseCode5\").value,\n\t\t\t\t\tdocument.getElementById(\"courseCode6\").value];\n\n\t//save marks\n\tprofile.courseMarks = [document.getElementById(\"courseMark1\").value,\n\t\t\t\t\tdocument.getElementById(\"courseMark2\").value,\n\t\t\t\t\tdocument.getElementById(\"courseMark3\").value,\n\t\t\t\t\tdocument.getElementById(\"courseMark4\").value,\n\t\t\t\t\tdocument.getElementById(\"courseMark5\").value,\n\t\t\t\t\tdocument.getElementById(\"courseMark6\").value];\n\n\t//save field of interest\n\tprofile.fieldOfInterest = document.getElementById(\"fieldOfInterest\").value;\n\n\t//save average\n\tvar sum = 0;\n\tfor(var i = 0; i < profile.courseMarks.length; i++){\n\t\tsum += parseInt(profile.courseMarks[i]);\n\t}\n\tprofile.average = Math.round(sum*10/6)/10;\n\n\t//save the profile and go to the results\n\tsaveProfiles();\n viewResults();\n}", "title": "" }, { "docid": "e69feae4940ee86f7ca9c9a8b4e4fad6", "score": "0.507418", "text": "function photoSearch() {\n let userInput = input.value.toLowerCase();\n for (let i = 0; i < imageInfo.length; i++) {\n let caption = imageInfo[i].parentElement.getAttribute('data-caption').toLowerCase();\n if (caption.includes(userInput)) {\n imageInfo[i].parentElement.style.display = 'block';\n } else {\n imageInfo[i].parentElement.style.display = 'none';\n }\n}}", "title": "" }, { "docid": "94a1080dee2a71c42dc0a22279eb13e4", "score": "0.5072286", "text": "function search() {\n if (searchParam == 'concert-this') {\n concertThis();\n }\n\n else if (searchParam == 'spotify-this-song') {\n spotifyThis();\n }\n\n else if (searchParam == 'movie-this') {\n movieThis();\n }\n\n else if (searchParam == 'do-what-it-says') {\n doWhatItSays();\n }\n}", "title": "" }, { "docid": "62a6e336b42d6959e67a0e0a9fb84e04", "score": "0.5069565", "text": "function searchcomponent(props) {\n\n\n\n const StyledHeading = styled.h1 `\n font-size: 30px;\n text-align: center;\n margin: 20px 0;\n `\n\n let pathname = typeof window !== \"undefined\" ? window.location.search : \"\"\n const getSearch = new URLSearchParams(pathname);\n const searchVal = getSearch.get('Search-term');\n\n\n const appId = \"LRDB3IFCF0\";\n const searchKey = \"0969668003a9459920213920ffc4b6ad\"\n const searchClient = algoliasearch(appId, searchKey);\n const facets = '[[\"' + props.facets + '\"]]';\n const Searchmod = () => (\n <div className=\"component-searchArea\">\n {props.title ?\n <StyledHeading>{props.title}</StyledHeading>\n :\n ''\n}\n\n\n\n \n\n <InstantSearch\n searchClient={searchClient}\n indexName=\"JR_PRD_variant_index_copy\"\n\n >\n\n <Configure\n hitsPerPage={props.numberOfProducts} \n \n \n facetFilters={facets}\n //filters={props.facets}\n />\n {props.showSearch ?\n <SearchBox defaultRefinement={searchVal}/>\n :\n ''\n }\n \n\n {props.carousel ?\n <CustomHits />\n : \n <Hits hitComponent={HitList} />\n }\n\n {props.showPagination ?\n <Pagination />\n :\n ''\n }\n\n </InstantSearch>\n </div>\n );\n return (\n <Searchmod />\n );\n}", "title": "" }, { "docid": "88d2eadaeedfbdb77ad452b1533127ee", "score": "0.506794", "text": "function createSearch(){\n\t\t\t\tvar search$=$(\"<div class='search'/>\"),\n\t\t\t\t\tresult$ = $(\"<div class='display-results'/>\");\n\t\t\t\tcontainer$.empty();\n\t\t\t\tcontainer$.append(search$);\n\t\t\t\tcontainer$.append(result$);\n\t\t\t\tresult$.append(getLoadingDiv());\n\n\t\t\t\t// no search to be rendered: fetch documents immediately\n\t\t\t\tif (!customData.showSearch){\n\t\t\t\t\tsubmitSearch();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\n\t\t\t\t// We do have a search to be rendered.\n\n\t\t\t\t// Load the labels and values for our search form\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: getBaseUrl() + \"?type=getCategories&lang=\" + getLocale() + (DEBUG? \"&debug=true\":\"\")\n\t\t\t\t}).done(function(json){\n\t\t\t\t\tconsole.log(\"Server return\", json);\n\n\t\t\t\t\trenderSearch(json);\n\t\t\t\t}).fail(function(){\n\t\t\t\t\tXCC.T.notifyError(\"Could not load search criteria.\");\n\t\t\t\t\tsubmitSearch();\n\t\t\t\t});\n\n\t\t\t}", "title": "" }, { "docid": "a4fe172c3a4563e14b0fa6e11544de6c", "score": "0.50589263", "text": "function SearchCriterion() {\n\n}", "title": "" }, { "docid": "727c4de5fb3d9ffbb92c2243000cd069", "score": "0.5056027", "text": "function onPMSearchClick(sender)\r\n\r\n{\r\n\r\n // Run the PMSearch & open the search dialog to the user\r\n\r\n pmSearch.Search();\r\n\r\n \r\n\r\n if (pmSearch.CancelClicked == false)\r\n\r\n {\r\n\r\n // Get the selected person/encounter\r\n\r\n var selectedValue;\r\n\r\n var status = 0;\r\n\r\n \r\n\r\n // If we are in single-select mode, replace the existing result if one exists\r\n\r\n if (formMultiSelectMode == pmSearchConst.pmSingleSelect && ctrlPMResults.recordCount > 0)\r\n\r\n ctrlPMResults.clear();\r\n\r\n \r\n\r\n \r\n\r\n // Add to the person list box\r\n\r\n var recNum = ctrlPMResults.getNextRecord();\r\n\r\n if (recNum >= 0)\r\n\r\n {\r\n\r\n for (var x in ctrlPMResultsDataset)\r\n\r\n {\r\n\r\n // Figure out which PMSearch API to call to get the data based on the attribute name in the dataset\r\n\r\n if (isInArray(arrGetPersonInfo, ctrlPMResultsDataset[x][1]))\r\n\r\n selectedValue = pmSearch.GetPersonInfo(status, ctrlPMResultsDataset[x][1], pmSearch.pmDisplay);\r\n\r\n \r\n\r\n else if (isInArray(arrGetPersonAlias, ctrlPMResultsDataset[x][1]))\r\n\r\n selectedValue = pmSearch.GetPersonAlias(status, ctrlPMResultsDataset[x][1], pmSearch.pmAlias);\r\n\r\n \r\n\r\n else if (isInArray(arrGetEncounterInfo, ctrlPMResultsDataset[x][1]))\r\n\r\n selectedValue = pmSearch.GetEncounterInfo(status, ctrlPMResultsDataset[x][1], pmSearch.pmDisplay);\r\n\r\n \r\n\r\n else if (isInArray(arrGetEncounterAlias, ctrlPMResultsDataset[x][1]))\r\n\r\n selectedValue = pmSearch.GetEncounterAlias(status, ctrlPMResultsDataset[x][1], pmSearch.pmAlias);\r\n\r\n \r\n\r\n \r\n\r\n // Trick CCL into handling as F8 for ID values\r\n\r\n if (ctrlPMResultsDataset[x][1].search(/_ID/) >= 0)\r\n\r\n selectedValue = selectedValue + \".00\";\r\n\r\n \r\n\r\n ctrlPMResults.setField(recNum, x, selectedValue); \r\n\r\n }\r\n\r\n \r\n\r\n ctrlPMResults.updateDisplay();\r\n\r\n }\r\n\r\n }\r\n\r\n \r\n\r\n ctrlPMResults.fireChangeEvent();\r\n\r\n validateResultList(sender);\r\n\r\n}", "title": "" }, { "docid": "f7e687dea3616e3aa14fb4cb0adfbd1a", "score": "0.5055972", "text": "function getSearchData(search_text) {\n $.headerSearchTxt.visible = true;\n $.headerSearchTxt.blur();\n $.searchContainer.setVisible(false);\n showLoader($.searchListing);\n var url = \"\";\n listData = [];\n backupData = [];\n var data = {};\n $.mainSection.setItems(listData);\n //if (!isNullVal(sortBy) || _.size(filters) > 0 || !isNullVal(selectedStyle)) {\n page_no = 1;\n limit = 10;\n //}\n filtersData = {};\n\n _.each(filters, function(value, key) {\n if (value.length > 0) {\n filtersData[key] = value.join(\",\");\n }\n });\n\n url = Alloy.Globals.commonUrl.search;\n data = {\n \"q\" : search_text, //$.SearchTxt.getValue()\n \"sortby\" : sortBy || \"\",\n \"pagination\" : {}\n };\n\n data.pagination = {\n \"page_no\" : page_no,\n \"page_size\" : limit\n };\n if (_.size(filtersData) > 0) {\n data['filters'] = filtersData;\n } else {\n data['filters'] = \"\";\n }\n\n var requestParams = JSON.stringify(data);\n\n Alloy.Globals.webServiceCall(url, requestParams, subCollectionSuccessCallback, subCollectionErrorCallback, \"POST\", $.searchListing);\n\n}", "title": "" }, { "docid": "17d9a319a59ccade4cc053dd7da380e8", "score": "0.50557005", "text": "function search(){\n\t\n\t// -- read param values\n\tvar diagnosis = $('#diagnosis').val();\n\tif($.isEmptyObject(diagnosis)){\n\t\talert('Please select a value for Admission diagnosis');\n\t\treturn;\n\t}\n\tvar data = {'age_group': age_group,\n\t\t\t\t'sex': sex,\n\t\t\t\t'diagnosis': diagnosis};\n\t\n\t$.ajax({url: 'search', \n\t\t\tdata: data, \n\t\t\ttype: 'GET',\n\t\t\tbeforeSend:function(){\n\t\t\t\t$('#searchResults').empty();\n\t\t\t\t$('#searchResults').append('Processing ...');\n\t\t\t},\n\t\t\tsuccess:function(result){\n\t\t\t\trenderSearchResults(result);\n\t\t\t}});\n}", "title": "" }, { "docid": "46389b11f8afd2eac0182eed7503668d", "score": "0.5054364", "text": "function GetSearchData() {\n var setName = $(searchElementNames.SetId).val();\n var searchText = $(searchElementNames.SearchInputId).val().trim();\n var sortBy = $(searchElementNames.SortCardsById).val();\n var sortOrder = $(searchElementNames.SortCardsOrderId).val();\n var cardView = $(searchElementNames.CardViewId).val();\n\n const searchData = {\n SetName: setName,\n SearchText: searchText,\n SortBy: sortBy,\n SortOrder: sortOrder,\n CardView: cardView,\n };\n\n return searchData;\n}", "title": "" }, { "docid": "95f893b3b886e60afe79858cb52d2372", "score": "0.5053102", "text": "function searchStudent(){\n\n}", "title": "" }, { "docid": "278bcbf4528c9eabb2ca628bd9f22614", "score": "0.50438035", "text": "function handleSearchFor()\n{\n var type = document.getElementById(\"LookFor\").value;\n search_for = type;\n if (type == \"METHOD\") {\n var div = document.getElementById(\"MethodDiv\");\n div.style.display = 'block';\n div = document.getElementById(\"ClassDiv\");\n div.style.display = 'none';\n }\n else if (type == 'CLASS') {\n var div = document.getElementById(\"MethodDiv\");\n div.style.display = 'none';\n div = document.getElementById(\"ClassDiv\");\n div.style.display = 'block';\n }\n else {\n document.getElementById(\"LookFor\").selectedIndex = 0;\n }\n}", "title": "" }, { "docid": "9bb25e8d052ede1618d5327b73223c60", "score": "0.50414526", "text": "function searchUniversity() {\n\tuserIsTyping = true;\n\t$(\"#lihatDaftarDosen\").prop('checked', false);\n\t$(\"#ketikNamaDosen\").prop('checked', false);\n\ttheDosenSearch.style.opacity = \".5\";\n\t$(\"#dosenSearch\").prop('readonly', true);\n\ttheDosenSearch.value = \"\";\n\tuniResult.innerHTML = \"\";\n\tsearchResult = [];\n\tif (theUniversitasSearch.value != \"\" && theUniversitasSearch.value.length != 1){\n\t\t\tfor (i = 0; i < allData.length; i++){\n\t\t\t\t\tfor (j = 0; j < allData[i].universitas.length; j++){\n\t\t\t\t\t\t\ttemp = allData[i].universitas[j].toLowerCase().indexOf(theUniversitasSearch.value.toLowerCase());\n\t\t\t\t\t\t\tif (temp != -1 && (temp == 0 || allData[i].universitas[j][temp-1] == \" \") && !searchResult.includes(allData[i].universitas[0]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tsearchResult.push(allData[i].universitas[0]);\n\t\t\t\t\t\t\t\t\t\tindex = i;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t}\n\tfor(var i = 0; i < searchResult.length; i++) {\n\t\tlet attributeItem = document.createAttribute(\"onclick\");\n\t\tattributeItem.value = \"getTheUniversity(\" + i.toString() + \");\";\n\t let item = document.createElement('li');\n\t let link = document.createElement('a');\n\t item.appendChild(document.createTextNode(searchResult[i]));\n\t\titem.setAttributeNode(attributeItem);\n\t link.appendChild(item);\n\t uniResult.appendChild(link);\n\t}\n}", "title": "" }, { "docid": "55e3d0504a9e38e715bdabce01a3cce2", "score": "0.504114", "text": "function newSearch(){\n\t\tphotoSearch(1, paginatingSearchCallback);\n\t}", "title": "" }, { "docid": "b0c7dee13d274a66b260ed88e993236b", "score": "0.5038587", "text": "function checkBoxSearchClick() {\n\tvar isClickAll = 0;\n\tvar isClickShool = 0;\n\tvar isClickName = 0;\n\tvar isClickExtra = 0;\n\tvar isClickMajor = 0;\n\tvar isClickTutor = 0;\n\t\n\t$('#checkAll').click(function() {\n\t\tif(isClickAll === 0 ) {\n\t\t\t$('#imgCheckAll').show();\n\t\t\tisClickAll = 1;\n\t\t} else {\n\t\t\t$('#imgCheckAll').hide();\n\t\t\tisClickAll = 0;\n\t\t}\n\t});\n\n\t$('#checkShool').click(function() {\n\t\tif(isClickShool === 0 ) {\n\t\t\t$('#imgCheckShool').show();\n\t\t\tisClickShool = 1;\n\t\t} else {\n\t\t\t$('#imgCheckShool').hide();\n\t\t\tisClickShool = 0;\n\t\t}\n\t});\n\n\t$('#checkName').click(function() {\n\t\tif(isClickName === 0 ) {\n\t\t\t$('#imgCheckName').show();\n\t\t\tisClickName = 1;\n\t\t} else {\n\t\t\t$('#imgCheckName').hide();\n\t\t\tisClickName = 0;\n\t\t}\n\t});\n\n\t$('#checkMajor').click(function() {\n\t\tif(isClickMajor === 0 ) {\n\t\t\t$('#imgCheckMajor').show();\n\t\t\tisClickMajor = 1;\n\t\t} else {\n\t\t\t$('#imgCheckMajor').hide();\n\t\t\tisClickMajor = 0;\n\t\t}\n\t});\n\n\t$('#checkExtra').click(function() {\n\t\tif(isClickExtra === 0 ) {\n\t\t\t$('#imgCheckExtra').show();\n\t\t\tisClickExtra = 1;\n\t\t} else {\n\t\t\t$('#imgCheckExtra').hide();\n\t\t\tisClickExtra = 0;\n\t\t}\n\t});\n\n\t$('#checkTutor').click(function() {\n\t\tif(isClickTutor === 0 ) {\n\t\t\t$('#imgCheckTutor').show();\n\t\t\tisClickTutor = 1;\n\t\t} else {\n\t\t\t$('#imgCheckTutor').hide();\n\t\t\tisClickTutor = 0;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6c0a7b1312675f26cd25154599f7bb51", "score": "0.50331515", "text": "function buildSearch(keywords, searchType) { //begin buildSearch\n\n //Clears previous results\n if (searchType != \"pageFwd\") {\n var $recentLinks = $(\"#recent\");\n $recentLinks.text(\"\");\n }\n\n //Clears previous intro text\n var $introLinks = $(\"#intro\");\n $introLinks.text(\"\");\n\n //clear out past instances in memory\n var akURL=\"\" //clear out past instances in memory\n\n//initialize akURL with all common parts before customizing\n akURL=\"https://catalog.archives.gov/api/v1/?\"; // Base url for API\n akURL=akURL+\"rows=10&\"; //Set rows to 10\n\nif (searchType == \"search\"){\n\n //Set keywords from form in index.html, restricted to online records mentioning Alaska\n var keywords = $(\"#keywords\").val();\n akURL=akURL + \"q=\" + keywords + \" and alaska &exists=objects\";\n\n\n $(\"#recent\").append(\"<br>Searching for digital Alaskana relating to \" + keywords + \".\");\n\n //limit records to items with descriptions\n akURL=akURL + \"&resultTypes=item,fileUnit\";\n\n //Save pageURL if needed for paging forward\n pageURL=akURL;\n console.log(searchType, \" \", akURL);\n} else if (searchType == \"newItems\") {\n\n //Limit to items and file units that mention Alaska and have digital objects\n akURL = akURL + \"q=alaska&resultTypes=item,fileUnit&exists=objects\"\n\n //Sort by date record modified\n akURL = akURL + \"&sort=description.recordHistory.changed.modification.dateTime%20desc\"\n\n //Save pageURL if needed for paging forward\n pageURL=akURL;\n\n console.log(searchType, \" \", akURL);\n //else if below retrieves federally run school newspapers\n} else if (searchType == \"schNews\"){\n offset=0;\n //Intro text\n $(\"#intro\").append(\"<p>Scope and Content of parent series: This series consists of school newspapers from Bureau of Indian Affairs schools throughout Alaska. </p> The newspapers include news about school activities such as sports; dances; special projects by different classes; and programs including plays, 4-H club events, and student council affairs. There are usually articles about events in the town or village including hunting; fishing; arrival of the supply ship, North Star, and other visitors; the arrival of the mail plane; births, deaths, and marriages; and weather conditions. Many of the newspapers include articles written by the children about their accomplishments or interests.</p><p>There are also several newspapers concerning events in the Adult Education program.</p><hr>\");\n $(\"#recent\").append(\"<p>Please be patient as it may take up to 90 seconds for records to appear. This is a known issue and being worked on.</p>\")\n\n\n//pull records mentioning the Alaska Digitization Project as an \"alternate control number\"\n akURL=akURL + \"description.fileUnit.variantControlNumberArray.variantControlNumber=\\\"Alaska%20Digitization%20Project\\\"\"\n\n //pull records of parent title series 'newspapers'\n akURL=akURL + \"&description.fileUnit.parentSeries.title=newspapers\"\n\n //limit records to items with descriptions\n akURL=akURL + \"&resultTypes=fileUnit\";\n\n //Sort items by title\n akURL=akURL + \"&sort=description.title asc\";\n\n //Save pageURL if needed for paging forward\n pageURL=akURL;\n\n console.log(searchType, \" \", akURL);\n} else if (searchType == \"1964Quake\"){\noffset=0;\n//Intro text\n$(\"#intro\").append(\"<p>Scope and Content of parent series: This series consists of black and white photographs taken by the Alaska District of the U.S. Army Corps of Engineers of the damage done by the 1964 Good Friday Alaska earthquake and the subsequent recovery efforts. The areas represented are Anchorage, the Turnagain Arm residential area, Denali Elementary School, Cordova, Elmendorf Air Force Base, Fort Richardson, Girdwood, Homer, Kodiak, Moose Pass, Nikolski, Seldovia, Seward, Tatitlek, Valdez, and Whittier.</p>\");\n$(\"#intro\").append(\"<p>Items should be in order by community.</p><hr>\")\n$(\"#recent\").append(\"<p>Please be patient as it may take up to 90 seconds for records to appear. This is a known issue and being worked on.</p>\")\n\n//pull records of parent title series 'Alaska Earthquake Photographs'\n akURL=akURL + \"description.fileUnit.parentSeries.title=1964%20Alaska%20Earthquake%20Photographs\"\n\n //limit records to items with descriptions\n akURL=akURL + \"&resultTypes=fileUnit\";\n\n //Sort items by title\n akURL=akURL + \"&sort=description.title asc\";\n\n //Save pageURL if needed for paging forward\n pageURL=akURL;\n\n console.log(searchType, \" \", akURL);\n} else if (searchType == \"villageCensusRolls\"){\noffset=0;\n//Intro text\n$(\"#intro\").append(\"<p>Scope and Content of parent series: This series consists of census sheets for towns and villages throughout the Territory and State of Alaska. The census was mainly taken by Bureau of Indian Affairs teachers and maintained by the Bureau's area office in Juneau. Information included on the census varies from year to year but consistently contains the names of each family member, their relationship to the head of the household, their age, and degree of Native blood. In some years the census sheets also asked for information on individual's education, ability to speak and read English, martial status, occupation, and special skills. Some sheets also have a column for remarks in which notes were made on the social, economic, and physical health of individuals. For some years the census also included questions relating to the monetary value of homes, vehicles, livestock such as reindeer, sled dogs, and foxes, and Native store shares held by each family.</p><hr>\");\n$(\"#recent\").append(\"<p>Please be patient as it may take up to 90 seconds for records to appear. This is a known issue and being worked on.</p>\")\n\n//pull records of parent title series 'Village Census Rolls\"\n akURL=akURL + \"description.fileUnit.parentSeries.title=village%20census%20rolls\";\n\n //limit records to items with descriptions\n akURL=akURL + \"&resultTypes=fileUnit\";\n\n //Sort items by title\n akURL=akURL + \"&sort=description.title asc\";\n\n //Save pageURL if needed for paging forward\n pageURL=akURL;\n\n console.log(searchType, \" \", akURL);\n\n} else if (searchType == \"taskForcePhotos\"){\noffset=0;\n//Intro text\n$(\"#intro\").append(\"<p>Scope and Content of parent series: This series consists of photographs taken between 1972 and 1976 documenting national parks in Alaska. Subjects include flora, fauna, facilities, rivers, mountains, other natural features, towns and villages, and activities of park personnel and visitors.</p>\");\n$(\"#intro\").append(\"<p>Items should be in order by place name.</p><hr>\")\n$(\"#recent\").append(\"<p>Please be patient as it may take up to 90 seconds for records to appear. This is a known issue and being worked on.</p>\")\n\n//pull records of parent title series 'Alaska Task Force Photographs', naId=2252773\n akURL=akURL + \"description.fileUnit.parentSeries.naId=2252773\"\n\n //limit records to items with descriptions\n akURL=akURL + \"&resultTypes=fileUnit\";\n\n //Sort items by title\n akURL=akURL + \"&sort=description.title asc\";\n\n //Save pageURL if needed for paging forward\n pageURL=akURL;\n\n console.log(searchType, \" \", akURL);\n} else if (searchType=\"pageFwd\") {\n offset=offset+10;\n akURL=pageURL + \"&offset=\" + offset;\n console.log(akURL);\n}\nreturn akURL;\n// end else\n} //end function build search", "title": "" }, { "docid": "f9b4eddd482639e94f62767d3247d245", "score": "0.50256664", "text": "function searching() {\n if (searchCache == search) { // no change ...\n timer = null;\n return;\n }\n\n var matches = 0;\n searchCache = search;\n selector.hide();\n selector.empty();\n\n // escape regexp characters\n var regexp = escapeRegExp(search);\n // exact match\n if(settings.exactMatch)\n \tregexp = \"^\" + regexp;\n // wildcard support\n if(settings.wildcards) {\n \tregexp = regexp.replace(/\\\\\\*/g, \".*\");\n \tregexp = regexp.replace(/\\\\\\?/g, \".\");\n }\n // ignore case sensitive\n var flags = null;\n if(settings.ignoreCase)\n \tflags = \"i\";\n\n // RegExp object\n search = new RegExp(regexp, flags);\n\n\t\t\t// for each item in list\n for(var i=1;i<self.get(0).length && matches < settings.maxMultiMatch;i++){\n \t// search\n if(search.length == 0 || search.test(self.get(0).options[i].text)){\n \tvar opt = $(self.get(0).options[i]).clone().attr(idxAttr, i-1);\n \tif(self.data(\"index\") == i)\n \t\topt.text(self.data(\"text\"));\n selector.append(opt);\n matches++;\n }\n }\n\n // result actions\n if(matches >= 1){\n selectorHelper.selectedIndex(0);\n }\n else if(matches == 0){\n selector.append(noMatchItem);\n }\n\n // append top match item if matches exceeds maxMultiMatch\n if(matches >= settings.maxMultiMatch){\n selector.append(topMatchItem);\n }\n\n // resize selector\n selectorHelper.size(matches);\n selector.show();\n timer = null;\n }", "title": "" }, { "docid": "d4d626b2087cabce4ef6439d77756e9e", "score": "0.50239676", "text": "function search(query, page, limit) {\n if (query == undefined) return;\n var query = query.replace(/^\\s+/,'').replace(/\\s+$/,'');\n var page = (page != undefined)?page:searchPage;\n var limit = (limit != undefined)?limit:searchLimit;\n var offset = (page -1) * limit;\n // don't allow empty searches\n if (query == '') return;\n // Show the searching mask and panel\n toggleSearchPanel(true);\n toggleSearchMask(true);\n toggleSearchSpinner(true);\n $('#itemModal').fadeOut();\n // build our filters\n var filters = {};\n // Go through the complete secondary filter list and add them to the filter variable\n // We dont have to add the primaries like we do up in the inline filter loader because\n // the secondaries are checked when you check the primaries\n $('input.secondaryCheckbox').each(function(i, o) {\n if ($(o).prop('checked')) {\n var name = $(o).prop('name');\n filters[name] = true;\n }\n });\n // setting some globals\n searchQuery = query;\n searchOffset = offset;\n searchLimit = limit;\n searchFilters = filters;\n searchPage = page;\n\n // POST!\n $.ajax({\n type : \"POST\",\n dataType : 'json',\n url : \"/browser/search\",\n data : { query : query, filters : filters, limit : limit, offset : offset },\n success : function(xhr) {\n toggleSearchMask(false);\n toggleSearchSpinner(false);\n renderSearchResults(xhr.hits, true);\n adjustFacets(xhr.facets);\n $('div.subjects button').removeClass('selected');\n },\n error : function(xhr, txtStatus, errThrown) {\n // @TODO what do we do here if something just fails\n }\n });\n\n return false;\n}", "title": "" }, { "docid": "a478f79faac2b9519796fe0b3eef1150", "score": "0.50206155", "text": "function searchBSResult(){\r\n\t//Create a model\r\n\tvar beforeSketch = Spine.Model.sub();\r\n\tbeforeSketch.configure(\"/user/search/searchBeforeSketch\", \"jobTitle\", \"firstResult\", \"maxResults\");\r\n\tbeforeSketch.extend( Spine.Model.Ajax );\r\n\tif(null == sessionStorage.getItem(\"firstResult\")){\r\n\t\tfirstRslt = 0;\r\n\t}else{\r\n\t\tfirstRslt = parseInt(sessionStorage.getItem(\"maxResults\")) + 1;\r\n\t}\r\n\tif(null == sessionStorage.getItem(\"maxResults\")){\r\n\t\tmaxRslt = 20;\r\n\t}else{\r\n\t\tmaxRslt = parseInt(sessionStorage.getItem(\"maxResults\")) + 20;\r\n\t}\r\n\tsessionStorage.setItem(\"firstResult\", firstRslt);\r\n\tsessionStorage.setItem(\"maxResults\", maxRslt);\r\n\t//Populate the model\r\n\tvar populateModel = new beforeSketch({ \r\n\t\tjobTitle: sessionStorage.getItem(\"jobTitle\"),\r\n\t\tfirstResult: firstRslt,\r\n\t\tmaxResults: maxRslt\r\n\t});\r\n\tpopulateModel.save(); //POST\r\n\t\r\n\tbeforeSketch.bind(\"ajaxError\", function(record, xhr, settings, error) {\r\n\t\talertify.alert(\"Unable to connect to the server.\");\r\n\t});\r\n\t\r\n\tbeforeSketch.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\r\n\t\tvar jsonStr = JSON.stringify(xhr);\r\n\t\tvar obj = jQuery.parseJSON(jsonStr);\r\n\t\t//console.log(obj);\r\n\t\tif(obj.statusCode == 200){\r\n\t\t\tvar baseObj = obj.sketchStringList;\r\n\t\t\tvar size = baseObj.length;\r\n\t\t\t\tif(size > 0){\r\n\t\t\t\tfor(var index=0; index<size; index++){\r\n\t\t\t\t\tnextLine = nextLine + 1;\r\n\t\t\t\t\timageText = imageText + \"<img src=\"+baseObj[index]+\" class='thumbnails' onclick='openImage(\"+baseObj[index]+\")'/> &nbsp;&nbsp;&nbsp;&nbsp;\";\r\n\t\t\t\t\tif(nextLine%3 == 0){\r\n\t\t\t\t\t\timageText = imageText + \"<br /><br /><br />\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdocument.getElementById('headerDiv').innerHTML = \"<br />Search Result For Level: \"+sessionStorage.getItem(\"jobTitle\");\r\n\t\t\t\tdocument.getElementById('imageBS').innerHTML = \"\";\r\n\t\t\t\tdocument.getElementById('imageDiv').innerHTML = imageText;\r\n\t\t\t\t//document.getElementById('contoller').innerHTML = \"<< Previous &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next >>\";\r\n\t\t\t} else {\r\n\t\t\t\tdocument.getElementById('headerDiv').innerHTML = \"<br />Search Result For Level: \"+sessionStorage.getItem(\"jobTitle\");\r\n\t\t\t\t//document.getElementById('imageBS').innerHTML = \"\";\r\n\t\t\t\tdocument.getElementById('imageBS').innerHTML = \"No result to display.\";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\talert('handle the exception');\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "59024246c51395a3026cda2f6c187eb9", "score": "0.50190115", "text": "function manualSearch(pvTabId, pvSearchTerm) {\n\n log(gvScriptName_BGMain + '.manualSearch: Start >>> pvTabId == ' + pvTabId + ', pvSearchTerm == ' + pvSearchTerm,'PROCS');\n\n // Build up the parameters that we'll pass through to the displayRecommendations function\n var lvArgs_displayRecs = {tabId: pvTabId,\n recommendationData: [],\n searchTerm: pvSearchTerm,\n displayChristmasBanner: false,\n productGroupIdsArray: []};\n\n if(pvSearchTerm === ''){\n displayRecommendations(lvArgs_displayRecs);\n userLog(pvTabId,'MANUAL_SEARCH_EMPTY_STRING');\n } else{\n\n userLog(pvTabId,'MANUAL_SEARCH',{searchTerm: pvSearchTerm});\n\n var lvSearchTerm_LC = pvSearchTerm.toLowerCase();\n var isMenInSearchTerm = false;\n var isWomenInSearchTerm = false;\n\n // We really don't want \"men's ---\" to return product's with \"women's ---\" in the name, so we have to do a little manual hack to fix this\n // While we're at it, we may as well match both \"women\" and \"men\" on sex\n if(lvSearchTerm_LC.indexOf('men') === 0 || lvSearchTerm_LC.indexOf(' men') !== -1 || lvSearchTerm_LC.indexOf('man') === 0 || lvSearchTerm_LC.indexOf(' man') !== -1) {\n isMenInSearchTerm = true;\n }\n if(lvSearchTerm_LC.indexOf('women') !== -1 || lvSearchTerm_LC.indexOf('woman') !== -1 || lvSearchTerm_LC.indexOf('lady') !== -1 || lvSearchTerm_LC.indexOf('ladies') !== -1) {\n isWomenInSearchTerm = true;\n }\n\n /******************************************************************\n * Hit the searchProducts with a whole bunch of different filters *\n ******************************************************************/\n\n var SearchProduct = Parse.Object.extend('SearchProduct');\n\n var searchProductQuery_productName = new Parse.Query(SearchProduct);\n var searchProductQuery_brand = new Parse.Query(SearchProduct);\n var searchProductQuery_searchTerm1 = new Parse.Query(SearchProduct);\n var searchProductQuery_searchTerm2 = new Parse.Query(SearchProduct);\n var searchProductQuery_searchTerm3 = new Parse.Query(SearchProduct);\n var searchProductQuery_searchTerm4 = new Parse.Query(SearchProduct);\n var searchProductQuery_searchTerm5 = new Parse.Query(SearchProduct);\n var searchProductQuery_searchTerm6 = new Parse.Query(SearchProduct);\n var searchProductQuery_productGroupName = new Parse.Query(SearchProduct);\n\n searchProductQuery_productName.contains('productName_LC',lvSearchTerm_LC);\n searchProductQuery_brand.contains('brand_LC',lvSearchTerm_LC);\n searchProductQuery_searchTerm1.contains('searchTerm1_LC',lvSearchTerm_LC);\n searchProductQuery_searchTerm2.contains('searchTerm2_LC',lvSearchTerm_LC);\n searchProductQuery_searchTerm3.contains('searchTerm3_LC',lvSearchTerm_LC);\n searchProductQuery_searchTerm4.contains('searchTerm4_LC',lvSearchTerm_LC);\n searchProductQuery_searchTerm5.contains('searchTerm5_LC',lvSearchTerm_LC);\n searchProductQuery_searchTerm6.contains('searchTerm6_LC',lvSearchTerm_LC);\n searchProductQuery_productGroupName.contains('productGroup_sort',lvSearchTerm_LC);\n\n // To do: the negative search terms?\n\n var searchProductCompoundQuery = Parse.Query.or(searchProductQuery_productName,\n searchProductQuery_brand,\n searchProductQuery_searchTerm1,\n searchProductQuery_searchTerm2,\n searchProductQuery_searchTerm3,\n searchProductQuery_searchTerm4,\n searchProductQuery_searchTerm5,\n searchProductQuery_searchTerm6,\n // We can't do any more - max OR clauses reached\n searchProductQuery_productGroupName);\n searchProductCompoundQuery.include('searchCategories');\n searchProductCompoundQuery.find({\n success: function(searchProducts){\n for (var i = 0; i < searchProducts.length; i++) {\n var includeThisProduct = true;\n if(isMenInSearchTerm && isWomenInSearchTerm) {\n // do nothing\n } else {\n if(isMenInSearchTerm && searchProducts[i].get('sex_LC') === 'women') {\n includeThisProduct = false;\n }\n if(isWomenInSearchTerm && searchProducts[i].get('sex_LC') === 'men') {\n includeThisProduct = false;\n }\n }\n if(includeThisProduct) {\n lvArgs_displayRecs.productGroupIdsArray.push(searchProducts[i].get('productGroups').id);\n }\n }\n\n /*******************************************************************\n * Hit the recommendations with a whole bunch of different filters *\n *******************************************************************/\n\n var Recommendation = Parse.Object.extend('Recommendation');\n\n // Product-level recs have productGroups\n var ProductGroup = Parse.Object.extend('ProductGroup');\n var productGroupQuery = new Parse.Query(ProductGroup);\n productGroupQuery.containedIn('objectId',lvArgs_displayRecs.productGroupIdsArray);\n var recommendationQuery_productGroups = new Parse.Query(Recommendation);\n recommendationQuery_productGroups.matchesQuery('productGroups',productGroupQuery);\n\n // Website-level recs have SearchCategories\n var SearchCategory = Parse.Object.extend('SearchCategory');\n var searchCategoryQuery = new Parse.Query(SearchCategory);\n searchCategoryQuery.contains('categoryName_LC',lvSearchTerm_LC);\n var recommendationQuery_searchCategory = new Parse.Query(Recommendation);\n recommendationQuery_searchCategory.matchesQuery('ethicalBrand',searchCategoryQuery);\n\n // All recs have a brand\n var EthicalBrand = Parse.Object.extend('EthicalBrand');\n var ethicalBrandQuery = new Parse.Query(EthicalBrand);\n ethicalBrandQuery.contains('brandName_LC',lvSearchTerm_LC);\n ethicalBrandQuery.notEqualTo('isArchived',true);\n var recommendationQuery_ethicalBrand = new Parse.Query(Recommendation);\n recommendationQuery_ethicalBrand.matchesQuery('ethicalBrand',ethicalBrandQuery);\n\n // Also search on productName ...\n var recommendationQuery_productName = new Parse.Query(Recommendation);\n recommendationQuery_productName.contains('productName_LC',lvSearchTerm_LC);\n\n // ... and productURL\n var recommendationQuery_productURL = new Parse.Query(Recommendation);\n recommendationQuery_productURL.contains('productURL',lvSearchTerm_LC);\n\n // Compound the whole lot together\n var recommendationCompoundQuery = Parse.Query.or(recommendationQuery_productGroups,\n recommendationQuery_searchCategory,\n recommendationQuery_ethicalBrand,\n recommendationQuery_productName,\n recommendationQuery_productURL);\n\n recommendationCompoundQuery.include('productGroups');\n recommendationCompoundQuery.include('ethicalBrand');\n\n // And remove the archived recs\n recommendationCompoundQuery.notEqualTo('isArchived',true);\n\n // The sort order is important, otherwise the ProductGroups will not\n // form up correctly on the sidebar\n recommendationCompoundQuery.ascending('productGroup_sort,-ratingScore, productName');\n\n recommendationCompoundQuery.find({\n success: function(recommendations){\n var lvProductGroupId;\n var lvProductGroupName;\n var lvSectionTitle;\n for (var j = 0; j < recommendations.length; j++) {\n var imageURL = \"\";\n if(recommendations[j].get('image')){\n imageURL = recommendations[j].get('image').url();\n }\n // confused here about the different ways this can be populated, so covering all bases\n if(typeof recommendations[j].get('productGroups') !== 'undefined' && typeof recommendations[j].get('productGroups').id !== 'undefined') {\n lvProductGroupId = recommendations[j].get('productGroups').id;\n lvProductGroupName = recommendations[j].get('productGroups').get('productGroupName');\n lvSectionTitle = lvProductGroupName;\n } else {\n // website-level recs\n lvSectionTitle = recommendations[j].get('searchCategory').get('categoryName');\n lvProductGroupId = null;\n }\n\n lvArgs_displayRecs.recommendationData.push({productGroupId: lvProductGroupId,\n sectionTitle: lvSectionTitle,\n productGroupName: lvProductGroupName,\n recommendationId: recommendations[j].id,\n productName: recommendations[j].get('productName'),\n pageConfirmationSearch: recommendations[j].get('pageConfirmationSearch'),\n productURL: recommendations[j].get('productURL'),\n brandName: recommendations[j].get('ethicalBrand').get('brandName'),\n brandId: recommendations[j].get('ethicalBrand').id,\n baluFavourite: recommendations[j].get('ethicalBrand').get('baluFavourite'),\n imageURL: imageURL,\n twitterHandle: recommendations[j].get('ethicalBrand').get('twitterHandle'),\n brandSpiel: recommendations[j].get('ethicalBrand').get('brandSpiel').replace(/(\\r\\n|\\n|\\r)/g,\"<br />\")});\n\n // If the recommendation we've just added is flagged to display the Christmas banner, then set the variable\n if(typeof recommendations[j].get('productGroups') !== 'undefined') {\n if(recommendations[j].get('productGroups').get('christmasBanner') === true){\n lvArgs_displayRecs.displayChristmasBanner = true;\n }\n }\n }\n\n // Note, the content_script will catch no-results and display the empty side bar\n // But we also want to log no results separately, because these could be products we should be adding to Balu\n if(!recommendations || lvArgs_displayRecs.recommendationData.length === 0) {\n userLog(pvTabId,'MANUAL_SEARCH_NO_RESULTS',{searchTerm: pvSearchTerm});\n }\n displayRecommendations(lvArgs_displayRecs);\n userLog(pvTabId,'MANUAL_SEARCH_RECOMMENDATIONS_RETURNED',{searchTerm: pvSearchTerm, recommendationsArray: lvArgs_displayRecs.recommendationData});\n },\n error: parseErrorFind\n });\n },\n error: parseErrorFind\n });\n }\n}", "title": "" }, { "docid": "07f1c0905108e510e729ff31366fba43", "score": "0.5012506", "text": "function chooseSearch(tags,$this,a,b){\n $this.next(\"div\").children().first().addClass(\"sbToggle2\");\n $(\"#y-cbg-main\").find(\"#keywords\").val(\"\");\n var KeyText=$this.val();\n var _value = '{\"con_key0\":\"'+KeyText+'\",\"con_key3\":a,\"con_key5\":b}';\n search_by_years(tags,KeyText, \"byYear\");\n}", "title": "" }, { "docid": "8ead960302f3485a75e14068ca00a377", "score": "0.5006881", "text": "function Search(opt) {\n var search = $(\"#search_bar\").val().toLowerCase();\n if (search.length === 0) {\n analytics(\"empty_search,search\");\n if (typeof opt.empty_func !== \"undefined\")\n opt.empty_func();\n }\n else {\n analytics(\"search\");\n if (typeof opt.nempty_func !== \"undefined\")\n opt.nempty_func();\n \n var tokens = search.splitQuoted(\" \", \"\\\"\");\n var results = [];\n for (var i = 0; i < SECTIONS.length; i ++) {\n var section = SECTIONS[i];\n var include = false;\n var str = section.program + \" \" + section.catalog_no + \" \" +\n section.section + \" \" + section.title + \" \" +\n section.instructor + \" \" + section.class_no + \" \" +\n section.credits + \" \" + \n section.seats + \"/\" + section.filled + \" \" +\n section._meetsAt().toString() + \" \";\n if (typeof section._meetsAt().mtgDays !== \"undefined\")\n str += expandDays(section._meetsAt().mtgDays()).join(\" \") + \" \";\n if (typeof section._meetsAt().first !== \"undefined\" &&\n typeof section._meetsAt().first.mtgDays !== \"undefined\")\n str += expandDays(section._meetsAt().first.mtgDays()).join(\" \") + \" \";\n if (typeof section._meetsAt().second !== \"undefined\" &&\n typeof section._meetsAt().second.mtgDays !== \"undefined\")\n str += expandDays(section._meetsAt().second.mtgDays()).join(\" \") + \" \";\n \n str = str.toLowerCase();\n for (var j = 0; j < tokens.length; j ++) {\n if (tokens[j] !== \"\\\"\" && str.indexOf(tokens[j]) != -1)\n include = true;\n else {\n include = false;\n break;\n }\n }\n if (include)\n results.push(section);\n }\n \n results.sort(sectionLessThan);\n WORKING_LIST = results;\n }\n if (typeof opt.done_searching !== \"undefined\")\n setTimeout(opt.done_searching, 1);\n}", "title": "" }, { "docid": "a20c6c5aaeb90a5843105adbddf63142", "score": "0.499977", "text": "function showFilterPageData(divName,pageNo,sortId,procId,sortOrder,prevSortId)\n{\n\n if(pageNo==\"-1\"&&sortId==\"-1\")\n objs = new Array();\n \n var parameters= new Array();\n var i=0;\n parameters[i++]='methodName';\n parameters[i++]='getCustomerSearchFilterList';\n\n parameters[i++]='strRequestedData1';\n parameters[i++]=ipStrManipulation(); // added TD20791 wildcard search Q2FY13..nvelaga\n\n// alert(\"Setting params\");\n//\talert(\"Page No: \" + pageNo);\n\n parameters[i++]='strSourceSystem';\n parameters[i++]=document.getElementById('strSourceSystem').value;\n\n parameters[i++]='strWithinContext';\n parameters[i++]=document.getElementById('strWithinContext').value;\n\t \n parameters[i++]='strContext';\n parameters[i++]=document.getElementById('strContext').value;\n \n parameters[i++]='strContextValue';\n parameters[i++]=document.getElementById('strContextValue').value;\n \n parameters[i++]='strRequestedData';\n parameters[i++]=document.getElementById('strRequestedData').value;\n \n parameters[i++]='strStatus';\n parameters[i++]=document.getElementById('strStatus').value;\n\n parameters[i++]='strSearchHier';\n parameters[i++]=document.getElementById('strSearchHier').value;\n\n parameters[i++]='strCustomerName';\n parameters[i++]=document.getElementById('strCustomerName').value;\n\n parameters[i++]='procId';\n parameters[i++]=procId; \n \n parameters[i++]='strCCOUserId';\n parameters[i++]=document.getElementById('strCCOUserId').value; \n \n if(pageNo!=\"-1\")\n {\n parameters[i++]='pageNo';\n parameters[i++]=pageNo; \n } \n \n if(sortId!=\"-1\")\n {\n parameters[i++]='sortId';\n parameters[i++]=sortId; \n }\n \n\n if(document.getElementById('strSelectType') != null)\n {\n parameters[i++]='strSelectType';\n\t parameters[i++]=document.getElementById('strSelectType').value;\n }\n parameters[i++]='sortOrder';\n parameters[i++]=sortOrder;\n parameters[i++]='prevSortId';\n parameters[i++]=prevSortId;\n parameters[i++]='rand';\n parameters[i++]=Math.floor(Math.random()*1001);\n\n // alert(\"Parameters : \"+ parameters);\n\n // alert('<< AJAX CALL >>');\n var response = XMLHttpRequestSender('./custSelectorDispatch.do',\n parameters,\n 'true',\n 'GET',\n '1000000',\n '3',divName, displayPopupResults);\n\n document.getElementById('dataGrid').innerHTML='<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" height=\"100%\"><tr><td valign=\"middle\"><p align=\"center\"><img src=\"images/global/progress_bar/progress_bar_anim_3.gif\">&nbsp;<font size=\"3\">Loading..</font></td></tr></table>'; \n \n\n}", "title": "" }, { "docid": "4e5a6c250c655d04e2c608c72ce65d1d", "score": "0.49994713", "text": "renderSearchHeader() {\n return (\n <div className='container'>\n <section>\n <div align=\"center\"><img src=\"logotype.svg\" width=\"224px\" height=\"56px\"/></div>\n <br/>\n <div align=\"center\">\n <Form onSubmit={this.submitHandler} inline>\n <FormControl\n type=\"text\"\n width=\"224px\"\n value={this.state.query}\n placeholder=\"Enter Search Criteria\"\n onChange={this.handleChange}\n /> \n\n <br/>\n <Button bsStyle=\"primary\" className=\"button is-info\" onClick={this.searchPeople} >\n Search People\n </Button>\n </Form>\n </div>\n <div></div>\n </section>\n </div>\n );\n }", "title": "" }, { "docid": "3934f1a2a625aaf4fc8181db544e94c6", "score": "0.49921194", "text": "function onSearchButt() {\n\t\t// var uri = new URI();\n\t\t// var queries = uri.search(true)\n\t\t// console.log(queries)\n\t\turi.setSearch({input: $(\"#search-input\").val()});\n\t\turi.setSearch({source: $(\"#data-source-selection\").val()});\n\t\t// queries['input'] = $(\"#search-input\").val();\n\t\t// queries['source'] = $(\"#data-source-selection\").val()\n\t\t\n\t\t// if user is dumb and pressed search on empty input\n\t\tif (! uri.search(true).input) {\n\t\t\thideContent(true)\n\t\t\t$(\"#emptySearch\").show()\n\t\t\treturn false;\n\t\t}\n\t\t// wrong\n\t\t// pushGuai(queries)\n\t\t\n\t\tsearch();\n\t\t// why is this return false here?\n\t\treturn false;\n\t}", "title": "" }, { "docid": "cb4fa7bc488f1ae05f8bb2d44de048d3", "score": "0.4989301", "text": "function search (mymap, data, proportionalSymbols){\n\n // new variable search control\n var searchLayer = new L.Control.Search({\n position: 'topright', // positions the operator in the top left of the screen\n layer: proportionalSymbols, // use proportionalSymbols as the layer to search through\n propertyName: 'Location', // search for State name\n marker: false,\n moveToLocation: function (latlng, title, mymap) {\n\n // set the view once searched to the circle marker's latlng and zoom\n mymap.setView(latlng, 6);\n\n } // close to moveToLocation\n }); // close to var searchLayer\n\n\n // add the control to the map\n mymap.addControl(searchLayer);\n\t$(\"#section-2\").append(searchLayer);\n\n}", "title": "" }, { "docid": "bec454b2ce896f62c7a21c1093d9ccb5", "score": "0.49874178", "text": "function _fnBuildSearchRow( oSettings, aData )\n\t\t{\n\t\t\tvar sSearch = '';\n\t\t\tvar nTmp = document.createElement('div');\n\t\t\t\n\t\t\tfor ( var j=0, jLen=oSettings.aoColumns.length ; j<jLen ; j++ )\n\t\t\t{\n\t\t\t\tif ( oSettings.aoColumns[j].bSearchable )\n\t\t\t\t{\n\t\t\t\t\tvar sData = aData[j];\n\t\t\t\t\tsSearch += _fnDataToSearch( sData, oSettings.aoColumns[j].sType )+' ';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * If it looks like there is an HTML entity in the string, attempt\n\t\t\t * to decode it\n\t\t\t */\n\t\t\tif ( sSearch.indexOf('&') !== -1 )\n\t\t\t{\n\t\t\t\tnTmp.innerHTML = sSearch;\n\t\t\t\tsSearch = nTmp.textContent ? nTmp.textContent : nTmp.innerText;\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * IE and Opera appear to put an newline where there is a <br>\n\t\t\t\t * tag - remove it\n\t\t\t\t */\n\t\t\t\tsSearch = sSearch.replace(/\\n/g,\" \").replace(/\\r/g,\"\");\n\t\t\t}\n\t\t\t\n\t\t\treturn sSearch;\n\t\t}", "title": "" } ]
ca2944e724b0a4a7b710b2b411cd486d
modify the array by destructively (modifying original array) end of array
[ { "docid": "e68721ae9c758b991a753088ad55bbe3", "score": "0.0", "text": "function destructivelyAppendDriver(name)\n {drivers.push(name)}", "title": "" } ]
[ { "docid": "bba2d1d659dcfdec39c45df3eb8337e2", "score": "0.7058609", "text": "function destructivelyRemoveElementFromEndOfArray(array) {\n array.pop(...array);\n return array\n}", "title": "" }, { "docid": "0dda13d40dbb4b23fba099d92094ca83", "score": "0.68835026", "text": "function destructivelyRemoveElementFromEndOfArray(array) {\n array.pop();\n return array;\n}", "title": "" }, { "docid": "0dda13d40dbb4b23fba099d92094ca83", "score": "0.68835026", "text": "function destructivelyRemoveElementFromEndOfArray(array) {\n array.pop();\n return array;\n}", "title": "" }, { "docid": "42b3d6332bcfb5e18e131efde05d9289", "score": "0.6841704", "text": "function destructivelyRemoveElementFromEndOfArray(array)\n{\n array.pop();\n return array;\n}", "title": "" }, { "docid": "149b7601f165f72863a7d8fbae993fae", "score": "0.6802821", "text": "function addElementToEndOfArray(array, element) {\n\n//modify without changing\nreturn [...array, element];\n}", "title": "" }, { "docid": "5c7f2a2acdac9a623be837312a961499", "score": "0.6743221", "text": "function removeElementFromEndOfArray(array)\n{\n var newArray = array\n newArray = newArray.slice(0 , newArray.length-1)\n return newArray // done\n}", "title": "" }, { "docid": "b98b9ee2c1fb454de2258f832bdee0ee", "score": "0.66651267", "text": "shift() {\n for(let i = 0; i < this.length - 1; i++) {\n this.data[i] = this.data[i + 1];\n }\n delete this.data[this.length - 1];\n }", "title": "" }, { "docid": "10d3caf06810fbe4516c8715f127f06b", "score": "0.66393125", "text": "shiftIndex(index){\r\n for(let i = index; i<this.length-1; i++ ){\r\n this.data[i] = this.data[i+1]\r\n \r\n }\r\n \r\n delete this.data[this.length - 1];\r\n this.length --;\r\n }", "title": "" }, { "docid": "b14712475b426ce1b28b48449d9fdc12", "score": "0.6598643", "text": "function removeFromBackOfNew(arr) {\n var newArray = arr.slice(0,arr.length-1); //\n return newArray;\n}", "title": "" }, { "docid": "2cd8395603a6206af4af1c4aaebeb829", "score": "0.65983343", "text": "function destructivelyAddElementToEndOfArray(array , element)\n{\n array.push(element)\n return array\n //return array.push(element)\n}", "title": "" }, { "docid": "09290371c36430710dd77474706e4128", "score": "0.6595306", "text": "function shift_array(arr) {\n\tfor (var i = 0, j = arr.length - 1; i < j; i++) {\n\t\tarr[i] = arr[i + 1];\n\t}\n\tarr[arr.length - 1] = 0;\n}", "title": "" }, { "docid": "6bbba987fd69a4b8b6332e5684d42236", "score": "0.6554544", "text": "function shiftArray(array){\n console.log(array);\n length = array.length - 1;\n for(i=0;i<length;i++){\n array[i] = array[i+1];\n }\n array[length] = 0;\n console.log(array);\n}", "title": "" }, { "docid": "2a51d1617ca6e701893e179d6f2ecaaf", "score": "0.65488577", "text": "shiftIndex(index){\n for(let i = index; i < this.length - 1; i++){\n this.data[i] = this.data[i+1];\n }\n delete this.data[this.length - 1];\n this.length--;\n }", "title": "" }, { "docid": "43bdddbf6c923520172306fe4daaad3a", "score": "0.65487474", "text": "function destructivelyRemoveElementFromEndOfArray(a) {\n a.pop();\n return a;\n}", "title": "" }, { "docid": "fb149e51feaa3f8e0400ebaf49b43e95", "score": "0.6535878", "text": "function removeElementFromEndOfArray(array) {\n return array.slice(0,array.length - 1);\n}", "title": "" }, { "docid": "c6dc10310be09464e7081c9a9f498cff", "score": "0.65236306", "text": "function removeElementFromEndOfArray(array) {\n var newArray = array.slice(0, array.length - 1);\n return newArray;\n}", "title": "" }, { "docid": "bec8ad8abd3cd7e85b3d2acf32f2e462", "score": "0.65218484", "text": "function shift_array(arr) {\n for (var i = 0; i < arr.length - 1; i++) {\n arr[i] = arr[i + 1]\n }\n arr[arr.length - 1] = 0\n console.log(arr);\n}", "title": "" }, { "docid": "6e0522037f2ecf216573e2b2dacd78b8", "score": "0.6519476", "text": "function removeElementFromEndOfArray(array) {\n var newArray = array.slice(0, array.length - 1);\n return newArray\n}", "title": "" }, { "docid": "701a46db955623816ef95c594ae1dc98", "score": "0.6510735", "text": "function shiftArrayValues(arr) {\n for (let i = 0; i < arr.length - 1; i++)arr[i] = arr[i + 1]\n\n arr[arr.length - 1] = 0\n\n console.log(arr)\n}", "title": "" }, { "docid": "5f1ccfaabd986bce7fe283345711c050", "score": "0.6501442", "text": "function destructivelyRemoveElementFromBeginningOfArray (array) {\n array.shift();\n return array;\n}", "title": "" }, { "docid": "3ca7ae90e7ba1d4d1e2a47de7c10f2a7", "score": "0.6499968", "text": "function removex(array, from, to) {\n var rest = array.slice((to || from) + 1 || array.length);\n array.length = from < 0 ? array.length + from: from;\n return array.push.apply(array, rest);\n}", "title": "" }, { "docid": "299cd3d7f24da09ac3ca47e76239ec12", "score": "0.64973634", "text": "function reverseArrayInPlace(a){\n let len = a.length;\n a.push(...a);\n for(let i = 0; i < len; ++i){\n let el = a.pop();\n a[i] = el;\n }\n}", "title": "" }, { "docid": "3623ad16eea1a6267d716ee11f28e39f", "score": "0.6479301", "text": "function destructivelyRemoveElementFromBeginningOfArray(array) {\n array.shift();\n return array;\n}", "title": "" }, { "docid": "dcae53d997aacf26d0a01a8fddb70ccf", "score": "0.64691424", "text": "replace(arr, arr2)\n {\n arr.length = 0;\n arr.splice.apply(arr, [0, 0].concat(arr2));\n return arr;\n }", "title": "" }, { "docid": "42ae46ac3a210416948b726f9a1b5cf5", "score": "0.6456423", "text": "function destructivelyRemoveElementFromBeginningOfArray(array) {\n array.shift();\n return array\n}", "title": "" }, { "docid": "c153549bf61ca64c854231a18ecb0d77", "score": "0.64562166", "text": "shift() {\n // if we have atleast 2 elements\n if(this.length == 0) { return; }\n // [1,2,3,4] to [2,3,4]\n // From 1 to n \n // n[i] = n[i - 1]\n // Remove last value\n for (let i = 0; i < this.length; i++) {\n this.memory[i] = this.memory[i + 1];\n }\n\n delete this.memory[this.length - 1];\n this.length--;\n }", "title": "" }, { "docid": "cdee4c27fb9e13683b8ebef1b974d346", "score": "0.6443501", "text": "function reverseArrayInPlace(arr) {\n for (var i = 0; i < arr.length; i++) {\n arr.splice(i, 0, arr[arr.length - 1]);\n arr.pop();\n }\n return arr;\n}", "title": "" }, { "docid": "39c5579d88a9aeb0806657a2c7f2a4a1", "score": "0.641986", "text": "function fixTheMeerkat(arr) {\n let x = arr[0];\n arr[0] = arr[arr.length - 1];\n arr[arr.length - 1] = x;\n return arr;\n }", "title": "" }, { "docid": "44aff999ea2070fd8788fac781e34638", "score": "0.64196795", "text": "function shiftArrayEl(array, index = 0) {\n if (array.length - 1 === index || array.length === 0){\n array.length = index;\n return array;\n }\n array[index] = array[index + 1];\n return shiftArrayEl(array, ++index)\n}", "title": "" }, { "docid": "52081260b6af780f6cfabeb95ff09302", "score": "0.6417947", "text": "function destructivelyRemoveElementFromBeginningOfArray(array)\n{\n array.shift();\n return array\n}", "title": "" }, { "docid": "704c44bc3f7b9b6268fb74d12080f94a", "score": "0.63799936", "text": "function destructivelyAddElementToEndOfArray(array, element) {\n array.push(element);\n return array;\n}", "title": "" }, { "docid": "33886b19423e42ef9167adae4c7c78c8", "score": "0.63779247", "text": "function reverseArrayInPlace(arr) {\n for (var i = 0; i <= Math.floor((arr.length - 1) / 2); i++) {\n let el = arr[i];\n arr[i] = arr[arr.length - 1 - i];\n arr[arr.length - 1 - i] = el;\n }\n }", "title": "" }, { "docid": "66f766056d7bab8f2bdd77c98d7e2ac3", "score": "0.6374685", "text": "function $$arrRemove(arr, index) {\n\t var origLength = arr.length;\n\t\tvar rest = arr.slice(parseFloat(index) + 1 );\n\t arr.length = index;\n\t arr.push.apply(arr, rest);\n\t if(origLength - arr.length != 1) throw Error('CarJS error: problem with arrRemove:(');\n}", "title": "" }, { "docid": "a5bacd1605ddd96ae210d23c537fbdee", "score": "0.6367697", "text": "function spliceElement(someArr){\n let newArr = new Array(someArr.length-1);\n console.log(\"Length of array is \" + someArr.length);\n\n for(let i=0; i<someArr.length-1; i++){\n if(i<2)\n newArr[i] = someArr[i];\n else\n newArr[i] = someArr[i+1];\n }\n\n console.log(\"Length of array is \" + newArr.length);\n}", "title": "" }, { "docid": "77da295f87a8727764db9e8329862b10", "score": "0.63549817", "text": "function rearranger(arr) {\n let mover = arr[0];\n arr.splice(0,1);\n arr.push(mover);\n return arr;\n}", "title": "" }, { "docid": "03d2afe977a62b9a1c50e6d1c9710d60", "score": "0.6350759", "text": "function destructivelyAddElementToEndOfArray(array, element) {\n array.push(element);\n return array\n}", "title": "" }, { "docid": "c3552d31ebb0a71c6116d0056f58c36f", "score": "0.63370425", "text": "function shiftArray(arr){\n for (let i = 1; i < arr.length; i++){\n arr[i-1] = arr[i];\n }\n arr[arr.length-1] = 0;\n return arr;\n}", "title": "" }, { "docid": "1fae665e8d52010349c6603400de3d18", "score": "0.6328724", "text": "function destructivelyRemoveElementFromBeginningOfArray(a) {\n a.shift();\n return a;\n}", "title": "" }, { "docid": "415d61729cb55b8febe4f94b7c5d9933", "score": "0.6323659", "text": "function $$arrRemove(arr, index) {\n\t var origLength = arr.length;\n\t\tvar rest = arr.slice(parseFloat(index) + 1 );\n\t arr.length = index;\n\t arr.push.apply(arr, rest);\n\t if(origLength - arr.length != 1) alert('problem with arrRemove:(');\n}", "title": "" }, { "docid": "2452655a727181613000d86a042610ef", "score": "0.632196", "text": "function reverseArrayInPlace(array) {\r\n\t\t\t\tconst lengthOfArray = array.length;\r\n\t\t\t\tfor (var i = lengthOfArray-1; i>=0; i--) {\r\n\t\t\t\t\tarray[lengthOfArray + (lengthOfArray-1-i)] = array[i];\r\n\t\t\t\t}\r\n\t\t\t\tarray.splice(0,lengthOfArray);\r\n\t\t\t}", "title": "" }, { "docid": "691a742a8b3b9d776fef5e02b63faa51", "score": "0.6309413", "text": "copyArray (array) { return array.slice(0) }", "title": "" }, { "docid": "0301797a0f61e0f94dc31dd2adc0bb7c", "score": "0.6308934", "text": "function copyAndExtendArray(arr, newValue) {\r\n return [...arr, newValue];\r\n}", "title": "" }, { "docid": "fefee3444cf05a50412d3cfdcf4a5048", "score": "0.6293933", "text": "function rvereseArray(arr,start,end)\n{\n let start = arr[i];\n let end = arr[arr.length-1]\n\twhile (start < end)\n\t{\n\t\tvar temp = arr[start];\n\t\tarr[start] = arr[end];\n\t\tarr[end] = temp;\n\t\tstart++;\n\t\tend--;\n\t}\n}", "title": "" }, { "docid": "8c064ea2f26d7cbb9a0e2f1142b848f8", "score": "0.62665325", "text": "shiftItems(index) {\n for (let i = index; i < this.length-1; i++) {\n this.data[i] = this.data[i+1];\n }\n delete this.data[this.length-1];\n this.length--;\n }", "title": "" }, { "docid": "46586d68229d328c9217bba1e3de651b", "score": "0.6260283", "text": "function swipeValues(arr) {\n let temp = arr[0];\n arr[0] = arr[arr.length - 1];\n arr[arr.length - 1] = temp;\n return arr\n}", "title": "" }, { "docid": "a52d61606b86068fba2d77ed37a9adf0", "score": "0.6249776", "text": "function mirrorArray(arr) {\n let copyArr = [...arr]; // [1,2,3]\n for (let i = arr.length - 1; i >= 0; i--) {\n copyArr.push(arr[i]);\n }\n return copyArr;\n}", "title": "" }, { "docid": "cbd92ca7a41113b4930cf916eb4d1dbd", "score": "0.6248754", "text": "function reverseArrayInPlace(array) {\n for (var i = array.length-1; i >= 0; i--) {\n array.push(array[i]);\n array.splice(i,1);\n }\n return array;\n}", "title": "" }, { "docid": "8fd11b7dea6d95e494a9fae87999d53e", "score": "0.6244031", "text": "function reverseArrayInPlace(arr) {\n var finalArr = [];\n for (var i = 0; i < arr.length; i++) {\n finalArr.unshift(arr[i]);\n }\n return finalArr;\n}", "title": "" }, { "docid": "270eceeb7f432430bb9d1faf4db99ed7", "score": "0.62421286", "text": "function arrayClone(arr) {\n return arr.slice(0);\n}", "title": "" }, { "docid": "134075608b6f71944b6195302c5201b3", "score": "0.6235253", "text": "function replaceElement(array, newElement, index) {\n var copy = array.slice();\n copy[index] = newElement;\n return copy;\n}", "title": "" }, { "docid": "134075608b6f71944b6195302c5201b3", "score": "0.6235253", "text": "function replaceElement(array, newElement, index) {\n var copy = array.slice();\n copy[index] = newElement;\n return copy;\n}", "title": "" }, { "docid": "134075608b6f71944b6195302c5201b3", "score": "0.6235253", "text": "function replaceElement(array, newElement, index) {\n var copy = array.slice();\n copy[index] = newElement;\n return copy;\n}", "title": "" }, { "docid": "6d6c154f96db02f6d9f71b2cbe50fff2", "score": "0.6235169", "text": "updateOperationArray(element) {\n this.operationArray[this.operationArray.length - 1] = element;\n }", "title": "" }, { "docid": "f3c307dbd6ed4c49fe824edd203e3f43", "score": "0.6221792", "text": "function arr (arr) {\n arr.unshift(arr.pop())\n return arr\n}", "title": "" }, { "docid": "4b512a6b94980c371da40877474de458", "score": "0.62149507", "text": "shiftItems(index) {\n for(let i = index; i < this.length - 1; i++) {\n this.data[i] = this.data[i + 1];\n }\n delete this.data[this.length - 1];\n this.length--;\n }", "title": "" }, { "docid": "11fc4a20ef4fa491b48523831d202cd8", "score": "0.6203831", "text": "remove(index) {\n assert(index >= 0 && index < this.logicalSize);\n\n // all elements from \"index+1\" to the end of the array needs to be shifted to the left\n for (let i = index + 1; i < this.logicalSize; i++) {\n this.array[i - 1] = this.array[i];\n }\n\n this.logicalSize = this.logicalSize - 1;\n }", "title": "" }, { "docid": "40f5cefb4ff816bfdf695bafe517a867", "score": "0.6203722", "text": "function rotateArray() {\n originalArray.push(originalArray[0]);\n originalArray.splice(0,1);\n}", "title": "" }, { "docid": "383122c909be8756252f396cefc34394", "score": "0.6201123", "text": "function update(index, ele){\n setArray(old=>[\n ...old.slice(0, index),\n ele, \n ...old.slice(index+1, old.length)\n ])\n }", "title": "" }, { "docid": "4b5a5d9003f069e7407d8cafa28c125c", "score": "0.6159856", "text": "function reverseArrayInPlace(){\r\n num_runs = array2.length;\r\n for (i = 0; i < num_runs; i++){\r\n array2.unshift(array2.pop());\r\n }\r\n console.log(array2);\r\n return array2;\r\n}", "title": "" }, { "docid": "ffed91a600e818b98070f47403b95aaf", "score": "0.61587954", "text": "function shifting(arr) {\n for (i=0; i<arr.length; i++){\n arr[i] = arr[i+1];\n \n }\n arr[arr.length-1] = 0;\n return arr;\n}", "title": "" }, { "docid": "269892a7378cc6b46a52d84d11c7a249", "score": "0.6155736", "text": "function addElementToEndOfArray(array , element)\n{\n return [...array , element] //done\n}", "title": "" }, { "docid": "8e23a8d31447e04b906cf9f42824a259", "score": "0.6153935", "text": "function reverseArrayInPlace(array) {\n let newArray = [];\n for(let i = 0; i < Math.floor(array.length/2); i ++) {\n let originalArr = array[i];\n array[i] = array[array.length - 1 - i];\n array[array.length - 1 - i] = originalArr;\n } return array;\n}", "title": "" }, { "docid": "1da219ee373ca6f56d8dabe0146572fc", "score": "0.6151184", "text": "function removeAt(array,idx){if(idx>=array.length||idx<0)return array;return array.slice(0,idx).concat(array.slice(idx+1));}// -- #### replaceAt()", "title": "" }, { "docid": "ddb81679c2d5dad844e4d496af075809", "score": "0.6130473", "text": "function remove(arr, index) {\n return arr = (arr.slice(0, index)).concat(arr.slice(index+1));\n // complete this statement\n}", "title": "" }, { "docid": "fb957443a6daf4e44e94d788dbf55e08", "score": "0.61266357", "text": "function shift(array)\r\n{\r\n array.splice(11, 1);\r\n if(buffer[0]==1)\r\n {\r\n buffer[0]=0;\r\n array.splice(0, 0, 1);\r\n }\r\n else\r\n array.splice(0, 0, 0);\r\n}", "title": "" }, { "docid": "473cd486fa487a5728a7deb5bf1f4330", "score": "0.61152345", "text": "function removeVals(arr, start, end) {\n // this one is tough and you can do it a lot of different ways!\n var offset = end - start + 1;\n for (var i = start; i <= offset; i++) {\n arr[i] = arr[i + offset];\n }\n console.log(arr); // check out this console log to see how the array looks\n // now we're going to lop off the same \"offset\" number of values from the end of the array\n arr.length = arr.length - offset;\n return arr;\n}", "title": "" }, { "docid": "6cc4c1723106371d2c1a34bf4ad1f137", "score": "0.61053693", "text": "function reverseArrayInPlace(arr) {\n var finalArr = [];\n var length = arr.length;\n for (var i = 0; i < length; i++) {\n finalArr.push(arr.pop());\n }\n return finalArr;\n}", "title": "" }, { "docid": "924b7ff3f24ba2b0b6357939cfc82c5a", "score": "0.6100704", "text": "function safePush(arr, newState) {\n var copy = arr.slice(0)\n copy.push(newState)\n return copy\n }", "title": "" }, { "docid": "d488db75cf6ad6c5e6ae1012d71e94f5", "score": "0.60943615", "text": "function reverseInPlace(array){\n\tfor(var i = 0; i < Math.floor(array.length/2); i++){\n\t\tvar old = array[i];\n\t\tarray[i] = array[array.length - 1 - i];\n\t\tarray[array.length - 1 - i] = old;\n\t}\n\treturn array;\n}", "title": "" }, { "docid": "39765bde35a5ca513cfd9afbf7fd20f8", "score": "0.6092007", "text": "function reverseArrayInPlace(array){\n let lastIndex = array.length-1;\n \n let temp1;\n \n for(i=0;i<=array.length/2-1; i++){\n temp1=array[lastIndex];\n array[lastIndex]=array[i];\n array[i]=temp1;\n lastIndex--;\n }\n \n }", "title": "" }, { "docid": "37f42118f7de00c5d17de1d92aa07661", "score": "0.608907", "text": "function replaceInArray(arr, pos, val) {\n return [ ...arr.slice(0, pos), val, ...arr.slice(pos+1) ]\n}", "title": "" }, { "docid": "d32f52cd3fd291c615243d6005116379", "score": "0.60877454", "text": "function arrayClone(array) {\n return slice.call(array, 0);\n }", "title": "" }, { "docid": "bc9fe8d16082cdc5a8ad8b8b6d7882a3", "score": "0.60774595", "text": "function reverseArrayInPlace(arr) {\n //Split the array in half\n for (let i = 0; i <= (arr.length / 2); i++) {\n let el = arr[i];\n arr[i] = arr[arr.length - 1 - i];\n arr[arr.length - 1 - i] = el;\n }\n return arr;\n}", "title": "" }, { "docid": "e42bf4459719f3e051adbb4896d74e5a", "score": "0.6075316", "text": "function destructivelyAddElementToBeginningOfArray(array , element)\n{\n //return array.shift(element);\n //return array.unshift(element)\n array.unshift(element)\n return array\n \n}", "title": "" }, { "docid": "a3f6cf3ecaacb05e0e49d7ceaa4221f0", "score": "0.60730445", "text": "function shiftArrayValsLeft(arr) {\n for(let i = 0; i < arr.length; i++) {\n arr[i] = arr[i + 1];\n }\n arr[arr.length-1] = 0;\n console.log(arr);\n}", "title": "" }, { "docid": "cab96a6b37fe1998797ebfc02ba83eb4", "score": "0.60723495", "text": "function ShiftArrayValsLeft(arr) {\n\n}", "title": "" }, { "docid": "cfe5bd2db9f26b9d4297e6d0992b22dd", "score": "0.6060128", "text": "function replace(array, index, value) {\n array = array.slice();\n array[index] = value;\n return array;\n}", "title": "" }, { "docid": "cfe5bd2db9f26b9d4297e6d0992b22dd", "score": "0.6060128", "text": "function replace(array, index, value) {\n array = array.slice();\n array[index] = value;\n return array;\n}", "title": "" }, { "docid": "cfe5bd2db9f26b9d4297e6d0992b22dd", "score": "0.6060128", "text": "function replace(array, index, value) {\n array = array.slice();\n array[index] = value;\n return array;\n}", "title": "" }, { "docid": "5222ea0a8bf3a446a7f4ee6147b333bb", "score": "0.6052777", "text": "function arrayMove(array, i, j) {\r\n\t if (i === j) {\r\n\t return;\r\n\t }\r\n\t var value = array[i];\r\n\t var d = i < j ? 1 : -1;\r\n\t for (var k = i; k !== j; k += d) {\r\n\t array[k] = array[k + d];\r\n\t }\r\n\t array[j] = value;\r\n\t }", "title": "" }, { "docid": "d9d02af055f430cf360862bddee6ab09", "score": "0.6040251", "text": "function removeElementFromEndOfArray(a) {\n var b = a.slice(0, a.length -1);\n return b;\n}", "title": "" }, { "docid": "75a363cff14c2be4ab4fdab450cbab89", "score": "0.60401845", "text": "copy(arr){\n\t\treturn arr.slice();\n\t}", "title": "" }, { "docid": "d379bd2056d64c89fe5d935cf656ad85", "score": "0.60302806", "text": "shift() {\n var result = this._array.shift();\n\n this._deleteArgs.index = 0;\n this._deleteArgs.removed = [result];\n this.notify(this._deleteArgs);\n\n this._notifyLengthChange();\n\n return result;\n }", "title": "" }, { "docid": "84044feaaf7374e97aec5cc8b086edef", "score": "0.6028489", "text": "function arrayRemove(array, from, to) {\n var rest = array.slice((to || from) + 1 || array.length);\n array.length = from < 0 ? array.length + from : from;\n return array.push.apply(array, rest);\n }", "title": "" }, { "docid": "d5bc583b3df996b8a48561dd9a5cb119", "score": "0.6021965", "text": "function updateArray2(array){\n\tvar array = [1,2,3];\n\n\treturn array;\n}", "title": "" }, { "docid": "0bc55699a976072a873e36e22dfa6b04", "score": "0.6021564", "text": "function UnsetArray(array, valueOrIndex){\n var c = -1; // ini the counter\n var output = new Array; // ini output var\n for(var i in array){ \n if (c == -1) {\n c = i;\n } // if its the first time ini the counter to i\n \n if (i != valueOrIndex){ // compare if it's the var to change' \n output[c]=array[i]; //output going to be the table\n c++; // increase the counter\n }\n \n \n }\n return output;\n// it's a copy of the first array but whit a shift'\n}", "title": "" }, { "docid": "e1a278d0040b0203e8557e331b843344", "score": "0.6018318", "text": "function reverseArrayInPlace(array) {\n let length = array.length\n for (let i = 0; i < length / 2; ++i) {\n let temp = array[i]\n array[i] = array[length - i - 1]\n array[length - i - 1] = temp\n }\n}", "title": "" }, { "docid": "38f8fb748d2aed95998f6082f81044f5", "score": "0.6016397", "text": "function ShiftArrayValsLeft(arr) {\n\n for(i=0; i<arr.length; i++){\n // If we are not at the end of the array -> (because at the end there is no following value)\n if(arr[i] != arr.length-1) {\n // set current index to the value of the next index\n arr[i] = arr[i + 1];\n }\n }\n // set the end index of the array to value of 0\n arr[arr.length-1] = 0;\n\n // print to the console\n console.log(arr);\n\n}", "title": "" }, { "docid": "10ef042738d3df1724ffab457b8d2091", "score": "0.601133", "text": "function removeVals(arr,start,end) {\n var temp=end-1;\n arr.splice(start,temp);\n return arr;\n }", "title": "" }, { "docid": "6e8f2bc68d9aa194b898890e5c715746", "score": "0.6006002", "text": "function removeAt(array, idx) {\n if (idx >= array.length || idx < 0) return array;\n return array\n .slice(0, idx)\n .concat(array.slice(idx + 1));\n }", "title": "" }, { "docid": "648e07d86947ef7416db5de50e79826a", "score": "0.5997427", "text": "function iterateArray(arr){\n\n // store the first elements value\n var temp = arr[0];\n \n // create a loop to traverse the array front to back\n for(var i = 0; i < arr.length; i++){\n\n console.log('The index is: ', i);\n console.log('The array value is: ', arr[i]);\n // store the next elements value and store it in our element\n arr[i] = arr[i + 1];\n\n // arr[arr.length - 1] = temp;\n }\n console.log(\"temp: \", temp);\n arr.length = arr.length - 1;\n console.log(arr);\n}", "title": "" }, { "docid": "80624891fc90a8ec5a2cea368be61c73", "score": "0.5995767", "text": "function reverseArrayInPlace(arr){\n return arr.reverse();\n}", "title": "" }, { "docid": "e5acba13a630722bb75d2c6f76ccb5cd", "score": "0.5993361", "text": "shiftItems(index) {\n // shift items to the left by one\n for (let i = index; i < this.length - 1; i++) {\n this.data[i] = this.data[i + 1];\n }\n // last item in the array still exists\n delete this.data[this.length - 1];\n this.length--;\n }", "title": "" }, { "docid": "cbe5fc07713bf622d992978e8760d3bd", "score": "0.59924626", "text": "function reverseArrayInPlace(arr) {\n\tif (arr && arr.length > 0) {\n\t\tvar startInd = 0;\n\t\tvar endInd = arr.length - 1;\n\t\twhile (startInd < endInd) {\n\t\t\tvar el1 = arr[startInd];\n\t\t\tvar el2 = arr[endInd];\n\t\t\tarr[startInd] = el2;\n\t\t\tarr[endInd] = el1;\n\t\t\tstartInd++;\n\t\t\tendInd--;\n\t\t}\n\t\treturn arr;\n\t} else {\n\t\treturn [];\n\t}\n}", "title": "" }, { "docid": "570eb66d6f9149a67f4246ba89c200d5", "score": "0.59913605", "text": "remove(index) { // index = 0\n if (index < 0 || index >= this.length) {\n // arrays don't have negative indexes so you'll get this error if you try\n // likewise, if the index is equal to or greater than the length of the array, you'll get this error\n throw new Error('Invalid index');\n }\n\n memory.copy(this.pointer + index, this.pointer + index + 1, this.length - index - 1);\n /* memory.copy( (2+0), (2+0+1), (3-2-1) )\n memory.copy(2, 3, 0)\n this.set(2, this.get(3))\n this.set(2, delta)\n this.memory[2] = delta\n */\n\n this.length--;\n // this.length = 2\n }", "title": "" }, { "docid": "871d230b1c36e17222914cc131f03990", "score": "0.5987937", "text": "function replaceInNativeArray(array, start, deleteCount, items) {\n arrayContentWillChange(array, start, deleteCount, items.length);\n\n if (items.length <= CHUNK_SIZE) {\n array.splice.apply(array, [start, deleteCount].concat(items));\n } else {\n array.splice(start, deleteCount);\n\n for (var i = 0; i < items.length; i += CHUNK_SIZE) {\n var chunk = items.slice(i, i + CHUNK_SIZE);\n array.splice.apply(array, [start + i, 0].concat(chunk));\n }\n }\n\n arrayContentDidChange(array, start, deleteCount, items.length);\n }", "title": "" }, { "docid": "5c4121b99ae24f9045cef96826f67942", "score": "0.5978097", "text": "function reverseArrayInPlace(array){\n \n for(let i = 0; i < array.length / 2; i++){ \n var tempVar = array[i]\n array[i] = array[array.length - 1 - i]\n array[array.length - 1 - i] = tempVar\n }\n \n return array\n}", "title": "" }, { "docid": "a62002b249973748d1d610e5868c3535", "score": "0.59679824", "text": "function arrayRemove(array, from, to) {\n var rest = array.slice((to || from) + 1 || array.length);\n array.length = from < 0 ? array.length + from : from;\n return array.push.apply(array, rest);\n }", "title": "" }, { "docid": "29859bfc733f4aeac7afef8f5006cf87", "score": "0.5959538", "text": "function arrayReplaceAt(src, pos, newElements) {\n\t return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n\t}", "title": "" }, { "docid": "29859bfc733f4aeac7afef8f5006cf87", "score": "0.5959538", "text": "function arrayReplaceAt(src, pos, newElements) {\n\t return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n\t}", "title": "" }, { "docid": "6b4e714ac598fcfc8029f0ee0f329616", "score": "0.59512126", "text": "function removeElementFromBeginningOfArray(array) {\n arraySliced = array.slice(1);\n return arraySliced;\n}", "title": "" } ]
f3d673742c31308ed6259ce5b125a747
provide data that used to selectDomain in
[ { "docid": "cd908a8650319039db26c14cede81b9e", "score": "0.0", "text": "select(event, dataList) {\n let index = event.target.selectedIndex;\n // console.log('dataList-value', dataList);\n return {\n index: index,\n value: dataList.options[index].name,\n };\n }", "title": "" } ]
[ { "docid": "cfb67d12632e25b0fbfe2f1f5c46613b", "score": "0.6172171", "text": "function getDomainInfo(){\n\tvar url = getURL(\"ConfigEditor\",\"JSON\");\n\tif(globalDeviceType == \"Mobile\"){\n loading('show');\n }\n\tvar InfoType = \"JSON\";\n\tvar query = {\"QUERY\":[{\"user\":globalUserName}]};\n query = JSON.stringify(query);\n\tconsole\n\t$.ajax({\n\t\turl: url,\n\t\tdata : {\n\t\t\t\"action\": \"domaininfo\",\n\t\t\t\"query\": query//\"user=\"+globalUserName,\n\t\t},\n\t\tmethod: 'POST',\n\t\tproccessData: false,\n\t\tasync:false,\n\t\tdataType: 'html',\n\t\tsuccess: function(data) {\n\t\t\tif(globalDeviceType == \"Mobile\"){\n \t\tloading('hide');\n\t\t }\n\t\t\twindow['variable' + dynamicDomain[pageCanvas] ] = \"Auto\"\n\t\t\tdata = $.trim(data);\n\t\t\tvar domainArray = [];\n\t\t\tvar zoneArray = [];\n\t\t\tvar groupArrat = [];\n\t\t\tif(InfoType == \"XML\"){\n\t\t\t\tvar parser = new DOMParser();\n\t\t\t\tvar xmlDoc = parser.parseFromString(data , \"text/xml\" );\n\t\t\t\tvar mainconfig = xmlDoc.getElementsByTagName('MAINCONFIG');\n\t\t\t\tvar domain = xmlDoc.getElementsByTagName('DOMAIN');\n\t\t\t\tvar selVal='<option value=\"\" data-placeholder=\"true\">Resource Domain</option>';\n\t\t\t\tvar startUpDom = mainconfig[0].getAttribute('StartUpDomain');\n\t\t\t\tfor(var a=0; a < domain.length; a++){\n\t if(startUpDom == domain[a].getAttribute('DomainName')){\n \t var sel = 'selected';\n \t }else{\n \t var sel = '';\n \t}\n\t selVal += \"<option \"+sel+\" value='\"+domain[a].getAttribute('DomainName')+\"'>\"+domain[a].getAttribute('DomainName')+\"</option>\";\n \t}\n\t\t\t}else{\n\t\t\t\tvar dat = data.replace(/'/g,'\"');\n var dat2 = $.parseJSON(dat);\n\t\t\t\tvar domain = dat2.MAINCONFIG[0].DOMAIN;\n\t\t\t\tvar startUpDom = dat2.MAINCONFIG[0].StartUpDomain;\n\t\t\t\tfor(var a=0; a < domain.length; a++){\n if(startUpDom == domain[a].DomainName){\n var sel = 'selected';\n }else{\n var sel = '';\n }\n selVal += \"<option \"+sel+\" value='\"+domain[a].DomainName+\"'>\"+domain[a].DomainName+\"</option>\";\n }\n\t\t\t}\n\t\t\tif(globalDeviceType == \"Mobile\"){\n\t\t\t\tif(domain.length <= 1 ){\n\t\t\t\t\t$(\"#resDomChkbox\").hide();\n\t\t\t\t\t$('#resDomSelect').selectmenu('disable');\n\t\t\t\t}\n\t\t\t\t$(\"#resDomSelect\").html(selVal).selectmenu( \"refresh\" );\n\t\t\t\t$(\"#resDomSelect\").parent().css({\"width\":\"100px\"});\n\t\t\t}else{\n\t\t\t\t$(\"#resDomSelect\").html(selVal);\n\t\t\t\tif(domain.length <= 1 ){\n\t\t\t\t\t$(\".squaredTwo\").hide();\n\t\t\t\t\t$('#resDomSelect').attr('disabled',true);\n\t\t\t\t\t$('#resDomSelect').css({\"background\":\"#ccc\"});\n\t\t\t\t\twindow['variable' + dynamicDomain[pageCanvas] ] = $('#resDomSelect').val();\n\t\t\t\t\tdomainFlag = true;\n\t\t\t\t}\n\t\t\t\t$(\"#resDomSelect\").parent().css({\"width\":\"100px\"});\t\t\t\n\t\t\t\t//$(\"#resDomSelect\").attr('disabled', true);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "067c812b13cfcc89d65d983df745df0f", "score": "0.59599996", "text": "function getDomainLinkVariables (context, pageData) {\n const tideSite = context.store.state.tideSite\n const siteId = tideSite.siteId.toString()\n const domains = tideSite.sitesDomainMap\n return { siteId, domains }\n}", "title": "" }, { "docid": "1ddf518e51e06769e5950418f30708aa", "score": "0.58612305", "text": "function getDomains () {\n websitesService.getGoogleDomains().then(function (response) {\n vm.domains.google = response.data;\n vm.seViews[0].domains = response.data;\n vm.seViews[0].selectedDomain = response.data[0];\n });\n websitesService.getYahooDomains().then(function (response) {\n vm.domains.yahoo = response.data;\n vm.seViews[1].domains = response.data;\n vm.seViews[1].selectedDomain = response.data[0];\n });\n websitesService.getBingDomains().then(function (response) {\n vm.domains.bing = response.data;\n vm.seViews[2].domains = response.data;\n vm.seViews[2].selectedDomain = response.data[0];\n });\n websitesService.getYandexDomains().then(function (response) {\n vm.domains.yandex = response.data;\n });\n }", "title": "" }, { "docid": "ca88a3e910579e82a83ebcb19f21a4a7", "score": "0.5743858", "text": "function getDomains() {\n var domains = new Array();\n $(\"#edit-field-domain-access :checked\").each(function(index, obj) {\n domains.push(obj.value);\n });\n setOptions(domains);\n }", "title": "" }, { "docid": "7addcc723ed41520206f1479fd06248d", "score": "0.5741143", "text": "function getSelectedDomain() {\n var dName = document.getElementById(\"domainName\"); \n var selectedDomain = dName.options[dName.selectedIndex].value;\n \n return selectedDomain;\n} // end of \"getSelectedDomain\" function", "title": "" }, { "docid": "b2b1623fd10b45ca47bcd0181ac95500", "score": "0.564918", "text": "async getDetails(domain) {\n dns.setServers([config.dns.main]);\n\n let nservers = await resolve(domain, 'NS');\n let address = await resolve(nservers[0]);\n\n dns.setServers(address);\n\n let details = {\n NS: nservers\n };\n\n try {\n details.A = await resolve(domain, 'A');\n } catch(err) {}\n\n try {\n details.AAAA = await resolve(domain, 'AAAA');\n } catch(err) {}\n\n return details;\n }", "title": "" }, { "docid": "64807c8b76cc660e6d30e5f3a0aef704", "score": "0.56424475", "text": "function gotTheDomainListData2(data) {\n var z = data;\n alert(JSON.stringify(data));\n }", "title": "" }, { "docid": "b300b89919eed1255dbab33691a85d38", "score": "0.5577497", "text": "get domain () {\n\t\treturn this._domain;\n\t}", "title": "" }, { "docid": "0581192e1a43766d8b41f8428567f77c", "score": "0.5541646", "text": "function getData() {\n\t\t\t}", "title": "" }, { "docid": "c09e83e19933c5bde1b5fab0b8ef4458", "score": "0.55295295", "text": "function datasetQuery(query){\r\n\t\tvar select = \"SELECT\";\r\n\t\tvar params = {};\r\n\t\tvar builtConditions = generateConditions(query);\r\n\t\tfor(var paramsk in builtConditions.params){\r\n\t\t\tif (!builtConditions.params.hasOwnProperty(paramsk)) continue;\r\n\t\t\tparams[paramsk]=builtConditions.params[paramsk];\r\n\t\t}\r\n\t\tfor(var i = 0; i < domain.length; i++){\r\n\t\t\tparams[\"domain_value_\" + i] = domain[i];\r\n\t\t\tvar dcond = domainCondition(i);\r\n\t\t\tfor(var paramsk in dcond.params){\r\n\t\t\t\tif (!dcond.params.hasOwnProperty(paramsk)) continue;\r\n\t\t\t\tparams[paramsk]=dcond.params[paramsk];\r\n\t\t\t}\r\n\t\t\tselect += \" \" + fn + \"(CASE WHEN \" + dcond.condition + \" THEN \" + value + \" END) AS \" + domainName + \"_\" + i;\r\n\t\t\tif(i != domain.length-1) select += \",\";\r\n\t\t}\r\n\t\tselect += \" FROM offence\" + (builtConditions.conditions.length?' WHERE ':'') + builtConditions.conditions.join(\" AND \") + \";\"\r\n\t\tconsole.log(select, params);\r\n\t\treturn {select, params};\r\n\t}", "title": "" }, { "docid": "5012a33a22b95205061a801d12bc4c02", "score": "0.55292684", "text": "function getTheSelectData() {\r\n\tvar prod = getTheValueSelect()[0];\r\n\tvar regi = getTheValueSelect()[1];\r\n\treturn getTheData(prod, regi);\r\n}", "title": "" }, { "docid": "af9f5ca822fe11e99e3aaefc00517c5c", "score": "0.5511729", "text": "function showDomainBox(originalRequest) {\n\tla = originalRequest.responseText.evalJSON();\n\ti = 0;\n\toptions = new Array();\n\t// we first clear the select of any options it has at the moment\n\tl = $('domainChoser').options.length;\n\tfor (x = 0; x < l; x++) {\n\t\t$('domainChoser').options[0] = null;\n\t}\n\n\tla.each(function(e) {\n\t\tselected = e[\"id\"];\n\t\toptions.push(new Option(e[\"name\"], e[\"id\"]));\n\t\t$('domainChoser').options[i++] = new Option(e[\"name\"], e[\"id\"]);\n\t});\n\t// $('domainChoser').options = options;\n\tchangeGraph(targetValue);\n}", "title": "" }, { "docid": "518ce5f2c8a675e4b85900b482809b38", "score": "0.5495278", "text": "function getDomainsForResDev() {\n\n\tvar ret = \"\";\n//\tvar cgiUrl = 'https://'+CURRENT_IP+'/cgi-bin/Final/NFast_RM/NFastRMCGI.py?action=getDomain&query=username='+globalUserName;\n\tvar cgiUrl = getURL('RM4')+'action=getDomain&query={\"QUERY\":[{\"username\":\"'+globalUserName+'\"}]}';\n\t$.ajax({\n\t\turl: cgiUrl,\t\n\t\tdataType: 'html',\n\t\tasync: false,\n\t\tsuccess:function(data) {\n\t\t\tdata = data.replace(/'/g,'\"');\n\t\t\tvar json = jQuery.parseJSON(data);\n\n\t\t/*\tvar mydata = data;\n var parser = new DOMParser();\n var xmlDoc;\n xmlDoc = parser.parseFromString( mydata , \"text/xml\" );\n var row = xmlDoc.getElementsByTagName('row');*/\n\t\t\tvar opT='';\n\t\t\tfor(var a =0; a< json.data[0].row.length; a++){\n var domId = json.data[0].row[a].DomainId;\n\t\t\t\tvar domName = json.data[0].row[a].DomainName;\n\t\t\t\topT += '<option value=\"'+domId+'\">'+domName+'</option>';\n\t\t\t}\n\n\t\t\t$('#domainSelect').empty().append(opT);\n\t\t\tif ($('#domainSelect').val() != \"\") {\n\t\t\t\tif (json.data[0].row.length == 1) {\n \t $('#domainSelect').hide();\n \t $('#tdDomain').empty().append(json.data[0].row[0].DomainName);\n \t$('#tdDomain').removeAttr('style');\n \t} else {\n\t $('#tdDomain').empty();\n \t $('#domainSelect').removeAttr('style').attr('style','width:auto;max-width:auto');\n \t }\n\t\t\t}\n\t\t\tvar dom = $('#domainSelect').val();\n\t\t\tgetDeviceAccess(dom);\n\t\t\tgetZoneForResDev();\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "63a3ab4400f12e5095029db588f76c02", "score": "0.54925996", "text": "get domain() {\n this._logger.debug(\"domain[get]\");\n return this._domain;\n }", "title": "" }, { "docid": "a1695c677d651296bc605ae1043d0cac", "score": "0.54854524", "text": "function getdata_setting_rpt(timescale , emailaddress,active)\n\t{\n\t\tdata = {\n\t\t\t'type' : timescale,\n\t\t\t'email' : emailaddress,\n\t\t\t'active' : active\n\t\t};\n\t\t\n\t\treturn data;\n\t}", "title": "" }, { "docid": "b206f903ac334745755b4db18600b0f6", "score": "0.54591733", "text": "function setDomainOpts(){\r\n\tvar split1 = location.href.split('ikariam.');\r\n\tvar split2 = split1[1].split('/');\r\n\tvar ext = split2[0];\r\n\tvar opts = new Array();\r\n\topts['ext'] = ext;\r\n\tif ( ext == 'fr' ){\r\n\t\topts['lvl'] = ' Niveau';\r\n\t\topts['inactives'] = 'Inactifs';\t\r\n\t}\r\n\telse if ( ext == 'de' ){\r\n\t\topts['lvl'] = ' Stufe';\r\n\t\topts['inactives'] = 'Inaktívak';\t\r\n\t}\r\n\telse if ( ext == 'com' ){\r\n\t\topts['lvl'] = ' Level';\t\r\n\t\topts['inactives'] = 'Inaltívak';\r\n\t}\r\n\telse if ( ext == 'es' ){\r\n\t\topts['lvl'] = ' Nivel';\r\n\t\topts['inactives'] = 'Inaktívak';\r\n\t}\r\n\telse if ( ext == 'gr' ){\r\n\t\topts['lvl'] = 'ÎľĎ�ÎŻĎ�ξδο';\r\n\t\topts['inactives'] = 'Inactives';\r\n\t}\r\n\telse if ( ext == 'hu' ){\r\n\t\topts['lvl'] = 'ÎľĎ�ÎŻĎ�ξδο';\r\n\t\topts['inactives'] = 'Inaktívak';\r\n\t}\r\n\telse {\r\n\t\topts['lvl'] = ' Level';\t\r\n\t\topts['inactives'] = 'Inactives';\t\r\n\t}\t\t\r\n\treturn opts;\r\n}", "title": "" }, { "docid": "e0d872464addc400ffe1c2a044e68c17", "score": "0.5430551", "text": "get domainInput() {\n return this._domain;\n }", "title": "" }, { "docid": "376c2d88f2be8c0c9a1e608bbfe7f5da", "score": "0.54293877", "text": "function ProviderData() {}", "title": "" }, { "docid": "93139d5f6fe962777e84e55fcb83c19f", "score": "0.5416941", "text": "function subjectID() {\n\n // Get a reference to the subject ID dropdown\n var dropdown = d3.select(\"#selDataset\");\n\n // Populate the Subject ID dropdown\n d3.json(\"data/samples.json\").then((importedData) => {\n\n var names = importedData.names;\n\n names.forEach((name) => {\n dropdown\n .append(\"option\")\n .text(name)\n .property(\"value\", name);\n });\n\n var initial = names[0];\n charts(initial);\n demographics(initial);\n });\n}", "title": "" }, { "docid": "404f098585eab53dcf4f38606265b019", "score": "0.53962225", "text": "function domainX(x, data) {\n var stations = data.map(row => row.name);\n\n x.domain(stations)\n}", "title": "" }, { "docid": "0be445c50027439b0b66f55ff8d48915", "score": "0.53935033", "text": "function get_domain(procedencia){\n arr = [];\n for(i=1;i<51;i++){\n if (i != selected_id)\n arr.push(splom_data.find(element => element[\"Codigo\"]==procedencia)[i]);\n }\n return d3.extent(arr)\n}", "title": "" }, { "docid": "60a5fddb7e774c21fd1da3743429ce71", "score": "0.53821754", "text": "function GetTarget()\n{\n return GetData(\"person\");\n}", "title": "" }, { "docid": "bd4c147cb091c90009c1ac08dcd751d1", "score": "0.5368709", "text": "function ProviderData() { }", "title": "" }, { "docid": "bd4c147cb091c90009c1ac08dcd751d1", "score": "0.5368709", "text": "function ProviderData() { }", "title": "" }, { "docid": "bd4c147cb091c90009c1ac08dcd751d1", "score": "0.5368709", "text": "function ProviderData() { }", "title": "" }, { "docid": "bd4c147cb091c90009c1ac08dcd751d1", "score": "0.5368709", "text": "function ProviderData() { }", "title": "" }, { "docid": "5ee0406e9170e6614e271d475f26d1dd", "score": "0.53686625", "text": "function getDomain() {\n\t\tvar domain = $('#domain').val();\n\t\t\n\t\tif( !(domain && domain !== \"null\" )) {\n\t\t\tdomain=\"system\";\n\t\t}\n\t\treturn domain;\n\t}", "title": "" }, { "docid": "55ed52ff8b4a45841ed651564761e444", "score": "0.53679997", "text": "function domain_info(domain_id, user_id) {\n var q = {\n id: domain_id,\n guid: null,\n /**\n * Can't delete domains with types. Delete the types first\n */\n \"/type/domain/types\": [],\n /**\n * Are there any /base key(s)? \n * We need to remove these with fb_writeuser.\n */\n \"base:key\": [{\n optional: true,\n namespace: \"/base\",\n value: null\n }],\n /**\n * Can't delete domains with key(s) in namespace(s)\n * that the user does not have permission on (except /base).\n */\n \"other:key\": [{\n optional: true,\n namespace: {\n id: null, \n permission: [{optional:true, permits: [{member: {id: user_id}}]}]\n },\n \"forbid:namespace\": {\n id: \"/base\",\n optional: \"forbidden\"\n },\n value: null\n }],\n /**\n * Can't delete domains that the user does not have permission on\n */\n permission: [{optional:true, permits: [{member: {id: user_id}}]}]\n };\n return freebase.mqlread(q)\n .then(function(env) {\n var r = env.result;\n r.types = r[\"/type/domain/types\"];\n r.has_permission = r.permission.length ? true : false;\n\n r[\"permitted:key\"] = [];\n r[\"not_permitted:key\"] = [];\n\n r[\"other:key\"].forEach(function(k) {\n var key = {\n namespace: k.namespace.id,\n value: k.value\n };\n if (k.namespace.permission.length) {\n r[\"permitted:key\"].push(key);\n }\n else {\n r[\"not_permitted:key\"].push(key);\n }\n });\n return r;\n });\n}", "title": "" }, { "docid": "ae02650cd6718e1159956500f1918151", "score": "0.5333833", "text": "function loadDLProcessDomain() {\n\t\t\tconsole.log(\"loadDLProcessDomain()\");\n\n\t\t\tvm.dlProcess = {};\n\t\t\tvar l = 0;\n\t\t\tfor(var i=0;i<vm.apiDomain.specimens.length; i++) {\n\n\t\t\t\t// continue if no specimenKey\n\t\t\t\tif (vm.apiDomain.specimens[i].specimenKey == \"\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// if check box == true, then append to dlProcess\n\t\t\t\tif (vm.apiDomain.specimens[i].spcheckbox == true) {\n\t\t\t\t\tvar item = {\n \t\t\"specimenKey\": vm.apiDomain.specimens[i].specimenKey,\n \t\t\"specimenLabel\": vm.apiDomain.specimens[i].specimenLabel,\n\t\t\t\t\t\t\"numberOfGenes\": 0,\n\t\t\t\t\t\t\"colorTerm1\": \"\",\n\t\t\t\t\t\t\"assayType1\": \"\",\n\t\t\t\t\t\t\"assayExtraWords1\": \"\",\n\t\t\t\t\t\t\"previewNote\": \"\",\n\t\t\t\t\t\t\"attachGene1\": \"\",\n\t\t\t\t\t\t\"attachExtraWords1\": false,\n\t\t\t\t \"otherGene\": [],\n\t\t\t\t\t\t\"otherText\": []\n\t\t\t\t\t }\n\t\t\t\t\t vm.dlProcess[l] = item;\n\t\t\t\t\t l = l + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9978fbd002615e690ae12ebf4af64a58", "score": "0.53294784", "text": "function populateSelect(x, y, layer) {\n //get the domain value \n var domain;\n switch (layer) {\n case 'support':\n domain = app.supportLayer.getDomain(x);\n break;\n case 'sign':\n domain = app.signLayer.getDomain(x);\n break;\n }\n\n //get the html select by ID \n var select = document.getElementById(y);\n\n //clear the current options in select \n for (var option in select) {\n select.remove(option);\n }\n\n var opt = document.createElement('option');\n opt.innerHTML = \"\";\n select.appendChild(opt);\n //loop through the domain value to fill the drop down \n for (var i = 0; i < domain.codedValues.length; i++) {\n console.log(domain.codedValues[i].name);\n ; var opt = document.createElement('option');\n opt.innerHTML = domain.codedValues[i].name;\n opt.value = domain.codedValues[i].name;\n select.appendChild(opt);\n }\n\n }", "title": "" }, { "docid": "82f0bdd310f4205608366b35df7fddfe", "score": "0.53282124", "text": "function showDomainTable() {\r\n webitel.domainList(function(res) {\r\n if (res.status === 0) {\r\n var domainData = this.parseDataTable();\r\n\r\n var domainDataHeaders = prepareHeadersToDomTable(domainData.headers);\r\n initDomTable(domainDataHeaders);\r\n\r\n var domainDataRow = prepareDataForLoadToDomTable(domainData.headers, domainData.data);\r\n $('#statDomainListTable').bootstrapTable(\"load\", domainDataRow);\r\n\r\n $(\"#stat-domain-lookup-modal\").modal(\"show\");\r\n }\r\n else if (res.status === 1) {\r\n alert.error(null, this.responseText, null);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "9f7384013fdc5d213261a38a1dd3bd65", "score": "0.53229773", "text": "getDataFromBackend() {}", "title": "" }, { "docid": "e33dc9615fcc0487fcb197f8c5b0ef1c", "score": "0.53196853", "text": "function getXDomain(currentChartInfo) {\n// Set the X-Axis Domain \n// Use the currentChartInfo X-Axis data to get Min & Max - Use that to set the domain \n \n // Get the minimum from current X-Axis \n var min = d3.min(currentChartInfo.data, d => d[currentChartInfo.currentX]);\n // Get the maximum from current X-Axis\n var max = d3.max(currentChartInfo.data, d => d[currentChartInfo.currentX]);\n\n // Return the min & max in an array\n return [min*xDomainScale.minConverter, max*xDomainScale.maxConverter];\n}", "title": "" }, { "docid": "86553cc0f52b27d94d87d07fe8fdb660", "score": "0.53165025", "text": "function getChosenDataset () {\n\tvar dataselect = d3.select(\"#dataset\");\n\treturn dataselect.options[select.selectedIndex].value;\n}", "title": "" }, { "docid": "d053bd5b00185218cdff51e895625862", "score": "0.5313179", "text": "function selectData() {\n \n // Use D3 to select the dropdown menu\n var dropdownMenu = d3.select(\"#selDataset\");\n \n // Assign the value selected in the dropdown menu option to a variable\n var selectID = dropdownMenu.property(\"value\");\n \n \n// Set the demographics and run the plots...for the selected subject!\nplotRun(selectID);\n\n// End of event driven process\n\n}", "title": "" }, { "docid": "033e806b0805e2dda322c8ed510c77c6", "score": "0.53002787", "text": "static setDomains(p, ds) {\n for(let i = 0; i < ds.length; ++i)p.variableAt(i).setDomain(ds[i]);\n }", "title": "" }, { "docid": "4e3dd6448c369cb45565ad00b0c4a618", "score": "0.52973455", "text": "_getDefaultData() {}", "title": "" }, { "docid": "b6b8d25e7b42ae347759b782d79eff0f", "score": "0.52943397", "text": "get domainName() {\n return this.getStringAttribute('domain_name');\n }", "title": "" }, { "docid": "b6b8d25e7b42ae347759b782d79eff0f", "score": "0.52943397", "text": "get domainName() {\n return this.getStringAttribute('domain_name');\n }", "title": "" }, { "docid": "7c039abdf2efe68dca2b8544da5eb2f9", "score": "0.52914286", "text": "function handle_requested_domains () {\n if(fundamental_vars.keywords[universalKeyword].length == 1){\n //If name is to big shorten name's presentation to fit on this screen width.\n finalName = single_domain_keyword_length_fix();\n tld = fundamental_vars.keywords[universalKeyword][0];\n\n var target = $('.list [data-tld=\"' + tld + '\"]'),\n singleResult = build_single_domain(target);\n\n //Target tld has a discount.\n if(target.find('.reduced-price').length > 0){\n singleResult.find('.reduced-price').html(target.find('.reduced-price').html());\n singleResult.find('.regular-price').addClass('discount');\n }\n\n //Remove source tld from the list.\n target.remove();\n\n //Show the single specified tld.\n $('.top-targets').removeClass('hide');\n }else{// Many specific domains requested.\n\n //Since the specified tlds are more than one then bring them to the top of the list in the order the user typed them.\n $.each($.upDownTable(fundamental_vars.keywords[universalKeyword]),function(key,value){\n $('.list').prepend($('[data-tld=\"' + value + '\"]'));\n });\n }\n}", "title": "" }, { "docid": "4d003bee9bbe297420e20b6838db3428", "score": "0.5281061", "text": "function addDomain(domain) {\n var key = domain.key;\n if (key && !domainKeys[key]) {\n domainKeys[key] = true;\n columns.push(new DomainColumn(domain, formatter));\n }\n }", "title": "" }, { "docid": "caf89b42039c2715b48be0d2034d9199", "score": "0.528001", "text": "GetThisObjectProperties(domain) {\n let url = `/email/domain/${domain}`;\n return this.client.request('GET', url);\n }", "title": "" }, { "docid": "950d8c4eb763d13755bbc45635140550", "score": "0.52751774", "text": "parseData() {\n return {\n select : this.defaults.select,\n method : this.element.dataset.method || this.defaults.method,\n items : this.element.dataset.items || this.defaults.items\n }\n }", "title": "" }, { "docid": "e7874fe7bf7a2526ba5b1a7f8e6fd2d5", "score": "0.5273665", "text": "getDomain(name) {\n return Domain.get({ name }, this.getLink(\"domains\"));\n }", "title": "" }, { "docid": "15a9d08d693a88a03d12248e9eeba678", "score": "0.5264285", "text": "function build_single_domain (target) {\n var singleResult;\n $('.list .tld-line.inactive').removeClass('inactive');\n $('.singleResult').attr({'data-categories':target.attr('data-categories'),'data-tld':target.attr('data-tld'),'data-flag':target.attr('data-flag'),'data-fqdn':target.attr('data-fqdn'),'data-product':target.attr('data-product')});\n singleResult = $('.singleResult');\n singleResult.find('.name').text(finalName).attr({'data-name':universalKeyword});\n singleResult.find('.tld').text(tld);\n singleResult.find('.regular-price').html(target.find('.regular-price').html());\n\n return singleResult;\n}", "title": "" }, { "docid": "668c5f009bd78997be7cfd3a2394fb22", "score": "0.52321637", "text": "function fetchOptionData(){\n limit = limitData[city];\n pageLimit = pageLimitData[city];\n page_number = pageNumberData[city];\n\n order = orderData[city];\n sortColId = sortColIDData[city];\n sortColNumber = sortColNumberData[city];\n \n}", "title": "" }, { "docid": "5ea784d46b3d2f9aff2568cd66685c05", "score": "0.5228057", "text": "function changeDomains($item) {\n switch ($item.selectedEngine) {\n case 'Google':\n $item.domains = vm.domains.google;\n $item.selectedDomain = vm.domains.google[0];\n break;\n case 'Yahoo':\n $item.domains = vm.domains.yahoo;\n $item.selectedDomain = vm.domains.yahoo[0];\n break;\n case 'Bing':\n $item.domains = vm.domains.bing;\n $item.selectedDomain = vm.domains.bing[0];\n break;\n case 'Yandex':\n $item.domains = vm.domains.yandex;\n $item.selectedDomain = vm.domains.yandex[0];\n break;\n };\n }", "title": "" }, { "docid": "008e956369b14ef8c580c16123de9b4b", "score": "0.52150697", "text": "function setOptions(domains) {\n $(\"#edit-field-domain-source option\").each(function(index, obj) {\n if (jQuery.inArray(obj.value, domains) == -1 && obj.value != '_none') {\n // If the current selection is removed, reset the selection to _none.\n if ($(\"#edit-field-domain-source\").val() == obj.value) {\n $(\"#edit-field-domain-source\").val('_none');\n }\n $(\"#edit-field-domain-source option[value=\" + obj.value + \"]\").hide();\n }\n else {\n $(\"#edit-field-domain-source option[value=\" + obj.value + \"]\").show();\n // If we reselected the initial value, reset the select option.\n if (obj.value == initialOption) {\n $(\"#edit-field-domain-source\").val(obj.value);\n }\n }\n });\n }", "title": "" }, { "docid": "9ec2d11745ec8ef5afd28d7ab19584b1", "score": "0.521092", "text": "function getInfo(){\r\n var result = {};\r\n var usr = isMel()?GetCurrentUserInfo():{FullName:\"Demo Data\",LoginName:\"dData\"};\r\n var pat = isMel()?GetDemographics():{patientKey:\"1000000000000000\"};\r\n var doc = isMel()?GetChartData(GetPatientId(),true).PatientData.chart.documentList[0]:{documentTypeDetail:{description:\"Demo Description\"},documentType:\"Demo Type\",summary:\"Demo Summary\"};\r\n result.docType = doc.documentTypeDetail.description;\r\n result.docTypeID = doc.documentType;//Get the Encounter Type SELECT * FROM ENCTYPE WHERE DOCTYPEID = '1878934079517780'\r\n result.docSum = doc.summary;\r\n result.fullname = usr.FullName;\r\n result.username = usr.LoginName;\r\n result.useremail = usr.LoginName+\"@valleymedicalcenter.com\";\r\n result.pid = pat.patientKey;\r\n return result;\r\n }", "title": "" }, { "docid": "1ad5f32caa96ade3553faba71eb80b7a", "score": "0.52033657", "text": "get domain() {\n var result = 'unknown';\n if (this.sourceInfo_ && this.sourceInfo_.domain)\n result = this.sourceInfo_.domain;\n if (result === 'unknown' && this.parentFrame)\n result = this.parentFrame.domain;\n return result;\n }", "title": "" }, { "docid": "9605484016252e0a1f230316bdb925dd", "score": "0.520012", "text": "function loadSelectionData(){\n\n\tappInit().then ( session => {\n\t\t currentSession = session;\n\t\t //setSessionTimeout();\n\t\t loadADPData();\n\t\t loadAssessors();\n\t\t loadFormTypes();\n\t\t document.querySelector(\"#form_date\").valueAsDate = new Date();\n\t}).catch( err => handleError(err));\n\n}", "title": "" }, { "docid": "efd050f18a1e418aacb6bd8e2341dfcf", "score": "0.5199613", "text": "function change_GNPS_domainName() {\n\n if($scope.result.datasets == null) return;\n\n for(var i = 0; i < $scope.result.datasets.length; i++){\n if($scope.result.datasets[i].title.substr(0,4) == \"GNPS\"){\n $scope.result.datasets[i].source_title = \"GNPS\";\n }\n else{\n $scope.result.datasets[i].source_title = $scope.result.datasets[i].source;\n }\n }\n\n }", "title": "" }, { "docid": "2461cc7e616d97d291544a2cc645c08a", "score": "0.5192127", "text": "function domainData(data) {\n const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://domain-checker7.p.rapidapi.com/api/v2.0/domain\",\n \"method\": \"POST\",\n \"headers\": {\n \"content-type\": \"application/x-www-form-urlencoded\",\n \"x-rapidapi-key\": `${mykey}`,\n \"x-rapidapi-host\": \"domain-checker7.p.rapidapi.com\"\n },\n \"data\": {\n \"domain\": `${data}`\n }\n };\n const newData = $.ajax(settings).done(function (response) {\n return response;\n });\n return newData;\n}", "title": "" }, { "docid": "e8028ad4a46a20a9d8672f5dc53a71c1", "score": "0.51807165", "text": "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "title": "" }, { "docid": "ee9ae0bc9578278a651fe78dc253ff82", "score": "0.5175921", "text": "function domain_name_builder () {\n $('.list .tldResults').each(function(){\n tld = $(this).attr('data-tld');\n $(this).attr({'data-fqdn': universalKeyword + '.' + tld}).find('.name').attr({'data-name':universalKeyword}).text(finalName);\n });\n}", "title": "" }, { "docid": "eea02797489d5115c94a6c5097c80429", "score": "0.5172205", "text": "function loadPropertySelectData() {\n \"use strict\";\n var i;\n //depend on how many select tap.\n for (i = 0; i < getSelectID.length; i++) {\n createP_Option(getSelectID[i]);\n }\n}", "title": "" }, { "docid": "28292f5f9c4b654404908fff7fd430cb", "score": "0.51721555", "text": "function init() {\n \n var selectSubject = d3.select(\"#selDataset\");\n \n d3.json(\"../../Resources/Earthquakes.json\").then((data) => {\n\n var country = data[0].country;\n\n // Get the all countries\n var countryList = data.map(a => a.country);\n // console.log(countryList);\n\n // Get the Unique list\n var uniqueCountryList = Array.from(new Set(countryList));\n // console.log(uniqueCountryList);\n \n // Append the countries to the dropdown\n uniqueCountryList.forEach((subject) => {\n // var country = data.country;\n // console.log(subject.country);\n \n selectSubject.append(\"option\").text(subject);\n });\n\n // call the function to display the data and the plots for default country\n buildPlot(country);\n metadata(country);\n \n })\n }", "title": "" }, { "docid": "e10f5dade427197950561fbe1806ec81", "score": "0.51603127", "text": "function initDataset(data)\n{\n //get data\n let sampleNames = data.names;\n //load data\n sampleNames.forEach((sample) => {\n selector\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n });\n //binding event\n selector.on(\"change\", selectorHandler );\n}", "title": "" }, { "docid": "3929d781867a508d1568a54475069ab7", "score": "0.5156232", "text": "static getLinksDomain(domain){\n return new Promise((resolve,reject) => {\n this.con.query(`SELECT \\`id\\`,\\`from\\`,\\`to\\`,\\`domain\\`,\\`created\\`,\\`status\\`,\\`comment\\` FROM \\`links\\` WHERE \\`domain\\`='${domain}'`, (err,result,fields) => {\n \n if(err){\n throw err;\n } \n resolve(result) \n }) \n }) \n }", "title": "" }, { "docid": "7a8ab083f3a4d24335b7bc811875d498", "score": "0.51401997", "text": "function ppDisplayDomainMenu(itemArray) {\n actualArray = new Array();\n //the list does not include the first two items.\n for (i = 2; i < itemArray.length; i++) {\n actualArray[i-2] = itemArray[i];\n }\n new PopupMenu(\"View By (Domain Selection)\", \"DomainSelection\", actualArray,\n \t\tmouse_x, mouse_y, updateDomainMenu, itemArray[1]);\n}", "title": "" }, { "docid": "ec06d9ffc8b92cd91cf16ea0dea1ec93", "score": "0.5139893", "text": "getData() {\n return {\n \"labelX\": this.labelX,\n \"labelY\": this.labelY,\n \"labelIndex\": this.dropDown.val(), \n \"labelWidth\": Math.abs(this.labelWidth),\n \"labelHeight\": Math.abs(this.labelHeight)\n }\n\n }", "title": "" }, { "docid": "a7e251de19258f5397760acf9405b4f4", "score": "0.5134111", "text": "function readDataFromSelectors() {\n selYear = document.querySelector('input[name=\"yearSelector\"]:checked').value;\n varName = document.getElementById('dataset').value;\n changeMap();\n firstTime = 0;\n if (document.getElementById(\"nationalViewCheckbox\").checked) {\n createUpperCharts(\"ITALIA\", createData(\"ITALIA\"));\n }\n if (!document.getElementById(\"nationalViewCheckbox\").checked) {\n createUpperCharts(selectedRegion, createData(selectedRegion));\n }\n}", "title": "" }, { "docid": "23bac9f9d6d7892b31b2ee690254a426", "score": "0.5132613", "text": "function linkedData (state) {\n return {\n '@context': 'http://schema.org',\n '@type': 'Organization',\n name: title,\n url: state.origin,\n logo: state.origin + '/share.png'\n }\n }", "title": "" }, { "docid": "d81cda3bd75b5312076152f8b6475018", "score": "0.5119221", "text": "function loadObject() {\n\t\t\tconsole.log(\"loadObject()\");\n\n\t\t\tif (vm.results.length == 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (vm.selectedIndex < 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tCloneLibGetAPI.get({ key: vm.results[vm.selectedIndex].sourceKey }, function(data) {\n\t\t\t\tvm.apiDomain = data;\n\t\t\t\tvm.apiDomain.sourceKey = vm.results[vm.selectedIndex].sourceKey;\n\t\t\t\tvm.results[vm.selectedIndex].name = vm.apiDomain.name;\n addAccRow(0);\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: CloneLibGetAPI.get\");\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "4a4dcb14cd5a524144d3780d9e79dba3", "score": "0.5110915", "text": "function setupDomainSelection() {\r\n\r\n\t$(\"#nodeDomain\").off().empty();\r\n\t$(\"#relDomain\").off().empty();\r\n\r\n\tvar html = \"\";\r\n\tvar count = 0;\r\n\tavailNodeDomain.forEach(function(domain) {\r\n\t\tvar labels = getNodeDomainParts(domain);\r\n\t\tcount++;\r\n\t\thtml += \"<strong>Domain \" + count + \", label as: </strong>\";\r\n\t\tlabels.forEach(function(label) {\r\n\t\t\thtml += '<input type=\"radio\" class=\"nodeDomainRadio\" value=\"'+label+'\" name=\"'+domain+'\" id=\"rad'+domain+label+'\" /><label class=\"nodeWord '+domain+' '+label+'\" for=\"rad'+domain+label+'\">'+label+'</label>&nbsp;&nbsp;';\r\n\t\t});\r\n\t\thtml += '<input type=\"radio\" class=\"nodeDomainRadio\" value=\"EXCLUDE\" name=\"'+domain+'\" id=\"rad'+domain+'EXCLUDE\" checked=\"checked\" /><label for=\"rad'+domain+'EXCLUDE\">(Exclude)</label>&nbsp;&nbsp;';\r\n\t\t// TODO: allow user to input a custom label for a given node domain\r\n\t\thtml += \"<br />\\n\";\r\n\t});\r\n\t$(\"#nodeDomain\").append(html);\r\n\r\n\thtml = \"\";\r\n\tcount = 0;\r\n\tavailRelDomain.forEach(function(domain) {\r\n\t\tvar parts = getRelDomainParts(domain);\r\n\t\tcount++;\r\n\t\thtml += \"<strong>\" + count + \": </strong>\";\r\n\t\thtml += '<span id=\"rel'+domain+'\"><input type=\"checkbox\" class=\"relDomainCheckbox\" checked=\"checked\" id=\"chk'+domain+'\" /><label id=\"lbl'+domain+'\" for=\"chk'+domain+'\">'+parts.sourceKey+'-[:'+parts.type+']-&gt;'+parts.targetKey+'</label></span><br />';\r\n\t});\r\n\t$(\"#relDomain\").append(html);\r\n\t\r\n\t$(\".nodeDomainRadio\").on(\"click\", handleDomainSelection);\r\n\t$(\".relDomainCheckbox\").on(\"click\", handleDomainSelection);\r\n\t$(\"#tabs\").tabs(\"refresh\");\r\n\t\r\n\tsetCleanQuery();\r\n\t\r\n\t// set the Nodes tab active\r\n\tif ($(\"#tabs\").tabs(\"option\",\"active\") != 1) {\r\n\t\t$(\"#tabs\").tabs(\"option\", \"active\", 1);\r\n\t}\r\n}", "title": "" }, { "docid": "cf32edd8eef52bf917707d4ca021c9b3", "score": "0.5108876", "text": "getQueryData() {\n return {\n connection: this.client.connectionName,\n inTransaction: this.client.isTransaction,\n model: this.model.name,\n };\n }", "title": "" }, { "docid": "1e6f84b9bdd1cceb5074009de3b35981", "score": "0.51072085", "text": "function getdata()\n{\n //sets up json read\nd3.json(city_url).then(function(data)\n{\n city_data = data[\"data\"]\n //pulls the city name from the dictionary, listed in array of dictionaries at city\n city_data.forEach(city=>cities.push(city.city)); \n //dyanmically obtains the dropdown data from the json pull and inserts it into the dropdown\n var dropdown = d3.select(\"#selDataset\").selectAll(\"select\");\n dropdown.data(cities)\n .enter()\n .append(\"option\")\n .html(function(d)\n {\n return `<option value = \"${d}\">${d}</option>`\n });\n //finds first city in the dropdown\n var currentCity = d3.select(\"#selDataset\").node().value\n //pulls function to display the data\n optionChanged(currentCity)\n });\n\n}", "title": "" }, { "docid": "e899279401751480e37f52c61673b421", "score": "0.5102098", "text": "function init() {\n // Use D3 to select the dropdown menu\n var dropdownMenu = d3.select(\"#selDataset\");\n d3.json(dataSet).then(function(data) {\n var NamesdropDown = data.names;\n // Use forEach to call a function on each element\n NamesdropDown.forEach(function(id) {\n dropdownMenu.append(\"option\").text(id).property(\"value\",id);\n });\n});\nVisuals(\"940\");\nMetadata(\"940\");\n}", "title": "" }, { "docid": "e1f41c924be6c282e3d010f62136a999", "score": "0.510124", "text": "function getDomainChoice(evt) {\n var selectedDomain = getSelectedDomain();\n // var directiveList = document.getElementById(\"cspDirectives\");\n\n if (previousTabId == -1) {\n // Currently selected Tab is \"All\"\n oldDomainValue = selectedDomain;\n\n // remove text from label named \"combinedStrictCSP\" \n setLabelToEmptyString(\"combinedStrictCSP\");\n // remove text from label named \"combinedLooseCSP\"\n setLabelToEmptyString(\"combinedLooseCSP\");\n\n // load website CSP\n if (websiteCSPAll || websiteCSPAll != null) {\n if (websiteCSPAll[selectedDomain]) {\n // dump(\"\\n @@@websiteCSPAll is present for this website=\"+websiteCSPAll[selectedDomain]);\n document.getElementById(\"websiteCompleteCSP\").textContent = websiteCSPAll[selectedDomain];\n } else{ setLabelToEmptyString(\"websiteCompleteCSP\"); }\n }else{ setLabelToEmptyString(\"websiteCompleteCSP\"); }\n\n // load user specified csp\n if (userCSPAll || userCSPAll != null) {\n if (userCSPAll[selectedDomain]) {\n // dump(\"\\n @@@userCSPAll is present for this website=\"+userCSPAll[selectedDomain]);\n document.getElementById(\"userCompleteCSP\").textContent = userCSPAll[selectedDomain];\n }else{ setLabelToEmptyString(\"userCompleteCSP\"); }\n }else{ setLabelToEmptyString(\"userCompleteCSP\"); }\n\n }else {\n // if Currently select tab is not \"All\"\n var userList = document.getElementById(\"rule1UserList\");\n var websiteList = document.getElementById(\"rule1WebsiteList\");\n\n // 1. Store the current directive of previous domain. \n helperToStore(oldDomainValue);\n // dump(\"\\n oldDomainName=\"+oldDomainValue+\" NewDomainName=\"+selectedDomain);\n oldDomainValue = selectedDomain;\n\n\n // 2. Empty userList multi-select drop-down box\n userList.options.length = 0;\n websiteList.options.length = 0;\n\n // 3. Make sure global table entry existis. If not then create it.\n if (!userCSPArray[selectedDomain]) {\n userCSPArray[selectedDomain] = new Array(15);\n\n // make bydefault state to Enable\n userCSPArray[selectedDomain][11] = 1;\n\n // bydefaule disallow inline scripts\n userCSPArray[selectedDomain][12] = false;\n // bydefaule disallow inline eval\n userCSPArray[selectedDomain][14] = false;\n\n // dump(\"\\n new userCSP arrary is created for = \"+selectedDomain);\n } \n // 4. Get the index of selected Directive\n // var index = directiveList.selectedIndex;\n \n // 5. change oldDirective value\n // oldDirectiveValue = directiveList.options[index].value;\n // dump(\"\\n I am in the getdomain choice2\");\n\n // 6. Restore \"rule1UserList\" selected directive contents\n\n if (userCSPArray[selectedDomain][oldDirectiveValue]) { \n // dump(\"\\n value to restore in list = \"+userCSPArray[selectedDomain][oldDirectiveValue]);\n\t restoreDirectiveRules(userCSPArray[selectedDomain][oldDirectiveValue]);\n }\n\n //---------------------------------------------------------------\n // 6.1 Show website CSP rules for selected directive\n if (websiteCSPArray || websiteCSPArray != null) {\n if (websiteCSPArray[selectedDomain]) {\n if (websiteCSPArray[selectedDomain][oldDirectiveValue]) { \n showWebsiteCSPRules(websiteCSPArray[selectedDomain][oldDirectiveValue]); \n }\n }\n }\n\n }\n //---------------------------------------------------------------\n\n // dump(\"\\nI am going in to enable or disable state\");\n // 7. Change user Rule state for domain (Enable/Disable) \n try {\n if (!userCSPArray[selectedDomain][11])\n userCSPArray[selectedDomain][11] = 1;\n }catch (e) { userCSPArray[selectedDomain][11] = 1; }\n\n switch (userCSPArray[selectedDomain][11]) {\n case 1: // website Rules\n document.getElementById(\"selectWebsiteCSPRuleBtn\").checked = true;\n break;\n case 2: // user Rules\n document.getElementById(\"selectUserCSPRuleBtn\").checked = true;\n break;\n case 3: // Combine Strict Rules\n document.getElementById(\"selectCombinedSCSPRuleBtn\").checked = true;\n break;\n case 4: // Combine Loose Rules\n document.getElementById(\"selectCombinedLCSPRuleBtn\").checked = true;\n break;\n default:\n document.getElementById(\"selectWebsiteCSPRuleBtn\").checked = true;\n break;\n } // end of switch\n\n \n // Restore infered Policy for selected domain\n selectedDomain = getSelectedDomain();\n // remove text from label named \"inferredCSP\" \n setLabelToEmptyString(\"inferredCSP\");\n \n if (inferCSPAll[selectedDomain]) {\n document.getElementById(\"inferredCSP\").textContent = inferCSPAll[selectedDomain];\n } else {\n document.getElementById(\"inferredCSP\").textContent = \"\";\n }\n\n\n} // end of getDomainChoice() Function", "title": "" }, { "docid": "4cea554658a57dcde96446b74502708e", "score": "0.5098176", "text": "function readData() {\n\t\t\t\tconsole.log(\"Procesando SELECT...\");\n\t\t\t\t$http.get($queryRuta.urlSixadcClient)\n\t\t\t\t\t.success(function(data){\n\t\t\t\t\t\tconsole.log(\"N° registros de clientes:\", data.sixadcClients.length);\n\t\t\t\t\t\t$scope.clientGeneral = data.sixadcClients;\n\t\t\t\t\t})\n\t\t\t\t\t.error(function(data, status) {\n\t\t\t\t\t\tconsole.log(status);\n\t\t\t\t\t\tresponseData(data);\n\t\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "71b96ac5bae62dc63b7ee4c673fee989", "score": "0.5079846", "text": "opt() {\n return {\n url: this.qs.url,\n view: this.child_view,\n schema: this.schema,\n fields: this.fields,\n enable_multiple_select: true,\n selections: this.selections,\n };\n }", "title": "" }, { "docid": "639a757e0fb83778f46c0b93d41ad48d", "score": "0.50794625", "text": "getData() {\n\n }", "title": "" }, { "docid": "531635e113af45768ec2b66f04fcad2c", "score": "0.5078788", "text": "function handleDomainSelection(e) {\r\n\r\n\t$(\".nodeWord\").css(\"color\", \"\");\r\n\t$(\".relArrow\").css(\"color\", \"\");\r\n\t$(\"#chart\").empty();\r\n\tgraphPlotted = false;\r\n\r\n\t// rebuild selected node domain list\r\n\tnodeDomainLabelMap = {};\r\n\tnodeDomain = [];\r\n\tavailNodeDomain.forEach(function(domain) {\r\n\t\tvar checkedVal = $(\"input[name='\" + domain + \"']:checked\").val();\r\n\t\tif (typeof(checkedVal) != \"undefined\" && checkedVal != \"EXCLUDE\") {\r\n\t\t\tnodeDomainLabelMap[domain] = checkedVal;\r\n\t\t\tnodeDomain.push(domain);\r\n\t\t}\r\n\t});\r\n\r\n\t// rebuild selected relationship domain list\r\n\trelDomain = [];\r\n\tavailRelDomain.forEach(function(domain) {\r\n\t\tvar parts = getRelDomainParts(domain);\r\n\t\t\r\n\t\tif (nodeDomainLabelMap[parts.sourceKey] && nodeDomainLabelMap[parts.targetKey]) {\r\n\t\t\t$(\"#rel\" + domain).removeClass(\"disabled\");\r\n\t\t\t$(\"#lbl\" + domain).html(getRelHtml(nodeDomainLabelMap[parts.sourceKey], nodeDomainLabelMap[parts.targetKey], parts.type, domain));\r\n\t\t\tif ($(\"#chk\" + domain).is(\":checked\")) {\r\n\t\t\t\trelDomain.push(domain);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$(\"#rel\" + domain).addClass(\"disabled\");\r\n\t\t}\r\n\t});\r\n\t\r\n\t// if at least 2 node domains and 1 relationship are selected, then regenerate the plot\r\n\tif (nodeDomain.length > 1 && relDomain.length > 0) {\r\n\t\tvar args = {\r\n\t\t\tcontainerSelector: \"#chart\",\r\n\t\t\tgraph: graph,\r\n\t\t\tnodeDomain: nodeDomain,\r\n\t\t\trelationshipDomain: relDomain,\r\n\t\t\tgetNodeName: generateNodeName,\r\n\t\t\tgetNodeLabel: getNodeLabel\r\n\t\t};\r\n\t\t\r\n\t\tHivePlot.Plotter.draw(args);\r\n\r\n\t\t// color the node and relationship text according to the colors in the plot\r\n\t\tnodeDomain.forEach(function(d) {\r\n\t\t\t$(\".nodeWord.\" + d + \".\" + nodeDomainLabelMap[d]).css(\"color\", HivePlot.Plotter.getNodeColor(d));\r\n\t\t});\r\n\t\t\r\n\t\trelDomain.forEach(function(d) {\r\n\t\t\t$(\".relArrow.\" + d).css(\"color\", HivePlot.Plotter.getRelationshipColor(d));\r\n\t\t});\r\n\t\t\r\n\t\tdefaultInfo = \"Showing \" + formatNumber(HivePlot.Plotter.getRelationshipCount()) + \" links among \" + formatNumber(HivePlot.Plotter.getNodeCount()) + \" nodes.\";\r\n\t\tsetStatus(defaultInfo);\r\n\t\t\r\n\t\tgraphPlotted = true; \r\n\t}\r\n}", "title": "" }, { "docid": "6f901a53ad680caa3d1dc4d3933ee8ae", "score": "0.5074999", "text": "function getFormData () {\n var domains = [];\n if ($ (\"#domain-1-inp\").val ()) {\n domains.push ($ (\"#domain-1-inp\").val ());\n }\n if ($ (\"#domain-2-inp\").val ()) {\n domains.push ($ (\"#domain-2-inp\").val ());\n }\n return {\n active : true,\n name : $ (\"#project-title\").val (),\n css : $ (\"#css-folder\").val (),\n images : $ (\"#images-folder\").val (),\n js : $ (\"#js-folder\").val (),\n fonts : $ (\"#fonts-folder\").val (),\n domains: domains\n };\n }", "title": "" }, { "docid": "0f7eded24279e521452d6b96543f7d56", "score": "0.50749624", "text": "function get_shared_spice_data(api_result) {\n return {\n id: 'whois',\n name: 'Whois',\n meta: {\n sourceName: 'Whois API',\n sourceUrl: 'https://www.whoisxmlapi.com/#whoisserver/WhoisService?domainName='\n + api_result.domainName\n + '&outputFormat=json&target=raw'\n },\n templates: {\n group: 'base',\n options: {\n moreAt: true\n }\n }\n };\n }", "title": "" }, { "docid": "72b2275917c1a4403ef70b852ae6cc56", "score": "0.5073521", "text": "get domain() {\n this._logService.debug(\"gsDiggEvent.domain[get]\");\n return this._domain;\n }", "title": "" }, { "docid": "235319ef49cfb0eae5f61389ac526f8e", "score": "0.50732017", "text": "function buildContext(domain, metadata){\n var emptyDomain = !domain || (domain && domain.length ===0);\n if(emptyDomain || !metadata){\n return [];\n }\n var dataContext = [];\n var len = metadata.length;\n dataContext = domain.map(function(d){\n var ctx = {};\n for(var i = 0; i < len ; i++){\n ctx[metadata[i].id] = d[i];\n }\n return ctx;\n });\n return dataContext;\n }", "title": "" }, { "docid": "d84ff0281438f35f81902e4f3870e7f8", "score": "0.5068524", "text": "function getData(){\n\n var dropdownMenu = d3.select(\"#selDataset\");\n // Assign the value of the dropdown menu option to a variable\n var variableID = dropdownMenu.property(\"value\");\n console.log(variableID);\n // Call function to update the chart\n BuildWithFilter(variableID);\n}", "title": "" }, { "docid": "49b1445293f7df2d040bda27262ace24", "score": "0.5060928", "text": "function get_industry_name(industry_name) {\n\n // select industry name data id in order to add the industry name\n var industry_select = d3.select(\"#industry_name\");\n\n // empty the industry info each time before getting new info so that nothing is added to existing info displayed\n industry_select.html(\"\");\n\n // get the necessary industry key for passing to the dynamic plot\n industry_select.append(\"h4\").text(industry_name.toUpperCase());\n \n}", "title": "" }, { "docid": "083c633b693a3132beed91835dec6e62", "score": "0.50598276", "text": "function init() {\n d3.json(samples).then(function(data) {\n var subjects = data.names;\n console.log(subjects)\n \n subjects.forEach(subject => {\n var option = idSelect.append(\"option\");\n option\n .attr(\"value\", subject)\n .text(subject)\n })\n var initSubject = subjects[0];\n inputDashboard(initSubject)\n }) \n}", "title": "" }, { "docid": "34fff962f893d274ae77a98772934c07", "score": "0.50546855", "text": "function domainEnaDis(src){\n\tif(src.checked == true){\n\t\t$(\"#resDomSelect\").attr('disabled', false);\n\t\twindow['variable' + dynamicDomain[pageCanvas] ] = $('#resDomSelect').val();\t\t\t\n\t\tdomainFlag= true;\n\t}else{\n\t\t$(\"#resDomSelect\").attr('disabled', true);\n\t\twindow['variable' + dynamicDomain[pageCanvas] ] = \"Auto\";\n\t\tdomainFlag= false;\n\t}\n\tloadGridMenuContent();\n}", "title": "" }, { "docid": "fb36601c9122e32a3d9ec1ee85e8d1ff", "score": "0.5050056", "text": "function selectDomain() {\t\n\t$.ajax({\n\t\turl: $('#url').val(),\n\t\ttype: \"GET\",\n\t\tdata: \"theme=\"+ $('#theme').val(),\n\t\tsuccess: function(data) {\n\t\t\t//alert(data);\n\t\t\t$(\"#domain\").attr('disabled', false);\n\t\t\t$(\"#domain\").empty().hide();\n\t\t\t$(\"#domain\").append(data);\n\t\t\t$('#domain').fadeIn(1000);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "c09e751892492d77a9b768041b9c6cc0", "score": "0.50492054", "text": "function setData() {\n\tvar requestSearch = (search == undefined) ? \"\" : \" AND Description CONTAINS IGNORING CASE '\" + search +\"'\";\n\tvar themeRequest = (theme == \"All\") ? \"\" : \" AND Topic = '\" + theme +\"'\";\n\tvar dateRequest = (dateSelection == \"\") ? \"\" : \" AND Date >= '\" + dateSelection + \"'\";\n\tvar dateEndRequest = (dateEnd == \"\") ? \"\" : \" AND Date <= '\" + dateEnd + \"'\";\n\tvar query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + encodeURIComponent(\"SELECT Latitude, Longitude FROM 1019598 WHERE Language='\" + language + \"'\" + requestSearch + themeRequest + dateRequest + dateEndRequest));\n\tquery.send(getData);\n}", "title": "" }, { "docid": "a5deb83d6f1b53a8b21f067570c94ba8", "score": "0.5040182", "text": "async getDataValueProgramIndicators(indicators,periods,ous){ \r\n let url=\"analytics?dimension=dx:\"+indicators+\"&dimension=pe:\"+periods+\"&dimension=ou:\"+ous+\"&displayProperty=NAME\"\r\n return await this.getResourceSelected(url)\r\n \r\n }", "title": "" }, { "docid": "3f7787238ca0945927e65cd95fc52f62", "score": "0.5037876", "text": "function odataSource(options){\n\tthis.url = options.url;\n\tthis.queryName = options.queryName;\n\tthis.useCache = (options.useCache ? 1 : 0);\n\n\tthis.metadata = []; // array of objects representing the characteristics and key figures\n\tthis.parameters = []; // array of objects representing the parameters available on the variable screen\n\n\tthis.loadMetaData = function(){\n\t\t// check and pull from the cache\n\t\tif(this.useCache && _metadata[this.queryName]){\n\t\t\tthis.metadata = _metadata[this.queryName].metadata;\n\t\t\tthis.paramaters = _metadata[this.queryName].paramaters;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar thisObj = this;\n\t\tthisObj.metadataUrl = thisObj.url + thisObj.queryName +\"_SRV/$metadata\";\n\n\t\t$.ajax({\n\t\t\tasync: false,\n\t\t\ttype: \"POST\",\n\t\t\tdata: {url: thisObj.metadataUrl, usecache: thisObj.useCache},\n\t\t\turl: _proxy_url,\n\t\t\tdataType: 'xml',\n\t\t\tsuccess: function (xml){\n\t\t\t var attributes = [\"Name\",\"sap:label\",\"sap:aggregation-role\",\"sap:text\"];\n\n\t\t\t // Find all of the Properties entities from the XML - these are the fields in the data source\n\t\t\t for(var i=0; i<$(xml).find(\"EntityType[sap\\\\:semantics=aggregate]\").find(\"Property\").length; i++){\n\t\t\t\t thisObj.metadata[i] = {};\n\n\t\t\t\t // Extract the XML attributes for each field (name, label, agregation role, etc)\n\t\t\t\t for(var k=0; k<attributes.length; k++){\n\t\t\t\t\t thisObj.metadata[i][attributes[k]] = $(xml).find(\"EntityType[sap\\\\:semantics=aggregate]\").find(\"Property\").eq(i).attr(attributes[k]);\n\t\t\t\t }\n\t\t\t }\n\n\t\t\t // Find all of the parameters from the variable screen\n\t\t\t var validParams = [];\n\t\t\t for(var i=0; i<$(xml).find(\"EntityType[sap\\\\:semantics=parameters] Key PropertyRef\").length; i++){\n\t\t\t\t validParams.push( $(xml).find(\"EntityType[sap\\\\:semantics=parameters] Key PropertyRef\").eq(i).attr(\"Name\"));\n\t\t\t }\n\t\t\t \n\t\t\t for(var i=0; i<$(xml).find(\"EntityType[sap\\\\:semantics=parameters]\").find(\"Property\").length; i++){\n\t\t\t\t var param = {};\n\t\t\t\t \n\t\t\t\t // Extract the XML attributes for each field (name, label, agregation role, etc)\n\t\t\t\t for(var k=0; k<attributes.length; k++){\n\t\t\t\t\t param[attributes[k]] = $(xml).find(\"EntityType[sap\\\\:semantics=parameters]\").find(\"Property\").eq(i).attr(attributes[k]);\n\t\t\t\t }\n\t\t\t\t // If the param is in the list of valid parameters, add it to the object parameter list\n\t\t\t\t if(validParams.indexOf(param.Name) > -1){\n\t\t\t\t\t thisObj.parameters.push(param);\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t if(thisObj.metadata.length == 0){\n\t\t\t\t console.log(\"No metadata found for \"+thisObj.queryName)\n\t\t\t\t console.log(\"Check \"+thisObj.metadataUrl);\n\t\t\t }\n\t\t\t \n\t\t\t // update the cache\n\t\t\t _metadata[this.queryName] = {};\n\t\t\t _metadata[this.queryName].metadata = this.metadata;\n\t\t\t _metadata[this.queryName].parameters = this.parameters;\n\t\t\t},\n\t\t\terror: function(er){\n\t\t\t\tconsole.log(\"Error loading Metadata for \"+thisObj.queryName);\n\t\t\t\tconsole.log(er);\n\t\t\t}\n\t\t});\n\t}\n\t\n\tthis.loadMetaData();\n} // END odataSource Class", "title": "" }, { "docid": "6f9fdd2fcddea3794fbf913ebf9d0e7a", "score": "0.5035253", "text": "function get()\n{\n\tvar ab = ZeT.bean('AuthBean')\n\tvar ds = []\n\n\tDbo.each({ type: 'Domain' }, function(o){ ds.push(o.object) })\n\n\tZeT.resjsonse(ds)\n}", "title": "" }, { "docid": "85dbe65186a92057209f0fd137ed4f70", "score": "0.50286084", "text": "function setTDomain1(modelData, tCol) {\n\n var yearFormat = d3.time.format(\"%Y\");\n var monthFormat = d3.time.format(\"%b\");\n //getting first day\n var dayArr = _.pluck(modelData, tCol);\n var epochArr = _.map(dayArr, function(d) {\n var date = new Date(d);\n return date.getTime();\n });\n \n var min = _.min(epochArr);\n \n var roundMin = new Date(min);\n var minMonth = monthFormat(roundMin);\n var minYear = yearFormat(roundMin);\n var minDate = new Date(minMonth + ' 1,' + minYear);\n\n var max = _.max(epochArr);\n var roundMax = new Date(max);\n var maxMonth = monthFormat(roundMax);\n var maxYear = yearFormat(roundMax);\n var maxDate = new Date(maxMonth + ' 1,' + maxYear);\n var domainArr = [minDate, maxDate];\n var domainArr = [roundMin, roundMax];\n //--\n return domainArr;\n\n}", "title": "" }, { "docid": "33442eb9c3ad6c147abeaa625e54816d", "score": "0.50230265", "text": "function getDomain(measurementScale) {\n\n if (measurementScale === 'dateTime') {\n return [allDomains[0]];\n\n } else if (measurementScale === 'ratio' || measurementScale === 'interval') {\n return [allDomains[2]];\n\n } else if (measurementScale === 'ordinal' || measurementScale === 'nominal') {\n return [allDomains[1], allDomains[3]];\n\n } else if (measurementScale === null || measurementScale === '') {\n return allDomains;\n }\n\n }", "title": "" }, { "docid": "6402c52f685df1fde140dc3c067320dd", "score": "0.502043", "text": "getData() {\n return PRIVATE.get(this).opt.data;\n }", "title": "" }, { "docid": "1e9e0af449211825ca208ecaa42795ca", "score": "0.5018892", "text": "get data () { return this[data]; }", "title": "" }, { "docid": "feddbe276cda29791ea3237189a64e59", "score": "0.5017734", "text": "state() {\n return {\n host,\n diseaseSystems: [],\n diseaseGroups: [],\n phenotypes: [],\n ancestries: [],\n complications: [],\n datasets: [],\n phenotypeMap: {},\n complicationsMap: {},\n datasetMap: {},\n documentation: {},\n user: \"\",\n links: []\n };\n }", "title": "" }, { "docid": "2d4c9655871a74ff2c07d5e4d65d82b8", "score": "0.5012253", "text": "function grabDSInfoEntries() {\n var name = document.getElementById(\"ds-name\").value;\n var description = document.getElementById(\"ds-description\").value;\n var keywordArray = keywordTagify.value;\n var samplesNo = document.getElementById(\"ds-samples-no\").value;\n var subjectsNo = document.getElementById(\"ds-subjects-no\").value;\n\n return {\n name: name,\n description: description,\n keywords: keywordArray,\n \"number of samples\": samplesNo,\n \"number of subjects\": subjectsNo,\n };\n}", "title": "" }, { "docid": "4f2f2ce0e5d7487a08b201646c32bcdf", "score": "0.5010656", "text": "getData() {\n return {\n\n } \n }", "title": "" }, { "docid": "4643b1f4dee768404a985021b357d100", "score": "0.49998048", "text": "function getData() {\n\n let test = '';\n let siteUrl = '';\n let cols = [];\n let expand = '';\n let filter = '';\n let top = '';\n let instrg = 0;\n\n // test if on SharePoint\n try {\n if (typeof _spPageContextInfo !== undefined && _spPageContextInfo.webAbsoluteUrl.indexOf('itim') > 0) {\n siteUrl = _spPageContextInfo.webAbsoluteUrl;\n test = false;\n }\n }\n catch (e) {\n siteUrl = undefined;\n test = true;\n }\n\n function callData(siteUrl, type, title, columns, expand, filter, top) {\n\n let url = \"\",\n endpoint;\n\n if (!test) {\n if (type !== 'web') {\n url = siteUrl + \"/_api/web/lists/GetByTitle('\" + title + \"')/items?$select=\" + columns + \"&$expand=\" + expand + \"&$filter=\" + filter + \"&$top=\" + top;\n }\n else {\n url = siteUrl + \"/_api/web/\" + title;\n }\n endpoint = d3.json(url).header(\"accept\", \"application/json;odata=nometadata\");\n\n }\n else {\n url = instrg == 0 ? \"../SiteAssets/data/\" + title + \".json\" : \"../SiteAssets/data/\" + title + \".js\";\n endpoint = d3.json(url);\n }\n\n return endpoint;\n\n }\n\n for (let i = 0; i < columns.length; i++) {\n cols.push(columns[i].field);\n }\n expand = \"\";\n filter = \"(Value ne 0)\";\n top = 5000;\n\n let componentEndpoint = callData(siteUrl, 'list', 'ISCA', cols.toString(), expand, filter, top);\n\n // Get the data\n componentEndpoint.get(function(error,data) {\n createViz(error, data);\n });\n\n }", "title": "" }, { "docid": "d950b53b3864c63ce269a989d38e71f0", "score": "0.49994743", "text": "_getData() {\n this._data = this._global[this._namespace];\n if (!this._data) {\n this._data = {};\n }\n }", "title": "" }, { "docid": "a44bf70ce6435f1305877a0a83d797fa", "score": "0.49887586", "text": "function getData(nameData) {\n\t \t\n\t\tif(nameData !== null) {\n\t\t\tvar resource = nameData;\n\t\t} else {\n\t\t\t// Get url datas\n\t\t\tvar resource = window.location.href.split('resource=');\n\t\t\tres = resource[1].split('#');\n\t\t\tresource = res[0];\n\t\t}\n\t \tif(resource == \"disponibilite_parking\") {\n\t \tBddLink = '&db=stationnement&table=disponibilite_parking&format=json';\n\n\t } else if (resource == \"population_2008\") {\n\t \tBddLink = '&db=insee&table=population_2008&format=json';\n\n\t } else if (resource == \"archive_fiche\") {\n\t \tBddLink = '&db=archive&table=fiche&format=json';\n\n\t } else if (resource == \"bp_2017_fonction\") {\n\t \tBddLink = '&db=budget&table=bp_2017_fonction&format=json';\n\n\t }\n\n\t ajaxRequest(BddLink, 0, function(data){\n \t\t_drawVisu(data);\n\t\t\t_enablePanel(data.metadata.dataType);\n \t});\n\n \treturn;\n\t}", "title": "" }, { "docid": "1015d3217940aa9cb9a27bcc3360696b", "score": "0.4980033", "text": "function selectDomain(item) {\n item.domainChecking = true;\n item.domainSelected = false;\n $timeout(function () {\n item.domainChecking = false;\n item.domainSelected = true;\n }, 1000);\n }", "title": "" }, { "docid": "ce405b22a2b98fca3431bc49f2470200", "score": "0.49783772", "text": "function newDeviceAvailableDom(){\n\tvar userid = userInformation[0].userId \n\tvar userinfo = userInformation[0].resourceDomain\n\tvar ctr = 0;var str = \"\";\n\tfor(var a =0; a< userinfo.length; a++){\n\t\tvar resource = userinfo[a];\n\t\tif (userinfo[a]==\"Default\"){var ctr =1;}\n\t\tstr += \"<option value='\"+resource+\"'>\"+resource+\"</option>\";\n\t}\n\tvar val = \"\"\n\tif (ctr==0){\n\t\tval += \"<option value='Default'>Default</option>\";\n\t\tval += str\n\t\t$(\"#dropdowndomain\").append(val);\n\t}else{\n\t\t$(\"#dropdowndomain\").append(str);\n\t}\n}", "title": "" }, { "docid": "cdd771834ffaac0fe64423938db6691c", "score": "0.49735516", "text": "function populateDomainContact(domain) {\n var domain_contact = \"\";\n var strDomain = document.forms[0].domain.value.toLowerCase();\n strDomain = (strDomain.replace(/^\\W+/,'')).replace(/\\W+$/,'');\n\t// HIC-635 - allow www.some.dom\n //strDomain = strDomain.replace(/^www\\./,'');\n domain = strDomain;\n\n if(domain) {\n domain_contact = \"root@\" + domain;\n } \n else {\n domain_contact = \"root@ (prepopulates domain once added)\";\n }\n document.forms[0].domain_contact.value = domain_contact;\n}", "title": "" }, { "docid": "473bf320f9b817db11c6089adeb51172", "score": "0.4972635", "text": "get domainIdInput() {\n return this._domainId;\n }", "title": "" }, { "docid": "7638805929dd129e83ab2c1e83e5821d", "score": "0.4957705", "text": "function getUserDataSources(target) {\n\n retrieveData(\"DataSource/User\", function (data) {\n\n jQuery(target).empty();\n jQuery.each(data, function (index, element) {\n\n jQuery(target).append(jQuery(\"<option/>\", { value:element.dataSourceId })\n .text(element.dataSourceName));\n });\n\n // triggers the select event\n jQuery(target).select();\n });\n}", "title": "" } ]
cf6faede4afcdf9e6c6b3b2c1f8b9297
make it look better
[ { "docid": "72a1c2052b1840a1c479a9bd978a7c5e", "score": "0.0", "text": "render(){\n\t\tconst step = this.props.step;\n\t return (\n\t\t\t\t<div \n\t\t\t\tclassName=\"stepIconContainer\"\n\t\t\t\tkey={step.id}\n\t\t\t\t>\n\t\t\t\t<div className=\"stepIconContentContainer\">\n\t\t\t\t\t\t<div className=\"poseIconImgContainer\">\n\t\t\t\t\t\t<img className=\"poseIconImg\"\n\t\t\t\t\t\t\talt={this.pose.english_name}\n\t\t\t\t\t\t\t// className=\"ui image\"\n\t\t\t\t\t\t\tsrc={this.pose.img_url}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t);\n }", "title": "" } ]
[ { "docid": "3172178cfbec041efe960c6f7d9bcd68", "score": "0.5775099", "text": "function strSc(p){stcSc(p,0);stcIt(p.sc[0],0);stcIt(p.sc[1],0);p._sc.style.overflow=\"visible\";p._sc.style.width=\"\";p._sc.style.height=\"\";return 1;}", "title": "" }, { "docid": "1a2c33468f196fe45d21f521d447f865", "score": "0.5772311", "text": "function DebugStyling(){}", "title": "" }, { "docid": "3d418c97de5939f318eb87b98801f947", "score": "0.5685856", "text": "function showTrendHover(){\n trendHover[i].style.display = \"flex\";\n //la condición para el gif en la posición quinta que posee un width diferente\n if((i+1)%5 == 0){\n trendHover[i].style.width = '41.1%';\n };\n }", "title": "" }, { "docid": "6da060c81f7db0045bae16eefc6a1e76", "score": "0.5591254", "text": "function debug_clone_formatter(){\n let debug_height_check = numberParse($(\".debug\").css(\"height\"))\n $(\".booleans:not(:first)\").remove()\n $.map($(\".booleans\").adv_clone({\n items:booleans[debug_counter].length\n }),function(d,i){\n debug_placement = topic.indexOf($(\".topic > h2 \").text())\n $(\".booleans > h2 \").eq(i).text(booleans[topic.indexOf($(\".topic > h2 \").text())][i])\n debug[\"debug object.self\"][2] ? console.log(debug_placement) : \"\"\n debug[\"debug object.self\"][2] ? console.log($(\".booleans > h2 \").eq(i).text(),booleans[i]) : \"\"\n })\n\n var debug_height_check_increase = 2.4 * numberParse($(\".booleans\").css(\"height\")) * $(\".booleans\").length\n\n $(\".debug\").css({\n \"height\": (debug_height_check > debug_height_check_increase ? debug_height_check : debug_height_check_increase),\n \"border-radius\":1.7* numberParse($(\".booleans\").css(\"height\")) * $(\".booleans\").length\n })\n }", "title": "" }, { "docid": "43d3da3f5107fb8f2c53557d59bc4d50", "score": "0.5574163", "text": "function t() {\n //$content.css('paddingTop', $pageMaskee.height());\n y.height(h.height()).width(h.width());\n }", "title": "" }, { "docid": "cef4d084c91d00892a1856126257dd08", "score": "0.5567121", "text": "function setNameLookHTML() {\n let HTML = \"<div><strong>Names:</strong> \";\n for (let i = 0; i < vm.classData[vm.class].names.length; i++) { HTML += vm.classData[vm.class].names[i] + (i === vm.classData[vm.class].names.length - 1 ? \" \" : \", \"); }\n HTML += \"<br /><strong>Eyes:</strong> \";\n for (let i = 0; i < vm.classData[vm.class].look.eyes.length; i++) { HTML += vm.classData[vm.class].look.eyes[i] + (i === vm.classData[vm.class].look.eyes.length - 1 ? \" \" : \", \"); }\n HTML += \"<br /><strong>Face:</strong> \";\n for (let i = 0; i < vm.classData[vm.class].look.face.length; i++) { HTML += vm.classData[vm.class].look.face[i] + (i === vm.classData[vm.class].look.face.length - 1 ? \" \" : \", \"); }\n HTML += \"<br /><strong>Body:</strong> \";\n for (let i = 0; i < vm.classData[vm.class].look.body.length; i++) { HTML += vm.classData[vm.class].look.body[i] + (i === vm.classData[vm.class].look.body.length - 1 ? \" \" : \", \"); }\n HTML += \"<br /><strong>Wear:</strong> \";\n for (let i = 0; i < vm.classData[vm.class].look.wear.length; i++) { HTML += vm.classData[vm.class].look.wear[i] + (i === vm.classData[vm.class].look.wear.length - 1 ? \" \" : \", \"); }\n HTML += \"<br /><strong>Skin:</strong> \";\n for (let i = 0; i < vm.classData[vm.class].look.skin.length; i++) { HTML += vm.classData[vm.class].look.skin[i] + (i === vm.classData[vm.class].look.skin.length - 1 ? \" \" : \", \"); }\n HTML += \"</div>\";\n return HTML;\n }", "title": "" }, { "docid": "e233653fab935a267081ad8c480627d2", "score": "0.5496036", "text": "function DebugStyling() { }", "title": "" }, { "docid": "d16c2f86e9dc04f5fe88c556b40beb70", "score": "0.5490882", "text": "function DebugStyling() {}", "title": "" }, { "docid": "ba70d2c6303a112f9c17804d98fc2eab", "score": "0.5447405", "text": "function IpadicFormatter() {\n}", "title": "" }, { "docid": "0e87652385e781386ceb2ded9b8b94fa", "score": "0.53591174", "text": "function fl_outToModern_btn ()\n\t\t{\n\t\t\t\tif(freez == \"false\"){// מבטיח שהמאוס אאוט יעבוד רק שהפריז בפולס\n\t\t\t\tconsole.log(\"hit\")\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.of.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\tthis.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "title": "" }, { "docid": "45ddb0f3e9fa6cb926f1c81e24c4f5d3", "score": "0.5355568", "text": "function upLeft(pHeight, pColorEven, pColorOdd, pSymbol){\nvar rLine =\"\";\nfor (i=1;i<=pHeight;i++){\nrLine +=\"<p>\";\n\nfor (x=1;x<=pHeight-i;x++) {\n\n rLine +=\"<span class='space'>\" + pSymbol +\"</span>\";\n}\n\nfor(j=x;j<=pHeight;j++){\n\n\nif (j%2) \nrLine +=\"<span style='color:\" + pColorEven + \";'>\" + pSymbol +\"</span>\";\nelse\nrLine +=\"<span style='color:\" + pColorOdd + \";'>\" + pSymbol +\"</span>\";\n\n}\nrLine +=\"</p>\";\n\n}\n\ndocument.getElementById(\"upLeft\").innerHTML = rLine;\n}", "title": "" }, { "docid": "503f4abb97761e7f114946230b35501b", "score": "0.53472984", "text": "function returnStyle(val) {\n\t\tif (val < 0.3) {\n\t\t\treturn 'blank';\n\t\t} else if (val < 0.6) {\n\t\t\treturn 'grid';\n\t\t} else {\n\t\t\treturn 'sliced';\n\t\t}\n\t}", "title": "" }, { "docid": "f16c05bb2c37e5ed95579a36b842ed78", "score": "0.53339666", "text": "function fixClefPlacement(el) {\n KeyVoice.fixClef(el);\n //if (el.el_type === 'clef') {\n//\t\t\t\tvar min = -2;\n//\t\t\t\tvar max = 5;\n//\t\t\t\tswitch(el.type) {\n//\t\t\t\t\tcase 'treble+8':\n//\t\t\t\t\tcase 'treble-8':\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'bass':\n//\t\t\t\t\tcase 'bass+8':\n//\t\t\t\t\tcase 'bass-8':\n//\t\t\t\t\t\tel.verticalPos = 20 + el.verticalPos; min += 6; max += 6;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'tenor':\n//\t\t\t\t\tcase 'tenor+8':\n//\t\t\t\t\tcase 'tenor-8':\n//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n////\t\t\t\t\t\tel.verticalPos+=2; min += 6; max += 6;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'alto':\n//\t\t\t\t\tcase 'alto+8':\n//\t\t\t\t\tcase 'alto-8':\n//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n////\t\t\t\t\t\tel.verticalPos-=2; min += 4; max += 4;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t}\n//\t\t\t\tif (el.verticalPos < min) {\n//\t\t\t\t\twhile (el.verticalPos < min)\n//\t\t\t\t\t\tel.verticalPos += 7;\n//\t\t\t\t} else if (el.verticalPos > max) {\n//\t\t\t\t\twhile (el.verticalPos > max)\n//\t\t\t\t\t\tel.verticalPos -= 7;\n//\t\t\t\t}\n //}\n }", "title": "" }, { "docid": "2809d0f70728a62c0a5b95bee75b57be", "score": "0.53146684", "text": "function stbValign() {\n\t\t\t$(\".split-text-block.fullWidth .valign\").each(function(){\n\t\t\t\tvar height = $(this).outerHeight();\n\t\t\t\tvar margin = height / 2;\n\t\t\t\tvar rightHeight = $(this).parent('.right').siblings('.left').children('img').height();\n\t\t\t\tif (height > rightHeight) {\n\t\t\t\t\t// $(this).css({\"position\": \"relative\", \"margin-top\": \"inherit\", \"top\": \"inherit\", \"left\":\"inherit\", \"right\":\"inherit\", \"padding-bottom\":\"6rem\"});\n\t\t\t\t\t$(this).parent('.right').siblings('.left').height(height);\n\t\t\t\t} else {\n\t\t\t\t\t$(this).parent('.right').height(rightHeight).css('position','relative');\n\t\t\t\t\t$(this).css({\"position\": \"absolute\", \"margin-top\": \"-\"+margin+\"px\", \"top\": \"50%\", \"left\":\"0\", \"right\":\"0\", \"padding-bottom\":\"0\"});\n\t\t\t\t}\n\t\t\t\tif ($(window).width() < '868') {\n\t\t\t\t\t$(this).attr('style', '');\n\t\t\t\t\t$(this).parent('.right').siblings('.left').attr('style', '');\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "dd4dcb277b2bcfde9c01ebde738f1dbb", "score": "0.5293946", "text": "function applyChanges () {\n var ostring = '', o;\n for ( var key in options ) {\n o = options [ key ];\n ostring +=\n o.fname +\n \"(\" +\n u ( o, 'current' ) +\n \") \"\n ;\n }\n img.style [ cssPropName ] = ostring;\n\n ostring = '', o = null;\n for ( let key in options ) {\n o = options [ key ];\n if ( o.dflt == o.current ) continue;\n ostring +=\n \"<span class='func'>\" + o.fname + \"</span>\" +\n \"<span class='char'>(</span>\" +\n \"<span class='num'>\" + o.current + \"</span>\" +\n \"<span class='unit'>\" + o.unit + \"</span>\" +\n \"<span class='char'>)</span>\" +\n \" \"\n ;\n }\n ostring = ostring.trim ();\n ostring = ostring ? ostring : \"<span class='unit'>none</span>\";\n ostring += \"<span class='char'>;</span>\";\n css.innerHTML =\n \"<span class='prop'>\" + cssPropName + \"</span>\" +\n \"<span class='char'>: </span>\" +\n ostring\n ;\n }", "title": "" }, { "docid": "04cd71f1d9feff8a5452ca4bcc0ea888", "score": "0.5290856", "text": "function scale(){\n\t\t\tif(win.width() > min && win.width() < max){\n\t\t\t\t\teq = ((win.width() / min) / inc) + bas;\n\t\t\t\t\t$(tag).css({\n\t\t\t\t\t\t'font-size' : eq+'px',\n\t\t\t\t\t\t'line-height' : eq * 1.5+'px',\n\t\t\t\t\t\t'letter-spacing' : (max / max) + ((win.width() / max) /100),\n\t\t\t\t\t\t'margin-bottom' : eq / 2+'px'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t }", "title": "" }, { "docid": "ff2347e3de8fc32930519bec7249348f", "score": "0.5279063", "text": "majHTML(){\r\n this.$element.css(\"left\",this.positionX);\r\n this.$element.css(\"top\",this.positionY);\r\n }", "title": "" }, { "docid": "2ec9c873bc80b48e192046f874a7b448", "score": "0.52602893", "text": "function forceTextOverprinting(lHead) {\r\n // Comm'd out Mar'21. I suspect that this was necessary for an earlier version of Illy\r\n // but it no longer seems necessary. If this holds, I can remove altogether...\r\n // lHead.blendingMode = BlendModes.MULTIPLY;\r\n}", "title": "" }, { "docid": "7d349769bdf598408b128e7ae4d61357", "score": "0.5246956", "text": "function doExtendedInfo() {\n var hdl = find('.player-extended h1'),\n text = hdl.textContent, l = text.length, f, s = 1,\n oW = window.innerWidth, rect;\n if (l) {\n f = Math.ceil(100 / l);\n hdl.style.fontSize = (f * s) + 'vw';\n\n for (var i = 0; i < 20; i++) {\n rect = hdl.getBoundingClientRect();\n hdl.style.fontSize = (f * s) + 'vw';\n s += 0.1;\n if (Math.floor(rect.width) > oW) {\n hdl.style.fontSize = (f * (s - 0.3)) + 'vw';\n break;\n }\n }\n hdl.style.lineHeight = (f * (s - 0.3)) + 'vw';\n }\n }", "title": "" }, { "docid": "468207663014ec0b2cf36756f2fb2a1d", "score": "0.5240841", "text": "function fixClefPlacement(el) {\n\t\t\tparseKeyVoice.fixClef(el);\n\t\t\t//if (el.el_type === 'clef') {\n\t\t\t//\t\t\t\tvar min = -2;\n\t\t\t//\t\t\t\tvar max = 5;\n\t\t\t//\t\t\t\tswitch(el.type) {\n\t\t\t//\t\t\t\t\tcase 'treble+8':\n\t\t\t//\t\t\t\t\tcase 'treble-8':\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t\tcase 'bass':\n\t\t\t//\t\t\t\t\tcase 'bass+8':\n\t\t\t//\t\t\t\t\tcase 'bass-8':\n\t\t\t//\t\t\t\t\t\tel.verticalPos = 20 + el.verticalPos; min += 6; max += 6;\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t\tcase 'tenor':\n\t\t\t//\t\t\t\t\tcase 'tenor+8':\n\t\t\t//\t\t\t\t\tcase 'tenor-8':\n\t\t\t//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n\t\t\t////\t\t\t\t\t\tel.verticalPos+=2; min += 6; max += 6;\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t\tcase 'alto':\n\t\t\t//\t\t\t\t\tcase 'alto+8':\n\t\t\t//\t\t\t\t\tcase 'alto-8':\n\t\t\t//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n\t\t\t////\t\t\t\t\t\tel.verticalPos-=2; min += 4; max += 4;\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t}\n\t\t\t//\t\t\t\tif (el.verticalPos < min) {\n\t\t\t//\t\t\t\t\twhile (el.verticalPos < min)\n\t\t\t//\t\t\t\t\t\tel.verticalPos += 7;\n\t\t\t//\t\t\t\t} else if (el.verticalPos > max) {\n\t\t\t//\t\t\t\t\twhile (el.verticalPos > max)\n\t\t\t//\t\t\t\t\t\tel.verticalPos -= 7;\n\t\t\t//\t\t\t\t}\n\t\t\t//}\n\t\t}", "title": "" }, { "docid": "167f285912d8ad92c682b82ff701643f", "score": "0.522711", "text": "function upRight(pHeight, pColorEven, pColorOdd, pSymbol){\nvar rLine =\"\";\nfor (i=0;i<pHeight;i++){\nrLine +=\"<p>\";\n\nfor(j=0;j<=i;j++){\n\n\nif (j%2) \nrLine +=\"<span style='color:\" + pColorEven + \";'>\" + pSymbol +\"</span>\";\nelse\nrLine +=\"<span style='color:\" + pColorOdd + \";'>\" + pSymbol +\"</span>\";\n\n}\nrLine +=\"</p>\";\n\n}\n\ndocument.getElementById(\"upRight\").innerHTML = rLine;\n}", "title": "" }, { "docid": "0c044c1ba19b266b097aaa14af944dc2", "score": "0.5215061", "text": "function change_font_size(){\n if(display_arr.length>8 || (display_arr[0].toString().length + display_arr.length)>9){\n $('.display').css('font-size', '2vh')\n }if(display_arr.length>14 || (display_arr[0].toString().length + display_arr.length)>15){\n $('.display').css('font-size', '1.5vh')\n }if(display_arr.length>18 || (display_arr[0].toString().length + display_arr.length)>19){\n $('.display').css('font-size', '1vh')\n }\n}", "title": "" }, { "docid": "dde92e20db14537d65270cf9a0c74d46", "score": "0.5200133", "text": "function fl_outToTu_btn ()\n\t\t{\n\t\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t this.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "0ee96fc6ee7cf691314545c8cb41d06f", "score": "0.5195898", "text": "function fl_outToLevivot ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "20826aa6d2568997fa1b9c0ba7deb677", "score": "0.51958376", "text": "function updateSample1(textpara,fontfamily,textsize,bold,italic,weight) {\n var f = getText(textpara,fontfamily,textsize,bold,italic,weight)\n if(f.textWidth >=45)\n {\n $(\"#textToolTooWide\").show();\n }\n else {\n $(\"#textToolTooWide\").hide();\n }\n newlayer.clearBeforeDraw(true);\n newlayer.clearCache();\n gridHiddenTextGroup.destroy();\n newlayer.draw();\n var q = gridSize;\n var g = applyDeselRatio(q);\n var d = Math.ceil(stage.width() / g);\n var p = Math.ceil(stage.height() / q);\n var o = Math.max(0, Math.floor((f.width - d) / 2));\n var m = Math.max(0, Math.floor((f.height - p) / 2));\n var j = Math.min(f.width, 1 + Math.ceil((f.width + d) / 2));\n var h = Math.min(f.height, 1 + Math.ceil((f.height + p) / 2));\n var b = Math.floor(stage.width() / 2 - g * f.width / 2);\n var a = Math.floor(stage.height() / 2 - q * f.height / 2);\n\n for (var l = m; l < h; l++) {\n var k = (false && (l & 1)) ? Math.round(g / 2) : 0;\n for (var n = o; n < j; n++) {\n var e = (l * f.width + n) * 4;\n var fillStyle = f.data[e + 3] == 255 ? \"#000000\" : \"#ffffff\";\n var complexText = new Konva.Text({\n x: b + n * g + k,\n y: a + l * q,\n text: 'X',\n fill: fillStyle,\n align: 'center',\n });\n gridHiddenTextGroup.add(complexText);\n }\n }\n newlayer.add(gridHiddenTextGroup);\n gridHiddenTextGroup.draw();\n stage.batchDraw();\n }", "title": "" }, { "docid": "b8dd4fa029a4fbf00dfd920eae1421e7", "score": "0.51940274", "text": "function fl_outToHazeret ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "title": "" }, { "docid": "e7a2532584d46a4b4242badf6804ff58", "score": "0.5193414", "text": "function fixClefPlacement(el) {\n\t\t\t//if (el.el_type === 'clef') {\n\t\t\t\tvar min = -2;\n\t\t\t\tvar max = 5;\n\t\t\t\tswitch(el.type) {\n\t\t\t\t\tcase 'treble+8':\n\t\t\t\t\tcase 'treble-8':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bass':\n\t\t\t\t\tcase 'bass+8':\n\t\t\t\t\tcase 'bass-8':\n\t\t\t\t\t\tel.verticalPos = 20 + el.verticalPos; min += 6; max += 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'tenor':\n\t\t\t\t\tcase 'tenor+8':\n\t\t\t\t\tcase 'tenor-8':\n\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n//\t\t\t\t\t\tel.verticalPos+=2; min += 6; max += 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'alto':\n\t\t\t\t\tcase 'alto+8':\n\t\t\t\t\tcase 'alto-8':\n\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n//\t\t\t\t\t\tel.verticalPos-=2; min += 4; max += 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (el.verticalPos < min) {\n\t\t\t\t\twhile (el.verticalPos < min)\n\t\t\t\t\t\tel.verticalPos += 7;\n\t\t\t\t} else if (el.verticalPos > max) {\n\t\t\t\t\twhile (el.verticalPos > max)\n\t\t\t\t\t\tel.verticalPos -= 7;\n\t\t\t\t}\n\t\t\t//}\n\t\t}", "title": "" }, { "docid": "018d63aad40ed5bd2c907551dfc46e40", "score": "0.51887196", "text": "function drawRescaledItems(ctx) {\n if (showVisualCues && isPlayerAlive()) {\n drawMapBorders(ctx);\n if(1 == isGrazing) {\n drawGrazingLines_old(ctx);\n } else {\n drawGrazingLines(ctx);\n }\n if(cobbler.drawTail){\n drawTrailTail(ctx);\n }\n\n\n drawSplitGuide(ctx, getSelectedBlob());\n drawMiniMap();\n }\n }", "title": "" }, { "docid": "d4771d7d338bbde114ef3a74659e6241", "score": "0.51878834", "text": "updateUI() {\n this.scoreText.setText(`Score ${this.bumperPoint}`);\n\n const emojis = [];\n for (let i = 0; i < this.healthPoint; i++) {\n emojis.push('❤');\n }\n let healthHearts = emojis.join().replace(/\\,/g, ' ');\n this.healthText.setText(`Health ${healthHearts}`);\n }", "title": "" }, { "docid": "7a571490dc7faa2f2645e714de2664f6", "score": "0.5184081", "text": "function renderBestScores() {\n if (gBestScoreEasy) elTopScores[0].innerText = gBestScoreEasy + ' sec';\n if (gBestScoreMedium) elTopScores[1].innerText = gBestScoreMedium + ' sec';\n if (gBestScoreHard) elTopScores[2].innerText = gBestScoreHard + ' sec';\n}", "title": "" }, { "docid": "1c25b3e9bebdb7d50f1bbaa8f184e081", "score": "0.5181155", "text": "function i(){function e(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}var t,n={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},i=document.body,r=document.createTextNode(\"\"),o=document.createElement(\"SPAN\"),a=function(e,t,n){window.attachEvent?e.attachEvent(\"on\"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent(\"on\"+t,n)},l=function(a){var s,l;a?/^[a-zA-Z \\.,\\\\\\/\\|0-9]$/.test(a)||(a=\".\"):a=\"\",void 0!==r.textContent?r.textContent=t.value+a:r.data=t.value+a,o.style.fontSize=e(t).fontSize,o.style.fontFamily=e(t).fontFamily,o.style.whiteSpace=\"pre\",i.appendChild(o),s=o.clientWidth+2,i.removeChild(o),t.style.height=n.minHeight+\"px\",n.minWidth>s?t.style.width=n.minWidth+\"px\":s>n.maxWidth?t.style.width=n.maxWidth+\"px\":t.style.width=s+\"px\",l=t.scrollHeight?t.scrollHeight-1:0,n.minHeight>l?t.style.height=n.minHeight+\"px\":n.maxHeight<l?(t.style.height=n.maxHeight+\"px\",t.style.overflowY=\"visible\"):t.style.height=l+\"px\"},c=function(){window.setTimeout(l,0)},u=function(e){if(e&&e.minHeight)if(\"inherit\"==e.minHeight)n.minHeight=t.clientHeight;else{var i=parseInt(e.minHeight);isNaN(i)||(n.minHeight=i)}if(e&&e.maxHeight)if(\"inherit\"==e.maxHeight)n.maxHeight=t.clientHeight;else{var a=parseInt(e.maxHeight);isNaN(a)||(n.maxHeight=a)}if(e&&e.minWidth)if(\"inherit\"==e.minWidth)n.minWidth=t.clientWidth;else{var s=parseInt(e.minWidth);isNaN(s)||(n.minWidth=s)}if(e&&e.maxWidth)if(\"inherit\"==e.maxWidth)n.maxWidth=t.clientWidth;else{var l=parseInt(e.maxWidth);isNaN(l)||(n.maxWidth=l)}o.firstChild||(o.className=\"autoResize\",o.style.display=\"inline-block\",o.appendChild(r))},d=function(e,i,r){t=e,u(i),\"TEXTAREA\"==t.nodeName&&(t.style.resize=\"none\",t.style.overflowY=\"\",t.style.height=n.minHeight+\"px\",t.style.minWidth=n.minWidth+\"px\",t.style.maxWidth=n.maxWidth+\"px\",t.style.overflowY=\"hidden\"),r&&(a(t,\"change\",l),a(t,\"cut\",c),a(t,\"paste\",c),a(t,\"drop\",c),a(t,\"keydown\",c),a(t,\"focus\",l)),l()};return{init:function(e,t,n){d(e,t,n)},unObserve:function(){s(t,\"change\",l),s(t,\"cut\",c),s(t,\"paste\",c),s(t,\"drop\",c),s(t,\"keydown\",c),s(t,\"focus\",l)},resize:l}}", "title": "" }, { "docid": "dcf7dcaa1e04331f59a675f0e20f6220", "score": "0.51721734", "text": "function displayScore(ctx) {\n\n //Deffault font : size 40px Arial bold\n var fontSize = \"40px Arial bold\";\n\n // If the font gets more than 100 shrink the font for 5px\n // So the score will be more visible\n var cfg = 1.36;\n if(g_socre_paddle2 >= 10) {\n cfg += 0.05; //Move the score of p2 to the left\n } \n // Shrink to 30px \n if (g_socre_paddle2 >= 100) {\n fontSize = \"30px Arial bold\";\n } \n // Shrink the size to 28px, hope none will play more than 9999\n if(g_socre_paddle2 >= 1000) {\n fontSize = \"28px Arial bold\";\n }\n ctx.font = fontSize;\n ctx.fillText(\"p1:\" + g_socre_paddle1 , 0, g_canvas.height/12);\n ctx.fillText(\"p2:\" + g_socre_paddle2, g_canvas.width/cfg, g_canvas.height/12);\n}", "title": "" }, { "docid": "1b0f614e4dcb4a36484943b4a825c8bf", "score": "0.51657724", "text": "function LolWut()\n{\n\t//Change fill and outline colours\n\tsimpleText.setFill((getRandomColour()));\n\tsimpleText.setStroke((getRandomColour()));\n//stage.draw();\n\t//Redraw text\n\tsimpleText.draw();\n}", "title": "" }, { "docid": "aa0f1b74b36843edcd0a2c28746e7ccb", "score": "0.5157682", "text": "function fl_outToShavuot_btn ()\n\t\t{\n\t\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=0.4\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "3ae18a90e492a5228ae90f0deff0c8cb", "score": "0.51552093", "text": "function update_text() {\r\n textSize(32)\r\n text(\"Score : \" + score, 0, 40); \r\n }", "title": "" }, { "docid": "720ae2bc78c459750f9d7b6b4c76a92b", "score": "0.51454455", "text": "function fl_outToBeiza ()\n\t\t{\n\t\t\tif (freez=='false'){\n\t\t console.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\t\t }\n\t\t\n\t\t}", "title": "" }, { "docid": "465f09d6d4f3c759d7e06ed501d56105", "score": "0.5138252", "text": "function fl_outToRosh_ha_shana_btn ()\n\t\t{\n\t\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.sufgania.alpha=1\t\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t\t\tthis.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "title": "" }, { "docid": "f84e7bd90b160d1a7158ff29484cfc0f", "score": "0.51364905", "text": "function fl_outToMishloah ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "ecf5ca417e70c43695197e3ae838c012", "score": "0.5133499", "text": "onShowLessFormat () {\n if (!this.pvc.formatter) return\n this.pvc.formatter.doLess()\n }", "title": "" }, { "docid": "525203dc697319becbce6e21077cadd5", "score": "0.5121604", "text": "function OLover2HTMLshow(quo){\r\r\n var so=OLoverHTML,s2=(OLover2HTML||'null').toString(),q=(quo||0);\r\r\n overlib(OLhtmlspecialchars(s2,q), CAPTION,'<div align=\"center\">OLover2HTML</div>', EXCLUSIVEOVERRIDE, STICKY, EXCLUSIVE,\r\r\n BGCLASS,'', BORDER,1, BGCOLOR,'#666666', BASE,0, CGCLASS,'', CAPTIONFONTCLASS,'', CLOSEFONTCLASS,'', CAPTIONPADDING,6,\r\r\n CGCOLOR,'#aaaaaa', CAPTIONSIZE,'12px', CAPCOLOR,'#ffffff', CLOSESIZE,'11px', CLOSECOLOR,'#ffffff', FGCLASS,'',\r\r\n TEXTFONTCLASS,'', TEXTPADDING,6, FGCOLOR,'#eeeeee', TEXTSIZE,'12px', TEXTCOLOR,'#000000', MIDX,0, RELY,5, WRAP,\r\r\n (OLfilterPI)?-FILTER:DONOTHING, (OLshadowPI)?-SHADOW:DONOTHING);\r\r\n OLoverHTML=so;\r\r\n}", "title": "" }, { "docid": "7ac7217b00aa050d31c39245fb273e5f", "score": "0.51170033", "text": "function ondea(){\n /* REFIERE AL TÍTULO */ \n var titulo = document.querySelector(\"h1\"); \n /* CAPTURA EL CONTENIDO DEL TÍTULO */\n var texto = titulo.innerHTML; \n /* MIDE EL TAMAÑO DEL TÍTULO */\n var ancho = 700; \n var alto = 120; \n\n /*SIEMPRE AJUSTA EL ancho COMO MÚLTIPLO DE anchoFaja EN PIXELES*/\n ancho = ancho+(anchoFaja-ancho%anchoFaja); \n /* FIJA EL TAMAÑO DEL TÍTULO */\n titulo.style.width = ancho+\"px\"; \n titulo.style.height = alto+\"px\"; \n\n /* LA CANTIDAD DE BANDAS ES EL ANCHO DE TÍTULO SOBRE ANCHO DE CLIP */\n var totalFajas = ancho/1.4; \n\n /* VACÍA EL TÍTULO CONTENEDOR DE TEXTO */\n titulo.innerHTML = \"\"; \n\n /* CREA LAS BANDAS Y LES DA FORMATO */\n for(i=0; i<totalFajas; i++) {\n /* UN DIV PARA CADA FAJA */\n faja = document.createElement(\"div\"); \n // $(\"div\").addClass( \"fulljit\" );\n /* LE ASIGNA LA MISMA ALTURA DEL TÍTULO */\n faja.style.height = alto+\"px\"; \n faja.style.width = ancho+\"px;\"\n /* PONE EL MISMO TEXTO ORIGINAL */\n faja.innerHTML = texto; \n /* DEJA VISIBLE UN CLIP DE 2px DE ANCHO, CADA UNO 2px A LA IZQUIERDA DEL ANTERIOR PARA QUE PAREZCA UNA IMAGEN DE TÍTULO COMPLETA SIN CORTES */\n faja.style.clip = \"rect(0, \"+((i+1)*anchoFaja)+\"px, \"+alto+\"px, \"+(i*anchoFaja)+\"px)\"; \n /* RETRASA LA ANIMACIÓN CSS DE CADA FAJA SIGUIENDO UNA ONDA DE TIEMPO SENOIDE */\n faja.style.animationDelay = (Math.cos(i)+i*anchoOnda)+\"ms\"; \n /* AGREGA LA CAPA AL CONTENEDOR */\n titulo.appendChild(faja);\n }\n}", "title": "" }, { "docid": "42295e50c9113fd24fed56f023030eff", "score": "0.5108932", "text": "function Paper_format_other(){\n\n}", "title": "" }, { "docid": "f5031d3b0083cfb50469f8755f27bd82", "score": "0.5102733", "text": "function changerStyle(){\n\tparagraphe.style.color = 'white';\n\tparagraphe.style.backgroundColor = 'black';\n\tparagraphe.style.border = '10px dashed red';\n\tparagraphe.style.padding = '5px';\n}", "title": "" }, { "docid": "81b935af5035ae700a4b467135cbd60d", "score": "0.5097008", "text": "function th(a){this.u=a;this.ma=null;this.Ce=new uh(a,!0,!0);this.af=new uh(a,!1,!0);this.pe=u(\"rect\",{height:kh,width:kh,style:\"fill: #fff\"},null);vh(this.pe,a.be)}", "title": "" }, { "docid": "7ea6cfc3fae667972f4afff8f9d83c4e", "score": "0.5092793", "text": "function convertir(){\n \n \t\n \n\t\tvar countHijos = $('.content-list').children().length - 1; //21\n\t\tvar entran = countHijos / columna; // 3\n\t\tvar entran = parseInt(entran); // 3\n\t\tvar aumentar = ((entran + 1) * columna)-countHijos;\n\t\tvar func = (aumentar / columna)*100;\n\n\t\tif(columna == 1){\n\t\t\t$('.content-list .liunico').css('display', 'none');\n\t\t}else{\n\t\t\t$('.content-list .liunico').css(\"width\", func +\"%\");\n\t\t\tif(countHijos % columna == 0){\n\t\t\t\t$('.content-list .liunico').css('display', 'none');\n\t\t\t}else{\n\t\t\t\t$('.content-list .liunico').css('display', 'block')\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "d0e4eaa60419644ebd8f1201be46ce57", "score": "0.5091223", "text": "function fl_outToSelek ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "e2bd3b50cee5358adb616bf7eaa04b34", "score": "0.5087246", "text": "function _createCoverReplacement(container, width, height) {\n\t\t\t$(container).append('<span style=\"line-height: '+height+'px; color: '+options.metaColor+';\">&hellip;</span>');\n\t\t}", "title": "" }, { "docid": "35bd6671d458073e80ac7ed876e3a616", "score": "0.5080043", "text": "function fl_outToPesach_btn ()\n\t\t{\n\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t\tthis.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "1ed5b6a650ce8b8288a2edec78eb5848", "score": "0.50784767", "text": "getTooltipText(){\n\t\t\n\t\tconst isConsumable = this.isConsumable(),\n\t\t\tisBreakable = ~this.slots.indexOf(Asset.Slots.upperBody) || ~this.slots.indexOf(Asset.Slots.lowerBody)\n\t\t;\n\t\tlet html = '';\n\t\t// Usable items shows the action tooltip instead\n\t\tif( isConsumable && !this.iuad )\n\t\t\treturn this.use_action.getTooltipText(true, this.rarity);\n\n\t\tlet apCost = this.equipped ? Game.UNEQUIP_COST : Game.EQUIP_COST;\n\n\n\t\thtml += '<strong class=\"'+(Asset.RarityNames[this.rarity])+'\">'+esc(this.name)+'</strong><br />';\n\t\t// Low level indicator (only affects upper/lowerbody since they're the only ones that give protection\n\t\tif( \n\t\t\tthis.isLowLevel() && \n\t\t\t(this.slots.includes(Asset.Slots.upperBody) || this.slots.includes(Asset.Slots.lowerBody)) \n\t\t){\n\n\t\t\tif( this.durability )\n\t\t\t\thtml += '<em style=\"color:#FAA\">Low level, armor reduced</em><br />';\n\t\t\telse\n\t\t\t\thtml += '<em style=\"color:#FAA\">Broken!</em><br />';\n\n\t\t}\n\t\t\n\t\thtml += '<em class=\"sub\">';\n\t\tif( game.battle_active && this.parent )\n\t\t\thtml += '[<span style=\"color:'+(this.parent.ap >= apCost ? '#DFD' : '#FDD')+'\">'+\n\t\t\t\tapCost+' AP to '+(this.equipped ? 'take off' : 'equip')+\n\t\t\t'</span>]<br />';\n\n\t\tif( this.equippable() ){\n\n\t\t\tlet lv = this.getLevel() || 0;\n\t\t\tif( lv < 0 )\n\t\t\t\tlv = game.getAveragePlayerLevel()+Math.abs(lv)-1;\n\t\t\t\n\t\t\thtml += 'Lv '+lv+' | ';\n\t\t\t\n\t\t\tif( this.isDamageable() )\n\t\t\t\thtml += (+this.durability)+'/'+this.getMaxDurability()+' Durability | ';\n\n\t\t}\n\t\thtml += this.getWeightReadable()+' ';\n\t\tif( this.equippable() ){\n\t\t\thtml += '| ';\n\t\t\tif(this.slots.length && !this.equipped)\n\t\t\t\thtml+= '<strong>'+this.slots.map(el => el.toUpperCase()).join(' + ')+'</strong>';\n\t\t\telse if(this.slots.length)\n\t\t\t\thtml+= 'Equipped <strong>'+this.slots.map(el => el.toUpperCase()).join(' + ')+'</strong>';\n\t\t}\n\t\thtml += '</em><br />';\n\n\t\t\n\t\t// Special tags:\n\t\t/*\n\t\t\t%TOD - Approximate time of day\n\t\t*/\n\t\tlet aDesc = this.description\n\t\t\t.split('%TOD').join(game.getApproxTimeOfDay())\n\t\t;\n\t\t\n\t\thtml += esc(aDesc);\n\n\t\thtml += '<div class=\"assetWrappers\">';\n\t\tfor( let wrapper of this.wrappers ){\n\n\t\t\tif( wrapper.description ){\n\t\t\t\t\n\t\t\t\tlet color = '#FAA';\n\t\t\t\tif( wrapper.rarity > 0 )\n\t\t\t\t\tcolor = Asset.RarityColors[wrapper.rarity];\n\t\t\t\tlet desc = wrapper.description;\n\n\t\t\t\thtml += '<br /><span style=\"color:'+color+'\">'+esc(desc)+'</span>';\n\n\t\t\t}\n\t\t}\n\t\thtml += '</div>';\n\n\t\treturn html;\n\t}", "title": "" }, { "docid": "2161e5f5a8560816df2da854741d87d7", "score": "0.5076324", "text": "function textSize(size) {\r\n\tif(size == 13) \r\n\t{\r\n\t\tjQuery(\"#13\").css({\"cursor\" : \"default\",\"color\" : \"#AAAAAA\"});\r\n\t\tjQuery(\"#14\").css({\"cursor\" : \"pointer\",\"color\" : \"#333333\"});\r\n\t\t\t\t\tjQuery(document).ready(function() {\r\n \t \t\t\t\tjQuery(\"#storyTxt > p, #storyTxt > p > a\").css({\"font-size\" : \"13px\"});\r\n\t\t\t\t\tjQuery(\"#storyTxt > table > caption, #storyTxt > table > tbody > tr > td, #rltdTxt > span , #rltdTxt > span > a, #rltdTxt > div , #rltdTxt > div > a, #authInfo > p,#authInfo > a,#authInfo > span\").css({\"font-size\" : \"11px\"});\r\n \t\t\t\t\t});\r\n\t\tjQuery(\"td.stryPicCptn,li.liSideBarNoBlt,li.liSideBarNoBlt > a,li.liSideBar,li.liSideBar > a\").css({\"font-size\" : \"11px\"}) \r\n\t\tjQuery(\"#rltdBlueHd,#pullquote,h4.sbHdr\").css({\"font-size\" : \"12px\"});\r\n\t\tjQuery(\"#storyTxt,#sdbrTop,#sdbrTopimg\").css({\"font-size\" : \"13px\"});\r\n\t\tjQuery(\"td.pullquotetext,span.txtHeader\").css({\"font-size\" : \"14px\"});\r\n\t}\r\n\tif(size == 14) \r\n\t{\r\n\t\tjQuery(\"#13\").css({\"cursor\" : \"pointer\",\"color\" : \"#333333\"});\r\n\t\tjQuery(\"#14\").css({\"cursor\" : \"default\",\"color\" : \"#AAAAAA\"});\r\n\t\t\t\t\tjQuery(document).ready(function() {\r\n \t\t\t\t\tjQuery(\"#storyTxt > p, #storyTxt > p > a\").css({\"font-size\" : \"14px\"});\r\n\t\t\t\t\tjQuery(\"#storyTxt > table > caption, #storyTxt > table > tbody > tr > td, #rltdTxt > span , #rltdTxt > span > a, #rltdTxt > div , #rltdTxt > div > a, #authInfo > p,#authInfo > a,#authInfo > span\").css({\"font-size\" : \"12px\"});\r\n\t \t\t\t\t});\r\n\t\tjQuery(\"td.stryPicCptn,li.liSideBarNoBlt,li.liSideBarNoBlt > a,li.liSideBar,li.liSideBar > a\").css({\"font-size\" : \"12px\"})\r\n\t\tjQuery(\"#rltdBlueHd,#pullquote,h4.sbHdr\").css({\"font-size\" : \"13px\"});\r\n\t\tjQuery(\"#storyTxt,#sdbrTop,#sdbrTopimg\").css({\"font-size\" : \"14px\"});\r\n\t\tjQuery(\"td.pullquotetext,span.txtHeader\").css({\"font-size\" : \"15px\"});\r\n\t}\t\t\t\t\t\t\t\t \r\n}", "title": "" }, { "docid": "31c27b944c496dafe28f54ca19eb1fc9", "score": "0.5074463", "text": "function updateCssSnip(container, hex, r, g, b) {\r\n\t$(container).html(getRgbCss(r, g, b) + '<br />' + getHexCss(hex));\r\n}", "title": "" }, { "docid": "e29a6cbd6d62ecfc60a89f2c2d8ff969", "score": "0.50671035", "text": "function fl_outToTamar ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "a5ec82e677abf9697db62034d1bb78c6", "score": "0.50618285", "text": "renderPersistentObjects() {\n\t\t// Draw derivation descriptions\n\t\t//font-family: 'Space Mono', monospace;\n\t\tlet ctx = this.shadowCtx;\n\n\t\tctx.font = 'bold 15pt Space Mono, Monaco, Consolas';\n\t\tctx.fillStyle = '#000000';\n\t\tctx.textAlign = 'right';\n\n\t\t// Draw titles of the derivations (I-III, aVL, aVR, aVL, V1-V6)\n\t\tfor(let col = 0; col <= 1; col++) {\n\t\t\tfor(let row = 0; row <= 5; row++) {\n\t\t\t\tctx.fillText(\n\t\t\t\t\tthis.state().ecgDisplay.derivationNames[6*col + row],\n\t\t\t\t\tthis.variables.col[col] - 5,\n\t\t\t\t\tthis.variables.row[row] + this.variables.derivation.hHalf\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "988158e6516cc267cd2f042498ff3c28", "score": "0.5060015", "text": "function formatScaleTable() {\n var v_scaleTable = document.querySelector('table'); // the table used to display the data\n var v_row_ctr;\n var v_col_ctr;\n var v_tabrow;\n var v_tabcell;\n\n for (v_row_ctr = 0; v_row_ctr < v_scaleTable.rows.length; v_row_ctr++) {\n v_tabrow = v_scaleTable.rows[v_row_ctr];\n for (v_col_ctr = 0; v_col_ctr < v_tabrow.cells.length; v_col_ctr++) {\n v_tabcell = v_tabrow.cells[v_col_ctr];\n console.log(\"710 [\" + v_row_ctr + \"] [\" + v_col_ctr + \"] [\" + v_tabcell.textContent + \"]\");\n switch (v_row_ctr) {\n case 0:\n v_tabcell.classList.add(\"majorScaleHead\");\n break;\n case 1:\n if (v_col_ctr == 0) {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#C55\";\n }\n else if (v_col_ctr == 1) {\n v_tabcell.classList.add(\"scaleTabText2\");\n v_tabcell.style.background = \"#D66\";\n }\n else {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#E77\";\n }\n break;\n case 2:\n if (v_col_ctr == 0) {\n v_tabcell.classList.add(\"scaleTabText2\");\n v_tabcell.style.background = \"#D66\";\n }\n else {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#E77\";\n }\n break;\n case 3:\n if (v_col_ctr == 0) {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#CC5\";\n }\n else if (v_col_ctr == 1) {\n v_tabcell.classList.add(\"scaleTabText2\");\n v_tabcell.style.background = \"#DD6\";\n }\n else {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#EE7\";\n }\n break;\n case 4:\n if (v_col_ctr == 0) {\n v_tabcell.classList.add(\"scaleTabText2\");\n v_tabcell.style.background = \"#DD6\";\n }\n else {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#EE7\";\n }\n break;\n case 5:\n v_tabcell.classList.add(\"majorScaleHead\");\n break;\n case 6:\n if (v_col_ctr == 0) {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#5B5\";\n }\n else if (v_col_ctr == 1) {\n v_tabcell.classList.add(\"scaleTabText2\");\n v_tabcell.style.background = \"#6C6\";\n }\n else {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#7D7\";\n }\n break;\n case 7:\n if (v_col_ctr == 0) {\n v_tabcell.classList.add(\"scaleTabText2\");\n v_tabcell.style.background = \"#6C6\";\n }\n else {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#7D7\";\n }\n break;\n case 8:\n if (v_col_ctr == 0) {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#C95\";\n }\n else if (v_col_ctr == 1) {\n v_tabcell.classList.add(\"scaleTabText2\");\n v_tabcell.style.background = \"#DA6\";\n }\n else {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#EB7\";\n }\n break;\n case 9:\n if (v_col_ctr == 0) {\n v_tabcell.classList.add(\"scaleTabText2\");\n v_tabcell.style.background = \"#DA6\";\n }\n else {\n v_tabcell.classList.add(\"scaleTabText1\");\n v_tabcell.style.background = \"#EB7\";\n }\n break;\n default:\n console.log(\"doh\");\n }\n }\n }\n}", "title": "" }, { "docid": "6a6cbc1a2a673daf32cfe126693cc51c", "score": "0.5059089", "text": "drawTutPopShrimpEaten() {\n const sqWidth = this.tileSize * 4;\n const sqHeight = this.tileSize * 1;\n this.buffer.drawImage(this.squareImg,\n this.worldWidth/2 - sqWidth/2,\n this.worldHeight/2 - sqHeight/2 - 3,\n sqWidth,\n sqHeight);\n this.buffer.font = \"10px Mali\";\n this.buffer.textAlign = \"center\";\n this.buffer.fillStyle = \"white\";\n this.buffer.fillText(window.currentLanguage[\"tutshrimpeaten1\"],\n this.worldWidth/2,\n this.worldHeight/2 - 15);\n this.buffer.fillText(window.currentLanguage[\"tutshrimpeaten2\"],\n this.worldWidth/2,\n this.worldHeight/2);\n this.buffer.fillText(window.currentLanguage[\"tutshrimpeaten3\"],\n this.worldWidth/2,\n this.worldHeight/2 + 15);\n }", "title": "" }, { "docid": "0cc38cb286fc48f37c838ed75204e9b9", "score": "0.5055195", "text": "function fl_outToGvina ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "title": "" }, { "docid": "50ed50d8d90927c8bd1843aea84afd07", "score": "0.5046883", "text": "function display_opt(){\n var i;\n for(i = 0;i < 4;i++){\n ctx.font = '16px arial';\n ctx.textAlign = 'left';\n ctx.fillStyle = txtcolor;\n ctx.fillText(mainF.OPC[i],txtpos[0]+block_s,txtpos[1]+8+i*block_s);\n }\n}", "title": "" }, { "docid": "88985fa4424dea0bd7c588d794cfe56b", "score": "0.50452745", "text": "function ai_player_style(ai_box_value){\r\n ai_box_value.innerHTML=ai_player_sign\r\n ai_box_value.style=\"text-shadow: 0 0 10px rgb(0, 153, 255) ,0 0 20px rgb(0, 153, 255),0 0 120px rgb(0, 153, 255);font-size: 9rem; transition-delay: .3s;\"\r\n count_clicks++\r\n}", "title": "" }, { "docid": "08cd093c2e74c321591f48e34f74eee6", "score": "0.5044761", "text": "function actualitza ()\r\n{\r\n this.capa.innerHTML = this.actual + this.putCursor ('black');\r\n}", "title": "" }, { "docid": "0a162f5ac196eb2e13267e005635b350", "score": "0.5040063", "text": "render(pretty) {\n this.canvas.reRender(pretty);\n }", "title": "" }, { "docid": "812b5a8ccc46ef0abd9d5aaedc9a1ef7", "score": "0.5038009", "text": "function updateScreen(){\t//funcio (bucle) que s'executa per actualitzar l'estat de la pantalla del joc\n\tcuttingSegments();\t//mira si hi ha segments que es creuin\n\tdrawAll();\t\t\t//dibuixa al canvas\n\tupdateState();\t\t//reescriu el nivell i el % completat\n}", "title": "" }, { "docid": "1a1ce046bfc6f653513df025e03706a9", "score": "0.5037481", "text": "function fl_outToRimon ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\n\t\t}}", "title": "" }, { "docid": "46231da68e808c765a121a7742b19606", "score": "0.50287867", "text": "SetBestTime(t, emphasize) {\n if (t) {\n g(\"bestTimeUI\").innerHTML = \"\" + t;\n g(\"bestTimeUI\").style.backgroundColor =\n emphasize ? \"darkgreen\" : \"transparent\";\n g(\"bestUI\").style.display = \"inline\"; // is a span, so inline \n } else {\n ui.Hide(\"bestUI\");\n }\n }", "title": "" }, { "docid": "444803092029b1fa11226cc397be049c", "score": "0.5022374", "text": "function fl_outToBible_btn ()\n\t\t{\n\t\t\t if(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\t }\n\t\t\n\t\t}", "title": "" }, { "docid": "bea0f4bed3d4ddf97dd0620b25fd1be3", "score": "0.5022223", "text": "updateExploreText(){\n console.log(this.isTome);\n if(this.board.isTome){\n return;\n }\n var text = \"\";\n if(this.board.game.gameData.gameMode == \"DOTS\"){\n text = \"path score: \" + this.hexesInPath.length + \" + \" + this.additionalHexes.size;\n\n }else{\n var loopModText = \"\";\n if(this.isLoop){\n if(this.hexesInPath.length>3){\n loopModText = \"+3\";\n }else{\n loopModText = \"+1\";\n }\n }\n var communityText = \"\";\n\n for(var i = 0; i<this.getNumDifferentInLoop(); i++){\n communityText+= \"+5\"\n }\n text = \"path score: \" + this.hexesInPath.length + loopModText + communityText;\n }\n\n this.board.exploreScoreText.setText(text);\n\n }", "title": "" }, { "docid": "571365ee6f35cf216925dbf2504988a1", "score": "0.50213677", "text": "function skryjvse(){\n\tfor(i = 1; i <= 16; i++){\n\t\tmark.get(\"Mark\"+i).setVisible(false);\t\n\t\tmark.get(\"Mark\"+i).setActive(false);\n\t\tmark.get(\"Mark\"+i).setAttached(false);\n\t\t \n\t\tmark.get(\"Start\"+i).setVisible(false);\t\n\t\tmark.get(\"Start\"+i).setActive(false);\n\t\tmark.get(\"Start\"+i).setAttached(false);\n\t\t \n\t\tpreference.get(\"Aim\"+i).setVisible(false);\n\t\tpreference.get(\"Aim\"+i).setActive(false);\n\t\tpreference.get(\"Aim\"+i).setAttached(false);\n\t}\n}", "title": "" }, { "docid": "8c12d96fa1228373b83658c4faf6890b", "score": "0.5014165", "text": "function lifeLine() {\n let rightMargin = 30;\n for (let i = lives; i > 0; i--) {\n ctx.font = \"30px Arial\";\n ctx.fillStyle = \"red\";\n ctx.fillText(\"♥\", canvas.width - rightMargin, canvas.height - 30);\n rightMargin = rightMargin + 30;\n }\n }", "title": "" }, { "docid": "b9174f9061fbd854a1a3afd68f4a336f", "score": "0.50123423", "text": "function HeightSystem(me, they) {\n var a;\n if (me.Height > they.Height) {\n if (me.Height * 0.95 < they.Height) {\n a = \"Your opponent is almost as tall as you.\";\n } else if (me.Height * 0.9 < they.Height) {\n a = \"You are a head taller than your opponent.\";\n } else if (me.Height * 0.8 < they.Height) {\n a = \"You are taller than your opponent.\"\n } else if (me.Height * 0.7 < they.Height) {\n a = \"You are taller than your opponent.\"\n } else if (me.Height * 0.6 < they.Height) {\n a = \"You are taller than your opponent.\"\n } else if (me.Height * 0.5 < they.Height) {\n a = \"You are taller than your opponent.\"\n } else if (me.Height * 0.4 < they.Height) {\n a = \"Your opponent is short enough for their head to be almost be in level with your groin, how convenient.\";\n } else if (me.Height * 0.3 < they.Height) {\n a = \"Looking down at your opponent you see that they are almost tall enough to reach your groin.\";\n } else if (me.Height * 0.2 < they.Height) {\n a = \"Looking down at your opponent you see that they are just tall enough to reach over your knees.\";\n } else if (me.Height * 0.1 < they.Height) {\n a = \"Your opponent is so short, that they can't reach over your knees!\";\n } else {\n a = \"Your opponent is so small than you could hold them in one hand.\"\n }\n } else if (me.Height == they.Height) {\n a = \"You and your opponent exact same height! What are the odds?\"\n } else {\n if (they.Height * 0.95 < me.Height) {\n a = \"You are almost as tall as your opponent.\"\n } else if (they.Height * 0.9 < me.Height) {\n a = \"You are a head shorter than your opponent.\"\n } else {\n a = \"Your opponent is taller than you.\"\n }\n }\n return a;\n }", "title": "" }, { "docid": "3b52517fba591ef66da6fc916312b97f", "score": "0.5008501", "text": "render() {\n let output =\n this.getHelperWordsBefore() +\n \" \" +\n this.renderForms()\n .map((i) => `<b>${i}</b>`)\n .join(\" / \") +\n this.getHelperWordsAfter();\n output = output.trim();\n\n // const highlight = options?.highlight\n // if (highlight && this.is(highlight)) {\n // output = `<span class=\"highlight\">${output}</span>`\n // }\n\n return output;\n }", "title": "" }, { "docid": "8be946e56a7edb32cb6a34374f0105f5", "score": "0.50069124", "text": "_replaceDisplay(value) {}", "title": "" }, { "docid": "384994c231d9bad62c0a7a44d650e793", "score": "0.49998754", "text": "DrawScore() {\n /// char score[512];\n /// sprintf(score, \"Score: %d, Remaining Oil %d\",\n /// m_listener.GetScore(), m_listener.GetOil());\n /// const char *lines[] = { score, \"Move: a,s,d,w Fracking Fluid: e\" };\n /// for (uint32 i = 0; i < B2_ARRAY_SIZE(lines); ++i)\n /// {\n /// m_debugDraw.DrawString(5, m_textLine, lines[i]);\n /// m_textLine += DRAW_STRING_NEW_LINE;\n /// }\n testbed.g_debugDraw.DrawString(5, this.m_textLine, `Score: ${this.m_listener.GetScore()}, Remaining Oil ${this.m_listener.GetOil()}`);\n this.m_textLine += testbed.DRAW_STRING_NEW_LINE;\n testbed.g_debugDraw.DrawString(5, this.m_textLine, \"Move: a,s,d,w Fracking Fluid: e\");\n this.m_textLine += testbed.DRAW_STRING_NEW_LINE;\n }", "title": "" }, { "docid": "14502973366e75d1969cbaa01fa2e806", "score": "0.49967995", "text": "function update_tape_view()\n {\n //Clearing the tape view.\n $tape_view.html(\"\");\n \n //Iterating over the tape arrays.\n for(var $index = ($left.length * -1) + 1; $index < $start_right.length; $index ++)\n {\n //Coloring the current index which represents the tape head with a different color.\n if($index == $current_tape_index)\n {\n $tape_view.html(\"\"+$tape_view.html()+span(at_index($index), $index, true));\n continue;\n }\n $tape_view.html(\"\"+$tape_view.html()+span(at_index($index), $index));\n }\n \n }", "title": "" }, { "docid": "c5a343f208caa18ad5a21673060c06a5", "score": "0.4993793", "text": "function apeEditor() {\n\t \t var zoom = detectZoom.zoom();\n\t var device = detectZoom.device();\n\n\t //console.log(zoom, device);\n\n\n\t\t$(\".gridstyle2 .grid-item2col\").each(function() {\n\n\t\t\tvar item = $(this).find(\".tiltWrapper\");\n\n\t\t\tvar svg = $(this).find(\".highlightContentBlur\");\n\n\t\t\tvar svginner = $(this).find(\".heroImageBlur\");\n\n\n\t\t\tvar containerHeight = $(item).height();\n\t\t\tvar containerWidth = $(item).width();\n\n\t\t\tcontainerHeight = containerHeight * zoom * device;\n\t\t\tcontainerWidth = containerWidth * zoom * device;\n\t\t\t//console.log(containerHeight);\n\t\t\t$(svg).height(containerHeight);\n\t\t\t$(svginner).width(containerWidth);\n\t\t});\n\t}", "title": "" }, { "docid": "ed4778d45be169ccbbbdccfa987185ac", "score": "0.49912706", "text": "function draw() {\r \r //GET PAGE\r var curPage = b.page();\r \r //CREATE NEW PAGE\r var newPage = curPage.duplicate(); // b.duplicate(curPage);\r\r // GO TO NEW PAGE\r b.page(newPage);\r \r //GET ITEMS ON PAGE\r var pageItems = b.items(newPage);\r \r //CONVERT TYPO IN PATH\r for (var i = 0; i < pageItems.length; i++) {\r var curItem = pageItems[i];\r if(curItem instanceof TextFrame){\r var tempLabel = curItem.label;\r b.println(tempLabel);\r var result = curItem.createOutlines(true);\r result[0].label = tempLabel;\r }\r }\r\r //GET ITEMS ON PAGE AGAIN\r pageItems = b.items(newPage);\r \r //LOOP THROUGH ITEMS\r for (var i = 0; i < pageItems.length; i++) {\r \r //SETUP DEFAULT VALUES\r var minX=0, maxX=0, minY=0, maxY=0;\r var minScale=0,maxScale=0;\r var minScaleW=0,maxScaleW=0,minScaleH=0,maxScaleH=0;\r var minRot=0; maxRot=0;\r var minR=0, maxR=0, minG=0, maxG=0, minB=0, maxB=0;\r var repeatPosition = 0;\r var ignore = false;\r \r //GET ITEM\r var curItem = pageItems[i];\r \r //GET VALUES FROM LABEL\r eval(curItem.label);\r \r //UPDATE ITEM VALUES\r //SCALE\r if(minScale!=0 || maxScale !=0){\r if(minScaleW!=0 || maxScaleW !=0 || minScaleH !=0 || maxScaleH !=0){\r b.error( \"you can not use proportional and unproportional scale in the same item\");\r }\r //SCALE PROPORTIONAL\r setRandomItemSizeProportional(curItem,minScale,maxScale);\r }else{\r //SCALE UNPROPORTIONAL\r setRandomItemSize(curItem,minScaleW,maxScaleW,minScaleH,maxScaleH);\r }\r //POSITION\r setRandomItemPosition(curItem,minX,maxX,minY,maxY);\r //ROTATION\r setRandomItemRotation(curItem,minRot,maxRot);\r //COLOR\r // try -- \r setRandomItemColor(curItem,minR,maxR,minG,maxG,minB,maxB);\r \r }\r\r}", "title": "" }, { "docid": "9f59ff2a8f4b320a418b918776a59338", "score": "0.49911946", "text": "function ReportsTranslate(tagnames,method){\r\n\tif(!method){\r\n\t\t//Mensajes: Color de numeros\r\n\t\tvar publi = document.getElementsByTagName (tagnames);\r\n\t\tfor (var i = publi.length - 1; i >= 0; i--) {\r\n\t\t\tif(publi[i].innerHTML){\r\n\t\t\t\thtmldentro = publi[i].innerHTML * 1 ;\r\n\t\t\t\tif( htmldentro >= 100000 && htmldentro < 5000000) {\r\n\t\t\t\t\tpubli[i].style.color=\"rgb(36,183,0)\";\r\n\t\t\t\t}\r\n\t\t\t\tif( htmldentro >= 500000 && htmldentro < 1000000 ) {\r\n\t\t\t\t\tpubli[i].style.color=\"rgb(239,173,20)\";\r\n\t\t\t\t}\r\n\t\t\t\tif( htmldentro >= 1000000 ) {\r\n\t\t\t\t\tpubli[i].style.color=\"rgb(255,0,0)\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(publi[i].innerHTML.indexOf(c(36164)+c(28304)+c(22312)+' ') != -1 && publi[i].innerHTML.indexOf('%') != -1){\r\n\t\t\t\tpubli[i].style.color=\"rgb(170,170,0)\";\r\n\t\t\t\tif(publi[i].parentNode.innerHTML)\r\n\t\t\t\t\tvar onTop = publi[i].parentNode;\r\n\t\t\t\telse\r\n\t\t\t\t var onTop = publi[i];\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(c(21453)+c(25506)+c(27979)+c(27963)+c(21160)+c(26426)+c(29575),SpyPorcent);\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(c(36164)+c(28304)+c(22312),Resources_in);\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(c(22312),at);\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(c(33328)+c(38431),Fleet);\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(c(38450)+c(24481),Defence);\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(c(24314)+c(31569),Buildings);\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(c(30740)+c(31350),Research);\r\n\t\t\t\t\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(chM,Metal);\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(chC,Crystal);\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(chD,Deuterium);\r\n\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(chE,Energy);\r\n\t\t\t\tfor(i=0;i<Zahlen.length;i++){\r\n\t\t\t\t //Armamos las palabras temporalmente\r\n\t\t\t\t\tword = '';\r\n\t\t\t\t\tfor(x=0;x<Zahlen[i].length;x++){\r\n\t\t\t\t\t word += c(Zahlen[i][x]);\r\n\t\t\t\t }\r\n\t\t\t\t\tonTop.innerHTML = onTop.innerHTML.replace(word,eval(\"gid\"+Cid[i]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tfor(i=0;i<Zahlen.length;i++){\r\n\t\t\t//Armamos las palabras temporalmente\r\n\t\t\tword = '';\r\n\t\t\tfor(x=0;x<Zahlen[i].length;x++){\r\n\t\t\t\tword += c(Zahlen[i][x]);\r\n\t\t\t}\r\n\t\t\tdocument.body.innerHTML = document.body.innerHTML.replace(word,eval(\"gid\"+Cid[i]));\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "2da7dc3b252793a5c6024dfed28e40f5", "score": "0.49864113", "text": "function montaThead(t) {\n // verifica se eh lista ou analise\n if (t === 'lista') {\n $('#th1').css('width', '05%');\n $('#th2').css('width', '05%');\n $('#th3').css('width', '08%');\n $('#th4').css('width', '18%');\n $('#th5').css('width', '12%');\n $('#th6').css('width', '26%');\n $('#th7').css('width', '26%');\n $('#th8').css('width', '00%');\n // coloca os titulos\n $('#sp1').html('Resp.');\n $('#sp2').html('#ID');\n $('#sp3').html(isFornecedor == 1 && tpoFornecedor == 1 ? 'Turma' : 'Fornecedor');\n $('#sp4').html('Processo');\n $('#sp5').html('M&eacute;trica');\n $('#sp6').html('Cliente/Contrato - O.S.');\n $('#sp7').html('Projeto');\n $('#sp8').html('');\n }\n else if (t === 'analises') {\n $('#th1').css('width', '05%');\n $('#th2').css('width', '05%');\n $('#th3').css('width', '10%');\n $('#th4').css('width', '5%');\n $('#th5').css('width', '5%');\n $('#th6').css('width', '10%');\n $('#th7').css('width', '37%');\n $('#th8').css('width', '23%');\n // coloca os titulos\n $('#sp1').html('R1');\n $('#sp2').html('#ID');\n $('#sp3').html('M&eacute;trica');\n $('#sp4').html('R2');\n $('#sp5').html('#ID');\n $('#sp6').html('M&eacute;trica');\n $('#sp7').html('Projeto - O.S.');\n $('#sp8').html('Analise');\n }\n}", "title": "" }, { "docid": "334954c11c15b8e4f4bad6a71d694e2a", "score": "0.49851465", "text": "function fl_outToSufgania ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "d7663b0c86aeecc268cdfb882184ecae", "score": "0.49778113", "text": "function downLeft(pHeight, pColorEven, pColorOdd, pSymbol){\nvar rLine =\"\";\nfor (i=pHeight;i > 0;i--){\nrLine +=\"<p>\";\n \n for (x=1;x<=pHeight-i;x++) {\n\n rLine +=\"<span class='space'>\" + pSymbol +\"</span>\";\n}\n \nfor(j=0;j<i;j++){\n\nif (j%2) \nrLine +=\"<span style='color:\" + pColorEven + \";'>\" + pSymbol +\"</span>\";\nelse\nrLine +=\"<span style='color:\" + pColorOdd + \";'>\" + pSymbol +\"</span>\";\n\n}\nrLine +=\"</p>\";\n\n}\n\ndocument.getElementById(\"downLeft\").innerHTML = rLine;\n}", "title": "" }, { "docid": "78361bbad9cc4614f37828dede2273de", "score": "0.4973795", "text": "function showOnHtml(){\n\tlet i = 0;\n\tlet color = 140;\n\tfor(let row of resultTemp){\n\t\tfor(let col of row){\n\t\t\tresult[i].innerHTML = col;\n\t\t\tif(col != 0){\n\t\t\t\tcolor = 99 + col*10 + 15;\n\t\t\t\tresult[i].style.backgroundColor = `hsl(${color},33%,76%)`;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tresult[i].style.backgroundColor = '#e6e6ff';\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}\n\tscore.innerHTML = scoreTemp;\n}", "title": "" }, { "docid": "b1a6a80d54c92a1d5e6b5c487da9d2be", "score": "0.49717662", "text": "function makelabyrinth(){\n\t// dibujando el borde\n\tlines.push(new line(10, 10, 580, 20));\n\tlines.push(new line(10, 570, 580, 20));\n\tlines.push(new line(10, 10, 20, 290));\n\tlines.push(new line(0, 280, 20, 20));\n\tlines.push(new line(0, 340, 20, 20));\n\tlines.push(new line(10, 340, 20, 250));\n\tlines.push(new line(570, 340, 20, 250));\n\tlines.push(new line(570, 10, 20, 290));\n\tlines.push(new line(570, 340, 40, 20));\n\tlines.push(new line(570, 280, 40, 20));\n\n\t// dibujando dentro\n\t// t rara\n\tlines.push(new line(60, 60, 70, 20));\n\tlines.push(new line(130, 60, 20, 100));\n\tlines.push(new line(180, 60, 90, 100));\n\tlines.push(new line(60, 110, 40, 50));\n\n\t// bordes que sobresalen\n\tlines.push(new line(300, 10, 20, 150));\n\tlines.push(new line(300, 460, 20, 110));\n\n\t// cuadrados\n\tlines.push(new line(250, 195, 120, 30));\n\tlines.push(new line(350, 120, 190, 40));\n\tlines.push(new line(350, 60, 190, 30));\n\tlines.push(new line(400, 195, 140, 30));\n\tlines.push(new line(60, 195, 160, 30));\n\tlines.push(new line(350, 460, 90, 80));\n\tlines.push(new line(170, 460, 100, 80));\n\tlines.push(new line(110, 460, 30, 110));\n\tlines.push(new line(65, 460, 10, 80));\n\tlines.push(new line(470, 460, 30, 110));\n\tlines.push(new line(530, 460, 10, 80));\n\tlines.push(new line(60, 260, 120, 130));\n\tlines.push(new line(440, 260, 100, 130));\n\n\n\t// centro de salida de fantasmas\n\tlines.push(new line(250, 340, 120, 10));\n\tlines.push(new line(250, 260, 10, 80));\n\tlines.push(new line(250, 260, 40, 10));\n\tlines.push(new line(330, 260, 40, 10));\n\tlines.push(new line(360, 260, 10, 80));\n\n\t// relleno luego del centro\n\tlines.push(new line(210, 340, 10, 80));\n\tlines.push(new line(210, 220, 10, 80));\n\tlines.push(new line(250, 390, 120, 40));\n\tlines.push(new line(250, 195, 120, 0));\n\tlines.push(new line(60, 420, 160, 10));\n\tlines.push(new line(400, 220, 140, 10));\n\tlines.push(new line(60, 220, 160, 10));\n\tlines.push(new line(400, 220, 10, 80));\n\tlines.push(new line(400, 340, 10, 80));\n\tlines.push(new line(400, 420, 140, 10));\n\n}", "title": "" }, { "docid": "3967fb46bf52ec67294b07ee415c73b3", "score": "0.49701166", "text": "function daComentarioFbk(){\r\n var limit = 150; \r\n /* ahora brega con el parrafo y da feedback pq ya se cuantos faltan */\r\n var parrafo = document.getElementById('comentario-feedback-paragraph');\r\n \r\n var faltan = noUsado(); \r\n if(faltan == limit && ! escogioFoto()){\r\n parrafo.style.color='red';\r\n parrafo.innerHTML='<b>Comentario del juego de hoy.</b>'; \r\n parrafo.style.fontSize = '1.00em';\r\n }else if(faltan == limit && escogioFoto()){\r\n parrafo.style.color='green';\r\n parrafo.innerHTML='<b>Comentario opcional del juego.</b>'; \r\n parrafo.style.fontSize = '1.00em'; \r\n }else if(faltan > 1){\r\n parrafo.style.color='green';\r\n //parrafo.innerHTML= 'Puedes usar ' + faltan + ' letras mas.';\r\n parrafo.innerHTML= '<b>' + faltan + '</b>';\r\n parrafo.style.fontSize = '0.70em';\r\n }else if(faltan == 1){\r\n parrafo.style.color='green';\r\n //parrafo.innerHTML= 'Puedes usar ' + faltan + ' letra mas.';\r\n parrafo.innerHTML= '<b>' + faltan + '</b>';\r\n parrafo.style.fontSize = '0.70em';\r\n }else if(faltan == 0){\r\n parrafo.style.color='green';\r\n //parrafo.innerHTML= 'Usando exactamente ' + limit + ' letras.';\r\n parrafo.innerHTML= '<b>' + faltan + '</b>'; \r\n parrafo.style.fontSize = '0.70em';\r\n }else if(faltan == -1 ){\r\n parrafo.style.color='red';\r\n parrafo.innerHTML='<b>Tienes ' + (-1 * faltan) + ' letra de mas.</b>';\r\n parrafo.style.fontSize = '1.00em';\r\n }else if(faltan < -1 ){\r\n parrafo.style.color='red';\r\n parrafo.innerHTML='<b>Tienes ' + (-1 * faltan) + ' letras de mas.</b>';\r\n parrafo.style.fontSize = '1.00em';\r\n }\r\n }", "title": "" }, { "docid": "3fa9fb8df07733460aa70306caf32f52", "score": "0.49681503", "text": "function changeCouleur(obj) {\r\n var couleurElement=obj[0];\r\n var pourcentage=obj[1];\r\n var rougeBinaire = binDec(hexaBin(couleurElement[1]+couleurElement[2]));\r\n var vertBinaire = binDec(hexaBin(couleurElement[3]+couleurElement[4]));\r\n var bleuBinaire = binDec(hexaBin(couleurElement[5]+couleurElement[6]));\r\n rougeBinaire=rougeBinaire+(255-rougeBinaire)*(pourcentage/100);\r\n vertBinaire=vertBinaire+(255-vertBinaire)*(pourcentage/100);\r\n bleuBinaire=bleuBinaire+(255-bleuBinaire)*(pourcentage/100);\r\n var rouge=binHexa(decBin(rougeBinaire));\r\n var vert=binHexa(decBin(vertBinaire));\r\n var bleu=binHexa(decBin(bleuBinaire));\r\n couleurElement=\"#\"+rouge+vert+bleu\r\n return couleurElement;\r\n}", "title": "" }, { "docid": "a2a47df2a7d020b75762c90a51c1409c", "score": "0.4960916", "text": "function fl_outToMaza ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "4be20d7d43225a5af7b7c5ecd44f381d", "score": "0.49607974", "text": "function fl_outToKarpas ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "84af98464c2a2bbfce80a23cfbf20ea5", "score": "0.49563885", "text": "function makeSmaller() {\n\n}", "title": "" }, { "docid": "f734e60c6c244debd6ab5072f351a1cd", "score": "0.49553758", "text": "function downRight(pHeight, pColorEven, pColorOdd, pSymbol){\nvar rLine =\"\";\nfor (i=pHeight;i > 0;i--){\nrLine +=\"<p>\";\n\nfor(j=0;j<i;j++){\n\nif (j%2) \nrLine +=\"<span style='color:\" + pColorEven + \";'>\" + pSymbol +\"</span>\";\nelse\nrLine +=\"<span style='color:\" + pColorOdd + \";'>\" + pSymbol +\"</span>\";\n\n}\nrLine +=\"</p>\";\n\n}\n\ndocument.getElementById(\"downRight\").innerHTML = rLine;\n}", "title": "" }, { "docid": "914eb253b02f81467b066c5383a877d2", "score": "0.4954885", "text": "function replace_allianz() {\r\n\tadd_log(3,\"replace_allianz() > Début.\");\r\n\tvar div_allianz = $class('sideInfoAlly')[0];\r\n\tdiv_allianz.style.backgroundImage= 'none';\r\n\tdiv_allianz.innerHTML= \"<div style='visibility: hidden; height: 0px;'>\" + div_allianz.innerHTML + \"</div>\";\r\n\tdiv_allianz.style.width = '200px';\r\n\tdiv_allianz.style.height = '50px';\r\n\t\r\n\t\t\r\n\tvar cadre_allianz = $cr_table([['id', 'cadre_allianz'],['class', 'cadres_side'],['cellspacing', '0'],['cellpadding', '0']]);\r\n\tvar hero_ligne = $cr_tr();\r\n\tif(isR2L) {\r\n\t\tvar hero_cel_3 = $cr_td([['class', 'cadres_side_t1']]);\r\n\t\tvar hero_cel_1 = $cr_td([['class', 'cadres_side_t3']]);\r\n\t\t}\r\n\telse {\r\n\t\tvar hero_cel_1 = $cr_td([['class', 'cadres_side_t1']]);\r\n\t\tvar hero_cel_3 = $cr_td([['class', 'cadres_side_t3']]);\r\n\t\t}\r\n\tvar hero_cel_2 = $cr_td([['class', 'cadres_side_t2'],['colspan', '2']]);\r\n\thero_ligne.appendChild(hero_cel_1);\r\n\thero_ligne.appendChild(hero_cel_2);\r\n\thero_ligne.appendChild(hero_cel_3);\r\n\tcadre_allianz.appendChild(hero_ligne);\r\n\t\r\n\tvar hero_ligne = $cr_tr();\r\n\tif(isR2L) {\r\n\t\tvar hero_cel_5 = $cr_td([['class', 'cadres_side_m1']]);\r\n\t\tvar hero_cel_1 = $cr_td([['class', 'cadres_side_m5']]);\r\n\t\t}\r\n\telse {\r\n\t\tvar hero_cel_1 = $cr_td([['class', 'cadres_side_m1']]);\r\n\t\tvar hero_cel_5 = $cr_td([['class', 'cadres_side_m5']]);\r\n\t\t}\r\n\t\t\r\n\tvar hero_cel_2 = $cr_td([['id', 'forum_ally'],['class', 'cadres_side_m3']]);\r\n\tvar hero_lien = $cr_a(\" \",[['href','allianz.php?s=2']])\r\n\tvar hero_img_hero = $cr_img([['src', var_images['alliance_blason']]]);\r\n\thero_lien.appendChild(hero_img_hero);\r\n\thero_lien.addEventListener(\"mouseover\", function () {this.style.color='#22AA55'; $id('forum_ally').style.backgroundImage='none'; $id('forum_ally').style.backgroundColor='#BBFFBB';}, true);\r\n\thero_lien.addEventListener(\"mouseout\", function () {this.style.color='#000000'; $id('forum_ally').style.backgroundImage=\"url('\" + var_images['cadre'] + \"')\"; $id('forum_ally').style.backgroundColor='transparent';}, true);\r\n\thero_cel_2.appendChild(hero_lien);\r\n\t\r\n\tvar hero_cel_3 = $cr_td([['id', 'info_ally'],['class', 'cadres_side_m2']]);\r\n\tvar adventure_lien = $cr_a(\" \",[['href','allianz.php']])\r\n\tvar hero_texte = $cr_s(\" \" + var_divers['allianz'])\r\n\tadventure_lien.appendChild(hero_texte);\r\n\tadventure_lien.addEventListener(\"mouseover\", function () {this.style.color='#22AA55'; $id('info_ally').style.backgroundImage='none'; $id('info_ally').style.backgroundColor='#BBFFBB';}, true);\r\n\tadventure_lien.addEventListener(\"mouseout\", function () {this.style.color='#000000'; $id('info_ally').style.backgroundImage=\"url('\" + var_images['cadre'] + \"')\"; $id('info_ally').style.backgroundColor='transparent';}, true);\r\n\thero_cel_3.appendChild(adventure_lien);\r\n\t\r\n\thero_ligne.appendChild(hero_cel_1);\r\n\thero_ligne.appendChild(hero_cel_2);\r\n\thero_ligne.appendChild(hero_cel_3);\r\n\thero_ligne.appendChild(hero_cel_5);\r\n\tcadre_allianz.appendChild(hero_ligne);\r\n\t\r\n\t\r\n\tvar hero_ligne = $cr_tr();\r\n\tif(isR2L) {\r\n\t\tvar hero_cel_3 = $cr_td([['class', 'cadres_side_b1']]);\r\n\t\tvar hero_cel_1 = $cr_td([['class', 'cadres_side_b3']]);\r\n\t\t}\r\n\telse {\r\n\t\tvar hero_cel_1 = $cr_td([['class', 'cadres_side_b1']]);\r\n\t\tvar hero_cel_3 = $cr_td([['class', 'cadres_side_b3']]);\r\n\t\t}\r\n\tvar hero_cel_2 = $cr_td([['class', 'cadres_side_b2'],['colspan', '2']]);\r\n\thero_ligne.appendChild(hero_cel_1);\r\n\thero_ligne.appendChild(hero_cel_2);\r\n\thero_ligne.appendChild(hero_cel_3);\r\n\tcadre_allianz.appendChild(hero_ligne);\r\n\t\r\n\tcadre_allianz.style.position = 'relative';\r\n\tif(isR2L)\r\n\t\tcadre_allianz.style.right = '-3px';\r\n\telse\r\n\t\tcadre_allianz.style.left = '-3px';\r\n\tdiv_allianz.appendChild(cadre_allianz);\r\n\t\t\r\n\tadd_log(1,\"replace_allianz() > Cadre Alliance remplacé\");\r\n\t\r\n\tadd_log(3,\"replace_allianz() > Fin.\");\r\n\t}", "title": "" }, { "docid": "9f4c2b3a17540ff3cdeb2f14741d010b", "score": "0.4953425", "text": "function roofStyleText() {\r\n\t\tif (document.getElementById(\"roofstyle\").value == 0) {\r\n\t\t\treturn doc.text(\"REG\", .4, 3.5);\r\n\t\t} else if (document.getElementById(\"roofstyle\").value == 1) {\r\n\t\t\treturn doc.text(\"A-FRAME\", .4, 3.5);\r\n\t\t} else if (document.getElementById(\"roofstyle\").value == 2) {\r\n\t\t\treturn doc.text(\"VERTICAL\", .4, 3.5);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3af0b0ea74d9a84104a0e20806a18b99", "score": "0.49517584", "text": "function renderStatus() {\n if (Map.collided === true) {\n ctx.font = '25pt Calibri';\n ctx.textAlign = 'center';\n ctx.fillStyle = 'black';\n ctx.fillText(\n 'YOU GOT STINKED!! Score: ' + Map.score,\n parseInt(Map.BLOCKWIDTH * Map.columns / 2),\n parseInt(Map.BLOCKHEIGHT * Map.rows * 2 / 3)\n );\n }\n else {\n ctx.font = '15pt Calibri';\n ctx.textAlign = 'right';\n ctx.fillStyle = 'white';\n ctx.fillText(\n 'Score: ' + Map.score,\n parseInt(Map.BLOCKWIDTH * Map.columns - (Map.BLOCKWIDTH * 1/8)),\n parseInt((Map.BLOCKHEIGHT / 2) + 40)\n );\n }\n }", "title": "" }, { "docid": "1b427958a4f22d4186acda72fadb89f3", "score": "0.49507815", "text": "function fl_outToHaroset ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "cc40e365869388ca8e92de419c0e4112", "score": "0.49449688", "text": "wordColorAttribution() {\r\n for (let i=0; i<25; i++) {\r\n if (i===0) {\r\n this.words[i].color = 'black';// ' \\u{2B1B} '; // black\r\n } else if (i<9) {\r\n this.words[i].color = 'red';// ' \\u{1F7E5} '; // red\r\n } else if (i<18) {\r\n this.words[i].color = 'blue';// ' \\u{1F7E6} '; // blue\r\n } else {\r\n this.words[i].color = 'white';// ' \\u{2B1C} '; // white\r\n }\r\n };\r\n }", "title": "" }, { "docid": "1801826229ca89441fa38f1f752edf9a", "score": "0.4944942", "text": "bubblemaker(x,y,w,h,r,g,b){\r\nfill(115)\r\nrect(275*r, 190,370, 185)\r\n\r\nfill(130, 44, 188,255/r)\r\nrect(277/r, 195*r,365/r, 180*r)\r\ntext(\"huffer :\"+encoded,380, 650,620,40)\r\n\r\nfill(220)\r\ntext(sata.name,x,y,w,h)\r\nfill(0)\r\n text(inp.value(),355/r, 255,256)\r\n \r\n}", "title": "" }, { "docid": "ef79de02570ad2396ef32528e726af83", "score": "0.49405175", "text": "function returnLegendCapsBack() {\n //todo\n}", "title": "" }, { "docid": "c5b01a4c8ac3750198c440b9efd83678", "score": "0.49391624", "text": "function visualFeedback(res, val, ui){\n 'use strict';\n var color,\n value=\"\",\n target = ui.parent().position(); // the visual feedback will be positioned according to the occupied tile and not the chip\n res==true? (color = 'green', value = \"+\"+val) : (color='red',value = \"-\"+val );\n var $self = $('#vfb').css({\"color\":color, \"display\":\"block\",\"top\":target.top,\"left\":target.left,'opacity':1}).text(value);\n // $self = $('<span/>').addClass('visualFeedback').css({\"color\":this.color}).text(val);\n\n function r_set(){\n $('#vfb').removeAttr('style');\n\n };\n\n this.reset = function() {\n // return r_set();\n $self.css({\"font-size\":\"4em\"}).text(\"\");\n\n };\n\n function pGetSelf() {\n return $self;\n }\n\n this.GetSelf = function() {\n return pGetSelf();\n };\n}", "title": "" }, { "docid": "cda59fbca09f09958cdc33321f13b9de", "score": "0.4935353", "text": "function fl_outToHasa ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "title": "" }, { "docid": "b476f3edfd21113b8efe20a70a5befd0", "score": "0.49346688", "text": "styleNeutre() {\n return {\n weight: 0.5,\n color: '#222',\n fillOpacity: 0 \n }\n }", "title": "" }, { "docid": "daf2fe18797af8a8cc32b12dec8f00fd", "score": "0.49338704", "text": "function printMotionGuidelines (){\n\tvar activeItem = app.project.activeItem;\n\tif (activeItem != null && (activeItem instanceof CompItem)){\n\t\ttestString = \"\";\n\t\twriteString = \"\";\n\t\tactiveComp = activeItem;\n\t\tactiveCompName = activeComp.name;\n\t\tfps = activeComp.frameRate;\n\t\ttimeMS = activeComp.time * 1000;\n\t\tcompAnimStart = activeComp.workAreaStart * 1000;\n\t\tcompAnimDur = activeComp.workAreaDuration * 1000;\n\n\t\twriteString = activeCompName + lineReturn + \"Total Anim time \" + compAnimDur + \"MS\" + lineReturn;\n\t\t\n\t\t\n\t\tvar selectedLayers = activeComp.layers;\n\n\t\t\n\t\tfor (var i = 1; i <= selectedLayers.length; i++) {\n\t\t\twriteString += paragraph + selectedLayers[i].name;\n\t\t\tvar numProps = selectedLayers[i].numProperties;\n\n\t\t\t\n\t\t\t\n\t\t\tfunction findProperties(curItem) {\n\t\t\t var curLayer = selectedLayers[i];\n\t\t\t var report = \"\";\n\n\t\t\t findKeys(curLayer);\n\t\t\t \n\t\t\t return\n\t\t\t}\n\t\t\t \n\t\t\tfunction findKeys(property) {\n\t\t\t \n\t\t\t \n\t\t\t var propTypeString = \"Unknown\";\n\t\t\t if (property.propertyType == PropertyType.INDEXED_GROUP) { propTypeString = \"INDEXED_GROUP\"; }\n\t\t\t else if (property.propertyType == PropertyType.NAMED_GROUP) { propTypeString = \"NAMED_GROUP\"; }\n\t\t\t else if (property.propertyType == PropertyType.PROPERTY) { propTypeString = \"PROPERTY\"; }\n\t\t\t \n\t\t\t \n\t\t\t\n\t\t\t if (property.propertyType == PropertyType.PROPERTY && property.canVaryOverTime && property.numKeys > 0){\n\t\t\t \t\n\t\t\t \twriteString += lineReturn + property.name + lineReturn;\n\t\t\t \tfor (var j = 1; j <= property.numKeys; j++) {\n\t\t\t \t\t\n\t\t\t \t\tvar t = (property.keyTime(j) * 1000) - compAnimStart;\n\n\t\t\t \t\tvar keyValue = [];\n\t\t\t \t\tif(property.keyValue(j)[0]){\n\t\t\t \t\t\tfor (var x = 0; x < property.keyValue(j).length; x++) {\n\t\t\t\t \t\t\tkeyValue.push(property.keyValue(j)[x].toFixed(0));\n\t\t\t\t \t\t}\n\t\t\t \t\t}else{\n\t\t\t \t\t\tkeyValue.push(property.keyValue(j));\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\twriteString += t.toString() + \"MS \" + \" - \" + keyValue.toString() + lineReturn;\n\n\t\t\t \t\tif(j % 2 === 0){\n\n\t\t\t \t\t\tif(Number.isInteger(property.keyValue(j)) || Number.isInteger(property.keyValue(j)[0]) ){\n\t\t\t\t \t\t\tvar x1,x2,y1,y2;\n\t\t\t\t \t\t\tvar t1 = property.keyTime(j-1);\n\t\t\t\t \t\t\tvar t2 = property.keyTime(j);\n\t\t\t\t \t\t\tif (Number.isInteger(property.keyValue(j)[0])){\n\t\t\t\t \t\t\t\tvar val1 = property.keyValue(j-1)[0] + property.keyValue(j-1)[1];\n\t\t\t\t\t\t\t\t\tvar val2 = property.keyValue(j)[0] + property.keyValue(j)[1];\n\t\t\t\t\t\t\t\t\tif(property.keyValue(j)[2]){\n\t\t\t\t\t\t\t\t\t\tval1 += property.keyValue(j-1)[2];\n\t\t\t\t\t\t\t\t\t\tval2 += property.keyValue(j)[2];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t \t\t\t}else{\n\t\t\t\t \t\t\t\tvar val1 = property.keyValue(j-1);\n\t\t\t\t\t\t\t\t\tvar val2 = property.keyValue(j);\n\t\t\t\t \t\t\t}\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar delta_t = t2-t1;\n\t\t\t\t\t\t\t\tvar delta = val2-val1;\n\t\t\t\t\t\t\t\tvar avSpeed = Math.abs(val2-val1)/(t2-t1);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tif (val1<val2){ \n\t\t\t\t\t\t\t\t\tx1 = property.keyOutTemporalEase(j-1)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty1 = x1*property.keyOutTemporalEase(j-1)[0].speed / avSpeed;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\tx2 = 1-property.keyInTemporalEase(j)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty2 = 1-(1-x2)*(property.keyInTemporalEase(j)[0].speed / avSpeed);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (val2<val1){\n\t\t\t\t\t\t\t\t\tx1 = property.keyOutTemporalEase(j-1)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty1 = (-x1)*property.keyOutTemporalEase(j-1)[0].speed / avSpeed;\n\t\t\t\t\t\t\t\t\tx2 = property.keyInTemporalEase(j)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty2 = 1+x2*(property.keyInTemporalEase(j)[0].speed / avSpeed);\n\t\t\t\t\t\t\t\t\tx2 = 1-x2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (val1==val2){\n\t\t\t\t\t\t\t\t\tx1 = property.keyOutTemporalEase(j-1)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty1 = (-x1)*property.keyOutTemporalEase(j-1)[0].speed / ((property.maxValue-property.minValue)/(t2-t1)) ;\n\t\t\t\t\t\t\t\t\tx2 = property.keyInTemporalEase(j)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty2 = 1+x2*(property.keyInTemporalEase(j)[0].speed / ((property.maxValue-property.minValue)/(t2-t1)));\n\t\t\t\t\t\t\t\t\tx2 = 1-x2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (x1 === y1 && x2 === y2){\n\t\t\t\t\t\t\t\t\twriteString += \"Linear\";\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\twriteString += \"Cubic-bezier(\" + x1.toFixed(2) + \", \" + y1.toFixed(2) + \", \" + x2.toFixed(2) + \", \" + y2.toFixed(2) + \")\" + lineReturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\twriteString += \"Can't calculate bezier on path anim\" + lineReturn;\n\t\t\t\t\t\t\t}\n\t\t\t \t\t\t\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \t\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t if (property.propertyType == PropertyType.INDEXED_GROUP || property.propertyType == PropertyType.NAMED_GROUP) {\n\t\t\t \n\t\t\t for (var d = 1; d <= property.numProperties; d++) {\n\t\t\t \tfindKeys(property.property(d));\n\t\t\t }\n\t\t\t }\n\t\t\t\n\t\t\t}\n\t\t\twriteString += paragraph;\n\t\t\tfindProperties(activeComp);\n\t\t\t \n\t\t\t\n\t\t\n\n\t\t\t\n\t\t}\n\t\t\n\t\teditText.text = writeString;\n\t}\n}", "title": "" }, { "docid": "10d8746e81cb5e46c2003328e65c571a", "score": "0.49330822", "text": "scalify() {\n // Clear up the notes\n let allFrets = this.container.querySelectorAll(\".fret-note\");\n allFrets.forEach(function(fret) {\n fret.style.opacity = \"0\";\n });\n this.writeNotes();\n // Enable the relevant notes\n for(let i = 0; i < scale.length; i++) {\n let noteFrets = this.container.querySelectorAll(\".\" + scale[i] + \" .fret-note\"); // Select all note HTML objects for the current note\n noteFrets.forEach(function(fretHTML) {\n fretHTML.style.backgroundColor = bgColors[i];\n fretHTML.style.opacity = \"1\"; \n });\n }\n }", "title": "" }, { "docid": "7abec543296612726f653ddb5f2a2acb", "score": "0.4930411", "text": "generateDetailsLabel() {\n var html = \"<table><tr><td><i class='material-icons speaking-android'>android</i></td><td><div class='speech-bubble'>Das Frachtstück \" + this.desc + \" gehört zu der Gruppe \" + this.group + \". Für die folgenden Eigenschaften habe ich die folgenden Koordinaten berechnet:<table class='speech-bubble-table'><tbody><tr><td>Länge:</td><td class='after-m'>\" + Styler.styleM(this.length) + \"</td></tr><tr><td>Breite:</td><td class='after-m'>\" + Styler.styleM(this.width) + \"</td></tr><tr><td>Höhe:</td><td class='after-m'>\" + Styler.styleM(this.height) + \"</td></tr><tr><td>Z-Koordinate (Länge):</td><td class='after-m'>\" + Styler.styleM(this.z) + \"</td></tr><tr><td>X-Koordinate (Tiefe):</td><td class='after-m'>\" + Styler.styleM(this.x) + \"</td></tr><tr><td>Y-Koordinate (Höhe):</td><td class='after-m'>\" + Styler.styleM(this.y) + \"</td></tr><tr><td>Folgenummer</td><td>\" + this.seqNr + \"</td></tr></tbody></table>\";\n if (this.isRotated) {\n html += \"das Gut wurde um die vertikale Achse rotiert\";\n } else {\n html += \"das Gut wurde nicht um die vertikale Achse rotiert\";\n }\n html += \"</div></td></tr></table>\";\n return html;\n }", "title": "" }, { "docid": "f2fb4ec8ac7cfe15a50a25d14310b5e2", "score": "0.4928996", "text": "function sabreTurbo() {\n $('.car').attr('src', 'svgs/sabre.svg');\n $('.row1 .number').text(\"6s\");\n $('.row2 .number').text(\"116\");\n $('.row3 .number').text(\"4\");\n $('.row1 .bar').css(\"width\", \"28%\");\n $('.row2 .bar').css(\"width\", \"53%\");\n $('.row3 .bar').css(\"width\", \"80%\");\n }", "title": "" }, { "docid": "118b62edb6f14be04025799079c6ff64", "score": "0.49278808", "text": "function rf(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(\n // Might be a text scaling operation, clear size caches.\n t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}", "title": "" } ]
7eb214903b3aa996ffefe0b3dab59abd
Updates an object in the store, setting the properties specified by `props`. If the object has an updatedAt property, it will be set to the current time. Returns the updated object.
[ { "docid": "7d87b290346594fcb18183507feb24d4", "score": "0.74131966", "text": "update(index, props = undefined) {\n const normalizedIndex = index >= 0 ? index : this._objects.length + index;\n if (normalizedIndex >= this._objects.length || normalizedIndex < 0)\n throw new Error('invalid index');\n if (props != null && 'createdAt' in props) {\n // Objects are ordered in the store in order of creation. If the factory\n // returns objects with a createdAt property, then the objects should also\n // be ordered by createdAt. (The order by createdAt should match the\n // actual order of creation.) Because of that, update() does not support\n // updating an object's createdAt property.\n throw new Error('createdAt cannot be updated');\n }\n const object = this._objects[normalizedIndex];\n const updated = { ...object, ...props };\n if ('updatedAt' in object) updated.updatedAt = new Date().toISOString();\n this._objects[normalizedIndex] = updated;\n return updated;\n }", "title": "" } ]
[ { "docid": "df6890abed49bc0fbeac399fc738b46b", "score": "0.64379483", "text": "update(props) {\n Object.assign(this.props, props);\n return etch.update(this);\n }", "title": "" }, { "docid": "24dbb2a16daed7e631090b472334c526", "score": "0.6176881", "text": "async update(args, props) {\n const promises = [];\n promises.push(this.emit(\"update\", {\n args,\n props\n }));\n if (args && args.length) promises.push(this.emit(\"updateArgs\", args));\n if (props && Object.keys(props).length) promises.push(this.emit(\"updateProps\", props));\n await Promise.all(promises);\n return this;\n }", "title": "" }, { "docid": "b2eb742d9971f844d21c24dbbd44a5d1", "score": "0.6175281", "text": "function createUpdate(props) {\n var _props = props = inferTo(props),\n to = _props.to,\n from = _props.from; // Collect the keys affected by this update.\n\n\n var keys = new Set();\n\n if (from) {\n findDefined(from, keys);\n } else {\n // Falsy values are deleted to avoid merging issues.\n delete props.from;\n }\n\n if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_1__[\"is\"].obj(to)) {\n findDefined(to, keys);\n } else if (!to) {\n // Falsy values are deleted to avoid merging issues.\n delete props.to;\n } // The \"keys\" prop helps in applying updates to affected keys only.\n\n\n props.keys = keys.size ? Array.from(keys) : null;\n return props;\n}", "title": "" }, { "docid": "471e2cc2c110902e2369408ce8b25a77", "score": "0.59335864", "text": "update(obj) {\n for (var prop in obj) this[prop] = obj[prop];\n return this;\n }", "title": "" }, { "docid": "1e1dd2ab8fb116abe1c1cdb9ee6ddbc0", "score": "0.58693504", "text": "commitUpdate(instance, updatePayload, type, oldProps, newProps) {\n if (!shallowEqual(oldProps, newProps)) {\n instance.replaceProps(newProps);\n }\n }", "title": "" }, { "docid": "cddccd0b7d670835aea1c2f0aee622eb", "score": "0.58366835", "text": "update(id, obj) {\n // once we've udpated, we'll return the obj we updated it with\n if (id) {\n return obj;\n }\n }", "title": "" }, { "docid": "ea206917df16aea86d9ed3c77015febd", "score": "0.57787514", "text": "function updateProperty(object, property, updateValue){;\n object[String(property)] = updateValue; \n }", "title": "" }, { "docid": "82b7d51a1604da0acc81945a00dadadb", "score": "0.57034487", "text": "function update(updateObj) {\n var _this = this;\n\n var newDoc = (0, _modifyjs2['default'])(this._data, updateObj);\n\n Object.keys(this._data).forEach(function (previousPropName) {\n if (newDoc[previousPropName]) {\n // if we don't check inequality, it triggers an update attempt on fields that didn't really change,\n // which causes problems with \"readonly\" fields\n if (!(0, _deepEqual2['default'])(_this._data[previousPropName], newDoc[previousPropName])) _this._data[previousPropName] = newDoc[previousPropName];\n } else delete _this._data[previousPropName];\n });\n delete newDoc._rev;\n delete newDoc._id;\n Object.keys(newDoc).filter(function (newPropName) {\n return !(0, _deepEqual2['default'])(_this._data[newPropName], newDoc[newPropName]);\n }).forEach(function (newPropName) {\n return _this._data[newPropName] = newDoc[newPropName];\n });\n\n return this.save();\n}", "title": "" }, { "docid": "9a1ed9b76c23bb80ffbed9bacb60ca94", "score": "0.56902754", "text": "static updateObjProp(obj, value, propArray){\n let [head, ...rest] = propArray;\n if(!rest.length){\n obj[head] = value;\n }else{\n if(!LocalStore.isObject(obj[head])) obj[head] = {};\n LocalStore.updateObjProp(obj[head], value, rest);\n }\n }", "title": "" }, { "docid": "2f2ef589ad318de4caf18a46ef436f7f", "score": "0.5653979", "text": "_requestUpdate(a,b){let c=!0;// If we have a property key, perform property update steps.\n if(a!==void 0){const d=this.constructor,e=d._classProperties.get(a)||defaultPropertyDeclaration;d._valueHasChanged(this[a],b,e.hasChanged)?(!this._changedProperties.has(a)&&this._changedProperties.set(a,b),!0===e.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(a,e))):c=!1;}!this._hasRequestedUpdate&&c&&this._enqueueUpdate();}", "title": "" }, { "docid": "8628aff989bdf60a45384965a13f8c20", "score": "0.56447405", "text": "updateObject({ state, commit }, data) {\n commit('updateObject', data);\n }", "title": "" }, { "docid": "7a4470d89d12f0acdbdc375a153ec5e1", "score": "0.56271106", "text": "function updateObjectWithKeyAndValue(object, key, value) {\n return Object.assign({prop2: 2}, {prop: 1});\n}", "title": "" }, { "docid": "dc851fa631b46d363705d9d74aab9100", "score": "0.54976565", "text": "updateProps(newProps) {\n Object.assign(this.props, newProps);\n }", "title": "" }, { "docid": "2f1767b45c00e407b62de27232fce28d", "score": "0.5482596", "text": "_requestUpdate(name,oldValue){let shouldRequestUpdate=!0;// If we have a property key, perform property update steps.\nif(name!==void 0){const ctor=this.constructor,options=ctor._classProperties.get(name)||defaultPropertyDeclaration;if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changedProperties.has(name)){this._changedProperties.set(name,oldValue)}// Add to reflecting properties set.\n// Note, it's important that every change has a chance to add the\n// property to `_reflectingProperties`. This ensures setting\n// attribute + property reflects correctly.\nif(!0===options.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)){if(this._reflectingProperties===void 0){this._reflectingProperties=new Map}this._reflectingProperties.set(name,options)}}else{// Abort the request if the property should not be considered changed.\nshouldRequestUpdate=!1}}if(!this._hasRequestedUpdate&&shouldRequestUpdate){this._enqueueUpdate()}}", "title": "" }, { "docid": "8024f910403848f98bdb5aab2ef10388", "score": "0.547086", "text": "updateProperty(x, y, update) {\n if (this.allProperties[x] == null) {\n this.allProperties[x] = {};\n }\n this.allProperties[x][y] = Object.assign({}, this.allProperties[x][y] || {}, update);\n this.organizeProperty(x, y);\n }", "title": "" }, { "docid": "bb7a6d277c23bca9aebac6166e7ae472", "score": "0.5469671", "text": "update (object) {\n for (let [property, value] of Object.entries(object)) {\n if (!this.hasOwnProperty(property)) {\n console.log(`Error: ${this.constructor.name} model does not have '${property}' property`);\n return false;\n }\n // do not use dot notation to avoid creating new property as object.property\n this[ property ] = value;\n\n }\n return this; \n }", "title": "" }, { "docid": "b2208163f81a1599506e311610762058", "score": "0.5383351", "text": "function updateTableObject(patch, obj, updated) {\n const objectId = patch.objectId\n if (!updated[objectId]) {\n updated[objectId] = obj ? obj._clone() : instantiateTable(objectId)\n }\n\n const object = updated[objectId]\n\n for (let key of Object.keys(patch.props || {})) {\n const opIds = Object.keys(patch.props[key])\n\n if (opIds.length === 0) {\n object.remove(key)\n } else if (opIds.length === 1) {\n const subpatch = patch.props[key][opIds[0]]\n object._set(key, getValue(subpatch, object.byId(key), updated), opIds[0])\n } else {\n throw new RangeError('Conflicts are not supported on properties of a table')\n }\n }\n return object\n}", "title": "" }, { "docid": "4f86dc5a6add16fd028a04b44e220248", "score": "0.5373855", "text": "function updateObject(object, key, value) {\n // updateObject() : Should take an object, a key and a value.\n // Should update the property <key> on <object> with new <value>.\n // If <key> does not exist on <object> create it.\n object[key] = value;\n return object;\n}", "title": "" }, { "docid": "7f85829c45eaf6198663d9b1723eb61e", "score": "0.5326605", "text": "update(properties, eTag = \"*\", listItemEntityTypeFullName = null) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const removeDependency = this.addBatchDependency();\n const listItemEntityType = yield this.ensureListItemEntityTypeName(listItemEntityTypeFullName);\n const postBody = Object(_pnp_odata__WEBPACK_IMPORTED_MODULE_4__[\"body\"])(Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"assign\"])(Object(_utils_metadata_js__WEBPACK_IMPORTED_MODULE_6__[\"metadata\"])(listItemEntityType), properties), Object(_pnp_odata__WEBPACK_IMPORTED_MODULE_4__[\"headers\"])({\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n }));\n removeDependency();\n const poster = _telemetry_js__WEBPACK_IMPORTED_MODULE_9__[\"tag\"].configure(this.clone(Item).usingParser(new ItemUpdatedParser()), \"i.update\");\n const data = yield Object(_operations_js__WEBPACK_IMPORTED_MODULE_8__[\"spPost\"])(poster, postBody);\n return {\n data,\n item: this,\n };\n });\n }", "title": "" }, { "docid": "00254c49b20e6094583a084abc4986da", "score": "0.5316209", "text": "function updateObject(oldObject, newObject) {\n return Object.assign({}, oldObject, newObject);\n}", "title": "" }, { "docid": "f17f819a9bf764721974d307c5e3239e", "score": "0.5301845", "text": "function updateObject(object, key, value) {\n//input: Should take an object, a key and a value\n//output:Should update the property <key> on <object> with new <value>.\n// If <key> does not exist on <object> create it.\n\n//simply assign the object[key] to the given value\n//if the property does not exist, it will add it to the object\nobject[key] = value;\nreturn object\n}", "title": "" }, { "docid": "0e4890ecd379de31787291f9baffb757", "score": "0.5301707", "text": "function updateMapObject(patch, obj, updated) {\n\t\t\t\tvar objectId = patch.objectId;\n\t\t\t\tif (!updated[objectId]) {\n\t\t\t\t\tupdated[objectId] = cloneMapObject(obj, objectId);\n\t\t\t\t}\n\n\t\t\t\tvar object = updated[objectId];\n\t\t\t\tapplyProperties(patch.props, object, object[CONFLICTS], updated);\n\t\t\t\treturn object;\n\t\t\t}", "title": "" }, { "docid": "0542cbea116e583b969b9f9b4395fb24", "score": "0.5273998", "text": "async updateById(collectionId, id, newObject, updates) {\n // Wait for building to finish\n await this.building;\n\n // Filter to only top level key updates\n const topLevelUpdates = new Set(Array.from(updates).map(update => update.split('.')[0]));\n\n // Create new object for storing only updated keys\n const replaceObject = {};\n\n // Create new object for storing only unset keys\n const unsetObject = {};\n\n // Iterate updated keys\n for (const updatedKey of topLevelUpdates) {\n if (newObject[updatedKey] != null) {\n // Set replace object key-val to be from new object\n replaceObject[updatedKey] = newObject[updatedKey];\n } else {\n // Set field on unset object to be key from new object\n unsetObject[updatedKey] = 0;\n }\n }\n\n // Set mongodb-special field for unsetting fields\n if (Object.keys(unsetObject).length > 0) replaceObject.$unset = unsetObject;\n\n // Construct MQuery cursor from collection ID\n const mQuery = MQuery(this._db.collection(collectionId));\n\n // Find and update Model instance data by provided ID and replacement object\n await mQuery.where({ _id : ObjectId(id) }).update(replaceObject).exec();\n }", "title": "" }, { "docid": "826a6da03c1af570c6fabc0e812ca5bc", "score": "0.5253343", "text": "function updateMapObject(patch, obj, updated) {\n const objectId = patch.objectId\n if (!updated[objectId]) {\n updated[objectId] = cloneMapObject(obj, objectId)\n }\n\n const object = updated[objectId]\n applyProperties(patch.props, object, object[CONFLICTS], updated)\n return object\n}", "title": "" }, { "docid": "bb63fed474c10956c22e98a48a32d88b", "score": "0.5250989", "text": "update(propsArg) {\n if (!propsArg) return this;\n const props = interpolateTo(propsArg); // For async animations, the `from` prop must be defined for\n // the Animated nodes to exist before animations have started.\n\n this._ensureAnimated(props.from);\n\n this._ensureAnimated(props.to);\n\n props.timestamp = now(); // The `delay` prop of every update must be a number >= 0\n\n if (is.fun(props.delay) && is.obj(props.to)) {\n const from = props.from || emptyObj;\n\n for (const key in props.to) {\n this.queue.push(_extends({}, props, {\n to: {\n [key]: props.to[key]\n },\n from: key in from ? {\n [key]: from[key]\n } : void 0,\n delay: Math.max(0, Math.round(props.delay(key)))\n }));\n }\n } else {\n props.delay = is.num(props.delay) ? Math.max(0, Math.round(props.delay)) : 0; // Coerce falsy values to undefined for these props\n\n if (!props.to) props.to = void 0;\n if (!props.from) props.from = void 0;\n this.queue.push(props);\n }\n\n return this;\n }", "title": "" }, { "docid": "625e8f34a5a39ebd4b9595ed821438e4", "score": "0.5229379", "text": "componentWillUpdate (newProps, newState){\n\n }", "title": "" }, { "docid": "8138f7a2d99fb2336bd23d3c9a5f203e", "score": "0.5219523", "text": "function updateObject(object, key, value) {\n object[key] = value\n return object\n}", "title": "" }, { "docid": "750314c0403f29290134d7f3962d0cd6", "score": "0.5215503", "text": "function declareUpdate(props) {\n var update = createUpdate(props);\n\n if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_1__[\"is\"].und(update[\"default\"])) {\n update[\"default\"] = getDefaultProps(update, [// Avoid forcing `immediate: true` onto imperative updates.\n update.immediate === true && 'immediate']);\n }\n\n return update;\n}", "title": "" }, { "docid": "862877e66d2484446d2562add7c55c40", "score": "0.5211899", "text": "function update(obj, key, val) {\nlet newObj = {...obj}\nnewObj[key] = val\nreturn newObj\n}", "title": "" }, { "docid": "101955f49312d9722447ea0c7cc031da", "score": "0.52039057", "text": "function updateObject(object, key, value) {\n//Should take an object, a key and a value. Should update the property <key>\n//on <object> with new <value>. If <key> does not exist on <object> create it.\n//console.log(object, key, value);\n object[key] = value;\n return object;\n}", "title": "" }, { "docid": "ab670ddb0cf82bcc878810625d06ee63", "score": "0.52012783", "text": "updated(_changedProperties) { }", "title": "" }, { "docid": "fd0c46c2e0e44c5e907865d02cf2841d", "score": "0.5199047", "text": "function updateTableObject(patch, obj, updated) {\n\t\t\t\tvar objectId = patch.objectId;\n\t\t\t\tif (!updated[objectId]) {\n\t\t\t\t\tupdated[objectId] = obj ? obj._clone() : instantiateTable(objectId);\n\t\t\t\t}\n\n\t\t\t\tvar object = updated[objectId];\n\n\t\t\t\tvar _iteratorNormalCompletion3 = true;\n\t\t\t\tvar _didIteratorError3 = false;\n\t\t\t\tvar _iteratorError3 = undefined;\n\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator3 = Object.keys(patch.props || {})[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n\t\t\t\t\t\tvar key = _step3.value;\n\n\t\t\t\t\t\tvar values = {},\n\t\t\t\t\t\t\topIds = Object.keys(patch.props[key]);\n\n\t\t\t\t\t\tif (opIds.length === 0) {\n\t\t\t\t\t\t\tobject.remove(key);\n\t\t\t\t\t\t} else if (opIds.length === 1) {\n\t\t\t\t\t\t\tvar subpatch = patch.props[key][opIds[0]];\n\t\t\t\t\t\t\tobject._set(key, getValue(subpatch, object.byId(key), updated), opIds[0]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new RangeError('Conflicts are not supported on properties of a table');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError3 = true;\n\t\t\t\t\t_iteratorError3 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion3 && _iterator3.return) {\n\t\t\t\t\t\t\t_iterator3.return();\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError3) {\n\t\t\t\t\t\t\tthrow _iteratorError3;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn object;\n\t\t\t}", "title": "" }, { "docid": "97e4808bbe50badcf8bfeb55e8a6ec27", "score": "0.5197969", "text": "function updateObject(object, key, value) {\n object[key] = value;\n return object;\n}", "title": "" }, { "docid": "97e4808bbe50badcf8bfeb55e8a6ec27", "score": "0.5197969", "text": "function updateObject(object, key, value) {\n object[key] = value;\n return object;\n}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.51698226", "text": "update(){}", "title": "" }, { "docid": "f4d28382c17a69e872ad67d606dec3d1", "score": "0.5162825", "text": "function destructivelyUpdateObjectWithKeyAndValue(object, key, value) {\n object['prop'] = 1;\n object['prop2'] = 2;\n\n return object;\n}", "title": "" }, { "docid": "026f961c8adf233dfa6991d1b27358cd", "score": "0.51550686", "text": "function updateObject(object, key, value) {\n object[key] = value;\n return object;\n }", "title": "" }, { "docid": "67707145a94fcdd7ee00083db2785eb3", "score": "0.5145373", "text": "function updateObject(object, key, value) {\n object[key] = value;\n return object;\n }", "title": "" }, { "docid": "2a9ee7daedaeeebe4a213f4593c6da6f", "score": "0.51294696", "text": "setProp(key, value) {\n this.props[key] = value;\n this.timestamps[key] = now();\n return this;\n }", "title": "" }, { "docid": "243d8f9bdf0c53666aa9a63d141f3f3b", "score": "0.5117085", "text": "function update() {\n setUpdatedAt(Date.now());\n }", "title": "" }, { "docid": "9eca4630bbf86f8279eee25b4fa87bca", "score": "0.5109012", "text": "updateBook(obj){\n\t\tconst book = this.getBook(obj.id);\n\t\tbook.updateProperties(obj);\n\t\tthis.notifySubscribers();\n\t}", "title": "" }, { "docid": "14c1012f932bfe5fcf603aef66e0da0d", "score": "0.51080644", "text": "function updateObject(object, key, value) {\n\n}", "title": "" }, { "docid": "f99345e207de366d3df4567ec25885b9", "score": "0.5105725", "text": "componentWillReceiveProps(props) {\n this.props = props;\n this.update();\n }", "title": "" }, { "docid": "f99345e207de366d3df4567ec25885b9", "score": "0.5105725", "text": "componentWillReceiveProps(props) {\n this.props = props;\n this.update();\n }", "title": "" }, { "docid": "f99345e207de366d3df4567ec25885b9", "score": "0.5105725", "text": "componentWillReceiveProps(props) {\n this.props = props;\n this.update();\n }", "title": "" }, { "docid": "deabe719349968988e6d4585de9503af", "score": "0.5098082", "text": "static updateObject(key, value) {\n const oldVal = this.getObject(key);\n this.setObject(key, Object.assign(oldVal || {}, value));\n }", "title": "" }, { "docid": "6766ba6c7b43c521f10c427981b02b18", "score": "0.50970566", "text": "function updateObject(obj) {\n var newPoint = new Point(obj.point.x + obj.changeX, obj.point.y + obj.changeY);\n obj.point = newPoint;\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.50437737", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.50437737", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.50437737", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.50437737", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "f8f58ebfe6c1f3811e504a95887ae178", "score": "0.504357", "text": "function updateObject(object, key, value) {\n/**Should take an object, a key and a value. Should update the property <key> on \n * <object> with new <value>. If <key> does not exist on <object> create it.\n * \n * ok so we got an object which we're going to search update and return in the end\n * we need to loop through the object look for a key, if the object has the key\n * return the object with the new key and value if it doesn't we add a new key and \n * add the value\n */\n// let upObj = object;\n// let update = key;\n// for(let key in upObj){\n// if(upObj.hasOwnProperty(update) === true){\n// upObj.update = value;\n// }\n// else if(upObj.hasOwnProperty(update) === false){\n// upObj.update = value;\n// }\n// }\n// return upObj;\n// }\n\n// let agnes = {painter: true, country: \"canada\", friends: [\"arnie glimcher\"]};\n// updateObject(agnes, \"country\", \"U S A\");\n\n// updateObject(agnes, \"former city\", \"new york\");\n\n// updateObject(agnes, \"painter\", true);\n\nlet upObj = object;\n let keyAsString = key\n \n for(let key in upObj){\n if(key === keyAsString){\n upObj[keyAsString] = value;\n return upObj\n }\n else if(key !== keyAsString){\n \n upObj[keyAsString] = value\n return upObj;\n \n } else {\n return upObj;\n }\n }\n\n}", "title": "" }, { "docid": "0e3344d9eb1a17ed5537db8a9d7b36c3", "score": "0.5042205", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "0e3344d9eb1a17ed5537db8a9d7b36c3", "score": "0.5042205", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "7889e93b094a7179b6c53a282fa0caff", "score": "0.50347567", "text": "function patchProperty(obj, prop, value) {\r\n\t obj[prop] = value;\r\n\t}", "title": "" }, { "docid": "e16f71a2764e21512439e31ebcc7f7be", "score": "0.5030677", "text": "static update(parkID, updateObject) {\n console.log(parkID)\n console.log(updateObject)\n return fetch(`${REACT_APP_API_URL}/parks/${parkID}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(updateObject)\n }).then(res => res.json())\n }", "title": "" }, { "docid": "220e31b129d5a85172d69eec3b578dfb", "score": "0.5029513", "text": "function updateObject(object, key, value) {\nobject[key] = value;\n return object;\n}", "title": "" }, { "docid": "68e2853bb4143ce15f34f409feedb2a4", "score": "0.5026235", "text": "getUpdatedState(props = {}, state = {}) {\n return {\n ...state,\n ...props,\n };\n }", "title": "" }, { "docid": "37b0159cd8ed0b0d328f5d93e638d19c", "score": "0.50258744", "text": "function updateObject(object,key,value){\n\n object[key] = value;\n return object;\n }", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.50255466", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "0b2745105206e61e9265d1bbbd0f7bc4", "score": "0.5020368", "text": "function updateRecords(object, id, prop, value) {\n const array = Object.keys(object[id]);\n if (prop !== 'tracks' && value !== '') {\n if (array.includes(prop)) {\n object[id][prop] = value;\n } else {\n const obj = {}\n obj[prop] = value;\n Object.assign(object[id], obj);\n }\n } else if (prop === 'tracks' && !array.includes('tracks')) {\n const arr = [];\n arr.push(value);\n const obj = {};\n obj[prop] = arr;\n Object.assign(object[id], obj);\n } else if (prop === 'tracks' && value !== '') {\n object[id][prop].push(value);\n } else if (value === '' && prop !== '') {\n delete object[id][prop];\n }\n return object;\n}", "title": "" }, { "docid": "a8020381905dc5b52a4c15531c35e6a7", "score": "0.50066024", "text": "function updateObject(object, key, value) {\n\n //This function will take an object, key, and a value as an argument. If the\n //key exists on the object, the function will update it with the new value. If the\n //key does not exist, the function will create it\n object[key] = value;\n return object;\n}", "title": "" }, { "docid": "34873d006e2589ea08322ba1040dfe30", "score": "0.5005229", "text": "function patchProperty(obj, prop, value) {\n\t obj[prop] = value;\n\t}", "title": "" }, { "docid": "c88a051207d719f37e5bdb09fa45e71c", "score": "0.50027376", "text": "function interpretPatch(patch, obj, updated) {\n // Return original object if it already exists and isn't being modified\n if (isObject(obj) && (!patch.props || Object.keys(patch.props).length === 0) &&\n (!patch.edits || patch.edits.length === 0) && !updated[patch.objectId]) {\n return obj\n }\n\n if (patch.type === 'map') {\n return updateMapObject(patch, obj, updated)\n } else if (patch.type === 'table') {\n return updateTableObject(patch, obj, updated)\n } else if (patch.type === 'list') {\n return updateListObject(patch, obj, updated)\n } else if (patch.type === 'text') {\n return updateTextObject(patch, obj, updated)\n } else {\n throw new TypeError(`Unknown object type: ${patch.type}`)\n }\n}", "title": "" }, { "docid": "6baae0819243852e2a4df4fb2835d3e2", "score": "0.49948707", "text": "update(object) { \n debug('Update',object);\n let _id = this.options.key(object);\n return this.collection\n .then(collection => collection.updateOne(\n { _id }, \n this.options.entry(_id,object), \n {w : 1, upsert: true}));\n \n }", "title": "" }, { "docid": "23c17c742f15f06ba8b546e8b5fd5ac8", "score": "0.49867904", "text": "function updateObject(object, key, value) {\n\nif(object.hasOwnProperty(key) === Object.keys(object)){\n return object[key];\n} else {\n object[key] = value;\n}\nreturn object;\n}", "title": "" }, { "docid": "d1407f9c02f00d87311dbed531cbcf13", "score": "0.49784765", "text": "update() {\n this._timestamp = Date.now();\n }", "title": "" }, { "docid": "d1809d38e9b52f97ae477d0d7a8b6029", "score": "0.49684843", "text": "function updateObject(object, key, value) {\n if (object.hasOwnProperty(key) === true) {\n object[key] = value;\n } else {\n object[key] = value;\n }\n\n return object;\n}", "title": "" }, { "docid": "f513b2d442200f650a5a1b96b8d00f84", "score": "0.4955843", "text": "function update(id, obj, callback) {\n $.ajax({\n url: \"/items/\" + id,\n type: \"put\",\n data: JSON.stringify(obj)\n }).done(function (data) {\n callback(data);\n }).fail(displayError);\n }", "title": "" }, { "docid": "aee345f311873dddd891db291f833332", "score": "0.49439335", "text": "async update(id, update) {\n //NOTE {new: true} insures I get the object back after the change\n return await _repository.findByIdAndUpdate(id, update, { new: true });\n }", "title": "" }, { "docid": "da77e69329f439d2632f38330040a72c", "score": "0.4938397", "text": "function update(obj, key, val) {\n\n let newObj = {...obj};\n newObj[key] = val;\n console.log(newObj)\n\n\n}", "title": "" }, { "docid": "4db949ef7459afa7423b5b1128250ea8", "score": "0.4936778", "text": "function updateRecords(object, id, prop, value) {\n for (let record in object) {\n if (record == id) {\n }\n }\n return object;\n }", "title": "" }, { "docid": "d343e38ce641677d5aa432fb8e30e378", "score": "0.49146387", "text": "update(newState) {\n this.state = Object.assign({}, this.state, newState);\n return this.state;\n }", "title": "" }, { "docid": "f5475c499891fca36f2d4b379ede98f4", "score": "0.4903787", "text": "function updateObjectWithKeyAndValue(obj, key, value) {\n return Object.assign({}, obj, { [key]: value });\n}", "title": "" }, { "docid": "43f07d2ff097cf623d676ade19b405f9", "score": "0.48820052", "text": "updated(_changedProperties){}", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "cdc469f04764683183f7296eeead4261", "score": "0.48632953", "text": "updated(_changedProperties) {\n }", "title": "" } ]
8bd72493c5e279e30cc27416f64294df
initiate crop function with rectangle
[ { "docid": "760601284e406b927991b625c1a216f1", "score": "0.6949862", "text": "function startCropRect(){\n canvas.remove(el);\n if(canvas.getActiveObject()) { \n object=canvas.getActiveObject(); \n if (lastActive && lastActive !== object) {\n lastActive.clipTo = null; \n } \n el = new fabric.Rect({\n fill: 'transparent',\n originX: 'left',\n originY: 'top',\n stroke: '#ccc',\n strokeDashArray: [2, 2],\n opacity: 1,\n width: 1,\n height: 1,\n borderColor: '#36fd00',\n cornerColor: 'green',\n hasRotatingPoint:false,\n objectCaching: false\n }); \n el.left=canvas.getActiveObject().left;\n el.top=canvas.getActiveObject().top;\n el.width=canvas.getActiveObject().width*canvas.getActiveObject().scaleX;\n el.height=canvas.getActiveObject().height*canvas.getActiveObject().scaleY; \n canvas.add(el);\n canvas.setActiveObject(el)\n } \n else {\n alert(\"Please select an object or layer\");\n }\n }", "title": "" } ]
[ { "docid": "496f448d837f3a9509a63418973f9189", "score": "0.7304229", "text": "function cropImage(img, rect) {\nlet draw = new DrawContext()\ndraw.size = new Size(rect.width, rect.height)\ndraw.drawImageAtPoint(img, new Point(-rect.x, -rect.y))\nreturn draw.getImage()\n}", "title": "" }, { "docid": "776afd4b1b52960421c4d6e7bc60c1d1", "score": "0.72137594", "text": "function updateCropArea() {\n\n cropArea.setPosition(topLeft.getPosition());\n\n var width = topRight.x() - topLeft.x();\n var height = bottomLeft.y() - topLeft.y();\n\n cropArea.setSize({\n width: width,\n height: height\n });\n }", "title": "" }, { "docid": "bc27c6563626f3aca50c69b76df82ed4", "score": "0.7123111", "text": "function endCropRect(){\n var left = Math.floor(el.left - object.left);\n var top = Math.floor(el.top - object.top); \n var width = el.width;\n var height = el.height; \n object.clipTo = function (ctx) { \n // check for crop guides extending beyond image\n if (left < 0 || top < 0 || left > object.width/2 || top > object.height/2) { \n alert('Crop guides can not extend beyond image.');\n location.reload();\n } else {\n // crop image\n ctx.rect(-(width/2)+left, -(height/2)+top, parseInt(width*el.scaleX), parseInt(height*el.scaleY)); \n } \n } \n canvas.remove(canvas.getActiveObject(el));\n lastActive = object;\n canvas.renderAll(); \n }", "title": "" }, { "docid": "7210cf01a32c7751d221809be267b662", "score": "0.7071328", "text": "function cropImage(img,rect) {\n \n let draw = new DrawContext()\n draw.size = new Size(rect.width, rect.height)\n \n draw.drawImageAtPoint(img,new Point(-rect.x, -rect.y)) \n return draw.getImage()\n}", "title": "" }, { "docid": "7210cf01a32c7751d221809be267b662", "score": "0.7071328", "text": "function cropImage(img,rect) {\n \n let draw = new DrawContext()\n draw.size = new Size(rect.width, rect.height)\n \n draw.drawImageAtPoint(img,new Point(-rect.x, -rect.y)) \n return draw.getImage()\n}", "title": "" }, { "docid": "73bdb96a307d8f923017ca80a640e73e", "score": "0.70148665", "text": "function handleCropChange() {\n return action('cropChange')('[Cropping Rect]');\n}", "title": "" }, { "docid": "0fe22b0e071f7e43885fd4b1cf17bdae", "score": "0.6979043", "text": "function cropAndUpdate() {\n\n\t\tvar bounds = croppingRect.bounds;\n\t\tctx.drawImage(backgroundImage, bounds.x, bounds.y, bounds.width,\n\t\t\t\tbounds.height, 0, 0, canvas.width, canvas.height);\n\t\tbackgroundImage = null;\n\n\t}", "title": "" }, { "docid": "c38cd370b52b54500d17e3be24cdb6b4", "score": "0.6894033", "text": "function cropSelectedFragment(){\n\t\t\tif(existsFile && existsSelection){\n\t\t\t\tcontext.clearRect(selectionRectangle.x, selectionRectangle.y, selectionRectangle.width, selectionRectangle.height);\n\t\t\t\tcanvasBackground.src = canvas.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\n\t\t\t\n\t\t\t\tselectionRectangle.x = image.x;\n\t\t\t\tselectionRectangle.y = image.y;\n\t\t\t\tselectionRectangle.width = image.width;\n\t\t\t\tselectionRectangle.height = image.height;\n\t\t\t\t\n\t\t\t\toriginalSizeImage.src = generateImageFromRectangleSelection();\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\talert(\"No image / fragment to crop yet !\");\n\t\t\t\tthrow(\"No image / fragment to crop yet !\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "15a708defbe491652e2c2c7722f1b613", "score": "0.6873423", "text": "crop(clip) {\n this.resizeCanvas({\n clip,\n dimensions: clip.dimensions,\n });\n }", "title": "" }, { "docid": "4d5c9a7d78a34eb5ae8eb234dc5ac104", "score": "0.682925", "text": "function calculateCropBox() {\n runtimeCrop = cropperHelper.pixelsToCoordinates(scope.dimensions.image, scope.dimensions.cropper.width, scope.dimensions.cropper.height, 0);\n }", "title": "" }, { "docid": "65b5c0023aa359393cf2aff5344bb2bd", "score": "0.68178415", "text": "function crop() {\n\n\t\tvar bounds = croppingRect.bounds;\n\t\tnullifyImage();\n\t\treturn ctx\n\t\t\t\t.getImageData(bounds.x, bounds.y, bounds.width, bounds.height);\n\n\t}", "title": "" }, { "docid": "c8c2f51fb6b5c82cce5d8001cb747588", "score": "0.6799512", "text": "function cropImage(img,rect) {\n\n let draw = new DrawContext()\n draw.size = new Size(rect.width, rect.height)\n\n draw.drawImageAtPoint(img,new Point(-rect.x, -rect.y))\n return draw.getImage()\n }", "title": "" }, { "docid": "15663b4a5798acccfbd112764496a7cb", "score": "0.67834765", "text": "onPressPreview() {\n this._crop();\n }", "title": "" }, { "docid": "58291aa4a32bf90d7099e8052729ba78", "score": "0.6712743", "text": "function loadCropPreview() {\r\n\r\n\t// display crop preview\r\n\t$(document).ready(function() {\r\n\r\n\t\tvar imageW = $('#image-previewer')[0].naturalWidth; \r\n\t\tvar imageH = $('#image-previewer')[0].naturalHeight;\r\n\r\n\t\tvar cropperW = $(\"#image-previewer\").width();\r\n\t\tvar cropperH = $(\"#image-previewer\").height();\r\n\r\n\t\tvar length = Math.round($(\"#crop-detail-panel\").height());\r\n\t\tvar topLeftX = selectionPoints[0][0];\r\n\t\tvar topLeftY = selectionPoints[0][1];\r\n\t\tvar extrude = selectionPoints[1][0] - selectionPoints[0][0];\r\n\r\n\t\tvar transformedW = ((length/extrude) * imageW)/(imageW/cropperW);\r\n\t\tvar transformedH = ((length/extrude) * imageH)/(imageH/cropperH);\r\n\r\n\t\tvar actual_topLeftX = (topLeftX/cropperW) * imageW;\r\n\t\tvar actual_topLeftY = (topLeftY/cropperH) * imageH;\r\n\r\n\t\tvar transformed_topLeftX = (transformedW/imageW) * actual_topLeftX;\r\n\t\tvar transformed_topLeftY = (transformedH/imageH) * actual_topLeftY;\r\n\r\n\t\t$(\"#crop-previewer\").css({\r\n\t\t\t\"border\": \"1px solid black\",\r\n\r\n\t\t\t\"background-image\": \"url('imgs/\" + imgs[currentImage] + \"')\",\r\n\t\t\t\"background-repeat\": \"no-repeat\",\r\n\t\t\t\"background-attachment\": \"scroll\",\r\n\r\n\t\t\t\"background-size\": transformedW + \"px \" + transformedH + \"px\",\r\n\t\t\t\"background-position\": \r\n\t\t\t\t\"-\" + (transformed_topLeftX + 50) + \"px \" + \r\n\t\t\t\t\"-\" + (transformed_topLeftY + 34) + \"px\"\r\n\t\t});\r\n\r\n\t\t// store\r\n\t\tvar actual_extrude = (extrude/cropperW) * imageW;\r\n\r\n\t\tcropData.targetTopLeftX = Math.round(actual_topLeftX);\r\n\t\tcropData.targetTopLeftY = Math.round(actual_topLeftY);\r\n\t\tcropData.targetBottomRightX = Math.round(actual_topLeftX + actual_extrude);\r\n\t\tcropData.targetBottomRightY = Math.round(actual_topLeftY + actual_extrude);\r\n\r\n\t\tcropData.imageFilename = imgs[currentImage];\r\n\r\n\t\t// load table data\r\n\t\t$(\"#preview-filename\").html(imgs[currentImage]);\r\n\t\t$(\"#preview-x1\").html(Math.round(actual_topLeftX));\r\n\t\t$(\"#preview-y1\").html(Math.round(actual_topLeftY));\r\n\t\t$(\"#preview-x2\").html(Math.round(actual_topLeftX + actual_extrude));\r\n\t\t$(\"#preview-y2\").html(Math.round(actual_topLeftY + actual_extrude));\r\n\t\t$(\"#preview-extrusion\").html(Math.round(actual_extrude));\r\n\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "7e1ecdd58a41af61a1ea45293a93b64e", "score": "0.6628374", "text": "function showRect(centerX, centerY){\n //I reset the globalAlpha for ctx_cropped_bg because it was set to 0.3 when #}\n ctx_cropped_bg.globalAlpha=1;\n removeSelection();\n actualCropSize = Math.round(canvasWidth / canvas_bg_ori.width * cropSize);\n leftUpperPt_x = Math.round(centerX - actualCropSize/2);\n leftUpperPt_y = Math.round(centerY - actualCropSize/2);\n\n // stop moving when the box encountering the edge\n if (leftUpperPt_x < 0) leftUpperPt_x = 0;\n else if (leftUpperPt_x > canvasWidth - actualCropSize) leftUpperPt_x = canvasWidth - actualCropSize;\n\n if (leftUpperPt_y < 0) leftUpperPt_y = 0;\n else if (leftUpperPt_y > canvasHeight - actualCropSize) leftUpperPt_y = canvasHeight - actualCropSize;\n\n ctx_bg.shadowBlur = 5;\n ctx_bg.shadowColor = \"white\";\n ctx_bg.strokeStyle = 'white';\n ctx_bg.lineWidth = 10;\n ctx_bg.strokeRect(leftUpperPt_x, leftUpperPt_y, actualCropSize, actualCropSize);\n ctx_bg.strokeStyle = 'black';\n ctx_bg.lineWidth = 3;\n ctx_bg.strokeRect(leftUpperPt_x, leftUpperPt_y, actualCropSize, actualCropSize);\n ctx_bg.strokeStyle = 'white';\n ctx_bg.lineWidth = 1;\n ctx_bg.strokeRect(leftUpperPt_x, leftUpperPt_y, actualCropSize, actualCropSize);\n ctx_bg.stroke();\n}", "title": "" }, { "docid": "97cc9f782d5a6512ffd9c23d195bc3c2", "score": "0.6627995", "text": "async onPressCrop() {\n await this._crop();\n this.props.onCrop(this.state.croppedData);\n await sleep();\n this._closeDialog();\n }", "title": "" }, { "docid": "9c67f6478249009c85f43982a4e3e087", "score": "0.6627692", "text": "function endCropEl(){\n var left = Math.floor(el.left - object.left);\n var top = Math.floor(el.top - object.top);\n var width = el.rx;\n var height = el.ry; \n object.clipTo = function (ctx) { \n // check for crop guides extending beyond image & is in the shape of a circle \n if (el.scaleX !== el.scaleY) { \n alert('Can only crop with a circle');\n location.reload();\n } else if (left < 0 || top < 0 || width*el.scaleX > width) { \n alert('Crop guides can not extend beyond image.');\n location.reload();\n } else if (left > 0 && top > 0 && el.scaleX === 1 && el.scaleY === 1) {\n alert('Crop guides can not extend beyond image.');\n location.reload();\n } // check for crop parameters \n else if (parseInt(width*el.scaleX) === width || parseInt(height*el.scaleY) === width){\n ctx.ellipse(left, top, parseInt(width*el.scaleX), parseInt(height*el.scaleY), 45 * Math.PI/180, 0, 2 * Math.PI); \n } else { \n ctx.ellipse(-(width/2)+left, -(height/2)+top, parseInt(width*el.scaleX), parseInt(height*el.scaleY), 45 * Math.PI/180, 0, 2 * Math.PI); \n }\n }\n canvas.remove(canvas.getActiveObject(el));\n lastActive = object;\n canvas.renderAll(); \n }", "title": "" }, { "docid": "461f4e9990e445729c5ff47d000ce5f7", "score": "0.6599225", "text": "function CMobilizeCrop(\r\n\tstrUserImageFileName,\t\t\t// the user's image filename\r\n\tdxUserImage, dyUserImage,\t\t// width and height of the user's image\r\n\tdxUserPhone, dyUserPhone,\t\t// width and height of the user's phone display\r\n\tdxCropDisplay, dyCropDisplay,\t// width and height of space available to (parent of) HTML element idCropDisplayContainer\r\n\tdxPhoneDisplay, dyPhoneDisplay,\t// width and height of space available to (parent of) HTML element idPhoneDisplayContainer\r\n\txPhoneDisplay, yPhoneDisplay)\t// desired xy offset of image within the black phone display area\r\n{\r\n\t// Start of Program variables\r\n\r\n\t// Width of border around crop rectangle\r\n\tvar m_iBorderSize = 3;\r\n\r\n\t// Size of handles used to resize crop rectangle\r\n\tvar m_iHandleSize = 7;\r\n\r\n\t// User's image to crop\r\n\tvar m_strUserImageFileName = strUserImageFileName;\r\n\t\r\n\t// Size of user's image\r\n\tvar m_dxUserImage = dxUserImage;\r\n\tvar m_dyUserImage = dyUserImage;\r\n\r\n\t// Size of user's phone display\r\n\tvar m_dxUserPhone = dxUserPhone;\r\n\tvar m_dyUserPhone = dyUserPhone;\r\n\r\n\t// Size of crop display window\r\n\tvar m_dxCropDisplay = dxCropDisplay;\r\n\tvar m_dyCropDisplay = dyCropDisplay;\r\n\r\n\t// Location of the display in the image of the phone\r\n\tvar m_xPhoneDisplay = xPhoneDisplay;\r\n\tvar m_yPhoneDisplay = yPhoneDisplay;\r\n\r\n\t// Size of the display in the image of the phone\r\n\tvar m_dxPhoneDisplay = dxPhoneDisplay;\r\n\tvar m_dyPhoneDisplay = dyPhoneDisplay;\r\n\t\r\n\t// Fixed aspect ratio; width of crop rectangle relative to height\r\n\t// Set to 0 for no fixed aspect ratio\r\n\tvar m_fMaintainAspect = 0;\r\n\r\n\tvar m_bStretchToFit = false;\r\n\t\r\n\t// End of program variables\r\n\r\n\tvar m_iMinSize = (2 * (m_iHandleSize + m_iBorderSize)) + 1;\t// Minimum width and height of crop area\r\n\tvar m_bIsOpera = (navigator.userAgent.indexOf('Opera') >= 0);\r\n\r\n\tvar m_oPhoneDisplayContainer = null;\r\n\tvar m_oPhoneDisplayImage = null;\r\n\tvar m_oCropRect = null;\r\n\tvar m_oBorderRect = null;\r\n\tvar m_oTransparentL = null;\r\n\tvar m_oTransparentT = null;\r\n\tvar m_oTransparentR = null;\r\n\tvar m_oTransparentB = null; \r\n\tvar m_oHandle_lt = null;\r\n\tvar m_oHandle_lc = null;\r\n\tvar m_oHandle_lb = null;\r\n\tvar m_oHandle_ct = null;\r\n\tvar m_oHandle_cb = null;\r\n\tvar m_oHandle_rt = null;\r\n\tvar m_oHandle_rc = null;\r\n\tvar m_oHandle_rb = null;\r\n\tvar m_idHandle = null;\r\n\tvar m_bHandleMouseDown = false;\r\n\tvar m_bImageMouseDown = false;\r\n\tvar m_xDownMouse = 0;\r\n\tvar m_yDownMouse = 0;\r\n\tvar m_ixDown = 0;\r\n\tvar m_iyDown = 0;\r\n\tvar m_dxDown = 0;\r\n\tvar m_dyDown = 0;\r\n\tvar m_bMouseMoveEventInProgress = false;\r\n\t\r\n\tthis.Initialize = Initialize;\r\n\tfunction Initialize()\r\n\t{\r\n\t\t// Set events\r\n\t\tdocument.documentElement.ondragstart = OnElementCancelEvent;\r\n\t\tdocument.documentElement.onselectstart = OnElementCancelEvent;\r\n\t\tdocument.documentElement.onmousemove = OnElementMouseMove;\t\t\r\n\t\tdocument.documentElement.onmouseup = OnElementMouseUp;\t\t\r\n\t\t\r\n\t\tCreateElements();\r\n\t\tUpdatePhoneDisplay();\r\n\t\tSetHiddenCropValues();\r\n\t}\r\n\r\n\tthis.CreateElements = CreateElements;\r\n\tfunction CreateElements()\r\n\t{\r\n\t\tm_dxCropDisplay -= (2 * m_iHandleSize);\r\n\t\tm_dyCropDisplay -= (2 * m_iHandleSize);\r\n\t\tvar dxOrigCropDisplay = m_dxCropDisplay;\r\n\t\tvar dyOrigCropDisplay = m_dyCropDisplay;\r\n\r\n\t\t// If the user's image is smaller than the crop display, set the crop display to be the exact size of the image\r\n\t\tif (m_dxCropDisplay >= m_dxUserImage && m_dyCropDisplay >= m_dyUserImage)\r\n\t\t{\r\n\t\t\tm_dxCropDisplay = m_dxUserImage;\r\n\t\t\tm_dyCropDisplay = m_dyUserImage;\r\n\t\t}\r\n\r\n\t\t// Compute the scale factor that fits the user's image into the crop display window\r\n\t\tvar fxScale = ScaleToFit(m_dxUserImage, m_dyUserImage, m_dxCropDisplay, m_dyCropDisplay, true/*bUseSmallerFactor*/);\r\n\t\tvar fyScale = fxScale;\r\n\r\n\t\tm_dxCropDisplay = Math.round(m_dxUserImage * fxScale);\r\n\t\tm_dyCropDisplay = Math.round(m_dyUserImage * fyScale);\r\n\t\tvar xOffset = Math.max(0, Half(dxOrigCropDisplay - m_dxCropDisplay));\r\n\t\tvar yOffset = Math.max(0, Half(dyOrigCropDisplay - m_dyCropDisplay));\r\n\r\n\t\tvar oCropDisplayContainer = document.getElementById('idCropDisplayContainer');\r\n\t\toCropDisplayContainer.style.left = xOffset + 'px';\r\n\t\t// We don't need the yOffset because the HTML takes care of it\r\n\t\t// oCropDisplayContainer.style.top = yOffset + 'px';\r\n\r\n\t\tvar oCropDisplay = document.getElementById('idCropDisplay');\r\n\t\toCropDisplay.src = m_strUserImageFileName;\r\n\t\toCropDisplay.style.width = m_dxCropDisplay + 'px';\r\n\t\toCropDisplay.style.height = m_dyCropDisplay + 'px';\r\n\r\n\t\tm_oPhoneDisplayContainer = document.getElementById('idPhoneDisplayContainer'); // Set size and location in UpdatePhoneDisplay()\r\n\r\n\t\tm_oPhoneDisplayImage = document.getElementById('idPhoneDisplay'); // Set size in UpdatePhoneDisplay()\r\n\t\tm_oPhoneDisplayImage.src = m_strUserImageFileName;\r\n\r\n\t\tm_oTransparentL = document.createElement('DIV');\r\n\t\tm_oTransparentL.className = 'clsTransparent'; \r\n\t\tm_oTransparentL.style.left = '0px';\r\n\t\tm_oTransparentL.style.top = '0px';\r\n\t\tm_oTransparentL.style.height = m_dyCropDisplay + 'px';\r\n\t\tm_oTransparentL.style.width = '0px';\r\n\t\tm_oTransparentL.innerHTML = '<span></span>';\r\n\t\toCropDisplayContainer.appendChild(m_oTransparentL);\r\n\t\t\r\n\t\tm_oTransparentT = document.createElement('DIV');\r\n\t\tm_oTransparentT.className = 'clsTransparent'; \r\n\t\tm_oTransparentT.style.left = '0px';\r\n\t\tm_oTransparentT.style.top = '0px';\r\n\t\tm_oTransparentT.style.height = '0px';\r\n\t\tm_oTransparentT.style.width = m_dxCropDisplay + 'px';\r\n\t\tm_oTransparentT.innerHTML = '<span></span>';\r\n\t\toCropDisplayContainer.appendChild(m_oTransparentT);\r\n\t\t\r\n\t\tm_oTransparentR = document.createElement('DIV');\r\n\t\tm_oTransparentR.className = 'clsTransparent'; \r\n\t\tm_oTransparentR.style.left = m_dxCropDisplay + 'px';\r\n\t\tm_oTransparentR.style.top = '0px';\r\n\t\tm_oTransparentR.style.height = m_dyCropDisplay + 'px';\r\n\t\tm_oTransparentR.style.width = '0px';\t\t\r\n\t\tm_oTransparentR.innerHTML = '<span></span>';\r\n\t\toCropDisplayContainer.appendChild(m_oTransparentR); \r\n\t\t\r\n\t\tm_oTransparentB = document.createElement('DIV');\r\n\t\tm_oTransparentB.className = 'clsTransparent'; \r\n\t\tm_oTransparentB.style.left = '0px';\r\n\t\tm_oTransparentB.style.top = m_dyCropDisplay + 'px';\r\n\t\tm_oTransparentB.style.height = '0px';\r\n\t\tm_oTransparentB.style.width = m_dxCropDisplay + 'px';\r\n\t\tm_oTransparentB.innerHTML = '<span></span>';\r\n\t\toCropDisplayContainer.appendChild(m_oTransparentB); \r\n\t\t\r\n\t\tm_oBorderRect = document.createElement('DIV');\r\n\t\tm_oBorderRect.className = 'clsBorderRect';\r\n\t\tm_oBorderRect.style.left = 0 - m_iBorderSize + 'px';\r\n\t\tm_oBorderRect.style.top = 0 - m_iBorderSize + 'px';\r\n\t\tm_oBorderRect.style.width = m_dxCropDisplay + 'px';\r\n\t\tm_oBorderRect.style.height = m_dyCropDisplay + 'px';\r\n\t\tm_oBorderRect.innerHTML = '<div></div>'; \r\n\t\tm_oBorderRect.style.cursor = 'move';\r\n\t\tm_oBorderRect.style.borderWidth = m_iBorderSize + 'px';\r\n\t\toCropDisplayContainer.appendChild(m_oBorderRect); \r\n\t\t\r\n\t\tm_oCropRect = document.createElement('DIV');\r\n\t\tm_oCropRect.className = 'clsCropRect';\r\n\t\tm_oCropRect.style.left = '0px';\r\n\t\tm_oCropRect.style.top = '0px';\r\n\t\tm_oCropRect.style.width = m_dxCropDisplay + 'px';\r\n\t\tm_oCropRect.style.height = m_dyCropDisplay + 'px';\r\n\t\tm_oCropRect.innerHTML = '<div></div>'; \r\n\t\tm_oCropRect.style.cursor = 'move';\r\n\t\tm_oCropRect.onmousedown = OnImageMouseDown;\r\n\t\toCropDisplayContainer.appendChild(m_oCropRect);\r\n\t\t\r\n\t\tif (m_bIsOpera)\r\n\t\t{\r\n\t\t\tvar div = m_oCropRect.getElementsByTagName('DIV')[0];\r\n\t\t\tdiv.style.backgroundColor = 'transparent';\r\n\t\t\tm_oTransparentB.style.backgroundColor = 'transparent';\r\n\t\t\tm_oTransparentR.style.backgroundColor = 'transparent';\r\n\t\t\tm_oTransparentT.style.backgroundColor = 'transparent';\r\n\t\t\tm_oTransparentL.style.backgroundColor = 'transparent';\r\n\t\t}\r\n\t\t\r\n\t\tvar xl = -m_iHandleSize;\r\n\t\tvar xr = m_dxCropDisplay;\r\n\t\tvar xc = Half(xr + xl);\r\n\t\tvar yt = -m_iHandleSize;\r\n\t\tvar yb = m_dyCropDisplay;\r\n\t\tvar yc = Half(yb + yt);\r\n\t\t\r\n\t\tm_oHandle_lt = document.createElement('IMG');\r\n\t\tm_oHandle_lt.className = 'clsHandle'; \r\n\t\tm_oHandle_lt.style.left = xl + 'px';\r\n\t\tm_oHandle_lt.style.top = yt + 'px';\r\n\t\tm_oHandle_lt.style.width = m_iHandleSize + 'px';\r\n\t\tm_oHandle_lt.style.height = m_iHandleSize + 'px';\r\n\t\tm_oHandle_lt.style.cursor = 'nw-resize';\r\n\t\tm_oHandle_lt.id = 'nw-resize';\r\n\t\tm_oHandle_lt.onmousedown = OnHandleMouseDown;\r\n\t\tm_oCropRect.appendChild(m_oHandle_lt);\r\n\t\t\r\n\t\tm_oHandle_rt = document.createElement('IMG');\r\n\t\tm_oHandle_rt.className = 'clsHandle'; \r\n\t\tm_oHandle_rt.style.left = xr + 'px';\r\n\t\tm_oHandle_rt.style.top = yt + 'px';\t\t\r\n\t\tm_oHandle_rt.style.width = m_iHandleSize + 'px';\r\n\t\tm_oHandle_rt.style.height = m_iHandleSize + 'px';\r\n\t\tm_oHandle_rt.style.cursor = 'ne-resize';\r\n\t\tm_oHandle_rt.id = 'ne-resize';\r\n\t\tm_oHandle_rt.onmousedown = OnHandleMouseDown;\r\n\t\tm_oCropRect.appendChild(m_oHandle_rt);\r\n\t\t\r\n\t\tm_oHandle_lb = document.createElement('IMG');\r\n\t\tm_oHandle_lb.className = 'clsHandle'; \r\n\t\tm_oHandle_lb.style.left = xl + 'px';\r\n\t\tm_oHandle_lb.style.top = yb + 'px';\r\n\t\tm_oHandle_lb.style.width = m_iHandleSize + 'px';\r\n\t\tm_oHandle_lb.style.height = m_iHandleSize + 'px';\r\n\t\tm_oHandle_lb.style.cursor = 'sw-resize';\r\n\t\tm_oHandle_lb.id = 'sw-resize';\r\n\t\tm_oHandle_lb.onmousedown = OnHandleMouseDown;\r\n\t\tm_oCropRect.appendChild(m_oHandle_lb);\r\n\t\t\r\n\t\tm_oHandle_rb = document.createElement('IMG');\r\n\t\tm_oHandle_rb.className = 'clsHandle'; \r\n\t\tm_oHandle_rb.style.left = xr + 'px';\r\n\t\tm_oHandle_rb.style.top = yb + 'px';\r\n\t\tm_oHandle_rb.style.width = m_iHandleSize + 'px';\r\n\t\tm_oHandle_rb.style.height = m_iHandleSize + 'px';\r\n\t\tm_oHandle_rb.style.cursor = 'se-resize';\r\n\t\tm_oHandle_rb.id = 'se-resize';\r\n\t\tm_oHandle_rb.onmousedown = OnHandleMouseDown;\r\n\t\tm_oCropRect.appendChild(m_oHandle_rb);\r\n\t\t\r\n\t\tm_oHandle_ct = document.createElement('IMG');\r\n\t\tm_oHandle_ct.className = 'clsHandle'; \r\n\t\tm_oHandle_ct.style.left = xc + 'px';\r\n\t\tm_oHandle_ct.style.top = yt + 'px';\r\n\t\tm_oHandle_ct.style.width = m_iHandleSize + 'px';\r\n\t\tm_oHandle_ct.style.height = m_iHandleSize + 'px';\r\n\t\tm_oHandle_ct.style.cursor = 's-resize';\r\n\t\tm_oHandle_ct.id = 'n-resize';\r\n\t\tm_oHandle_ct.onmousedown = OnHandleMouseDown;\r\n\t\tm_oCropRect.appendChild(m_oHandle_ct);\r\n\t\t\r\n\t\tm_oHandle_cb = document.createElement('IMG');\r\n\t\tm_oHandle_cb.className = 'clsHandle'; \r\n\t\tm_oHandle_cb.style.left = xc + 'px';\r\n\t\tm_oHandle_cb.style.top = yb + 'px';\r\n\t\tm_oHandle_cb.style.width = m_iHandleSize + 'px';\r\n\t\tm_oHandle_cb.style.height = m_iHandleSize + 'px';\r\n\t\tm_oHandle_cb.style.cursor = 's-resize';\r\n\t\tm_oHandle_cb.id = 's-resize';\r\n\t\tm_oHandle_cb.onmousedown = OnHandleMouseDown;\r\n\t\tm_oCropRect.appendChild(m_oHandle_cb);\r\n\t\t\r\n\t\tm_oHandle_lc = document.createElement('IMG');\r\n\t\tm_oHandle_lc.className = 'clsHandle'; \r\n\t\tm_oHandle_lc.style.left = xl + 'px';\r\n\t\tm_oHandle_lc.style.top = yc + 'px';\r\n\t\tm_oHandle_lc.style.width = m_iHandleSize + 'px';\r\n\t\tm_oHandle_lc.style.height = m_iHandleSize + 'px';\r\n\t\tm_oHandle_lc.style.cursor = 'e-resize';\r\n\t\tm_oHandle_lc.id = 'w-resize';\r\n\t\tm_oHandle_lc.onmousedown = OnHandleMouseDown;\r\n\t\tm_oCropRect.appendChild(m_oHandle_lc);\t\r\n\t\t\r\n\t\tm_oHandle_rc = document.createElement('IMG');\r\n\t\tm_oHandle_rc.className = 'clsHandle'; \r\n\t\tm_oHandle_rc.style.left = xr + 'px';\r\n\t\tm_oHandle_rc.style.top = yc + 'px';\r\n\t\tm_oHandle_rc.style.width = m_iHandleSize + 'px';\r\n\t\tm_oHandle_rc.style.height = m_iHandleSize + 'px';\r\n\t\tm_oHandle_rc.style.cursor = 'e-resize';\r\n\t\tm_oHandle_rc.id = 'e-resize';\r\n\t\tm_oHandle_rc.onmousedown = OnHandleMouseDown;\r\n\t\tm_oCropRect.appendChild(m_oHandle_rc);\t\t\r\n\t}\r\n\r\n\tthis.OnImageMouseDown = OnImageMouseDown;\r\n\tfunction OnImageMouseDown(e)\r\n\t{\r\n\t\tif (document.all)\r\n\t\t\te = event;\r\n\t\tif (e.target)\r\n\t\t\tsource = e.target;\r\n\t\telse\r\n\t\tif (e.srcElement)\r\n\t\t\tsource = e.srcElement;\r\n\t\tif (source.nodeType == 3) // defeat Safari bug\r\n\t\t\tsource = source.parentNode;\r\n\t\tif (source.id && source.id.indexOf('resize') >= 0)\r\n\t\t\treturn;\t\r\n\t\t\r\n\t\tm_xDownMouse = e.clientX;\r\n\t\tm_yDownMouse = e.clientY;\t\t\r\n\t\tm_ixDown = Int(m_oCropRect.style.left);\r\n\t\tm_iyDown = Int(m_oCropRect.style.top);\r\n\t\tm_dxDown = Int(m_oCropRect.style.width);\r\n\t\tm_dyDown = Int(m_oCropRect.style.height);\t\t\r\n\t\t\r\n\t\tm_bImageMouseDown = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\tthis.OnHandleMouseDown = OnHandleMouseDown;\r\n\tfunction OnHandleMouseDown(e)\r\n\t{\r\n\t\tif (document.all)\r\n\t\t\te = event;\r\n\t\t\r\n\t\tm_oCropRect.style.cursor = 'default';\r\n\t\tm_idHandle = this.id;\r\n\r\n\t\tm_xDownMouse = e.clientX;\r\n\t\tm_yDownMouse = e.clientY;\r\n\t\tm_ixDown = Int(m_oCropRect.style.left);\r\n\t\tm_iyDown = Int(m_oCropRect.style.top);\r\n\t\tm_dxDown = Int(m_oCropRect.style.width);\r\n\t\tm_dyDown = Int(m_oCropRect.style.height);\r\n\t\t\r\n\t\tif (document.all)\r\n\t\t{\r\n\t\t\tvar div = m_oCropRect.getElementsByTagName('DIV')[0];\r\n\t\t\tdiv.style.display = 'none';\r\n\t\t}\r\n\t\t\t\t\r\n\t\tm_bHandleMouseDown = true;\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tthis.OnElementCancelEvent = OnElementCancelEvent;\r\n\tfunction OnElementCancelEvent(e)\r\n\t{\r\n\t\tif (document.all)\r\n\t\t\te = event;\r\n\t\tif (e.target)\r\n\t\t\tsource = e.target;\r\n\t\telse\r\n\t\tif (e.srcElement)\r\n\t\t\tsource = e.srcElement;\r\n\t\tif (source.nodeType == 3) // defeat Safari bug\r\n\t\t\tsource = source.parentNode;\r\n\t\t\t\t\t\t\r\n\t\tif (source.tagName && source.tagName.toLowerCase() == 'input')\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tthis.OnElementMouseMove = OnElementMouseMove;\r\n\tfunction OnElementMouseMove(e)\r\n\t{\r\n\t\tif (m_bMouseMoveEventInProgress)\r\n\t\t\treturn;\r\n\t\tif (!m_bImageMouseDown && !m_bHandleMouseDown)\r\n\t\t\treturn;\r\n\t\tif (document.all)\r\n\t\t\tm_bMouseMoveEventInProgress = true;\r\n\t\tif (document.all)\r\n\t\t\te = event;\r\n\r\n\t\tvar dxMouse = e.clientX - m_xDownMouse;\r\n\t\tvar dyMouse = e.clientY - m_yDownMouse;\r\n\r\n\t\t// Move the crop handle\r\n\t\tif (m_bHandleMouseDown)\r\n\t\t{\r\n\t\t\tvar L = Int(m_oCropRect.style.left);\r\n\t\t\tvar T = Int(m_oCropRect.style.top);\r\n\t\t\tvar R = Int(m_oCropRect.style.width) + L;\r\n\t\t\tvar B = Int(m_oCropRect.style.height) + T;\r\n\t\t\t\r\n\t\t\tif (m_idHandle == 'w-resize' || m_idHandle == 'sw-resize' || m_idHandle == 'nw-resize')\r\n\t\t\t{\r\n\t\t\t\tvar LDown = m_ixDown;\r\n\t\t\t\tL = LDown + dxMouse;\r\n\t\t\t\tif (L > R - m_iMinSize)\r\n\t\t\t\t\tL = R - m_iMinSize;\r\n\t\t\t\tif (L < 0)\r\n\t\t\t\t\tL = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (m_idHandle == 'e-resize' || m_idHandle == 'ne-resize' || m_idHandle == 'se-resize')\r\n\t\t\t{\r\n\t\t\t\tvar RDown = L + m_dxDown;\r\n\t\t\t\tR = RDown + dxMouse;\r\n\t\t\t\tif (R < L + m_iMinSize)\r\n\t\t\t\t\tR = L + m_iMinSize;\r\n\t\t\t\tif (R > m_dxCropDisplay)\r\n\t\t\t\t\tR = m_dxCropDisplay;\r\n\t\t\t}\r\n\r\n\t\t\tif (m_idHandle == 'n-resize' || m_idHandle == 'nw-resize' || m_idHandle == 'ne-resize')\r\n\t\t\t{\r\n\t\t\t\tvar TDown = m_iyDown;\r\n\t\t\t\tT = TDown + dyMouse;\r\n\t\t\t\tif (T > B - m_iMinSize)\r\n\t\t\t\t\tT = B - m_iMinSize;\r\n\t\t\t\tif (T < 0)\r\n\t\t\t\t\tT = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (m_idHandle == 's-resize' || m_idHandle == 'sw-resize' || m_idHandle == 'se-resize')\r\n\t\t\t{\r\n\t\t\t\tvar BDown = T + m_dyDown;\r\n\t\t\t\tB = BDown + dyMouse;\r\n\t\t\t\tif (B < T + m_iMinSize)\r\n\t\t\t\t\tB = T + m_iMinSize;\r\n\t\t\t\tif (B > m_dyCropDisplay)\r\n\t\t\t\t\tB = m_dyCropDisplay;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (m_fMaintainAspect) // Preserve Aspect Ratio\r\n\t\t\t{\r\n\t\t\t\tvar dx = R - L;\r\n\t\t\t\tvar dy = B - T;\r\n\t\t\t\tvar fAspect = dx / dy;\r\n\t\t\t\tif (fAspect < m_fMaintainAspect)\r\n\t\t\t\t\tdy = Math.round(dx / m_fMaintainAspect); // Reduce dy\r\n\t\t\t\telse\r\n\t\t\t\t\tdx = Math.round(dy * m_fMaintainAspect); // Reduce dx\r\n\r\n\t\t\t\tif (m_idHandle == 'se-resize')\r\n\t\t\t\t{ // Anchor is LT\r\n\t\t\t\t\tR = L + dx;\r\n\t\t\t\t\tB = T + dy;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (m_idHandle == 'nw-resize')\r\n\t\t\t\t{ // Anchor is RB\r\n\t\t\t\t\tL = R - dx;\r\n\t\t\t\t\tT = B - dy;\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tif (m_idHandle == 'sw-resize')\r\n\t\t\t\t{ // Anchor is RT\r\n\t\t\t\t\tL = R - dx;\r\n\t\t\t\t\tB = T + dy;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (m_idHandle == 'ne-resize')\r\n\t\t\t\t{ // Anchor is LB\r\n\t\t\t\t\tR = L + dx;\r\n\t\t\t\t\tT = B - dy;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tm_oCropRect.style.left = L + 'px';\r\n\t\t\tm_oCropRect.style.top = T + 'px';\r\n\t\t\tm_oCropRect.style.width = (R - L) + 'px';\r\n\t\t\tm_oCropRect.style.height = (B - T) + 'px';\r\n\t\t}\r\n\t\t\r\n\t\t// Move the crop window\r\n\t\tif (m_bImageMouseDown)\r\n\t\t{\r\n\t\t\tvar ix = Int(m_oCropRect.style.left);\r\n\t\t\tvar iy = Int(m_oCropRect.style.top);\r\n\r\n\t\t\tix = m_ixDown + dxMouse;\r\n\t\t\tif (ix < 0)\r\n\t\t\t\tix = 0;\r\n\t\t\tif (ix > m_dxCropDisplay - m_dxDown)\r\n\t\t\t\tix = m_dxCropDisplay - m_dxDown;\r\n\t\t\tiy = m_iyDown + dyMouse;\r\n\t\t\tif (iy < 0)\r\n\t\t\t\tiy = 0;\r\n\t\t\tif (iy > m_dyCropDisplay - m_dyDown)\r\n\t\t\t\tiy = m_dyCropDisplay - m_dyDown;\r\n\r\n\t\t\tm_oCropRect.style.left = ix + 'px';\r\n\t\t\tm_oCropRect.style.top = iy + 'px';\r\n\t\t}\r\n\t\t\r\n\t\tif (m_bHandleMouseDown || m_bImageMouseDown)\r\n\t\t{\r\n\t\t\tRepositionElements();\r\n\t\t\tUpdatePhoneDisplay();\r\n\t\t\tSetHiddenCropValues();\r\n\t\t}\r\n\r\n\t\tm_bMouseMoveEventInProgress = false;\r\n\t}\r\n\t\r\n\tthis.OnElementMouseUp = OnElementMouseUp;\r\n\tfunction OnElementMouseUp()\r\n\t{\r\n\t\tm_bHandleMouseDown = false;\r\n\t\tm_bImageMouseDown = false;\r\n\t\tm_oCropRect.style.cursor = 'move';\r\n\t\tif (document.all)\r\n\t\t{\r\n\t\t\tvar div = m_oCropRect.getElementsByTagName('DIV')[0];\r\n\t\t\tdiv.style.display = 'block';\r\n\t\t}\r\n\t}\r\n\t\r\n\tthis.OnFreeform = OnFreeform;\r\n\tfunction OnFreeform()\r\n\t{\r\n\t\tm_fMaintainAspect = 0;\r\n\t\tm_bStretchToFit = false;\r\n\t\tRepositionElements();\r\n\t\tUpdatePhoneDisplay();\r\n\t\tSetHiddenCropValues();\r\n\t}\r\n\r\n\tthis.OnStretchToFit = OnStretchToFit;\r\n\tfunction OnStretchToFit()\r\n\t{\r\n\t\tm_fMaintainAspect = 0;\r\n\t\tm_bStretchToFit = true;\r\n\t\tRepositionElements();\r\n\t\tUpdatePhoneDisplay();\r\n\t\tSetHiddenCropValues();\r\n\t}\r\n\r\n\tthis.OnMaintainAspect = OnMaintainAspect;\r\n\tfunction OnMaintainAspect()\r\n\t{\r\n\t\tm_fMaintainAspect = m_dxPhoneDisplay / m_dyPhoneDisplay;\r\n\t\tm_bStretchToFit = false;\r\n\t\tCorrectAspect();\r\n\t\tRepositionElements();\r\n\t\tUpdatePhoneDisplay();\r\n\t\tSetHiddenCropValues();\r\n\t}\r\n\r\n\tthis.CorrectAspect = CorrectAspect;\r\n\tfunction CorrectAspect()\r\n\t{\r\n\t\tif (!m_fMaintainAspect)\r\n\t\t\treturn;\r\n\r\n\t\tvar dx = Int(m_oCropRect.style.width);\r\n\t\tvar dy = Int(m_oCropRect.style.height);\r\n\r\n\t\tvar fAspect = dx / dy;\r\n\t\tif (fAspect < m_fMaintainAspect)\r\n\t\t\tdy = Math.round(dx / m_fMaintainAspect); // Reduce dy\r\n\t\telse\r\n\t\t\tdx = Math.round(dy * m_fMaintainAspect); // Reduce dx\r\n\r\n\t\tm_oCropRect.style.width = dx + 'px';\r\n\t\tm_oCropRect.style.height = dy + 'px';\r\n\t}\r\n\r\n\tthis.RepositionElements = RepositionElements;\r\n\tfunction RepositionElements()\r\n\t{\r\n\t\tvar ix = Int(m_oCropRect.style.left);\r\n\t\tvar iy = Int(m_oCropRect.style.top);\r\n\t\tvar dx = Int(m_oCropRect.style.width);\r\n\t\tvar dy = Int(m_oCropRect.style.height);\r\n\r\n\t\t// Repostion the transparent rectangles\r\n\t\tm_oTransparentL.style.width = ix + 'px';\r\n\r\n\t\tm_oTransparentR.style.left = (dx + ix) + 'px';\r\n\t\tm_oTransparentR.style.width = (m_dxCropDisplay - dx - ix) + 'px';\r\n\r\n\t\tm_oTransparentT.style.left = ix + 'px';\r\n\t\tm_oTransparentT.style.height = iy + 'px';\r\n\t\tm_oTransparentT.style.width = dx + 'px' ;\r\n\r\n\t\tm_oTransparentB.style.left = ix + 'px';\r\n\t\tm_oTransparentB.style.top = (dy + iy) + 'px';\r\n\t\tm_oTransparentB.style.height = (m_dyCropDisplay - dy - iy) + 'px';\r\n\t\tm_oTransparentB.style.width = dx + 'px' ;\r\n\t\t\r\n\t\tm_oTransparentL.style.visibility = (m_oTransparentL.style.width == '0px' ? 'hidden' : 'visible');\r\n\t\tm_oTransparentR.style.visibility = (m_oTransparentR.style.width == '0px' ? 'hidden' : 'visible');\r\n\t\tm_oTransparentT.style.visibility = (m_oTransparentT.style.width == '0px' ? 'hidden' : 'visible');\r\n\t\tm_oTransparentB.style.visibility = (m_oTransparentB.style.width == '0px' ? 'hidden' : 'visible');\r\n\r\n\t\t// Repostion the border rectangle\r\n\t\tm_oBorderRect.style.left = ix - m_iBorderSize + 'px';\r\n\t\tm_oBorderRect.style.top = iy - m_iBorderSize + 'px';\r\n\t\tm_oBorderRect.style.width = dx + 'px';\r\n\t\tm_oBorderRect.style.height = dy + 'px';\r\n\r\n\t\t// Reposition the handles\r\n\t\tvar xl = Int(m_oHandle_lt.style.left);\r\n\t\tvar yt = Int(m_oHandle_lt.style.top);\r\n\r\n\t\tvar xr = dx;\r\n\t\tm_oHandle_rt.style.left = xr + 'px';\r\n\t\tm_oHandle_rc.style.left = xr + 'px';\r\n\t\tm_oHandle_rb.style.left = xr + 'px';\r\n\r\n\t\tvar yb = dy;\r\n\t\tm_oHandle_rb.style.top = yb + 'px';\r\n\t\tm_oHandle_cb.style.top = yb + 'px';\r\n\t\tm_oHandle_lb.style.top = yb + 'px';\r\n\r\n\t\tvar xc = Half(xr + xl);\r\n\t\tm_oHandle_ct.style.left = xc + 'px';\r\n\t\tm_oHandle_cb.style.left = xc + 'px';\r\n\r\n\t\tvar yc = Half(yb + yt);\r\n\t\tm_oHandle_lc.style.top = yc + 'px';\r\n\t\tm_oHandle_rc.style.top = yc + 'px';\r\n\t\t\r\n\t\tm_oHandle_lc.style.visibility = (m_fMaintainAspect ? 'hidden' : 'visible');\r\n\t\tm_oHandle_rc.style.visibility = (m_fMaintainAspect ? 'hidden' : 'visible');\r\n\t\tm_oHandle_ct.style.visibility = (m_fMaintainAspect ? 'hidden' : 'visible');\r\n\t\tm_oHandle_cb.style.visibility = (m_fMaintainAspect ? 'hidden' : 'visible');\r\n\t}\r\n\t\r\n\tthis.UpdatePhoneDisplay = UpdatePhoneDisplay;\r\n\tfunction UpdatePhoneDisplay()\r\n\t{\r\n\t\tvar ix = Int(m_oCropRect.style.left);\r\n\t\tvar iy = Int(m_oCropRect.style.top);\r\n\t\tvar dx = Int(m_oCropRect.style.width);\r\n\t\tvar dy = Int(m_oCropRect.style.height);\r\n\r\n\t\t// Compute the scale factor that fits the cropped image into the phone display\r\n\t\tvar fxScale = 0;\r\n\t\tvar fyScale = 0;\r\n\t\tif (m_bStretchToFit)\r\n\t\t{\r\n\t\t\tfxScale = Scale(dx, m_dxPhoneDisplay);\r\n\t\t\tfyScale = Scale(dy, m_dyPhoneDisplay);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar dxImage = dx;\r\n\t\t\tvar dyImage = dy;\r\n\r\n\t\t\t// If the user's image is smaller than the user's phone, set the scale differently\r\n\t\t\tif (!m_fMaintainAspect && m_dxUserPhone >= m_dxUserImage && m_dyUserPhone >= m_dyUserImage)\r\n\t\t\t{\r\n\t\t\t\tdxImage = m_dxUserPhone;\r\n\t\t\t\tdyImage = m_dyUserPhone;\r\n\t\t\t}\r\n\r\n\t\t\tfxScale = fyScale = ScaleToFit(dxImage, dyImage, m_dxPhoneDisplay, m_dyPhoneDisplay, true/*bUseSmallerFactor*/);\r\n\t\t}\r\n\r\n\t\tvar ixPhoneDisplayContainer = Math.round(ix * fxScale);\r\n\t\tvar iyPhoneDisplayContainer = Math.round(iy * fyScale);\r\n\t\tvar dxPhoneDisplayContainer = Math.round(dx * fxScale);\r\n\t\tvar dyPhoneDisplayContainer = Math.round(dy * fyScale);\r\n\r\n\t\t// Hide the Container and the Image (to avoid flicker when changing display attributes)\r\n\t\tm_oPhoneDisplayContainer.style.visibility = 'hidden';\r\n\t\tm_oPhoneDisplayImage.style.visibility = 'hidden';\r\n\r\n\t\tvar dxPhoneDisplayImage = Math.round(m_dxCropDisplay * fxScale);\r\n\t\tvar dyPhoneDisplayImage = Math.round(m_dyCropDisplay * fyScale);\r\n\t\tm_oPhoneDisplayImage.style.width = dxPhoneDisplayImage + 'px';\r\n\t\tm_oPhoneDisplayImage.style.height = dyPhoneDisplayImage + 'px';\r\n\r\n\t\t// Since we are centering the container in the parent, the parent should use style=\"text-align:left; vertical-align:top;\"\r\n\t\tm_oPhoneDisplayContainer.style.left = m_xPhoneDisplay + Half(m_dxPhoneDisplay - dxPhoneDisplayContainer) + 'px';\r\n\t\tm_oPhoneDisplayContainer.style.top = m_yPhoneDisplay + Half(m_dyPhoneDisplay - dyPhoneDisplayContainer) + 'px';\r\n\t\tm_oPhoneDisplayContainer.style.width = dxPhoneDisplayContainer + 'px';\r\n\t\tm_oPhoneDisplayContainer.style.height = dyPhoneDisplayContainer + 'px';\r\n\t\tm_oPhoneDisplayContainer.scrollLeft = ixPhoneDisplayContainer;\r\n\t\tm_oPhoneDisplayContainer.scrollTop = iyPhoneDisplayContainer;\r\n\r\n\t\t// Show the Container and the Image\r\n\t\tm_oPhoneDisplayContainer.style.visibility = 'visible';\r\n\t\tm_oPhoneDisplayImage.style.visibility = 'visible';\r\n\t}\r\n\t\r\n\tthis.SetHiddenCropValues = SetHiddenCropValues;\r\n\tfunction SetHiddenCropValues()\r\n\t{\r\n\t\tvar ix = Int(m_oCropRect.style.left);\r\n\t\tvar iy = Int(m_oCropRect.style.top);\r\n\t\tvar dx = Int(m_oCropRect.style.width);\r\n\t\tvar dy = Int(m_oCropRect.style.height);\r\n\r\n\t\tvar fxScale = m_dxUserImage / m_dxCropDisplay;\r\n\t\tvar fyScale = m_dyUserImage / m_dyCropDisplay;\r\n\r\n\t\tdocument.getElementById('idCropIX').value = Math.round(ix * fxScale);\r\n\t\tdocument.getElementById('idCropIY').value = Math.round(iy * fyScale);\r\n\t\tdocument.getElementById('idCropDX').value = Math.round(dx * fxScale);\r\n\t\tdocument.getElementById('idCropDY').value = Math.round(dy * fyScale);\r\n\r\n\t\tif (m_bStretchToFit)\r\n\t\t{\r\n\t\t\tdocument.getElementById('idSizeDX').value = m_dxUserPhone;\r\n\t\t\tdocument.getElementById('idSizeDY').value = m_dyUserPhone;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfxScale = fyScale = ScaleToFit(dx, dy, m_dxUserPhone, m_dyUserPhone, true/*bUseSmallerFactor*/);\r\n\t\t\tdocument.getElementById('idSizeDX').value = Math.round(dx * fyScale);\r\n\t\t\tdocument.getElementById('idSizeDY').value = Math.round(dy * fyScale);\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tthis.ScaleToFit = ScaleToFit;\r\n\tfunction ScaleToFit(dxSrc, dySrc, dxDst, dyDst, bUseSmallerFactor)\r\n\t{\r\n\t\t// Scale the source to fit the destination\r\n\t\tvar fxScale = dxDst / dxSrc;\r\n\t\tvar fyScale = dyDst / dySrc;\r\n\t\treturn (bUseSmallerFactor ? Math.min(fxScale, fyScale) : Math.max(fxScale, fyScale));\r\n\t}\r\n\r\n\tthis.Scale = Scale;\r\n\tfunction Scale(dxSrc, dxDst)\r\n\t{\r\n\t\t// Scale the source to fit the destination\r\n\t\treturn dxDst / dxSrc;\r\n\t}\r\n\r\n\tthis.Int = Int;\r\n\tfunction Int(str)\r\n\t{\r\n\t\treturn str.replace('px','')/1;\r\n\t}\r\n\r\n\tthis.Half = Half;\r\n\tfunction Half(val)\r\n\t{\r\n\t\treturn Math.floor(val / 2);\r\n\t}\r\n}", "title": "" }, { "docid": "2897c80dc4bba08133518411ecf802af", "score": "0.6575212", "text": "cropARegion(e) {\n if (this.state.type != \"dummy\") {\n var left_padding = $('.img-group').css(\"margin-left\");\n var left_padding = left_padding.substring(0, left_padding.length - 2);\n var total_left = (e.pageX + window.pageXOffset);\n var mouseX = total_left - left_padding;\n\n var bodyRect = document.body.getBoundingClientRect()\n var elemRect = document.getElementsByClassName(\"img-mask\")[0].getBoundingClientRect();\n var elem_top = elemRect.top - bodyRect.top;\n var total_top = e.pageY + window.pageYOffset;;\n var mouseY = total_top - elem_top;\n\n if (this.state.rectStatus == 0) {\n var mouse_first_pos = [mouseX, mouseY, 0, 0];\n this.setState({\n rectStatus: 1,\n mouse_pos: mouse_first_pos,\n message: \"Top left corner of mask selected\"\n });\n $('.img-mask').css( 'cursor', 'crosshair' );\n $('.dot-mask').css( {'left': mouseX, 'top': mouseY, 'opacity': 1});\n $('.rect-mask').css( {'left': mouseX, 'top': mouseY, 'opacity': 0});\n } else if (this.state.rectStatus == 1){\n var mouse_second_pos = this.state.mouse_pos;\n mouse_second_pos[2] = mouseX;\n mouse_second_pos[3] = mouseY;\n this.setState({\n rectStatus: 2,\n mouse_pos: mouse_second_pos,\n message: \"Mask completed. Click generate to proceed\"\n });\n $('.img-mask').css( 'cursor', 'pointer' );\n $('.dot-mask').css( {'opacity': 0});\n $('.rect-mask').css( {\n 'width': mouse_second_pos[2] - mouse_second_pos[0],\n 'height': mouse_second_pos[3] - mouse_second_pos[1],\n 'opacity': 1\n });\n } else {\n this.setDisplayMessage(\"Mask already generated\");\n }\n } else {\n this.setDisplayMessage(\"You need to upload a photo to start\");\n }\n\n }", "title": "" }, { "docid": "397c8e9348a160f6a0f502b86ba74f51", "score": "0.6536471", "text": "onCrop()\n {\n this.setState({ instrument: \"Crop\", isReady: false, stage: \"Cancel\", action: \"Crop\", crop: this.initialCrop() });\n }", "title": "" }, { "docid": "72c776ce6beacb96c6eb3774f7f042d3", "score": "0.6513751", "text": "function setCropperData(){\n\n var cropper = document.getElementsByClassName('lyteCropCropper')[0];\n var fixedImage = document.getElementsByClassName('lyteCropFixedImage')[0];\n var divImageImg = document.getElementsByClassName('lyteCropDivImageImg')[0];\n retValue.cropperDim = cropper.getBoundingClientRect();\n retValue.imageDim = divImageImg.getBoundingClientRect();\n retValue.imageSource = imageTag.src;\n retValue.displayImage = divImageImg;\n retValue.aspectRatio = aspectRatio;\n retValue.resetCropper = function(){\n if(imageHeight < imageWidth){\n fixedImage.style.width = divImageImg.style.width = (cropperDiv.getBoundingClientRect().width) + \"px\";\n } else if(imageHeight > imageWidth){\n fixedImage.style.height = divImageImg.style.height = (cropperDiv.getBoundingClientRect().height) + \"px\";\n } else if(imageHeight === imageWidth){\n fixedImage.style.height = divImageImg.style.height = (cropperDiv.getBoundingClientRect().height) + \"px\";\n }\n fixedImage.style.transform = divImageImg.style.transform = \"\";\n retValue.angle = 0;\n fixedImage.style.top = (box.getBoundingClientRect().height - fixedImage.getBoundingClientRect().height)/2 + \"px\";\n fixedImage.style.left = (opacityDiv.getBoundingClientRect().width - fixedImage.getBoundingClientRect().width)/2 + \"px\";\n // box.style.height = (imageHeight) + \"px\";\n cropper.style.height = initialCropperHeight + \"px\";\n cropper.style.width = initialCropperWidth + \"px\";\n var opDivDimension = opacityDiv.getBoundingClientRect();\n var cropperDim = cropper.getBoundingClientRect();\n cropper.style.top = ((opDivDimension.height - cropperDim.height)/2) + \"px\";\n cropper.style.left = ((opDivDimension.width - cropperDim.width)/2) + \"px\";\n var fixedImageDim = fixedImage.getBoundingClientRect();\n cropperDim = cropper.getBoundingClientRect();\n divImageImg.style.left = (fixedImageDim.left - cropperDim.left)+\"px\";\n divImageImg.style.top = (fixedImageDim.top - cropperDim.top)+\"px\";\n cropArea.style.width = fixedImage.getBoundingClientRect().width + \"px\";\n cropArea.style.height = fixedImage.getBoundingClientRect().height + \"px\";\n cropArea.style.top = (box.getBoundingClientRect().height - fixedImage.getBoundingClientRect().height)/2 + \"px\";\n cropArea.style.left = (opacityDiv.getBoundingClientRect().width - fixedImage.getBoundingClientRect().width)/2 + \"px\";\n };\n\n\n retValue.rotate = function(){\n var cropperDim = cropper.getBoundingClientRect();\n var cropAreaDim = cropArea.getBoundingClientRect();\n var imageDim = fixedImage.getBoundingClientRect();\n var angle;\n var o = fixedImage.style.transform;\n var prevAng;\n if(o){\n angle = o.match(/-?\\d+/g);\n prevAng = angle[0];\n angle = parseInt(angle[0]) + 90;\n if(angle >= 360){\n angle = 0;\n }\n // cropArea.style.transform = \"rotate(\"+angle+\"deg)\";\n fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n } else {\n var angle = 90;\n // cropArea.style.transform = \"rotate(\"+angle+\"deg)\";\n fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n }\n if(retValue.angle === undefined){\n angle = 0\n retValue.angle = angle;\n } else {\n retValue.angle = angle;\n }\n\n positionCropper(cropperDim , cropAreaDim , imageDim , angle , prevAng);\n\n };\n\n\n // retValue.rotate = function(an){\n // var angle;\n // var currentValue = retValue.angle;\n // angle = an + currentValue;\n // fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n // divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n // if(retValue.angle === undefined){\n // retValue.angle = 0;\n // } else {\n // retValue.angle = angle;\n // }\n // };\n\n // retValue.rotateAntiClock = function(){\n // var cropperDim = cropper.getBoundingClientRect();\n // var cropAreaDim = cropArea.getBoundingClientRect();\n // var imageDim = fixedImage.getBoundingClientRect();\n // var angle;\n // var o = fixedImage.style.transform;\n // if(o){\n // angle = o.match(/-?\\d+/g);\n // angle = parseInt(angle[0]) - 90;\n // if(angle <= -360){\n // angle = 0;\n // }\n // // cropArea.style.transform = \"rotate(\"+angle+\"deg)\";\n // fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n // divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n // } else {\n // var angle = -90;\n // // cropArea.style.transform = \"rotate(\"+angle+\"deg)\";\n // fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n // divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n // }\n // if(retValue.angle === undefined){\n // angle = 0;\n // retValue.angle = angle;\n // } else {\n // retValue.angle = angle;\n // }\n //\n //\n // positionCropper(cropperDim , cropAreaDim , imageDim , angle);\n //\n // };\n\n\n retValue.getCroppedImage = function(){\n // debugger;\n\n var canvas = document.createElement('CANVAS');\n canvas.height = cropper.getBoundingClientRect().height;\n canvas.width = cropper.getBoundingClientRect().width;\n canvas.style.background = \"#eee\";\n var ctx = canvas.getContext('2d');\n\n var o = fixedImage.style.transform;\n var angle = 0;\n if(o){\n angle = o.match(/-?\\d+/g);\n angle = parseInt(angle[0]);\n }\n if((Math.abs(angle) !== 90)&&(Math.abs(angle) !== 270)){\n divImageImg.style.transform = 'rotate(0deg)';\n }\n // var image = new Image();\n // image.src = divImageImg.src;\n var image = $L('.lyteCropDivImageImg')[0];\n // image.style.width = divImageImg.getBoundingClientRect().width + 'px';\n // image.style.height = divImageImg.getBoundingClientRect().height + 'px';\n var cx = divImageImg.getBoundingClientRect().left - cropper.getBoundingClientRect().left;\n var cy = divImageImg.getBoundingClientRect().top - cropper.getBoundingClientRect().top;\n var cw = divImageImg.getBoundingClientRect().width;\n var ch = divImageImg.getBoundingClientRect().height;\n divImageImg.style.transform = o;\n if(angle !== 0){\n\n var halfWidth = cw / 2;\n var halfHeight = ch / 2;\n\n ctx.save();\n\n ctx.translate( cx+halfWidth , cy+halfHeight);\n ctx.rotate(angle * (Math.PI/180));\n if((Math.abs(angle)%90 === 0)&&(!((Math.abs(angle) === 180)||(Math.abs(angle) === 360)))){\n cw = fixedImage.getBoundingClientRect().width;\n ch = fixedImage.getBoundingClientRect().height;\n ctx.drawImage(image,-halfHeight,-halfWidth,ch,cw);\n } else {\n ctx.drawImage(image,-halfWidth,-halfHeight,cw,ch);\n }\n\n ctx.restore();\n\n } else {\n ctx.imageSmoothingEnabled = true;\n ctx.imageSmoothingQuality = 'high';\n ctx.drawImage(image,cx,cy,cw,ch);\n // console.log(cx , cy);\n // ctx.drawImage(image,0,-300,100,100);\n }\n\n // console.log(image);\n\n return canvas;\n }\n\n\n $L(imageTag).data('cropper' , retValue);\n\n setTimeout(function(){\n cropMove();\n imageMove();\n imageZoom();\n imageRotate();\n },100);\n\n }", "title": "" }, { "docid": "4c8a3b4c08f62757a1ccec49f95efdf1", "score": "0.6505343", "text": "function getCroppingRect() {\n\t\tvar bounds = croppingRect.bounds;\n\n\t\treturn {\n\t\t\tx : bounds.x,\n\t\t\ty : bounds.y,\n\t\t\tw : bounds.width,\n\t\t\th : bounds.height\n\t\t};\n\t}", "title": "" }, { "docid": "2e4339fa298ab667582faa2a46cb83e4", "score": "0.64386356", "text": "cropMask(e) {\n var left_padding = $('.img-group').css(\"margin-left\");\n var left_padding = left_padding.substring(0, left_padding.length - 2);\n var total_left = (e.pageX + window.pageXOffset);\n var mouseX = total_left - left_padding;\n\n var bodyRect = document.body.getBoundingClientRect()\n var elemRect = document.getElementsByClassName(\"img-mask\")[0].getBoundingClientRect();\n var elem_top = elemRect.top - bodyRect.top;\n var total_top = e.pageY + window.pageYOffset;;\n var mouseY = total_top - elem_top;\n if (this.state.type != \"dummy\") {\n if (this.state.rectStatus == 1){\n const ctx = this.refs.mask.getContext('2d');\n ctx.fillStyle = '#808080';\n ctx.beginPath();\n ctx.arc(mouseX, mouseY, 10, 0, 2 * Math.PI);\n ctx.fill();\n }\n } else {\n this.setDisplayMessage(\"You need to upload a photo to start\");\n }\n }", "title": "" }, { "docid": "03bcd63d9e29b86ebfa522043e5d0fa9", "score": "0.64184165", "text": "function initCropper() {\n let cropperClickOffsetX, cropperClickOffsetY, action;\n let $body = $('body');\n\n // Use `body` selector for listen mouse events outside of dialog\n $body\n .on('mouseup.nd.avatar_change touchend.nd.avatar_change', () => {\n $dialog.removeClass('avatar-dialog__m-cursor-' + action);\n $dialog.removeClass('avatar-dialog__m-crop-active');\n action = null;\n })\n .on('mousemove.nd.avatar_change touchmove.nd.avatar_change', event => {\n\n if (!action) return;\n\n // Detect mouse button up for case when `mouseup` event happens\n // out of browser window. Check current state directly. Skip this check\n // for touch events, because they have invalid mouse buttons values.\n // `event.which` works in chrome, `event.buttons` in firefox\n if (event.type === 'mousemove' && (event.which === 0 || event.buttons === 0)) {\n $dialog.removeClass('avatar-dialog__m-cursor-' + action);\n $dialog.removeClass('avatar-dialog__m-crop-active');\n action = null;\n return;\n }\n\n let canvasRect = canvas.getBoundingClientRect();\n let point = event.originalEvent.touches ? event.originalEvent.touches[0] : event;\n let mouseX = (point.pageX - canvasRect.left) / viewRatio;\n let mouseY = (point.pageY - canvasRect.top) / viewRatio;\n\n if (action !== 'move') {\n cropperResize(mouseX, mouseY, action);\n } else {\n cropperDrag(cropperClickOffsetX, cropperClickOffsetY, mouseX, mouseY);\n }\n\n cropperUpdate();\n previewUpdate();\n });\n\n $(cropper).on('mousedown touchstart', event => {\n let $target = $(event.target);\n let point = event.originalEvent.touches ? event.originalEvent.touches[0] : event;\n\n let canvasRect = canvas.getBoundingClientRect();\n cropperClickOffsetX = (point.pageX - canvasRect.left) / viewRatio - cropperLeft;\n cropperClickOffsetY = (point.pageY - canvasRect.top) / viewRatio - cropperTop;\n\n if (!action) {\n action = $target.data('action');\n $dialog.addClass('avatar-dialog__m-cursor-' + action);\n $dialog.addClass('avatar-dialog__m-crop-active');\n }\n\n return false;\n });\n}", "title": "" }, { "docid": "3dc3cb6f1862facaa52429da0043c804", "score": "0.63856345", "text": "function positionCropper(cropperDim , cropAreaDim , imageDim , ang1 , prevAng){\n\n var ang = fixedImage.style.transform.match(/-?\\d+/g)[0];\n var angCheck = parseInt(ang);\n var angCheck1 = angCheck;\n angCheck = Math.abs(angCheck);\n\n\n\n if((angCheck === 90) || (angCheck === 270)){\n\n\n if(imageTagDets.height<imageTagDets.width){\n fixedImage.style.width = divImageImg.style.width = cropperDiv.getBoundingClientRect().height + \"px\";\n fixedImage.style.height = divImageImg.style.height =\"auto\";\n cropArea.style.height = cropperDiv.getBoundingClientRect().height + \"px\";\n cropArea.style.top = \"0px\";\n cropArea.style.width = fixedImage.getBoundingClientRect().width + \"px\";\n cropArea.style.left = ((cropperDiv.getBoundingClientRect().width - cropArea.getBoundingClientRect().width)/2) + \"px\";\n } else if(imageTagDets.height>imageTagDets.width){\n fixedImage.style.width = divImageImg.style.width = \"auto\"\n fixedImage.style.height = divImageImg.style.height = cropperDiv.getBoundingClientRect().width + \"px\";\n cropArea.style.width = cropperDiv.getBoundingClientRect().width + \"px\";\n cropArea.style.left = \"0px\";\n cropArea.style.height = fixedImage.getBoundingClientRect().height + \"px\";\n cropArea.style.top = ((cropperDiv.getBoundingClientRect().height - cropArea.getBoundingClientRect().height)/2) + \"px\";\n }\n\n\n\n fixedImage.style.left = (cropArea.getBoundingClientRect().left - fixedImage.getBoundingClientRect().left) + \"px\";\n fixedImage.style.top = (cropArea.getBoundingClientRect().top - fixedImage.getBoundingClientRect().top) + \"px\";\n\n cropper.style.width = (cropperDim.height*cropArea.getBoundingClientRect().width) / cropAreaDim.height + \"px\";\n cropper.style.height = (cropperDim.width*cropArea.getBoundingClientRect().height) / cropAreaDim.width + \"px\";\n\n\n if((angCheck1 === -90)||(angCheck1 === -270)){\n cropper.style.left = (((cropperDim.top - cropAreaDim.top) * cropArea.getBoundingClientRect().width)/cropAreaDim.height) + \"px\";\n cropper.style.top = ((cropArea.getBoundingClientRect().height) - ((((cropperDim.left - cropAreaDim.left) * cropArea.getBoundingClientRect().height)/cropAreaDim.width) + cropper.getBoundingClientRect().height) ) + \"px\";\n }\n if((angCheck1 === 90) || (angCheck1 === 270)){\n cropper.style.top = (((cropperDim.left - cropAreaDim.left) * cropArea.getBoundingClientRect().height)/cropAreaDim.width) + \"px\";\n cropper.style.left = (cropArea.getBoundingClientRect().width - ( cropper.getBoundingClientRect().width + (((cropperDim.top - cropAreaDim.top)* cropArea.getBoundingClientRect().width)/cropAreaDim.height))) + \"px\";\n }\n\n\n\n } else {\n\n if(imageTagDets.height<imageTagDets.width){\n fixedImage.style.width = divImageImg.style.width = cropperDiv.getBoundingClientRect().width + \"px\";\n fixedImage.style.height = divImageImg.style.height = \"auto\";\n cropArea.style.width = cropperDiv.getBoundingClientRect().width + \"px\";\n cropArea.style.left = \"0px\";\n cropArea.style.height = fixedImage.getBoundingClientRect().height + \"px\";\n cropArea.style.top = (cropperDiv.getBoundingClientRect().height - cropArea.getBoundingClientRect().height)/2 + \"px\";\n } else {\n fixedImage.style.width = divImageImg.style.width = \"auto\";\n fixedImage.style.height = divImageImg.style.height = cropperDiv.getBoundingClientRect().height + \"px\";\n cropArea.style.height = cropperDiv.getBoundingClientRect().height + \"px\";\n cropArea.style.top = \"0px\";\n cropArea.style.width = fixedImage.getBoundingClientRect().width + \"px\";\n cropArea.style.left = (cropperDiv.getBoundingClientRect().width - cropArea.getBoundingClientRect().width)/2 + \"px\";\n }\n\n\n\n fixedImage.style.top = (box.getBoundingClientRect().height - fixedImage.getBoundingClientRect().height)/2 + \"px\";\n fixedImage.style.left = (opacityDiv.getBoundingClientRect().width - fixedImage.getBoundingClientRect().width)/2 + \"px\";\n\n cropper.style.width = (cropperDim.height*cropArea.getBoundingClientRect().width) / cropAreaDim.height + \"px\";\n cropper.style.height = (cropperDim.width*cropArea.getBoundingClientRect().height) / cropAreaDim.width + \"px\";\n\n if((angCheck1 === -180)){\n cropper.style.top = ((cropArea.getBoundingClientRect().height) - ((((cropperDim.left - cropAreaDim.left) * cropArea.getBoundingClientRect().height)/cropAreaDim.width) + cropper.getBoundingClientRect().height) ) + \"px\";\n cropper.style.left = (((cropperDim.top - cropAreaDim.top) * cropArea.getBoundingClientRect().width)/cropAreaDim.height) + \"px\";\n }\n if((angCheck1 === 0)||(angCheck1 === 180)){\n cropper.style.top = (((cropperDim.left - cropAreaDim.left) * cropArea.getBoundingClientRect().height)/cropAreaDim.width) + \"px\";\n cropper.style.left = (cropArea.getBoundingClientRect().width - ( cropper.getBoundingClientRect().width + (((cropperDim.top - cropAreaDim.top)* cropArea.getBoundingClientRect().width)/cropAreaDim.height))) + \"px\";\n }\n }\n\n var fixedImageTransform = fixedImage.style.transform;\n fixedImage.style.transform = 'rotate(0deg)';\n divImageImg.style.left = (fixedImage.getBoundingClientRect().left - cropper.getBoundingClientRect().left)+\"px\";\n divImageImg.style.top = (fixedImage.getBoundingClientRect().top - cropper.getBoundingClientRect().top)+\"px\";\n fixedImage.style.transform = fixedImageTransform;\n\n }", "title": "" }, { "docid": "b813a5ca2ff4a4c7750a417bc5e1642a", "score": "0.63835394", "text": "function initiateCropper() {\n\n var picture = $('#dpUploadedImage'); // Must be already loaded or cached!\n picture.one('load', function () {\n picture.guillotine({ width: 400, height: 400 });\n picture.guillotine('fit');\n\n $('#rotate-left').click(function () {\n picture.guillotine('rotateLeft');\n });\n\n $('#rotate-right').click(function () {\n picture.guillotine('rotateLeft');\n });\n\n $('#zoom-in').click(function () {\n picture.guillotine('zoomIn');\n });\n\n $('#zoom-out').click(function () {\n picture.guillotine('zoomOut');\n });\n\n $('#fit').click(function () {\n picture.guillotine('fit');\n });\n });\n }", "title": "" }, { "docid": "33c0c52b08e70555ba02555664e5801c", "score": "0.6369458", "text": "function captureAndCrop(orgInput, x, y, endWidth, endHeight) {\n\t/* Offset x & y to capture more hair */\n\tx = x - x * 0.001;\n\ty = y - y * 0.3;\n\n\t// draw image to canvas and get image data\n\tvar canvas0 = document.createElement(\"canvas\");\n\n\tcanvas0.width = orgInput.videoWidth; // Intrinsic Width\n\tcanvas0.height = orgInput.videoHeight; // Intrinsic Height\n\n\tvar ctx = canvas0.getContext(\"2d\");\n\tctx.drawImage(orgInput, 0, 0);\n\tvar imageData = ctx.getImageData(x, y, endWidth, endHeight);\n\n\t/* Create destiantion canvas */\n\tvar canvas1 = document.createElement(\"canvas\");\n\n\tcanvas1.width = endWidth;\n\tcanvas1.height = endHeight;\n\n\tvar ctx1 = canvas1.getContext(\"2d\");\n\tctx1.rect(0, 0, endWidth, endHeight);\n\tctx1.fillStyle = \"white\";\n\tctx1.fill();\n\tctx1.putImageData(imageData, 0, 0);\n\n\t// Return final image\n\treturn canvas1.toDataURL(\"image/png\");\n}", "title": "" }, { "docid": "819b37d49e0bf25981e8dbba61532636", "score": "0.6351007", "text": "function createCrop(vegeCode,areaID,growthState,growthTrend){\n\t\t\t\tcrop = new Crop(vegeCode,areaID);\n\t\t\t\tcrop.setFrame(growthState);\n\t\t\t\tcrop.setGrowthTrend(growthTrend);\n\t\t\t\t\n\t\t\t\tcrops.push(crop);\n\t\t\t\t\n\t\t\t\t//decide which group the crop belongs into\n\t\t\t\t//maybe not ideal solution but it works\n\t\t\t\t\n\t\t\t\tvar AREAHEIGHT = 64;\n\t\t\t\tvar AREAWIDTH = 48;\n\t\t\t\t\n\t\t\t\tif(areaID == 0){\n\t\t\t\t\tareaGroup0.push(crop);\n\t\t\t\t\tcrop.setPosition(areaGroup0.length*AREAWIDTH,areaID * AREAHEIGHT);\n\t\t\t\t}else if (areaID == 1){\n\t\t\t\t\tareaGroup1.push(crop);\n\t\t\t\t\tcrop.setPosition(areaGroup1.length*AREAWIDTH,areaID * AREAHEIGHT);\n\t\t\t\t}else if (areaID == 2){\n\t\t\t\t\tareaGroup2.push(crop);\n\t\t\t\t\tcrop.setPosition(areaGroup2.length*AREAWIDTH,areaID * AREAHEIGHT);\n\t\t\t\t}else if (areaID == 3){\n\t\t\t\t\tareaGroup3.push(crop);\n\t\t\t\t\tcrop.setPosition(areaGroup3.length*AREAWIDTH,areaID * AREAHEIGHT);\n\t\t\t\t}else if (areaID == 4){\n\t\t\t\t\tareaGroup4.push(crop);\n\t\t\t\t\tcrop.setPosition(areaGroup4.length*AREAWIDTH,areaID * AREAHEIGHT);\n\t\t\t\t}else if (areaID == 5){\n\t\t\t\t\tareaGroup5.push(crop);\n\t\t\t\t\tcrop.setPosition(areaGroup5.length*AREAWIDTH,areaID * AREAHEIGHT);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//add statusSmiley\n\t\t\t\taddSmiley(growthTrend,crop.x,crop.y);\n\t\t\t\t\n\t\t\t\tthis.crop = crop;\n\t\t\t\tcropsGroup.addChild(crop);\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "215378432fd53ef2492cc8b47a47bcc3", "score": "0.6339554", "text": "onSelectForCrop() {\n const attachment = this.frame.state().get('selection').first().toJSON();\n\n if (this.params.width === attachment.width && this.params.height === attachment.height && !this.params.flex_width && !this.params.flex_height) {\n this.setImageInRepeaterField(attachment);\n } else {\n this.frame.setState('cropper');\n }\n }", "title": "" }, { "docid": "67872556fd31196d31353fd99c7762de", "score": "0.63360703", "text": "function recupImg(arg) {\n\t// On crée la balise de l'image\n\tvar img = document.createElement('img');\n\t// On donne un id à l'image\n\timg.setAttribute('id', 'cropbox');\n\t// On défini la source de l'image\n\timg.setAttribute('src', arg.target.result);\n\t// Attribution du css\n\t//img.setAttribute('style', 'max-width:100%;');\n\t// Positionnement de l'image créé dans son parent\n\tparent.appendChild(img);\n\timg.style.top = \"0px\";\n\timg.style.left = \"0px\";\n\t// Récupération du bouton de rognage\n\tvar bouton = document.getElementById('btn');\n\tbouton.classList.remove('hide');\n\n\t//////////////////////////////////////////////\n\t// Affichage et gestion du carré de rognage //\n\t//////////////////////////////////////////////\n\n\t$('#cropbox').Jcrop({\n\t\taspectRatio: 1,\n\t\tonSelect: updateCoords\n\t});\n\n\tfunction updateCoords(c) {\n\t\t$('#x').val(c.x);\n\t\t$('#y').val(c.y);\n\t\t$('#w').val(c.w);\n\t\t$('#h').val(c.h);\n\t\t// Création de l'image du canvas au chargement\n\t\twindow.onload = initVisu();\n\t}\n\n\tfunction initVisu() {\n\t\t// Récupération du canvas et du context\n\t\tvar canvas = document.getElementById('apercu');\n\t\tvar context = canvas.getContext('2d');\n\t\t// Gestion de l'affichage du canvas\n\t\tcanvas.classList.remove('hide');\n\t\tvar widthApercu; // Initialisation de la variable\n\t\tvar heightApercu; // Initialisation de la variable\n\t\t// Récupération des valeurs du carré de rognage\n\t\tvar sourceX = $('#x').val();\n\t\tvar sourceY = $('#y').val();\n\t\tvar sourceWidth = $('#w').val();\n\t\tvar sourceHeight = $('#h').val();\n\t\t// Calcul des pourcentages hauteur et largeur pour l'affichage\n\t\tif ((sourceWidth > widthMax) || (sourceHeight > heightMax)) {\n\t\t\tif (sourceWidth > sourceHeight) {\n\t\t\t\twidthApercu = parseInt(sourceWidth * (widthMax / sourceWidth));\n\t\t\t\theightApercu = parseInt(sourceHeight * (widthMax / sourceWidth));\n\t\t\t} else {\n\t\t\t\twidthApercu = parseInt(sourceWidth * (heightMax / sourceHeight));\n\t\t\t\theightApercu = parseInt(sourceHeight * (heightMax / sourceHeight));\n\t\t\t}\n\t\t\timg.style.width = widthApercu;\n\t\t\timg.style.height = heightApercu;\n\t\t} else {\n\t\t\timg.style.width = sourceWidth;\n\t\t\timg.style.height = sourceHeight;\n\t\t}\n\t\t// Mise en mémoire tampon du context\n\t\tcontext.save();\n\t\t// Positionnement de la copie de l'image dans le context\n\t\tcontext.drawImage(img, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, widthApercu, heightApercu);\n\t\t// Affichage de l'image\n\t\tcontext.restore();\n\t}\n\n\tfunction checkCoords() {\n\t\tif (parseInt($('#w').val()))\n\t\t\treturn true;\n\t\talert('Merci de selectionner une région à rogner.');\n\t\treturn false;\n\t}\n\n} // fin de la création de l'image", "title": "" }, { "docid": "bb3879da90473dae6e4713fa2c32ee34", "score": "0.6296834", "text": "function getCrop(image, size, clipPosition = 'center-middle') {\n const width = size.width;\n const height = size.height;\n const aspectRatio = width / height;\n\n let newWidth;\n let newHeight;\n\n const imageRatio = image.width / image.height;\n\n if (aspectRatio >= imageRatio) {\n newWidth = image.width;\n newHeight = image.width / aspectRatio;\n } else {\n newWidth = image.height * aspectRatio;\n newHeight = image.height;\n }\n\n let x = 0;\n let y = 0;\n if (clipPosition === 'left-top') {\n x = 0;\n y = 0;\n } else if (clipPosition === 'left-middle') {\n x = 0;\n y = (image.height - newHeight) / 2;\n } else if (clipPosition === 'left-bottom') {\n x = 0;\n y = image.height - newHeight;\n } else if (clipPosition === 'center-top') {\n x = (image.width - newWidth) / 2;\n y = 0;\n } else if (clipPosition === 'center-middle') {\n x = (image.width - newWidth) / 2;\n y = (image.height - newHeight) / 2;\n } else if (clipPosition === 'center-bottom') {\n x = (image.width - newWidth) / 2;\n y = image.height - newHeight;\n } else if (clipPosition === 'right-top') {\n x = image.width - newWidth;\n y = 0;\n } else if (clipPosition === 'right-middle') {\n x = image.width - newWidth;\n y = (image.height - newHeight) / 2;\n } else if (clipPosition === 'right-bottom') {\n x = image.width - newWidth;\n y = image.height - newHeight;\n } else if (clipPosition === 'scale') {\n x = 0;\n y = 0;\n newWidth = width;\n newHeight = height;\n } else {\n console.error(\n new Error('Unknown clip position property - ' + clipPosition)\n );\n }\n\n return {\n cropX: x,\n cropY: y,\n cropWidth: newWidth,\n cropHeight: newHeight,\n };\n}", "title": "" }, { "docid": "521649d648234f91cea4cd832b92e6aa", "score": "0.6296035", "text": "function applyCrop(pos) {\n profileImg.setAttr('lastCropUsed', pos);\n const crop = getCrop(\n profileImg.image(),\n { width: profileImg.width(), height: profileImg.height() },\n pos\n );\n profileImg.setAttrs(crop);\n}", "title": "" }, { "docid": "467ed287caa2bd0bc974fee42ff57127", "score": "0.6272013", "text": "renderCropBox() {\n const {\n proj,\n screenHeight,\n screenWidth,\n selectedLayer,\n selectedCollection,\n } = this.props;\n\n const {\n boundaries,\n coordinates,\n showBoundingBox,\n } = this.state;\n\n const {\n x, y, x2, y2,\n } = boundaries;\n\n return selectedCollection && selectedLayer && proj.id === 'geographic' && (\n <>\n <div className=\"smart-handoff-crop-toggle\">\n <Checkbox\n id=\"chk-crop-toggle\"\n label=\"Set Area of Interest\"\n text=\"Toggle boundary selection.\"\n color=\"gray\"\n checked={showBoundingBox}\n onCheck={this.onCheckboxToggle}\n />\n </div>\n\n { showBoundingBox && (\n <Crop\n x={x}\n y={y}\n width={x2 - x}\n height={y2 - y}\n maxHeight={screenHeight}\n maxWidth={screenWidth}\n onChange={this.onBoundaryChange}\n onDragStop={(crop) => {\n this.onBoundaryChange(crop, true);\n }}\n onClose={onClose}\n keepSelection\n bottomLeftStyle={{\n left: x,\n top: y2 + 5,\n width: x2 - x,\n zIndex: 2,\n }}\n topRightStyle={{\n left: x,\n top: y - 20,\n width: x2 - x,\n zIndex: 2,\n }}\n coordinates={coordinates}\n showCoordinates\n zIndex={1}\n />\n )}\n <hr />\n </>\n );\n }", "title": "" }, { "docid": "d70cad2aea52ca4bc998b96f6de63a5b", "score": "0.6238554", "text": "crop(left /*int*/, top /*int*/, width /*int*/, height /*int*/) {\n throw new UnsupportedOperationException('This luminance source does not support cropping.');\n }", "title": "" }, { "docid": "3f33105578b52a6959814aaa800d9778", "score": "0.62281364", "text": "copyTo(rectangle) {\n return rectangle.x = this.x, rectangle.y = this.y, rectangle.width = this.width, rectangle.height = this.height, rectangle;\n }", "title": "" }, { "docid": "d1e141c422371bcdf415911ecc48eb46", "score": "0.6214719", "text": "cropImage(){\n\t\t\t//si la ruta actual no es cutout detenemos\n\t\t\tif(this.$route.name!=\"cutout\"){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.ima.widthCut<100 || this.ima.heightCut<100){\n\t\t\t\t//console.log(\"no es posible recortar \")\n\t\t\t}\n\t\t\tvar self=this;\n\t\t\tif(sessionStorage && sessionStorage.getItem(\"biedit_apitoken\")){\n\n\t\t\t\tlet api_token = sessionStorage.getItem(\"biedit_apitoken\");\n\t\t\t\tlet email = sessionStorage.getItem(\"biedit_email\");\n\t\t\t\tlet square = document.querySelector(\"#square-panel\");\t\t\t\t\n\t\t\t\tsquare.className=\"flash animated\";\n\n\t\t\t\tlet prop = {\n\t\t\t\t\tx : square.offsetLeft,\n\t\t\t\t\ty : square.offsetTop,\n\t\t\t\t\twidth : square.offsetWidth,\n\t\t\t\t\theight : square.offsetHeight,\n\t\t\t\t\tresizeWidth:this.ima.widthCut,\n\t\t\t\t\tresizeHeight:this.ima.heightCut,\n\t\t\t\t\tsrc : this.ima.src,\n\t\t\t\t\temail: email\n\t\t\t\t}\n\t\t\t\tlet data = {\n\t\t\t\t\tdata: JSON.stringify(prop)\n\t\t\t\t}\n\t\t\t\tlet headers= {\n\t\t\t\t\theaders:{Authorization: \"Bearer \"+api_token}\n\t\t\t\t}\n\t\t\t\taxios.post(this.url+\"crop\",data,headers).then(res => {\n\t\t\t\t\tif(res.data.error){\n\t\t\t\t\t\tthis.titleDialogAlert=\"Ocurrió un error\";\n\t\t\t\t\t\tthis.msgeDialogAlert=res.data.error;\t\t\t\t\t\t\n\t\t\t\t\t\tthis.dialogErrorActive=true;\n\t\t\t\t\t\treturn;\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(res.data.message){\n\t\t\t\t\t\tconst cloneBoxSquare=this.cloneBoxSquare();\n\t\t\t\t\t\t//realizamos un setTimeout para que funcione el transition\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\tsquare.className=\"\";\n\t\t\t\t\t\t\tcloneBoxSquare.style.top=\"-1000px\";\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\t//cloneBoxSquare.style.display=\"none\";\n\t\t\t\t\t\t\t\tself.titleDialogAlert=\"Recorte aplicado correctamente\";\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tself.msgeDialogAlert=res.data.message;\n\t\t\t\t\t\t\t\tself.dialogSuccessActive=true;\n\t\t\t\t\t\t\t},1000);\n\t\t\t\t\t\t},100);\n\t\t\t\t\t}\n\t\t\t\t}).catch(error=>{\n\t\t\t\t\tthis.msgeDialogAlert=\"Se generó un error al procesar la nueva imagen\";\n\t\t\t\t\tthis.dialogErrorActive=true;\n\t\t\t\t\tconsole.log(\"Error server: \",error);\n\t\t\t\t})\n\n\t\t\t\tthis.playSound();\n\t\t\t}else{\n\t\t\t\tconsole.log(\"El usuario no está logueado o el navegador no soporta sessionStorage\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f33627c09f93cba12bd15d6e2869c484", "score": "0.62082183", "text": "function cropperFun(){\n\n naturalAR = imageTag.naturalWidth / imageTag.naturalHeight;\n\n /*\n * Creating required elements for cropper\n */\n (function(){\n\n cropperParent = imageTag.parentElement;\n cropArea = document.createElement(\"DIV\");\n displayArea = document.createElement(\"DIV\");\n mainImage = document.createElement(\"IMG\");\n box = document.createElement(\"DIV\");\n fixedDiv = document.createElement(\"DIV\");\n fixedImage = document.createElement(\"IMG\");\n opacityDiv = document.createElement(\"DIV\");\n cropper = document.createElement(\"DIV\");\n cropVerGrid1 = document.createElement(\"SPAN\");\n cropVerGrid2 = document.createElement(\"SPAN\");\n cropVerGrid3 = document.createElement(\"SPAN\");\n cropHorGrid1 = document.createElement(\"SPAN\");\n cropHorGrid2 = document.createElement(\"SPAN\");\n cropHorGrid3 = document.createElement(\"SPAN\");\n topEdge = document.createElement(\"DIV\");\n topSpan = document.createElement(\"SPAN\");\n bottomEdge = document.createElement(\"DIV\");\n bottomSpan = document.createElement(\"SPAN\");\n leftEdge = document.createElement(\"DIV\");\n leftSpan = document.createElement(\"SPAN\");\n rightEdge = document.createElement(\"DIV\");\n rightSpan = document.createElement(\"SPAN\");\n topRightCorner = document.createElement(\"DIV\");\n topLeftCorner = document.createElement(\"DIV\");\n bottomLeftCorner = document.createElement(\"DIV\");\n bottomRightCorner = document.createElement(\"DIV\");\n divImage = document.createElement(\"DIV\");\n divImageImg = document.createElement(\"IMG\");\n displayImageDiv = document.createElement(\"DIV\");\n displayImage = document.createElement(\"IMG\");\n\n\n cropperParent.appendChild(cropArea);\n displayArea.appendChild(displayImageDiv);\n displayImageDiv.appendChild(displayImage);\n cropArea.appendChild(box);\n box.appendChild(fixedDiv);\n fixedDiv.appendChild(fixedImage);\n box.appendChild(opacityDiv);\n box.appendChild(cropper);\n cropper.appendChild(cropVerGrid1);\n cropper.appendChild(cropVerGrid2);\n cropper.appendChild(cropVerGrid3);\n cropper.appendChild(cropHorGrid1);\n cropper.appendChild(cropHorGrid2);\n cropper.appendChild(cropHorGrid3);\n cropper.appendChild(topEdge);\n topEdge.appendChild(topSpan);\n cropper.appendChild(bottomEdge);\n bottomEdge.appendChild(bottomSpan);\n cropper.appendChild(rightEdge);\n rightEdge.appendChild(rightSpan);\n cropper.appendChild(leftEdge);\n leftEdge.appendChild(leftSpan);\n cropper.appendChild(topRightCorner);\n cropper.appendChild(bottomRightCorner);\n cropper.appendChild(topLeftCorner);\n cropper.appendChild(bottomLeftCorner);\n cropper.appendChild(divImage);\n divImage.appendChild(divImageImg);\n\n /*\n * Defining classes for the cropper elements\n */\n\n (function(){\n cropArea.setAttribute(\"class\" , \"lyteCropArea\");\n displayArea.setAttribute(\"class\" , \"lyteCropDisplayArea\");\n displayImageDiv.setAttribute(\"class\" , \"lyteCropDisplayImageDiv\");\n displayImage.setAttribute(\"class\" , \"lyteCropDisplayImage\");\n mainImage.setAttribute(\"class\" , \"lyteCropMainImage\");\n box.setAttribute(\"class\" , \"lyteCropBox\");\n fixedDiv.setAttribute(\"class\" , \"lyteCropFixedDiv\");\n fixedImage.setAttribute(\"class\" , \"lyteCropFixedImage\");\n opacityDiv.setAttribute(\"class\" , \"lyteCropOpacityDiv\");\n cropper.setAttribute(\"class\" , \"lyteCropCropper\");\n cropVerGrid1.setAttribute(\"class\" , \"lytecropVerGrid1\");\n cropVerGrid2.setAttribute(\"class\" , \"lytecropVerGrid2\");\n cropVerGrid3.setAttribute(\"class\" , \"lytecropVerGrid3\");\n cropHorGrid1.setAttribute(\"class\" , \"lytecropHorGrid1\");\n cropHorGrid2.setAttribute(\"class\" , \"lytecropHorGrid2\");\n cropHorGrid3.setAttribute(\"class\" , \"lytecropHorGrid3\");\n topEdge.setAttribute(\"class\" , \"lyteCropTopEdge\");\n topSpan.setAttribute(\"class\" , \"lyteCropTopSpan\");\n bottomEdge.setAttribute(\"class\" , \"lyteCropBottomEdge\");\n bottomSpan.setAttribute(\"class\" , \"lyteCropBottomSpan\");\n leftEdge.setAttribute(\"class\" , \"lyteCropLeftEdge\");\n leftSpan.setAttribute(\"class\" , \"lyteCropLeftSpan\");\n rightEdge.setAttribute(\"class\" , \"lyteCropRightEdge\");\n rightSpan.setAttribute(\"class\" , \"lyteCropRightSpan\");\n topRightCorner.setAttribute(\"class\" , \"lyteCropTopRightCorner\");\n topLeftCorner.setAttribute(\"class\" , \"lyteCropTopLeftCorner\");\n bottomRightCorner.setAttribute(\"class\" , \"lyteCropBottomRightCorner\");\n bottomLeftCorner.setAttribute(\"class\" , \"lyteCropBottomLeftCorner\");\n divImage.setAttribute(\"class\" , \"lyteCropDivImage\");\n divImageImg.setAttribute(\"class\" , \"lyteCropDivImageImg\");\n })();\n\n\n var imageHeight = imageTagDets.height , imageWidth = imageTagDets.width;\n var initialCropperHeight,initialCropperWidth,fixedImageHeight,fixedImageWidth;\n var aspectDiff , diffHeight , diffWidth , leastHeight , leastWidth;\n\n /*\n * Aspect Ratio definition\n */\n\n fixedImage.src = mainImage.src = divImageImg.src = displayImage.src = imageTag.src;\n\n\n\n\n (function(){\n\n var imageHeight = imageTagDets.height;\n var imageWidth = imageTagDets.width;\n\n if(aspectRatio === '1:1'){\n\n aspectDiff = 1/1;\n diffHeight = 1;\n diffWidth = 1;\n leastWidth = leastHeight = 50;\n\n if(imageHeight < imageWidth){\n\n initialCropperWidth = initialCropperHeight = imageHeight * 0.8;\n\n } else if(imageHeight > imageWidth){\n\n initialCropperWidth = initialCropperHeight = imageWidth * 0.8;\n\n } else if(imageHeight === imageWidth){\n\n initialCropperWidth = imageWidth * 0.8;\n initialCropperHeight = imageHeight * 0.8;\n\n }\n\n } else if(aspectRatio === '2:3'){\n\n aspectDiff = 2/3;\n // diffHeight = 3;\n // diffWidth = 2;\n\n leastWidth = (70*aspectDiff);\n leastHeight = 70;\n\n if(imageHeight < imageWidth){\n\n initialCropperHeight = imageHeight * 0.8;\n initialCropperWidth = (imageHeight * 0.8)*(2/3);\n\n } else if(imageHeight > imageWidth){\n\n initialCropperHeight = imageWidth * 0.8;\n initialCropperWidth = (imageWidth * 0.8)*(2/3);\n\n } else if(imageHeight === imageWidth){\n\n initialCropperWidth = imageWidth * 0.8;\n initialCropperHeight = imageHeight * 0.8;\n\n }\n\n } else if(aspectRatio === '4:3'){\n\n aspectDiff = 4/3;\n diffHeight = 3;\n diffWidth = 4;\n\n leastWidth = 70;\n leastHeight = (70/aspectDiff);\n\n if(imageHeight < imageWidth){\n\n initialCropperHeight = imageHeight * 0.8;\n initialCropperWidth = (imageHeight * 0.8)*(4/3);\n\n } else if(imageHeight > imageWidth){\n\n initialCropperHeight = imageWidth * 0.8*(3/4);\n initialCropperWidth = (imageWidth * 0.8);\n\n } else if(imageHeight === imageWidth){\n\n initialCropperWidth = imageWidth * 0.8;\n initialCropperHeight = imageHeight * 0.8;\n\n }\n\n } else if(aspectRatio === '16:9'){\n\n aspectDiff = 16/9;\n diffHeight = 9;\n diffWidth = 16;\n\n leastWidth = 70;\n leastHeight = (70/aspectDiff);\n\n if(imageHeight < imageWidth){\n\n initialCropperHeight = imageHeight * 0.8;\n initialCropperWidth = (imageHeight * 0.8)*(16/9);\n\n } else if(imageHeight > imageWidth){\n\n initialCropperHeight = imageWidth * 0.8*(9/16);\n initialCropperWidth = (imageWidth * 0.8);\n\n } else if(imageHeight === imageWidth){\n\n initialCropperWidth = imageWidth * 0.8;\n initialCropperHeight = imageHeight * 0.8;\n\n }\n\n } else if(aspectRatio === 'n:n'){\n\n // aspectDiff = 2/3;\n // diffHeight = 3;\n // diffWidth = 2;\n\n leastWidth = 70;\n leastHeight = 70;\n\n if(imageHeight < imageWidth){\n\n initialCropperHeight = imageHeight * 0.8;\n initialCropperWidth = (imageHeight * 0.8)*(3/2);\n\n } else if(imageHeight > imageWidth){\n initialCropperHeight = imageWidth * 0.8*(2/3);\n initialCropperWidth = (imageWidth * 0.8);\n\n } else if(imageHeight === imageWidth){\n\n initialCropperWidth = imageWidth * 0.8;\n initialCropperHeight = imageHeight * 0.8;\n\n }\n\n }\n\n }());\n\n var initialDimensions = function(){\n if(imageHeight < imageWidth){\n fixedImage.style.width = divImageImg.style.width = (cropperDiv.getBoundingClientRect().width) + \"px\";\n fixedImage.style.height = divImageImg.style.height = ((cropperDiv.getBoundingClientRect().width)/naturalAR) + \"px\";\n cropArea.style.height = fixedImage.getBoundingClientRect().height + \"px\";\n cropArea.style.width = fixedImage.getBoundingClientRect().width + \"px\";\n cropArea.style.top = ((cropperDiv.getBoundingClientRect().height - cropArea.getBoundingClientRect().height)/2) + \"px\";\n } else if(imageHeight > imageWidth){\n fixedImage.style.height = divImageImg.style.height = (cropperDiv.getBoundingClientRect().height) + \"px\";\n fixedImage.style.width = divImageImg.style.width = ((cropperDiv.getBoundingClientRect().height)*naturalAR) + \"px\";\n cropArea.style.width = fixedImage.getBoundingClientRect().width + \"px\";\n cropArea.style.height = fixedImage.getBoundingClientRect().height + \"px\";\n cropArea.style.left = ((cropperDiv.getBoundingClientRect().width - cropArea.getBoundingClientRect().width)/2) + \"px\";\n } else if(imageHeight === imageWidth){\n fixedImage.style.height = divImageImg.style.height = (cropperDiv.getBoundingClientRect().height) + \"px\";\n fixedImage.style.width = divImageImg.style.width = ((cropperDiv.getBoundingClientRect().height)*naturalAR) + \"px\";\n cropArea.style.width = (fixedImage.getBoundingClientRect().width) + \"px\";\n cropArea.style.height = (fixedImage.getBoundingClientRect().height) + \"px\";\n cropArea.style.left = ((cropperDiv.getBoundingClientRect().width - cropArea.getBoundingClientRect().width)/2) + \"px\";\n }\n // box.style.height = (imageHeight) + \"px\";\n\n // fixedImage.style.top = (box.getBoundingClientRect().height - fixedImage.getBoundingClientRect().height)/2 + \"px\";\n // fixedImage.style.left = (opacityDiv.getBoundingClientRect().width - fixedImage.getBoundingClientRect().width)/2 + \"px\";\n\n fixedImage.style.left = \"0px\";\n divImageImg.style.left = \"-\"+((opacityDiv.getBoundingClientRect().width - cropper.getBoundingClientRect().width)/2) + \"px\"\n fixedImage.style.top = \"0px\";\n divImageImg.style.top = \"-\"+((opacityDiv.getBoundingClientRect().height - cropper.getBoundingClientRect().height)/2) + \"px\"\n\n cropper.style.height = opacityDiv.getBoundingClientRect().height + \"px\";\n cropper.style.width = opacityDiv.getBoundingClientRect().width + \"px\";\n cropper.style.top = ((opacityDiv.getBoundingClientRect().height - cropper.getBoundingClientRect().height)/2) + \"px\"\n cropper.style.left = ((opacityDiv.getBoundingClientRect().width - cropper.getBoundingClientRect().width)/2) + \"px\"\n setCropperData();\n }\n\n initialDimensions();\n\n\n /*\n *Positioning cropper on rotate\n */\n\n function positionCropper(cropperDim , cropAreaDim , imageDim , ang1 , prevAng){\n\n var ang = fixedImage.style.transform.match(/-?\\d+/g)[0];\n var angCheck = parseInt(ang);\n var angCheck1 = angCheck;\n angCheck = Math.abs(angCheck);\n\n\n\n if((angCheck === 90) || (angCheck === 270)){\n\n\n if(imageTagDets.height<imageTagDets.width){\n fixedImage.style.width = divImageImg.style.width = cropperDiv.getBoundingClientRect().height + \"px\";\n fixedImage.style.height = divImageImg.style.height =\"auto\";\n cropArea.style.height = cropperDiv.getBoundingClientRect().height + \"px\";\n cropArea.style.top = \"0px\";\n cropArea.style.width = fixedImage.getBoundingClientRect().width + \"px\";\n cropArea.style.left = ((cropperDiv.getBoundingClientRect().width - cropArea.getBoundingClientRect().width)/2) + \"px\";\n } else if(imageTagDets.height>imageTagDets.width){\n fixedImage.style.width = divImageImg.style.width = \"auto\"\n fixedImage.style.height = divImageImg.style.height = cropperDiv.getBoundingClientRect().width + \"px\";\n cropArea.style.width = cropperDiv.getBoundingClientRect().width + \"px\";\n cropArea.style.left = \"0px\";\n cropArea.style.height = fixedImage.getBoundingClientRect().height + \"px\";\n cropArea.style.top = ((cropperDiv.getBoundingClientRect().height - cropArea.getBoundingClientRect().height)/2) + \"px\";\n }\n\n\n\n fixedImage.style.left = (cropArea.getBoundingClientRect().left - fixedImage.getBoundingClientRect().left) + \"px\";\n fixedImage.style.top = (cropArea.getBoundingClientRect().top - fixedImage.getBoundingClientRect().top) + \"px\";\n\n cropper.style.width = (cropperDim.height*cropArea.getBoundingClientRect().width) / cropAreaDim.height + \"px\";\n cropper.style.height = (cropperDim.width*cropArea.getBoundingClientRect().height) / cropAreaDim.width + \"px\";\n\n\n if((angCheck1 === -90)||(angCheck1 === -270)){\n cropper.style.left = (((cropperDim.top - cropAreaDim.top) * cropArea.getBoundingClientRect().width)/cropAreaDim.height) + \"px\";\n cropper.style.top = ((cropArea.getBoundingClientRect().height) - ((((cropperDim.left - cropAreaDim.left) * cropArea.getBoundingClientRect().height)/cropAreaDim.width) + cropper.getBoundingClientRect().height) ) + \"px\";\n }\n if((angCheck1 === 90) || (angCheck1 === 270)){\n cropper.style.top = (((cropperDim.left - cropAreaDim.left) * cropArea.getBoundingClientRect().height)/cropAreaDim.width) + \"px\";\n cropper.style.left = (cropArea.getBoundingClientRect().width - ( cropper.getBoundingClientRect().width + (((cropperDim.top - cropAreaDim.top)* cropArea.getBoundingClientRect().width)/cropAreaDim.height))) + \"px\";\n }\n\n\n\n } else {\n\n if(imageTagDets.height<imageTagDets.width){\n fixedImage.style.width = divImageImg.style.width = cropperDiv.getBoundingClientRect().width + \"px\";\n fixedImage.style.height = divImageImg.style.height = \"auto\";\n cropArea.style.width = cropperDiv.getBoundingClientRect().width + \"px\";\n cropArea.style.left = \"0px\";\n cropArea.style.height = fixedImage.getBoundingClientRect().height + \"px\";\n cropArea.style.top = (cropperDiv.getBoundingClientRect().height - cropArea.getBoundingClientRect().height)/2 + \"px\";\n } else {\n fixedImage.style.width = divImageImg.style.width = \"auto\";\n fixedImage.style.height = divImageImg.style.height = cropperDiv.getBoundingClientRect().height + \"px\";\n cropArea.style.height = cropperDiv.getBoundingClientRect().height + \"px\";\n cropArea.style.top = \"0px\";\n cropArea.style.width = fixedImage.getBoundingClientRect().width + \"px\";\n cropArea.style.left = (cropperDiv.getBoundingClientRect().width - cropArea.getBoundingClientRect().width)/2 + \"px\";\n }\n\n\n\n fixedImage.style.top = (box.getBoundingClientRect().height - fixedImage.getBoundingClientRect().height)/2 + \"px\";\n fixedImage.style.left = (opacityDiv.getBoundingClientRect().width - fixedImage.getBoundingClientRect().width)/2 + \"px\";\n\n cropper.style.width = (cropperDim.height*cropArea.getBoundingClientRect().width) / cropAreaDim.height + \"px\";\n cropper.style.height = (cropperDim.width*cropArea.getBoundingClientRect().height) / cropAreaDim.width + \"px\";\n\n if((angCheck1 === -180)){\n cropper.style.top = ((cropArea.getBoundingClientRect().height) - ((((cropperDim.left - cropAreaDim.left) * cropArea.getBoundingClientRect().height)/cropAreaDim.width) + cropper.getBoundingClientRect().height) ) + \"px\";\n cropper.style.left = (((cropperDim.top - cropAreaDim.top) * cropArea.getBoundingClientRect().width)/cropAreaDim.height) + \"px\";\n }\n if((angCheck1 === 0)||(angCheck1 === 180)){\n cropper.style.top = (((cropperDim.left - cropAreaDim.left) * cropArea.getBoundingClientRect().height)/cropAreaDim.width) + \"px\";\n cropper.style.left = (cropArea.getBoundingClientRect().width - ( cropper.getBoundingClientRect().width + (((cropperDim.top - cropAreaDim.top)* cropArea.getBoundingClientRect().width)/cropAreaDim.height))) + \"px\";\n }\n }\n\n var fixedImageTransform = fixedImage.style.transform;\n fixedImage.style.transform = 'rotate(0deg)';\n divImageImg.style.left = (fixedImage.getBoundingClientRect().left - cropper.getBoundingClientRect().left)+\"px\";\n divImageImg.style.top = (fixedImage.getBoundingClientRect().top - cropper.getBoundingClientRect().top)+\"px\";\n fixedImage.style.transform = fixedImageTransform;\n\n }\n\n /*\n * Defining cropper values to the image tag\n */\n\n function setCropperData(){\n\n var cropper = document.getElementsByClassName('lyteCropCropper')[0];\n var fixedImage = document.getElementsByClassName('lyteCropFixedImage')[0];\n var divImageImg = document.getElementsByClassName('lyteCropDivImageImg')[0];\n retValue.cropperDim = cropper.getBoundingClientRect();\n retValue.imageDim = divImageImg.getBoundingClientRect();\n retValue.imageSource = imageTag.src;\n retValue.displayImage = divImageImg;\n retValue.aspectRatio = aspectRatio;\n retValue.resetCropper = function(){\n if(imageHeight < imageWidth){\n fixedImage.style.width = divImageImg.style.width = (cropperDiv.getBoundingClientRect().width) + \"px\";\n } else if(imageHeight > imageWidth){\n fixedImage.style.height = divImageImg.style.height = (cropperDiv.getBoundingClientRect().height) + \"px\";\n } else if(imageHeight === imageWidth){\n fixedImage.style.height = divImageImg.style.height = (cropperDiv.getBoundingClientRect().height) + \"px\";\n }\n fixedImage.style.transform = divImageImg.style.transform = \"\";\n retValue.angle = 0;\n fixedImage.style.top = (box.getBoundingClientRect().height - fixedImage.getBoundingClientRect().height)/2 + \"px\";\n fixedImage.style.left = (opacityDiv.getBoundingClientRect().width - fixedImage.getBoundingClientRect().width)/2 + \"px\";\n // box.style.height = (imageHeight) + \"px\";\n cropper.style.height = initialCropperHeight + \"px\";\n cropper.style.width = initialCropperWidth + \"px\";\n var opDivDimension = opacityDiv.getBoundingClientRect();\n var cropperDim = cropper.getBoundingClientRect();\n cropper.style.top = ((opDivDimension.height - cropperDim.height)/2) + \"px\";\n cropper.style.left = ((opDivDimension.width - cropperDim.width)/2) + \"px\";\n var fixedImageDim = fixedImage.getBoundingClientRect();\n cropperDim = cropper.getBoundingClientRect();\n divImageImg.style.left = (fixedImageDim.left - cropperDim.left)+\"px\";\n divImageImg.style.top = (fixedImageDim.top - cropperDim.top)+\"px\";\n cropArea.style.width = fixedImage.getBoundingClientRect().width + \"px\";\n cropArea.style.height = fixedImage.getBoundingClientRect().height + \"px\";\n cropArea.style.top = (box.getBoundingClientRect().height - fixedImage.getBoundingClientRect().height)/2 + \"px\";\n cropArea.style.left = (opacityDiv.getBoundingClientRect().width - fixedImage.getBoundingClientRect().width)/2 + \"px\";\n };\n\n\n retValue.rotate = function(){\n var cropperDim = cropper.getBoundingClientRect();\n var cropAreaDim = cropArea.getBoundingClientRect();\n var imageDim = fixedImage.getBoundingClientRect();\n var angle;\n var o = fixedImage.style.transform;\n var prevAng;\n if(o){\n angle = o.match(/-?\\d+/g);\n prevAng = angle[0];\n angle = parseInt(angle[0]) + 90;\n if(angle >= 360){\n angle = 0;\n }\n // cropArea.style.transform = \"rotate(\"+angle+\"deg)\";\n fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n } else {\n var angle = 90;\n // cropArea.style.transform = \"rotate(\"+angle+\"deg)\";\n fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n }\n if(retValue.angle === undefined){\n angle = 0\n retValue.angle = angle;\n } else {\n retValue.angle = angle;\n }\n\n positionCropper(cropperDim , cropAreaDim , imageDim , angle , prevAng);\n\n };\n\n\n // retValue.rotate = function(an){\n // var angle;\n // var currentValue = retValue.angle;\n // angle = an + currentValue;\n // fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n // divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n // if(retValue.angle === undefined){\n // retValue.angle = 0;\n // } else {\n // retValue.angle = angle;\n // }\n // };\n\n // retValue.rotateAntiClock = function(){\n // var cropperDim = cropper.getBoundingClientRect();\n // var cropAreaDim = cropArea.getBoundingClientRect();\n // var imageDim = fixedImage.getBoundingClientRect();\n // var angle;\n // var o = fixedImage.style.transform;\n // if(o){\n // angle = o.match(/-?\\d+/g);\n // angle = parseInt(angle[0]) - 90;\n // if(angle <= -360){\n // angle = 0;\n // }\n // // cropArea.style.transform = \"rotate(\"+angle+\"deg)\";\n // fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n // divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n // } else {\n // var angle = -90;\n // // cropArea.style.transform = \"rotate(\"+angle+\"deg)\";\n // fixedImage.style.transform = \"rotate(\"+angle+\"deg)\";\n // divImageImg.style.transform = \"rotate(\"+angle+\"deg)\";\n // }\n // if(retValue.angle === undefined){\n // angle = 0;\n // retValue.angle = angle;\n // } else {\n // retValue.angle = angle;\n // }\n //\n //\n // positionCropper(cropperDim , cropAreaDim , imageDim , angle);\n //\n // };\n\n\n retValue.getCroppedImage = function(){\n // debugger;\n\n var canvas = document.createElement('CANVAS');\n canvas.height = cropper.getBoundingClientRect().height;\n canvas.width = cropper.getBoundingClientRect().width;\n canvas.style.background = \"#eee\";\n var ctx = canvas.getContext('2d');\n\n var o = fixedImage.style.transform;\n var angle = 0;\n if(o){\n angle = o.match(/-?\\d+/g);\n angle = parseInt(angle[0]);\n }\n if((Math.abs(angle) !== 90)&&(Math.abs(angle) !== 270)){\n divImageImg.style.transform = 'rotate(0deg)';\n }\n // var image = new Image();\n // image.src = divImageImg.src;\n var image = $L('.lyteCropDivImageImg')[0];\n // image.style.width = divImageImg.getBoundingClientRect().width + 'px';\n // image.style.height = divImageImg.getBoundingClientRect().height + 'px';\n var cx = divImageImg.getBoundingClientRect().left - cropper.getBoundingClientRect().left;\n var cy = divImageImg.getBoundingClientRect().top - cropper.getBoundingClientRect().top;\n var cw = divImageImg.getBoundingClientRect().width;\n var ch = divImageImg.getBoundingClientRect().height;\n divImageImg.style.transform = o;\n if(angle !== 0){\n\n var halfWidth = cw / 2;\n var halfHeight = ch / 2;\n\n ctx.save();\n\n ctx.translate( cx+halfWidth , cy+halfHeight);\n ctx.rotate(angle * (Math.PI/180));\n if((Math.abs(angle)%90 === 0)&&(!((Math.abs(angle) === 180)||(Math.abs(angle) === 360)))){\n cw = fixedImage.getBoundingClientRect().width;\n ch = fixedImage.getBoundingClientRect().height;\n ctx.drawImage(image,-halfHeight,-halfWidth,ch,cw);\n } else {\n ctx.drawImage(image,-halfWidth,-halfHeight,cw,ch);\n }\n\n ctx.restore();\n\n } else {\n ctx.imageSmoothingEnabled = true;\n ctx.imageSmoothingQuality = 'high';\n ctx.drawImage(image,cx,cy,cw,ch);\n // console.log(cx , cy);\n // ctx.drawImage(image,0,-300,100,100);\n }\n\n // console.log(image);\n\n return canvas;\n }\n\n\n $L(imageTag).data('cropper' , retValue);\n\n setTimeout(function(){\n cropMove();\n imageMove();\n imageZoom();\n imageRotate();\n },100);\n\n }\n\n var prevHt = fixedImage.getBoundingClientRect().height;\n var prevWt = fixedImage.getBoundingClientRect().width;\n\n\n cropper.addEventListener(\"mousedown\" , croppie);\n cropper.addEventListener(\"touchstart\" , croppie);\n\n\n function croppie(){\n cropStart();\n // console.log('croppie');\n opacityDiv.style.opacity = \"0.6\";\n\n event.preventDefault();\n\n\n var todo;\n if((event.target.className === \"lyteCropDivImageImg\")||(event.target.className === \"lyteCropDivImage\")){\n todo = \"parent\";\n } else {\n todo = \"child\"\n }\n var topEdge = document.getElementsByClassName('lyteCropTopEdge')[0];\n var rightEdge = document.getElementsByClassName('lyteCropRightEdge')[0];\n var bottomEdge = document.getElementsByClassName('lyteCropBottomEdge')[0];\n var leftEdge = document.getElementsByClassName('lyteCropLeftEdge')[0];\n var topRightCorner = document.getElementsByClassName('lyteCropTopRightCorner')[0];\n var bottomRightCorner = document.getElementsByClassName('lyteCropBottomRightCorner')[0];\n var bottomLeftCorner = document.getElementsByClassName('lyteCropBottomLeftCorner')[0];\n var topLeftCorner = document.getElementsByClassName('lyteCropTopLeftCorner')[0];\n\n // topEdge.style.background = rightEdge.style.background = bottomEdge.style.background = leftEdge.style.background = \"rgba(255,255,255,0.6)\";\n\n switch (todo) {\n\n case \"child\":{\n\n\n var cropperTop = cropper.getBoundingClientRect().top;\n var cropperBottom = cropper.getBoundingClientRect().bottom;\n var cropperRight = cropper.getBoundingClientRect().right;\n var cropperLeft = cropper.getBoundingClientRect().left;\n var cropperWidth = cropper.getBoundingClientRect().width;\n var cropperHeight = cropper.getBoundingClientRect().height;\n var previousClientX;\n var previousClientY;\n if(event.type === 'mousedown'){\n previousClientX = event.clientX;\n previousClientY = event.clientY;\n } else if(event.type === 'touchstart'){\n previousClientX = event.touches[0].clientX;\n previousClientY = event.touches[0].clientY;\n }\n var midHeight = (cropper.getBoundingClientRect().top + (cropper.getBoundingClientRect().height / 2)) - cropArea.getBoundingClientRect().top;\n var midWidth = (cropper.getBoundingClientRect().left + (cropper.getBoundingClientRect().width / 2)) - cropArea.getBoundingClientRect().left;\n var finalLeft = opacityDiv.getBoundingClientRect().left - cropArea.getBoundingClientRect().left;\n var finalTop = opacityDiv.getBoundingClientRect().top - cropArea.getBoundingClientRect().top;\n var finalRight = opacityDiv.getBoundingClientRect().right - cropper.getBoundingClientRect().width - box.getBoundingClientRect().left;\n var tempWidth , tempHeight;\n var todoC;\n if (event.target.className === \"\") {\n todoC = event.target.parentElement.className;\n } else {\n todoC = event.target.className;\n }\n\n function cropFun(){\n event.preventDefault();\n var opacityDivLeft = opacityDiv.getBoundingClientRect().left;\n var opacityDivRight = opacityDiv.getBoundingClientRect().right;\n var opacityDivHeight = opacityDiv.getBoundingClientRect().height;\n var opacityDivWidth = opacityDiv.getBoundingClientRect().width;\n var opacityDivTop = opacityDiv.getBoundingClientRect().top;\n var opacityDivBottom = opacityDiv.getBoundingClientRect().bottom;\n var presentClientX;\n var presentClientY;\n var evX;\n var evY;\n if(event.type === 'mousemove'){\n evX = event.clientX;\n evY = event.clientY;\n presentClientX = event.clientX;\n presentClientY = event.clientY;\n } else if(event.type === 'touchmove'){\n evX = event.touches[0].clientX;\n evY = event.touches[0].clientY;\n presentClientX = event.touches[0].clientX;\n presentClientY = event.touches[0].clientY;\n }\n var cropperCurrentHeight = cropper.getBoundingClientRect().height;\n var cropperCurrentWidth = cropper.getBoundingClientRect().width;\n var cropperCurrentRight = cropper.getBoundingClientRect().right;\n var cropperCurrentLeft = cropper.getBoundingClientRect().left;\n var cropperCurrentTop = cropper.getBoundingClientRect().top;\n var cropperCurrentBottom = cropper.getBoundingClientRect().bottom;\n var x = ( window.pageXOffset || document.documentElement.scrollLeft ) ,y = window.pageYOffset || document.documentElement.scrollTop;\n var xChange = 0, yChange = 0;\n\n\n switch (todoC) {\n case \"lyteCropLeftEdge\":\n if ((cropperWidth - (evX - previousClientX))>=leastWidth) {\n if(evX > opacityDiv.getBoundingClientRect().left){\n cropper.style.width = cropperWidth - (presentClientX - previousClientX) + \"px\";\n cropper.style.height = (cropperWidth - (presentClientX - previousClientX))/aspectDiff + \"px\";\n cropper.style.top = ((cropperTop - cropArea.getBoundingClientRect().top) + ((presentClientX - previousClientX)/aspectDiff)/2) + \"px\";\n cropper.style.left = ((cropperLeft - cropArea.getBoundingClientRect().left) + (evX - previousClientX))+ \"px\";\n }\n if(evX-6 <= opacityDiv.getBoundingClientRect().left){\n if((!(cropper.getBoundingClientRect().height >= opacityDiv.getBoundingClientRect().height))||(!(cropper.getBoundingClientRect().width >= opacityDiv.getBoundingClientRect().width))&&(cropper.getBoundingClientRect().left < opacityDiv.getBoundingClientRect().left)){\n cropper.style.top = (opacityDivBottom - (((opacityDivWidth - (opacityDivRight - cropperRight))/aspectDiff) + (opacityDivBottom - (midHeight + ((opacityDivWidth - (opacityDivRight - cropperRight))/aspectDiff)/2)))) + \"px\";\n cropper.style.left = opacityDiv.getBoundingClientRect().left - cropArea.getBoundingClientRect().left + \"px\";\n }\n cropper.style.width = opacityDivWidth - (opacityDivRight - cropperRight) + \"px\";\n cropper.style.height = (opacityDivWidth - (opacityDivRight - cropperRight))/aspectDiff + \"px\";\n }\n if(cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom){\n cropper.style.top = opacityDiv.getBoundingClientRect().bottom - cropper.getBoundingClientRect().height - cropArea.getBoundingClientRect().top + \"px\";\n }\n if(cropper.getBoundingClientRect().top <= opacityDiv.getBoundingClientRect().top){\n cropper.style.top = opacityDiv.getBoundingClientRect().top - cropArea.getBoundingClientRect().top + \"px\";\n }\n if((cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom)&&(cropper.getBoundingClientRect().top <= opacityDiv.getBoundingClientRect().top)){\n cropper.style.left = cropperRight - ((opacityDivBottom - opacityDivTop)*aspectDiff) - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = (opacityDivBottom - opacityDivTop)*aspectDiff + \"px\";\n cropper.style.height = opacityDivBottom - opacityDivTop + \"px\";\n cropper.style.top = opacityDivTop - cropArea.getBoundingClientRect().top + \"px\";\n }\n } else {\n if(!(aspectRatio === \"n:n\")){\n cropper.style.left = (cropperRight - leastWidth) - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.top = (midHeight - (leastHeight/2)) + \"px\";\n cropper.style.width = leastWidth +\"px\";\n cropper.style.height = leastHeight + \"px\";\n }\n }\n break;\n case \"lyteCropTopEdge\":\n if ((cropperHeight - (evY - previousClientY))>=leastHeight) {\n if(evY > opacityDiv.getBoundingClientRect().top+6){\n cropper.style.width = (cropperHeight - (evY - previousClientY))*aspectDiff + \"px\";\n cropper.style.height = cropperHeight - (evY - previousClientY)+ \"px\";\n cropper.style.left = ((cropperLeft - cropArea.getBoundingClientRect().left) + ((evY - previousClientY)*aspectDiff)/2) + \"px\";\n cropper.style.top = ((cropperTop - cropArea.getBoundingClientRect().top) + (evY - previousClientY))+ \"px\";\n }\n if(evY-6 <= opacityDiv.getBoundingClientRect().top){\n if((!(cropper.getBoundingClientRect().height >= opacityDiv.getBoundingClientRect().height))||(!(cropper.getBoundingClientRect().width >= opacityDiv.getBoundingClientRect().width))&&(cropper.getBoundingClientRect().left < opacityDivLeft)){\n cropper.style.left = (opacityDivRight - (((cropperBottom - opacityDivTop)*aspectDiff) + (opacityDivRight-(midWidth+(((cropperBottom - opacityDivTop)*aspectDiff)/2))))) + \"px\";\n cropper.style.top = opacityDiv.getBoundingClientRect().top - cropArea.getBoundingClientRect().top + \"px\";\n }\n cropper.style.width = (cropperBottom - opacityDivTop)*aspectDiff + \"px\";\n cropper.style.height = cropperBottom - opacityDivTop + \"px\";\n }\n if(cropper.getBoundingClientRect().left <= opacityDivLeft){\n cropper.style.left = opacityDivLeft - cropArea.getBoundingClientRect().left + \"px\";\n }\n if(cropper.getBoundingClientRect().right >= opacityDiv.getBoundingClientRect().right){\n cropper.style.left = opacityDiv.getBoundingClientRect().right - cropper.getBoundingClientRect().width - cropArea.getBoundingClientRect().left+ \"px\";\n }\n if((cropper.getBoundingClientRect().right >= opacityDiv.getBoundingClientRect().right)&&(cropper.getBoundingClientRect().left <= opacityDivLeft)){\n cropper.style.width = opacityDivRight - opacityDivLeft + \"px\";\n cropper.style.height = (opacityDivRight - opacityDivLeft)/aspectDiff + \"px\";\n cropper.style.top = (cropperBottom - ((opacityDivRight - opacityDivLeft)/aspectDiff)) - cropArea.getBoundingClientRect().top + \"px\";\n cropper.style.left = opacityDivLeft - cropArea.getBoundingClientRect().left + \"px\";\n }\n } else {\n if(!(aspectRatio === \"n:n\")){\n cropper.style.top = (cropperBottom - leastHeight) - cropArea.getBoundingClientRect().top + \"px\";\n cropper.style.left = (midWidth - (leastWidth/2)) + \"px\";\n cropper.style.width = leastWidth +\"px\";\n cropper.style.height = leastHeight + \"px\";\n }\n }\n break;\n case \"lyteCropBottomEdge\":\n if((cropperHeight + (evY - previousClientY))>=leastHeight){\n if(evY < opacityDiv.getBoundingClientRect().bottom){\n cropper.style.width = (cropperHeight + (presentClientY - previousClientY))*aspectDiff + \"px\";\n cropper.style.height = cropperHeight + (evY - previousClientY)+ \"px\";\n cropper.style.left = ((cropperLeft - cropArea.getBoundingClientRect().left) - ((presentClientY - previousClientY)*aspectDiff)/2) + \"px\";\n cropper.style.bottom = ((cropperBottom - cropArea.getBoundingClientRect().bottom) - (presentClientY - previousClientY))+ \"px\";\n }\n if(evY >= opacityDiv.getBoundingClientRect().bottom){\n cropper.style.left = midWidth - (((opacityDivBottom - cropperTop)*aspectDiff) / 2) + \"px\";\n cropper.style.width = (opacityDivBottom - cropperTop)*aspectDiff + \"px\";\n cropper.style.height = opacityDivBottom - cropperTop + \"px\";\n }\n if(cropper.getBoundingClientRect().left <= opacityDivLeft){\n cropper.style.left = opacityDivLeft - cropArea.getBoundingClientRect().left + \"px\";\n }\n if(cropper.getBoundingClientRect().right >= opacityDiv.getBoundingClientRect().right){\n cropper.style.left = opacityDivRight - cropper.getBoundingClientRect().width - cropArea.getBoundingClientRect().left+ \"px\";\n }\n if((cropper.getBoundingClientRect().right >= opacityDiv.getBoundingClientRect().right)&&(cropper.getBoundingClientRect().left <= opacityDivLeft)){\n cropper.style.left = opacityDivLeft - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = opacityDivRight - opacityDivLeft + \"px\";\n cropper.style.height = (opacityDivRight - opacityDivLeft)/aspectDiff + \"px\";\n }\n } else {\n if(!(aspectRatio === \"n:n\")){\n cropper.style.left = (midWidth - (leastWidth/2)) + \"px\";\n cropper.style.width = leastWidth + \"px\";\n cropper.style.height = leastHeight + \"px\";\n }\n }\n break;\n case \"lyteCropRightEdge\":\n if((cropperWidth + (presentClientX - previousClientX))>=leastWidth){\n if(presentClientX < opacityDivRight){\n cropper.style.width = cropperWidth + (presentClientX - previousClientX) + \"px\";\n cropper.style.height = (cropperWidth + (presentClientX - previousClientX))/aspectDiff + \"px\";\n cropper.style.top = ((cropperTop - cropArea.getBoundingClientRect().top) - ((presentClientX - previousClientX)/aspectDiff)/2) + \"px\";\n cropper.style.right = ((cropperRight - cropArea.getBoundingClientRect().right) - (presentClientX - previousClientX))+ \"px\";\n }\n if(presentClientX >= opacityDivRight){\n cropper.style.top = midHeight - (((opacityDivRight - cropperLeft)/aspectDiff) / 2) + \"px\";\n cropper.style.width = opacityDivRight - cropperLeft + \"px\";\n cropper.style.height = (opacityDivRight - cropperLeft)/aspectDiff + \"px\";\n }\n if(cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom){\n cropper.style.top = opacityDiv.getBoundingClientRect().bottom - cropper.getBoundingClientRect().height - cropArea.getBoundingClientRect().top + \"px\";\n }\n if(cropper.getBoundingClientRect().top <= opacityDiv.getBoundingClientRect().top){\n cropper.style.top = opacityDivTop - cropArea.getBoundingClientRect().top + \"px\";\n }\n if((cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom)&&(cropper.getBoundingClientRect().top <= opacityDiv.getBoundingClientRect().top)){\n cropper.style.left = cropperLeft - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = (opacityDivBottom - opacityDivTop)*aspectDiff + \"px\";\n cropper.style.height = (opacityDivBottom - opacityDivTop) + \"px\";\n }\n } else {\n if(!(aspectRatio === \"n:n\")){\n cropper.style.top = (midHeight - (leastHeight/2)) + \"px\";\n cropper.style.width = leastWidth + \"px\";\n cropper.style.height = leastHeight + \"px\";\n }\n }\n break;\n case \"lyteCropTopRightCorner\":\n if ((cropperHeight - (evY - previousClientY))>=leastHeight) {\n if(evY >= opacityDivTop+5){\n cropper.style.width = (cropperHeight - (evY - previousClientY))*aspectDiff + \"px\";\n cropper.style.height = cropperHeight - (evY - previousClientY)+ \"px\";\n cropper.style.top = ((cropperTop - cropArea.getBoundingClientRect().top) + (evY - previousClientY))+ \"px\";\n cropper.style.right = ((cropperRight - cropArea.getBoundingClientRect().right) - (evX - previousClientX))+ \"px\";\n }\n if(evY < (opacityDiv.getBoundingClientRect().top+5)){\n if((!(cropper.getBoundingClientRect().height >= opacityDiv.getBoundingClientRect().height))||(!(cropper.getBoundingClientRect().width >= opacityDiv.getBoundingClientRect().width))&&(cropper.getBoundingClientRect().left < opacityDivLeft)){\n cropper.style.top = opacityDiv.getBoundingClientRect().top - cropArea.getBoundingClientRect().top + \"px\";\n }\n cropper.style.width = (cropperBottom - opacityDivTop)*aspectDiff + \"px\";\n cropper.style.height = cropperBottom - opacityDivTop + \"px\";\n }\n if(cropper.getBoundingClientRect().right >= opacityDiv.getBoundingClientRect().right){\n cropper.style.top = (cropperBottom - ((opacityDivRight - cropperLeft)/aspectDiff)) - cropArea.getBoundingClientRect().top + \"px\";\n cropper.style.width = opacityDivRight - cropperLeft + \"px\";\n cropper.style.height = (opacityDivRight - cropperLeft)/aspectDiff + \"px\";\n }\n } else {\n if(!(aspectRatio === \"n:n\")){\n cropper.style.top = (cropperBottom - leastHeight) - cropArea.getBoundingClientRect().top + \"px\";\n cropper.style.width = leastWidth + \"px\";\n cropper.style.height = leastHeight + \"px\";\n }\n }\n if(aspectRatio === \"n:n\"){\n if((cropperWidth + (presentClientX - previousClientX))>=leastWidth){\n if(presentClientX < opacityDivRight){\n cropper.style.width = cropperWidth + (presentClientX - previousClientX) + \"px\";\n cropper.style.height = (cropperWidth + (presentClientX - previousClientX))/aspectDiff + \"px\";\n cropper.style.top = ((cropperTop - cropArea.getBoundingClientRect().top) - ((presentClientX - previousClientX)/aspectDiff)/2) + \"px\";\n cropper.style.right = ((cropperRight - cropArea.getBoundingClientRect().right) - (presentClientX - previousClientX))+ \"px\";\n }\n if(presentClientX >= opacityDivRight){\n cropper.style.top = midHeight - (((opacityDivRight - cropperLeft)/aspectDiff) / 2) + \"px\";\n cropper.style.width = opacityDivRight - cropperLeft + \"px\";\n cropper.style.height = (opacityDivRight - cropperLeft)/aspectDiff + \"px\";\n }\n if(cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom){\n cropper.style.top = opacityDiv.getBoundingClientRect().bottom - cropper.getBoundingClientRect().height - cropArea.getBoundingClientRect().top + \"px\";\n }\n if(cropper.getBoundingClientRect().top <= opacityDiv.getBoundingClientRect().top){\n cropper.style.top = opacityDivTop - cropArea.getBoundingClientRect().top + \"px\";\n }\n if((cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom)&&(cropper.getBoundingClientRect().top <= opacityDiv.getBoundingClientRect().top)){\n cropper.style.left = cropperLeft - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = (opacityDivBottom - opacityDivTop)*aspectDiff + \"px\";\n cropper.style.height = (opacityDivBottom - opacityDivTop) + \"px\";\n }\n }\n }\n break;\n case \"lyteCropTopLeftCorner\":\n if((cropperHeight - (evY - previousClientY))>=leastHeight){\n if(evY >= opacityDivTop+5){\n cropper.style.width = (cropperHeight - (evY - previousClientY))*aspectDiff + \"px\";\n cropper.style.height = cropperHeight - (evY - previousClientY)+ \"px\";\n cropper.style.top = ((cropperTop - cropArea.getBoundingClientRect().top) + (evY - previousClientY))+ \"px\";\n cropper.style.left = ((cropperLeft - cropArea.getBoundingClientRect().left) + ((evY - previousClientY)*aspectDiff)) + \"px\";\n }\n if(evY-6 <= opacityDiv.getBoundingClientRect().top){\n if((!(cropper.getBoundingClientRect().height >= opacityDiv.getBoundingClientRect().height))||(!(cropper.getBoundingClientRect().width >= opacityDiv.getBoundingClientRect().width))&&(cropper.getBoundingClientRect().left < opacityDivLeft)){\n cropper.style.left = (opacityDivRight - (((cropperBottom - opacityDivTop)*aspectDiff) + (opacityDivRight - cropperRight))) - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.top = opacityDiv.getBoundingClientRect().top - cropArea.getBoundingClientRect().top + \"px\";\n }\n cropper.style.width = (cropperBottom - opacityDivTop)*aspectDiff + \"px\";\n cropper.style.height = cropperBottom - opacityDivTop + \"px\";\n }\n if(cropper.getBoundingClientRect().left <= opacityDiv.getBoundingClientRect().left){\n cropper.style.top = (cropperBottom - ((cropperRight - opacityDivLeft)/aspectDiff)) - cropArea.getBoundingClientRect().top + \"px\";\n cropper.style.left = opacityDiv.getBoundingClientRect().left - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = cropperRight - opacityDivLeft + \"px\";\n cropper.style.height = (cropperRight - opacityDivLeft)/aspectDiff + \"px\";\n }\n } else {\n if(!(aspectRatio === \"n:n\")){\n cropper.style.top = (cropperBottom - leastHeight) - cropArea.getBoundingClientRect().top + \"px\";\n cropper.style.left = (cropperRight - leastWidth) - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = leastWidth + \"px\";\n cropper.style.height = leastHeight + \"px\";\n }\n }\n if(aspectRatio === \"n:n\"){\n if ((cropperWidth - (evX - previousClientX))>=leastWidth) {\n if(evX > opacityDiv.getBoundingClientRect().left){\n cropper.style.width = cropperWidth - (presentClientX - previousClientX) + \"px\";\n cropper.style.height = (cropperWidth - (presentClientX - previousClientX))/aspectDiff + \"px\";\n cropper.style.top = ((cropperTop - cropArea.getBoundingClientRect().top) + ((presentClientX - previousClientX)/aspectDiff)/2) + \"px\";\n cropper.style.left = ((cropperLeft - cropArea.getBoundingClientRect().left) + (evX - previousClientX))+ \"px\";\n }\n if(evX-6 <= opacityDiv.getBoundingClientRect().left){\n if((!(cropper.getBoundingClientRect().height >= opacityDiv.getBoundingClientRect().height))||(!(cropper.getBoundingClientRect().width >= opacityDiv.getBoundingClientRect().width))&&(cropper.getBoundingClientRect().left < opacityDiv.getBoundingClientRect().left)){\n cropper.style.top = (opacityDivBottom - (((opacityDivWidth - (opacityDivRight - cropperRight))/aspectDiff) + (opacityDivBottom - (midHeight + ((opacityDivWidth - (opacityDivRight - cropperRight))/aspectDiff)/2)))) + \"px\";\n cropper.style.left = opacityDiv.getBoundingClientRect().left - cropArea.getBoundingClientRect().left + \"px\";\n }\n cropper.style.width = opacityDivWidth - (opacityDivRight - cropperRight) + \"px\";\n cropper.style.height = (opacityDivWidth - (opacityDivRight - cropperRight))/aspectDiff + \"px\";\n }\n if(cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom){\n cropper.style.top = opacityDiv.getBoundingClientRect().bottom - cropper.getBoundingClientRect().height - cropArea.getBoundingClientRect().top + \"px\";\n }\n if(cropper.getBoundingClientRect().top <= opacityDiv.getBoundingClientRect().top){\n cropper.style.top = opacityDiv.getBoundingClientRect().top - cropArea.getBoundingClientRect().top + \"px\";\n }\n if((cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom)&&(cropper.getBoundingClientRect().top <= opacityDiv.getBoundingClientRect().top)){\n cropper.style.left = cropperRight - ((opacityDivBottom - opacityDivTop)*aspectDiff) - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = (opacityDivBottom - opacityDivTop)*aspectDiff + \"px\";\n cropper.style.height = opacityDivBottom - opacityDivTop + \"px\";\n cropper.style.top = opacityDivTop - cropArea.getBoundingClientRect().top + \"px\";\n }\n }\n }\n break;\n case \"lyteCropBottomRightCorner\":\n if((cropperWidth + (presentClientX - previousClientX))>=leastWidth){\n if(presentClientX < opacityDivRight){\n cropper.style.width = cropperWidth + (presentClientX - previousClientX) + \"px\";\n cropper.style.height = (cropperWidth + (presentClientX - previousClientX))/aspectDiff + \"px\";\n }\n if((cropper.getBoundingClientRect().right >= opacityDivRight-5)&&(presentClientX >= opacityDivRight-5)){\n // cropper.style.top = (cropperBottom - ((opacityDivRight - cropperLeft)/aspectDiff)) - cropArea.getBoundingClientRect().top + \"px\";\n cropper.style.width = opacityDivRight - cropperLeft + \"px\";\n cropper.style.height = (opacityDivRight - cropperLeft)/aspectDiff + \"px\";\n }\n if(cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom){\n cropper.style.height = opacityDivBottom - cropperTop + \"px\";\n cropper.style.width = (opacityDivBottom - cropperTop)*aspectDiff + \"px\";\n }\n } else {\n if(!(aspectRatio === \"n:n\")){\n cropper.style.width = leastWidth + \"px\";\n cropper.style.height = leastHeight + \"px\";\n }\n }\n if(aspectRatio === \"n:n\"){\n if((cropperHeight + (evY - previousClientY))>=leastHeight){\n if(evY < opacityDiv.getBoundingClientRect().bottom){\n cropper.style.width = (cropperHeight + (presentClientY - previousClientY))*aspectDiff + \"px\";\n cropper.style.height = cropperHeight + (evY - previousClientY)+ \"px\";\n cropper.style.left = ((cropperLeft - cropArea.getBoundingClientRect().left) - ((presentClientY - previousClientY)*aspectDiff)/2) + \"px\";\n cropper.style.bottom = ((cropperBottom - cropArea.getBoundingClientRect().bottom) - (presentClientY - previousClientY))+ \"px\";\n }\n if(evY >= opacityDiv.getBoundingClientRect().bottom){\n cropper.style.left = midWidth - (((opacityDivBottom - cropperTop)*aspectDiff) / 2) + \"px\";\n cropper.style.width = (opacityDivBottom - cropperTop)*aspectDiff + \"px\";\n cropper.style.height = opacityDivBottom - cropperTop + \"px\";\n }\n if(cropper.getBoundingClientRect().left <= opacityDivLeft){\n cropper.style.left = opacityDivLeft - cropArea.getBoundingClientRect().left + \"px\";\n }\n if(cropper.getBoundingClientRect().right >= opacityDiv.getBoundingClientRect().right){\n cropper.style.left = opacityDivRight - cropper.getBoundingClientRect().width - cropArea.getBoundingClientRect().left+ \"px\";\n }\n if((cropper.getBoundingClientRect().right >= opacityDiv.getBoundingClientRect().right)&&(cropper.getBoundingClientRect().left <= opacityDivLeft)){\n cropper.style.left = opacityDivLeft - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = opacityDivRight - opacityDivLeft + \"px\";\n cropper.style.height = (opacityDivRight - opacityDivLeft)/aspectDiff + \"px\";\n }\n }\n }\n break;\n case \"lyteCropBottomLeftCorner\":\n if((cropperWidth - (evX - previousClientX))>=leastWidth){\n if(evX > opacityDiv.getBoundingClientRect().left){\n cropper.style.width = cropperWidth - (presentClientX - previousClientX) + \"px\";\n cropper.style.height = (cropperWidth - (presentClientX - previousClientX))/aspectDiff + \"px\";\n cropper.style.left = ((cropperLeft - cropArea.getBoundingClientRect().left) + (evX - previousClientX))+ \"px\";\n }\n if(evX-6 <= opacityDivLeft+2){\n if((!(cropper.getBoundingClientRect().height >= opacityDiv.getBoundingClientRect().height))||(!(cropper.getBoundingClientRect().width >= opacityDiv.getBoundingClientRect().width))&&(cropper.getBoundingClientRect().left < opacityDivLeft)){\n cropper.style.left = opacityDivLeft - cropArea.getBoundingClientRect().left + \"px\";\n }\n cropper.style.width = (cropperRight - opacityDivLeft) + \"px\";\n cropper.style.height = (cropperRight - opacityDivLeft)/aspectDiff + \"px\";\n }\n if(cropper.getBoundingClientRect().bottom >= opacityDiv.getBoundingClientRect().bottom){\n cropper.style.height = (opacityDivBottom - cropperTop) + \"px\";\n cropper.style.width = (opacityDivBottom - cropperTop)*aspectDiff + \"px\";\n cropper.style.left = opacityDivRight - (((opacityDivBottom - cropperTop)*aspectDiff) + (opacityDivRight - cropperRight)) - cropArea.getBoundingClientRect().left + \"px\";\n }\n } else {\n if(!(aspectRatio === \"n:n\")){\n cropper.style.left = (cropperRight - leastWidth) - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = leastWidth + \"px\";\n cropper.style.height = leastHeight + \"px\";\n }\n }\n if(aspectRatio === \"n:n\"){\n if((cropperHeight + (evY - previousClientY))>=leastHeight){\n if(evY < opacityDiv.getBoundingClientRect().bottom){\n cropper.style.width = (cropperHeight + (presentClientY - previousClientY))*aspectDiff + \"px\";\n cropper.style.height = cropperHeight + (evY - previousClientY)+ \"px\";\n cropper.style.left = ((cropperLeft - cropArea.getBoundingClientRect().left) - ((presentClientY - previousClientY)*aspectDiff)/2) + \"px\";\n cropper.style.bottom = ((cropperBottom - cropArea.getBoundingClientRect().bottom) - (presentClientY - previousClientY))+ \"px\";\n }\n if(evY >= opacityDiv.getBoundingClientRect().bottom){\n cropper.style.left = midWidth - (((opacityDivBottom - cropperTop)*aspectDiff) / 2) + \"px\";\n cropper.style.width = (opacityDivBottom - cropperTop)*aspectDiff + \"px\";\n cropper.style.height = opacityDivBottom - cropperTop + \"px\";\n }\n if(cropper.getBoundingClientRect().left <= opacityDivLeft){\n cropper.style.left = opacityDivLeft - cropArea.getBoundingClientRect().left + \"px\";\n }\n if(cropper.getBoundingClientRect().right >= opacityDiv.getBoundingClientRect().right){\n cropper.style.left = opacityDivRight - cropper.getBoundingClientRect().width - cropArea.getBoundingClientRect().left+ \"px\";\n }\n if((cropper.getBoundingClientRect().right >= opacityDiv.getBoundingClientRect().right)&&(cropper.getBoundingClientRect().left <= opacityDivLeft)){\n cropper.style.left = opacityDivLeft - cropArea.getBoundingClientRect().left + \"px\";\n cropper.style.width = opacityDivRight - opacityDivLeft + \"px\";\n cropper.style.height = (opacityDivRight - opacityDivLeft)/aspectDiff + \"px\";\n }\n }\n }\n break;\n default :\n break;\n }\n // divImageImg.style.left = \"-\"+((opacityDivLeft) + x )+\"px\";\n // divImageImg.style.left = \"-\"+((opacityDivLeft - (opacityDivLeft - divImageImg.getBoundingClientRect().left)) + x)+\"px\";\n // divImageImg.style.top = \"-\"+((opacityDiv.getBoundingClientRect().top) + window.scrollY )+\"px\";\n // divImageImg.style.top = \"-\"+((opacityDiv.getBoundingClientRect().top - (opacityDiv.getBoundingClientRect().top - divImageImg.getBoundingClientRect().top))+window.scrollY)+\"px\";\n var fixedImageTransform = fixedImage.style.transform;\n fixedImage.style.transform = 'rotate(0deg)';\n divImageImg.style.left = (fixedImage.getBoundingClientRect().left - cropper.getBoundingClientRect().left)+\"px\";\n divImageImg.style.top = (fixedImage.getBoundingClientRect().top - cropper.getBoundingClientRect().top)+\"px\";\n fixedImage.style.transform = fixedImageTransform;\n\n if(fixedImage.naturalWidth > fixedImage.naturalHeight){\n displayImage.style.height = (divImageImg.getBoundingClientRect().height * (displayImageDiv.getBoundingClientRect().height/cropper.getBoundingClientRect().height)) + \"px\";\n retValue.height = (divImageImg.getBoundingClientRect().height * (displayImageDiv.getBoundingClientRect().height/cropper.getBoundingClientRect().height));\n displayImage.style.width = \"auto\";\n retValue.width = \"auto\";\n } else {\n displayImage.style.width = (divImageImg.getBoundingClientRect().width * (displayImageDiv.getBoundingClientRect().width/cropper.getBoundingClientRect().width)) + \"px\";\n retValue.width = (divImageImg.getBoundingClientRect().width * (displayImageDiv.getBoundingClientRect().width/cropper.getBoundingClientRect().width));\n displayImage.style.height = \"auto\";\n retValue.height = \"auto\";\n }\n\n displayImage.style.top = \"-\" + ((cropper.getBoundingClientRect().top - opacityDiv.getBoundingClientRect().top)*(displayImageDiv.getBoundingClientRect().height/cropper.getBoundingClientRect().height)) + \"px\";\n displayImage.style.left = \"-\" + ((cropper.getBoundingClientRect().left - opacityDivLeft)*(displayImageDiv.getBoundingClientRect().width/cropper.getBoundingClientRect().width)) + \"px\";\n\n retValue.top =((cropper.getBoundingClientRect().top - opacityDiv.getBoundingClientRect().top)*(displayImageDiv.getBoundingClientRect().height/cropper.getBoundingClientRect().height));\n retValue.left =((cropper.getBoundingClientRect().left - opacityDivLeft)*(displayImageDiv.getBoundingClientRect().width/cropper.getBoundingClientRect().width));\n setCropperData();\n\n }\n document.addEventListener(\"mousemove\" , cropFun);\n document.addEventListener(\"mouseup\" , removeFun);\n // document.addEventListener(\"touchmove\" , cropFun);\n // document.addEventListener(\"touchend\" , removeFun);\n\n function removeFun(){\n opacityDiv.style.opacity = \"\";\n document.removeEventListener(\"mousemove\" , cropFun);\n document.removeEventListener(\"mouseup\" , removeFun);\n // document.removeEventListener(\"touchmove\" , cropFun);\n cropEnd();\n\n // fitToScreen();\n\n\n }\n\n break;\n\n }\n\n\n\n\n case \"parent\":{\n\n\n if(event.target.className === \"lyteCropDivImage\" || event.target.className === \"lyteCropDivImageImg\"){\n var cropperTop = cropper.getBoundingClientRect().top;\n var cropperLeft = cropper.getBoundingClientRect().left;\n var cropperRight = cropper.getBoundingClientRect().right;\n var cropperBottom = cropper.getBoundingClientRect().bottom;\n var cropperWidth = cropper.getBoundingClientRect().width;\n var cropperHeight = cropper.getBoundingClientRect().height;\n var previousClientX;\n var previousClientY;\n if(event.type === 'mousedown'){\n previousClientX = event.clientX;\n previousClientY = event.clientY;\n } else if(event.type === 'touchstart'){\n previousClientX = event.touches[0].clientX;\n previousClientY = event.touches[0].clientY;\n }\n var finalLeft = opacityDiv.getBoundingClientRect().left - cropArea.getBoundingClientRect().left;\n var finalRight = opacityDiv.getBoundingClientRect().right - cropper.getBoundingClientRect().width - box.getBoundingClientRect().left;\n var finalTop = opacityDiv.getBoundingClientRect().top - cropArea.getBoundingClientRect().top;\n var finalBottom = ((cropArea.getBoundingClientRect().bottom - (cropArea.getBoundingClientRect().bottom - opacityDiv.getBoundingClientRect().bottom) - cropper.getBoundingClientRect().height)-(window.innerHeight - cropArea.getBoundingClientRect().bottom));\n\n function moveCropper(){\n event.preventDefault();\n var opacityDivLeft = opacityDiv.getBoundingClientRect().left;\n var evX;\n var evY;\n if(event.type === 'mousemove'){\n evX = event.clientX;\n evY = event.clientY;\n } else if(event.type === 'touchmove'){\n evX = event.touches[0].clientX;\n evY = event.touches[0].clientY;\n }\n\n\n if(((cropperTop+(evY-previousClientY) - cropArea.getBoundingClientRect().top)+cropArea.getBoundingClientRect().top)>opacityDiv.getBoundingClientRect().top){\n cropper.style.top = (cropperTop+(evY-previousClientY) - cropArea.getBoundingClientRect().top)+\"px\";\n } else {\n cropper.style.top = finalTop +\"px\";\n }\n if(((cropperLeft+(evX-previousClientX) - cropArea.getBoundingClientRect().left)+cropArea.getBoundingClientRect().left)>opacityDivLeft){\n cropper.style.left = ((cropperLeft+(evX - previousClientX))-cropArea.getBoundingClientRect().left) + \"px\";\n } else {\n cropper.style.left = finalLeft + \"px\";\n }\n if(!(((cropperRight+(evX-previousClientX) - cropArea.getBoundingClientRect().right)+cropArea.getBoundingClientRect().right)<opacityDiv.getBoundingClientRect().right)){\n cropper.style.left = finalRight +\"px\";\n }\n if(!(((cropperBottom+(evY-previousClientY) - cropArea.getBoundingClientRect().bottom)+cropArea.getBoundingClientRect().bottom)<opacityDiv.getBoundingClientRect().bottom)){\n cropper.style.top = opacityDiv.getBoundingClientRect().bottom - cropper.getBoundingClientRect().height - cropArea.getBoundingClientRect().top + \"px\";\n }\n var opacityDivTop = opacityDiv.getBoundingClientRect().top;\n var fixedImageTransform = fixedImage.style.transform;\n fixedImage.style.transform = 'rotate(0deg)';\n divImageImg.style.left = (fixedImage.getBoundingClientRect().left - cropper.getBoundingClientRect().left)+\"px\";\n divImageImg.style.top = (fixedImage.getBoundingClientRect().top - cropper.getBoundingClientRect().top)+\"px\";\n fixedImage.style.transform = fixedImageTransform;\n // divImageImg.style.left = \"-\"+(opacityDivLeft)+\"px\";\n // divImageImg.style.left = \"-\"+((opacityDivLeft - (opacityDivLeft - divImageImg.getBoundingClientRect().left))+(opacityDivLeft - fixedImage.getBoundingClientRect().left))+\"px\";\n // divImageImg.style.top = \"-\"+opacityDiv.getBoundingClientRect().top+\"px\";\n // console.log(opacityDivTop - fixedImage.getBoundingClientRect().top);\n // divImageImg.style.top = \"-\"+((opacityDiv.getBoundingClientRect().top - (opacityDiv.getBoundingClientRect().top - divImageImg.getBoundingClientRect().top)) + (opacityDivTop - fixedImage.getBoundingClientRect().top))+\"px\";\n\n // console.log((cropper.getBoundingClientRect().top - opacityDiv.getBoundingClientRect().top)*(displayImageDiv.getBoundingClientRect().height/cropper.getBoundingClientRect().height));\n\n displayImage.style.top = \"-\" + ((cropper.getBoundingClientRect().top - opacityDiv.getBoundingClientRect().top)*(displayImageDiv.getBoundingClientRect().height/cropper.getBoundingClientRect().height)) + \"px\";\n displayImage.style.left = \"-\" + ((cropper.getBoundingClientRect().left - opacityDivLeft)*(displayImageDiv.getBoundingClientRect().width/cropper.getBoundingClientRect().width)) + \"px\";\n // displayImage.style.top = \"-\" + (((divImageImg.getBoundingClientRect().height - cropper.getBoundingClientRect().height)/(cropper.getBoundingClientRect().height/displayImageDiv.getBoundingClientRect().height))/2 + (-previousClientY + event.clientY)) + \"px\";\n\n retValue.top = ((cropper.getBoundingClientRect().top - opacityDiv.getBoundingClientRect().top)*(displayImageDiv.getBoundingClientRect().height/cropper.getBoundingClientRect().height));\n retValue.left = ((cropper.getBoundingClientRect().left - opacityDivLeft)*(displayImageDiv.getBoundingClientRect().width/cropper.getBoundingClientRect().width));\n setCropperData();\n }\n\n document.addEventListener(\"mousemove\" , moveCropper);\n document.addEventListener(\"mouseup\" , remFun);\n // document.addEventListener(\"touchmove\" , moveCropper);\n // document.addEventListener(\"touchend\" , remFun);\n\n function remFun(){\n opacityDiv.style.opacity = \"\";\n document.removeEventListener(\"mousemove\" , moveCropper);\n document.removeEventListener(\"mouseup\" , remFun);\n document.removeEventListener(\"mousedown\" , moveCropper);\n // document.removeEventListener(\"touchmove\" , moveCropper);\n cropEnd();\n }\n }\n break;\n\n\n }\n\n default :\n break;\n\n }\n\n\n function fitToScreen(){\n var rt , newHt , newWt;\n\n if(cropper.getBoundingClientRect().height > cropper.getBoundingClientRect().width){\n\n rt = (opacityDiv.getBoundingClientRect().height - 100)/cropper.getBoundingClientRect().height;\n newHt = opacityDiv.getBoundingClientRect().height - 100 ; newWt = rt*cropper.getBoundingClientRect().width;\n cropper.style.height = newHt + \"px\";\n cropper.style.width = newWt + \"px\";\n cropper.style.top = ((opacityDiv.getBoundingClientRect().height - cropper.getBoundingClientRect().height)/2) + \"px\"\n cropper.style.left = ((opacityDiv.getBoundingClientRect().width - cropper.getBoundingClientRect().width)/2) + \"px\"\n fixedImage.style.height = fixedImage.getBoundingClientRect().height * rt + \"px\";\n fixedImage.style.width = fixedImage.getBoundingClientRect().width * rt + \"px\";\n divImageImg.style.height = divImageImg.getBoundingClientRect().height * rt + \"px\";\n divImageImg.style.width = divImageImg.getBoundingClientRect().width * rt + \"px\";\n\n } else {\n\n rt = (opacityDiv.getBoundingClientRect().width - 100)/cropper.getBoundingClientRect().width;\n newWt = opacityDiv.getBoundingClientRect().width - 100 ; newHt = rt*cropper.getBoundingClientRect().height;\n cropper.style.height = newHt + \"px\";\n cropper.style.width = newWt + \"px\";\n cropper.style.top = ((opacityDiv.getBoundingClientRect().height - cropper.getBoundingClientRect().height)/2) + \"px\"\n cropper.style.left = ((opacityDiv.getBoundingClientRect().width - cropper.getBoundingClientRect().width)/2) + \"px\"\n\n }\n }\n\n\n }\n\n\n\n\n divImageImg.style.left = (fixedImage.getBoundingClientRect().left - cropper.getBoundingClientRect().left)+\"px\";\n divImageImg.style.top = (fixedImage.getBoundingClientRect().top - cropper.getBoundingClientRect().top)+\"px\";\n\n cropArea.addEventListener('wheel', function(ev) {\n // ev.preventDefault();\n // if(ev.ctrlKey){\n //\n // var fixedImageTransform = fixedImage.style.transform;\n // fixedImage.style.transform = 'rotate(0deg)';\n // var delY = ev.deltaY*10 || ev.deltaX*10;\n // var fixedImageDimension = fixedImage.getBoundingClientRect();\n // var cursorPosXInsideImage = ev.clientX - fixedImageDimension.left;\n // var cursorPosYInsideImage = ev.clientY - fixedImageDimension.top;\n // var oldWidth = fixedImageDimension.width;\n // var oldHeight = fixedImageDimension.height;\n // var newWidth = fixedImageDimension.width - delY;\n // var newXPos,diffXPos,newYPos,diffYpos,leftValFixedImage,topValFixedImage;\n // if(fixedImageDimension.width > fixedImageDimension.height) {\n // var newWidth = fixedImageDimension.width - delY;\n // if((newWidth >= 200)&&(newWidth <= 1500)){\n // fixedImage.style.height = divImageImg.style.height = '';\n // fixedImage.style.width = newWidth + 'px';\n // divImageImg.style.width = newWidth + 'px';\n // newXPos = (cursorPosXInsideImage/oldWidth)*newWidth;\n // diffXPos = newXPos - cursorPosXInsideImage;\n // newYPos = (cursorPosYInsideImage/oldHeight)*fixedImage.getBoundingClientRect().height;\n // diffYpos = newYPos - cursorPosYInsideImage;\n // leftValFixedImage = parseFloat(fixedImage.style.left);\n // topValFixedImage = parseFloat(fixedImage.style.top);\n // fixedImage.style.left = (leftValFixedImage - diffXPos) + 'px';\n // fixedImage.style.top = (topValFixedImage - diffYpos) + 'px';\n // }\n // }\n // else {\n // var newHeight = fixedImageDimension.height - delY;\n // if((newHeight >=200)&&(newHeight<=1000)){\n // fixedImage.style.width = divImageImg.style.width = '';\n // fixedImage.style.height = newHeight + 'px';\n // divImageImg.style.height = newHeight + 'px';\n // newXPos = (cursorPosXInsideImage/oldWidth)*fixedImage.getBoundingClientRect().width;\n // diffXPos = newXPos - cursorPosXInsideImage;\n // newYPos = (cursorPosYInsideImage/oldHeight)*newHeight;\n // diffYpos = newYPos - cursorPosYInsideImage;\n // leftValFixedImage = parseFloat(fixedImage.style.left);\n // topValFixedImage = parseFloat(fixedImage.style.top);\n // fixedImage.style.left = (leftValFixedImage - diffXPos) + 'px';\n // fixedImage.style.top = (topValFixedImage - diffYpos) + 'px';\n // }\n // }\n //\n // // var widthDiff = newWidth - fixedImageDimension.width;\n // // fixedImageWrap.style.width = fixedImageWrap.style.height = newWidth + \"px\";\n // //\n // // fixedImageWrap.style.top = widthDiff/2 + \"px\";\n // // fixedImageWrap.style.left = widthDiff/2 + \"px\";\n //\n // fixedImageDimension = fixedImage.getBoundingClientRect();\n //\n //\n // divImageImg.style.left = (fixedImageDimension.left - cropper.getBoundingClientRect().left)+\"px\";\n // divImageImg.style.top = (fixedImageDimension.top - cropper.getBoundingClientRect().top)+\"px\";\n // // fixedImage.style.transform = fixedImageTransform + \" translateX(-\" + newLt + \"px) translateY(-\" + newTt + \"px)\";\n // fixedImage.style.transform = fixedImageTransform;\n // } else {\n //\n // var fixedImageTransform = fixedImage.style.transform;\n // fixedImage.style.transform = 'rotate(0deg)';\n // var delTop = ev.deltaY/2;\n // var delLeft = ev.deltaX/2;\n // var fixedImageDimension = fixedImage.getBoundingClientRect();\n //\n //\n // if(((fixedImage.getBoundingClientRect().top-51) < (cropArea.getBoundingClientRect().top - fixedImage.getBoundingClientRect().height)) && ((ev.deltaY>=0)) ){\n // fixedImage.style.top = ((cropArea.getBoundingClientRect().top - fixedImage.getBoundingClientRect().height - cropArea.getBoundingClientRect().top)+ 50) + 'px';\n // divImageImg.style.top = (((cropArea.getBoundingClientRect().top - fixedImage.getBoundingClientRect().height - cropArea.getBoundingClientRect().top) - (cropper.getBoundingClientRect().top - opacityDiv.getBoundingClientRect().top))+50) + 'px';\n // } else if(((fixedImage.getBoundingClientRect().top+51) > opacityDiv.getBoundingClientRect().bottom)&&(ev.deltaY<=0)){\n // fixedImage.style.top = (opacityDiv.getBoundingClientRect().bottom - opacityDiv.getBoundingClientRect().top - 50) + \"px\";\n // divImageImg.style.top = (((opacityDiv.getBoundingClientRect().bottom - opacityDiv.getBoundingClientRect().top) - (cropper.getBoundingClientRect().top - opacityDiv.getBoundingClientRect().top))-50) + \"px\";\n // } else {\n // fixedImage.style.top = (fixedImage.getBoundingClientRect().top - opacityDiv.getBoundingClientRect().top - delTop) + 'px';\n // divImageImg.style.top = (divImageImg.getBoundingClientRect().top - delTop) + 'px';\n // divImageImg.style.top = (fixedImage.getBoundingClientRect().top - cropper.getBoundingClientRect().top)+\"px\";\n // }\n //\n //\n //\n // if(((fixedImage.getBoundingClientRect().left-51) <= (cropArea.getBoundingClientRect().left - fixedImage.getBoundingClientRect().width)) && (ev.deltaX>=0) ){\n // fixedImage.style.left = ((cropArea.getBoundingClientRect().left - fixedImage.getBoundingClientRect().width - cropArea.getBoundingClientRect().left)+50) + 'px';\n // divImageImg.style.left = (((cropArea.getBoundingClientRect().left - fixedImage.getBoundingClientRect().width - cropArea.getBoundingClientRect().left) - (cropper.getBoundingClientRect().left - opacityDiv.getBoundingClientRect().left))+50) + 'px';\n // } else if(((fixedImage.getBoundingClientRect().left+51) > opacityDiv.getBoundingClientRect().right)&&(ev.deltaX<=0)){\n // fixedImage.style.left = (opacityDiv.getBoundingClientRect().right - opacityDiv.getBoundingClientRect().left - 50) + \"px\";\n // divImageImg.style.left = (((opacityDiv.getBoundingClientRect().right - opacityDiv.getBoundingClientRect().left) - (cropper.getBoundingClientRect().left - opacityDiv.getBoundingClientRect().left))-50) + \"px\";\n // } else {\n // fixedImage.style.left = (fixedImage.getBoundingClientRect().left - opacityDiv.getBoundingClientRect().left - delLeft) + 'px';\n // divImageImg.style.left = (divImageImg.getBoundingClientRect().left - delLeft) + 'px';\n // divImageImg.style.left = (fixedImage.getBoundingClientRect().left - cropper.getBoundingClientRect().left)+\"px\";\n // }\n //\n //\n //\n //\n //\n // fixedImage.style.transform = fixedImageTransform;\n //\n // }\n //\n //\n // setCropperData();\n\n\n });\n\n\n\n\n fixedImage.ondragstart = mainImage.ondragstart = divImageImg.ondragstart = function () { return false; };\n\n })();\n\n\n }", "title": "" }, { "docid": "8d13e3a15bdced5f04f3d88fa34563ff", "score": "0.6140157", "text": "copyFrom(rectangle) {\n return this.x = rectangle.x, this.y = rectangle.y, this.width = rectangle.width, this.height = rectangle.height, this;\n }", "title": "" }, { "docid": "5193080fa8576bd1f0eb27b3cd0441bc", "score": "0.6138641", "text": "highlightSelectedAreaInCanvas(rect) {\n if (rect.x) {\n let oldCanvas = document.getElementById(this.element.id + '_canvas');\n let newCanvas = document.getElementById(this.element.id + '_secondary_canvas');\n let initialRect = this.initialClipRect;\n let rectImage = oldCanvas.getContext('2d').getImageData(rect.x, rect.y, rect.width, rect.height);\n newCanvas.getContext('2d').putImageData(rectImage, rect.x, rect.y);\n oldCanvas.style.opacity = '0.3';\n let topPosition = oldCanvas.getContext('2d').getImageData(0, 0, this.availableSize.width, initialRect.y);\n newCanvas.getContext('2d').putImageData(topPosition, 0, 0);\n let bottomPosition = oldCanvas.getContext('2d').getImageData(0, initialRect.y + initialRect.height, this.availableSize.width, this.availableSize.height - (initialRect.y + initialRect.height));\n newCanvas.getContext('2d').putImageData(bottomPosition, 0, initialRect.y + initialRect.height);\n let rightPosition = oldCanvas.getContext('2d').getImageData(initialRect.x + initialRect.width, 0, this.availableSize.width - (initialRect.x + initialRect.width), this.availableSize.height);\n newCanvas.getContext('2d').putImageData(rightPosition, initialRect.x + initialRect.width, 0);\n let leftPosition = oldCanvas.getContext('2d').getImageData(0, 0, initialRect.x, this.availableSize.height);\n newCanvas.getContext('2d').putImageData(leftPosition, 0, 0);\n }\n }", "title": "" }, { "docid": "df36e24a7ab9c0e3e204f524011cb625", "score": "0.6119746", "text": "static imageCrop(image, cropX, cropY, cropW, cropH, placeX, placeY, placeW, placeH){\n if(Draw.checkGame()){\n game.ctx.drawImage(image, cropX, cropY, cropW, cropH, placeX, placeY, placeW, placeH);\n }\n }", "title": "" }, { "docid": "65ea234046af3cee7b41f40fe952b298", "score": "0.6084146", "text": "function cropperDrag(cropperClickOffsetX, cropperClickOffsetY, mouseX, mouseY) {\n let left, top;\n\n let width = cropperRight - cropperLeft;\n let height = cropperBottom - cropperTop;\n\n left = mouseX - cropperClickOffsetX;\n top = mouseY - cropperClickOffsetY;\n\n cropperLeft = Math.round(clamp(left, 0, imageWidth - width));\n cropperTop = Math.round(clamp(top, 0, imageHeight - height));\n cropperRight = Math.round(cropperLeft + width);\n cropperBottom = Math.round(cropperTop + height);\n}", "title": "" }, { "docid": "20d2587bcecbd13bb3d97cffbc7eba18", "score": "0.60786146", "text": "function crop(image, width, height) { \n var n = new SimpleImage(width, height);\n for(var p of image.values()) {\n var x = p.getX();\n var y = p.getY();\n if (x < width && y < height){\n var np = n.getPixel(x,y);\n np.setRed(p.getRed());\n np.setBlue(p.getBlue());\n np.setGreen(p.getGreen());\n }\n }\n return n;\n}", "title": "" }, { "docid": "947faf6a3b3c4ff22d33399c81590432", "score": "0.60776883", "text": "function cropperFunction() {\n try {\n $(function () {\n $('#CropperImageSet').cropper({\n viewMode: 1,\n dragMode: 'move',\n checkCrossOrigin: true,\n checkImageOrigin: true,\n autoCropArea: 0,\n restore: true,\n modal: true,\n guides: true,\n highlight: false,\n center: true,\n minContainerHeight: divHeight + 50,\n minContainerWidth: divWidth + 50,\n cropBoxMovable: false,\n cropBoxResizable: false,\n toggleDragModeOnDblclick: false,\n built: function () {\n var canvas = $('.cropper-canvas').children()[0];\n var zoomfactorW = divWidth / canvas.naturalWidth;\n var zoomfactorH = divHeight / canvas.naturalHeight;\n if (zoomfactorW > zoomfactorH) {\n if (canvas.width > divWidth) {\n setBoxThenImage(zoomfactorW);\n } else {\n setImageThenBox(zoomfactorW);\n }\n } else {\n if (canvas.height > divHeight) {\n setBoxThenImage(zoomfactorH);\n } else {\n setImageThenBox(zoomfactorH);\n }\n }\n var ratio = (canvas.width) / (canvas.naturalWidth);\n $('.input-range-bar').val(ratio);\n $('.input-range-bar').slider({\n highlight: true\n });\n if (ratio > 1) {\n $('.ui-slider-track').addClass(\"pwdon0\");\n }\n $('#getAssetsEditorModal').css(\"opacity\", \"1\");\n }\n });\n });\n } catch (err) {\n console.log(err.message)\n }\n }", "title": "" }, { "docid": "7b76f0fd135f1fa757abde7bdc0d69dc", "score": "0.60519016", "text": "_crop() {\n return this.setStateAsync({\n // croppedData: this.cropper.getCroppedCanvas().toDataURL(),\n });\n }", "title": "" }, { "docid": "7a2b36d66a9a4ce432c971707db7e8fa", "score": "0.60361004", "text": "function cropImage(img) {\n let height = img.size.height;\n let width = img.size.width;\n \n let imgShortSide = Math.min(height, width);\n let imgLongSide = Math.max(height, width);\n \n if (imgShortSide != imgLongSide) {\n let imgCropTotal = imgLongSide - imgShortSide;\n let imgCropSide = Math.floor(imgCropTotal / 2);\n \n let rect;\n switch (imgShortSide) {\n case height:\n rect = new Rect(imgCropSide, 0, imgShortSide, imgShortSide);\n break;\n case width:\n rect = new Rect(0, imgCropSide, imgShortSide, imgShortSide);\n break;\n }\n \n let draw = new DrawContext();\n draw.size = new Size(rect.width, rect.height);\n \n draw.drawImageAtPoint(img, new Point(-rect.x, -rect.y));\n img = draw.getImage();\n }\n \n return img;\n}", "title": "" }, { "docid": "bbcad5e45508ec4a28bb832d9fe6823a", "score": "0.6016944", "text": "function drawRectangle(){\r\n image = \"Rectangle\";\r\n canvasClear();\r\n context.beginPath();\r\n context.beginPath();\r\n context.rect(T1, T2, Z0, Z1);\r\n context.fillStyle = polygonColor;\r\n context.fill();\r\n}", "title": "" }, { "docid": "27579a10e87741e0c27a621e22f1f099", "score": "0.6014522", "text": "function renderImage(item) {\n // Locate the container for all the cropper windows\n const cropperContainer = document.getElementById('croppercontainer');\n\n //Create the container for a single cropper window (to include heading and cropper img)\n const newCropperChildContainer = document.createElement(\"div\");\n newCropperChildContainer.textContent = item.x + \"x\" + item.y + \"_\" + item.type;\n newCropperChildContainer.classList.add(\"croppercont\");\n\n //Create the container for just the cropper img\n const newCropperChildContain = document.createElement(\"div\");\n\n const newCropperChild = document.createElement(\"img\");\n newCropperChild.id = item.x + \"x\" + item.y + \"x\" + item.type;\n newCropperChild.src = img.src;\n newCropperChildContain.appendChild(newCropperChild);\n newCropperChildContainer.appendChild(newCropperChild);\n cropperContainer.appendChild(newCropperChildContainer);\n // const image = document.getElementById('image'+item);\n croppers.push(new Cropper(document.getElementById(item.x + \"x\" + item.y + \"x\" + item.type), {viewMode: 0, autoCropArea: 1,\n aspectRatio: item.x / item.y,\n crop(event) {\n // console.log(event.detail.x);\n // console.log(event.detail.y);\n // console.log(event.detail.width);\n // console.log(event.detail.height);\n // console.log(event.detail.rotate);\n // console.log(event.detail.scaleX);\n // console.log(event.detail.scaleY);\n },\n }));\n}", "title": "" }, { "docid": "9faa4ccdcfacdeae8058c184d63690a1", "score": "0.600595", "text": "cropSuccess(imgDataUrl, field) {\n console.log('-------- crop success --------');\n this.imgDataUrl = imgDataUrl;\n }", "title": "" }, { "docid": "d7a160d061f266927b7147818e827c98", "score": "0.600493", "text": "redrawSelectionRectangle() {\r\n this.selection.rectangle\r\n .attr(\"x\", this.selection.minCoords[0])\r\n .attr(\"y\", this.selection.minCoords[1])\r\n .attr(\"width\", Math.abs(this.selection.maxCoords[0] - this.selection.minCoords[0]))\r\n .attr(\"height\", Math.abs(this.selection.maxCoords[1] - this.selection.minCoords[1]))\r\n .style(\"opacity\", 0.2);\r\n }", "title": "" }, { "docid": "994c845ab3af0c1f42be781a83b44e1b", "score": "0.5991603", "text": "function updateCrop(coords) {\n $('#crop_x').val(coords.x*ratio_w);\n $('#crop_y').val(coords.y*ratio_h);\n $('#crop_w').val(coords.w*ratio_w);\n $('#crop_h').val(coords.h*ratio_h);\n}", "title": "" }, { "docid": "bc76e974d8ff415e6ffda21ab84e4c7f", "score": "0.5941443", "text": "function createRectCutoutWithCutterRadius(minx, miny, maxx, maxy, cutterRadius, plate2d)\n{\n var deltax = maxx-minx;\n var deltay = maxy-miny;\n var cutout = CAG.rectangle({radius: [(maxx-minx)/2, (maxy-miny)/2], center: [(maxx+minx)/2, (maxy+miny)/2]});\n var cornercutouts = [];\n if(cutterRadius > 0)\n {\n var extracutout = cutterRadius * 0.2;\n var hypcutterradius = cutterRadius / Math.sqrt(2.0);\n var halfcutterradius = 0.5 * cutterRadius;\n var dcx, dcy;\n if(deltax > 3*deltay)\n {\n dcx = cutterRadius + extracutout/2;\n dcy = extracutout / 2;\n }\n else if(deltay > 3*deltax)\n {\n dcx = extracutout / 2;\n dcy = cutterRadius + extracutout/2;\n }\n else\n {\n dcx = hypcutterradius-extracutout/2;\n dcy = hypcutterradius-extracutout/2;\n }\n for(var corner = 0; corner < 4; corner++)\n {\n var cutoutcenterx = (corner & 2)? (maxx-dcx):(minx+dcx);\n var cutoutcentery = (corner & 1)? (maxy-dcy):(miny+dcy);\n var cornercutout = CAG.rectangle({radius: [cutterRadius+extracutout/2, cutterRadius+extracutout/2], center: [cutoutcenterx, cutoutcentery]});\n var testrectacenterx = (corner & 2)? (maxx-halfcutterradius):(minx+halfcutterradius);\n var testrectbcenterx = (corner & 2)? (maxx+halfcutterradius):(minx-halfcutterradius);\n var testrectacentery = (corner & 1)? (maxy+halfcutterradius):(miny-halfcutterradius);\n var testrectbcentery = (corner & 1)? (maxy-halfcutterradius):(miny+halfcutterradius);\n var testrecta = CAG.rectangle({radius: [halfcutterradius, halfcutterradius], center: [testrectacenterx, testrectacentery]});\n var testrectb = CAG.rectangle({radius: [halfcutterradius, halfcutterradius], center: [testrectbcenterx, testrectbcentery]});\n if( (plate2d.intersect(testrecta).sides.length > 0)\n && (plate2d.intersect(testrectb).sides.length > 0) )\n {\n cornercutouts.push(cornercutout);\n }\n }\n }\n if(cornercutouts.length > 0)\n {\n cutout = cutout.union(cornercutouts);\n }\n return cutout;\n}", "title": "" }, { "docid": "d8ae90e7787f0e7a59e6c9f85716abdc", "score": "0.5903042", "text": "_addCropTool() {\n const {orientation, cropRegion} = this._transformsToProperties()\n\n // Create the crop tool for the editor\n this._cropTool = new CropTool(\n this._dom.table,\n this._imageURL,\n this._cropAspectRatio || this._imageSize[0] / this._imageSize[1],\n this._fixCropAspectRatio\n )\n this._cropTool.init()\n\n // Fit the image within the table\n this._orientation = orientation\n this._fit(true)\n\n // Set the image's background image\n this._dom.mask.style\n .backgroundImage = `url(${this._imageURL})`\n\n // Set the orientation and region for the crop tool\n this._cropTool.set(orientation, cropRegion)\n this._cropTool.visible = true\n }", "title": "" }, { "docid": "4b485789a97f15013d44d6dce5a619a5", "score": "0.5892441", "text": "initCropperFrame() {\n // We get the field id from which this was called\n let currentFieldId = this.$thisButton.siblings('input.hidden-field').attr('data-field'),\n attrs = ['width', 'height', 'flex_width', 'flex_height'], // A list of attributes to look for\n libMediaType = this.getMimeType();\n\n // Make sure we got it\n if (_.isString(currentFieldId) && currentFieldId !== '') {\n // Make fields is defined and only do the hack for cropped_image\n if (_.isObject(this.params.fields[currentFieldId]) && this.params.fields[currentFieldId].type === 'cropped_image') {\n // Iterate over the list of attributes\n attrs.forEach((el) => {\n // If the attribute exists in the field\n if (!_.isUndefined(this.params.fields[currentFieldId][el])) {\n // Set the attribute in the main object\n this.params[el] = this.params.fields[currentFieldId][el];\n }\n });\n }\n }\n\n this.frame = wp.media({\n button: {\n text: 'Select and Crop',\n close: false,\n },\n states: [\n new wp.media.controller.Library({\n library: wp.media.query({ type: libMediaType }),\n multiple: false,\n date: false,\n suggestedWidth: this.params.width,\n suggestedHeight: this.params.height,\n }),\n new wp.media.controller.CustomizeImageCropper({\n imgSelectOptions: this.calculateImageSelectOptions,\n control: this,\n }),\n ],\n });\n\n this.frame.on('select', this.onSelectForCrop, this);\n this.frame.on('cropped', this.onCropped, this);\n this.frame.on('skippedcrop', this.onSkippedCrop, this);\n }", "title": "" }, { "docid": "1855810c7d54ae127a3c0b6034c21d49", "score": "0.5887379", "text": "getCroppedImageRect() {\n return getScaledRect({\n rect: this.state.currentRect,\n scale: this.img.current.naturalWidth / this.container.current.offsetWidth,\n });\n }", "title": "" }, { "docid": "c9d337af3bb3462aa483639a6b5e2eac", "score": "0.5857839", "text": "function cropperResize(mouseX, mouseY, dir) {\n let ratio = avatarWidth / avatarHeight;\n\n let left, top, right, bottom;\n let refX, refY;\n let maxLeft, maxRight, maxTop, maxBottom, minLeft, minRight, minTop, minBottom, widthHalf, heightHalf;\n\n switch (dir) {\n case 's':\n // The middle of top cropper border\n refX = cropperLeft + (cropperRight - cropperLeft) / 2;\n refY = cropperTop;\n maxBottom = imageHeight;\n minBottom = refY + cropperMinHeight;\n bottom = clamp(mouseY, minBottom, maxBottom);\n top = refY;\n left = refX - (bottom - top) * ratio / 2;\n right = refX + (bottom - top) * ratio / 2;\n\n if (left < 0 || right > imageWidth) {\n widthHalf = Math.min(refX - Math.max(left, 0), Math.min(imageWidth, right) - refX);\n left = refX - widthHalf;\n right = refX + widthHalf;\n bottom = top + (right - left) / ratio;\n }\n\n break;\n\n case 'n':\n // The middle of bottom cropper border\n refX = cropperLeft + (cropperRight - cropperLeft) / 2;\n refY = cropperBottom;\n minTop = 0;\n maxTop = refY - cropperMinHeight;\n top = clamp(mouseY, minTop, maxTop);\n bottom = refY;\n left = refX - (bottom - top) * ratio / 2;\n right = refX + (bottom - top) * ratio / 2;\n\n if (left < 0 || right > imageWidth) {\n widthHalf = Math.min(refX - Math.max(left, 0), Math.min(imageWidth, right) - refX);\n left = refX - widthHalf;\n right = refX + widthHalf;\n top = bottom - (right - left) / ratio;\n }\n\n break;\n\n case 'w':\n // The middle of right cropper border\n refX = cropperRight;\n refY = cropperTop + (cropperBottom - cropperTop) / 2;\n minLeft = 0;\n maxLeft = refX - cropperMinWidth;\n left = clamp(mouseX, minLeft, maxLeft);\n right = refX;\n top = refY - (right - left) / ratio / 2;\n bottom = refY + (right - left) / ratio / 2;\n\n if (top < 0 || bottom > imageHeight) {\n heightHalf = Math.min(refY - Math.max(top, 0), Math.min(imageHeight, bottom) - refY);\n top = refY - heightHalf;\n bottom = refY + heightHalf;\n left = right - (bottom - top) * ratio;\n }\n\n break;\n\n case 'e':\n // The middle of left cropper border\n refX = cropperLeft;\n refY = cropperTop + (cropperBottom - cropperTop) / 2;\n minRight = refX + cropperMinWidth;\n maxRight = imageWidth;\n right = clamp(mouseX, minRight, maxRight);\n left = refX;\n top = refY - (right - left) / ratio / 2;\n bottom = refY + (right - left) / ratio / 2;\n\n if (top < 0 || bottom > imageHeight) {\n heightHalf = Math.min(refY - Math.max(top, 0), Math.min(imageHeight, bottom) - refY);\n top = refY - heightHalf;\n bottom = refY + heightHalf;\n right = left + (bottom - top) * ratio;\n }\n\n break;\n\n case 'se':\n // Top left corner\n refX = cropperLeft;\n refY = cropperTop;\n minRight = refX + cropperMinWidth;\n maxRight = imageWidth;\n right = clamp(mouseX, minRight, maxRight);\n left = refX;\n top = refY;\n bottom = refY + (right - left) / ratio;\n\n if (bottom > imageHeight) {\n bottom = imageHeight;\n right = refX + (bottom - top) * ratio;\n }\n\n break;\n\n case 'nw':\n // Bottom right corner\n refX = cropperRight;\n refY = cropperBottom;\n minLeft = 0;\n maxLeft = refX - cropperMinWidth;\n left = clamp(mouseX, minLeft, maxLeft);\n right = refX;\n bottom = refY;\n top = refY - (right - left) / ratio;\n\n if (top < 0) {\n top = 0;\n left = refX - (bottom - top) * ratio;\n }\n\n break;\n\n case 'ne':\n // Bottom right corner\n refX = cropperLeft;\n refY = cropperBottom;\n minTop = 0;\n maxTop = refY - cropperMinHeight;\n top = clamp(mouseY, minTop, maxTop);\n left = refX;\n bottom = refY;\n right = refX + (bottom - top) * ratio;\n\n if (right > imageWidth) {\n right = imageWidth;\n top = refY - (right - left) / ratio;\n }\n\n break;\n\n case 'sw':\n // Right top corner\n refX = cropperRight;\n refY = cropperTop;\n minBottom = refY + cropperMinHeight;\n maxBottom = imageHeight;\n bottom = clamp(mouseY, minBottom, maxBottom);\n right = refX;\n top = refY;\n left = refX - (bottom - top) * ratio;\n\n if (left < 0) {\n left = 0;\n bottom = refY + (right - left) / ratio;\n }\n\n break;\n\n default:\n return;\n }\n\n cropperBottom = Math.round(bottom);\n cropperRight = Math.round(right);\n cropperTop = Math.round(top);\n cropperLeft = Math.round(left);\n}", "title": "" }, { "docid": "2792930c288dc619f1001d6c88ddaeae", "score": "0.5837515", "text": "function frect(rrx,rry,rrw,rrh) { conget[ican].save();if(qpc[ican]>0){polyclip(200*ican,npc[ican],xpc,ypc);qpc[ican]-=1;};\n if(prgb2.length<3){conget[ican].fillStyle =prgb; }else{ gclsf(1,rrx,rry,rrx+rrw,rry+rrh); };\n conget[ican].fillRect(rrx,rry,rrw,rrh); conget[ican].restore(); }", "title": "" }, { "docid": "cfb7a0cde758697f2d554f472208b2a7", "score": "0.58374584", "text": "function clipRect(rect,boundary){\r\n\t//Get bundary limits\r\n\tvar left\t= boundary.left;\r\n\tvar right\t= boundary.left+boundary.width;\r\n\tvar top\t\t= boundary.top;\r\n\tvar bottom\t= boundary.top+boundary.height;\r\n\t//If it is outside \r\n\tif ( rect.left+rect.width<left || \r\n\t\trect.left>right ||\r\n\t\trect.top+rect.height<top ||\r\n\t\trect.top>bottom\t\t\r\n\t)\r\n\t\t//No rectangle\r\n\t\treturn false;\r\n\t//Get inner part\r\n\treturn {\r\n\t\tleft\t: Math.max(rect.left,left),\r\n\t\ttop\t: Math.max(rect.top,top),\r\n\t\twidth\t: Math.min(rect.left+rect.width,right)-Math.max(rect.left,left),\r\n\t\theight\t: Math.min(rect.top+rect.height,bottom)-Math.max(rect.top,top)\r\n\t};\r\n\t\r\n}", "title": "" }, { "docid": "e9ca26b305f4f5ca278ebb64d6db77d4", "score": "0.5831995", "text": "function drawCroppedCanvas(){\n const croppedCanvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas');\n croppedCanvas.width = 440;\n croppedCanvas.height = 440;\n\n const imageForDraw = new Image();\n const blobForDraw = new Blob([this.imagedata], { type: this.imagetype });\n imageForDraw.src = $window.URL.createObjectURL(blobForDraw);\n imageForDraw.onload = () => {\n\n const cropCtx = croppedCanvas.getContext('2d');\n cropCtx.drawImage(\n imageForDraw,\n _overlayOriginX * _resizeRatio,\n _overlayOriginY * _resizeRatio,\n 440 * _resizeRatio,\n 440 * _resizeRatio,\n 0,\n 0,\n 440,\n 440\n );\n // Convert Canvas > Blob > ArrayBuffer\n // -------------------------------------------------------------------- //\n // toBlob() is NOT available in Safari / WebKit\n // Polyfill courtesy of: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n if (!HTMLCanvasElement.prototype.toBlob) {\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\n value: function (callback, type, quality) {\n\n var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),\n len = binStr.length,\n arr = new Uint8Array(len);\n\n for (var i=0; i<len; i++ ) {\n arr[i] = binStr.charCodeAt(i);\n }\n\n callback( new Blob( [arr], {type: type || 'image/png'} ) );\n }\n });\n }\n // -------------------------------------------------------------------- //\n croppedCanvas.toBlob( blob => {\n var fileReader = new FileReader();\n fileReader.onloadend = element => {\n this.croppedImageData = element.target.result;\n $window.URL.revokeObjectURL(imageForDraw.src);\n };\n fileReader.readAsArrayBuffer(blob);\n }, 'image/png');\n };\n }", "title": "" }, { "docid": "89a4a5e7a3134659245c962026693228", "score": "0.5809667", "text": "function imageSwitchDrawCropBox()\r\n{\r\n\tvar cropScreen \t\t = dojo.byId('imageCropScreen');\r\n\tvar cropBlockTop \t\t = dojo.byId('imageCropBlockTop');\r\n\tvar cropBlockLeft \t\t = dojo.byId('imageCropBlockLeft');\r\n\tvar cropBlockRight \t\t = dojo.byId('imageCropBlockRight');\r\n\tvar cropBlockBottom \t = dojo.byId('imageCropBlockBottom');\r\n\tvar cropBox \t\t\t\t = dojo.byId('imageCropBox');\r\n\t\r\n/* START Fixed Bug #119 - Initialize all the below style attributes to empty */\t\r\n\tcropBlockLeft.style.width \t = '';\r\n\tcropBlockLeft.style.height = '';\r\n\tcropBlockRight.style.width \t = '';\r\n\tcropBlockRight.style.height = '';\r\n\tcropBlockTop.style.height\t = '';\r\n\tcropBlockTop.style.width = '';\r\n\tcropBlockTop.style.left\t\t = '';\r\n\tcropBlockBottom.style.height = '';\r\n\tcropBlockBottom.style.width = '';\r\n\tcropBlockBottom.style.left\t = '';\r\n\tcropBox.style.height = '';\r\n\tcropBox.style.width = '';\r\n\tcropBox.style.left = '';\r\n\tcropBox.style.top = '';\r\n\t/* END Fixed Bug #119 - Initialize all the below style attributes to empty */\r\n\r\n\t/* Size and position the blocking elements */\r\n\t\r\n\tif(zoomScaler > 0){\r\n\t\tcropBlockLeft.style.width \t = '4px';\r\n\t}else{\r\n\t\tcropBlockLeft.style.width \t = Math.floor((cropScreen.offsetWidth - imageSwitchTargetImage.editWidth) / 2) + 'px';\r\n\t}\r\n\tcropBlockLeft.style.height = cropScreen.offsetHeight + 'px';\r\n\tcropBlockRight.style.width \t = (cropScreen.offsetWidth - imageSwitchTargetImage.editWidth - cropBlockLeft.offsetWidth) + 'px';\r\n\tcropBlockRight.style.height = cropScreen.offsetHeight + 'px';\r\n\tcropBlockTop.style.height\t = Math.floor((cropScreen.offsetHeight - imageSwitchTargetImage.editHeight) / 2) + 'px';\r\n\tcropBlockTop.style.width = imageSwitchTargetImage.editWidth + 'px';\r\n\tcropBlockTop.style.left\t\t = cropBlockLeft.offsetWidth + 'px';\r\n\tcropBlockBottom.style.height = (cropScreen.offsetHeight - imageSwitchTargetImage.editHeight - cropBlockTop.offsetHeight) + 'px';\r\n\tcropBlockBottom.style.width = imageSwitchTargetImage.editWidth + 'px';\r\n\tcropBlockBottom.style.left\t = cropBlockLeft.offsetWidth + 'px';\r\n\tcropBox.style.height = imageSwitchTargetImage.editHeight - 2 + 'px';\r\n\tcropBox.style.width = imageSwitchTargetImage.editWidth - 2 + 'px';\r\n\tcropBox.style.left = cropBlockLeft.offsetWidth + 'px';\r\n\tcropBox.style.top = cropBlockTop.offsetHeight + 'px';\r\n\t\r\n}", "title": "" }, { "docid": "22cff7d4a68830a282ade3028c07ab93", "score": "0.5804979", "text": "function cut() {\n\tvar self = this;\n\tvar deviceRadio = self.deviceRadio;\n\n\tvar boundWidth = self.width; // 裁剪框默认宽度,即整个画布宽度\n\tvar boundHeight = self.height;\n\t// 裁剪框默认高度,即整个画布高度\n\tvar _self$cut = self.cut,\n\t _self$cut$x = _self$cut.x,\n\t x = _self$cut$x === undefined ? 0 : _self$cut$x,\n\t _self$cut$y = _self$cut.y,\n\t y = _self$cut$y === undefined ? 0 : _self$cut$y,\n\t _self$cut$width = _self$cut.width,\n\t width = _self$cut$width === undefined ? boundWidth : _self$cut$width,\n\t _self$cut$height = _self$cut.height,\n\t height = _self$cut$height === undefined ? boundHeight : _self$cut$height;\n\n\t/**\n * 设置边界\n * @param imgLeft 图片左上角横坐标值\n * @param imgTop 图片左上角纵坐标值\n */\n\n\tself.outsideBound = function (imgLeft, imgTop) {\n\t\tself.imgLeft = imgLeft >= x ? x : self.scaleWidth + imgLeft - x <= width ? x + width - self.scaleWidth : imgLeft;\n\n\t\tself.imgTop = imgTop >= y ? y : self.scaleHeight + imgTop - y <= height ? y + height - self.scaleHeight : imgTop;\n\t};\n\n\t/**\n * 设置边界样式\n * @param color\t边界颜色\n */\n\tself.setBoundStyle = function () {\n\t\tvar _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t\t _ref$color = _ref.color,\n\t\t color = _ref$color === undefined ? '#04b00f' : _ref$color,\n\t\t _ref$mask = _ref.mask,\n\t\t mask = _ref$mask === undefined ? 'rgba(0, 0, 0, 0.3)' : _ref$mask,\n\t\t _ref$lineWidth = _ref.lineWidth,\n\t\t lineWidth = _ref$lineWidth === undefined ? 1 : _ref$lineWidth;\n\n\t\t// 绘制半透明层\n\t\tself.ctx.beginPath();\n\t\tself.ctx.setFillStyle(mask);\n\t\tself.ctx.fillRect(0, 0, x, boundHeight);\n\t\tself.ctx.fillRect(x, 0, width, y);\n\t\tself.ctx.fillRect(x, y + height, width, boundHeight - y - height);\n\t\tself.ctx.fillRect(x + width, 0, boundWidth - x - width, boundHeight);\n\t\tself.ctx.fill();\n\n\t\t// 设置边界左上角样式\n\t\t// 为使边界样式处于边界外边缘,此时x、y均要减少lineWidth\n\t\tself.ctx.beginPath();\n\t\tself.ctx.setStrokeStyle(color);\n\t\tself.ctx.setLineWidth(lineWidth);\n\t\tself.ctx.moveTo(x - lineWidth, y + 10 - lineWidth);\n\t\tself.ctx.lineTo(x - lineWidth, y - lineWidth);\n\t\tself.ctx.lineTo(x + 10 - lineWidth, y - lineWidth);\n\t\tself.ctx.stroke();\n\n\t\t// 设置边界左下角样式\n\t\t// 为使边界样式处于边界外边缘,此时x要减少lineWidth、y要增加lineWidth\n\t\tself.ctx.beginPath();\n\t\tself.ctx.setStrokeStyle(color);\n\t\tself.ctx.setLineWidth(lineWidth);\n\t\tself.ctx.moveTo(x - lineWidth, y + height - 10 + lineWidth);\n\t\tself.ctx.lineTo(x - lineWidth, y + height + lineWidth);\n\t\tself.ctx.lineTo(x + 10 - lineWidth, y + height + lineWidth);\n\t\tself.ctx.stroke();\n\n\t\t// 设置边界右上角样式\n\t\t// 为使边界样式处于边界外边缘,此时x要增加lineWidth、y要减少lineWidth\n\t\tself.ctx.beginPath();\n\t\tself.ctx.setStrokeStyle(color);\n\t\tself.ctx.setLineWidth(lineWidth);\n\t\tself.ctx.moveTo(x + width - 10 + lineWidth, y - lineWidth);\n\t\tself.ctx.lineTo(x + width + lineWidth, y - lineWidth);\n\t\tself.ctx.lineTo(x + width + lineWidth, y + 10 - lineWidth);\n\t\tself.ctx.stroke();\n\n\t\t// 设置边界右下角样式\n\t\t// 为使边界样式处于边界外边缘,此时x、y均要增加lineWidth\n\t\tself.ctx.beginPath();\n\t\tself.ctx.setStrokeStyle(color);\n\t\tself.ctx.setLineWidth(lineWidth);\n\t\tself.ctx.moveTo(x + width + lineWidth, y + height - 10 + lineWidth);\n\t\tself.ctx.lineTo(x + width + lineWidth, y + height + lineWidth);\n\t\tself.ctx.lineTo(x + width - 10 + lineWidth, y + height + lineWidth);\n\t\tself.ctx.stroke();\n\t};\n}", "title": "" }, { "docid": "cfbd1217f1ec5587c073fc88f214c544", "score": "0.5790553", "text": "fit(rectangle) {\n const x1 = Math.max(this.x, rectangle.x), x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width), y1 = Math.max(this.y, rectangle.y), y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);\n return this.x = x1, this.width = Math.max(x2 - x1, 0), this.y = y1, this.height = Math.max(y2 - y1, 0), this;\n }", "title": "" }, { "docid": "3e674f69312133f5a4b03ad9745b3d82", "score": "0.57848275", "text": "function removeFun(){\n opacityDiv.style.opacity = \"\";\n document.removeEventListener(\"mousemove\" , cropFun);\n document.removeEventListener(\"mouseup\" , removeFun);\n // document.removeEventListener(\"touchmove\" , cropFun);\n cropEnd();\n\n // fitToScreen();\n\n\n }", "title": "" }, { "docid": "e41148b283a6949f3769e7a823a2b58c", "score": "0.57707345", "text": "handleMouseDown(event, originPointer){\n const editorInstance = this.imageEditor.current.getInstance();\n if(editorInstance.getDrawingMode()!=='CROPPER'){\n this.setState({checkcropmode:false});\n this.setState({cropMode:'normal'});\n }\n }", "title": "" }, { "docid": "58326c65fe93bf2934d1238e705c246e", "score": "0.5762754", "text": "handleDragBegin(event) {\n const { allowNewSelection } = this.props;\n const { pageX: x, pageY: y } = event.pageX ? event : event.targetTouches[0];\n const action =\n event.target.getAttribute('data-action') ||\n event.target.parentNode.getAttribute('data-action');\n const originalPointerPos = { x, y };\n\n // resize or move the selection if:\n // 1. user is dragging the anchors, or\n // 2. user is dragging the selection\n if (action) {\n event.preventDefault();\n this.setState(\n state => ({\n originalPointerPos,\n originalRect: state.currentRect,\n isDragging: true,\n action,\n }),\n () => this.invokeCropHandler(this.props.onCropBegin)\n );\n return;\n }\n // otherwise, if no action and new selection is allowed, create a new frame\n if (allowNewSelection) {\n event.preventDefault();\n this.cropFromNewRegion(event);\n }\n }", "title": "" }, { "docid": "20de1c7b35367acc95a7fae2170e4cf6", "score": "0.5747789", "text": "dragSelectedImage(mouseX, mouseY) {\r\n\r\n // we start dragging\r\n this.dragging = true;\r\n\r\n let { topLeftX, topLeftY, botRightX, botRightY } = this.select.getCoords();\r\n\r\n // we have to get these offsets so we clan click anywhere in the select square to move it.\r\n // the rect and image have different offsets because the image always draws from top left and the rect draws from whereever the rect's startX and startY were (which could be any of the four corners)\r\n \r\n // get the top offset from the first mouse click to the rectangle's starting point\r\n let rectXOffset = this.mouseStart.x - this.select.startX;\r\n let rectYOffset = this.mouseStart.y - this.select.startY;\r\n\r\n // subtract the select coords from the initial mouse click coords to set an find the offset from the top left corner\r\n let imageXOffset = this.mouseStart.x - topLeftX;\r\n let imageYOffset = this.mouseStart.y - topLeftY;\r\n\r\n // draw a clearRect at the exact spot where we picked up our selection so we dont copy it. Remove these 2 lines and we'll create a copy\r\n this.context.beginPath();\r\n this.context.clearRect(this.select.startX, this.select.startY, this.select.width, this.select.height);\r\n this.clear();\r\n\r\n // top left coords of the dragged select rectangle\r\n let newTopLeftX = mouseX - rectXOffset;\r\n let newTopLeftY = mouseY - rectYOffset;\r\n\r\n // draw a rect and the selected image at the current mouse position, but account for the initial click's offset\r\n let rect = new Rectangle(newTopLeftX, newTopLeftY, this.select.width, this.select.height);\r\n this.previewContext.putImageData(this.selectedImage, mouseX - imageXOffset, mouseY - imageYOffset);\r\n rect.drawStroke(this.previewContext, 'black', 2);\r\n }", "title": "" }, { "docid": "4a98b0c7a81f8b0294b23727eca7afaa", "score": "0.5718623", "text": "function generateImageFromRectangleSelection(){\n\t\t\tvar src;\n\t\t\tselectedImageCanvas.style.visibility = \"hidden\";\n\t\t\tvar selectedImageCanvasContext = selectedImageCanvas.getContext(\"2d\");\n\t\t\tselectedImageCanvasContext.clearRect(0, 0, selectedImageCanvas.width, selectedImageCanvas.height);\n\n\t\t\t//if there is no selection, we get the whole image\n\t\t\tif(selectionRectangle.width == 0 || selectionRectangle.height == 0){\n\t\t\t\tselectedImageCanvas.width = image.width;\n\t\t\t\tselectedImageCanvas.height = image.height;\n\t\t\t\tselectedImageCanvasContext.drawImage(canvas, image.x, image.y, image.width, image.height, 0, 0, selectedImageCanvas.width, selectedImageCanvas.height);\n\t\t\t\tselectionRectangle.x = image.x;\n\t\t\t\tselectionRectangle.y = image.y;\n\t\t\t\tselectionRectangle.width = image.width;\n\t\t\t\tselectionRectangle.height = image.height;\n\t\t\t//if there is a selection, we only get the selection\n\t\t\t}else{\n\t\t\t\tselectedImageCanvas.width = selectionRectangle.width;\n\t\t\t\tselectedImageCanvas.height = selectionRectangle.height;\n\t\t\t\tselectedImageCanvasContext.drawImage(canvas, selectionRectangle.x, selectionRectangle.y, selectionRectangle.width, selectionRectangle.height, 0, 0, selectedImageCanvas.width, selectedImageCanvas.height);\n\t\t\t}\n\t\t\t//convert temp selected image canvas to data url, to use it as an image src\n\t\t\tsrc = selectedImageCanvas.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\t\t\t\n\t\t\tselectedImageCanvas.width = 0;\n\t\t\tselectedImageCanvas.height = 0;\n\n\t\t\treturn src;\n\t\t}", "title": "" }, { "docid": "81d8fc34e6ca4b97a28e91ea1a0560b7", "score": "0.56928843", "text": "function cropComicPanels(srcDirPath, destDirPath)\n{\n if (srcDirPath.length == 0 || destDirPath.length == 0)\n {\n return;\n }\n // TODO Replace with a different message to show a different progress\n win.webContents.send('EVENT_CROP_START');\n // Send folder to be scanned by the recognizer to extract the page panels.\n const pythonProcess = spawn('python',[\"recognizer/panelextractor.py\", \"-x\", srcDirPath, \"-s\", destDirPath]);\n pythonProcess.stdout.on('data', (data) =>\n {\n // TODO Replace with better message\n win.webContents.send('EVENT_CROP_COMPLETE');\n\n });\n pythonProcess.stderr.on('data', (data) =>\n {\n // Do something with the error data returned from python script\n win.webContents.send('Back_To_You','Failed To Run');\n // TODO Handle Error cases.\n });\n}", "title": "" }, { "docid": "a3d8b969b98bc025387731eed824e3df", "score": "0.56926537", "text": "function cropImg(image) {\n canvas = document.createElement('canvas');\n canvas.width = widthcrop;\n canvas.height = heightcrop;\n canvas.getContext(\"2d\").drawImage(image, leftcrop, topcrop, widthcrop, heightcrop, 0, 0, canvas.width, canvas.height);\n canvas.toBlob(function(blob) {\n saveAs(blob, title + \".png\");\n });\n}", "title": "" }, { "docid": "c077b144ec31d888f357ba9022703bd3", "score": "0.56873065", "text": "function drect(rrx,rry,rrw,rrh) { conget[ican].save(); if(qpc[ican]>0){polyclip(200*ican,npc[ican],xpc,ypc);qpc[ican]-=1;};\n if(prgb2.length<3){conget[ican].strokeStyle =prgb; }else{ gclsf(0,rrx,rry,rrx+rrw,rry+rrh); }; \n conget[ican].strokeRect(rrx,rry,rrw,rrh); conget[ican].restore(); }", "title": "" }, { "docid": "bd9c9e919607fd991a192f12f9869c6d", "score": "0.56835085", "text": "function makeRectPanelClipPath(rect) {\n rect = normalizeRect(rect);\n return function (localPoints, transform) {\n return graphicUtil.clipPointsByRect(localPoints, rect);\n };\n}", "title": "" }, { "docid": "f146ca1c88864dc80fa8ecebfe9abb17", "score": "0.5681065", "text": "crop() {\n\n this.cropper.getCroppedCanvas({\n width: this.data.get('width'),\n height: this.data.get('height'),\n minWidth: this.data.get('min-width'),\n minHeight: this.data.get('min-height'),\n maxWidth: this.data.get('max-width'),\n maxHeight: this.data.get('max-height'),\n imageSmoothingQuality: 'medium',\n }).toBlob((blob) => {\n const formData = new FormData();\n\n formData.append('file', blob);\n formData.append('storage', this.data.get('storage'));\n\n let element = this.element;\n axios.post(platform.prefix('/systems/files'), formData)\n .then((response) => {\n let image = response.data.url;\n let targetValue = this.data.get('target');\n\n element.querySelector('.cropper-preview').src = image;\n element.querySelector('.cropper-preview').classList.remove('none');\n element.querySelector('.cropper-remove').classList.remove('none');\n element.querySelector('.cropper-path').value = response.data[targetValue];\n $(element.querySelector('.modal')).modal('hide');\n })\n .catch((error) => {\n window.platform.alert('Validation error', 'File upload error');\n console.warn(error);\n });\n });\n\n }", "title": "" }, { "docid": "c321ecab3e2dc4141fbc4d978dc901a3", "score": "0.56742483", "text": "function remFun(){\n opacityDiv.style.opacity = \"\";\n document.removeEventListener(\"mousemove\" , moveCropper);\n document.removeEventListener(\"mouseup\" , remFun);\n document.removeEventListener(\"mousedown\" , moveCropper);\n // document.removeEventListener(\"touchmove\" , moveCropper);\n cropEnd();\n }", "title": "" }, { "docid": "93a6ea9666347de161ca68a88440253e", "score": "0.5671951", "text": "function RoiTool()\n{\n // call super constructor\n BoxSelectionTool.call( this );\n\n var self = this;\n this.toolname = \"roitool\";\n\n\t// inputs for x, y, width and height of the crop box\n\tthis.box_roi_x = document.getElementById( \"box_roi_x\" );\n\tthis.box_roi_y = document.getElementById( \"box_roi_y\" );\n\tthis.box_roi_w = document.getElementById( \"box_roi_w\" );\n\tthis.box_roi_h = document.getElementById( \"box_roi_h\" );\n\tthis.box_roi_r = document.getElementById( \"box_roi_r\" );\n\n\t//! mouse catcher\n\tthis.mouseCatcher = document.createElement( \"div\" );\n\tthis.mouseCatcher.className = \"sliceMouseCatcher\";\n\tthis.mouseCatcher.style.cursor = \"default\";\n\n // initialize roi button\n this.button_roi_apply = document.getElementById( \"button_roi_apply\" );\n this.button_roi_apply.onclick = this.createRoi.bind(this, function(result) {\n if (result.status) {\n growlAlert(\"Success\", result.status);\n }\n });\n\n // bind event handlers to current calling context\n this.onmousedown_bound = this.onmousedown.bind(this);\n this.onmouseup_bound = this.onmouseup.bind(this);\n this.onmousemove_pos_bound = this.onmousemove.pos.bind(this);\n this.onmousemove_crop_bound = this.onmousemove.crop.bind(this);\n}", "title": "" }, { "docid": "e2e7dab8ef7fbe2beb8ed0216aadabf4", "score": "0.5668385", "text": "function pixelateCover() {\n\n}", "title": "" }, { "docid": "4988ea334af2137bbd3e87f31dd27f6e", "score": "0.56665844", "text": "invokeCropHandler(handler) {\n safelyInvoke(handler)({\n getDataUrl: () => this.getDataUrl(),\n getRectValues: () => ({\n cropper: this.state.currentRect,\n image: this.getCroppedImageRect(),\n }),\n });\n }", "title": "" }, { "docid": "dc870508d0331d8036700956030357e1", "score": "0.56484395", "text": "setPostCrop(postCrop) { this.setParam(WPConst.POST_CROP, postCrop + ''); }", "title": "" }, { "docid": "dcdeac84e1d3ea3b535493419f4fa249", "score": "0.5643385", "text": "function set_crop_selection(crop_target, form, id, jcrop_api) {\n if (\n form.elements[`${id}_exam_template_crop_x`].value &&\n form.elements[`${id}_exam_template_crop_y`].value &&\n form.elements[`${id}_exam_template_crop_width`].value &&\n form.elements[`${id}_exam_template_crop_height`].value\n ) {\n const stageHeight = parseFloat(getComputedStyle(crop_target, null).height.replace(\"px\", \"\"));\n const stageWidth = parseFloat(getComputedStyle(crop_target, null).width.replace(\"px\", \"\"));\n const x = parseFloat(form.elements[`${id}_exam_template_crop_x`].value) * stageWidth;\n const y = parseFloat(form.elements[`${id}_exam_template_crop_y`].value) * stageHeight;\n const width = parseFloat(form.elements[`${id}_exam_template_crop_width`].value) * stageWidth;\n const height = parseFloat(form.elements[`${id}_exam_template_crop_height`].value) * stageHeight;\n\n jcrop_api.setSelect([x, y, x + width, y + height]);\n }\n}", "title": "" }, { "docid": "0828e9914c6ab9588755d14e71313203", "score": "0.5642473", "text": "function onRectangleButtonClick() {\n if(isDeleteMode){\n isDeleteMode = false;\n clearTrackedValues();\n clearSketchFromCanvas();\n }\n\n if (!minX || !minY || !maxX || !maxY)\n return;\n\n // rectangles.push({\n // shape: 'rectangle',\n // x: minX,\n // y: minY,\n // width: maxX - minX,\n // height: maxY - minY,\n // color: currColor\n // });\n\n allDrawnShapes.push({\n drawFunc: drawRectangle,\n data: {\n shape: 'rectangle',\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n color: currColor,\n selected: false\n }\n });\n\n clearTrackedValues();\n\n clearSketchFromCanvas();\n}", "title": "" }, { "docid": "e7ab0e9a4fdcff4ee952107a28b464c5", "score": "0.5642004", "text": "function startCropEl(){\n canvas.remove(el);\n if(canvas.getActiveObject()) { \n object=canvas.getActiveObject();\n if (lastActive && lastActive !== object) {\n lastActive.clipTo = null; \n } \n el = new fabric.Ellipse({\n fill: 'transparent',\n originX: 'left',\n originY: 'top',\n stroke: 'yellow',\n strokeDashArray: [5, 4],\n rx: object.width/3,\n ry: object.width/3,\n opacity: 1,\n borderColor: '#36fd00',\n cornerColor: 'green',\n hasRotatingPoint:false,\n objectCaching: false\n }); \n el.left=canvas.getActiveObject().left;\n el.top=canvas.getActiveObject().top;\n el.width=canvas.getActiveObject().width*canvas.getActiveObject().scaleX;\n el.height=canvas.getActiveObject().height*canvas.getActiveObject().scaleY; \n canvas.add(el);\n canvas.setActiveObject(el)\n } \n else {\n alert(\"Please select an object or layer\");\n }\n }", "title": "" }, { "docid": "a77eedb9e787a7907e929c9e024810d4", "score": "0.5625502", "text": "function rotatePreview(amount)\n{\n $(\"#portrait_crop\").cropper('rotate', amount);\n}", "title": "" }, { "docid": "85fd1be261e9d67d7a4aa713c039a839", "score": "0.56217504", "text": "moveN(e){\n\t\t\n\t\tconst new_height = bcrop.height - e.dy;\n\t\tif (e.dy < 0 && (new_height > this.height || bcrop.top + e.dy < 0) && crop.width * 2 >= bcrop.height + bcrop.top) {\n\t\t\t\n\t\t\tcrop.top = 0;\n\t\t\treturn crop.height = bcrop.height + bcrop.top;\n\t\t} else if (new_height >= crop.width * 2) {\n\t\t\t\n\t\t\tcrop.height = crop.width * 2;\n\t\t\treturn crop.top = (bcrop.height - crop.height) + bcrop.top;\n\t\t} else if (this.height >= new_height && new_height >= crop.width / 2 && new_height >= 64) {\n\t\t\t\n\t\t\tcrop.height = new_height;\n\t\t\treturn crop.top = bcrop.top + e.dy;\n\t\t} else {\n\t\t\t\n\t\t\tcrop.height = (crop.width / 2 > 64) ? (crop.width / 2) : 64;\n\t\t\treturn crop.top = bcrop.top + (bcrop.height - crop.height);\n\t\t}\t}", "title": "" }, { "docid": "965a18db155144504ee2cf3513e7c615", "score": "0.56162953", "text": "function createRectangle() {\n var color = '#' + Math.floor(Math.random() * 16777215).toString(16);\n var rectGroup = new Konva.Group({\n x: 180,\n y: 50,\n id: naming.z\n });\n stage.find('Layer')[0].add(rectGroup);\n rectGroup.add(new Konva.Rect({\n x: 0,\n y: 0,\n width: 100,\n height: 100,\n stroke: color,\n strokeWidth: 4,\n name: 'droppable',\n id: naming.z,\n transformsEnabled: 'position',\n cornerRadius: 2,\n shadowColor: '#b3b3b3',\n shadowBlur: 1,\n shadowOffset: {\n x: 2,\n y: 2\n },\n shadowOpacity: 0.5\n }));\n var black = \"#000000\";\n addAnchor(rectGroup, 0, 0, 'topLeft', black);\n addAnchor(rectGroup, 100, 0, 'topRight', black);\n addAnchor(rectGroup, 100, 100, 'bottomRight', black);\n addAnchor(rectGroup, 0, 100, 'bottomLeft', black);\n addEditButton(rectGroup, 50, 0, color);\n addDeleteIcon(rectGroup, 100, 50, color);\n naming.z++;\n rectGroup.setZIndex(1);\n rectGroup.setDraggable(true);\n rectGroup['attrs']['dragBoundFunc'] = function(pos) {\n var stage = rectGroup.getStage();\n var finalX = rectGroup.find('.delete')[0].x() + pos.x;\n var finalY = rectGroup.find('.bottomRight')[0].y() + pos.y;\n var topLeft = rectGroup.find('.topLeft')[0];\n if ((topLeft.x() + pos.x) < 5) {\n var newX = 5 - topLeft.x();\n } else if (finalX > (stage.width() - 20)) {\n var newX = stage.width() - 20 - rectGroup.find('.delete')[0].x();\n } else {\n var newX = pos.x;\n }\n if ((topLeft.y() + pos.y) < 20) {\n var newY = 20 - topLeft.y();\n } else if (finalY > (stage.height() - 10)) {\n var newY = stage.height() - 10 - rectGroup.find('.bottomRight')[0].y();\n } else {\n var newY = pos.y;\n }\n return {\n x: newX,\n y: newY\n };\n }\n stage.find('Layer')[0].draw();\n}", "title": "" }, { "docid": "d3d99ec2acfbd1c4fe97d9e9af6b2576", "score": "0.5594338", "text": "function cutPasteOrig(array) {\n function paste (p1, p2, p3, p4, p5, p6) {\n var i;\n var coord = [position[nameVarz[4] % position.length],\n position[nameVarz[5] % position.length],\n position[nameVarz[4] % position.length] * 2,\n position[nameVarz[5] % position.length] * 2,\n position[nameVarz[4] % position.length] * -1,\n position[nameVarz[5] % position.length] * -1,\n position[nameVarz[4] % position.length] * -2,\n position[nameVarz[5] % position.length] * -2];\n\n var xcor = coord[nameVarz[6] % coord.length];\n var ycor = coord[nameVarz[7] % coord.length];\n\n function draw() {\n ctx.drawImage(ctx.canvas, p1, p2, p3, p4, xcor, ycor, p5, p6);\n }\n\n draw();\n\n for (i = 2; i < nameVarz[5]; i++) {\n ctx.drawImage(ctx.canvas, p1, p2, p3, p4, (i * xcor * incr[1]), (i * ycor * incr[1]), p5, p6);\n }\n\n caller(array);\n }\n\n var blend = composite[nameVarz[2] % composite.length];\n comp = blend;\n paste(position[nameVarz[3] % position.length], position[nameVarz[4] % position.length], position[nameVarz[5] % position.length], position[nameVarz[2] % position.length], position[nameVarz[3] % position.length], position[nameVarz[4] % position.length]);\n\n }", "title": "" }, { "docid": "19942e8bec676ec777e008f1a08722c9", "score": "0.55891424", "text": "getCropXY() {\n //default x, y value for 500 score pop up\n let [x, y] = [224, 192];\n if (this._value !== 500) {\n x = (Math.log2(this._value / 100) - 1) * this._cropWidth;\n y = 224;\n }\n this._cropXY = new point_1.default(x, y);\n }", "title": "" }, { "docid": "b8930341e3d0e5517555a2e05900ea03", "score": "0.5582972", "text": "function cropConnection(e){var context=e.context,connection;if(!context.cropped){connection=context.connection;connection.waypoints=connectionDocking.getCroppedWaypoints(connection);context.cropped=true;}}", "title": "" }, { "docid": "524a253fdfc029434bdbd2c4915c85e3", "score": "0.55824965", "text": "function canvaState(canvas) {\n\n \n this.canvas = canvas;\n this.width = canvas.width;\n this.height = canvas.height;\n this.ctx = canvas.getContext('2d');\n \n //For pages with fixed-position bars\n var html = document.body.parentNode;\n this.htmlTop = html.offsetTop;\n this.htmlLeft = html.offsetLeft;\n \n \n this.isValid = false; // canvas will redraw everything until it is valid\n this.shapes = []; \n this.draggingOld = false; // true if already existing rectangle is dragged\n this.draggingNew = false; // true if a new rectangle is being created\n this.isDragged = false; \n this.selection = null; \n this.mouseX = 0; \n this.mouseY = 0;\n this.newRect = {w:0 , h:0}; \n this.randomColour = '#000';\n\n var cState = this; \n cState.randomColour = randomColor(); \n\n \n canvas.addEventListener('selectstart', function(e) { e.preventDefault(); return false; }, false);\n\n canvas.addEventListener('mousedown', function(e) {\n var mouse = cState.getMouse(e);\n var mx = mouse.x;\n var my = mouse.y;\n var shapes = cState.shapes;\n var l = shapes.length;\n if(!cState.draggingNew){\n for (var i = l-1; i >= 0; i--) {\n if (shapes[i].contains(mx, my)) {\n var mySel = shapes[i]; \n cState.mouseX = mx - mySel.x;\n cState.mouseY = my - mySel.y;\n cState.draggingOld = true;\n cState.selection = mySel;\n cState.isValid = false;\n return;\n }\n }\n }\n cState.mouseX = mx; // begining position for the new rectangle shape\n cState.mouseY = my;\n cState.draggingNew = true;\n return; \n }, true);\n\n \n canvas.addEventListener('mousemove', function(e) {\n var mouse = cState.getMouse(e);\n if (cState.draggingOld){ // if already existing rectangle is dragged\n cState.selection.x = mouse.x - cState.mouseX;\n cState.selection.y = mouse.y - cState.mouseY; \n cState.isValid = false; \n }\n if (cState.draggingNew) { \n cState.ctx.clearRect(0, 0, 800, 400); // recreate all the shapes\n cState.isValid = false;\n cState.draw();\n cState.newRect.w = mouse.x - cState.mouseX;\n cState.newRect.h = mouse.y - cState.mouseY;\n cState.ctx.fillStyle = cState.randomColour;\n\n cState.ctx.fillRect(cState.mouseX, cState.mouseY, cState.newRect.w, cState.newRect.h, cState.randomColour);\n cState.isDragged = true;\n }\n }, false);\n\n \n canvas.addEventListener('mouseup', function(e) {\n var mouse = cState.getMouse(e);\n \n if (cState.isDragged) { \n cState.addShape(new rectShape(cState.mouseX, cState.mouseY, cState.newRect.w, cState.newRect.h, cState.randomColour));\n }\n cState.randomColour = randomColor(); \n cState.draggingOld = false;\n cState.draggingNew = false;\n cState.isDragged = false;\n cState.selection = null; \n }, false);\n\n canvas.addEventListener('dblclick', function(e) {\n var mouse = cState.getMouse(e);\n var shapes = cState.shapes;\n var l = shapes.length;\n for (var i = l-1; i >= 0; i--) {\n if (cState.shapes[i].contains(mouse.x, mouse.y)) {\n cState.shapes[i] = cState.shapes[l-1];\n cState.shapes.pop();\n cState.isValid = false;\n return;\n }\n }\n }, false);\n\n \n setInterval(function() { cState.draw(); }, cState.interval);\n}", "title": "" }, { "docid": "231d90603707c8a494a6d8fde029e8f9", "score": "0.5581707", "text": "function BoundingBoxRect() {}", "title": "" }, { "docid": "d5d764acd5af4eccc343b8afb5c57bc2", "score": "0.5581042", "text": "function clipDrawing() {\n\tcontext.save();\n\tcontext.beginPath();\n\tcontext.rect(drawingAreaX, drawingAreaY, drawingAreaWidth,\n\t\t\tdrawingAreaHeight);\n\tcontext.clip();\n}", "title": "" }, { "docid": "227627f0acc557f78af1122b83dfde9c", "score": "0.5580705", "text": "function center_rectangle(){\n polygon.setMap(null); // remove polygon\n let box = make_center_box();\n rectangle.setBounds(box);\n update_corners_form();\n}", "title": "" }, { "docid": "83c575f6683191ec63893dbbbe12367d", "score": "0.5571707", "text": "function _drawRectangle() {\n\treturn;\n var drawnItems = new L.FeatureGroup();\n map.addLayer(drawnItems);\n var drawControl = new L.Control.Draw({\n draw : {\n position : 'topleft',\n polygon : false,\n polyline : false,\n circle : false,\n marker : false,\n\n rectangle : {\n shapeOptions : {\n color : '#bada55'\n },\n showArea : true\n },\n },\n edit : {\n featureGroup : drawnItems,\n edit : false,\n remove : false\n },\n });\n map.addControl(drawControl);\n // handle rectangle create event\n map.on('draw:created', function(e) {\n var type = e.layerType;\n layer = e.layer;\n if (type === 'rectangle') {\n $(\"#exportModal\").modal();\n bounds = layer.getBounds();\n $(\"#exstatustext\").html(\"<i class='glyphicon glyphicon-refresh spinning'></i> Processing &hellip;\");\n coordinates = bounds.toBBoxString();\n console.log(coordinates);\n $(\"#exrect\").html(coordinates);\n var data = {\n bounds : coordinates,\n type : _getActiveSelection(),\n startTime : $minX.val(),\n endTime : $maxX.val()\n };\n ajax = $.post(\"/browse/extract\", data, function(data) {\n $(\"#exstatustext\").html(\"export complete. <a href='/browse/download?filename=\" + data.filename + \"'>Download</a>\");\n }, \"json\");\n }\n });\n\n}", "title": "" }, { "docid": "a695b642cea81ad48182d10f9ade033b", "score": "0.55700254", "text": "function createGridClipShape(rect, seriesModel, cb) {\n\t var rectEl = new graphic.Rect({\n\t shape: {\n\t x: rect.x - 10,\n\t y: rect.y - 10,\n\t width: 0,\n\t height: rect.height + 20\n\t }\n\t });\n\t graphic.initProps(rectEl, {\n\t shape: {\n\t width: rect.width + 20,\n\t height: rect.height + 20\n\t }\n\t }, seriesModel, cb);\n\t\n\t return rectEl;\n\t }", "title": "" }, { "docid": "5e27de384237358cd744f62acfd8823a", "score": "0.55546063", "text": "function methods() {\n\tvar self = this;\n\n\tvar deviceRadio = self.deviceRadio;\n\n\tvar boundWidth = self.width; // 裁剪框默认宽度,即整个画布宽度\n\tvar boundHeight = self.height; // 裁剪框默认高度,即整个画布高度\n\tvar _self$cut = self.cut,\n\t _self$cut$x = _self$cut.x,\n\t x = _self$cut$x === undefined ? 0 : _self$cut$x,\n\t _self$cut$y = _self$cut.y,\n\t y = _self$cut$y === undefined ? 0 : _self$cut$y,\n\t _self$cut$width = _self$cut.width,\n\t width = _self$cut$width === undefined ? boundWidth : _self$cut$width,\n\t _self$cut$height = _self$cut.height,\n\t height = _self$cut$height === undefined ? boundHeight : _self$cut$height;\n\n\n\tself.updateCanvas = function () {\n\t\tif (self.croperTarget) {\n\t\t\t// 画布绘制图片\n\t\t\tself.ctx.drawImage(self.croperTarget, self.imgLeft, self.imgTop, self.scaleWidth, self.scaleHeight);\n\t\t}\n\t\ttypeof self.onBeforeDraw === 'function' && self.onBeforeDraw(self.ctx, self);\n\n\t\tself.setBoundStyle(); //\t设置边界样式\n\t\tself.ctx.draw();\n\t\treturn self;\n\t};\n\n\tself.pushOrign = function (src) {\n\t\tself.src = src;\n\n\t\ttypeof self.onBeforeImageLoad === 'function' && self.onBeforeImageLoad(self.ctx, self);\n\n\t\twx.getImageInfo({\n\t\t\tsrc: src,\n\t\t\tsuccess: function success(res) {\n\t\t\t\tvar innerAspectRadio = res.width / res.height;\n\n\t\t\t\tself.croperTarget = res.path;\n\t\t\t\tif (innerAspectRadio < width / height) {\n\t\t\t\t\tself.rectX = x;\n\t\t\t\t\t// self.baseWidth = width;\n // self.baseHeight = width / innerAspectRadio;\n\t\t\t\t\t// self.rectY = y - Math.abs((height - self.baseHeight) / 2);\n self.baseWidth = width;\n self.baseHeight = width / innerAspectRadio;\n self.rectY = y - Math.abs((height - self.baseHeight)/2);\n } else {\n\t\t\t\t\tself.rectY = y;\n self.baseWidth = height * innerAspectRadio;\n self.baseHeight = height ;\n self.rectX = x - Math.abs((width - self.baseWidth)/2);\n\t\t\t\t\t// self.baseWidth = height * innerAspectRadio;\n\t\t\t\t\t// self.baseHeight = height;\n\t\t\t\t\t// self.rectX = x - Math.abs((width - self.baseWidth) / 2);\n\t\t\t\t}\n console.log(self.baseWidth, self.baseHeight);\n\t\t\t\tself.imgLeft = self.rectX;\n\t\t\t\tself.imgTop = self.rectY;\n self.scaleWidth = self.baseWidth;\n self.scaleHeight = self.baseHeight;\n\t\t\t\t// self.scaleWidth = self.baseWidth;\n\t\t\t\t// self.scaleHeight = self.baseHeight;\n\n\t\t\t\tself.updateCanvas();\n\n\t\t\t\ttypeof self.onImageLoad === 'function' && self.onImageLoad(self.ctx, self);\n\t\t\t}\n\t\t});\n\n\t\tself.update();\n\t\treturn self;\n\t};\n\n\tself.getCropperImage = function () {\n\t\tfor (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t\t\targs[_key] = arguments[_key];\n\t\t}\n\n\t\tvar id = self.id;\n\n\t\tvar ARG_TYPE = toString.call(args[0]);\n\n\t\tswitch (ARG_TYPE) {\n\t\t\tcase '[object Object]':\n\t\t\t\tvar _args$0$quality = args[0].quality,\n\t\t\t\t quality = _args$0$quality === undefined ? 10 : _args$0$quality;\n\n\n\t\t\t\tif (typeof quality !== 'number') {\n\t\t\t\t\tconsole.error('quality\\uFF1A' + quality + ' is invalid');\n\t\t\t\t} else if (quality < 0 || quality > 10) {\n\t\t\t\t\tconsole.error('quality should be ranged in 0 ~ 10');\n\t\t\t\t}\n\t\t\t\twx.canvasToTempFilePath({\n\t\t\t\t\tcanvasId: id,\n\t\t\t\t\tx: x,\n\t\t\t\t\ty: y,\n\t\t\t\t\twidth: width,\n\t\t\t\t\theight: height,\n\t\t\t\t\tdestWidth: width * quality / (deviceRadio * 10),\n\t\t\t\t\tdestHeight: height * quality / (deviceRadio * 10),\n\t\t\t\t\tsuccess: function success(res) {\n\t\t\t\t\t\ttypeof args[args.length - 1] === 'function' && args[args.length - 1](res.tempFilePath);\n\t\t\t\t\t}\n\t\t\t\t});break;\n\t\t\tcase '[object Function]':\n\t\t\t\twx.canvasToTempFilePath({\n\t\t\t\t\tcanvasId: id,\n\t\t\t\t\tx: x,\n\t\t\t\t\ty: y,\n\t\t\t\t\twidth: width,\n\t\t\t\t\theight: height,\n\t\t\t\t\tdestWidth: width / deviceRadio,\n\t\t\t\t\tdestHeight: height / deviceRadio,\n\t\t\t\t\tsuccess: function success(res) {\n\t\t\t\t\t\ttypeof args[args.length - 1] === 'function' && args[args.length - 1](res.tempFilePath);\n\t\t\t\t\t}\n\t\t\t\t});break;\n\t\t}\n\n\t\treturn self;\n\t};\n}", "title": "" }, { "docid": "6e7b34edcd7d217005919cceac9d6870", "score": "0.55515283", "text": "setPostCropAndCenter(postCrop) { this.setParam(WPConst.POST_CROP_AND_CENTER, postCrop + ''); }", "title": "" }, { "docid": "72db7a06473777979adfb41dc79cf320", "score": "0.55473727", "text": "function plate_crop_enter(popup_description, plate_crop_url)\n {\n $(\"#floating_crop_img strong.floating_title\").text(popup_description);\n\n\n $(\"#floating_crop_img img.cropimage\").error(function() {\n $(this).hide();\n $(\"#floating_crop_img .croperror\").text(\"image not available\").show();\n });\n\n $(\"#floating_crop_img .croperror\").hide();\n $(\"#floating_crop_img img.cropimage\").show();\n\n $(\"#floating_crop_img img.cropimage\").attr(\"src\",plate_crop_url);\n\n }", "title": "" }, { "docid": "bba96520b440b1a66b8908484a63edd7", "score": "0.5546537", "text": "function main() {\n var r1 = CAG.rectangle({center:[0,0], radius: 4});\n var r2 = CAG.rectangle({center:[2,0], radius: 2});\n var r3 = r1.subtract(r2);\n var cutterradius = 0.5;\n var r4 = r3.overCutInsideCorners(cutterradius);\n\n return [r3.translate([0,10]),r4];\n}", "title": "" }, { "docid": "3be2d6911712849f82fd881443053ff4", "score": "0.55458236", "text": "getSliceRect(_tStart, _tEnd, _depth) {\n return undefined;\n }", "title": "" }, { "docid": "c29b7c8fb2ca301ef3083c67a956d004", "score": "0.5529545", "text": "function boundingBox() {\n var minX = Math.min.apply(Math, clickX) - 20;\n var maxX = Math.max.apply(Math, clickX) + 20;\n \n var minY = Math.min.apply(Math, clickY) - 20;\n var maxY = Math.max.apply(Math, clickY) + 20;\n\n var tempCanvas = document.createElement(\"canvas\"),\n tCtx = tempCanvas.getContext(\"2d\");\n\n tempCanvas.width = maxX - minX;\n tempCanvas.height = maxY - minY;\n\n tCtx.drawImage(canvas, minX, minY, maxX - minX, maxY - minY, 0, 0, maxX - minX, maxY - minY);\n\n var imgBox = document.getElementById(\"canvas_image\");\n imgBox.src = tempCanvas.toDataURL();\n\n return tempCanvas;\n}", "title": "" }, { "docid": "5bc2e37193717010e0859579bc617d66", "score": "0.55153316", "text": "copy() {\n return new Rectangle(this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "bc396b5bf0fcccbb875dc4ae7a70edda", "score": "0.55121815", "text": "function drawrectangle(v_width,v_height){\n\t\t\tvar pointshape = new Array;\n\t\t\tprocessing.pushMatrix();\n\t\t\tprocessing.translate (sizescreenx/2,sizescreeny/2); //translate coordinates to the middle of screen\n\t\t\tpointshape[0] = new point (-(v_width/2.0),-(v_height/2.0));\n\t\t\tpointshape[1] = new point (pointshape[0].x+v_width,pointshape[0].y);\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tpointshape[2] = new point (pointshape[0].x+v_width,pointshape[0].y+v_height);\n\t\t\tpointshape[3] = new point (pointshape[0].x,pointshape[0].y+v_height);\n\t\t\tprocessing.rect(pointshape[0].x,pointshape[0].y,v_width,v_height); //drawing rectangle\n\t\t\tprocessing.popMatrix(); \n\t\t\treturn pointshape;\n\t\t}", "title": "" }, { "docid": "9888cf4d8ac09010646417dabf89d4c8", "score": "0.5510664", "text": "function createGridClipShape(rect, seriesModel, cb) {\n\t var rectEl = new graphic.Rect({\n\t shape: {\n\t x: rect.x - 10,\n\t y: rect.y - 10,\n\t width: 0,\n\t height: rect.height + 20\n\t }\n\t });\n\t graphic.initProps(rectEl, {\n\t shape: {\n\t width: rect.width + 20,\n\t height: rect.height + 20\n\t }\n\t }, seriesModel, cb);\n\n\t return rectEl;\n\t }", "title": "" } ]
5ff69a035c67c1dc26667f4ce480169a
Acquiring integration context may only be created by: 1. Admin / support 2. Organization integration manager 3. Integration service user Acquiring integration context may only be updated by: 1. Admin 2. Integration service user
[ { "docid": "3eda483ed777d20c2d402afc72ae3e84", "score": "0.69616216", "text": "async function canManageAcquiringIntegrationContexts ({ authentication: { item: user }, originalInput, operation, itemId }) {\n if (!user) return throwAuthenticationError()\n if (user.deletedAt) return false\n\n if (user.isAdmin || user.isSupport) return true\n\n let organizationId, integrationId, context\n\n if (operation === 'create') {\n // get ids from input on create\n organizationId = get(originalInput, ['organization', 'connect', 'id'])\n integrationId = get(originalInput, ['integration', 'connect', 'id'])\n if (!organizationId || !integrationId) return false\n } else if (operation === 'update') {\n // getting ids from existing object\n if (!itemId) return false\n context = await getById('AcquiringIntegrationContext', itemId)\n if (!context) return false\n const { organization, integration } = context\n organizationId = organization\n integrationId = integration\n }\n\n const canManageIntegrations = await checkOrganizationPermission(user.id, organizationId, 'canManageIntegrations')\n if (canManageIntegrations && operation === 'create') return true\n if (canManageIntegrations && operation === 'update') {\n // Allow employee to complete context settings\n if (context.status === CONTEXT_IN_PROGRESS_STATUS) {\n return true\n }\n }\n return await checkAcquiringIntegrationAccessRight(user.id, integrationId)\n}", "title": "" } ]
[ { "docid": "35eb1e4e7e0c2e17d53350dd25e175e6", "score": "0.61592263", "text": "async function canManageBillingIntegrationOrganizationContexts ({ authentication: { item: user }, originalInput, operation, itemId }) {\n if (!user) return throwAuthenticationError()\n if (user.deletedAt) return false\n \n if (user.isAdmin || user.isSupport) return true\n\n let organizationId, integrationId\n\n if (operation === 'create') {\n // NOTE: can only be created by the organization integration manager\n organizationId = get(originalInput, ['organization', 'connect', 'id'])\n integrationId = get(originalInput, ['integration', 'connect', 'id'])\n if (!organizationId || !integrationId) return false\n } else if (operation === 'update') {\n // NOTE: can update by the organization integration manager OR the integration account\n if (!itemId) return false\n const context = await getById('BillingIntegrationOrganizationContext', itemId)\n if (!context) return false\n const { organization, integration } = context\n organizationId = organization\n integrationId = integration\n }\n\n if (!organizationId || !integrationId) return false\n const canManageIntegrations = await checkOrganizationPermission(user.id, organizationId, 'canManageIntegrations')\n if (canManageIntegrations) return true\n\n return await checkBillingIntegrationsAccessRights(user.id, [integrationId])\n}", "title": "" }, { "docid": "53ee88fdd8ca0161c18ea5fd0c849f24", "score": "0.60640204", "text": "async function canReadAcquiringIntegrationContexts ({ authentication: { item: user } }) {\n if (!user) return throwAuthenticationError()\n if (user.deletedAt) return false\n\n if (user.isSupport || user.isAdmin) return {}\n\n return {\n OR: [\n { organization: { employees_some: { user: { id: user.id }, role: { canReadPayments: true }, isBlocked: false, deletedAt: null } } },\n { integration: { accessRights_some: { user: { id: user.id }, deletedAt: null } } },\n ],\n }\n}", "title": "" }, { "docid": "067ed39ae8cead149269d4bf0a6a31e6", "score": "0.59292465", "text": "async function addBillingIntegrationAndContext(client, organization, integrationExtraAttrs = {}, contextExtraAttrs = {}) {\n if (!organization || !organization.id) {\n throw new Error('No organization')\n }\n\n const [ billingIntegration ] = await createTestBillingIntegration(client, integrationExtraAttrs)\n const [ billingIntegrationContext ] = await createTestBillingIntegrationOrganizationContext(client, organization, billingIntegration, contextExtraAttrs)\n\n return {\n billingIntegration,\n billingIntegrationContext,\n client\n }\n}", "title": "" }, { "docid": "4663a435692d7e9205bfb0e34d51260d", "score": "0.57118016", "text": "async function canReadBillingIntegrationOrganizationContexts ({ authentication: { item: user } }) {\n if (!user) return throwAuthenticationError()\n if (user.deletedAt) return false\n if (user.isSupport || user.isAdmin) return true\n\n return {\n OR: [\n { organization: { employees_some: { user: { id: user.id }, role: { OR: [{ canReadBillingReceipts: true }, { canManageIntegrations: true }] }, isBlocked: false, deletedAt: null } } },\n { integration: { accessRights_some: { user: { id: user.id }, deletedAt: null } } },\n ],\n }\n}", "title": "" }, { "docid": "71c369de9c8c1effd24bc1f6450f95a8", "score": "0.50815725", "text": "createRegistrationProxy(registrationId, context) {\n //check the condition if canTransact is enabled in moolya then only follow the steps\n var registrationDetails = mlDBController.findOne('MlRegistration', {_id: registrationId}) || {}\n registrationDetails = _.omit(registrationDetails, '_id')\n var subChapterId = registrationDetails.registrationInfo && registrationDetails.registrationInfo.subChapterId ? registrationDetails.registrationInfo.subChapterId : ''\n var subChapterDetails = mlDBController.findOne('MlSubChapters', {_id: subChapterId}) || {}\n var resp = null\n if (subChapterDetails && !subChapterDetails.isDefaultSubChapter) {\n var defaultSubChapter = mlDBController.findOne('MlSubChapters', {\n clusterId: subChapterDetails.clusterId,\n chapterId: subChapterDetails.chapterId,\n isDefaultSubChapter: true\n })\n registrationDetails.status = \"Yet To Start\"\n let regInfo = registrationDetails.registrationInfo\n var isRegister = mlDBController.findOne('MlRegistration', {\n \"registrationInfo.clusterId\": regInfo.clusterId,\n \"registrationInfo.chapterId\": regInfo.chapterId,\n \"registrationInfo.subChapterId\": defaultSubChapter._id,\n \"registrationInfo.userId\": regInfo.userId\n })\n if (!isRegister && regInfo.userId) {\n regInfo.registrationDate = new Date()\n regInfo.subChapterId = defaultSubChapter._id\n regInfo.subChapterName = defaultSubChapter.subChapterName\n orderNumberGenService.assignRegistrationId(regInfo)\n registrationDetails.transactionId = regInfo.registrationId\n registrationDetails.registrationInfo = regInfo\n resp = mlDBController.insert('MlRegistration', registrationDetails, context)\n return resp\n }\n }\n }", "title": "" }, { "docid": "f1319e7ffb9648d341f83bd78cdd7c3c", "score": "0.5028064", "text": "addThirdPartyIntegration(){\n console.log(\"addThirdPartyIntegration called\")\n let credentialObj = {};\n /*****\n\n JIRA Api calls goes below if condition\n @username : jira Username\n @password : jira Passqord\n @hosturl : Url for Login to jira\n @projectkey : key which jira should login\n #Date : 17/07/2017\n\n ****/\n if(this.state.selectedIntegrationType === 'jira'){\n var host = this.state.hosturl;\n host = host.replace(/\\/$/, \"\");\n // JIRA Api calls goes here!!!!\n if (!host.match(/^[a-zA-Z]+:\\/\\//))\n {\n host = 'https://' + host;\n }\n var JiraApi_Request = {\"username\":this.state.username,\"password\":this.state.password,\"key\":this.state.apiKey,\"host\":host+\"/\"}\n var integration_request = {\"username\":this.state.username,\"password\":this.state.password,\"accesskey\":this.state.apiKey,\"host\":host}\n\n\n verifyJiraConnection(JiraApi_Request).then((Response)=>{\n //credentialObj[\"accesskey\"]= this.state.apiKey;\n\n var statusCode = Response.data.statuscode;\n if(statusCode!=null && statusCode!=''){\n\n credentialObj[\"accesskey\"]= this.state.apiKey;\n if(statusCode === 200){\n this.setState({ apiIntegrationStatus:'Active',\n apiIntegrationDescription:'Integrated Successfully'},function(){\n //+++++++++++ Success-->Add Integration API ++++++++++++++\n addIntegration(this.state.selectedIntegrationType, integration_request, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n console.log(\"Integration response \"+JSON.stringify(addIntegrationResponse))\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n console.log(\"Error in addIntegration \"+addIntegrationError)\n })\n })\n }\n else\n {\n this.setState({apiIntegrationStatus:'Offline',\n apiIntegrationDescription:Response.data.output},function(){\n //+++++++++++ Error flow-->Call Add API Integration API\n console.log(\"Error integration\")\n addIntegration(this.state.selectedIntegrationType, integration_request, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n console.log(\"Integration response \"+JSON.stringify(addIntegrationResponse))\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n console.log(\"Error in addIntegration \"+addIntegrationError)\n })\n })\n }\n }\n else\n {\n this.setState({apiIntegrationStatus:'Offline',\n apiIntegrationDescription:Response.data.output},function(){\n //+++++++++++ Error flow-->Call Add API Integration API\n console.log(\"Error integration\")\n addIntegration(this.state.selectedIntegrationType, integration_request, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n console.log(\"Integration response \"+JSON.stringify(addIntegrationResponse))\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n console.log(\"Error in addIntegration \"+addIntegrationError)\n })\n })\n }\n console.log(\"JIRA RESP\"+Response.data.response.statusCode);\n })\n //.catch((error) => alert(\"Something went Wrong\"))\n }\n else if(this.state.selectedIntegrationType === 'pagerduty'){\n\n //++++++++++++ Validating API Key ++++++++++++++++++\n verifyPDconnection(this.state.apiKey, \"trigger\", \"Welcome to Cavirin-Verifying Integration\")\n .then((verifyPDconnectionStatus)=>{\n let statusCode = verifyPDconnectionStatus.data.response.statusCode\n\n //++++++++++++++++ Add Integration checkpoint ++++++++++++++++++++++++\n if(statusCode!=null && statusCode!=''){\n credentialObj[\"accesskey\"]= this.state.apiKey;\n if(statusCode === 200){\n this.setState({ apiIntegrationStatus:'Active',\n apiIntegrationDescription:'Integrated Successfully'},function(){\n //+++++++++++ Success-->Add Integration API ++++++++++++++\n addIntegration(this.state.selectedIntegrationType, credentialObj, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n console.log(\"Error in addIntegration \"+addIntegrationError)\n })\n })\n }\n else if(statusCode === 400){\n this.setState({apiIntegrationStatus:'Offline',\n apiIntegrationDescription:'Invalid API Key'},function(){\n // +++++++++++ Error flow ++++++++++++++++++ //\n addIntegration(this.state.selectedIntegrationType, credentialObj, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n console.log(\"Error in addIntegration \"+addIntegrationError)\n })\n })\n }\n }\n })\n .catch((error) => console.log(\"Error in apiKeyValidation in container:\" + error))\n }\n else if(this.state.selectedIntegrationType === \"slack\")\n {\n verifySlackConnection(this.state.apiKey)\n .then((verifySlackConnectionStatus)=>{\n let statusCode = verifySlackConnectionStatus.data.response.statusCode\n //++++++++++++++++ Add Integration checkpoint ++++++++++++++++++++++++\n if(statusCode!=null && statusCode!='' && statusCode!=undefined){\n credentialObj[\"webhook\"]= this.state.apiKey;\n if(statusCode === 200){\n this.setState({apiIntegrationStatus:'Active',\n apiIntegrationDescription:'Integrated Successfully'},function(){\n //+++++++++++ Success-->Add Integration API ++++++++++++++\n addIntegration(this.state.selectedIntegrationType, credentialObj, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n console.log(\"Error in addIntegration \"+addIntegrationError)\n this.props.refreshIntegrationsList();\n })\n })\n }\n else{\n this.setState({apiIntegrationStatus:'Offline',\n apiIntegrationDescription:'Invalid webhook url'},function(){\n //+++++++++++ Error flow ++++++++++ //\n addIntegration(this.state.selectedIntegrationType, credentialObj, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n this.props.refreshIntegrationsList();\n console.log(\"Error in addIntegration \"+addIntegrationError)\n })\n })\n }\n }else if (statusCode===undefined){\n this.setState({apiIntegrationStatus:'Offline',\n apiIntegrationDescription:'Invalid webhook url'},function(){\n //+++++++++++ Error flow-->Call Add API Integration Api\n addIntegration(this.state.selectedIntegrationType, credentialObj, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n this.props.refreshIntegrationsList();\n console.log(\"Error in addIntegration \"+addIntegrationError)\n })\n })\n }\n })\n .catch((error) => console.log(\"Error in apiKeyValidation in container:\" + error))\n }\n else if(this.state.selectedIntegrationType === \"serviceNow\") {\n /* var ServiceNowApi_Request = {\"username\":this.state.serviceusernameValue,\"password\":this.state.servicePasswordValue}\n this.setState({apiIntegrationStatus:'Active',\n apiIntegrationDescription:'Integrated Successfully'},function(){\n //+++++++++++ Success-->Add Integration API ++++++++++++++\n addIntegration(this.state.selectedIntegrationType, ServiceNowApi_Request, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n console.log(\"Integration response \"+JSON.stringify(addIntegrationResponse))\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n console.log(\"Error in addIntegration \"+addIntegrationError)\n this.props.refreshIntegrationsList();\n })\n })*/\n let host= this.state.serviceUrlValue;\n host = host.replace(/\\/$/, \"\");\n if (!host.match(/^[a-zA-Z]+:\\/\\//))\n {\n\n host = 'https://' + host;\n }\n\n verifyUserPasswordForServiceNow(this.state.serviceusernameValue,this.state.servicePasswordValue,host)\n .then((verifyServiceNowConnectionStatus)=>{\n\n let statusCode = verifyServiceNowConnectionStatus.data.statuscode\n\n var ServiceNowApi_Request = {\"username\":this.state.serviceusernameValue,\"password\":this.state.servicePasswordValue,\"url\":host}\n //++++++++++++++++ Add Integration checkpoint ++++++++++++++++++++++++\n if(statusCode!=null && statusCode!='' && statusCode!=undefined){\n\n if(statusCode === 200){\n this.setState({apiIntegrationStatus:'Active',\n apiIntegrationDescription:'Integrated Successfully'},function(){\n //+++++++++++ Success-->Add Integration API ++++++++++++++\n addIntegration(this.state.selectedIntegrationType, ServiceNowApi_Request, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n console.log(\"Integration response \"+JSON.stringify(addIntegrationResponse))\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n console.log(\"Error in addIntegration \"+addIntegrationError)\n this.props.refreshIntegrationsList();\n })\n })\n }\n else{\n this.setState({apiIntegrationStatus:'Offline',\n apiIntegrationDescription:verifyServiceNowConnectionStatus.data.output},function(){\n //+++++++++++ Error flow-->Call Add API Integration API\n console.log(\"Error integration\")\n addIntegration(this.state.selectedIntegrationType, ServiceNowApi_Request, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n console.log(\"Integration response \"+JSON.stringify(addIntegrationResponse))\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n this.props.refreshIntegrationsList();\n console.log(\"Error in addIntegration \"+addIntegrationError)\n })\n })\n }\n }else if (statusCode===undefined){\n this.setState({apiIntegrationStatus:'Offline',\n apiIntegrationDescription:verifyServiceNowConnectionStatus.data.output},function(){\n //+++++++++++ Error flow-->Call Add API Integration Api\n addIntegration(this.state.selectedIntegrationType, ServiceNowApi_Request, this.state.apiIntegrationStatus, this.state.apiIntegrationDescription)\n .then((addIntegrationResponse)=>{\n console.log(\"Integration response \"+JSON.stringify(addIntegrationResponse))\n this.props.refreshIntegrationsList();\n })\n .catch((addIntegrationError)=>{\n this.props.refreshIntegrationsList();\n console.log(\"Error in addIntegration \"+addIntegrationError)\n })\n })\n }\n })\n .catch((error) => console.log(\"Error in ServiceNow validation in container:\" + error))\n\n\n }\n this.setState({showIntegration:false})\n}", "title": "" }, { "docid": "4bfcd5eaef7542e859ba229423c54d8d", "score": "0.5024275", "text": "function createContext() {\n\n return {\n\n // Email based test account\n testAccount1: {\n id: '9e3f05cd-fd65-4db4-abe5-1b44dba55a7d',\n email: '[email protected]',\n password: 'test'\n },\n \n // Email based test account\n testAccount2: {\n id: '3c8a915e-c70a-42df-9196-63ae869b21a3',\n email: '[email protected]',\n password: 'test'\n },\n\n // Cleanup functions to call afterwards\n cleanup: []\n\n }\n\n}", "title": "" }, { "docid": "284e6aba7979456c977258c8d782aac3", "score": "0.49952638", "text": "verifyAuthentication(){\n const account = msalInstance.getAccount()\n if (account) {\n msalInstance.acquireTokenSilent(msalRequestScope)\n .then(\n response => this.updateAuthenticatedState(response.accessToken, account.userName, account.name)\n )\n } else {\n this.updateAuthenticatedState();\n }\n }", "title": "" }, { "docid": "f5363e9a1222fede8d80ebc24d03db92", "score": "0.49867874", "text": "defaultOnOperation(baseParams, args, ctx) {\n const newBaseParams = Object.assign({}, baseParams); // clone object\n return getAuthenticatedUser(ctx)\n .then((user) => {\n if (!user.id) {\n return Promise.reject(Error('Unauthorized!'));\n }\n\n newBaseParams.context = ctx;\n return newBaseParams;\n });\n }", "title": "" }, { "docid": "804443c8208cf830d206f241b86f544e", "score": "0.49393553", "text": "setupIntegrations() {\n if (this._isEnabled() && !this._integrationsInitialized) {\n this._integrations = integration.setupIntegrations(this._options.integrations);\n this._integrationsInitialized = true;\n }\n }", "title": "" }, { "docid": "c87a2956061cc2856c422ab2ff7a2abe", "score": "0.49223214", "text": "function _getAuthToken() \n{\n misty.SendExternalRequest(\"POST\", misty.Get(\"AccessTokenTrigger\"), null, null, null, false, false, null, \"application/json\", \"_UpdateAuthToken\");\n}", "title": "" }, { "docid": "9ddcea1828dc28a64bada6f2ed08db75", "score": "0.48989207", "text": "integrateUserToIdentityPool(onSuccess, onFailure, onRefreshFailure) {\n let cognitoUser = this.userPool.getCurrentUser()\n var callback = (err, result) => {\n if (err) {\n logger.log(err)\n if (typeof onFailure == 'function') {\n return onFailure(err)\n }\n return\n }\n\n if (result) {\n logger.log('You are now logged in.')\n\n this.cognitoUser = cognitoUser\n // Add the User's Id Token to the Cognito credentials login map.\n AWS.config.credentials = new AWS.CognitoIdentityCredentials({\n IdentityPoolId: ENV_VARS.COGNITO_IDENTITY_POOL_ID,\n Logins: {\n ['cognito-idp.' + ENV_VARS.COGNITO_REGION + '.amazonaws.com/' + ENV_VARS.COGNITO_USER_POOL_ID]: result.getIdToken().getJwtToken()\n }\n })\n }\n }\n\n if (cognitoUser != null) {\n cognitoUser.getSession(callback)\n var refreshCallback = (err) => {\n if (err) {\n logger.log(err)\n if (typeof onRefreshFailure == 'function') {\n return onRefreshFailure(err)\n }\n } else {\n logger.log('Cognito credential has been successfully refreshed !')\n if (typeof onSuccess == 'function') {\n return onSuccess()\n }\n }\n }\n\n //call refresh method in order to authenticate user and get new temp credentials\n AWS.config.credentials.refresh(refreshCallback)\n }\n }", "title": "" }, { "docid": "a7d573bf673b7d3ba0b330f31aeda529", "score": "0.48862988", "text": "function EnrichIntegrationConfigStrategy (userConfig) {\n this.userConfig = userConfig;\n}", "title": "" }, { "docid": "8c94f20d851b9c62ff3ab8b804f1b7a7", "score": "0.48797148", "text": "contextUser(options) {\n // Default to context user\n if (options.context && options.context.user) {\n return options.context.user;\n // Other wise use the internal override\n } else if (options.context && options.context.internal) {\n return 1;\n } else {\n errors.logAndThrowError(new Error('missing context'));\n }\n }", "title": "" }, { "docid": "61672321d9f2e32428db923e127e2c32", "score": "0.48755538", "text": "function ContextOfTenant(editCtx) {\n if (editCtx.Environment) {\n // 2020-11-28 #cleanup11.11 2dm - not used, disabled - keep till Jan 2021, then remove from backend-json and drop these comments\n // this.id = editCtx.Environment.WebsiteId;\n // this.url = editCtx.Environment.WebsiteUrl;\n }\n }", "title": "" }, { "docid": "e105860052b52d8c0e50875b2c64efab", "score": "0.4828713", "text": "_fillUserContext() {\n if (this._context &&\n this._context.has('identity') &&\n this._context.identity.hasOwnProperty('cognitoIdentityPoolId') &&\n this._context.identity.hasOwnProperty('cognitoIdentityId')\n ) {\n let identityPoolId = this._context.identity.cognitoIdentityPoolId;\n\n if (this.securityService.identityPoolId !== identityPoolId) {\n throw new InvalidCognitoIdentityException(identityPoolId);\n }\n\n // inject lambda context into security service\n // and instantiate security token without loading credentials\n this.securityService.warmupBackendLogin(this._context);\n\n this._loggedUserId = this._context.identity.cognitoIdentityId;\n }\n }", "title": "" }, { "docid": "7acdf4e41ce8d9ad72229e31c3a2c4ac", "score": "0.48241985", "text": "function setupIntegrations(options){var integrations={};getIntegrationsToSetup(options).forEach(function(integration){integrations[integration.name]=integration;setupIntegration(integration);});return integrations;}", "title": "" }, { "docid": "c07dc7d4049752cf4c97c92d11dc9585", "score": "0.48187432", "text": "function isDesiredScriptContext() {\r\n var exCtx = nlapiGetContext().getExecutionContext();\r\n // allow also webservices because Celigo has a suiteflex integration that expects this script to run\r\n return exCtx == 'userinterface' || exCtx == 'webservices';\r\n}", "title": "" }, { "docid": "a45feb4448cb274042116afbcd7f43e3", "score": "0.48033467", "text": "function GiveRights() {\n var targetUserId = \"213DF37D-2351-E911-8117-00155D05FA01\";\n var accessOptions = {\n targetEntityName: \"contact\",\n targetEntityId: contactId,\n principalEntityName: \"systemuser\",\n principalEntityId: targetUserId,\n accessRights: [\"ReadAccess\", \"WriteAccess\"]\n };\n XrmServiceToolkit.Soap.GrantAccess(accessOptions);\n\n}", "title": "" }, { "docid": "c06a1f2b05e44afb382fcf362a2461e9", "score": "0.47952023", "text": "function IntegrationService(konyRef, serviceName) {\n var logger = new konyLogger();\n var dataStore = new konyDataStore();\n var homeUrl = konyRef.integsvc[serviceName];\n var networkProvider = new konyNetworkProvider();\n if (homeUrl == undefined || serviceName == undefined) {\n throw new Exception(Errors.INIT_FAILURE, \"Invalid homeUrl and serviceName\");\n }\n homeUrl = stripTrailingCharacter(homeUrl, \"/\");\n this.getUrl = function() {\n return homeUrl;\n };\n /**\n * Integration service success callback method.\n * @callback integrationSuccessCallback\n * @param {json} response - Integration service response\n */\n /**\n * Integration service failure callback method.\n * @callback integrationFailureCallback\n * @param {json} error - Error information\n */\n /**\n * invoke the specified operation \n * @param {string} operationName - Name of the operation\n * @param {object} headers - Input headers for the operation\n * @param {object} data - Input data for the operation\n * @param {integrationSuccessCallback} successCallback - Callback method on success\n * @param {integrationFailureCallback} failureCallback - Callback method on failure\n */\n this.invokeOperation = function(operationName, headers, data, successCallback, failureCallback) {\n function invokeOperationHandler() {\n _invokeOperation(operationName, headers, data, successCallback, failureCallback);\n }\n kony.sdk.claimsRefresh(invokeOperationHandler, failureCallback);\n };\n\n function _invokeOperation(operationName, headers, data, successCallback, failureCallback) {\n var requestData = {};\n var reportingData = kony.sdk.getPayload(konyRef);\n if (kony.sdk.metric) {\n if (kony.sdk.metric.reportEventBufferBackupArray.length === 0) {\n kony.sdk.metric.readFromDS();\n }\n kony.sdk.metric.pushEventsToBufferArray();\n requestData.events = kony.sdk.metric.reportEventBufferBackupArray;\n }\n for (var key in data) {\n requestData[key] = data[key];\n }\n reportingData.svcid = operationName;\n var token;\n for (var i in konyRef.tokens) {\n if (konyRef.tokens.hasOwnProperty(i) && typeof(i) !== 'function') {\n token = konyRef.tokens[i];\n break;\n }\n }\n requestData[\"konyreportingparams\"] = JSON.stringify(reportingData);\n var defaultHeaders = {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"X-Kony-Authorization\": konyRef.currentClaimToken\n }\n // if the user has defined his own headers, use them\n if (headers) {\n for (var header in headers) {\n defaultHeaders[header] = headers[header];\n }\n }\n networkProvider.post(homeUrl + \"/\" + operationName, requestData, defaultHeaders, function(res) {\n if (kony.sdk.metric) {\n kony.sdk.metric.clearBufferEvents();\n }\n kony.sdk.verifyAndCallClosure(successCallback, res);\n }, function(xhr, status, err) {\n if (xhr && !(status && err)) {\n err = xhr;\n }\n if (kony.sdk.metric) {\n if (kony.sdk.metric.errorCodeMap[xhr.opstatus]) {\n kony.sdk.metric.saveInDS();\n }\n }\n kony.sdk.verifyAndCallClosure(failureCallback, err);\n }, true);\n };\n}", "title": "" }, { "docid": "50c2ef6fed2e786583932cf2eb471b9d", "score": "0.47932523", "text": "addTransaction(newTrasaction) {\r\n const { addFinananceItem } = this.context\r\n ApiFinancesService.addTransaction(newTrasaction)\r\n .then(trx => addFinananceItem(trx))\r\n .catch(error => new Error(error))\r\n }", "title": "" }, { "docid": "f8a6d61bb1978d509401baecf59fc813", "score": "0.47813934", "text": "static async manageIntegrations({ _id, integrationIds }) {\n await Integrations.update(\n { _id: { $in: integrationIds } },\n { $set: { brandId: _id } },\n { multi: true },\n );\n\n return Integrations.find({ _id: { $in: integrationIds } });\n }", "title": "" }, { "docid": "a68d64805eb8440c1eced1c15990c749", "score": "0.4763998", "text": "constructor(factoryOptions = {}) {\n var _a;\n const { MicrosoftAppId = null, MicrosoftAppPassword = null, MicrosoftAppType = null, MicrosoftAppTenantId = null, } = TypedConfig.nonstrict().parse(factoryOptions);\n super(MicrosoftAppId, MicrosoftAppPassword, MicrosoftAppTenantId);\n const appType = (_a = MicrosoftAppType === null || MicrosoftAppType === void 0 ? void 0 : MicrosoftAppType.trim()) !== null && _a !== void 0 ? _a : MultiTenant;\n switch (appType.toLocaleLowerCase()) {\n case UserAssignedMsi.toLocaleLowerCase():\n assert_1.ok(MicrosoftAppId === null || MicrosoftAppId === void 0 ? void 0 : MicrosoftAppId.trim(), 'MicrosoftAppId is required for MSI in configuration.');\n assert_1.ok(MicrosoftAppTenantId === null || MicrosoftAppTenantId === void 0 ? void 0 : MicrosoftAppTenantId.trim(), 'MicrosoftAppTenantId is required for MSI in configuration.');\n assert_1.ok(!(MicrosoftAppPassword === null || MicrosoftAppPassword === void 0 ? void 0 : MicrosoftAppPassword.trim()), 'MicrosoftAppPassword must not be set for MSI in configuration.');\n this.inner = new botframework_connector_1.ManagedIdentityServiceClientCredentialsFactory(MicrosoftAppId, new botframework_connector_1.JwtTokenProviderFactory());\n break;\n case SingleTenant.toLocaleLowerCase():\n assert_1.ok(MicrosoftAppId === null || MicrosoftAppId === void 0 ? void 0 : MicrosoftAppId.trim(), 'MicrosoftAppId is required for SingleTenant in configuration.');\n assert_1.ok(MicrosoftAppPassword === null || MicrosoftAppPassword === void 0 ? void 0 : MicrosoftAppPassword.trim(), 'MicrosoftAppPassword is required for SingleTenant in configuration.');\n assert_1.ok(MicrosoftAppTenantId === null || MicrosoftAppTenantId === void 0 ? void 0 : MicrosoftAppTenantId.trim(), 'MicrosoftAppTenantId is required for SingleTenant in configuration.');\n this.inner = new botframework_connector_1.PasswordServiceClientCredentialFactory(MicrosoftAppId, MicrosoftAppPassword, MicrosoftAppTenantId);\n break;\n default:\n //MultiTenant\n this.inner = new botframework_connector_1.PasswordServiceClientCredentialFactory(MicrosoftAppId, MicrosoftAppPassword, '');\n break;\n }\n }", "title": "" }, { "docid": "8c5513f59e1675c94196dd776317ce8f", "score": "0.4752858", "text": "async optInUsersToOktaCommunicationEmails(_options) {\n let _config = _options || this.configuration;\n // Path Params\n const path = '/api/v1/org/privacy/oktaCommunication/optIn';\n // Make Request Context\n const requestContext = _config.baseServer.makeRequestContext(path, http_1.HttpMethodEnum.POST);\n requestContext.setHeaderParam('Accept', 'application/json, */*;q=0.8');\n let authMethod;\n // Apply auth methods\n authMethod = _config.authMethods['apiToken'];\n if (authMethod?.applySecurityAuthentication) {\n await authMethod?.applySecurityAuthentication(requestContext);\n }\n // Apply auth methods\n authMethod = _config.authMethods['oauth2'];\n if (authMethod?.applySecurityAuthentication) {\n await authMethod?.applySecurityAuthentication(requestContext);\n }\n const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;\n if (defaultAuth?.applySecurityAuthentication) {\n await defaultAuth?.applySecurityAuthentication(requestContext);\n }\n return requestContext;\n }", "title": "" }, { "docid": "c0d7174c36caa40fcbd4f433954ad037", "score": "0.47444317", "text": "function getIntegrationsToSetup(options) {\n var defaultIntegrations = (options.defaultIntegrations && tslib_1.__spread(options.defaultIntegrations)) || [];\n var userIntegrations = options.integrations;\n var integrations = [];\n if (Array.isArray(userIntegrations)) {\n var userIntegrationsNames_1 = userIntegrations.map(function (i) { return i.name; });\n var pickedIntegrationsNames_1 = [];\n // Leave only unique default integrations, that were not overridden with provided user integrations\n defaultIntegrations.forEach(function (defaultIntegration) {\n if (userIntegrationsNames_1.indexOf(defaultIntegration.name) === -1 &&\n pickedIntegrationsNames_1.indexOf(defaultIntegration.name) === -1) {\n integrations.push(defaultIntegration);\n pickedIntegrationsNames_1.push(defaultIntegration.name);\n }\n });\n // Don't add same user integration twice\n userIntegrations.forEach(function (userIntegration) {\n if (pickedIntegrationsNames_1.indexOf(userIntegration.name) === -1) {\n integrations.push(userIntegration);\n pickedIntegrationsNames_1.push(userIntegration.name);\n }\n });\n }\n else if (typeof userIntegrations === 'function') {\n integrations = userIntegrations(defaultIntegrations);\n integrations = Array.isArray(integrations) ? integrations : [integrations];\n }\n else {\n return tslib_1.__spread(defaultIntegrations);\n }\n return integrations;\n}", "title": "" }, { "docid": "8e5f2094a903f7cfef28cbe2e54715c8", "score": "0.47379076", "text": "addExternalUser(externalUser) {\n return new Promise(async (resolve, reject) => {\n try {\n\n console.log(\"context method called\");\n const response = await ExternalUserService.saveExternalUser(externalUser);\n if (response.status === 201) {\n /* 201 - created. */\n const responseResultObject = response.data;\n const newExternalUsersList = [...this.state.externalUsers];\n newExternalUsersList.unshift({\n ...externalUsers,\n _id: responseResultObject?.generatedId\n });\n\n this.setState({\n externalUsers: newExternalUsersList\n });\n\n const addedExternalUsers = this.state\n .external.find(externalUserElem => externalUserElem._id === responseResultObject?.generatedId);\n if (addedExternalUsers) {\n resolve(addedExternalUsers);\n } else {\n reject(new Error('External User was not inserted successfully!'));\n }\n }\n } catch (error) {\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "dd646d99892065590440a94b7a77067c", "score": "0.46947318", "text": "async function updatePaymentIntent(req, res) {\n \n // \n const { currentUser, body: { paymentIntentId } } = req;\n\n // Create customer\n const customer = await getCustomer(currentUser.uid);\n\n let paymentIntent;\n\n try {\n // 1. Passing the payment intent ID (obtained from req)\n // 2. Pass object - customer we want to associate payment intent with\n paymentIntent = await stripeAPI.paymentIntents.update(\n paymentIntentId,\n { \n customer: customer.id\n }\n );\n\n /*\n - Respond to frontend. Send back updated client secret\n - Previously sent back client secret from payment intent\n - Now that payment intent has been updated, we are sending back the \n updated one that can be used on the frontend to checkout\n */\n res.status(200).json({ clientSecret: paymentIntent.client_secret });\n\n } catch (error) {\n console.log(error);\n res.status(400).json({ error: 'unable to update payment intent' });\n }\n}", "title": "" }, { "docid": "4a5585248dc016432aeb43acb76e63cd", "score": "0.46930894", "text": "enterCreate_user(ctx) {\n\t}", "title": "" }, { "docid": "b1d7428a2f79fe99f6ab3ff62086b641", "score": "0.46844333", "text": "async function putADigitalTwinsInstanceResourceWithIdentity() {\n const subscriptionId =\n process.env[\"DIGITALTWINS_SUBSCRIPTION_ID\"] || \"50016170-c839-41ba-a724-51e9df440b9e\";\n const resourceGroupName = process.env[\"DIGITALTWINS_RESOURCE_GROUP\"] || \"resRg\";\n const resourceName = \"myDigitalTwinsService\";\n const digitalTwinsCreate = {\n identity: {\n type: \"SystemAssigned,UserAssigned\",\n userAssignedIdentities: {\n \"/subscriptions/50016170C83941baA72451e9df440b9e/resourceGroups/testrg/providers/MicrosoftManagedIdentity/userAssignedIdentities/testidentity\":\n {},\n },\n },\n location: \"WestUS2\",\n };\n const credential = new DefaultAzureCredential();\n const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);\n const result = await client.digitalTwins.beginCreateOrUpdateAndWait(\n resourceGroupName,\n resourceName,\n digitalTwinsCreate\n );\n console.log(result);\n}", "title": "" }, { "docid": "a85bf02e16a6641a830cdd5b62013631", "score": "0.46320602", "text": "async function tasksUpdateWithMsiCustomCredentials() {\n const subscriptionId =\n process.env[\"CONTAINERREGISTRY_SUBSCRIPTION_ID\"] || \"4385cf00-2d3a-425a-832f-f4285b1c9dce\";\n const resourceGroupName = process.env[\"CONTAINERREGISTRY_RESOURCE_GROUP\"] || \"myResourceGroup\";\n const registryName = \"myRegistry\";\n const taskName = \"myTask\";\n const taskUpdateParameters = {\n agentConfiguration: { cpu: 3 },\n credentials: {\n customRegistries: { myregistryAzurecrIo: { identity: \"[system]\" } },\n },\n logTemplate: undefined,\n status: \"Enabled\",\n step: {\n type: \"Docker\",\n dockerFilePath: \"src/DockerFile\",\n imageNames: [\"azurerest:testtag1\"],\n },\n tags: { testkey: \"value\" },\n trigger: {\n sourceTriggers: [\n {\n name: \"mySourceTrigger\",\n sourceRepository: {\n sourceControlAuthProperties: { token: \"xxxxx\", tokenType: \"PAT\" },\n },\n sourceTriggerEvents: [\"commit\"],\n },\n ],\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new ContainerRegistryManagementClient(credential, subscriptionId);\n const result = await client.tasks.beginUpdateAndWait(\n resourceGroupName,\n registryName,\n taskName,\n taskUpdateParameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "8e0934687345ec5e17c36ac8b3b5a73f", "score": "0.46253923", "text": "function AuthorizePayer(LineItemCtnrObj, paymentInstrument, orderNo) {\n var libCybersource = require('~/cartridge/scripts/cybersource/libCybersource');\n var CybersourceHelper = libCybersource.getCybersourceHelper();\n var result, PAReasonCode, PAVReasonCode, AuthorizationReasonCode, serviceResponse;\n var paEnabled = false;\n var Site = require('dw/system/Site');\n\tvar CsSAType = Site.getCurrent().getCustomPreferenceValue('CsSAType').value;\n\tvar paymentMethod = paymentInstrument.getPaymentMethod();\n if (!empty(CybersourceHelper.getPAMerchantID())) {\n var CardHelper = require('~/cartridge/scripts/helper/CardHelper');\n if ((paymentMethod.equals(CybersourceConstants.METHOD_CREDIT_CARD) && (CsSAType == null || CsSAType != CybersourceConstants.METHOD_SA_FLEX)) || paymentMethod.equals(CybersourceConstants.METHOD_VISA_CHECKOUT) || paymentMethod.equals(CybersourceConstants.METHOD_GooglePay)) {\n result = CardHelper.PayerAuthEnable(paymentInstrument.creditCardType);\n\t\t} else if (CsSAType.equals(CybersourceConstants.METHOD_SA_FLEX)) {\n\t\t\tresult = CardHelper.PayerAuthEnable(paymentInstrument.creditCardType);\n\t\t}\n if (result.error) {\n return result;\n } else if (result.paEnabled) {\n paEnabled = result.paEnabled;\n }\n }\n \n if (paEnabled && empty(LineItemCtnrObj.getPaymentInstruments(CybersourceConstants.METHOD_VISA_CHECKOUT)) && empty(LineItemCtnrObj.getPaymentInstruments(CybersourceConstants.METHOD_GooglePay))) {\n var CardFacade = require('~/cartridge/scripts/facade/CardFacade');\n result = CardFacade.PayerAuthEnrollCheck(LineItemCtnrObj, paymentInstrument.paymentTransaction.amount, orderNo, session.forms.billing.creditCardFields);\n if (result.error) {\n return result;\n }\n serviceResponse = result.serviceResponse;\n if (CybersourceHelper.getProofXMLEnabled()) {\n var PaymentInstrumentUtils = require('~/cartridge/scripts/utils/PaymentInstrumentUtils');\n PaymentInstrumentUtils.UpdatePaymentTransactionWithProofXML(paymentInstrument, serviceResponse.ProofXML);\n }\n if (serviceResponse.ReasonCode === 100) {\n return { OK: true, serviceResponse: serviceResponse };\n } else if (!empty(serviceResponse.AcsURL)) {\n session.privacy.AcsURL = serviceResponse.AcsURL;\n session.privacy.PAReq = serviceResponse.PAReq;\n session.privacy.PAXID = serviceResponse.PAXID;\n session.privacy.order_id = orderNo;\n session.privacy.authenticationTransactionID = serviceResponse.authenticationTransactionID;\n return { payerauthentication: true, serviceResponse: serviceResponse };\n } else {\n Logger.error('An error occured during PayerAuthEnroll check. (ReasonCode: {0} , RequestID: {1}', serviceResponse.ReasonCode, serviceResponse.RequestID);\n return { error: true, serviceResponse: serviceResponse };\n }\n } else if (paEnabled && !empty(LineItemCtnrObj.getPaymentInstruments(CybersourceConstants.METHOD_VISA_CHECKOUT))) {\n var VisaCheckoutHelper = require(CybersourceConstants.CS_CORE_SCRIPT + 'visacheckout/helper/VisaCheckoutHelper');\n return VisaCheckoutHelper.PayerAuthEnroll(LineItemCtnrObj, paymentInstrument, orderNo);\n } else {\n return { success: true }\n }\n}", "title": "" }, { "docid": "d08a4d3f736e652b544104201aaa923b", "score": "0.4622898", "text": "_activeAccountByUsername (context) {\n let url = '/api/account/update-active-account/' + context.state._username + '/1'\n return new Promise((resolve, reject) => {\n axios.put(url,\n {},\n {headers: {Authorization: sessionStorage.getItem('token')}}\n )\n .then((res) => {\n resolve(res)\n })\n .catch((e) => {\n reject(e)\n })\n })\n }", "title": "" }, { "docid": "bc2d723b35e2f0b3ca858439d16b30d3", "score": "0.46207255", "text": "async function interactionsCreateOrUpdate() {\n const subscriptionId = \"subid\";\n const resourceGroupName = \"TestHubRG\";\n const hubName = \"sdkTestHub\";\n const interactionName = \"TestProfileType396\";\n const parameters = {\n apiEntitySetName: \"TestInteractionType6358\",\n fields: [\n {\n fieldName: \"TestInteractionType6358\",\n fieldType: \"Edm.String\",\n isArray: false,\n isRequired: true,\n },\n { fieldName: \"profile1\", fieldType: \"Edm.String\" },\n ],\n idPropertyNames: [\"TestInteractionType6358\"],\n largeImage: \"\\\\\\\\Images\\\\\\\\LargeImage\",\n mediumImage: \"\\\\\\\\Images\\\\\\\\MediumImage\",\n primaryParticipantProfilePropertyName: \"profile1\",\n smallImage: \"\\\\\\\\Images\\\\\\\\smallImage\",\n };\n const credential = new DefaultAzureCredential();\n const client = new CustomerInsightsManagementClient(credential, subscriptionId);\n const result = await client.interactions.beginCreateOrUpdateAndWait(\n resourceGroupName,\n hubName,\n interactionName,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "2149b2592541c4431c1627b56eaf3fbf", "score": "0.46065414", "text": "authenticate(username, password, conFailure, conSuccess) {\n let authenticationData = {\n Username: username,\n Password: password\n }\n const refreshCallback = (err) => {\n if (err) {\n logger.log(err)\n } else {\n logger.log('Cognito credential has been successfully refreshed !')\n }\n }\n\n let authenticationDetails = new CognitoIdentityServiceProvider.AuthenticationDetails(authenticationData)\n var onSuccess = (result) => {\n logger.log('access token + ' + result.getAccessToken().getJwtToken())\n\n AWS.config.credentials = new AWS.CognitoIdentityCredentials({\n IdentityPoolId: ENV_VARS.COGNITO_IDENTITY_POOL_ID,\n Logins: {\n ['cognito-idp.' + ENV_VARS.COGNITO_REGION + '.amazonaws.com/' + ENV_VARS.COGNITO_USER_POOL_ID]: result.getIdToken().getJwtToken()\n }\n })\n \n //call refresh method in order to authenticate user and get new temp credentials\n AWS.config.credentials.refresh(refreshCallback)\n\n if (typeof conSuccess == 'function') {\n return conSuccess()\n }\n }\n\n var onFailure = (err) => {\n logger.log(err)\n if (typeof conFailure == 'function') {\n return conFailure(err)\n }\n }\n\n this.getCognitoUser(username).authenticateUser(\n authenticationDetails,\n {onSuccess, onFailure, mfaRequired: function() {}}\n )\n }", "title": "" }, { "docid": "1cc3fa85f4a3c5bd436c2f0b58563bb0", "score": "0.45923927", "text": "function OnContextChangeAccepted(contextcoupon) {\n Caradigm.IAM.IContextor.GetContextAsync(false, onGetContext);\n cmv.addstatus(\"Context changed received\");\n}", "title": "" }, { "docid": "4edbadeb78f6b833c72b3933ef7313ec", "score": "0.45828605", "text": "postEntitlementsRequest_(usedEntitlement, entitlementResult, entitlementSource) {\n let optionalToken = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';\n let optionalIsUserRegistered = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;\n let optionalSubscriptionTimestamp = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;\n const message = new _api_messages.EntitlementsRequest();\n message.setUsedEntitlement(usedEntitlement);\n message.setClientEventTime((0, _dateUtils.toTimestamp)(Date.now()));\n message.setEntitlementResult(entitlementResult);\n message.setEntitlementSource(entitlementSource);\n message.setToken(optionalToken);\n if (typeof optionalIsUserRegistered === 'boolean') {\n message.setIsUserRegistered(optionalIsUserRegistered);\n }\n if (optionalSubscriptionTimestamp) {\n message.setSubscriptionTimestamp(optionalSubscriptionTimestamp);\n }\n let url = '/publication/' + encodeURIComponent(this.publicationId_) + this.action_;\n url = addDevModeParamsToUrl(this.win_.location, url);\n\n // Promise that sets this.encodedParams_ when it resolves.\n const encodedParamsPromise = this.encodedParams_ ? Promise.resolve() : (0, _string.hash)((0, _url.getCanonicalUrl)(this.deps_.doc())).then(hashedCanonicalUrl => {\n /** @type {!GetEntitlementsParamsInternalDef} */\n const encodableParams = {\n metering: {\n resource: {\n hashedCanonicalUrl\n }\n }\n };\n this.encodedParams_ = (0, _bytes.base64UrlEncodeFromBytes)((0, _bytes.utf8EncodeSync)(JSON.stringify(encodableParams)));\n });\n\n // Get swgUserToken from local storage\n const swgUserTokenPromise = this.storage_.get(_constants.Constants.USER_TOKEN, true);\n this.entitlementsPostPromise = Promise.all([swgUserTokenPromise, encodedParamsPromise]).then(values => {\n const swgUserToken = values[0];\n if (swgUserToken) {\n url = (0, _url.addQueryParam)(url, 'sut', swgUserToken);\n }\n url = (0, _url.addQueryParam)(url, this.encodedParamName_, /** @type {!string} */this.encodedParams_);\n return this.fetcher_.sendPost((0, _services2.serviceUrl)(url), message);\n });\n }", "title": "" }, { "docid": "c47c8668d7b188a9dc6d12e6e78def1f", "score": "0.45806408", "text": "function getIntegrationsToSetup(options){var defaultIntegrations=options.defaultIntegrations&&Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(options.defaultIntegrations)||[];var userIntegrations=options.integrations;var integrations=[];if(Array.isArray(userIntegrations)){var userIntegrationsNames_1=userIntegrations.map(function(i){return i.name;});var pickedIntegrationsNames_1=[];// Leave only unique default integrations, that were not overridden with provided user integrations\ndefaultIntegrations.forEach(function(defaultIntegration){if(userIntegrationsNames_1.indexOf(defaultIntegration.name)===-1&&pickedIntegrationsNames_1.indexOf(defaultIntegration.name)===-1){integrations.push(defaultIntegration);pickedIntegrationsNames_1.push(defaultIntegration.name);}});// Don't add same user integration twice\nuserIntegrations.forEach(function(userIntegration){if(pickedIntegrationsNames_1.indexOf(userIntegration.name)===-1){integrations.push(userIntegration);pickedIntegrationsNames_1.push(userIntegration.name);}});}else if(typeof userIntegrations==='function'){integrations=userIntegrations(defaultIntegrations);integrations=Array.isArray(integrations)?integrations:[integrations];}else{integrations=Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(defaultIntegrations);}// Make sure that if present, `Debug` integration will always run last\nvar integrationsNames=integrations.map(function(i){return i.name;});var alwaysLastToRun='Debug';if(integrationsNames.indexOf(alwaysLastToRun)!==-1){integrations.push.apply(integrations,Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(integrations.splice(integrationsNames.indexOf(alwaysLastToRun),1)));}return integrations;}", "title": "" }, { "docid": "7848120eea21eff705bd0540ffcd3f72", "score": "0.45791706", "text": "async registerOrganization(context, { email, password, id }) {\n return await orgAPI.createOrganization({ email, password, id });\n }", "title": "" }, { "docid": "f1c4328a6f330915c9f848e3b9f30e4c", "score": "0.4573251", "text": "enterUnified_auditing(ctx) {\n\t}", "title": "" }, { "docid": "59261ff5a143e3493be599a29c9329ae", "score": "0.45694715", "text": "async function handleCreate(event, context) {\n const params = {\n AccountName: event.ResourceProperties.AccountName,\n Email: event.ResourceProperties.Email,\n RoleName: \"TemporaryAdmin\",\n };\n\n let { Id } = (await organizations.createAccount(params).promise()).CreateAccountStatus;\n let State = \"IN_PROGRESS\";\n\n while(State === \"IN_PROGRESS\") {\n await sleep(500); \n // todo: test & debug this section more - the createAccount call succeeds but for some reason this part errors with \"another request already in progress\n // temp workaround - delete the stack and bring it back up\n let response = await organizations.describeCreateAccountStatus({ CreateAccountRequestId: Id }).promise();\n let status = response.CreateAccountStatus;\n\n State = status.State;\n }\n \n let ids = await getAccountIds(event.ResourceProperties.Email);\n return ids;\n}", "title": "" }, { "docid": "ca1e54de72c2653413420138751a2cba", "score": "0.45602208", "text": "function grantFeatureLocally(productId, transactionId) {\n var nextIndex = grantedIds[productId].length;\n grantedIds[productId][nextIndex] = transactionId;\n\n // Grant the user the content, such as by increasing some kind of asset count\n numberOfConsumablesPurchased++;\n }", "title": "" }, { "docid": "dbe277858e39ff98d89eeaf1e37830d1", "score": "0.4548453", "text": "async registerCompany(\r\n ctx,\r\n companyCRN,\r\n companyName,\r\n Location,\r\n organisationRole\r\n ) {\r\n // As this method is not valid for \"Consumer\".\r\n if (organisationRole === \"Consumer\") {\r\n console.log(\"Not Allowed to Invoke this Function\");\r\n return \"Not Allowed to Invoke this Function\";\r\n }\r\n\r\n // Assigning Hierarchy Key for different Organizations.\r\n let hierarchyKey = null;\r\n if (organisationRole === \"Manufacturer\") {\r\n hierarchyKey = \"1\";\r\n } else if (organisationRole === \"Distributor\") {\r\n hierarchyKey = \"2\";\r\n } else if (organisationRole === \"Retailer\") {\r\n hierarchyKey = \"3\";\r\n }\r\n\r\n // Create a composite key for the new company\r\n const companyKey = ctx.stub.createCompositeKey(\r\n \"org.pharma-net.pharmanet.company\",\r\n [companyCRN] // , companyName] // Name of the company is not being used here as it will be difficult to retrieve the key in later functions.\r\n );\r\n\r\n // To Validate if the Asset is already Present or not.\r\n let companyBuffer = await ctx.stub\r\n .getState(companyKey)\r\n .catch((err) => console.log(err));\r\n\r\n if (companyBuffer.length > 0) {\r\n return \"Company already Registered\";\r\n }\r\n\r\n // Create a Company object to be stored in blockchain\r\n let newCompanyObject = {\r\n companyID: companyKey,\r\n name: companyName,\r\n location: Location,\r\n organisationRole: organisationRole,\r\n hierarchyKey: hierarchyKey,\r\n createdAt: new Date(),\r\n };\r\n\r\n // Convert the JSON object to a buffer and send it to blockchain for storage\r\n let dataBuffer = Buffer.from(JSON.stringify(newCompanyObject));\r\n await ctx.stub.putState(companyKey, dataBuffer);\r\n\r\n // Return value of new Company Object created to user\r\n return newCompanyObject;\r\n }", "title": "" }, { "docid": "648dfb007c8d39ded1f13b1fe89c42d3", "score": "0.45324624", "text": "static associate_identity({ organizationId, userId, identityAssociation }) {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n resolve(Service.rejectResponse(\n e.message || 'Invalid input',\n e.status || 405,\n ));\n }\n },\n );\n }", "title": "" }, { "docid": "72b226d68a786e0c2a477a64b6139aa5", "score": "0.45304942", "text": "function withGlobalContext(teamLogin, teamPassword, personId) {\n\n let teamId = ''\n\n // --- Promise 1\n return teamLoginHelper.getTeamId(teamLogin, teamPassword)\n .then(teamIdResult => {\n teamId = teamIdResult\n // --- Promise 2\n return teamLoginHelper.registerPersonWithinTeam(personId, teamId)\n })\n .then(() => {\n return teamId\n })\n .catch(err => {\n console.error(err)\n throw err\n })\n}", "title": "" }, { "docid": "93b87086b1349cd7325892bc0c2dc9e0", "score": "0.45276076", "text": "enterQualifiedId(ctx) {\n\t}", "title": "" }, { "docid": "8d16ee0b62d77fbd64969dd8e23c77fa", "score": "0.4522374", "text": "function handleCaseUserAuthRequest(intent, session, response) {\n var userPasscode = session.attributes.userPasscode = intent.slots.userPasscode.value;\n console.log('>>>>', userPasscode);\n var query = \"Select Passcode__c,UserName__c from User_Authentication__c where Passcode__c = '\" + userPasscode + \"'\" + \" Limit 1\";\n org.authenticate({\n username: USERNAME,\n password: PASSWORD\n })\n .then(function () {\n return org.query({\n query: query\n })\n }).then(function (results) {\n var speechOutput = 'Sorry, I could not find you in the system. Are you sure you are an authenticated service agent? Please try again reading your passcode slowly one more time.';\n if (results.records.length > 0) {\n var cs = results.records[0];\n userAlexaName = cs.get('UserName__c');\n speechOutput = 'Hello ' + cs.get('UserName__c') + '! Welcome back! Thank You for authenticating yourself. How can I help you Today?';\n response.ask(speechOutput, \"Salesforce\", speechOutput);\n } else {\n if (userAuthTrialOne == false) {\n userAuthTrialOne = true;\n response.ask(speechOutput, \"Salesforce\", speechOutput);\n } else {\n speechOutput = 'Sorry again, Looks like you are not a service agent in Cable Plus system. Please try creating a new passcode in your salesforce system or please contact your system administrator';\n response.tellWithCard(speechOutput, \"Salesforce\", speechOutput);\n }\n }\n }).error(function (err) {\n var errorOutput = 'Sorry, there was a problem while making connection with Cable Plus application.';\n response.tellWithCard(errorOutput, \"Salesforce\", errorOutput);\n });\n\n}", "title": "" }, { "docid": "452ba925e889f57adc1b96ae3cd9f7ac", "score": "0.45163447", "text": "static integrate(userId, callback) {\n\t\tDBManager.getUser({_id: userId}).then(function (user) {\n\t\t\tif (user && user._id) {\n\t\t\t\t//redirect the user to his integrations page\n\t\t\t\tlet authUrl = GmailLogic.getUrl(userId);\n\t\t\t\tif (!user.integrations.Gmail || !user.integrations.Gmail.refresh_token) {\n\t\t\t\t\tauthUrl += \"&prompt=consent\";\n\t\t\t\t}\n\t\t\t\tcallback(302, {'location': authUrl});\n\t\t\t}\n\t\t}).catch(MyUtils.getErrorMsg);\n\t}", "title": "" }, { "docid": "741199eb6492b06683479f3d07efbc05", "score": "0.4507711", "text": "function registerSubscription(forceCreate) {\n return new Promise(function (resolve, reject) {\n var FILE_SUBSCRIPTION = 'subscription.id';\n var subscriptionId;\n try {\n subscriptionId = fs.readFileSync(__dirname + '/' + FILE_SUBSCRIPTION,\n 'UTF-8');\n }\n catch(e) {\n console.log('Subscription id not present');\n }\n\n var subscription = {\n type: 'urn:smartsantander:entityType:parkingSensor',\n pattern: 'urn:x-iot:smartsantander:u7jcfa:fixed:np.*',\n };\n\n var options = {\n callback: 'http://' + SERVER_ADDRESS + ':' + PORT + '/on_context_change',\n throttling: 'PT30S',\n attributes: [\n 'presenceStatus:parking'\n ]\n };\n\n if (subscriptionId && !forceCreate) {\n console.log('Using existing subscription id: ', subscriptionId);\n options.subscriptionId = subscriptionId;\n }\n\n SantanderClient.subscribeContext(subscription, options, {\n path: '/parking/#'\n }).then(function(data) {\n if (!data) {\n reject({\n code: 404\n });\n return;\n }\n\n fs.writeFileSync(__dirname + '/' + FILE_SUBSCRIPTION,\n data.subscriptionId);\n resolve(data.subscriptionId);\n\n }).catch(function(err) {\n reject(err);\n });\n });\n}", "title": "" }, { "docid": "495100ad41d92db0f2b0d4e1cbda9036", "score": "0.45040554", "text": "async function runContextTasks(conversation) {\n\n let context = conversation.context\n const conversation_id = context.conversation_id\n if (hasEmail(conversation)) {\n let email = getEmailFromContext(conversation)\n if(email)\n {\n let data = {\n email: email,\n conversation_id: conversation_id,\n date: new Date(),\n };\n const transcript = await Transcript.build(conversation_id)\n if(transcript){\n let doc = {\n email: email,\n conversation_id: conversation_id,\n transcript: transcript\n }\n if(transcript){\n Transcript.send(email, doc.transcript)\n Transcript.send(config.sendGrid.contactEmail, doc.transcript)\n }\n await user.subscribe(data, conversation_id)\n }\n }\n }\n\n if(isPersonDescriptionNode(conversation)){\n let problem = nlu.parseProblemNode(context.problem.text)\n context.problem = {\n text: problem,\n parsed: true\n }\n }\n\n if(shouldEnableBot(conversation))\n context.bot_active = true\n\n if(shouldPauseBot(conversation))\n context.bot_active = false\n \n if (is3RdNode(conversation) && process.env.NODE_ENV === 'production')\n admin.alert(\"Someone is talking to the bot. Remember to train on the input!\")\n\n if(conversation.context.help_request || conversation.context.email_admin){\n admin.alert(\"Help is needed! Check the facebook page ASAP!\")\n conversation.context.email_admin = false\n }\n\n if(conversation.context.email_admin && conversation.context.email_admin === true ){\n admin.alert(\"Narrafy is struggling! Check the facebook page ASAP!\")\n conversation.context.email_admin = false\n }\n}", "title": "" }, { "docid": "eea812b2ceb88dcad3a1ea31dadb8895", "score": "0.45026284", "text": "function testUser(successReply, errorReply, intermediateReply) {\n try {\n var iam = new AWS.IAM();\n iam.getUser({}, function(err, data) {\n if (err) {\n console.log(err, err.stack)\n testToggle = false;\n successReply(\"Please provide correct credentials again. Please enter the Access Key:\");\n } else {\n var accountData = data.User.UserId;\n if (accountData == USER_ID) {\n testToggle = true;\n successReply(\"Please Provide a Repo name where you want to deploy your image:\");\n } else {\n console.log(accountData);\n console.log(USER_ID)\n testToggle = false;\n successReply(\"Please provide correct credentials again. Please enter the Access Key:\");\n }\n }\n });\n } catch (exception) {\n testToggle = false;\n successReply(\"Please provide correct credentials again. Please enter the Access Key:\");\n }\n}", "title": "" }, { "docid": "41de89c6e2cebd75b952b907009a1d0a", "score": "0.45010772", "text": "function getIntegrationsToSetup(options) {\n var defaultIntegrations = (options.defaultIntegrations && tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"](options.defaultIntegrations)) || [];\n var userIntegrations = options.integrations;\n var integrations = [];\n if (Array.isArray(userIntegrations)) {\n var userIntegrationsNames_1 = userIntegrations.map(function (i) { return i.name; });\n var pickedIntegrationsNames_1 = [];\n // Leave only unique default integrations, that were not overridden with provided user integrations\n defaultIntegrations.forEach(function (defaultIntegration) {\n if (userIntegrationsNames_1.indexOf(defaultIntegration.name) === -1 &&\n pickedIntegrationsNames_1.indexOf(defaultIntegration.name) === -1) {\n integrations.push(defaultIntegration);\n pickedIntegrationsNames_1.push(defaultIntegration.name);\n }\n });\n // Don't add same user integration twice\n userIntegrations.forEach(function (userIntegration) {\n if (pickedIntegrationsNames_1.indexOf(userIntegration.name) === -1) {\n integrations.push(userIntegration);\n pickedIntegrationsNames_1.push(userIntegration.name);\n }\n });\n }\n else if (typeof userIntegrations === 'function') {\n integrations = userIntegrations(defaultIntegrations);\n integrations = Array.isArray(integrations) ? integrations : [integrations];\n }\n else {\n integrations = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"](defaultIntegrations);\n }\n // Make sure that if present, `Debug` integration will always run last\n var integrationsNames = integrations.map(function (i) { return i.name; });\n var alwaysLastToRun = 'Debug';\n if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {\n integrations.push.apply(integrations, tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"](integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1)));\n }\n return integrations;\n}", "title": "" }, { "docid": "41de89c6e2cebd75b952b907009a1d0a", "score": "0.45010772", "text": "function getIntegrationsToSetup(options) {\n var defaultIntegrations = (options.defaultIntegrations && tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"](options.defaultIntegrations)) || [];\n var userIntegrations = options.integrations;\n var integrations = [];\n if (Array.isArray(userIntegrations)) {\n var userIntegrationsNames_1 = userIntegrations.map(function (i) { return i.name; });\n var pickedIntegrationsNames_1 = [];\n // Leave only unique default integrations, that were not overridden with provided user integrations\n defaultIntegrations.forEach(function (defaultIntegration) {\n if (userIntegrationsNames_1.indexOf(defaultIntegration.name) === -1 &&\n pickedIntegrationsNames_1.indexOf(defaultIntegration.name) === -1) {\n integrations.push(defaultIntegration);\n pickedIntegrationsNames_1.push(defaultIntegration.name);\n }\n });\n // Don't add same user integration twice\n userIntegrations.forEach(function (userIntegration) {\n if (pickedIntegrationsNames_1.indexOf(userIntegration.name) === -1) {\n integrations.push(userIntegration);\n pickedIntegrationsNames_1.push(userIntegration.name);\n }\n });\n }\n else if (typeof userIntegrations === 'function') {\n integrations = userIntegrations(defaultIntegrations);\n integrations = Array.isArray(integrations) ? integrations : [integrations];\n }\n else {\n integrations = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"](defaultIntegrations);\n }\n // Make sure that if present, `Debug` integration will always run last\n var integrationsNames = integrations.map(function (i) { return i.name; });\n var alwaysLastToRun = 'Debug';\n if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {\n integrations.push.apply(integrations, tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"](integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1)));\n }\n return integrations;\n}", "title": "" }, { "docid": "7c0ae1ca9c4e787cbd781453dcc1e546", "score": "0.44920802", "text": "enterAlter_user(ctx) {\n\t}", "title": "" }, { "docid": "fe2f013b1545b7972dfd7aedbfff83a1", "score": "0.44800815", "text": "function getAugurIdentityLiteContext() {\n\t\t\tvar augur = window['augur'];\n\t\t\tif (augur) {\n\t\t\t\tvar context = { consumer: {}, device: {} };\n\t\t\t\tvar consumer = augur.consumer || {};\n\t\t\t\tcontext['consumer']['UUID'] = consumer.UID;\n\t\t\t\tvar device = augur.device || {};\n\t\t\t\tcontext['device']['ID'] = device.ID;\n\t\t\t\tcontext['device']['isBot'] = device.isBot;\n\t\t\t\tcontext['device']['isProxied'] = device.isProxied;\n\t\t\t\tcontext['device']['isTor'] = device.isTor;\n\t\t\t\tvar fingerprint = device.fingerprint || {};\n\t\t\t\tcontext['device']['isIncognito'] = fingerprint.browserHasIncognitoEnabled;\n\n\t\t\t\treturn {\n\t\t\t\t\tschema: 'iglu:io.augur.snowplow/identity_lite/jsonschema/1-0-0',\n\t\t\t\t\tdata: context\n\t\t\t\t};\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8ed047677378d491f7a76b1d14e946a6", "score": "0.4479662", "text": "function processSingleTenant(item, activeDocsBelongingToTenant) {\n var tenant = {};\n tenant.name = item.name;\n if(lang === 'en')\n {\n tenant.description = item.description_en;\n }\n else\n {\n tenant.description = item.description_fr;\n }\n tenant.maintainers = {};\n tenant.maintainers.fn = \"Don Vo\";\n tenant.maintainers.email = \"[email protected]\";\n tenant.maintainers.url = \"https://api.canada.ca\";\n tenant.apis = [];\n var apiPromise = getAPISByTenant(item.id);\n apiPromise.then(function(payload) {\n var apisBelongingToTenant = JSON.parse(payload).services;\n apisBelongingToTenant.forEach(function(api) {\n \n var doc_localized = getAssociatedDoc(api.service.system_name + '-' + lang, activeDocsBelongingToTenant);\n if (doc_localized) {\n addDoc(api,tenant,lang,doc_localized, tenant.apis);\n }\n });\n if(lang === 'en')\n {\n pushToMasterTenant(tenants_en, tenant);\n //uploadToS3(tenant, item.apisjson_eng_s3);\n }\n else\n {\n pushToMasterTenant(tenants_fr, tenant);\n //uploadToS3(tenant, item.apisjson_fra_s3);\n }\n \n })\n }", "title": "" }, { "docid": "7c493a86b7a3c3e96cf106a1f659a47a", "score": "0.44791135", "text": "function setCustomerIntegrationObject(payload) {\r\n KDF.setVal('txt_confirm_firstname',payload['first_name']);\r\n KDF.setVal('txt_confirm_lastname',payload['last_name']);\r\n KDF.setVal('eml_confirm_email',payload['email']);\r\n KDF.setVal('tel_confirm_phone',payload['phone']);\r\n KDF.setVal('txt_confirm_addressno',payload['address_number']);\r\n KDF.setVal('txt_confirm_addressname',payload['address_name']);\r\n KDF.setVal('txt_confirm_town',payload['town']);\r\n KDF.setVal('txt_confirm_postcode',payload['postcode']);\r\n \r\n KDF.setVal('txta_confirm_fulladdress',(KDF.getVal('txt_confirm_addressno') +' '+ KDF.getVal('txt_confirm_addressname') +', '+ KDF.getVal('txt_confirm_town')+', '+KDF.getVal('txt_confirm_postcode')).substring(0, 60));\r\n}", "title": "" }, { "docid": "b9406461a1e750361943c84a2c30a01c", "score": "0.44721177", "text": "async function enableUser(ctx) {\n\n\tpromise = new Promise((resolve, reject) => {\n\t\tdb.run(`update users set authorized = 1 where userid = '${ctx.request.body.userid}'`, (err) => {\n\t\t\tif (err) reject(err);\n\t\t\tresolve('ok');\n\t\t});\n\t});\n\n\tstatus = \"\";\n\ttry {\n\t\tstatus = await promise;\n\t}\n\tcatch (e) {\n\t\tlogger.error(e);\n\t}\n\n\tif (status === \"ok\")\n\t\tctx.ok();\n\telse ctx.noContent();\n\n}", "title": "" }, { "docid": "395f305eb8f80c82fd71bdbba6cd1a75", "score": "0.4464446", "text": "function setInitialDepartmentSettingContext(context, successCallback){\n var departmentQueryObject = new Parse.Query(\"Department\");\n departmentQueryObject.equalTo(\"company\", currentUser.get(\"company\"));\n departmentQueryObject.find().then(function(departmentList){\n context.isDepartmentSetupRequired = (departmentList.length == 1 && departmentList[0].get(\"name\").toLowerCase() == companyConstants.DEFAULT_DEPARTMENT_NAME.toLowerCase());\n if(context.isDepartmentSetupRequired){\n var quizQuestionTypeQuery = new Parse.Query(\"Quiz_Question_Type\");\n quizQuestionTypeQuery.find().then(function(questionTypes){\n _.extend(context, companyUtils.getInitialDepartmentSetupData(questionTypes));\n successCallback();\n }, errorCallback);\n }\n else if(departmentList.length == 0){ // add other department to company if it does not exists\n var DepartmentModel = Parse.Object.extend(\"Department\"),\n departmentObject = new DepartmentModel();\n departmentObject.set(\"name\", companyConstants.DEFAULT_DEPARTMENT_NAME);\n departmentObject.set(\"company\", currentUser.get('company'));\n departmentObject.set(\"name_lower_case\", companyConstants.DEFAULT_DEPARTMENT_NAME.toLowerCase());\n departmentObject.set(\"user_count\", 0);\n departmentObject.save().then(function() {\n context.isDepartmentSetupRequired = true;\n var quizQuestionTypeQuery = new Parse.Query(\"Quiz_Question_Type\");\n quizQuestionTypeQuery.find().then(function (questionTypes) {\n _.extend(context, companyUtils.getInitialDepartmentSetupData(questionTypes));\n successCallback();\n }, errorCallback);\n }, errorCallback);\n }\n else\n successCallback();\n }, errorCallback);\n }", "title": "" }, { "docid": "bf160a2b19a54595ae1400030bb01a1e", "score": "0.4454891", "text": "function setPendingEmailCredentials() {\n // Pending credential stored.\n var credential = firebaseui.auth.idp.getAuthCredential({\n 'accessToken': 'facebookAccessToken',\n 'providerId': 'facebook.com'\n });\n pendingEmailCred = new firebaseui.auth.PendingEmailCredential(\n '[email protected]', credential);\n firebaseui.auth.storage.setPendingEmailCredential(\n pendingEmailCred, app.getAppId());\n}", "title": "" }, { "docid": "f154da4665bf108a89dd60c35738430c", "score": "0.4449892", "text": "handleClickActivateDependentAccount() {\n const { t } = this.props;\n const dependent = this.state.currentDependent;\n\n this.setState({\n buttonDisabled: true\n });\n client.mutate({\n mutation: activateDependentMutation,\n variables: {\n email: dependent.email,\n personCode: dependent.personCode\n }\n }).\n then(() => {\n this.setState({\n isOpenConfirmModal: false,\n currentDependent: null,\n buttonDisabled: false,\n showCommonErrorMessage: false,\n commonErrorMessage: ''\n });\n this.fetchData();\n }).\n catch((err) => {\n const errorMsg = commonFunctions.parseGraphQLErrorMessage(err, t);\n\n this.setState({\n isOpenConfirmModal: false,\n currentDependent: null,\n buttonDisabled: false,\n showCommonErrorMessage: true,\n commonErrorMessage: errorMsg\n });\n });\n }", "title": "" }, { "docid": "e6a663a3f60ad180ec6bbe346d2d3c6c", "score": "0.4446888", "text": "function ContextAPI() {\n }", "title": "" }, { "docid": "b7c3e775eef3a6eb06918d9510b592c9", "score": "0.44458425", "text": "enterAudit_user(ctx) {\n\t}", "title": "" }, { "docid": "ebe3063f448fb26d342dac8180493241", "score": "0.44437048", "text": "async authorizeAnonymously() {\n\n try{\n let authorizedUser;\n // Check if this user has already authenticated and we're here\n const client = await ServicesManager.dbClient();\n\n if (client.auth.isLoggedIn){\n authorizedUser = client.auth.authInfo;\n }\n else{\n authorizedUser = await client.auth.loginWithCredential(new AnonymousCredential()) ;\n }\n \n return authorizedUser;\n }catch(error){\n return{errorStack:'authorizeAnonymously() => '+error};\n }\n}", "title": "" }, { "docid": "3613162173eb244a74949243d7267422", "score": "0.44404024", "text": "extend(config, ctx) {\n\n if (ctx.isDev && ctx.isClient) {\n\n }\n\n }", "title": "" }, { "docid": "774264e80925202e4b73e68b30fde30e", "score": "0.44375277", "text": "renewToken () {\n let self = this\n return new Promise((resolve, reject) => {\n self.mgr.signinSilent().then(function (user) {\n if (user == null) {\n self.signIn(null)\n } else{\n return resolve(user)\n }\n }).catch(function (err) {\n console.log(err)\n return reject(err)\n });\n })\n }", "title": "" }, { "docid": "6a446550839bcefc054273af8c24f1e8", "score": "0.44374588", "text": "_onlyManager() {\n if (this.userRole !== userRoleConstants.manager) {\n throw new Error({\n api_error_identifier: 's_p_c_om_1',\n error_msg: 'Only manager can create product',\n user_id: this.userId\n });\n }\n }", "title": "" }, { "docid": "4c4f614268e4f8612af8ad3ffcd7a13a", "score": "0.44359395", "text": "function suitelet_approveFulfillOAC(request, response){\n\tnlapiLogExecution(\"Debug\", \"approve fulfill\", \"Start\");\n\tinitialize();\n\t\n\tif ( request.getMethod() == 'GET' )\t{\n\t\tif (request.getParameter('soid')!=null) {\n\t\t\ttry { \n\t\t\t\trecId = request.getParameter('soid');\n\t\t\t\tnlapiLogExecution(\"Debug\", \"Custom approve fulfill\", recId);\n\t\t\t\tvar rec = nlapiLoadRecord('salesorder', recId);\n\t\t\t\trec.setFieldValue('orderstatus', \"B\");\n\t\t\t\trec.setFieldValue('custbody_provisioned_by', nlapiGetUser());\n\t\t\t\trec.setFieldValue('custbody_provisioned_date', nlapiDateToString(new Date()));\n\t\t\t\trec.setFieldValue('custbody5', nlapiGetUser() );\n\t\t\t\trec.setFieldValue('custbody_verfied_date',nlapiDateToString(new Date()));\n\t\t\t\tnlapiSubmitRecord(rec);\n\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tvar fulfillRecord = nlapiTransformRecord('salesorder', recId,'itemfulfillment');\n\t\t\t\t\tnlapiSubmitRecord( fulfillRecord );\n\t\t\t\t}\n\t\t\t\tcatch (fe){\n\t\t\t\t\tnlapiLogExecution(\"Debug\", \"fulfillment\", fe);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tvar customerid = rec.getFieldValue('entity');\n\t\t\t\trec = nlapiLoadRecord('salesorder', recId);\n\n\t\t\t\tvar googlesaletype = '';\n\t\t\t\t\n\t\t\t\t//IF THIS IS A SALES ORDER CONVERTING AN UPSELL RECORD THERE MAY BE AUTOMATED BILLING ALREADY IN PLACE : REMOVE--->\n\t\t\t\tvar nlines = rec.getLineItemCount('item');\n\t\t\t\tfor (var i=1;i<=nlines;i++){\n\t\t\t\t\tvar item = rec.getLineItemValue('item', 'item', i);\n\t\t\t\t\tif (item==ITEM_WEBSITE_site_InvokeToUpsell){\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar custObj = nlapiLoadRecord('customer', customerid);\n\t\t\t\t\t\t\tif (custObj.getFieldValue('custentity_website_automatedbilling')=='T'){\n\t\t\t\t\t\t\t\tcustObj.setFieldValue('custentity_website_automatedbilling','F');\n\t\t\t\t\t\t\t\tnlapiSubmitRecord(custObj);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(e){\n\t\t\t\t\t\t\tnlapiLogExecution(\"error\", \"so approve update cust auto billing\", e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (item==ITEM_GOOGLE_ADS85_new || item==ITEM_GOOGLE_ADS135_new|| item==ITEM_GOOGLE_ADS200_new|| \n\t\t\t\t\t\t\titem==ITEM_GOOGLE_ADS300_new || item==ITEM_GOOGLE_ADS500_new || \n\t\t\t\t\t\t\titem==ITEM_GOOGLE_ADBASIC_new || item==ITEM_GOOGLE_ADSTANDARD_new|| \n\t\t\t\t\t\t\titem==ITEM_GOOGLE_ADEXTREME_new || item==ITEM_GOOGLE_ADADVANCED_new ){\n\t\t\t\t\t\tgooglesaletype = \"NEW\";\n\t\t\t\t\t\tnlapiLogExecution(\"Debug\", \"Google Ad Words Sale\",\"NEW SALE\");\n\t\t\t\t\t}\n\t\t\t\t\tif (item==ITEM_GOOGLE_ADS85_recur || item==ITEM_GOOGLE_ADS135_recur|| item==ITEM_GOOGLE_ADS200_recur|| \n\t\t\t\t\t\t\titem==ITEM_GOOGLE_ADS300_recur|| item==ITEM_GOOGLE_ADS500_recur || \n\t\t\t\t\t\t\titem==ITEM_GOOGLE_ADBASIC_recur || item==ITEM_GOOGLE_ADSTANDARD_recur|| \n\t\t\t\t\t\t\titem==ITEM_GOOGLE_ADEXTREME_recur || item==ITEM_GOOGLE_ADADVANCED_recur ){\n\t\t\t\t\t\tgooglesaletype = \"RENEWAL\";\n\t\t\t\t\t\tnlapiLogExecution(\"Debug\", \"Google Ad Words Sale\",\"NEW SALE\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\n\t\t\t\tif (googlesaletype=='NEW'||googlesaletype=='RENEWAL'){\n\t\t\t\t\tvar params = new Array();\n\t\t\t\t\tparams['custid'] = customerid;\n\t\t\t\t\tparams['soid'] = recId;\n\t\t\t\t\tparams['saletype'] = googlesaletype;\n\t\t\t\t\tnlapiSetRedirectURL('SUITELET', 'customscript_googleadwordssetup', 'customdeploy_googleadwordssetup', null, params);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnlapiSetRedirectURL('RECORD', 'customer', customerid, null, null);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tnlapiLogExecution(\"Debug\", \"Error\", e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dff3e65a5f813e6f7bd5f38b3ab30f58", "score": "0.44350645", "text": "startUserServicesWithBearer() {\n BroadcastingService.initialize();\n FoxdoxGeneralService.getProviderList();\n FolderService.getRootFolder();\n }", "title": "" }, { "docid": "0ccf458e50244d57c3580c12db8bd977", "score": "0.44348836", "text": "async function getDetailsOfASubscriptionTicket() {\n const subscriptionId = process.env[\"SUPPORT_SUBSCRIPTION_ID\"] || \"subid\";\n const supportTicketName = \"testticket\";\n const credential = new DefaultAzureCredential();\n const client = new MicrosoftSupport(credential, subscriptionId);\n const result = await client.supportTickets.get(supportTicketName);\n console.log(result);\n}", "title": "" }, { "docid": "6a66abd85db70051c978c3e55dffdf7a", "score": "0.4433571", "text": "function activatePersonOnline(personId,info){\n var deferred=Q.defer();\n var registrationId=null;\n if(info!==undefined&&info!==null)\n registrationId=info.registrationId;\n\n var service_person=null;\n models.InsuranceCarServicePerson.find({where: {personId: personId}}).then(function(ins) {\n if(ins!==undefined&&ins!==null)//servicePerson\n {\n if(info.registrationId!==undefined&&info.registrationId!==null)\n return models.InsuranceCarServicePerson.update({registrationId:info.registrationId},\n {where:\n {\n personId:personId\n }});\n else\n return ({re: 1});\n }\n else\n {\n if(registrationId!==undefined&&registrationId!==null)\n {\n return models.InsuranceCustomer.update({registrationId:registrationId},\n {where:{personId:personId}}\n );\n }else{\n return {re: 1};\n }\n }\n }).then(function(ins) {\n if(ins!==undefined&&ins!==null)\n deferred.resolve({re: 1, data: ''});\n else\n deferred.resolve({re: 2, data: ''});\n }).catch(function(err) {\n var str='';\n for(var field in err)\n str+=err[field];\n console.error('error=\\r\\n' + str);\n });\n\n return deferred.promise;\n}", "title": "" }, { "docid": "6ccf44982a0953a8bbb0e8899388240c", "score": "0.4426328", "text": "async authorize () {\n\t\t// user must be an admin for the \"everyone\" team for the company\n\t\tthis.company = await this.data.companies.getById(this.request.params.id.toLowerCase());\n\t\tif (!this.company || this.company.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'company' });\n\t\t}\n\t\tconst everyoneTeamId = this.company.get('everyoneTeamId');\n\t\tif (!everyoneTeamId) {\n\t\t\tthrow this.errorHandler.error('updateAuth', { reason: 'cannot update a company that has no \"everyone\" team' });\n\t\t}\n\t\t\n\t\tthis.everyoneTeam = await this.data.teams.getById(everyoneTeamId);\n\t\tif (!this.everyoneTeam || this.everyoneTeam.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'everyone team' }); // shouldn't really happen\n\t\t}\n\n\t\tif (!(this.everyoneTeam.get('adminIds') || []).includes(this.request.user.id)) {\n\t\t\tthrow this.errorHandler.error('updateAuth', { reason: 'only admins can update this company' });\n\t\t}\n\n\t\t// under unified identitiy, companies can only be updated if they are \"codestream only\",\n\t\t// here we not only check if the flag is present, but we double-check with New Relic\n\t\tconst codestreamOnly = await IsCodeStreamOnly(this.company, this);\n\t\tif (!codestreamOnly) {\n\t\t\tawait this.persist();\n\t\t\tawait this.publishCompanyNoCSOnly();\n\t\t\tthrow this.errorHandler.error('updateAuth', { reason: 'this company/org is managed by New Relic and can not be updated' });\n\t\t}\n\t}", "title": "" }, { "docid": "81ec0a9cccc65736e2dd089a8a1b955c", "score": "0.44240108", "text": "function ComApigeeAuthHandler() {\n var theHandler = this;\n this.userName = \"\";\n this.userPass = \"\";\n /**\n * Checks to see if the browser supports localStorage; returns true or false accordingly.\n */\n this.checkLocalStorage = function () {\n try {\n return \"localStorage\" in window && window.localStorage !== null\n } catch (e) {\n return false\n }\n };\n this.doesLocalStorage = this.checkLocalStorage();\n /**\n * If the browser supports localStorage and the credentials exist in LS, confirms that the user wants to keep using these, and either sets userName and userPass accordingly or calls getCredentials to query for them.\n * If the browser does not support localStorage (or the credentials do not exist), call getCredentials to query for them.\n */\n this.init = function () {\n var doSet = true;\n if (theHandler.doesLocalStorage) {\n if (localStorage.userName && localStorage.userName != null && localStorage.userName != \"null\" && localStorage.userPass && localStorage.userPass != null && localStorage.userPass != \"null\") {\n theHandler.userName = localStorage.userName;\n theHandler.userPass = localStorage.userPass;\n doSet = !(confirm('Existing Apigee credentials (\"' + theHandler.userName + '\") detected.\\nUse these?'))\n }\n }\n if (doSet) {\n this.getCredentials()\n }\n };\n /**\n * Prompts for username and password.\n * Passes prompted data into setCredentials.\n */\n this.getCredentials = function () {\n theHandler.userName = prompt(\"Log into your Apigee Source account.\\nEmail:\", theHandler.userName);\n theHandler.userPass = prompt(\"Password:\", theHandler.userPass);\n this.setCredentials()\n };\n /**\n * If the browser supports localStorage, store the prompted data.\n */\n this.setCredentials = function () {\n if (theHandler.doesLocalStorage && theHandler.userName != null && theHandler.userName != \"null\" && theHandler.userPass != null && theHandler.userPass != \"null\") {\n localStorage.userName = theHandler.userName;\n localStorage.userPass = theHandler.userPass\n }\n };\n this.init()\n}", "title": "" }, { "docid": "0701dd581fe3d13690dd91e4c3f02d4c", "score": "0.4417845", "text": "constructor() { \n \n IntegrationId.initialize(this);\n }", "title": "" }, { "docid": "980a5ca9762f3dc296a2adc446758c14", "score": "0.44122446", "text": "function initUserCurrentEnterpriseCache() {\n var userId = $rootScope.currentUser && $rootScope.currentUser.settings.id;\n var cachedEnterprise = userId && enterpriseCache.get('currentEnterprise' + userId);\n if (cachedEnterprise) {\n // if the user has cached preferences, update the cache based on them\n return updateUserCurrentEnterpriseCache(cachedEnterprise);\n } else {\n // otherwise update the cache with a default current enterprise ('personal')\n return updateUserCurrentEnterpriseCache(DEFAULT_CACHED_ENTERPRISE_ID);\n }\n }", "title": "" }, { "docid": "c8f5731a816d520a07b0f6bedf5d810d", "score": "0.44056132", "text": "async function updateAnAccount() {\n let userService = new UserService(process.env.MICRO_API_TOKEN);\n let rsp = await userService.update({\n email: \"[email protected]\",\n id: \"usrid-1\",\n });\n console.log(rsp);\n}", "title": "" }, { "docid": "30e961647708ba4b40bdc9dd3d1d8132", "score": "0.44006863", "text": "function doUpdate(request) {\n\tvar db = new TenantDatabase();\n\t//Find the issue from database\n\tvar issueDetails = db.execute(\"SELECT * FROM ib_issues WHERE id = ?\",[DbParameter.number(parseInt(request.issueid))]);\n\t\n\t// To acquire the account context.\n\tvar accountContext = Contexts.getAccountContext();\n\t// To acquire the user code.\n\tvar userCd = accountContext.userCd;\n\t//update emission email address\n\tvar updateObject = {\n\t\tproject_id: parseInt(Client.get('project_id_session_value')),\n\t\ttracker_id: parseInt(request.tracker_id),\n\t\tsubject: new String(request.subject),\n\t\tstatus_id: parseInt(request.status_id),\n\t\tpriority_id: parseInt(request.priority_id),\n\t\tauthor_id: new String(userCd),\n\t\tprogress: parseInt(request.progress)\n\t};\n\tif(request.description!=\"\"){\n\t\tupdateObject.description = new String(request.description);\n\t}\n\telse{\n\t\tupdateObject.description = null;\n\t}\n\tif(request.parent_id!=\"\"){\n\t\tupdateObject.parent_id = parseInt(request.parent_id);\n\t}\n\telse{\n\t\tupdateObject.parent_id = null;\n\t}\n\tif(request.assigned_to_id!=\"\"){\n\t\tupdateObject.assigned_to_id =new String(request.assigned_to_id);\n\t}\n\telse{\n\t\tupdateObject.assigned_to_id = null;\n\t}\n\tif(request.start_date!=\"\"){\n\t\tupdateObject.start_date = new Date(request.start_date);\n\t}\n\telse{\n\t\tupdateObject.start_date = null;\n\t}\n\tif(request.due_date!=\"\"){\n\t\tupdateObject.due_date = new Date(request.due_date);\n\t}\n\telse{\n\t\tupdateObject.due_date = null;\n\t}\n\tif(request.estimated_hours!=\"\"){\n\t\tupdateObject.estimated_hours = new String(request.estimated_hours);\n\t}\n\telse{\n\t\tupdateObject.estimated_hours = null;\n\t}\n\t\n\tif(request.is_private_issue==1){\n\t\tupdateObject.is_private = 1;\n\t}\n\telse{\n\t\tupdateObject.is_private = 0;\n\t}\n\t\n\tvar imgLog = \"\";\n\t// insert issue to database\n\tTransaction.begin(function() {\n\t\tvar db = new TenantDatabase();\n\t\tvar result = db.update('ib_issues',\n\t\tupdateObject,\n\t\t'id = ? ',\n\t\t[\n\t\t\tDbParameter.number(parseInt(request.issueid))\n\t\t]);\n\t\tif(result.error) {\n\t\t\tTransaction.rollback();\n\t\t\tTransfer.toErrorPage({\n\t\t\t\ttitle: 'エラー',\n\t\t\t\tmessage: '登録処理時にエラーが発生しました。',\n\t\t\t\tdetail: result.errorMessage\n\t\t\t});\n\t\t}\n\t\t\n\t\tvar imgArr = Client.get('imgArrSess');\n\t\tif(imgArr){\n\t\t\tfor(var i=0; i<imgArr.length; i++){\n\t\t\t\tvar imgCap = new String(imgArr[i]);\n\t\t\t\tvar imgCapGet = imgCap.split(\"_\");\n\t\t\t\tvar imgCaption = removeA(imgCapGet, imgCapGet[0]).join('_');\n\t\t\t\tvar insertFiles = {\n\t\t\t\t\tissue_id: parseInt(request.issueid),\n\t\t\t\t\tfilename: new String(imgArr[i]),\n\t\t\t\t\tcaption: new String(imgCaption),\n\t\t\t\t\tcreated_by: new String(userCd)\n\t\t\t\t};\n\t\t\t\tvar result = db.insert('ib_issues_files', insertFiles);\n\t\t\t\tvar lastID = db.select(\"SELECT currval(pg_get_serial_sequence('ib_issues_files','id')) as last_insert_id\");\n\t\t\t\tvar last_insert_id = lastID.data[0].last_insert_id;\n\t\t\t\timgLog += '<li><strong>'+MessageManager.getMessage(\"FILE.ID\")+'</strong> <a href=\"ib_issues/details/download/'+last_insert_id+'\">'+imgCaption+'</a> added </li>';\n\t\t\t}\n\t\t}\n\t\tClient.remove('imgArrSess');\n\t});\n\t\n\tvar update_status = 0;\n\tvar is_description_change = 0;\n\tvar change_log = '<ul class=\"details\">';\n\tif(issueDetails.data[0].tracker_id!=request.tracker_id){\n\t\tupdate_status = 1;\n\t\tvar oldTrackerArray = db.select(\"SELECT name FROM ib_trackers WHERE id ='\"+parseInt(issueDetails.data[0].tracker_id)+\"'\");\n\t\tvar newTrackerArray = db.select(\"SELECT name FROM ib_trackers WHERE id ='\"+parseInt(request.tracker_id)+\"'\");\t\n\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"TRACKER.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>'+oldTrackerArray.data[0].name+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>'+newTrackerArray.data[0].name+'</i></li>';\n\t}\n\tif(issueDetails.data[0].subject!=request.subject){\n\t\tupdate_status = 1;\n\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"SUBJECT.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>'+issueDetails.data[0].subject+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>'+request.subject+'</i></li>';\n\t}\n\tif(issueDetails.data[0].description!=request.description){\n\t\t//update_status = 1;\n\t\tis_description_change = 1;\n\t\t//change_log += '<li><strong>'+MessageManager.getMessage(\"DESCRIPTION.ID\")+'</strong> updated </li>';\n\t}\n\tif(issueDetails.data[0].status_id!=request.status_id){\n\t\tupdate_status = 1;\n\t\tvar oldStatusArray = db.select(\"SELECT name FROM ib_issue_statuses WHERE id = '\"+parseInt(issueDetails.data[0].status_id)+\"'\");\n\t\tvar newStatusArray = db.select(\"SELECT name FROM ib_issue_statuses WHERE id = '\"+parseInt(request.tracker_id)+\"'\");\n\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"STATUS.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>'+oldStatusArray.data[0].name+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>'+newStatusArray.data[0].name+'</i></li>';\n\t}\n\tif(issueDetails.data[0].parent_id!=request.parent_id){\n\t\tif(!issueDetails.data[0].parent_id && request.parent_id==''){\n\t\t\t//no action\n\t\t}\n\t\telse if(issueDetails.data[0].parent_id && request.parent_id==''){\n\t\t\tupdate_status = 1;\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"PARENT.TASK.ID\")+'</strong> '+MessageManager.getMessage(\"DELETED.ID\")+' (<del><i>#'+issueDetails.data[0].parent_id+'</i></del>)</li>';\n\t\t}\n\t\telse if(!issueDetails.data[0].parent_id && request.parent_id!=''){\n\t\t\tupdate_status = 1;\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"PARENT.TASK.ID\")+'</strong> '+MessageManager.getMessage(\"SET.ID\")+' '+MessageManager.getMessage(\"TO.ID\")+' <i>#'+request.parent_id+'</i></li>';\n\t\t}\n\t\telse{\n\t\t\tupdate_status = 1;\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"PARENT.TASK.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>#'+issueDetails.data[0].parent_id+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>#'+request.parent_id+'</i></li>';\n\t\t}\n\t}\n\tif(issueDetails.data[0].priority_id!=request.priority_id){\n\t\tupdate_status = 1;\n\t\tvar oldPriorityArray = db.select(\"SELECT name FROM ib_enumerations WHERE id = '\"+parseInt(issueDetails.data[0].priority_id)+\"'\");\n\t\tvar newPriorityArray = db.select(\"SELECT name FROM ib_enumerations WHERE id = '\"+parseInt(request.priority_id)+\"'\");\n\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"PRIORITY.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>'+oldPriorityArray.data[0].name+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>'+newPriorityArray.data[0].name+'</i></li>';\n\t}\n\tif(issueDetails.data[0].assigned_to_id!=request.assigned_to_id){\n\t\tif(!issueDetails.data[0].assigned_to_id && request.assigned_to_id==''){\n\t\t\t//no action\n\t\t}\n\t\telse if(issueDetails.data[0].assigned_to_id && request.assigned_to_id==''){\n\t\t\tupdate_status = 1;\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"ASSIGN.TO.ID\")+'</strong> '+MessageManager.getMessage(\"DELETED.ID\")+' (<del><i>'+issueDetails.data[0].assigned_to_id+'</i></del>)</li>';\n\t\t}\n\t\telse if(!issueDetails.data[0].assigned_to_id && request.assigned_to_id!=''){\n\t\t\tupdate_status = 1;\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"ASSIGN.TO.ID\")+'</strong> '+MessageManager.getMessage(\"SET.ID\")+' '+MessageManager.getMessage(\"TO.ID\")+' <i>'+request.assigned_to_id+'</i></li>';\n\t\t}\n\t\telse{\n\t\t\tupdate_status = 1;\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"ASSIGN.TO.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>'+issueDetails.data[0].assigned_to_id+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>'+request.assigned_to_id+'</i></li>';\n\t\t}\n\t}\n\tif(issueDetails.data[0].start_date!=request.start_date){\n\t\tif(!issueDetails.data[0].start_date && request.start_date==''){\n\t\t\t//no action\n\t\t}\n\t\telse if(issueDetails.data[0].start_date && request.start_date==''){\n\t\t\tupdate_status = 1;\n\t\t\tvar d = new Date(issueDetails.data[0].start_date);\n\t\t\tvar start_date_format = (((d.getMonth() + 1)<10)?'0'+(d.getMonth() + 1):(d.getMonth() + 1)) + '/' + ((d.getDate()<10)?'0'+(d.getDate()):(d.getDate())) + '/' + d.getFullYear();\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"START.DATE.ID\")+'</strong> '+MessageManager.getMessage(\"DELETED.ID\")+' (<del><i>'+start_date_format+'</i></del>)</li>';\n\t\t}\n\t\telse if(!issueDetails.data[0].start_date && request.start_date!=''){\n\t\t\tupdate_status = 1;\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"START.DATE.ID\")+'</strong> '+MessageManager.getMessage(\"SET.ID\")+' '+MessageManager.getMessage(\"TO.ID\")+' <i>'+request.due_date+'</i></li>';\n\t\t}\n\t\telse{\n\t\t\tvar d = new Date(issueDetails.data[0].start_date);\n\t\t\tvar start_date_format = (((d.getMonth() + 1)<10)?'0'+(d.getMonth() + 1):(d.getMonth() + 1)) + '/' + ((d.getDate()<10)?'0'+(d.getDate()):(d.getDate())) + '/' + d.getFullYear();\n\t\t\tif(start_date_format!=request.start_date){\n\t\t\t\tupdate_status = 1;\n\t\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"START.DATE.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>'+start_date_format+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>'+request.start_date+'</i></li>';\n\t\t\t}\n\t\t}\n\t}\n\tif(issueDetails.data[0].due_date!=request.due_date){\n\t\tif(!issueDetails.data[0].due_date && request.due_date==''){\n\t\t\t//no action\t\t\t\n\t\t}\n\t\telse if(issueDetails.data[0].due_date && request.due_date==''){\n\t\t\tupdate_status = 1;\n\t\t\tvar d = new Date(issueDetails.data[0].due_date);\n\t\t\tvar due_date_format = (((d.getMonth() + 1)<10)?'0'+(d.getMonth() + 1):(d.getMonth() + 1)) + '/' + ((d.getDate()<10)?'0'+(d.getDate()):(d.getDate())) + '/' + d.getFullYear();\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"DUE.DATE.ID\")+'</strong> '+MessageManager.getMessage(\"DELETED.ID\")+' (<del><i>'+due_date_format+'</i></del>)</li>';\n\t\t}\n\t\telse if(!issueDetails.data[0].due_date && request.due_date!=''){\n\t\t\tupdate_status = 1;\n\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"DUE.DATE.ID\")+'</strong> '+MessageManager.getMessage(\"SET.ID\")+' '+MessageManager.getMessage(\"TO.ID\")+' <i>'+request.due_date+'</i></li>';\n\t\t}\n\t\telse{\n\t\t\tvar d = new Date(issueDetails.data[0].due_date);\n\t\t\tvar due_date_format = (((d.getMonth() + 1)<10)?'0'+(d.getMonth() + 1):(d.getMonth() + 1)) + '/' + ((d.getDate()<10)?'0'+(d.getDate()):(d.getDate())) + '/' + d.getFullYear();\n\t\t\tif(due_date_format!=request.due_date){\n\t\t\t\tupdate_status = 1;\n\t\t\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"DUE.DATE.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>'+due_date_format+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>'+request.due_date+'</i></li>';\n\t\t\t}\n\t\t}\n\t}\n\tif(issueDetails.data[0].estimated_hours!=request.estimated_hours){\n\t\tupdate_status = 1;\n\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"ESTIMATED.TIME.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>'+issueDetails.data[0].estimated_hours+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>'+request.estimated_hours+'</i></li>';\n\t}\n\tif(issueDetails.data[0].progress!=request.progress){\n\t\tupdate_status = 1;\n\t\tchange_log += '<li><strong>'+MessageManager.getMessage(\"PROGRESS.ID\")+'</strong> '+MessageManager.getMessage(\"CHANGED.ID\")+' '+MessageManager.getMessage(\"FROM.ID\")+' <i>'+issueDetails.data[0].progress+'</i> '+MessageManager.getMessage(\"TO.ID\")+' <i>'+request.progress+'</i></li>';\n\t}\n\tif(imgLog!=\"\"){\n\t\tupdate_status = 1;\n\t\tchange_log += imgLog;\n\t}\n\tchange_log += '</ul>';\n\tif(update_status == 1 || is_description_change==1){\n\t\tvar insertChangeObject = {\n\t\t\tupdated_by: new String(userCd),\n\t\t\tissue_id: parseInt(request.issueid),\n\t\t\tnotes: new String(request.notes)\n\t\t}\n\t\tif(update_status == 1){\n\t\t\tinsertChangeObject.change_list = new String(change_log);\n\t\t}\n\t\tif(is_description_change == 1){\n\t\t\tinsertChangeObject.is_description_change = 1;\n\t\t\tinsertChangeObject.description = new String(issueDetails.data[0].description);\n\t\t}\n\t\telse{\n\t\t\tinsertChangeObject.is_description_change = 0;\n\t\t}\n\t\tif(request.notes!=''){\n\t\t\tinsertChangeObject.notes = request.notes;\n\t\t}\n\t\tif(request.is_private==1){\n\t\t\tinsertChangeObject.is_private = 1;\n\t\t}\n\t\telse{\n\t\t\tinsertChangeObject.is_private = 0;\n\t\t}\n\t\tTransaction.begin(function() {\n\t\t\tvar db = new TenantDatabase();\n\t\t\tvar result = db.insert('ib_issues_changes', insertChangeObject);\n\t\t\tif(result.error) {\n\t\t\t\tTransaction.rollback();\n\t\t\t\tTransfer.toErrorPage({\n\t\t\t\t\ttitle: 'エラー',\n\t\t\t\t\tmessage: '登録処理時にエラーが発生しました。',\n\t\t\t\t\tdetail: result.errorMessage\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\tif(request.hours!=''){\n\t\tvar insertCommentObject = {\n\t\t\tproject_id: parseInt(Client.get('project_id_session_value')),\n\t\t\tuser_cd: new String(userCd),\n\t\t\tissue_id: parseInt(request.issueid),\n\t\t\tcomments: new String(request.comments),\n\t\t\tactivity_id: parseInt(request.activity_id),\n\t\t\tspent_on: new Date(),\n\t\t\ttyear: parseInt(new Date().getFullYear()),\n\t\t\ttmonth: parseInt(new Date().getMonth()+1),\n\t\t\ttweek: parseInt(request.tweek),\n\t\t\thours: new String(request.hours)\n\t\t};\n\t\t\n\t\tTransaction.begin(function() {\n\t\t\tvar db = new TenantDatabase();\n\t\t\tvar result = db.insert('ib_time_entries', insertCommentObject);\n\t\t\tif(result.error) {\n\t\t\t\tTransaction.rollback();\n\t\t\t\tTransfer.toErrorPage({\n\t\t\t\t\ttitle: 'エラー',\n\t\t\t\t\tmessage: '登録処理時にエラーが発生しました。',\n\t\t\t\t\tdetail: result.errorMessage\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\t\n\tClient.set('ib_issues/edit' + '-status', {error : false, success : true, message: '', issue_id: request.issueid});\n}", "title": "" }, { "docid": "538e879aa2723542804f19643b1c0d09", "score": "0.4397463", "text": "function updatePhoneOwner(device_name, user_id) {\r\n // Make sure the CUCM files exist\r\n if (!verifyWSDL()) {\r\n console.log('Exiting due to missing AXL Files!');\r\n process.exit(1);\r\n } \r\n\r\n var sql = \"update device \" +\r\n \"set fkenduser = (select pkid from enduser where userid = '\" + user_id + \"') \" +\r\n \"where name = '\" + device_name + \"';\"\r\n\r\n // Request Arguments\r\n var args = {\r\n sql: sql,\r\n sequence: \"1\"\r\n };\r\n\r\n // Create the client\r\n return new Promise(function(resolve, reject) {\r\n soap.createClient(wsdl_uri, axl_options, function (err, client) {\r\n if (!err) {\r\n client.setSecurity(new soap.ClientSSLSecurity(undefined, undefined, {rejectUnauthorized: false}));\r\n client.executeSQLUpdate(args, function (err, result) {\r\n if (err) {\r\n console.log('updatePhoneOwner->soap api error is: ' + err);\r\n console.log('updatePhoneOwner->last request: ' + client.lastRequest);\r\n console.log('updatePhoneOwner->response is: ', result);\r\n process.exit(1);\r\n }\r\n console.log('updatePhoneOwner->result is ', JSON.stringify(result));\r\n\r\n var s = JSON.stringify(result);\r\n var j = JSON.parse(s);\r\n resolve(j);\r\n }, null, axl_headers); // updatePhoneOwner\r\n }\r\n else {\r\n console.log('updatePhoneOwner->Error in createClient: ', err);\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "1d8221c418cac55eb412569fd670e32f", "score": "0.43969557", "text": "function initializeUserAuthentication(user,accountId){\n userInfo.accessToken =user.token;\n userInfo.sessionStable=!!user.token;\n userInfo.user=user;\n userInfo.accountId=accountId;\n\n CookieUtil.set(accessTokenCookie, userInfo.accessToken);\n $rootScope.$broadcast('LoggedUserContext.Authenticated');\n\n return waitForSessionToStabilize()\n .then(function(){\n userInfo.sessionStable = true;\n $rootScope.$broadcast('LoggedUserContext.Change');\n });\n }", "title": "" }, { "docid": "03e2d3c335081e71a51bbacc49194fa2", "score": "0.43966407", "text": "createUser({sessionId, context, text, entities}) {\n let senderID = sessions[sessionId].fbid;\n\n // if user sent bad info...\n if(!entities.contact || entities.contact.length < 1) {\n sendTextMessage(senderID, 'Not sure I caught that. Can you try something else?');\n return context;\n }\n\n //info is good. extract the name\n let userName = entities.contact[0].value;\n\n //parse through to get first and last name\n let firstName = userName.split(' ')[0];\n let lastName = userName.split(' ').slice(1).join(' ');\n \n //create the userID\n let userIDfirst = stringPad(firstName, 4, '*').toLowerCase();\n let userIDlast = stringPad(lastName, 4, '*').toLowerCase();\n\n //TODO lookup other users with this user name to generate another userID\n // for now, just use 0001\n let userID = userIDfirst + '_' + userIDlast + '_0001';\n firstName = firstName.charAt(0).toUpperCase() + firstName.slice(1);\n lastName = lastName.charAt(0).toUpperCase() + lastName.slice(1);\n \n let newUser = {\n userID: userID,\n userTpye: \"student\",\n messengerID: senderID,\n firstname: firstName,\n lastname: lastName,\n school: \"All University\"\n }\n\n let index = algoClient.initIndex('test_USERS');\n index.addObject(newUser, (err, content) => {\n if(err) {\n console.log('createUser :: Algolia search error');\n } else {\n console.log('new user added!!');\n }\n });\n\n context.name = firstName;\n context.userProfile = newUser;\n\n //remove new user context\n !context.newUser || delete context.newUser;\n \n return context;\n }", "title": "" }, { "docid": "6032d7a1bec8d8ff54467e2416ac1cc9", "score": "0.4392764", "text": "function getAdminUser(req){\n return new promise(function(fulfill,reject){\n if(typeof req.userId === 'undefined' && config.bypassUserId === true) {\n/*\n var headers = {\n \"Content-Type\": \"application/json\"\n };\n var optionsget = {\n host : 'localhost',\n port : 8000,\n path: '/api/authentication/getAdminUser/'+req.ownerId,\n method: 'GET',\n -- headers: headers\n };\n restservices.getCall(optionsget).then(function (adminUserId) {\n req.userId = adminUserId._id;\n req.IsBypassed = true;\n return fulfill(req);\n }).catch(function onReject(err) {\n return fulfill(null);\n }).catch(function(error){\n return fulfill(null);\n });\n */\n req.userId = SYSTEM_USER_ID;\n req.IsBypassed = true;\n return fulfill(req);\n }\n else{\n req.IsBypassed = false;\n return fulfill(req);\n }\n });\n}", "title": "" }, { "docid": "0bb4e5f29fd3fa40b205d56d6d1dafce", "score": "0.43909037", "text": "function retrieveUserContext() {\n $scope.loadingUserContext = true;\n\n console.log(\"retrieving user context.\");\n\n AccountService.findUserContext()\n .success(function (data) {\n\n console.log(\"got user context:\")\n console.log(data);\n\n // This is in helpers.js\n initializeUserContext(data, $rootScope, AccountService, HabitsService, GoalService, AudioService, PayService, NotificationService, Environment);\n\n $scope.loadingUserContext = false;\n })\n .error(function(data, status, headers, config) { \n // Handle the error\n console.log(\"error loading user context\");\n\n $scope.loadingUserContext = false;\n\n });\n }", "title": "" }, { "docid": "489b7eef33c5004d41fe54f435aab4ca", "score": "0.43886667", "text": "function acquireAnAccessTokenAndCallTheProtectedService() {\n showProgress(\"acquiring an access token for the Web API\");\n authenticationContext.acquireToken(webApiConfig.resourceId, function (errorDesc, token, error) {\n if (error) {\n if (config.popUp) {\n authenticationContext.acquireTokenPopup(webApiConfig.resourceId, null, null, onAccessToken);\n }\n else {\n authenticationContext.acquireTokenRedirect(webApiConfig.resourceId, null, null);\n }\n }\n else {\n onAccessToken(errorDesc, token, error);\n }\n });\n}", "title": "" }, { "docid": "7fd52019d652fc8be4c39ab8253e6ea6", "score": "0.4387547", "text": "createContext() {\n\t\treturn new EdTechContext();\n\t}", "title": "" }, { "docid": "8e8f93906e0a5ca9aa86101137e08831", "score": "0.43810546", "text": "updateContext() {\n if (_.get(this, 'config.userContext.prev.size') > 0) {\n this.updateContextPrev();\n }\n }", "title": "" }, { "docid": "280528c09d28e098932f5949ebf7f502", "score": "0.43793324", "text": "function getEnrollmentCustomerInformation(Id) {\n \n var url = '/api/CustomerInformation/';\n if (Id != '' && Id != null && Id != '00000000-0000-0000-0000-000000000000') {\n ajaxHelper(url + '?id=' + Id, 'GET',null,false).done(function (data) {\n $('#sp_Head').html(data.CompanyName);\n $('#IsVerified').val(data.IsVerified);\n $('#ismsouser').val(data.IsMSOUser);\n $('#hdnEFINStatus').val(data.EFINStatus);\n // fnVerifiedLinksStatus();\n $('#ActiveMyAccountStatus').val(data.IsActivationCompleted);\n $('#uTaxNotCollectingSBFee').val(data.IsNotCollectingFee);\n\n $('#SalesforceOpportunityID').val(data.SalesforceOpportunityID);\n\n if (data.BaseEntityId == $('#BaseEntity_AESS').val()) {\n\n //Office Config\n $('#divSubSiteOfficeConfigForm input').attr('disabled', 'disabled');\n $('#divSubSiteOfficeConfigForm select').attr('disabled', 'disabled');\n $('#divSubSiteOfficeConfigForm textarea').attr('disabled', 'disabled');\n\n $('#divSubSiteOfficeConfigForm a')\n .attr('disabled', 'disabled')\n .css('pointer-events', 'none');\n\n\n //Fee Setup & Config\n $('#SubOfficeSVBFee input,#SubOfficeTranFee input').attr('disabled', 'disabled');\n $('#SubOfficeSVBFee select,#SubOfficeTranFee select').attr('disabled', 'disabled');\n $('#SubOfficeSVBFee textarea,#SubOfficeTranFee textarea').attr('disabled', 'disabled');\n\n $('#SubOfficeSVBFee a, #SubOfficeTranFee a,#spanSvbTansSave a')\n .attr('disabled', 'disabled')\n .css('pointer-events', 'none');\n\n\n\n\n //Dashboard\n if ($('#entitydisplayid').val() != $('#Entity_uTax').val()) {\n //$('#divSubSiteOfficeDashboardForm a')\n // .attr('disabled', 'disabled')\n // .css('pointer-events', 'none');\n }\n\n\n //Activate My Account\n $('#divSubSiteOfficeActivate a.btn-Edit-SubSiteOffice-Active')\n .attr('disabled', 'disabled')\n .css('pointer-events', 'none');\n\n\n //Customer Notes\n $('#divSubSiteOfficeCustNotesForm input').attr('disabled', 'disabled');\n $('#divSubSiteOfficeCustNotesForm textarea').attr('disabled', 'disabled');\n\n $('#divSubSiteOfficeCustNotesForm a')\n .attr('disabled', 'disabled')\n .css('pointer-events', 'none');\n\n\n\n //\n // $('#lblIsSubSiteEFINRB').remove();\n // $('#lblIsSubSiteEFIN').remove();\n\n //Office Config\n $('#divEnrollOfficeConfigForm input').attr('disabled', 'disabled');\n $('#divEnrollOfficeConfigForm select').attr('disabled', 'disabled');\n $('#divEnrollOfficeConfigForm textarea').attr('disabled', 'disabled');\n\n $('#divEnrollOfficeConfigForm a')\n .attr('disabled', 'disabled')\n .css('pointer-events', 'none');\n\n\n //Affliate Config\n $('#divEnrollAffliateForm input').attr('disabled', 'disabled');\n $('#divEnrollAffliateForm select').attr('disabled', 'disabled');\n $('#divEnrollAffliateForm textarea').attr('disabled', 'disabled');\n\n $('#divEnrollAffliateForm a')\n .attr('disabled', 'disabled')\n .css('pointer-events', 'none');\n\n\n //Dashboard\n $('#divEnrollOfficeInfoForm a')\n .attr('disabled', 'disabled')\n .css('pointer-events', 'none');\n\n\n //Enroll Summary Form\n $('#divEnrollSummaryForm a.btn-edit-enroll-disabled')\n .attr('disabled', 'disabled')\n .css('pointer-events', 'none');\n\n\n ////Fee Setup Config\n //$('#divEnrollFeeSetupConfigForm input').attr('disabled', 'disabled');\n //$('#divEnrollFeeSetupConfigForm textarea').attr('disabled', 'disabled');\n //$('#divEnrollFeeSetupConfigForm select').attr('disabled', 'disabled');\n\n //$('#divEnrollFeeSetupConfigForm a')\n // .attr('disabled', 'disabled')\n // .css('pointer-events', 'none');\n }\n\n \n $('#ActiveMyAccountStatus').val('0');\n if (data.IsActivationCompleted == '1' || data.IsActivationCompleted == 1) {\n $('#ActiveMyAccountStatus').val('1');\n }\n\n //if ($('#ActiveMyAccountStatus').val() == '1' || $('#ActiveMyAccountStatus').val() == 1) {\n // var sitemapid = $('#formid').attr('sitemapid');\n // if (sitemapid == \"60025459-7568-4a77-b152-f81904aaaa63\") {\n // $('#divSVBFeeReimNoteActive').show();\n // }\n //}\n\n });\n }\n}", "title": "" }, { "docid": "8a83d7420810acf1c09cc25a19367a00", "score": "0.43792093", "text": "function getUserID() {\n var intermediatMessage = configureAws();\n return intermediatMessage;\n var sts = new AWS.STS();\n var new_user = sts.getCallerIdentity({}, function(err, data) {\n if (err) {\n console.log(\"Error\", err);\n return null;\n } else {\n var accountData = JSON.stringify(data.Account);\n return accountData;\n }\n });\n}", "title": "" }, { "docid": "225cd4ff5c14cdadc7f20fba57d90fb5", "score": "0.4378283", "text": "consume (userId, ingredientIds) {\n var currentUser = this.validInventory(userId, ingredientIds);\n // strongly consistent put.\n this._datastore.putUser(currentUser);\n return currentUser;\n }", "title": "" }, { "docid": "68205849b88f832762e7f5860fa819b0", "score": "0.43730563", "text": "async function tasksUpdateWithOpaqueCustomCredentials() {\n const subscriptionId =\n process.env[\"CONTAINERREGISTRY_SUBSCRIPTION_ID\"] || \"4385cf00-2d3a-425a-832f-f4285b1c9dce\";\n const resourceGroupName = process.env[\"CONTAINERREGISTRY_RESOURCE_GROUP\"] || \"myResourceGroup\";\n const registryName = \"myRegistry\";\n const taskName = \"myTask\";\n const taskUpdateParameters = {\n agentConfiguration: { cpu: 3 },\n credentials: {\n customRegistries: {\n myregistryAzurecrIo: {\n password: { type: \"Opaque\", value: \"***\" },\n userName: { type: \"Opaque\", value: \"username\" },\n },\n },\n },\n logTemplate: undefined,\n status: \"Enabled\",\n step: {\n type: \"Docker\",\n dockerFilePath: \"src/DockerFile\",\n imageNames: [\"azurerest:testtag1\"],\n },\n tags: { testkey: \"value\" },\n trigger: {\n sourceTriggers: [\n {\n name: \"mySourceTrigger\",\n sourceRepository: {\n sourceControlAuthProperties: { token: \"xxxxx\", tokenType: \"PAT\" },\n },\n sourceTriggerEvents: [\"commit\"],\n },\n ],\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new ContainerRegistryManagementClient(credential, subscriptionId);\n const result = await client.tasks.beginUpdateAndWait(\n resourceGroupName,\n registryName,\n taskName,\n taskUpdateParameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "db767c4a2b449b4380959eae40c6954e", "score": "0.437242", "text": "function test_edit_bad_subscription() {}", "title": "" }, { "docid": "80a91e19d47788b5b90ea07408ac7982", "score": "0.43692064", "text": "static addUserEx(userName,password,options=null,requestOptions=null,callback=null){if(!userName){const errorDetail={code:TcHmi.Errors.E_PARAMETER_INVALID,message:TcHmi.Errors[TcHmi.Errors.E_PARAMETER_INVALID],reason:\"Invalid parameter userName given\",domain:\"TcHmi.Server.UserManagement\"};return TcHmi.Callback.callSafeEx(callback,null,{error:errorDetail.code,details:errorDetail}),errorDetail}let writeValue={domain:TcHmi.System.Services.accessManager.getCurrentUserConfig().defaultAuthExtension,userName:userName,parameters:{password:password||void 0},settings:{}};options&&(\"string\"==typeof options.domain&&options.domain.length>0&&(writeValue.domain=options.domain),\"boolean\"==typeof options.enabled&&(writeValue.parameters.enabled=options.enabled),(\"string\"==typeof options.locale&&options.locale.length>0||null===options.locale)&&(writeValue.settings.locale=options.locale),(\"string\"==typeof options.timeFormatLocale&&options.timeFormatLocale.length>0||null===options.timeFormatLocale)&&(writeValue.settings.timeFormatLocale=options.timeFormatLocale),(\"string\"==typeof options.timeZone&&options.timeZone.length>0||null===options.timeZone)&&(writeValue.settings.timeZone=options.timeZone),\"string\"==typeof options.autoLogout&&options.autoLogout.length>0&&(writeValue.settings.autoLogoff=options.autoLogout),Array.isArray(options.groups)&&(writeValue.settings.groups=options.groups));const request={requestType:\"ReadWrite\",commands:[{commandOptions:[\"SendErrorMessage\",\"SendWriteValue\"],symbol:\"AddOrChangeUser\",writeValue:writeValue}]};if(null===Server.requestEx(request,requestOptions,Server.__handleServerResponse({error:data=>{if(data.error!==TcHmi.Errors.NONE)TcHmi.Callback.callSafeEx(callback,null,{error:data.error,details:data.details});else{let res=data.results[0];TcHmi.Callback.callSafeEx(callback,null,{error:res.error,details:res.details})}},success:data=>{TcHmi.Callback.callSafeEx(callback,null,{error:TcHmi.Errors.NONE})}}))){const errorDetail={code:TcHmi.Errors.ERROR,message:TcHmi.Errors[TcHmi.Errors.ERROR],reason:\"Request could not be sent.\",domain:\"TcHmi.Server.UserManagement\"};return TcHmi.Callback.callSafeEx(callback,null,{error:errorDetail.code,details:errorDetail}),errorDetail}return{code:TcHmi.Errors.NONE}}", "title": "" }, { "docid": "5f93a242ad55e8a199344cde8002e166", "score": "0.43691576", "text": "async inviteUserToProject(projectId, userId, additionalOpts = {}) {\n const response = await this.client.post(`v1/projects/${projectId}/invites`, {\n json: {\n userId\n },\n ...additionalOpts\n }).json();\n response.projectPermission = defaultProjectInvitePermission;\n return response;\n }", "title": "" }, { "docid": "acd79c1f043bc812d973c0fb8a082fdd", "score": "0.43651265", "text": "assignUserToVersions(userId, requestData) {\n const restClient = this;\n return new Promise((resolve, reject) => {\n if (!restClient.api) {\n return reject(\"restClient not initialized! make sure to call initialize before using API\");\n }\n restClient.api[\"project-version-of-auth-entity-controller\"].assignProjectVersionOfAuthEntity({\n parentId: userId,\n resource: requestData\n }, getClientAuthTokenObj(restClient.token)).then((resp) => {\n resolve(resp.obj.data);\n }).catch((error) => {\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "7d2a685db32be900dfd260a7ecc523b4", "score": "0.436108", "text": "static request_enrollment({ organizationId, identityRequest }) {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n resolve(Service.rejectResponse(\n e.message || 'Invalid input',\n e.status || 405,\n ));\n }\n },\n );\n }", "title": "" }, { "docid": "79c9c579cb78b61af62dde09f07372bd", "score": "0.4357856", "text": "impersonate () {\n return this.SingleResourceAction.extend ({\n /// The session service for generating tokens.\n session: service (),\n\n async executeFor (account, req, res) {\n const payload = { impersonator: req.user.id };\n const options = { scope: ['gatekeeper.session.impersonation'] };\n\n const token = await this.session.issueToken (req.accessToken.client._id, account, payload, options);\n\n return res.status (200).json (Object.assign ({token_type: 'Bearer'}, token));\n }\n });\n }", "title": "" }, { "docid": "7026c2e932a46f7396b7030b268752c4", "score": "0.43572518", "text": "function ContextAPI() {\n }", "title": "" }, { "docid": "7026c2e932a46f7396b7030b268752c4", "score": "0.43572518", "text": "function ContextAPI() {\n }", "title": "" }, { "docid": "7026c2e932a46f7396b7030b268752c4", "score": "0.43572518", "text": "function ContextAPI() {\n }", "title": "" }, { "docid": "7026c2e932a46f7396b7030b268752c4", "score": "0.43572518", "text": "function ContextAPI() {\n }", "title": "" }, { "docid": "7026c2e932a46f7396b7030b268752c4", "score": "0.43572518", "text": "function ContextAPI() {\n }", "title": "" }, { "docid": "65aae30f1f8abd2c7b00680c81c5dffd", "score": "0.43537205", "text": "function fnSetOKatUserID(parCurrentUserOKatUserID, parIsKBUserAuthenticated) {\n\n try {\n if (isthisKBExternal) {\n if (typeof digitalData != 'undefined') {\n if (parIsKBUserAuthenticated) {\n digitalData.visitor = {\n oktaUserId: parCurrentUserOKatUserID,\n networkStatus: \"logged in\"\n };\n\n } else {\n digitalData.visitor = {\n networkStatus: \"anonymous\"\n };\n }\n\n }\n }\n } catch (ex) {\n console.log(\"Method : fnSetOKatUserID; Error :\" + ex.description);\n }\n\n}", "title": "" } ]
d0a98cc432638cb22d68a766315bb830
Helper function to calculate the new progress values of card ie, updated review date and invterval progress correct adapted from:
[ { "docid": "6e360580936063e90186de8047648e57", "score": "0.6988908", "text": "function getNewProgressValues(score, intervalProgress, now) {\n // our setup intervals and scores to change intervals\n // a card begins with a review time of 2 hrs from current time\n var intervals = [2, 4, 6, 16, 34];\n var scoreToIntervalChange = [-3, -1, 1];\n\n // determine if user knew the card immediately\n // ie gave a score equal to the length of score intervals array\n var knewImmediately = false;\n if (score == scoreToIntervalChange.length - 1) {\n knewImmediately = true;\n }\n\n // determine next review date\n // in the case of user not knowing the answer immediately\n // we simply add 2 hrs to the current time.\n var nextReview = now + 2;\n if (knewImmediately) {\n // if the interval progress is less than our intervals length,\n // we add the relative interval to the current time\n if (intervalProgress < intervals.length) {\n nextReview = now + intervals[intervalProgress];\n } \n else if (intervalProgress >= intervals.length) {\n // else, we double the last interval and add it to the current time\n nextReview = now + (intervals.slice(-1) * (intervalProgress + 1 - intervals.length) * 2);\n }\n }\n\n // determine new interval progress, if less than 0, normalize to 0\n let newIntervalProgress = intervalProgress + scoreToIntervalChange[score];\n if (newIntervalProgress < 0) {\n newIntervalProgress = 0;\n }\n \n return {\n nextReview,\n newIntervalProgress\n }\n}", "title": "" } ]
[ { "docid": "7428b2e3a378abc0c3de0d3d29d30e75", "score": "0.6637354", "text": "async function attemptUpdateProgress(card, cardScore) {\n // calculate the new progress values\n let now = Math.floor(new Date().getTime() / HOUR_IN_MILIS);\n let { nextReview, newIntervalProgress } = getNewProgressValues(cardScore, card.intervalProgress, now);\n\n // construct next time for review string\n let nextTime = nextReview - now;\n let nextTimeString = `${nextTime} hours`;\n if (nextTime > 24) {\n nextTimeString = `${Math.floor(nextTime / 24)} day(s)`;\n }\n\n // attempt database update query\n try {\n await cardCtrls.updateOne(card._id, { nextReview, intervalProgress: newIntervalProgress });\n console.log(`Card progress updated. This card is scheduled for another review in ${nextTimeString}.`)\n } catch (err) {\n throw new Error(`Error encountered while updating card progress: ${err}.\\nExiting...`);\n }\n}", "title": "" }, { "docid": "45279f3d7a38cc5c5344834d5ae4978d", "score": "0.6250106", "text": "function RadiantProgressUpdate() {\n\tvar progress = CustomNetTables.GetTableValue(\"arena_capture\", \"radiant_progress\");\n\tif (progress[1] >= 0) {\n\t\t$('#RadiantProgressBar').value = progress[1];\n\t\t$('#RadiantTakenProgressBar').value = progress[1];\n\t} else {\n\t\t$('#RadiantProgressBar').value = (-1) * progress[1];\n\t\t$('#RadiantTakenProgressBar').value = (-1) * progress[1];\n\t}\n}", "title": "" }, { "docid": "02d874c9a79f349b8048ad728f0e7936", "score": "0.6112664", "text": "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "title": "" }, { "docid": "02d874c9a79f349b8048ad728f0e7936", "score": "0.6112664", "text": "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "title": "" }, { "docid": "02d874c9a79f349b8048ad728f0e7936", "score": "0.6112664", "text": "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "title": "" }, { "docid": "02d874c9a79f349b8048ad728f0e7936", "score": "0.6112664", "text": "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "title": "" }, { "docid": "02d874c9a79f349b8048ad728f0e7936", "score": "0.6112664", "text": "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "title": "" }, { "docid": "02d874c9a79f349b8048ad728f0e7936", "score": "0.6112664", "text": "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "title": "" }, { "docid": "a8f990b141e24272c458ed0a96de1c37", "score": "0.6108225", "text": "function _getProgress() {\n\t // Steps are 0 indexed\n\t var currentStep = parseInt((this._currentStep + 1), 10);\n\t return ((currentStep / this._introItems.length) * 100);\n\t }", "title": "" }, { "docid": "7a5eff5193c1e36ada0484f2177956cd", "score": "0.6092018", "text": "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt(this._currentStep + 1, 10);\n return currentStep / this._introItems.length * 100;\n }", "title": "" }, { "docid": "b69aa091ebb44b0b4e22024e738abee9", "score": "0.6089367", "text": "GetProgress() {\n\n return ((Number(this.Progress) / Number(this.Budget)) * 100).toFixed();\n }", "title": "" }, { "docid": "eb2357c10fde8927c04da651c92e740d", "score": "0.6077241", "text": "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "title": "" }, { "docid": "87e0b0d2e1418b4919796c50038a5c4b", "score": "0.60238874", "text": "function DireProgressUpdate() {\n\tvar progress = CustomNetTables.GetTableValue(\"arena_capture\", \"dire_progress\");\n\tif (progress[1] >= 0) {\n\t\t$('#DireProgressBar').value = progress[1];\n\t\t$('#DireTakenProgressBar').value = progress[1];\n\t} else {\n\t\t$('#DireProgressBar').value = (-1) * progress[1];\n\t\t$('#DireTakenProgressBar').value = (-1) * progress[1];\n\t}\n}", "title": "" }, { "docid": "dba0f1acc901a49e27b75b6aacf6cc63", "score": "0.6018711", "text": "function changeProgress () {\n const $progress = document.getElementById('progress-line');\n const $score = document.getElementById('score');\n const width = $progress.style.width || 0;\n const step = document.querySelectorAll('.js-card').length;\n\n $progress.style.width = parseFloat(width) + parseFloat((100/step).toFixed(2)) + '%';\n $score.innerText = parseInt($score.innerText, 10) + 1;\n }", "title": "" }, { "docid": "d48d73ec9b22f8114c79ecc294ca323d", "score": "0.5909624", "text": "percentChange() {\n const lastCoreEquity = this.rawData.portfolio.last_core_equity\n return (this.absChange() / lastCoreEquity) * 100\n }", "title": "" }, { "docid": "8a89cc481db7d978951d4d7cbbe1a985", "score": "0.58426046", "text": "static calculateProgress(startDate, endDate) {\n if(!startDate && !endDate) {\n return 0;\n }\n var start = new Date(startDate),\n end = new Date(endDate),\n today = new Date();\n var q = today - start;\n var d = end - start;\n var progress = Math.round((q / d) * 100);\n if (progress <= 0)\n return 0;\n else if (progress <= 100) {\n return progress;\n } else {\n return 100;\n }\n }", "title": "" }, { "docid": "4ff648a6099ceb46ec96053588fea677", "score": "0.58418477", "text": "function percentChange() {\n let diff = stockData.c - stockData.o;\n let pc = (diff / stockData.o) * 100;\n return pc.toFixed(2);\n }", "title": "" }, { "docid": "cda909c1d393967f75990373bba26197", "score": "0.5799892", "text": "function renderCalProgress(intake) {\n\n // keep adding value with user's calorie amount\n currCalValue += intake.calorie\n progressTag.value = currCalValue\n\n}", "title": "" }, { "docid": "28ebdeb5c6bfd55c17230677b91fff57", "score": "0.56952834", "text": "function updateProgressBar() {\n percentageViewed = 100 * ((productsLoaded + pagStepSize)/collectionTotalProducts);\n pagProgress.css('width', percentageViewed + '%');\n }", "title": "" }, { "docid": "2fc56eae81533ff75743b503deeb8cbd", "score": "0.56917655", "text": "function initProgress(){\n\n $('.donate-static').each(function(){\n var donated = Math.round($('.donated', this).html()); \n var asked = Math.round($('.asked', this).html());\n if (donated > asked) {\n perc = 100;\n } else if (asked) {\n perc = 100 * donated / asked;\n } else {\n perc = 100;\n }\n perc = Math.round(perc);\n $('.donate-percentage', this).css({width: perc +'%'});\n });\n\n $('.donate-status').each(function(){\n var donated = Math.round($('.donated', this).html()); \n var asked = Math.round($('.asked', this).html());\n if (donated > asked) {\n perc = 100;\n } else if (asked) {\n perc = 100 * donated / asked;\n } else {\n perc = 100;\n }\n perc = Math.round(perc);\n if (perc == 0) {\n $('.donate-percentage', this).addClass('is-empty');\n } else if(perc == 100) {\n $('.donate-percentage', this).addClass('is-full');\n \n } else {\n $('.donate-percentage', this).addClass('is-in-progress');\n }\n \n $('.donate-percentage', this).animate({width: perc +'%'}, 2000);\n \n });\n}", "title": "" }, { "docid": "39eb399fe139ac3ff888a5e09a117920", "score": "0.567479", "text": "render() {\n const partner = this.props.partner\n const documents = partner.documents\n\n const dueDate = new Date(partner.due_date)\n let displayDate =\n dueDate.getMonth() +\n 1 +\n '/' +\n dueDate.getDate() +\n '/' +\n dueDate\n .getFullYear()\n .toString()\n .substring(2)\n\n let approved = 0\n let pending = 0\n let rejected = 0\n let rest = 0\n\n // counts number of documents in eachS\n let len = documents.length\n for (const document in documents) {\n let item = documents[document].status\n if (item === 'Approved') {\n approved += 1\n } else if (item === 'Pending') {\n pending += 1\n } else if (item === 'Rejected') {\n rejected += 1\n }\n }\n\n // turns into percentage values\n if (len > 0) {\n approved = Math.floor((approved / len) * 100)\n pending = Math.floor((pending / len) * 100)\n rejected = Math.floor((rejected / len) * 100)\n rest = 100 - approved - pending - rejected\n } else {\n rest = 100\n }\n\n return (\n <div className=\"partnerBox\">\n <div className=\"duedate\">\n <div className=\"due\">Due</div>\n {displayDate}\n </div>\n <div className=\"partner-icon\">\n <p className=\"partner-org-initials\">{partner.org_name[0]}</p>\n </div>\n <div className=\"nameProgressDisplay\">\n <p>{partner.org_name}</p>\n <div className=\"progressAdditional\">\n {approved}%\n <Progress multi>\n <Progress bar color=\"dashgreen\" value={approved} />\n <Progress bar color=\"dashorange\" value={pending} />\n <Progress bar color=\"dashred\" value={rejected} />\n <Progress bar color=\"dashgrey\" value={rest} />\n </Progress>\n </div>\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "164c8265ec75f2fe03d28815357f2edd", "score": "0.5662686", "text": "function reconver() {\n\t\t\tconsole.log(vm.history[0].amount);\n\t\t\tvar i;\n\t\t\tfor (i = 0; i < vm.history.length; i++) {\n\t\t\t\tvm.history[i].amount = vm.history[i].amount / 100;\n\t\t\t\t//console.log(vm.history.amount);\n\t\t\t\tif (vm.history[i].service_fee) {\n\t\t\t\t\tvm.history[i].service_fee = vm.history[i].service_fee / 100;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9a433a4455b3ee1d4a089fd803d45c5e", "score": "0.56164354", "text": "function getTotalProgress() {\n\t\tvar notUploaded = $scope.files.length - uploaded;\n\t\tvar totalUploaded = notUploaded ? $scope.files.length - notUploaded :$scope.files.length;\n\t\tvar ratio = 100 /$scope.files.length;\n\t\tvar current = 0 * ratio / 100;\n\t\treturn Math.round(totalUploaded * ratio + current);\n\t }", "title": "" }, { "docid": "aa07078390209c5e5edb4eed291e2640", "score": "0.560723", "text": "GetProgressLine() {\n let result = Number(this.Progress) / Number(this.Budget) * 100;\n return result > 100 ? 100 : result;\n }", "title": "" }, { "docid": "939656eaf97991ef3361c2a4a20c5b6a", "score": "0.5591036", "text": "function updateProgressBar() {\n var progressPercent = (timeLeft) / (quizzes[quizID].length * 6) * 100;\n var percent = progressPercent.toFixed(2);\n multiplierEl.innerHTML = `Multiplier: <b>x${points}</b>`\n progressBarEl.setAttribute(\"style\", `width: ${percent}%`);\n progressBarEl.setAttribute(\"aria-valuenow\", `${timeLeft}`);\n progressBarEl.setAttribute(\"aria-valuemin\", \"0\");\n progressBarEl.setAttribute(\"aria-valuemax\", `${quizzes[quizID].length * 5}`);\n\n if (percent < 66) {\n progressBarEl.setAttribute(\"class\", \"progress-bar bg-warning progress-bar-striped progress-bar-animated\");\n }\n\n if (percent < 33) {\n progressBarEl.setAttribute(\"class\", \"progress-bar bg-danger progress-bar-striped progress-bar-animated\");\n }\n\n}", "title": "" }, { "docid": "a845f1afd339101b1730676bf2b35fa8", "score": "0.5584508", "text": "advanceProgress() {\n this.setProgress(this.progressNow + 1);\n }", "title": "" }, { "docid": "09cf6bc4a5e674221d2e17c1b3632abd", "score": "0.55772984", "text": "function updateTotal() {\n\t\tvar total = progressTable.size(),\n\t\t\tvalues = progressTable.values(),\n\t\t\tpercent = 0;\n\t\t\t\n\t\tfor (var ndx = 0; ndx < total; ndx++) {\n\t\t\tvar fileObj = values[ndx];\n\t\t\t\n\t\t\tpercent += fileObj.percent / total;\n\t\t}\n\t\t\n\t\themi.send(hemi.msg.progress, {\n\t\t\ttask: 'Total Progress',\n\t\t\tisTotal: true,\n\t\t\tpercent: percent\n\t\t});\n\t\t\n\t\tif (percent >= 99.9) {\n\t\t\tprogressTable.clear();\n\t\t}\n\t\t\n\t\treturn percent;\n\t}", "title": "" }, { "docid": "108bff8e510c8ff7967eb3c91b2fee30", "score": "0.556083", "text": "function fun1(snapshot){\n// snapshot info- bytes transfered and total byted, allow us to show % of download\nlet progress=(snapshot.bytesTransferred / snapshot.totalBytes)*100;\nconsole.log(progress);\n }", "title": "" }, { "docid": "a5e416cf34165f582bccac7f9b0d2802", "score": "0.55606407", "text": "function createStatusBarData() {\r\n var result = (CardTopic.totalSkillsComplete() / CardTopic.skillCount());\r\n result = Math.round(result * 100);\r\n return result;\r\n}", "title": "" }, { "docid": "3480e91d9b148c0bea11d48e1b49d76c", "score": "0.5550865", "text": "#updateProgress() {\n const prog = parseFloat(this.progress) || DEFAULT_PROGRESS;\n const tot = parseFloat(this.total) || DEFAULT_TOTAL;\n // make sure that prog / tot doesn't exceed 1 -- will happen if prog > tot\n const percentage = Math.floor((prog / tot > 1 ? 1 : prog / tot) * 100);\n this.percentage = percentage;\n this.container.querySelector('.bar-progress').style.width = `${percentage}%`;\n }", "title": "" }, { "docid": "95a0da06f0960246424ac468a4eef410", "score": "0.55502045", "text": "function updateProgress()\n {\n if (queueLength === 0)\n {\n progress = 0;\n }\n else\n {\n progress = Math.ceil(((queuePosition + 1) / queueLength) * 100);\n }\n }", "title": "" }, { "docid": "94ab12f7bd3ab6e101b3c4fb789a312e", "score": "0.5548396", "text": "function updateQuizProgress(data) {\n //update scores\n results[0]++;\n if (data.correct) {\n results[1]++;\n } else {\n results[2]++;\n }\n //tracked quiz status\n completed = (results[0] === quizQuestionData.length) ? true : false;\n //progress question number\n count++;\n}", "title": "" }, { "docid": "a8865af0895bf3685992e044940fc3d3", "score": "0.55162686", "text": "function UpdateProgress() {\n let filesLoaded = Math.max(0, totalFiles - neededFiles);\n let progress = (totalFiles > 0) ? (filesLoaded / totalFiles) : 1;\n progress *= 100;\n progress = Math.round(progress);\n document.getElementById(\"file\").innerText = currentFile;\n document.getElementById(\"percentage\").innerText = `${progress}%`;\n document.getElementById(\"filesloaded\").innerText = `${filesLoaded}`;\n document.getElementById(\"totalfiles\").innerText = `${totalFiles}`;\n}", "title": "" }, { "docid": "4f416686f37d61d34d04f321f83858b0", "score": "0.54996574", "text": "_updateProgressBarValue() {\n const percent = this.progressNow * 100 / this.progressTotal;\n this.progressBar.setValue(percent);\n\n const indicator =\n this.shadowRoot.querySelector('#progress-bar-indicator');\n const roundToTwoDecimal = (x) => parseFloat(x.toFixed(2));\n\n indicator.innerText =\n `${percent.toFixed(1)}% (${roundToTwoDecimal(this.progressNow)}/${\n roundToTwoDecimal(this.progressTotal)})`;\n }", "title": "" }, { "docid": "8444bb0a83b5687379ba7e1ed0bba3af", "score": "0.54979813", "text": "updateUI() {\n if (this.currentScore > this.totalScore) {\n this.currentScore = this.totalScore;\n }\n\n const k = Math.ceil((this.currentScore / this.totalScore) * 100) * 1.8;\n\n this.$fullAndFill.css('transform', `rotate(${k}deg)`);\n this.$fillFix.css('transform', `rotate(${k * 2}deg)`);\n\n const textualProgress = (this.showTotal) ?\n `${this.currentScore}<span class=\"h5p-progress-circle-textual-progress-divider\">/</span>${this.totalScore}` :\n this.currentScore;\n\n this.$textualProgress.html(textualProgress);\n\n //this.$text.attr('aria-valuenow', currentScore);\n }", "title": "" }, { "docid": "a79d3a7dd0a2169517314fdd11ae79e5", "score": "0.5496304", "text": "updateWindowProgressBar () {\n const all = Object.keys(this.downloadsInProgress).reduce((acc, id) => {\n acc.received += this.downloadsInProgress[id].received\n acc.total += this.downloadsInProgress[id].total\n return acc\n }, { received: 0, total: 0 })\n\n if (all.received === 0 && all.total === 0) {\n this.mailboxWindow.setProgressBar(-1)\n } else {\n this.mailboxWindow.setProgressBar(all.received / all.total)\n }\n }", "title": "" }, { "docid": "49e71f2b0010f7c47713330aa335fb41", "score": "0.54933333", "text": "updateOfflineProgress_() {\n for (const card of this.assetCards_) {\n card.updateProgress();\n }\n }", "title": "" }, { "docid": "3d53fec249ec66cdd5cb73386d539ac1", "score": "0.5491536", "text": "function updateMissionProgress(skip) {\n let labelsProgress = getProperty(\"labelsProgress\");\n if (labelsProgress < getProperty(\"labelsValidated\")) {\n if (!skip) {\n labelsProgress += 1;\n }\n svv.statusField.incrementLabelCounts();\n setProperty(\"labelsProgress\", labelsProgress);\n\n // Submit mission if mission is complete\n if (labelsProgress >= getProperty(\"labelsValidated\")) {\n setProperty(\"completed\", true);\n svv.missionContainer.completeAMission();\n }\n }\n\n let completionRate = labelsProgress / getProperty(\"labelsValidated\");\n svv.statusField.setProgressBar(completionRate);\n svv.statusField.setProgressText(completionRate);\n }", "title": "" }, { "docid": "99ea6880eac506a88f6d98d5df6d572b", "score": "0.5488679", "text": "function calculateProgress() {\r\n let completedItems = Array.from($taskList.children('li')).filter(task => $(task).hasClass('done')).length\r\n return completedItems / totalTasks() * 100\r\n}", "title": "" }, { "docid": "70d71713e3914e57c24abf2c90c8d070", "score": "0.548448", "text": "getContentInfo(completed, total) {\n let l = completed / total;\n l = l * 100;\n this.setState({percentageComplete: l});\n }", "title": "" }, { "docid": "279241ecb0586c8526a826a4e9f7ac10", "score": "0.5483088", "text": "function calculatePercentages(){\n\tvar difference = calculateDifference()\n\n //Offset for each number\n\tvar smallest = Math.abs(Math.min(difference[\"black\"],difference[\"red\"], difference[\"blue\"], difference[\"gold\"]))\n\n var adjustment = smallest*2\n //Scalar numbers to scale different colors, adjustable\n\tvar scalars = {\n\t\t\"black\": 1.25,\n\t\t\"red\": 1,\n\t\t\"blue\": 1,\n\t\t\"gold\": 0.5\n\t}\n\tvar newDifferences = {\n\t\t\"black\": difference[\"black\"]+adjustment*scalars[\"black\"],\n\t\t\"red\": difference[\"red\"]+adjustment *scalars[\"red\"],\n\t\t\"blue\": difference[\"blue\"]+adjustment*scalars[\"blue\"],\n\t\t\"gold\": difference[\"gold\"]+adjustment *scalars[\"gold\"]\n\t}\n\n //Total of all differences after adjustment\n\tvar total = Number(newDifferences[\"black\"]) + Number(newDifferences[\"red\"]) + Number(newDifferences[\"blue\"]) + Number(newDifferences[\"gold\"])\n\n //Final Dictionary\n\tvar newDifferences = {\n\t\t\"black\": newDifferences[\"black\"]/total,\n\t\t\"red\": newDifferences[\"red\"]/total,\n\t\t\"blue\": newDifferences[\"blue\"]/total,\n\t\t\"gold\": newDifferences[\"gold\"]/total\n\t}\n\treturn newDifferences\n}", "title": "" }, { "docid": "a67710c59a34a09136002252a4959896", "score": "0.54805434", "text": "function CardProgress(props) {\n let { current, max, multiplier } = props, progress = current * 100 / max\n return (\n <div className=\"row progress-bar-holder image-card\">\n <div className=\"col-xs-6 left\">\n <p style={{fontWeight: \"bold\", color:\"#f00\"}}>{currency(multiplier * current)}</p>\n </div>\n <div className=\"col-xs-6 right\"><p style={{fontWeight: \"bold\", color:\"#f00\"}}>{currency(multiplier * max)}</p></div>\n <div className=\"col-xs-12 range-holder\">\n <div className=\"range\" style={{backgroundColor: progress < 100 ? \"#f26438\" : \"#00cc99\", width: `${ progress }%`}}></div>\n </div>\n <div className=\"col-xs-12 range-txt\">\n <p className=\"purple-text\"><b>{max - current}</b> participaciones disponibles de <b>{max}</b></p>\n </div>\n <hr className=\"hr-card\"/>\n </div>\n )\n}", "title": "" }, { "docid": "7e2580e5341eb06dd6b15f9b4c11a85e", "score": "0.5477538", "text": "function getDiff(x,y) {\nvar compDue = x;\nvar paid = y;\nvar diff = 0;\n if (compDue != \"\" && paid == \"\") {\n diff = compDue;\n } else if (compDue != \"\" && paid != \"\") {\n diff = compDue - paid;\n } else {\n diff = 0 - paid;\n }\ndiff = Math.round(diff*100)/100;\nreturn diff;\n}", "title": "" }, { "docid": "5e332f5dd4cdaaab6f01063cef6b02e2", "score": "0.54736996", "text": "function pBarCalc () {\n const progress = $('.skills__ratings-progress span'),\n counter = $('.skills__ratings-counter');\n\n observer.unobserve(skillRatings);\n \n counter.each(function (i, e) {\n move(progress[i], e);\n })\n \n /* animated progress bar */\n \n function move(el, cntr) {\n let i = 0;\n if (i == 0) {\n i = 1;\n let width = 1;\n let id = setInterval(frame, 20);\n function frame() {\n if (width >= +cntr.getAttribute('data-val')) {\n clearInterval(id);\n i = 0;\n } else {\n width++;\n el.style.width = width + \"%\";\n cntr.innerHTML = width + \"%\";\n }\n }\n }\n }\n }", "title": "" }, { "docid": "6c89c79a02c01a022ac8d2ce3fcca661", "score": "0.54697573", "text": "update()\n {\n this.total = this.likes.length + this.dislikes.length + this.neutral.length;\n if (this.total != 0) {\n this.like_perc = this.likes.length * 1.0 / this.total;\n this.dislike_perc = this.dislikes.length * 1.0 / this.total;\n this.neutral_perc = this.neutral.length * 1.0 / this.total;\n } else {\n this.like_perc = 0;\n this.dislike_perc = 0;\n this.neutral_perc = 0;\n }\n }", "title": "" }, { "docid": "cc694b4eb162a699964816c736b1ca5e", "score": "0.5466444", "text": "function update_rapproval(ev) {\n var row = $axel($(ev.target).closest('.x-ra-FundingSource'));\n row.poke('Balance', Math.round(row.peek('ApprovedAmount') * 100 - row.peek('EffectiveAmount') * 100) / 100);\n recompute_rapproval();\n }", "title": "" }, { "docid": "6b1a2d71581437657c03298cc3d222cb", "score": "0.5462989", "text": "function progressBarUpdater() {\n document.querySelector('.indicator-current').innerHTML = `Page ${currentSlide + 1}`;\n // const allRequiredQuestions = document.querySelectorAll('.is-required').length;\n const percentageCompleted = `${`${(currentSlide + 1) * 100}` / slideItems.length}%`;\n progressIndicator.style.transform = `translateX(${percentageCompleted})`;\n }", "title": "" }, { "docid": "c0b74ebb48151ff67e2e8eba6137f2d8", "score": "0.5462088", "text": "function getRewardAmount() {\n return 1000 + (videosWatched * 2000) + (total_persecond * 180) + (deported / 12);\n}", "title": "" }, { "docid": "da03d2b6a6cf514a0aa6b5845eb45292", "score": "0.54536456", "text": "progressEdited(args) {\n let ganttRecord = args.data;\n this.parent.setRecordValue('progress', (ganttRecord[this.parent.taskFields.progress] > 100 ? 100 : ganttRecord[this.parent.taskFields.progress]), ganttRecord.ganttProperties, true);\n this.parent.setRecordValue('taskData.' + this.parent.taskFields.progress, (ganttRecord[this.parent.taskFields.progress] > 100 ? 100 : ganttRecord[this.parent.taskFields.progress]), args.data);\n if (!args.data.hasChildRecords) {\n this.parent.setRecordValue('progressWidth', this.parent.dataOperation.getProgressWidth(ganttRecord.ganttProperties.width, ganttRecord.ganttProperties.progress), ganttRecord.ganttProperties, true);\n }\n this.updateEditedRecord(args);\n }", "title": "" }, { "docid": "76bd95e3acaf3f4600b492cfc850c9f0", "score": "0.54522234", "text": "function updateDispenseProgressBar(dispenserIDNum) {\n currentState = JSON.parse(localStorage.dispenserData)[dispenserIDNum - 1]['Current_State'];\n maxVol = JSON.parse(localStorage.dispenserData)[dispenserIDNum - 1]['Max'];\n minVol = JSON.parse(localStorage.dispenserData)[dispenserIDNum - 1]['Min'];\n if (currentState == 0){\n percentageUpdate = 0; // value is NaN otherwise\n }\n else {\n percentageUpdate = Math.floor(((currentState - minVol)/(maxVol - minVol)) * 100);\n }\n\n // first update syringe\n updateDispenseSyringe(dispenserIDNum, percentageUpdate);\n\n // now base percentage update on syringe orientation:\n if(JSON.parse(localStorage.dispenserData)[dispenserIDNum - 1]['orientation'] === \"push\"){\n percentageUpdate = 100 - percentageUpdate;\n }\n\n document.getElementById('progress' + dispenserIDNum).innerHTML = percentageUpdate + \"% total vol\";\n document.getElementById('stateOf' + dispenserIDNum).innerHTML = currentState + \" uL\";\n $('#progress' + dispenserIDNum).css('width', percentageUpdate+'%').attr('aria-valuenow', percentageUpdate);\n return false;\n}", "title": "" }, { "docid": "aded6f343dbfaf0484b36db3da976740", "score": "0.54464024", "text": "function update_progress_bar() {\n let total_points = document.querySelector(\"#total-points\").textContent\n total_points = parseInt(total_points)\n fetch('/api/tiers')\n .then(response => response.json())\n .then((tiers) => {\n let upper = tiers.find(tier => tier.points > total_points)\n let rev = tiers.slice(0).reverse()\n let lower = rev.find(tier => tier.points <= total_points)\n\n let percent = 0\n if (lower == null) {\n percent = total_points / upper.points * 100;\n } else if (upper == null) {\n percent = 100\n } else {\n percent = (total_points - lower.points) / (upper.points - lower.points) * 100;\n }\n\n document.querySelector(\"#progress-bar\").style.width = \"\" + percent + \"%\"\n display_msg(total_points, upper, lower)\n })\n}", "title": "" }, { "docid": "8e041cfa8e2886dfd29dbeaf98d4bff4", "score": "0.5440654", "text": "getFillPercentage(encData){\r\n\r\n if(encData.total && encData.completed){\r\n return Math.floor(((encData.completed/encData.total)*100))\r\n }\r\n return 0;\r\n }", "title": "" }, { "docid": "6ed4bc742e3afc88f7807f50d9a5b4c4", "score": "0.54359764", "text": "function updVal() {\n const amounts = transactions.map(transaction => transaction.amount);\n\n const total = amounts.reduce((acc, item) => (acc += item), 0).toFixed(2);\n\n const income = amounts\n .filter(item => item > 0)\n .reduce((acc, item) => (acc += item), 0)\n .toFixed(2); \n \n const expense = (amounts\n .filter(item => item < 0)\n .reduce((acc, item) => (acc += item), 0) * \n -1\n ).toFixed(2);\n \n balance.innerText = `$${total}`;\n money_plus.innerText = `$${income}`;\n money_minus.innerText = `$${expense}`;\n}", "title": "" }, { "docid": "8706d800e4f2fb56c2a6a555425cf180", "score": "0.5430401", "text": "function updateProgressIndicator(progress) {\n // Update/animate progress bar\n $('#generator-progress-value').animate({value: progress}, 800);\n //$('.ccg-progress-indicator').animate({width: progress * 100 + '%'});\n // Update progress width for older browsers\n $('.ccg-generator-progress-wrap .progress-bar > span').animate({width: progress * 100 + '%'}, 800);\n // Update/animate number display(s)\n $('.generator-progress-value-print').each(function (index, element) {\n $({countNum: $(element).text()}).animate({countNum: Math.floor(progress * 100)}, {\n duration: 800,\n easing: 'linear',\n step: function () {\n $(element).text(Math.floor(this.countNum));\n },\n complete: function () {\n $(element).text(this.countNum);\n }\n });\n });\n}", "title": "" }, { "docid": "c71ea8b7dc8fb233f254e61b2829e844", "score": "0.5429383", "text": "progress(value, time) {\n this.timings.left -= value\n if (this.isComplete()) {\n this.timings.end = time + this.timings.left\n this.timings.elapsed = this.timings.end - this.timings.start\n this.timings.idle = this.timings.elapsed - this.timings.needed\n }\n return this.timings.left\n }", "title": "" }, { "docid": "e704d7ec59d53a1f9c3b623fca0377f3", "score": "0.5422781", "text": "function increaseProgress() {\n gameProgress++;\n generateProgressString();\n}", "title": "" }, { "docid": "98e8fda8ff943b791b4305e6e4e34095", "score": "0.5419175", "text": "function ProgressUpdate() {\n\t//alert('in ProgressUpdate');\n\tvar n = (_progressWidth / _progressEnd) * _progressAt;\n\tif (document.all) {\t// Internet Explorer\n\t\tvar bar = dialog.bar;\n \t} else if (document.layers) {\t// Netscape\n\t\tvar bar = document.layers[\"progress\"].document.forms[\"dialog\"].bar;\n\t\tn = n * 0.55;\t// characters are larger\n\t} else if (document.getElementById){\n var bar=document.dialog.bar\n }\n\tvar temp = _progressBar.substring(0, n);\n\tbar.value = temp;\n}", "title": "" }, { "docid": "46e86647c80690fc752e9ee5f6f14258", "score": "0.541556", "text": "function calcPercent() {\n let result = Math.round(((currentQuestion + 1) / questions.length) * 100);\n return result;\n}", "title": "" }, { "docid": "75bedb1c7d5110bad17cd083336aaf0a", "score": "0.5409418", "text": "updateStats(newCorrect, newWrong) {\n this.correct += newCorrect;\n this.wrong += newWrong;\n this.percentage = Math.round(100 * this.correct / (this.correct + this.wrong));\n this.updateScreens('update stats');\n }", "title": "" }, { "docid": "99c1ab769841ba49a8a646306e99e5cd", "score": "0.5403194", "text": "calcPercentChange(prevYear, currYear) {\n return ((currYear - prevYear) / prevYear) * 100;\n }", "title": "" }, { "docid": "6a4fec68acc6f166a0fde35d79082de3", "score": "0.5402338", "text": "function calcPercentChange(oldVal, newVal){\n var change = newVal - oldVal;\n return -(change / oldVal);\n }", "title": "" }, { "docid": "fb9730e30655a14372cd2a33bf26b0d8", "score": "0.54005474", "text": "function updateRemainingCards(hash_name, is_spymaster) {\n const status_red = document.getElementById(\"status-remaining-red\");\n const status_blue = document.getElementById(\"status-remaining-blue\");\n status_red.textContent = getRemaining(true, is_spymaster, hash_name);\n status_blue.textContent = getRemaining(false, is_spymaster, hash_name);\n}", "title": "" }, { "docid": "7b27b304d146827c9284fa989320efe8", "score": "0.5399458", "text": "function CardProgress(props) {\n let { current, max, multiplier } = props, progress = current * 100 / max\n return (\n <div className=\"row progress-bar-holder image-card\">\n <div className=\"col-xs-6 left\">\n <p><b>{currency(multiplier * current)}</b></p>\n </div>\n <div className=\"col-xs-6 right\">\n <p><b>{currency(multiplier * max)}</b></p>\n </div>\n <div className=\"col-xs-12 range-holder\">\n <div className=\"range\" style={{backgroundColor: progress < 100 ? \"#f26438\" : \"#00cc99\", width: `${ progress }%`}}></div>\n </div>\n <div className=\"col-xs-12 range-txt\">\n <p className=\"purple-text\"><b>{max - current}</b> participaciones disponibles de <b>{max}</b></p>\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "c59ae1fbc5d7d5733d71d59ecfe2d084", "score": "0.5394984", "text": "function progressPercent (list) {\n const incompleteTaskCount = list.tasks.filter(task => !task.complete).length;\n const completeTaskCount = list.tasks.filter(task => task.complete).length;\n const totalTaskCount = (list.tasks.filter(task => !task.complete).length) + (list.tasks.filter(task => task.complete).length);\n\n return Math.round((completeTaskCount/totalTaskCount)*100);\n\n}", "title": "" }, { "docid": "08802dbbcea3a498f5a289c05b3a35da", "score": "0.53927803", "text": "function ProgressUpdate() {\n\tvar n = (_progressWidth / _progressEnd) * _progressAt;\n\tif (document.all) {\t// Internet Explorer\n\t\tvar bar = dialog.bar;\n \t} else if (document.layers) {\t// Netscape\n\t\tvar bar = document.layers[\"progress\"].document.forms[\"dialog\"].bar;\n\t\tn = n * 0.55;\t// characters are larger\n\t} else if (document.getElementById){\n var bar=document.getElementById(\"bar\")\n }\n\tvar temp = _progressBar.substring(0, n);\n\tbar.value = temp;\n}", "title": "" }, { "docid": "9bdf5b934eb9f26a22f59f437c8011b0", "score": "0.53883165", "text": "increment() {\n // Don't update anything if we're paused\n if (this.status == POMODORO_STOPPED || this.status == POMODORO_PAUSED) {\n return;\n }\n\n // Get the current date (time), calculate the difference, and update all the\n // concerned variables\n let now = Date.now();\n let diff = now - this.last_update;\n this.last_update = now;\n this.remaining = this.remaining - diff;\n\n // Don't let remaining time get below 0, and set it to 0 if it does.\n if (this.remaining <= 0) {\n this.status = POMODORO_STOPPED;\n this.completed = true;\n }\n }", "title": "" }, { "docid": "7cc37ea32868b5108039a410f64e083a", "score": "0.5384778", "text": "remainingPercent() {\n\t\tvar now = new Date().getTime()\n\t\treturn dash.floor(((this.timeout - now + this.start)/this.timeout) * 100) \n\t}", "title": "" }, { "docid": "e316edb57aef7f9b92cd5f7c0649e7ab", "score": "0.53824687", "text": "function calculateProgress (frameGatheringProgress, renderingProgress) {\n return ((frameGatheringProgress * 0.7) + (renderingProgress * 0.3)) * 100;\n}", "title": "" }, { "docid": "db9e4abf2cb401c61aea20a82bea0d67", "score": "0.53754854", "text": "function updateProgressBar() {\n if (progress < 100) {\n progress = progress += updateVal; //13 calls\n $rootScope.$broadcast('loading-bar-updated', progress, map);\n }\n }", "title": "" }, { "docid": "8e96e9de427c81a498115fc52af2fb72", "score": "0.53739417", "text": "function getRateOfChange(data)\n{\n let len = data.length;\n console.log(data);\n let change = [];\n for (let i = 0; i < HOURS; i++)\n change[i] = 0;\n let prev = undefined;\n\n let index = 0;\n for (; index < len; index++)\n {\n if (data[index].averageSentiment != -2) {\n prev = data[index];\n break;\n }\n }\n let count = 1;\n change[0] = 0;\n if (index == 0)\n index = 1;\n for (let i = index; i < len; i++)\n {\n\n if (data[i].averageSentiment != -2) {\n if (data[i-1].averageSentiment == -2) {\n change[i] = ((data[i].averageSentiment - prev.averageSentiment) / (HOUR * count));\n prev = data[i];\n count++;\n }\n else {\n change[i] = ((data[i].averageSentiment - data[i-1].averageSentiment) / HOUR);\n count = 0;\n }\n \n }\n else\n {\n count++;\n }\n \n }\n console.log(change);\n return change;\n}", "title": "" }, { "docid": "9b357cf76672044868f843092aa7282e", "score": "0.53723997", "text": "updateParentProgress(cloneParent) {\n let parentProgress = 0;\n let parent = this.parent.getParentTask(cloneParent);\n let childRecords = parent.childRecords;\n let childCount = childRecords ? childRecords.length : 0;\n let totalProgress = 0;\n let milesStoneCount = 0;\n let taskCount = 0;\n let totalDuration = 0;\n let progressValues = {};\n if (childRecords) {\n for (let i = 0; i < childCount; i++) {\n if ((!childRecords[i].ganttProperties.isMilestone || childRecords[i].hasChildRecords) &&\n isScheduledTask(childRecords[i].ganttProperties)) {\n progressValues = this.parent.dataOperation.getParentProgress(childRecords[i]);\n totalProgress += getValue('totalProgress', progressValues);\n totalDuration += getValue('totalDuration', progressValues);\n }\n else {\n milesStoneCount += 1;\n }\n }\n taskCount = childCount - milesStoneCount;\n parentProgress = taskCount > 0 ? Math.round(totalProgress / totalDuration) : 0;\n if (isNaN(parentProgress)) {\n parentProgress = 0;\n }\n this.parent.setRecordValue('progressWidth', this.parent.dataOperation.getProgressWidth(parent.ganttProperties.width, parentProgress), parent.ganttProperties, true);\n this.parent.setRecordValue('progress', Math.floor(parentProgress), parent.ganttProperties, true);\n this.parent.setRecordValue('totalProgress', totalProgress, parent.ganttProperties, true);\n this.parent.setRecordValue('totalDuration', totalDuration, parent.ganttProperties, true);\n }\n this.parent.dataOperation.updateTaskData(parent);\n if (parent.parentItem) {\n this.updateParentProgress(parent.parentItem);\n }\n }", "title": "" }, { "docid": "8ac522336ae178ecd9bc458e54f97782", "score": "0.5368292", "text": "_getProgress() {\n let loaded = 0, total = 0;\n for (let resource of this.items) {\n loaded += resource.progress.loaded;\n total += resource.progress.total;\n }\n return { loaded: loaded, total: total };\n }", "title": "" }, { "docid": "f943481b509cb8e5edb4a7261a0be4d9", "score": "0.53640693", "text": "function update_progress() {\n //console.log(video.currentTime,\" \",video.duration,\" \",(video.currentTime/video.duration),\" \",(video.currentTime/video.duration)*100,\"%\");\n progress_bar.style.width = `${(video.currentTime/video.duration)*100}%`;\n current_time.textContent = `${display_time(video.currentTime)} /`;\n duration.textContent = `${display_time(video.duration)} `;\n}", "title": "" }, { "docid": "d16260e62d319fc2bde650625d937bdd", "score": "0.53529984", "text": "function dailyCalcFlexi(){\n\n var flexiArr = flexiSheet.getRange('A2:M'+flexiSheet.getLastRow()).getValues();\n var countArr = getAttendanceCount(flexiArr);\n\n var compName;\n var buffer;\n var dpQuota;\n var dpUsage;\n var dpBalance;\n var creditQuota;\n var creditUsage;\n var creditBalance;\n var charge;\n var attdExcess;\n\n var tempArr = [];\n\n for(var i = 0 ; i < flexiArr.length ; i++){\n compName = flexiArr[i][0];\n buffer = flexiArr[i][7];\n dpQuota = flexiArr[i][9];\n dpUsage = countArr[i][2];\n creditQuota = flexiArr[i][11];\n charge = 0;\n\n attdExcess = dpUsage - buffer;\n\n if(attdExcess > 0){\n\n dpBalance = dpQuota - attdExcess;\n creditUsage = 0;\n creditBalance = creditQuota - creditUsage;\n\n if(dpBalance < 0){\n\n creditUsage = Math.abs(dpBalance * 30);\n\n creditBalance = creditQuota - creditUsage;\n\n if(creditBalance < 0){\n\n charge = charge + Math.abs(creditBalance);\n\n creditBalance = 0;\n\n } \n\n dpBalance = 0;\n }\n\n } else {\n attdExcess = 0;\n dpBalance = dpQuota - attdExcess;\n creditUsage = 0;\n creditBalance = creditQuota - creditUsage;\n }\n\n tempArr.push([compName, buffer, dpQuota, dpUsage, attdExcess , dpBalance, creditQuota, creditUsage, creditBalance, charge]);\n }\n\n for (var i = 0 ; i < tempArr.length ; i++){\n\n flexiArr[i][9] = tempArr[i][5];\n\n flexiArr[i][12] += tempArr[i][7];\n\n flexiArr[i][11] = flexiArr[i][10] - flexiArr[i][12];\n }\n \n if(dailyCalcFlexiSheet.getLastRow() == 1){\n\n dailyCalcFlexiSheet.getRange(dailyCalcFlexiSheet.getLastRow()+1 , 1).setValue(today.toLocaleDateString('en-MY'));\n\n dailyCalcFlexiSheet.getRange(dailyCalcFlexiSheet.getLastRow() , 2 , tempArr.length , tempArr[0].length).setValues(tempArr);\n \n } else {\n\n dailyCalcFlexiSheet.getRange(dailyCalcFlexiSheet.getLastRow()+2 , 1).setValue(today.toLocaleDateString('en-MY'));\n\n dailyCalcFlexiSheet.getRange(dailyCalcFlexiSheet.getLastRow() , 2 , tempArr.length , tempArr[0].length).setValues(tempArr);\n\n }\n\n flexiSheet.getRange(2,1 , flexiArr.length , flexiArr[0].length).setValues(flexiArr);\n\n}", "title": "" }, { "docid": "5ee4239abb016491f8a614ec5c1de877", "score": "0.5350962", "text": "function updateProgress() {\n\tseek.value = video.currentTime;\n\tprogressBar.value = video.currentTime;\n}", "title": "" }, { "docid": "d31ee7b03e4a1f68dce83edaab002f90", "score": "0.535035", "text": "function findProgressPercent() {\n let percent;\n if (onBreak) {\n percent = Math.round(\n ((breakDuration - remainingTime) * 100) / breakDuration\n );\n } else {\n percent = Math.round(\n ((focusDuration - remainingTime) * 100) / focusDuration\n );\n }\n setProgressPercent(percent);\n }", "title": "" }, { "docid": "4f2a57da67224d80f75d3b5ce38b08df", "score": "0.53481585", "text": "function calculatePercentage () {\n // -- Calculate Percent using component collection\n // cc.first().attributes._isComplete\n // var p = adp.components.filter(function(m) { return m.get('_isComplete') == true; } ).length / adp.components.length\n\n var completionStr = JSON.parse(window.localStorage.getItem('cmi.suspend_data')).completion;\n var roundedPct = 0;\n ppjConsoleLog('Completion calc for: ' + completionStr);\n\n if (completionStr !== undefined) {\n var counts = _.countBy(completionStr.split(''));\n var pct = counts[1] / (counts[0] + counts[1]);\n roundedPct = Math.round(pct * 100);\n }\n\n return roundedPct;\n }", "title": "" }, { "docid": "1a322f86fe8c79610108e48da392a4b7", "score": "0.53465444", "text": "function updateProgression() {\n\n let currentProgression = parseInt(document.getElementById('progression').innerText);\n currentProgression++;\n document.getElementById('progression').innerText = currentProgression;\n // https://css-tricks.com/updating-a-css-variable-with-javascript/\n let progressionPercentage = (currentProgression / numberOfQuotes) * 100;\n let root = document.documentElement;\n root.style.setProperty('--progression-percentage', progressionPercentage + '%');\n playGame();\n}", "title": "" }, { "docid": "b20f1fe547e9acd6fb673b828fb57b70", "score": "0.5345586", "text": "function giveChangeCents(changeCentsRequired){\r\n var centRemainder = changeCentsRequired;\r\n if (centRemainder <= cidObj[\"QUARTER\"]){\r\n if (centRemainder % 0.25 == 0){\r\n resultObj[\"QUARTER\"] = centRemainder;\r\n centRemainder = 0;\r\n } else{\r\n resultObj[\"QUARTER\"] = Math.floor(centRemainder/0.25)*0.25;\r\n centRemainder = centRemainder % 0.25;\r\n }\r\n } else{\r\n resultObj[\"QUARTER\"] = 0;\r\n }\r\n\r\n if (centRemainder <= cidObj[\"DIME\"]){\r\n if (centRemainder % 0.10 == 0){\r\n resultObj[\"DIME\"] = centRemainder;\r\n centRemainder = 0;\r\n } else{\r\n resultObj[\"DIME\"] = Math.floor(centRemainder/0.10)*0.10;\r\n centRemainder = centRemainder % 0.10;\r\n }\r\n } else{\r\n resultObj[\"DIME\"] = 0;\r\n }\r\n\r\n if (centRemainder <= cidObj[\"NICKEL\"]){\r\n if (centRemainder % 0.05 == 0){\r\n resultObj[\"NICKEL\"] = centRemainder;\r\n centRemainder = 0;\r\n } else{\r\n resultObj[\"NICKEL\"] = Math.floor(centRemainder/0.05)*0.05;\r\n centRemainder = centRemainder % 0.05;\r\n }\r\n } else{\r\n resultObj[\"NICKEL\"] = 0;\r\n }\r\n\r\n if (centRemainder <= cidObj[\"PENNY\"]){\r\n resultObj[\"PENNY\"] = Math.round(centRemainder*100)/100;\r\n } else{\r\n status = \"INSUFFICIENT_FUNDS\";\r\n }\r\n\r\n \r\n }", "title": "" }, { "docid": "365f384aea983fb2dce6e5ed6f8c0fd9", "score": "0.5345324", "text": "function completionPercentage() {\r\n const result = (count / todos.length) * 100;\r\n setPercent(parseInt(result));\r\n }", "title": "" }, { "docid": "8dd72bce2c0cf766b4e61eaf431d8c95", "score": "0.5334874", "text": "function calc(){ (function()\n\t{\n\t\tvar costs = sum($(ts(\"cost\")).map(pick).get());\n\t\tvar personals = sum($(ts(\"personal\"), this).map(pick).get());\n\t\tvar presences = sum($(ts(\"presence\"), this).map(pick).get());\n\n\t\tif(presences == 0)\n\t\t\treturn;\n\n\t\tvar costpp = (costs - personals) / presences;\n\n\t\t// Update totals per person\n\t\t$(\"tr[data-type=user]\", this).each(function(){\n\t\t\tvar id = $(this).attr('data-user');\n\t\t\tvar a = pick(0, $(ts(\"presence\"), this));\n\t\t\tvar b = pick(0, $(ts(\"personal\"), this));\n\t\t\tupdate($(ts(\"change-visual\"), this), ((costpp * a + b)/100).toFixed(2));\n\t\t\tupdate($(\"[name='changes[\"+id+\"]']\"), (costpp * a + b).toFixed(0));\n\t\t});\n\n\t\t// Update totals\n\t\t$(ts(\"total-presence\"), this).text(presences);\n\t\t$(ts(\"total-personal\"), this).text((personals/100).toFixed(2)).attr('value', (personals/100).toFixed(2));\n\t\tvar total_cost = sum($(\"[name^='changes']\").map(pick).get())\n\t\t$(ts(\"total-changes\"), this).text((total_cost/100).toFixed(2)).attr('value', (total_cost/100).toFixed(2));\n\t\n\t}).bind($(\"#billEditorStandard\").get(0)).call(); }", "title": "" }, { "docid": "40db103e5aea9626b6de7ef60d505e06", "score": "0.5332203", "text": "function progress_update_bar(progress) {\n let total = 0;\n let error = 0;\n let running = 0;\n let complete = 0;\n let pending = 0;\n\n // Calculating the overall percentage\n for (const tag in progress) {\n for (const detid in progress[tag]) {\n total++;\n if (progress[tag][detid] == CMD_PENDING) {\n pending++;\n } else if (progress[tag][detid] == CMD_RUNNING) {\n running++;\n } else if (progress[tag][detid] == CMD_COMPLETE) {\n complete++;\n } else {\n error++;\n }\n }\n }\n if (total == 0) {\n return;\n }\n\n // Updating the overall session progress progress bar.\n const complete_percent = (100.0 * complete) / total;\n const error_percent = (100.0 * error) / total;\n const running_percent = (100 * running) / total;\n\n var bar_elem = $('#session-progress');\n bar_elem.children('.progress-complete').css('width', `${complete_percent}%`);\n bar_elem.children('.progress-running').css('width', `${running_percent}%`);\n bar_elem.children('.progress-error').css('width', `${error_percent}%`);\n}", "title": "" }, { "docid": "f4eeff612998ec8350879ea3b74dc36b", "score": "0.5330696", "text": "function calculateScore() {\n var pi = 3.142;\n score = ((sentOut + 1) * ((completed + 1) * 4)) / pi;\n }", "title": "" }, { "docid": "5b6625c637aa96f2077386d603df49ec", "score": "0.5328836", "text": "function updateProgress(story, cp, acp){\n var wordcount = story.match(/\\S+/g).length;\n var wordsTyped = story.slice(0,cp+acp).match(/\\S+/g) ? story.slice(0,cp+acp).match(/\\S+/g).length : 0;\n // var percentCompleted = (wordsTyped/wordcount*100);\n // document.getElementById('completed').innerHTML = percentCompleted.toFixed(0) + \"% Completed!\";\n var wordsLeft = story.slice(cp+acp,story.length).match(/\\S+/g) ? story.slice(cp+acp,story.length).match(/\\S+/g).length : 0;\n document.getElementById('stats').textContent = wordsLeft;\n var prog = document.getElementById(\"progress\");\n prog.value = wordsTyped;\n prog.max = wordcount;\n}", "title": "" }, { "docid": "eb2ce3ea9351b2142cd1f485076c266f", "score": "0.5326838", "text": "function update_ccontracting(ev) {\n var row = $axel($(ev.target).closest('.x-cc-FundingSource')), balance;\n balance = row.peek('ApprovedAmount') - row.peek('RequestedAmount');\n row.poke('Balance', { '#val' : balance, 'color' : balance >= 0 ? 'green' : 'red' });\n recompute_ccontracting();\n }", "title": "" }, { "docid": "1d5057d9e5cc98c1dec4f2d7ff168626", "score": "0.53198045", "text": "function updateProgressBar(minNumQ, answeredNumQ) {\n // TODO save some energy on calculate the exact progress for future\n // for now just roughly update\n var progress = \"0\";\n var percent = answeredNumQ / minNumQ;\n\n if (percent > 0 && percent < 0.3) progress = \"5\";\n else if (percent >= 0.3 && percent < 0.6) progress = \"33\";\n else if (percent >= 0.6 && percent <= 0.9) progress = \"66\";\n else if (percent > 0.9) progress = \"99\";\n\n $(\".progress-bar\").css(\"width\", progress + \"%\").attr(\"aria-valuenow\", progress);\n $(\"#progress-container p\").html(progress + \"% Complete\");\n}", "title": "" }, { "docid": "d7c6ee82ea8d45f58eab7bff43a71bea", "score": "0.53176606", "text": "function progress(update) {\n handleProgress(update);\n }", "title": "" }, { "docid": "ce5c162e963b5e8da94d0ae6eaa20d54", "score": "0.53176147", "text": "function progressUpdate()\n\t{\n\t\t//the percentage loaded based on the tween's progress\n\t\tloadingProgress = Math.round(progressTl.progress() * 100);\n\t\t//we put the percentage in the screen\n\t\t$(\".txt-perc\").text(loadingProgress + '%');\n\n\t}", "title": "" }, { "docid": "f67129760bb799276b85f8bad804372d", "score": "0.53143406", "text": "function progress(update) {\n handleProgress(update);\n }", "title": "" }, { "docid": "d589d25c6bf2db86833e74562f6eb31a", "score": "0.530808", "text": "function update_creport(ev) {\n var hr = $axel('#x-frep-CoachingHourlyRate').peek('CoachingHourlyRate'),\n row = $axel($(ev.target).closest('.x-CoachActivity'));\n row.poke('EffectiveHoursAmount', row.peek('EffectiveNbOfHours') * hr);\n row.poke('ActivityAmount', row.peek('EffectiveOtherExpensesAmount') * 1.0 + row.peek('EffectiveHoursAmount'));\n recompute_creport();\n }", "title": "" }, { "docid": "8b8ced3f4858480c2b68836599eb6775", "score": "0.53022146", "text": "estimateProgress() {\n if (this.won) return 100;\n\n var maxMyColorValue = 0;\n for (var x = 0; x < this.size; x++) {\n for (var y = 0; y < this.size; y++) {\n var tile = this.grid.cellContent({ x: x, y: y });\n if (tile && tile.type === this.copeWith && tile.value > maxMyColorValue) {\n maxMyColorValue = tile.value;\n }\n }\n }\n var progress = maxMyColorValue * 100 / this.syringeValue;\n return Math.floor(progress);\n }", "title": "" }, { "docid": "dd774a8bca47739c3ab5e577bc115a59", "score": "0.5302164", "text": "function advanceProgressBar(dp){\n setTimeout(function(){\n percentage += dp;\n var newVal = 3.10 * percentage * $(window).width() / 10;\n $('.progress-bar').css(\"width\", newVal);\n //$('.progress-bar').html(\"\" + Math.round(percentage*T/1000) );\n if (percentage>=0.98){\n actualSlide += 1;\n $('#actual-slide').html(\"\" + actualSlide );\n setBackground(actualSlide);\n setBackground(actualSlide+1, \"#preload\");\n content = $(\"#\"+actualSlide).html();\n $(\"#change-content\").html(content);\n $('#content p').css(\"font-size\", \"10vh\");\n $('#content p').css(\"padding\", \"0 3vh\");\n animateSlide(actualSlide);\n percentage = 0;\n color += 50505;\n console.log(color)\n $('.progress-bar').css(\"background-color\", setColor(actualSlide));\n }\n if (actualSlide <= 20 ) {\n advanceProgressBar(dp);\n }\n else {\n endIgnite();\n }\n }, t)\n }", "title": "" }, { "docid": "57baad2173c485425a187f6669de4918", "score": "0.52941793", "text": "function trackProgress(value, total) {\n\t\t\treturn Math.round(100 * value / total);\n\t\t}", "title": "" }, { "docid": "f955ecb1cd88a3b8ec021c6a6ec81437", "score": "0.5292787", "text": "function updateValues() {\n const cantidades = transacciones.map(transaccion => transaccion.cantidad);\n const total = cantidades.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const entradas = cantidades\n .filter(item => item > 0)\n .reduce((acc, item) => (acc += item), 0)\n .toFixed(2);\n const gastos = (cantidades.filter(item => item < 0).reduce((acc, item) => (acc += item), 0)\n *\n -1\n ).toFixed(2);\n balance.innerHTML = `$${total}`;\n moneyPlus.innerText = `$${entradas}`;\n moneyMinus.innerHTML = `$${gastos}`;\n}", "title": "" }, { "docid": "f6caf9dfb2e72bcf620446f9adc60fba", "score": "0.52920127", "text": "get downloadProgress() {\n let percent;\n if (this[kResponseSize]) {\n percent = this[kDownloadedSize] / this[kResponseSize];\n }\n else if (this[kResponseSize] === this[kDownloadedSize]) {\n percent = 1;\n }\n else {\n percent = 0;\n }\n return {\n percent,\n transferred: this[kDownloadedSize],\n total: this[kResponseSize]\n };\n }", "title": "" }, { "docid": "2661bd7cf50a44e36ba28f3ceb05f64e", "score": "0.52808297", "text": "function percent(){\n if(operations.length != 0 && !resultFlag){\n var num = parseFloat(numString);\n num = num / 100;\n numString = num.toString();\n updateNumString();\n operations.pop();\n operations.push(num);\n updateOperations();\n }\n}", "title": "" }, { "docid": "0f519b36b52e0a83b086fc70dbbd1baa", "score": "0.52800924", "text": "function final() { \n\t//console.log(\"fraction of zero helpful reviews\");\n\t//console.log(totalZeroHelpfulReviews/totalReviews);\n\t\t\t\n}", "title": "" }, { "docid": "44c25aa1a57123a8694941c80abe2bbb", "score": "0.52786744", "text": "function doPercentage() {\n var menuOffset = x_pageInfo[0].type == 'menu' ? 1 : 0;\n\t\n\t// by default stand-alone pages are excluded from being included in progress - this can be overridden with optional property\n var totalPages = $(x_pageInfo).filter(function(i){ return this.standalone != true || x_pages[i].getAttribute('reqProgress') == 'true'; }).length - menuOffset,\n\t\tpagesViewed = $(x_pageInfo).filter(function(i){ return (this.viewed !== false && (this.standalone != true || x_pages[i].getAttribute('reqProgress') == 'true')) || this.builtLightBox == true || this.builtNewWindow == true; }).length - menuOffset;\n\t\n var progress = Math.round((pagesViewed * 100) / totalPages),\n\t\tpBarText = x_getLangInfo(x_languageData.find(\"progressBar\")[0], \"label\", \"COMPLETE\");\n\n $(\".pbBar\").css({\"width\": progress + \"%\"});\n $('.pbTxt').html(progress + \"% \" + pBarText);\n}", "title": "" }, { "docid": "c949977f76b46a2749bcbe0a3ee10844", "score": "0.5272108", "text": "function updateValues() {\n const amounts = transactions.map(transaction => transaction.amount);\n\n const total = amounts.reduce((acc, item) => (acc += item), 0).toFixed(2);\n\n const income = amounts\n .filter(item => item > 0)\n .reduce((acc, item) => (acc += item), 0)\n .toFixed(2);\n\n const expense = (\n amounts.filter(item => item < 0).reduce((acc, item) => (acc += item), 0) *\n -1\n ).toFixed(2);\n\n balance.innerText = `$${total}`;\n money_plus.innerText = `$${income}`;\n money_minus.innerText = `$${expense}`;\n}", "title": "" }, { "docid": "6623edf498562cc81bc932f4935b1c35", "score": "0.5266404", "text": "function updateDiscrete (payout) {\n\n\tupdateGame(payout);\n\tconsole.log(\"Discrete payout: \" + payout);\n\n\t//carve up post-second-bonus pixels into fixed amount between this turn and last turn\n\n\t// WARNING: .css modifies the element's <style> property, not the CSS sheet!\n\n\t//updates dollars counter if bonus is reached. These functions are called from displayResultsDialog above\n\n}", "title": "" } ]
02d84216611b3b2abb1a1b3808944455
Regenerate tree map objects for all ContentBlocks that have changed between the current editorState and newContent. Returns an OrderedMap with only changed regenerated tree map objects.
[ { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.72953117", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" } ]
[ { "docid": "154e854d734061756e609adc152673ce", "score": "0.7532297", "text": "function regenerateTreeForNewBlocks(editorState,newBlockMap,newEntityMap,decorator){var contentState=editorState.getCurrentContent().set(\"entityMap\",newEntityMap),prevBlockMap=contentState.getBlockMap();return editorState.getImmutable().get(\"treeMap\").merge(newBlockMap.toSeq().filter(function(block,key){return block!==prevBlockMap.get(key);}).map(function(block){return BlockTree.generate(contentState,block,decorator);}));}", "title": "" }, { "docid": "a0081849fe306d290ebffb78d68b5b8f", "score": "0.72981375", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, decorator) {\n\t var prevBlockMap = editorState.getCurrentContent().getBlockMap();\n\t var prevTreeMap = editorState.getImmutable().get('treeMap');\n\t return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n\t return block !== prevBlockMap.get(key);\n\t }).map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }));\n\t}", "title": "" }, { "docid": "a0081849fe306d290ebffb78d68b5b8f", "score": "0.72981375", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, decorator) {\n\t var prevBlockMap = editorState.getCurrentContent().getBlockMap();\n\t var prevTreeMap = editorState.getImmutable().get('treeMap');\n\t return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n\t return block !== prevBlockMap.get(key);\n\t }).map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }));\n\t}", "title": "" }, { "docid": "1f16d076c50b5f1f3e00798f459cd08c", "score": "0.6982328", "text": "function generateNewTreeMap(contentState,decorator){return contentState.getBlockMap().map(function(block){return BlockTree.generate(contentState,block,decorator);}).toOrderedMap();}", "title": "" }, { "docid": "3393da6433b81d7defb48d9544f6f07d", "score": "0.64908797", "text": "function generateNewTreeMap(contentState, decorator) {\n\t return contentState.getBlockMap().map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }).toOrderedMap();\n\t}", "title": "" }, { "docid": "3393da6433b81d7defb48d9544f6f07d", "score": "0.64908797", "text": "function generateNewTreeMap(contentState, decorator) {\n\t return contentState.getBlockMap().map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }).toOrderedMap();\n\t}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.6416186", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" }, { "docid": "1462e033d8fc04c01da040bd8c73692b", "score": "0.62190425", "text": "function regenerateTreeForNewDecorator(content,blockMap,previousTreeMap,decorator,existingDecorator){return previousTreeMap.merge(blockMap.toSeq().filter(function(block){return decorator.getDecorations(block,content)!==existingDecorator.getDecorations(block,content);}).map(function(block){return BlockTree.generate(content,block,decorator);}));}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6093931", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "ff970c9e7c0bd77bf8ef5350ab92de81", "score": "0.5573115", "text": "_rebuildTree() {\n const {_cache} = this;\n\n // Reset states\n for (const tile of _cache.values()) {\n tile.parent = null;\n tile.children.length = 0;\n }\n\n // Rebuild tree\n for (const tile of _cache.values()) {\n const parent = this._getNearestAncestor(tile.x, tile.y, tile.z);\n tile.parent = parent;\n if (parent) {\n parent.children.push(tile);\n }\n }\n }", "title": "" }, { "docid": "13624885c73d12c134606a2f0d5e18da", "score": "0.5513197", "text": "function regenerateTreeForNewDecorator(blockMap, previousTreeMap, decorator, existingDecorator) {\n\t return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n\t return decorator.getDecorations(block) !== existingDecorator.getDecorations(block);\n\t }).map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }));\n\t}", "title": "" }, { "docid": "13624885c73d12c134606a2f0d5e18da", "score": "0.5513197", "text": "function regenerateTreeForNewDecorator(blockMap, previousTreeMap, decorator, existingDecorator) {\n\t return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n\t return decorator.getDecorations(block) !== existingDecorator.getDecorations(block);\n\t }).map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }));\n\t}", "title": "" }, { "docid": "fee54b8273fd3f88e42f509f8da7de1b", "score": "0.54747665", "text": "rebased(newMaps, rebasedTransform, positions) {\n if (this.events == 0) return\n\n let rebasedItems = [], start = this.items.length - positions.length, startPos = 0\n if (start < 1) {\n startPos = 1 - start\n start = 1\n this.items[0] = new Item\n }\n\n if (positions.length) {\n let remap = new Remapping([], newMaps.slice())\n for (let iItem = start, iPosition = startPos; iItem < this.items.length; iItem++) {\n let item = this.items[iItem], pos = positions[iPosition++], id\n if (pos != -1) {\n let map = rebasedTransform.maps[pos]\n if (item.step) {\n let step = rebasedTransform.steps[pos].invert(rebasedTransform.docs[pos])\n let selection = item.selection && item.selection.type.mapToken(item.selection, remap)\n rebasedItems.push(new StepItem(map, item.id, step, selection))\n } else {\n rebasedItems.push(new MapItem(map))\n }\n id = remap.addToBack(map)\n }\n remap.addToFront(item.map.invert(), id)\n }\n\n this.items.length = start\n }\n\n for (let i = 0; i < newMaps.length; i++)\n this.items.push(new MapItem(newMaps[i]))\n for (let i = 0; i < rebasedItems.length; i++)\n this.items.push(rebasedItems[i])\n\n if (!this.compressing && this.emptyItems(start) + newMaps.length > max_empty_items)\n this.compress(start + newMaps.length)\n }", "title": "" }, { "docid": "6f772a9157935bb1076f49c4702d75d6", "score": "0.54519355", "text": "newTreeState_INTERNAL() {\n if (this._changes.size === 0) {\n return this._treeState;\n }\n\n const newState = copyTreeState$1(this._treeState);\n\n for (const [k, v] of this._changes) {\n writeLoadableToTreeState$1(newState, k, loadableWithValue$1(v));\n }\n\n invalidateDownstreams$1(this._store, newState);\n return newState;\n }", "title": "" }, { "docid": "154cbe051ee9483af3fc63e0c8f50f40", "score": "0.5432846", "text": "_diffMarker(oldData,newData) {\n\n //get updating data\n //first second level for editor and open if the input was expanded\n let pendingElements = {'first':{},'second':{},'open':{}};\n for(let i = 0 ; i < oldData.length; i++){\n if(oldData[i].showChildren){\n pendingElements.open[oldData[i]._id] = true;\n }\n if(oldData[i]._updated == true) {\n pendingElements.first[oldData[i]._id] = oldData[i].value;\n }\n\n if(oldData[i].__t == 'Component') {\n for(let j = 0 ; j < oldData[i].children.length; j++){\n if(oldData[i].children[j]._updated == true) {\n pendingElements.second[oldData[i].children[j]._id] = oldData[i].children[j].value;\n }\n }\n }\n }\n\n for(let i = 0 ; i < newData.length; i++){\n //check parent level for updated data\n if(pendingElements.first[newData[i]._id] && pendingElements.first[newData[i]._id] !== newData[i].value) {\n newData[i]._newData = newData[i].value;\n newData[i].value = pendingElements.first[newData[i]._id];\n newData[i]._updated = true;\n }\n if(pendingElements.open[newData[i]._id]) {\n newData[i].showChildren = true;\n }\n\n //check child level for updated data\n if(newData[i].__t == 'Component') {\n for(let j = 0 ; j < newData[i].children.length; j++){\n if(pendingElements.second[newData[i].children[j]._id] && pendingElements.second[newData[i].children[j]._id] !== newData[i].children[j].value) {\n newData[i].children[j]._newData = newData[i].children[j].value;\n newData[i].children[j].value = pendingElements.second[newData[i].children[j]._id];\n newData[i].children[j]._updated = true;\n }\n }\n }\n }\n\n return newData;\n }", "title": "" }, { "docid": "63e58611212874d378c5c9d5fe48b7f1", "score": "0.5277804", "text": "replace(_from, _to, nodes) {\n return HeightMap.of(nodes)\n }", "title": "" }, { "docid": "2aff2d95d2b522906e3b3a4a823e72e4", "score": "0.526695", "text": "replace(_from, _to, nodes) {\n return HeightMap.of(nodes);\n }", "title": "" }, { "docid": "a9c2df38edc0a6b22584348d158870f1", "score": "0.52580684", "text": "replace(_from, _to, nodes) {\n return HeightMap.of(nodes);\n }", "title": "" }, { "docid": "d978550109383cfc3ab964001c0a71f4", "score": "0.5161556", "text": "function adjustBlockDepthForContentState(contentState,selectionState,adjustment,maxDepth){var startKey=selectionState.getStartKey(),endKey=selectionState.getEndKey(),blockMap=contentState.getBlockMap(),blocks=blockMap.toSeq().skipUntil(function(_,k){return k===startKey;}).takeUntil(function(_,k){return k===endKey;}).concat([[endKey,blockMap.get(endKey)]]).map(function(block){var depth=block.getDepth()+adjustment;return depth=Math.max(0,Math.min(depth,maxDepth)),block.set(\"depth\",depth);});return blockMap=blockMap.merge(blocks),contentState.merge({blockMap:blockMap,selectionBefore:selectionState,selectionAfter:selectionState});}", "title": "" }, { "docid": "dcd69e158bf92c9a4bb8274c54de479c", "score": "0.51338804", "text": "function mapCopyContent(oldMap, newMap) {\n clear(oldMap);\n for (var prop in newMap) {\n if (newMap.hasOwnProperty(prop)) {\n oldMap[prop] = newMap[prop];\n }\n }\n}", "title": "" }, { "docid": "f3f7ec38e7e65b38c055da35cf4588d7", "score": "0.5085902", "text": "_createParentStates(states) {\n const self = this;\n const { $state } = this;\n const updateStates = states.map((state, index) => {\n let { embeddedViews = [] } = state;\n const stateData = self.createParentState(state);\n\n $state.stateRegistry.register(stateData);\n\n const modifiedEmbeddedViews = embeddedViews.reduce((views, embeddedView) => {\n return [\n ...views,\n ...self._createEmbeddedStates(embeddedView, state, states)\n ];\n }, []);\n\n return Object.assign({}, stateData, {\n embeddedViews: modifiedEmbeddedViews\n });\n });\n\n return updateStates;\n }", "title": "" }, { "docid": "7d75d186d15ce304f38870fcc4a975e5", "score": "0.5065318", "text": "function mapNodeAndRefreshWhenChanged(mapping, valueToMap) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap) || [];\n \n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0)\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n \n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.splice(0, mappedNodes.length);\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { 'disposeWhen': function() { return (mappedNodes.length == 0) || !ko.utils.domNodeIsAttachedToDocument(mappedNodes[0]) } });\n return mappedNodes;\n }", "title": "" }, { "docid": "edcd85a139679f029ff7e7dbbf51066d", "score": "0.502375", "text": "dropEmptyBlocks() {\n Object.keys(this.emptyMap).forEach((parentBlockId) => {\n const node = this.emptyMap[parentBlockId];\n if (node.updateReference !== this.updateReference) {\n node.parent.removeChild(node);\n delete this.emptyMap[parentBlockId];\n }\n });\n }", "title": "" }, { "docid": "9af9bc1039f8d54f67ff2bf77572791e", "score": "0.50144106", "text": "function populateMaps() {\n // Populate maps by reading the entire blockchain\n let indices = [];\n let blockHeight = blockchain.getBlockHeight();\n // Skip genesis block as there is no star information on it\n if (blockHeight > 0) {\n let promises = [];\n for (let i = 1; i <= blockHeight; i++) {\n let promise = blockchain.getBlock(i).then(block => populateMapsFromBlock(block));\n promises.push(promise);\n }\n Promise.all(promises).then(() => console.log('Populated internal maps'));\n } \n}", "title": "" }, { "docid": "82655531f038c6524069599251ab2f09", "score": "0.49644384", "text": "function changeOrder() {\n\tvar controlsNode = this.parentNode.parentNode;\n\tvar maps = $(controlsNode).parent().parent().find('.map');\n\tvar orderedMaps = [];\n\tfor (var i = 0; i < maps.length; i++) {\n\t\torderedMaps[maps.length - 1 - i] = maps[i];\n\t}\n\tvar mapsNode = $(controlsNode.parentNode.parentNode).find('.maps')[0];\n\toutputMaps(orderedMaps, mapsNode);\n}", "title": "" }, { "docid": "127d736dc6c14f350e28e3ebc6426809", "score": "0.49643147", "text": "SET_NODES_TO_MAP(state, { nodes, rootComponentSetId }) {\n const { rootComponentSetIds, projectIds, nodesMap } = state\n\n toArray(nodes).forEach(node => {\n const id = node[ID]\n const parentId = node[PARENT_ID]\n\n if (\n isComponentSet(node) &&\n !rootComponentSetIds.find(id => id === node.id)\n ) {\n rootComponentSetIds.push(node.id)\n }\n else if (isProject(node) && !projectIds.find(id => id === node.id)) {\n projectIds.push(node.id)\n }\n\n node[CHILDREN] = childrenOf[id] = childrenOf[id] || []\n\n if (parentId) {\n childrenOf[parentId] = childrenOf[parentId] || []\n const isExist = findBy(childrenOf[parentId], 'id', node.id)\n // this context only happens when hot reload\n if (!isExist) {\n childrenOf[parentId].push(node)\n }\n }\n\n Vue.set(nodesMap, id, node)\n defineProperties(node, rootComponentSetId)\n })\n }", "title": "" }, { "docid": "d3e6d780c0f2de5691e4b7286c2e00cb", "score": "0.48769343", "text": "descendBlocks() {\r\n if (BOARD_DEBUG.DESCEND_BLOCKS) {\r\n debug(\"Board.descendBlocks\")\r\n }\r\n // use this object to keep track of pill indices that were already checked\r\n var pill_indices_checked_map = new Map();\r\n // use this object to keep track of pill indices that were already moved\r\n var pill_indices_moved_map = new Map();\r\n // use this object as the grid to store the updated boxes until the end\r\n var new_grid = this.grid.copy();\r\n\r\n // check each row for blocks that should descend\r\n for (var r = this.grid.properties.divisions.y - 1; r >= 0; r--) {\r\n for (var c = 0; c <= this.grid.properties.divisions.x - 2; c++) {\r\n // don't do anything if there's no pill at [c][r]\r\n if(!this.grid.cellContainsBox(c, r)) {\r\n continue;\r\n }\r\n var pill_index_at_ij = this.grid.get(c, r).index;\r\n\r\n if (BOARD_DEBUG.DESCEND_BLOCKS) {\r\n debug(\"LOOP START - INDEX GOOD: [c=\", c, \"][r=\", r, \"].index=\", pill_index_at_ij)\r\n }\r\n if (pill_indices_checked_map.check(pill_index_at_ij)) {\r\n continue;\r\n }\r\n // at this point we know that the pill_index_at_ij is not in the\r\n // checked map, so add it\r\n if (BOARD_DEBUG.DESCEND_BLOCKS) {\r\n debug(\"LOOP - ADDING INDEX TO MAP [c=\", c, \"][r=\", r, \"].index=\", pill_index_at_ij)\r\n }\r\n // because this loop is iterating bottom to top and left to right,\r\n // this will always get to the lower box of a vertical pill first.\r\n // for that reason, it is okay to just check the box right below\r\n // [c][r]\r\n var descend = (this.pill_manager.isHorizontal(pill_index_at_ij)) ?\r\n this.canHorizontalPillDescend(c, r) :\r\n (this.pill_manager.isVertical(pill_index_at_ij)) ?\r\n this.canVerticalPillDescend(c, r) :\r\n false;\r\n\r\n if (BOARD_DEBUG.DESCEND_BLOCKS) {\r\n debug(\"LOOP - DESCEND=\", descend);\r\n }\r\n\r\n if(!descend) { continue; }\r\n\r\n // for horizontal pills, check if this.grid[grid_i][grid_j+1]\r\n // has a pill in it\r\n // for vertical pills, check if this.grid[grid_i][grid_j+1] has a\r\n // pill in it. if there is, check to see if it's the same pill,\r\n // as it will be when we hit the second box of the pill\r\n if (!pill_indices_moved_map.check(pill_index_at_ij)) {\r\n if (BOARD_DEBUG.DESCEND_BLOCKS) {\r\n debug(\"LOOP - DESCENDING PILL: c=\", c, \"][r=\", r, \"], index=\", pill_index_at_ij)\r\n }\r\n this.descendBoardPill(new_grid, pill_index_at_ij, c, r);\r\n if (BOARD_DEBUG.DESCEND_BLOCKS) {\r\n debug(\"AFTER descendBoardPill - New Grid\")\r\n debug(new_grid)\r\n }\r\n } else {\r\n if (BOARD_DEBUG.DESCEND_BLOCKS) {\r\n debug(\"LOOP - PILL ALREADY MOVED: c=\", c, \"][r=\", r, \"], index=\", pill_index_at_ij)\r\n }\r\n } // if already moved\r\n } // for\r\n } // for\r\n\r\n // set this.grid to the updated grid\r\n this.grid = new_grid;\r\n }", "title": "" }, { "docid": "a093f5e576e6584c762f3563f2c20ac7", "score": "0.48478276", "text": "function refresh() {\n\n\tvar sitemap = {};\n\tvar helper = {};\n\tvar navigation = {};\n\tvar partial = [];\n\n\tvar sql = DB();\n\n\tsql.select('pages', 'tbl_page').make(function(builder) {\n\t\tbuilder.where('isremoved', false);\n\t\tbuilder.fields('id', 'url', 'name', 'title', 'parent', 'language', 'icon', 'ispartial', 'navigations', 'tags', 'priority');\n\t});\n\n\tsql.exec(function(err, response) {\n\n\t\tfor (var i = 0, length = response.pages.length; i < length; i++) {\n\t\t\tvar page = response.pages[i];\n\n\t\t\t// A partial content is skipped from the sitemap\n\t\t\tif (page.ispartial) {\n\t\t\t\tpartial.push({ id: page.id, url: page.url, name: page.name, title: page.title, language: page.language, icon: page.icon, tags: page.tags, priority: page.priority });\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Prepares navigations\n\t\t\tpage.navigations = page.navigations ? page.navigations.split(';') : [];\n\n\t\t\tvar key = (page.language ? page.language + ':' : '') + page.url;\n\t\t\thelper[page.id] = key;\n\t\t\tsitemap[key] = page;\n\n\t\t\tif (!page.navigations.length)\n\t\t\t\tcontinue;\n\n\t\t\tfor (var j = 0, jl = page.navigations.length; j < jl; j++) {\n\t\t\t\tvar name = page.navigations[j];\n\t\t\t\tif (!navigation[name])\n\t\t\t\t\tnavigation[name] = [];\n\t\t\t\tnavigation[name].push({ url: page.url, name: page.name, title: page.title, priority: page.priority, language: page.language, icon: page.icon, tags: page.tags });\n\t\t\t}\n\t\t}\n\n\t\t// Pairs parents by URL\n\t\tObject.keys(sitemap).forEach(function(key) {\n\t\t\tvar parent = sitemap[key].parent;\n\t\t\tif (parent)\n\t\t\t\tsitemap[key].parent = helper[parent];\n\t\t});\n\n\t\t// Sorts navigation according to priority\n\t\tObject.keys(navigation).forEach(function(name) {\n\t\t\tnavigation[name].sort(function(a, b) {\n\t\t\t\tif (a.priority > b.priority)\n\t\t\t\t\treturn -1;\n\t\t\t\treturn a.priority < b.priority ? 1 : 0;\n\t\t\t});\n\t\t});\n\n\t\tpartial.sort((a, b) => a.priority > b.priority ? -1 : a.priority === b.priority ? 0 : 1);\n\n\t\tF.global.navigations = navigation;\n\t\tF.global.sitemap = sitemap;\n\t\tF.global.partial = partial;\n\n\t\tF.cache.removeAll('cache.');\n\t});\n}", "title": "" }, { "docid": "6999f2781080babb877d27428d60d601", "score": "0.4846837", "text": "function updateGroups() {\n function createGroup(groupInfo, itemsContainer) {\n var GroupType = (groupInfo.enableCellSpanning ?\n Groups.CellSpanningGroup :\n Groups.UniformGroup);\n return new GroupType(that, itemsContainer);\n }\n\n var oldRealizedItemRange = (that._groups.length > 0 ?\n that._getRealizationRange() :\n null),\n newGroups = [],\n prepared = [],\n cleanUpDom = {},\n newGroupMap = {},\n currentIndex = 0,\n len = tree.length,\n i;\n\n for (i = 0; i < len; i++) {\n var oldChangedRealizedRangeInGroup = null,\n groupInfo = that._getGroupInfo(i),\n groupKey = that._site.groupFromIndex(i).key,\n oldGroup = that._groupMap[groupKey],\n wasCellSpanning = oldGroup instanceof Groups.CellSpanningGroup,\n isCellSpanning = groupInfo.enableCellSpanning;\n\n if (oldGroup) {\n if (wasCellSpanning !== isCellSpanning) {\n // The group has changed types so DOM needs to be cleaned up\n cleanUpDom[groupKey] = true;\n } else {\n // Compute the range of changed items that is within the group's realized range\n var firstChangedIndexInGroup = Math.max(0, changedRange.firstIndex - oldGroup.startIndex),\n oldRealizedItemRangeInGroup = that._rangeForGroup(oldGroup, oldRealizedItemRange);\n if (oldRealizedItemRangeInGroup && firstChangedIndexInGroup <= oldRealizedItemRangeInGroup.lastIndex) {\n // The old changed realized range is non-empty\n oldChangedRealizedRangeInGroup = {\n firstIndex: Math.max(firstChangedIndexInGroup, oldRealizedItemRangeInGroup.firstIndex),\n lastIndex: oldRealizedItemRangeInGroup.lastIndex\n };\n }\n }\n }\n var group = createGroup(groupInfo, tree[i].itemsContainer.element);\n var prepareLayoutPromise;\n if (group.prepareLayoutWithCopyOfTree) {\n prepareLayoutPromise = group.prepareLayoutWithCopyOfTree(copyItemsContainerTree(tree[i].itemsContainer), oldChangedRealizedRangeInGroup, oldGroup, {\n groupInfo: groupInfo,\n startIndex: currentIndex,\n });\n } else {\n prepareLayoutPromise = group.prepareLayout(getItemsContainerLength(tree[i].itemsContainer), oldChangedRealizedRangeInGroup, oldGroup, {\n groupInfo: groupInfo,\n startIndex: currentIndex,\n });\n }\n prepared.push(prepareLayoutPromise);\n\n currentIndex += group.count;\n\n newGroups.push(group);\n newGroupMap[groupKey] = group;\n }\n\n return Promise.join(prepared).then(function () {\n var currentOffset = 0;\n for (var i = 0, len = newGroups.length; i < len; i++) {\n var group = newGroups[i];\n group.offset = currentOffset;\n currentOffset += that._getGroupSize(group);\n }\n\n // Clean up deleted groups\n Object.keys(that._groupMap).forEach(function (deletedKey) {\n var skipDomCleanUp = !cleanUpDom[deletedKey];\n that._groupMap[deletedKey].cleanUp(skipDomCleanUp);\n });\n\n that._groups = newGroups;\n that._groupMap = newGroupMap;\n });\n }", "title": "" }, { "docid": "b138641dbc4cab8fc1557346794498ec", "score": "0.48190996", "text": "function reorder(aChildren, bChildren) {\n\t // O(M) time, O(M) memory\n\t var bChildIndex = keyIndex(bChildren)\n\t var bKeys = bChildIndex.keys\n\t var bFree = bChildIndex.free\n\t\n\t if (bFree.length === bChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\t\n\t // O(N) time, O(N) memory\n\t var aChildIndex = keyIndex(aChildren)\n\t var aKeys = aChildIndex.keys\n\t var aFree = aChildIndex.free\n\t\n\t if (aFree.length === aChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\t\n\t // O(MAX(N, M)) memory\n\t var newChildren = []\n\t\n\t var freeIndex = 0\n\t var freeCount = bFree.length\n\t var deletedItems = 0\n\t\n\t // Iterate through a and match a node in b\n\t // O(N) time,\n\t for (var i = 0 ; i < aChildren.length; i++) {\n\t var aItem = aChildren[i]\n\t var itemIndex\n\t\n\t if (aItem.key) {\n\t if (bKeys.hasOwnProperty(aItem.key)) {\n\t // Match up the old keys\n\t itemIndex = bKeys[aItem.key]\n\t newChildren.push(bChildren[itemIndex])\n\t\n\t } else {\n\t // Remove old keyed items\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t } else {\n\t // Match the item in a with the next free item in b\n\t if (freeIndex < freeCount) {\n\t itemIndex = bFree[freeIndex++]\n\t newChildren.push(bChildren[itemIndex])\n\t } else {\n\t // There are no free items in b to match with\n\t // the free items in a, so the extra free nodes\n\t // are deleted.\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t }\n\t }\n\t\n\t var lastFreeIndex = freeIndex >= bFree.length ?\n\t bChildren.length :\n\t bFree[freeIndex]\n\t\n\t // Iterate through b and append any new keys\n\t // O(M) time\n\t for (var j = 0; j < bChildren.length; j++) {\n\t var newItem = bChildren[j]\n\t\n\t if (newItem.key) {\n\t if (!aKeys.hasOwnProperty(newItem.key)) {\n\t // Add any new keyed items\n\t // We are adding new items to the end and then sorting them\n\t // in place. In future we should insert new items in place.\n\t newChildren.push(newItem)\n\t }\n\t } else if (j >= lastFreeIndex) {\n\t // Add any leftover non-keyed items\n\t newChildren.push(newItem)\n\t }\n\t }\n\t\n\t var simulate = newChildren.slice()\n\t var simulateIndex = 0\n\t var removes = []\n\t var inserts = []\n\t var simulateItem\n\t\n\t for (var k = 0; k < bChildren.length;) {\n\t var wantedItem = bChildren[k]\n\t simulateItem = simulate[simulateIndex]\n\t\n\t // remove items\n\t while (simulateItem === null && simulate.length) {\n\t removes.push(remove(simulate, simulateIndex, null))\n\t simulateItem = simulate[simulateIndex]\n\t }\n\t\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t // if we need a key in this position...\n\t if (wantedItem.key) {\n\t if (simulateItem && simulateItem.key) {\n\t // if an insert doesn't put this key in place, it needs to move\n\t if (bKeys[simulateItem.key] !== k + 1) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t simulateItem = simulate[simulateIndex]\n\t // if the remove didn't put the wanted item in place, we need to insert it\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t // items are matching, so skip ahead\n\t else {\n\t simulateIndex++\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t k++\n\t }\n\t // a key in simulate has no matching wanted key, remove it\n\t else if (simulateItem && simulateItem.key) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t }\n\t }\n\t else {\n\t simulateIndex++\n\t k++\n\t }\n\t }\n\t\n\t // remove all the remaining nodes from simulate\n\t while(simulateIndex < simulate.length) {\n\t simulateItem = simulate[simulateIndex]\n\t removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n\t }\n\t\n\t // If the only moves we have are deletes then we can just\n\t // let the delete patch remove these items.\n\t if (removes.length === deletedItems && !inserts.length) {\n\t return {\n\t children: newChildren,\n\t moves: null\n\t }\n\t }\n\t\n\t return {\n\t children: newChildren,\n\t moves: {\n\t removes: removes,\n\t inserts: inserts\n\t }\n\t }\n\t}", "title": "" }, { "docid": "b138641dbc4cab8fc1557346794498ec", "score": "0.48190996", "text": "function reorder(aChildren, bChildren) {\n\t // O(M) time, O(M) memory\n\t var bChildIndex = keyIndex(bChildren)\n\t var bKeys = bChildIndex.keys\n\t var bFree = bChildIndex.free\n\t\n\t if (bFree.length === bChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\t\n\t // O(N) time, O(N) memory\n\t var aChildIndex = keyIndex(aChildren)\n\t var aKeys = aChildIndex.keys\n\t var aFree = aChildIndex.free\n\t\n\t if (aFree.length === aChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\t\n\t // O(MAX(N, M)) memory\n\t var newChildren = []\n\t\n\t var freeIndex = 0\n\t var freeCount = bFree.length\n\t var deletedItems = 0\n\t\n\t // Iterate through a and match a node in b\n\t // O(N) time,\n\t for (var i = 0 ; i < aChildren.length; i++) {\n\t var aItem = aChildren[i]\n\t var itemIndex\n\t\n\t if (aItem.key) {\n\t if (bKeys.hasOwnProperty(aItem.key)) {\n\t // Match up the old keys\n\t itemIndex = bKeys[aItem.key]\n\t newChildren.push(bChildren[itemIndex])\n\t\n\t } else {\n\t // Remove old keyed items\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t } else {\n\t // Match the item in a with the next free item in b\n\t if (freeIndex < freeCount) {\n\t itemIndex = bFree[freeIndex++]\n\t newChildren.push(bChildren[itemIndex])\n\t } else {\n\t // There are no free items in b to match with\n\t // the free items in a, so the extra free nodes\n\t // are deleted.\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t }\n\t }\n\t\n\t var lastFreeIndex = freeIndex >= bFree.length ?\n\t bChildren.length :\n\t bFree[freeIndex]\n\t\n\t // Iterate through b and append any new keys\n\t // O(M) time\n\t for (var j = 0; j < bChildren.length; j++) {\n\t var newItem = bChildren[j]\n\t\n\t if (newItem.key) {\n\t if (!aKeys.hasOwnProperty(newItem.key)) {\n\t // Add any new keyed items\n\t // We are adding new items to the end and then sorting them\n\t // in place. In future we should insert new items in place.\n\t newChildren.push(newItem)\n\t }\n\t } else if (j >= lastFreeIndex) {\n\t // Add any leftover non-keyed items\n\t newChildren.push(newItem)\n\t }\n\t }\n\t\n\t var simulate = newChildren.slice()\n\t var simulateIndex = 0\n\t var removes = []\n\t var inserts = []\n\t var simulateItem\n\t\n\t for (var k = 0; k < bChildren.length;) {\n\t var wantedItem = bChildren[k]\n\t simulateItem = simulate[simulateIndex]\n\t\n\t // remove items\n\t while (simulateItem === null && simulate.length) {\n\t removes.push(remove(simulate, simulateIndex, null))\n\t simulateItem = simulate[simulateIndex]\n\t }\n\t\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t // if we need a key in this position...\n\t if (wantedItem.key) {\n\t if (simulateItem && simulateItem.key) {\n\t // if an insert doesn't put this key in place, it needs to move\n\t if (bKeys[simulateItem.key] !== k + 1) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t simulateItem = simulate[simulateIndex]\n\t // if the remove didn't put the wanted item in place, we need to insert it\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t // items are matching, so skip ahead\n\t else {\n\t simulateIndex++\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t k++\n\t }\n\t // a key in simulate has no matching wanted key, remove it\n\t else if (simulateItem && simulateItem.key) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t }\n\t }\n\t else {\n\t simulateIndex++\n\t k++\n\t }\n\t }\n\t\n\t // remove all the remaining nodes from simulate\n\t while(simulateIndex < simulate.length) {\n\t simulateItem = simulate[simulateIndex]\n\t removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n\t }\n\t\n\t // If the only moves we have are deletes then we can just\n\t // let the delete patch remove these items.\n\t if (removes.length === deletedItems && !inserts.length) {\n\t return {\n\t children: newChildren,\n\t moves: null\n\t }\n\t }\n\t\n\t return {\n\t children: newChildren,\n\t moves: {\n\t removes: removes,\n\t inserts: inserts\n\t }\n\t }\n\t}", "title": "" }, { "docid": "06c1eb968c06fe4b46fc3bb4ae6b5b17", "score": "0.47996324", "text": "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n \n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n \n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "title": "" }, { "docid": "4c0a9173059411c9df98391eee55f31e", "score": "0.47919008", "text": "function updateChildren (newNode, oldNode) {\n // if (DEBUG) {\n // console.log(\n // 'updateChildren\\nold\\n %s\\nnew\\n %s',\n // oldNode && oldNode.outerHTML,\n // newNode && newNode.outerHTML\n // )\n // }\n var oldChild, newChild, morphed, oldMatch\n\n // The offset is only ever increased, and used for [i - offset] in the loop\n var offset = 0\n\n for (var i = 0; ; i++) {\n oldChild = oldNode.childNodes[i]\n newChild = newNode.childNodes[i - offset]\n // if (DEBUG) {\n // console.log(\n // '===\\n- old\\n %s\\n- new\\n %s',\n // oldChild && oldChild.outerHTML,\n // newChild && newChild.outerHTML\n // )\n // }\n // Both nodes are empty, do nothing\n if (!oldChild && !newChild) {\n break\n\n // There is no new child, remove old\n } else if (!newChild) {\n oldNode.removeChild(oldChild)\n i--\n\n // There is no old child, add new\n } else if (!oldChild) {\n oldNode.appendChild(newChild)\n offset++\n\n // Both nodes are the same, morph\n } else if (same(newChild, oldChild)) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Both nodes do not share an ID or a placeholder, try reorder\n } else {\n oldMatch = null\n\n // Try and find a similar node somewhere in the tree\n for (var j = i; j < oldNode.childNodes.length; j++) {\n if (same(oldNode.childNodes[j], newChild)) {\n oldMatch = oldNode.childNodes[j]\n break\n }\n }\n\n // If there was a node with the same ID or placeholder in the old list\n if (oldMatch) {\n morphed = walk(newChild, oldMatch)\n if (morphed !== oldMatch) offset++\n oldNode.insertBefore(morphed, oldChild)\n\n // It's safe to morph two nodes in-place if neither has an ID\n } else if (!newChild.id && !oldChild.id) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Insert the node at the index if we couldn't morph or find a matching node\n } else {\n oldNode.insertBefore(newChild, oldChild)\n offset++\n }\n }\n }\n}", "title": "" }, { "docid": "4c0a9173059411c9df98391eee55f31e", "score": "0.47919008", "text": "function updateChildren (newNode, oldNode) {\n // if (DEBUG) {\n // console.log(\n // 'updateChildren\\nold\\n %s\\nnew\\n %s',\n // oldNode && oldNode.outerHTML,\n // newNode && newNode.outerHTML\n // )\n // }\n var oldChild, newChild, morphed, oldMatch\n\n // The offset is only ever increased, and used for [i - offset] in the loop\n var offset = 0\n\n for (var i = 0; ; i++) {\n oldChild = oldNode.childNodes[i]\n newChild = newNode.childNodes[i - offset]\n // if (DEBUG) {\n // console.log(\n // '===\\n- old\\n %s\\n- new\\n %s',\n // oldChild && oldChild.outerHTML,\n // newChild && newChild.outerHTML\n // )\n // }\n // Both nodes are empty, do nothing\n if (!oldChild && !newChild) {\n break\n\n // There is no new child, remove old\n } else if (!newChild) {\n oldNode.removeChild(oldChild)\n i--\n\n // There is no old child, add new\n } else if (!oldChild) {\n oldNode.appendChild(newChild)\n offset++\n\n // Both nodes are the same, morph\n } else if (same(newChild, oldChild)) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Both nodes do not share an ID or a placeholder, try reorder\n } else {\n oldMatch = null\n\n // Try and find a similar node somewhere in the tree\n for (var j = i; j < oldNode.childNodes.length; j++) {\n if (same(oldNode.childNodes[j], newChild)) {\n oldMatch = oldNode.childNodes[j]\n break\n }\n }\n\n // If there was a node with the same ID or placeholder in the old list\n if (oldMatch) {\n morphed = walk(newChild, oldMatch)\n if (morphed !== oldMatch) offset++\n oldNode.insertBefore(morphed, oldChild)\n\n // It's safe to morph two nodes in-place if neither has an ID\n } else if (!newChild.id && !oldChild.id) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Insert the node at the index if we couldn't morph or find a matching node\n } else {\n oldNode.insertBefore(newChild, oldChild)\n offset++\n }\n }\n }\n}", "title": "" }, { "docid": "4c0a9173059411c9df98391eee55f31e", "score": "0.47919008", "text": "function updateChildren (newNode, oldNode) {\n // if (DEBUG) {\n // console.log(\n // 'updateChildren\\nold\\n %s\\nnew\\n %s',\n // oldNode && oldNode.outerHTML,\n // newNode && newNode.outerHTML\n // )\n // }\n var oldChild, newChild, morphed, oldMatch\n\n // The offset is only ever increased, and used for [i - offset] in the loop\n var offset = 0\n\n for (var i = 0; ; i++) {\n oldChild = oldNode.childNodes[i]\n newChild = newNode.childNodes[i - offset]\n // if (DEBUG) {\n // console.log(\n // '===\\n- old\\n %s\\n- new\\n %s',\n // oldChild && oldChild.outerHTML,\n // newChild && newChild.outerHTML\n // )\n // }\n // Both nodes are empty, do nothing\n if (!oldChild && !newChild) {\n break\n\n // There is no new child, remove old\n } else if (!newChild) {\n oldNode.removeChild(oldChild)\n i--\n\n // There is no old child, add new\n } else if (!oldChild) {\n oldNode.appendChild(newChild)\n offset++\n\n // Both nodes are the same, morph\n } else if (same(newChild, oldChild)) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Both nodes do not share an ID or a placeholder, try reorder\n } else {\n oldMatch = null\n\n // Try and find a similar node somewhere in the tree\n for (var j = i; j < oldNode.childNodes.length; j++) {\n if (same(oldNode.childNodes[j], newChild)) {\n oldMatch = oldNode.childNodes[j]\n break\n }\n }\n\n // If there was a node with the same ID or placeholder in the old list\n if (oldMatch) {\n morphed = walk(newChild, oldMatch)\n if (morphed !== oldMatch) offset++\n oldNode.insertBefore(morphed, oldChild)\n\n // It's safe to morph two nodes in-place if neither has an ID\n } else if (!newChild.id && !oldChild.id) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Insert the node at the index if we couldn't morph or find a matching node\n } else {\n oldNode.insertBefore(newChild, oldChild)\n offset++\n }\n }\n }\n}", "title": "" }, { "docid": "131da4325833cc21ef8a4b7a02ec045c", "score": "0.47905764", "text": "_changedNode(){\n\n if (this.root.autoMerklify)\n this._refreshHash(true);\n }", "title": "" }, { "docid": "b376eb11876c0430ace4fff865921b7c", "score": "0.47892645", "text": "function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n var depth = block.getDepth() + adjustment;\n depth = Math.max(0, Math.min(depth, maxDepth));\n return block.set('depth', depth);\n });\n\n blockMap = blockMap.merge(blocks);\n\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}", "title": "" }, { "docid": "b376eb11876c0430ace4fff865921b7c", "score": "0.47892645", "text": "function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n var depth = block.getDepth() + adjustment;\n depth = Math.max(0, Math.min(depth, maxDepth));\n return block.set('depth', depth);\n });\n\n blockMap = blockMap.merge(blocks);\n\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}", "title": "" }, { "docid": "b376eb11876c0430ace4fff865921b7c", "score": "0.47892645", "text": "function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n var depth = block.getDepth() + adjustment;\n depth = Math.max(0, Math.min(depth, maxDepth));\n return block.set('depth', depth);\n });\n\n blockMap = blockMap.merge(blocks);\n\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}", "title": "" }, { "docid": "b376eb11876c0430ace4fff865921b7c", "score": "0.47892645", "text": "function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n var depth = block.getDepth() + adjustment;\n depth = Math.max(0, Math.min(depth, maxDepth));\n return block.set('depth', depth);\n });\n\n blockMap = blockMap.merge(blocks);\n\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}", "title": "" }, { "docid": "b376eb11876c0430ace4fff865921b7c", "score": "0.47892645", "text": "function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n var depth = block.getDepth() + adjustment;\n depth = Math.max(0, Math.min(depth, maxDepth));\n return block.set('depth', depth);\n });\n\n blockMap = blockMap.merge(blocks);\n\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}", "title": "" }, { "docid": "b376eb11876c0430ace4fff865921b7c", "score": "0.47892645", "text": "function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n var depth = block.getDepth() + adjustment;\n depth = Math.max(0, Math.min(depth, maxDepth));\n return block.set('depth', depth);\n });\n\n blockMap = blockMap.merge(blocks);\n\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}", "title": "" }, { "docid": "b376eb11876c0430ace4fff865921b7c", "score": "0.47892645", "text": "function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n var depth = block.getDepth() + adjustment;\n depth = Math.max(0, Math.min(depth, maxDepth));\n return block.set('depth', depth);\n });\n\n blockMap = blockMap.merge(blocks);\n\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}", "title": "" }, { "docid": "b376eb11876c0430ace4fff865921b7c", "score": "0.47892645", "text": "function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n var depth = block.getDepth() + adjustment;\n depth = Math.max(0, Math.min(depth, maxDepth));\n return block.set('depth', depth);\n });\n\n blockMap = blockMap.merge(blocks);\n\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}", "title": "" }, { "docid": "b376eb11876c0430ace4fff865921b7c", "score": "0.47892645", "text": "function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n var depth = block.getDepth() + adjustment;\n depth = Math.max(0, Math.min(depth, maxDepth));\n return block.set('depth', depth);\n });\n\n blockMap = blockMap.merge(blocks);\n\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}", "title": "" }, { "docid": "ddfa6ff2b22f60bcb9a538040a3c230a", "score": "0.47742045", "text": "function transformChanges() {\n\tfor (var rq in pendingChanges) {\n\t\tvar allOperations = pendingChanges[rq]; // {clientID: operation_list}\n\t\t// console.log(\"pending_changes = \", allOperations);\n\t\tvar mergedOperations = null;\n\t\tfor (var client in allOperations) {\n\t\t\tif (mergedOperations == null)\n\t\t\t\tmergedOperations = allOperations[client];\n\t\t\telse\n\t\t\t\tmergedOperations = merge_transformations2(\n\t\t\t\t\tmergedOperations,\n\t\t\t\t\tallOperations[client]\n\t\t\t\t);\n\t\t}\n\t\tif (mergedOperations == null) continue;\n\t\tconsole.log(\"[x] Sending : \", mergedOperations);\n\t\tserverChannel.sendToQueue(\n\t\t\trq,\n\t\t\tBuffer.from(JSON.stringify(mergedOperations))\n\t\t);\n\t\t// apply to local copy of the document\n\t\t// anirban: I don't think this is correct. We should not be applying the operations to the local copy.\n\t\t// \t\t\tWe should be applying them to the document.\n\t\t// subhranil: I agree.\n\t\t// \t\t\tI'm not sure if this is the correct place to do this. I think it should be done in the\n\t\t// \t\t\tonMessage callback. But I'm not sure where to do it.\n\t\t// anubhab: I agree.\n\t\t// \t\t\tI think it should be done in the onMessage callback.\n\t\tif (fileMap[rq] != null) {\n\t\t\tvar localCopy = applyTransformation(\n\t\t\t\tmergedOperations,\n\t\t\t\tcontentMap[fileMap[rq]]\n\t\t\t);\n\t\t\tcontentMap[fileMap[rq]] = localCopy;\n\t\t}\n\t\tconsole.log(contentMap);\n\t\tpendingChanges[rq] = {};\n\t}\n}", "title": "" }, { "docid": "65ce6a4358e00384cbd6a793adb62cf7", "score": "0.47679812", "text": "function reorder(aChildren, bChildren) {\n\t // O(M) time, O(M) memory\n\t var bChildIndex = keyIndex(bChildren)\n\t var bKeys = bChildIndex.keys\n\t var bFree = bChildIndex.free\n\n\t if (bFree.length === bChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\n\t // O(N) time, O(N) memory\n\t var aChildIndex = keyIndex(aChildren)\n\t var aKeys = aChildIndex.keys\n\t var aFree = aChildIndex.free\n\n\t if (aFree.length === aChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\n\t // O(MAX(N, M)) memory\n\t var newChildren = []\n\n\t var freeIndex = 0\n\t var freeCount = bFree.length\n\t var deletedItems = 0\n\n\t // Iterate through a and match a node in b\n\t // O(N) time,\n\t for (var i = 0 ; i < aChildren.length; i++) {\n\t var aItem = aChildren[i]\n\t var itemIndex\n\n\t if (aItem.key) {\n\t if (bKeys.hasOwnProperty(aItem.key)) {\n\t // Match up the old keys\n\t itemIndex = bKeys[aItem.key]\n\t newChildren.push(bChildren[itemIndex])\n\n\t } else {\n\t // Remove old keyed items\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t } else {\n\t // Match the item in a with the next free item in b\n\t if (freeIndex < freeCount) {\n\t itemIndex = bFree[freeIndex++]\n\t newChildren.push(bChildren[itemIndex])\n\t } else {\n\t // There are no free items in b to match with\n\t // the free items in a, so the extra free nodes\n\t // are deleted.\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t }\n\t }\n\n\t var lastFreeIndex = freeIndex >= bFree.length ?\n\t bChildren.length :\n\t bFree[freeIndex]\n\n\t // Iterate through b and append any new keys\n\t // O(M) time\n\t for (var j = 0; j < bChildren.length; j++) {\n\t var newItem = bChildren[j]\n\n\t if (newItem.key) {\n\t if (!aKeys.hasOwnProperty(newItem.key)) {\n\t // Add any new keyed items\n\t // We are adding new items to the end and then sorting them\n\t // in place. In future we should insert new items in place.\n\t newChildren.push(newItem)\n\t }\n\t } else if (j >= lastFreeIndex) {\n\t // Add any leftover non-keyed items\n\t newChildren.push(newItem)\n\t }\n\t }\n\n\t var simulate = newChildren.slice()\n\t var simulateIndex = 0\n\t var removes = []\n\t var inserts = []\n\t var simulateItem\n\n\t for (var k = 0; k < bChildren.length;) {\n\t var wantedItem = bChildren[k]\n\t simulateItem = simulate[simulateIndex]\n\n\t // remove items\n\t while (simulateItem === null && simulate.length) {\n\t removes.push(remove(simulate, simulateIndex, null))\n\t simulateItem = simulate[simulateIndex]\n\t }\n\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t // if we need a key in this position...\n\t if (wantedItem.key) {\n\t if (simulateItem && simulateItem.key) {\n\t // if an insert doesn't put this key in place, it needs to move\n\t if (bKeys[simulateItem.key] !== k + 1) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t simulateItem = simulate[simulateIndex]\n\t // if the remove didn't put the wanted item in place, we need to insert it\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t // items are matching, so skip ahead\n\t else {\n\t simulateIndex++\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t k++\n\t }\n\t // a key in simulate has no matching wanted key, remove it\n\t else if (simulateItem && simulateItem.key) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t }\n\t }\n\t else {\n\t simulateIndex++\n\t k++\n\t }\n\t }\n\n\t // remove all the remaining nodes from simulate\n\t while(simulateIndex < simulate.length) {\n\t simulateItem = simulate[simulateIndex]\n\t removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n\t }\n\n\t // If the only moves we have are deletes then we can just\n\t // let the delete patch remove these items.\n\t if (removes.length === deletedItems && !inserts.length) {\n\t return {\n\t children: newChildren,\n\t moves: null\n\t }\n\t }\n\n\t return {\n\t children: newChildren,\n\t moves: {\n\t removes: removes,\n\t inserts: inserts\n\t }\n\t }\n\t}", "title": "" }, { "docid": "65ce6a4358e00384cbd6a793adb62cf7", "score": "0.47679812", "text": "function reorder(aChildren, bChildren) {\n\t // O(M) time, O(M) memory\n\t var bChildIndex = keyIndex(bChildren)\n\t var bKeys = bChildIndex.keys\n\t var bFree = bChildIndex.free\n\n\t if (bFree.length === bChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\n\t // O(N) time, O(N) memory\n\t var aChildIndex = keyIndex(aChildren)\n\t var aKeys = aChildIndex.keys\n\t var aFree = aChildIndex.free\n\n\t if (aFree.length === aChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\n\t // O(MAX(N, M)) memory\n\t var newChildren = []\n\n\t var freeIndex = 0\n\t var freeCount = bFree.length\n\t var deletedItems = 0\n\n\t // Iterate through a and match a node in b\n\t // O(N) time,\n\t for (var i = 0 ; i < aChildren.length; i++) {\n\t var aItem = aChildren[i]\n\t var itemIndex\n\n\t if (aItem.key) {\n\t if (bKeys.hasOwnProperty(aItem.key)) {\n\t // Match up the old keys\n\t itemIndex = bKeys[aItem.key]\n\t newChildren.push(bChildren[itemIndex])\n\n\t } else {\n\t // Remove old keyed items\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t } else {\n\t // Match the item in a with the next free item in b\n\t if (freeIndex < freeCount) {\n\t itemIndex = bFree[freeIndex++]\n\t newChildren.push(bChildren[itemIndex])\n\t } else {\n\t // There are no free items in b to match with\n\t // the free items in a, so the extra free nodes\n\t // are deleted.\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t }\n\t }\n\n\t var lastFreeIndex = freeIndex >= bFree.length ?\n\t bChildren.length :\n\t bFree[freeIndex]\n\n\t // Iterate through b and append any new keys\n\t // O(M) time\n\t for (var j = 0; j < bChildren.length; j++) {\n\t var newItem = bChildren[j]\n\n\t if (newItem.key) {\n\t if (!aKeys.hasOwnProperty(newItem.key)) {\n\t // Add any new keyed items\n\t // We are adding new items to the end and then sorting them\n\t // in place. In future we should insert new items in place.\n\t newChildren.push(newItem)\n\t }\n\t } else if (j >= lastFreeIndex) {\n\t // Add any leftover non-keyed items\n\t newChildren.push(newItem)\n\t }\n\t }\n\n\t var simulate = newChildren.slice()\n\t var simulateIndex = 0\n\t var removes = []\n\t var inserts = []\n\t var simulateItem\n\n\t for (var k = 0; k < bChildren.length;) {\n\t var wantedItem = bChildren[k]\n\t simulateItem = simulate[simulateIndex]\n\n\t // remove items\n\t while (simulateItem === null && simulate.length) {\n\t removes.push(remove(simulate, simulateIndex, null))\n\t simulateItem = simulate[simulateIndex]\n\t }\n\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t // if we need a key in this position...\n\t if (wantedItem.key) {\n\t if (simulateItem && simulateItem.key) {\n\t // if an insert doesn't put this key in place, it needs to move\n\t if (bKeys[simulateItem.key] !== k + 1) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t simulateItem = simulate[simulateIndex]\n\t // if the remove didn't put the wanted item in place, we need to insert it\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t // items are matching, so skip ahead\n\t else {\n\t simulateIndex++\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t k++\n\t }\n\t // a key in simulate has no matching wanted key, remove it\n\t else if (simulateItem && simulateItem.key) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t }\n\t }\n\t else {\n\t simulateIndex++\n\t k++\n\t }\n\t }\n\n\t // remove all the remaining nodes from simulate\n\t while(simulateIndex < simulate.length) {\n\t simulateItem = simulate[simulateIndex]\n\t removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n\t }\n\n\t // If the only moves we have are deletes then we can just\n\t // let the delete patch remove these items.\n\t if (removes.length === deletedItems && !inserts.length) {\n\t return {\n\t children: newChildren,\n\t moves: null\n\t }\n\t }\n\n\t return {\n\t children: newChildren,\n\t moves: {\n\t removes: removes,\n\t inserts: inserts\n\t }\n\t }\n\t}", "title": "" }, { "docid": "65ce6a4358e00384cbd6a793adb62cf7", "score": "0.47679812", "text": "function reorder(aChildren, bChildren) {\n\t // O(M) time, O(M) memory\n\t var bChildIndex = keyIndex(bChildren)\n\t var bKeys = bChildIndex.keys\n\t var bFree = bChildIndex.free\n\n\t if (bFree.length === bChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\n\t // O(N) time, O(N) memory\n\t var aChildIndex = keyIndex(aChildren)\n\t var aKeys = aChildIndex.keys\n\t var aFree = aChildIndex.free\n\n\t if (aFree.length === aChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\n\t // O(MAX(N, M)) memory\n\t var newChildren = []\n\n\t var freeIndex = 0\n\t var freeCount = bFree.length\n\t var deletedItems = 0\n\n\t // Iterate through a and match a node in b\n\t // O(N) time,\n\t for (var i = 0 ; i < aChildren.length; i++) {\n\t var aItem = aChildren[i]\n\t var itemIndex\n\n\t if (aItem.key) {\n\t if (bKeys.hasOwnProperty(aItem.key)) {\n\t // Match up the old keys\n\t itemIndex = bKeys[aItem.key]\n\t newChildren.push(bChildren[itemIndex])\n\n\t } else {\n\t // Remove old keyed items\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t } else {\n\t // Match the item in a with the next free item in b\n\t if (freeIndex < freeCount) {\n\t itemIndex = bFree[freeIndex++]\n\t newChildren.push(bChildren[itemIndex])\n\t } else {\n\t // There are no free items in b to match with\n\t // the free items in a, so the extra free nodes\n\t // are deleted.\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t }\n\t }\n\n\t var lastFreeIndex = freeIndex >= bFree.length ?\n\t bChildren.length :\n\t bFree[freeIndex]\n\n\t // Iterate through b and append any new keys\n\t // O(M) time\n\t for (var j = 0; j < bChildren.length; j++) {\n\t var newItem = bChildren[j]\n\n\t if (newItem.key) {\n\t if (!aKeys.hasOwnProperty(newItem.key)) {\n\t // Add any new keyed items\n\t // We are adding new items to the end and then sorting them\n\t // in place. In future we should insert new items in place.\n\t newChildren.push(newItem)\n\t }\n\t } else if (j >= lastFreeIndex) {\n\t // Add any leftover non-keyed items\n\t newChildren.push(newItem)\n\t }\n\t }\n\n\t var simulate = newChildren.slice()\n\t var simulateIndex = 0\n\t var removes = []\n\t var inserts = []\n\t var simulateItem\n\n\t for (var k = 0; k < bChildren.length;) {\n\t var wantedItem = bChildren[k]\n\t simulateItem = simulate[simulateIndex]\n\n\t // remove items\n\t while (simulateItem === null && simulate.length) {\n\t removes.push(remove(simulate, simulateIndex, null))\n\t simulateItem = simulate[simulateIndex]\n\t }\n\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t // if we need a key in this position...\n\t if (wantedItem.key) {\n\t if (simulateItem && simulateItem.key) {\n\t // if an insert doesn't put this key in place, it needs to move\n\t if (bKeys[simulateItem.key] !== k + 1) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t simulateItem = simulate[simulateIndex]\n\t // if the remove didn't put the wanted item in place, we need to insert it\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t // items are matching, so skip ahead\n\t else {\n\t simulateIndex++\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t k++\n\t }\n\t // a key in simulate has no matching wanted key, remove it\n\t else if (simulateItem && simulateItem.key) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t }\n\t }\n\t else {\n\t simulateIndex++\n\t k++\n\t }\n\t }\n\n\t // remove all the remaining nodes from simulate\n\t while(simulateIndex < simulate.length) {\n\t simulateItem = simulate[simulateIndex]\n\t removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n\t }\n\n\t // If the only moves we have are deletes then we can just\n\t // let the delete patch remove these items.\n\t if (removes.length === deletedItems && !inserts.length) {\n\t return {\n\t children: newChildren,\n\t moves: null\n\t }\n\t }\n\n\t return {\n\t children: newChildren,\n\t moves: {\n\t removes: removes,\n\t inserts: inserts\n\t }\n\t }\n\t}", "title": "" }, { "docid": "65ce6a4358e00384cbd6a793adb62cf7", "score": "0.47679812", "text": "function reorder(aChildren, bChildren) {\n\t // O(M) time, O(M) memory\n\t var bChildIndex = keyIndex(bChildren)\n\t var bKeys = bChildIndex.keys\n\t var bFree = bChildIndex.free\n\n\t if (bFree.length === bChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\n\t // O(N) time, O(N) memory\n\t var aChildIndex = keyIndex(aChildren)\n\t var aKeys = aChildIndex.keys\n\t var aFree = aChildIndex.free\n\n\t if (aFree.length === aChildren.length) {\n\t return {\n\t children: bChildren,\n\t moves: null\n\t }\n\t }\n\n\t // O(MAX(N, M)) memory\n\t var newChildren = []\n\n\t var freeIndex = 0\n\t var freeCount = bFree.length\n\t var deletedItems = 0\n\n\t // Iterate through a and match a node in b\n\t // O(N) time,\n\t for (var i = 0 ; i < aChildren.length; i++) {\n\t var aItem = aChildren[i]\n\t var itemIndex\n\n\t if (aItem.key) {\n\t if (bKeys.hasOwnProperty(aItem.key)) {\n\t // Match up the old keys\n\t itemIndex = bKeys[aItem.key]\n\t newChildren.push(bChildren[itemIndex])\n\n\t } else {\n\t // Remove old keyed items\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t } else {\n\t // Match the item in a with the next free item in b\n\t if (freeIndex < freeCount) {\n\t itemIndex = bFree[freeIndex++]\n\t newChildren.push(bChildren[itemIndex])\n\t } else {\n\t // There are no free items in b to match with\n\t // the free items in a, so the extra free nodes\n\t // are deleted.\n\t itemIndex = i - deletedItems++\n\t newChildren.push(null)\n\t }\n\t }\n\t }\n\n\t var lastFreeIndex = freeIndex >= bFree.length ?\n\t bChildren.length :\n\t bFree[freeIndex]\n\n\t // Iterate through b and append any new keys\n\t // O(M) time\n\t for (var j = 0; j < bChildren.length; j++) {\n\t var newItem = bChildren[j]\n\n\t if (newItem.key) {\n\t if (!aKeys.hasOwnProperty(newItem.key)) {\n\t // Add any new keyed items\n\t // We are adding new items to the end and then sorting them\n\t // in place. In future we should insert new items in place.\n\t newChildren.push(newItem)\n\t }\n\t } else if (j >= lastFreeIndex) {\n\t // Add any leftover non-keyed items\n\t newChildren.push(newItem)\n\t }\n\t }\n\n\t var simulate = newChildren.slice()\n\t var simulateIndex = 0\n\t var removes = []\n\t var inserts = []\n\t var simulateItem\n\n\t for (var k = 0; k < bChildren.length;) {\n\t var wantedItem = bChildren[k]\n\t simulateItem = simulate[simulateIndex]\n\n\t // remove items\n\t while (simulateItem === null && simulate.length) {\n\t removes.push(remove(simulate, simulateIndex, null))\n\t simulateItem = simulate[simulateIndex]\n\t }\n\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t // if we need a key in this position...\n\t if (wantedItem.key) {\n\t if (simulateItem && simulateItem.key) {\n\t // if an insert doesn't put this key in place, it needs to move\n\t if (bKeys[simulateItem.key] !== k + 1) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t simulateItem = simulate[simulateIndex]\n\t // if the remove didn't put the wanted item in place, we need to insert it\n\t if (!simulateItem || simulateItem.key !== wantedItem.key) {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t // items are matching, so skip ahead\n\t else {\n\t simulateIndex++\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t }\n\t else {\n\t inserts.push({key: wantedItem.key, to: k})\n\t }\n\t k++\n\t }\n\t // a key in simulate has no matching wanted key, remove it\n\t else if (simulateItem && simulateItem.key) {\n\t removes.push(remove(simulate, simulateIndex, simulateItem.key))\n\t }\n\t }\n\t else {\n\t simulateIndex++\n\t k++\n\t }\n\t }\n\n\t // remove all the remaining nodes from simulate\n\t while(simulateIndex < simulate.length) {\n\t simulateItem = simulate[simulateIndex]\n\t removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n\t }\n\n\t // If the only moves we have are deletes then we can just\n\t // let the delete patch remove these items.\n\t if (removes.length === deletedItems && !inserts.length) {\n\t return {\n\t children: newChildren,\n\t moves: null\n\t }\n\t }\n\n\t return {\n\t children: newChildren,\n\t moves: {\n\t removes: removes,\n\t inserts: inserts\n\t }\n\t }\n\t}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "86fb6ec4a1906c3961b4c0c39761bb41", "score": "0.4752585", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "65ef1c32e8dcde5a78f0c10db2a04a67", "score": "0.47511348", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren);\n var bKeys = bChildIndex.keys;\n var bFree = bChildIndex.free;\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren);\n var aKeys = aChildIndex.keys;\n var aFree = aChildIndex.free;\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = [];\n\n var freeIndex = 0;\n var freeCount = bFree.length;\n var deletedItems = 0;\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i];\n var itemIndex;\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key];\n newChildren.push(bChildren[itemIndex]);\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++;\n newChildren.push(null);\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++];\n newChildren.push(bChildren[itemIndex]);\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++;\n newChildren.push(null);\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex];\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j];\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem);\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem);\n }\n }\n\n var simulate = newChildren.slice();\n var simulateIndex = 0;\n var removes = [];\n var inserts = [];\n var simulateItem;\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k];\n simulateItem = simulate[simulateIndex];\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove$3(simulate, simulateIndex, null));\n simulateItem = simulate[simulateIndex];\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove$3(simulate, simulateIndex, simulateItem.key));\n simulateItem = simulate[simulateIndex];\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k});\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++;\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k});\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k});\n }\n k++;\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove$3(simulate, simulateIndex, simulateItem.key));\n }\n }\n else {\n simulateIndex++;\n k++;\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex];\n removes.push(remove$3(simulate, simulateIndex, simulateItem && simulateItem.key));\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "65ef1c32e8dcde5a78f0c10db2a04a67", "score": "0.47511348", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren);\n var bKeys = bChildIndex.keys;\n var bFree = bChildIndex.free;\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren);\n var aKeys = aChildIndex.keys;\n var aFree = aChildIndex.free;\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = [];\n\n var freeIndex = 0;\n var freeCount = bFree.length;\n var deletedItems = 0;\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i];\n var itemIndex;\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key];\n newChildren.push(bChildren[itemIndex]);\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++;\n newChildren.push(null);\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++];\n newChildren.push(bChildren[itemIndex]);\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++;\n newChildren.push(null);\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex];\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j];\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem);\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem);\n }\n }\n\n var simulate = newChildren.slice();\n var simulateIndex = 0;\n var removes = [];\n var inserts = [];\n var simulateItem;\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k];\n simulateItem = simulate[simulateIndex];\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove$3(simulate, simulateIndex, null));\n simulateItem = simulate[simulateIndex];\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove$3(simulate, simulateIndex, simulateItem.key));\n simulateItem = simulate[simulateIndex];\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k});\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++;\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k});\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k});\n }\n k++;\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove$3(simulate, simulateIndex, simulateItem.key));\n }\n }\n else {\n simulateIndex++;\n k++;\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex];\n removes.push(remove$3(simulate, simulateIndex, simulateItem && simulateItem.key));\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}", "title": "" }, { "docid": "12027163cef36a07b260e60fc37762f8", "score": "0.4749138", "text": "function reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren);\n var bKeys = bChildIndex.keys;\n var bFree = bChildIndex.free;\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n };\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren);\n var aKeys = aChildIndex.keys;\n var aFree = aChildIndex.free;\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n };\n }\n\n // O(MAX(N, M)) memory\n var newChildren = [];\n\n var freeIndex = 0;\n var freeCount = bFree.length;\n var deletedItems = 0;\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0; i < aChildren.length; i++) {\n var aItem = aChildren[i];\n var itemIndex;\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key];\n newChildren.push(bChildren[itemIndex]);\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++;\n newChildren.push(null);\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++];\n newChildren.push(bChildren[itemIndex]);\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++;\n newChildren.push(null);\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ? bChildren.length : bFree[freeIndex];\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j];\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem);\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem);\n }\n }\n\n var simulate = newChildren.slice();\n var simulateIndex = 0;\n var removes = [];\n var inserts = [];\n var simulateItem;\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k];\n simulateItem = simulate[simulateIndex];\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null));\n simulateItem = simulate[simulateIndex];\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key));\n simulateItem = simulate[simulateIndex];\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({ key: wantedItem.key, to: k });\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++;\n }\n } else {\n inserts.push({ key: wantedItem.key, to: k });\n }\n } else {\n inserts.push({ key: wantedItem.key, to: k });\n }\n k++;\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key));\n }\n } else {\n simulateIndex++;\n k++;\n }\n }\n\n // remove all the remaining nodes from simulate\n while (simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex];\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key));\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n };\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n };\n}", "title": "" }, { "docid": "1cd5e2c7bfaa83e8e6bab048338ac07b", "score": "0.474281", "text": "fieldsResetDependenciesMap () {\n const dependenciesMap = {}\n for (const key in this.resourceData.editableFields) {\n if (Object.prototype.hasOwnProperty.call(this.resourceData.editableFields, key)) {\n const field = this.resourceData.editableFields[key]\n if (field.fieldType === 'dynamic-table') {\n for (const header of field.table.headers) {\n if (header.type === 'reference' &&\n !!header.reference &&\n !!header.reference.extra &&\n !!header.reference.extra.resetWhen &&\n !!header.reference.extra.resetWhen.changed) {\n for (const propertyKey of header.reference.extra.resetWhen.changed) {\n dependenciesMap[propertyKey] = key\n }\n }\n }\n }\n }\n }\n return dependenciesMap\n }", "title": "" }, { "docid": "c3ee0cb4a3e0331cd1b4e3f5d45ed81d", "score": "0.4738174", "text": "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "title": "" }, { "docid": "c3ee0cb4a3e0331cd1b4e3f5d45ed81d", "score": "0.4738174", "text": "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "title": "" }, { "docid": "c3ee0cb4a3e0331cd1b4e3f5d45ed81d", "score": "0.4738174", "text": "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "title": "" }, { "docid": "c3ee0cb4a3e0331cd1b4e3f5d45ed81d", "score": "0.4738174", "text": "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "title": "" }, { "docid": "06313b0e88892cd80b42f7ed86c2f271", "score": "0.4730376", "text": "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.splice(0, mappedNodes.length);\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "title": "" }, { "docid": "b5130edb9a4af75e7e8ec9b6b819d835", "score": "0.47230294", "text": "function updateBlocks() {\n // special structure for loop blocks -> look at children\n if (lines[line].trim() === Blockly.JavaScript.blockToCode(block).split('\\n')[0] &&\n (lines[line].trim().startsWith(\"for\") || lines[line].trim().startsWith(\"while\") ||\n lines[line].trim().startsWith(\"if\"))) {\n loopBlocks.push(block);\n DwenguinoSimulation.debugger.blocks.blockMapping[line] = block;\n block = block.getInputTargetBlock('DO') || block.getInputTargetBlock('DO0');\n } else if (lines[line].trim() === Blockly.JavaScript.blockToCode(block).split('\\n')[0]) {\n DwenguinoSimulation.debugger.blocks.blockMapping[line] = block;\n block = block.getNextBlock();\n }\n // end of loop structure\n if (block === null && loopBlocks.length > 0) {\n var parentBlock = loopBlocks.pop();\n block = parentBlock.getNextBlock();\n line++;\n }\n line++;\n }", "title": "" }, { "docid": "579ad351ca533cab7d658db32588bc55", "score": "0.47163716", "text": "function DraftMap(target, parent) {\n this[DRAFT_STATE] = {\n type_: 2\n /* Map */\n ,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: undefined,\n assigned_: undefined,\n base_: target,\n draft_: this,\n isManual_: false,\n revoked_: false\n };\n return this;\n }", "title": "" }, { "docid": "6ebddb73cd9266267a04c6829facf867", "score": "0.47111937", "text": "_compareAndCopy(newJst, topNode, jstComponent, forceUpdate, level) {\n let oldIndex = 0;\n let newIndex = 0;\n let itemsToDelete = [];\n let indicesToRemove = [];\n\n // console.log(\"CAC>\" + \" \".repeat(level*2), this.tag + this.id, newJst.tag+newJst.id);\n\n // Check to see if this the old and new node are the same\n if (this.id == newJst.id) {\n return false;\n }\n\n // First check the attributes, props and events\n // But only if we aren't the topNode\n if (!topNode) {\n if (forceUpdate || this.opts.forceUpdate || this.tag !== newJst.tag) {\n return true;\n }\n\n // Blindly copy the JST options\n this.opts = newJst.opts;\n \n // Just fix all the attributes inline\n for (let attrName of Object.keys(this.attrs)) {\n if (!newJst.attrs[attrName]) {\n delete this.attrs[attrName];\n if (this.isDomified) {\n this.el.removeAttribute(attrName);\n }\n }\n else if (newJst.attrs[attrName] !== this.attrs[attrName]) {\n this.attrs[attrName] = newJst.attrs[attrName];\n if (this.isDomified) {\n //refactor\n let val = newJst.attrs[attrName];\n if (this.jstComponent && (attrName === \"class\" || attrName === \"id\") &&\n val.match(/(^|\\s)-/)) {\n // Add scoping for IDs and Class names\n val = val.replace(/(^|\\s)(--?)/g,\n (m, p1, p2) => p1 + (p2 === \"-\" ?\n this.jstComponent.getClassPrefix() :\n this.jstComponent.getFullPrefix()));\n }\n this.el.setAttribute(attrName, val);\n }\n }\n }\n for (let attrName of Object.keys(newJst.attrs)) {\n if (!this.attrs[attrName]) {\n this.attrs[attrName] = newJst.attrs[attrName];\n if (this.isDomified) {\n //refactor\n let val = newJst.attrs[attrName];\n if (this.jstComponent && (attrName === \"class\" || attrName === \"id\") &&\n val.match(/(^|\\s)-/)) {\n // Add scoping for IDs and Class names\n val = val.replace(/(^|\\s)(--?)/g,\n (m, p1, p2) => p1 + (p2 === \"-\" ?\n this.jstComponent.getClassPrefix() :\n this.jstComponent.getFullPrefix()));\n }\n this.el.setAttribute(attrName, val);\n }\n }\n }\n\n if (this.props.length || newJst.props.length) {\n let fixProps = false;\n \n // Just compare them in order - if they happen to be the same,\n // but in a different order, we will do a bit more work than necessary\n // but it should be very unlikely that that would happen\n if (this.props.length != newJst.props.length) {\n fixProps = true;\n }\n else {\n for (let i = 0; i < this.props.length; i++) {\n if (this.props[i] !== newJst.props[i]) {\n fixProps = true;\n break;\n }\n }\n }\n \n if (fixProps) {\n if (this.isDomified) {\n for (let prop of this.props) {\n delete this.el[prop];\n }\n for (let prop of newJst.props) {\n this.el[prop] = true;\n }\n }\n this.props = newJst.props;\n }\n }\n \n // Fix all the events\n for (let eventName of Object.keys(this.events)) {\n if (!newJst.events[eventName]) {\n if (this.isDomified) {\n this.el.removeEventListener(eventName, this.events[eventName].listener);\n }\n delete this.events[eventName];\n }\n else if (newJst.events[eventName].listener !== this.events[eventName].listener) {\n if (this.isDomified) {\n this.el.removeEventListener(eventName, this.events[eventName].listener);\n this.el.addEventListener(eventName, newJst.events[eventName].listener);\n }\n this.events[eventName] = newJst.events[eventName];\n }\n }\n for (let eventName of Object.keys(newJst.events)) {\n if (!this.events[eventName]) {\n this.events[eventName] = newJst.events[eventName];\n if (this.isDomified) {\n this.el.addEventListener(eventName, newJst.events[eventName].listener);\n }\n }\n }\n \n }\n\n if (!forceUpdate && !this.opts.forceUpdate) {\n // First a shortcut in the case where all\n // contents are removed\n\n // TODO - can clear the DOM in one action, but\n // need to take care of the components so that they\n // aren't still thinking they are in the DOM\n // if (this.contents.length && !newJst.contents.length) {\n // if (this.el) {\n // this.el.textContent = \"\";\n // //this.contents = [];\n // //return false;\n // }\n // }\n \n \n // Loop through the contents of this element and compare\n // to the contents of the newly created element\n while (true) {\n let oldItem = this.contents[oldIndex];\n let newItem = newJst.contents[newIndex];\n\n if (!oldItem || !newItem) {\n break;\n }\n\n // Types of items in the contents must match or don't continue\n if (oldItem.type !== newItem.type) {\n break;\n }\n\n if (oldItem.type === JstElementType.JST_ELEMENT) {\n\n // This detects items that are being replaced by pre-existing items\n // They are too complicated to try to do in place replacements\n if (oldItem.value.id !== newItem.value.id && newItem.value._refCount > 1) {\n break;\n }\n \n // Descend into the JstElement and compare them and possibly copy their\n // content in place\n let doReplace = oldItem.value._compareAndCopy(newItem.value, false,\n jstComponent, undefined, level+1);\n if (doReplace) {\n break;\n }\n\n // Need to decrement the ref counts for items that didn't change\n if (oldItem.value.id === newItem.value.id) {\n this._deleteItem(newItem);\n }\n \n }\n else if (oldItem.type === JstElementType.JST_COMPONENT) {\n // If the tags are the same, then we must descend and compare\n if (oldItem.value._jstId !== newItem.value._jstId) {\n\n // Small optimization since often a list is modified with a\n // single add or remove\n\n let nextOldItem = this.contents[oldIndex+1];\n let nextNewItem = newJst.contents[newIndex+1];\n\n if (!nextOldItem || !nextNewItem) {\n // no value of optimizing when we are at the end of the list\n break;\n }\n\n if (nextNewItem.type === JstElementType.JST_COMPONENT &&\n oldItem.value._jstId === nextNewItem.value._jstId) {\n // We have added a single item - TBD\n let nextEl = oldItem.value._jstEl._getFirstEl();\n this._moveOrRenderInDom(newItem, jstComponent, nextEl);\n this.contents.splice(oldIndex, 0, newItem);\n newIndex++;\n oldIndex++;\n newItem = nextNewItem;\n }\n else if (nextOldItem.type === JstElementType.JST_COMPONENT &&\n nextOldItem.value._jstId === newItem.value._jstId) {\n // We have deleted a single item\n this.contents.splice(oldIndex, 1);\n itemsToDelete.push(oldItem);\n }\n else if (nextOldItem.type === JstElementType.JST_COMPONENT &&\n nextNewItem.type === JstElementType.JST_COMPONENT &&\n nextOldItem.value._jstId === nextNewItem.value._jstId) {\n // We have swapped in an item\n let nextEl = nextOldItem.value._jstEl._getFirstEl();\n this._moveOrRenderInDom(newItem, jstComponent, nextEl);\n this.contents[oldIndex] = newItem;\n oldIndex++;\n newIndex++;\n newItem = nextNewItem;\n itemsToDelete.push(oldItem);\n }\n else {\n break;\n }\n\n }\n\n // Don't bother descending into JstComponents - they take care of themselves\n \n }\n else if (oldItem.type === JstElementType.TEXTNODE) {\n\n if (oldItem.value !== newItem.value) {\n\n // For textnodes, we just fix them inline\n if (oldItem.el) {\n oldItem.el.textContent = newItem.value;\n }\n oldItem.value = newItem.value;\n }\n }\n\n oldIndex++;\n newIndex++;\n \n if (newItem.type === JstElementType.JST_COMPONENT) {\n // Unhook this reference\n newItem.value._unrender();\n }\n }\n }\n\n // Need to copy stuff - first delete all the old contents\n let oldStartIndex = oldIndex;\n let oldItem = this.contents[oldIndex];\n\n while (oldItem) {\n // console.log(\"CAC> \" + \" \".repeat(level*2), \"deleting old item :\", oldItem.value.tag, oldItem.value.id);\n itemsToDelete.push(oldItem);\n oldIndex++;\n oldItem = this.contents[oldIndex];\n }\n\n // Remove unneeded items from the contents list\n this.contents.splice(oldStartIndex, oldIndex - oldStartIndex);\n\n if (newJst.contents[newIndex]) {\n\n // Get list of new items that will be inserted\n let newItems = newJst.contents.splice(newIndex, newJst.contents.length - newIndex);\n\n //console.log(\"CAC> \" + \" \".repeat(level*2), \"new items being added:\", newItems);\n \n newItems.forEach(item => {\n if (item.type === JstElementType.JST_ELEMENT) {\n if (item.value.el && item.value.el.parentNode) {\n item.value.el.parentNode.removeChild(item.value.el);\n if (this.el) {\n this.el.appendChild(item.value.el);\n }\n else {\n delete(this.el);\n }\n }\n else if (this.el) {\n // Need to add it\n this.el.appendChild(item.value.dom(jstComponent));\n }\n else if (jstComponent && jstComponent.parentEl) {\n jstComponent.parentEl.appendChild(item.value.dom(jstComponent));\n }\n else {\n console.warn(\"Not adding an element to the DOM\", item.value.tag, item, this, jstComponent);\n }\n }\n else if (item.type === JstElementType.TEXTNODE) {\n if (this.el) {\n // Need to add it\n if (item.el) {\n if (item.el.parentNode) {\n item.el.parentNode.removeChild(item.el);\n }\n this.el.appendChild(item.el);\n }\n else {\n item.el = document.createTextNode(item.value);\n this.el.appendChild(item.el);\n }\n }\n else if (jstComponent && jstComponent.parentEl) {\n item.el = document.createTextNode(item.value);\n jstComponent.parentEl.appendChild(item.el);\n }\n else {\n console.warn(\"Not adding an element to the DOM\", item.value.tag, item, this, jstComponent);\n }\n }\n else if (item.type === JstElementType.JST_COMPONENT) {\n this._moveOrRenderInDom(item, jstComponent);\n }\n });\n this.contents.splice(oldStartIndex, 0, ...newItems);\n }\n\n for (let itemToDelete of itemsToDelete) {\n this._deleteItem(itemToDelete); \n } \n \n // console.log(\"CAC>\" + \" \".repeat(level*2), \"/\" + this.tag+this.id);\n return false;\n \n }", "title": "" } ]
2e88502dce115a5683951eff77c44d01
fills the information panel with info about course with id nid
[ { "docid": "08019def2ff3b851d2a1f558790f212d", "score": "0.6847863", "text": "function fill_infopanel(nid){\r\n let infopanel = d3.select('#infopanel');\r\n // empty the infopanel\r\n infopanel.selectAll('*').remove();\r\n // title\r\n infopanel.append('div')\r\n .append('strong')\r\n .text(nodes[nid].title);\r\n // description\r\n infopanel.append('div').text(course_descriptions[nid]);\r\n infopanel.append('br');\r\n // sections\r\n if(course_sections[nid]){\r\n let text = '<strong style=\"\">This course is thaught to: </strong> <br/>';\r\n course_sections[nid].forEach(function(s){\r\n text += s + '<br/>';\r\n });\r\n infopanel.append('div').style('font-size', '13px').html(text);\r\n }\r\n infopanel.append('br');\r\n // related courses\r\n if(adjacency_list[nid]){\r\n infopanel.append('div').style('font-size', '13px').style('font-weight', 'bold').text('Related courses:');\r\n let related_courses = adjacency_list[nid].map(eid => edges[eid].target);\r\n related_courses.forEach(function(nid){\r\n infopanel.append('span')\r\n .text(nodes[nid].title)\r\n .attr('class', 'related_course')\r\n .on('click', function(){\r\n on_click_node(nid);\r\n g.select('circle#' + nid).style('stroke-width', '0px');\r\n })\r\n .on('mouseover', function(){\r\n d3.select(this)\r\n .style('border-color', 'rgba(100, 100, 100, 1)')\r\n .style('cursor', 'pointer');\r\n g.select('circle#' + nid).style('stroke', 'black').style('stroke-width', current_node_size/6 + 'px');\r\n })\r\n .on('mouseout', function(){\r\n d3.select(this)\r\n .style('border-color', 'transparent')\r\n .style('cursor', 'default');\r\n g.select('circle#' + nid).style('stroke-width', '0px');\r\n })\r\n });\r\n }\r\n}", "title": "" } ]
[ { "docid": "9ab3c373a3e66b8e336fde73788b2203", "score": "0.687388", "text": "function getStudentCourseInfo(cid) {\n\tdbResult('/courses/' + cid, function(key, value) {\n\t\tif (key === 'title') {\n\t\t\t$('#side-menu #courses ul li.' + cid + ' a').html(value);\n\t\t}\n\t}, function() {\n\t\t// Callback to retrieving DB data\n\t});\n}", "title": "" }, { "docid": "fef4011503212c34f1e20fa86fa2ef09", "score": "0.6526226", "text": "function readCourseInfo(course)\n{\n //create an object selecting course information\n const courseInfo = {\n img: course.querySelector('img').src,\n title: course.querySelector('h4').innerText,\n price: course.querySelector('.precio span').innerText,\n id: course.querySelector('a').getAttribute('data-id')\n };\n\n //recieves info and creates html to insert\n insertIntoCart(courseInfo);\n}", "title": "" }, { "docid": "03e2535120efd060f0662894fec132a7", "score": "0.65075207", "text": "function getCourseInfo(course){\n //Object with course data\n const courseInfo = {\n image: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.price span').textContent,\n id: course.querySelector('a').getAttribute('data-id')\n }\n // Insert into shopping cart\n addIntoCart(courseInfo);\n}", "title": "" }, { "docid": "dcdb20e0b90a731144649001c0e20fc6", "score": "0.6484193", "text": "function getCourseInfo(course) {\n // Create an Object with Course Data\n const courseInfo = {\n image: course.querySelector('.placeIcon').src, \n title: course.querySelector('h4').textContent,\n price: course.querySelector('.price').textContent,\n id: course.querySelector('a').getAttribute('data-id')\n }\n // Insert into the shopping cart\n addIntoCart(courseInfo);\n}", "title": "" }, { "docid": "ba26b4bba8715313ba41b7797ef76686", "score": "0.64400184", "text": "function readCourseInfo(course) {\n const courseInfo = {\n imagen: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.precio span').textContent,\n id: course.querySelector('a').getAttribute('data-id'),\n };\n\n addToCart(courseInfo);\n}", "title": "" }, { "docid": "0e2d578b440a4b8fa360b91169aba31f", "score": "0.64204144", "text": "function getCourseInfo(course) {\n //Create an Object w/ Course Data\n const courseInfo = {\n image: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.price span').textContent,\n id: course.querySelector('a').getAttribute('data-id')\n }\n\n // Insert to Shopping Cart\n addIntoCart(courseInfo);\n}", "title": "" }, { "docid": "e4d2255721ce2ac5115da8283adabaff", "score": "0.6417745", "text": "function getInfoOfCourse(course) {\r\n //create object with info of course\r\n const infoCourse = {\r\n image: course.querySelector('img').src,\r\n title: course.querySelector('h4').textContent,\r\n price: course.querySelector('.price span').textContent,\r\n id: course.querySelector('a').getAttribute('data-id')\r\n };\r\n\r\n //function for add object into shopping car\r\n addItemToCar(infoCourse);\r\n}", "title": "" }, { "docid": "41ea6301d9f1a2ad51f9e2881c875629", "score": "0.6385417", "text": "function getCourseInfo(course){\r\n // Create an Object with Course Data\r\n const courseInfo = {\r\n image: course.querySelector('img').src,\r\n title: course.querySelector('h4').textContent,\r\n price: course.querySelector('.price span').textContent,\r\n id: course.querySelector('a').getAttribute('data-id')\r\n }\r\n \r\n // Insert into shopping cart\r\n addIntoCart(courseInfo);\r\n}", "title": "" }, { "docid": "474a5e174406b5b56d3814862a9e7150", "score": "0.63755864", "text": "function getCourseInfo (course) {\n //create an object with course data\n const courseCardInfo = {\n image: course.querySelector ('img').src,\n title: course.querySelector ('h4').textContent,\n price: course.querySelector ('.price span').textContent,\n id: course.querySelector ('a').getAttribute ('data-id') //uzima index ili broj kursa, trebać mi za class:remove\n }\n\n //insert into shopping cart\n addIntoCart (courseCardInfo);\n}", "title": "" }, { "docid": "9795b09badec0192e68d6b1bccfef917", "score": "0.62771326", "text": "buildCourseData(id) {\n const courseInfo = \"<div class='info'>\" +\n \"<h3>\" + getCourseParameter(id, 'nameLV') + \"</h3>\" +\n \"<div>\" +\n \"<table>\" +\n f.displayArray(getCourseParameter(id, 'modul'), \"Modul\", \"courseInfo-\" + id + \"-modul\") +\n f.displayArray(getCourseParameter(id, 'dozent'), \"Dozent\", \"courseInfo-\" + id + \"-dozent\") +\n \"<tr>\" +\n \"<td>Leistungspunkte</td>\" +\n \"<td id='courseInfo-\" + id + \"-cp'>\" + getCourseParameter(id, 'cp') + \" Leistungspunkte</td>\" +\n \"</tr>\" +\n f.displayArray(getCourseParameter(id, 'lehrform'), \"Lehrform\", \"courseInfo-\" + id + \"-lehrform\") +\n f.displayArray(getCourseParameter(id, 'vertiefung').map(mapVertiefungsgebietNameToDisplayName), \"Vertiefungsgebiet\", \"courseInfo-\" + id + \"-vertiefung\") +\n f.displayArray(getCourseParameter(id, 'semester'), \"Angeboten im\", \"courseInfo-\" + id + \"-semester\") +\n \"</table>\" +\n \"</div>\" +\n \"</div>\";\n\n // if item contains no newline break, apply specific css class (which sets line-height higher, so text is vertically aligned)\n const classes = [];\n if (getCourseParameter(id, 'kurz').indexOf(\"<br />\") === - 1) {\n classes.push(\"oneliner\");\n }\n let cssclass = \"\";\n if (classes.length !== 0)\n cssclass = \" class='\" + classes.join(\" \") + \"'\";\n\n return \"<li\" + cssclass + \" id='course-\" + id + \"'>\" +\n \"<span id='courseInfo-\" + id + \"-kurz'>\" + getCourseParameter(id, 'kurz') + \"</span>\" +\n \"<input type='text' id='course-\" + id + \"-gradeinput' class='courseGradeInput'/>\" +\n \"<button class='bold'>\" +\n \"<div class='info grade-info'>Hier klicken, um deine Note für diese Veranstaltung einzutragen.</div>\" +\n f.gradeCharacter +\n \"</button>\" + courseInfo +\n \"</li>\";\n }", "title": "" }, { "docid": "af355cf82e711415cb195b80330a0dad", "score": "0.6272371", "text": "function display(course_id) {\n /* Make sure we aren't trying to display the \"show previous\" entry */\n if (course_id == \"result\") return;\n \n /* turn the right-hand pane dark */\n $(\"#right_scrollbar_wrap\").css(\"background-color\",\"rgba(0,0,0,0.8)\");\n\n /* highlight the course if it's in the search results */\n if ($(\"#result_num_\"+course_id).attr('class') !=('course_shown')) {\n $(\".course_shown\").addClass(\"course\").removeClass(\"course_shown\");\n $(\"#result_num_\"+course_id).addClass(\"course_shown\").removeClass(\"course\");\n }\n \n /* show the info */\n if ($(\"#detail_num_\"+course_id).attr('class') != \"detail_shown\") {\n $(\".detail_shown\").addClass(\"detail\").removeClass(\"detail_shown\");\n var detail_id = \"#detail_num_\"+course_id;\n $(detail_id).addClass(\"detail_shown\").removeClass(\"detail\");\n $(\".coursecart\").removeClass(\"coursecart_selected\");\n $(\"#cart_num_\"+course_id).addClass(\"coursecart_selected\");\n }\n}", "title": "" }, { "docid": "3d7db4af54085c5d057c9df917a2bd02", "score": "0.61978716", "text": "function getCourseInfo(course) {\n // Uses querySelector to get all the course information\n const courseInfo = {\n image: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.precio span').textContent,\n id: course.querySelector('a').getAttribute('data-id')\n }\n return courseInfo;\n}", "title": "" }, { "docid": "437e1aea16e3f65ea8e14c52ae050c03", "score": "0.61223346", "text": "function getCourseInfo(course) {\n console.log(course)\n}", "title": "" }, { "docid": "2373a6d3f9ea29deb9718a6f63ecb032", "score": "0.6074565", "text": "function expandOfficialCourseDescription(course) {\r\n\r\n\t$.ajax({\r\n\t\t\t\turl : '/direct/portalManager/getOfficialCourseDescription.json?courseId=' + course,\r\n\t\t\t\tdatatype : 'json',\r\n\t\t\t\tsuccess : function(course) {\r\n\r\n\t\t\t\t\tvar department_group_bundle_key = 'department_' + course.departmentGroup;\r\n\t\t\t\t\tvar career_group_bundle_key = 'career_' + course.careerGroup;\r\n\r\n\t\t\t\t\tvar div = \"<div id=\\\"direct_course_div\\\" class=\\\"accordion-group \\\"><div class=\\\"accordion-heading row\\\"><div class=\\\"span5\\\"><a class=\\\"accordion-toggle\\\" data-toggle=\\\"collapse\\\" href=\\\"#collapseCourse\\\"data-parent=\\\"#accordionCourseSelect\\\">\"\r\n\t\t\t\t\t\t\t+ course.hyphenatedCourseId\r\n\t\t\t\t\t\t\t+ \" - \"\r\n\t\t\t\t\t\t\t+ course.title\r\n\t\t\t\t\t\t\t+ \"</a><div class=\\\"toolsWrapper\\\">\";\r\n\r\n\t\t\t\t\tdiv += \"<a class=\\\"icon-button-right button-microapp\\\" data-original-title=\\\"cours archivé\\\" data-toggle=\\\"\\\" href=\\\"archive.html\\\"></a></div></div></div><div id=\\\"collapseCourse\\\" class=\\\"accordion-body in collapse\\\"><div class=\\\"accordion-inner\\\"><h4 data-bundle-key=\\\"label_description\\\"></h4>\"\r\n\t\t\t\t\t\t\t+\"<br>\";\r\n\t\t\t\t\tif (course.shortDescription != null){\r\n div += course.shortDescription\r\n +\"<br><br>\";\r\n }else {\r\n div += $('#bundleDiv').data(\"label_no_description\") +\"<br><br>\";\r\n }\r\n if (course.description != null)\r\n div += course.description\r\n\t\t\t\t\t\t\t+\"<br><br>\";\r\n if (course.themes != null)\r\n div += \"<h4 data-bundle-key=\\\"label_theme\\\">\" + $('#bundleDiv').data(\"label_theme\")+ \"</h4>\"\r\n\t\t\t\t\t\t\t+\"<br>\" + course.themes\r\n\t\t\t\t\t\t\t+ \"<br><br>\"\r\n\r\n\t\t\t\t\tdiv += \"<table class=\\\"table\\\"><thead><tr><th class=\\\"col-co-department\\\" data-bundle-key=\\\"label_department\\\"></th><th class=\\\"col-co-career\\\" data-bundle-key=\\\"label_academic_career\\\"></th><th class=\\\"col-co-credits\\\" data-bundle-key=\\\"label_credits\\\"></th><th class=\\\"col-co-requirements\\\" data-bundle-key=\\\"label_requirements\\\"></th></tr></thead><tbody><tr><td>\"\r\n\t\t\t\t\t\t\t+ \"<a data-itemName=\\\"department\\\" data-itemGroup=\\\"\" + course.departmentGroup + \"\\\" data-bundle-key=\\\"\" + department_group_bundle_key + \"\\\" href=\\\"#discipline=\" + course.departmentGroup + \"\\\" class=\\\"linkItemUnicOfficialCourseDescription\\\">\"\r\n\t\t\t\t\t\t\t+ departmentDescriptionsMap[course.departmentGroup]\r\n\t\t\t\t\t\t\t+ \"</a></td><td><a data-itemName=\\\"career\\\" data-itemGroup=\\\"\" + course.careerGroup + \"\\\" data-bundle-key=\\\"\" + career_group_bundle_key + \"\\\" href=\\\"#programme=\" + course.careerGroup + \"\\\" class=\\\"linkItemUnicOfficialCourseDescription\\\">\"\r\n\t\t\t\t\t\t\t+ careerDescriptionsMap[course.careerGroup]\r\n\t\t\t\t\t\t\t+ \"</a></td><td>\"\r\n\t\t\t\t\t\t\t+ course.credits\r\n\t\t\t\t\t\t\t+ \"</td><td>\"\r\n\t\t\t\t\t\t\t+ course.requirements\r\n\t\t\t\t\t\t\t+ \"</td></tr></tbody></table></div></div></div>\";\r\n\r\n\t\t\t\t\t$('#my-tab-content').append(div);\r\n\t\t\t\t\tbindLinkItemUnicOfficialCourseDescription();\r\n\t\t\t\t\t$('#current_breadcrumb').html(course.hyphenatedCourseId);\r\n\t\t\t\t\tupdateLabelsFromBundle();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t},\r\n\t\t\t\tstatusCode: {\r\n\t\t\t\t\t404: function() {\r\n\t\t\t\t\t\tvar div = \"<div id=\\\"direct_course_div\\\" class=\\\"accordion-group \\\"><div class=\\\"accordion-heading row\\\"><div class=\\\"span5\\\"><a class=\\\"accordion-toggle\\\" style=\\\"cursor:auto\\\">\"\r\n\t\t\t\t\t\t\t+ $('#bundleDiv').data(\"label_no_description\")\r\n\t\t\t\t\t\t\t+ \"</a></div></div></div>\";\r\n\r\n\t\t\t\t\t\t$('#my-tab-content').append(div);\r\n\t\t\t\t\t\t$('#current_breadcrumb').html(course);\r\n\t\t\t\t\t\tupdateLabelsFromBundle();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}", "title": "" }, { "docid": "15b5549500a1a4fdb82f8a6e4bd5b61d", "score": "0.5956181", "text": "function showVariables()\r\n{\r\n listCourses();\r\n changeCourseID();\r\n}", "title": "" }, { "docid": "dd69f1080e5a9ed34525f3cfb6b76675", "score": "0.5948955", "text": "function getCourse(course) {\n // courseContent object to hold all the course data\n const courseContent = {\n image: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.price span').textContent,\n id: course.querySelector('a').getAttribute('data-id')\n }\n\n // add the course to the cart\n addToCart(courseContent);\n}", "title": "" }, { "docid": "fac18cc598d63fbe1f13494141213548", "score": "0.59313756", "text": "displayInfo(ent, cp) {\n let elm = document.getElementById('info');\n elm.parentNode.replaceChild(elm.cloneNode(true), elm);\n\n let header = cp === 'c' ? 'Church: ' : 'Person: ';\n header += formatNumLength(ent['id'], 4);\n $('#info_header').text(header);\n setInfoMetaListeners(ent, cp);\n\n let details = $('#details_switch').html('');\n if (cp === 'c') {\n details.append(createInput('Name:', 'name', ent['name']));\n details.append(\n createInput('Denomination:', 'denomination', ent['denomination']));\n details.append(createRegionSelector('region', ent['region']));\n details.append(createVisibilitySelector('visibility', ent['visibility']));\n details.append(createTextarea('Notes:', 'note', ent['note']));\n } else if (cp === 'p') {\n details.append(\n createInput('First Name:', 'first_name', ent['first_name']));\n details.append(createInput('Last Name:', 'last_name', ent['last_name']));\n details.append(createTextarea('Notes:', 'note', ent['note']));\n }\n setSaveButtonListener($('#details_save'), ent['id'], cp);\n\n let contacts_table = $('#contacts_switch').html('');\n ent['contacts'].forEach((ctc) => {\n this.addContactRow(ctc, ent['id'], contacts_table, cp);\n });\n setCreateContactListeners(ent['id'], cp);\n\n let roles_table = $('#roles_switch').html('');\n let roles = (cp === 'p') ? ent['churches'] : ent['people'];\n roles.forEach((ctc) => {\n this.addRolesRow(ctc, ent, roles_table, cp);\n });\n setCreateRoleListener(ent['id'], cp);\n }", "title": "" }, { "docid": "6f4f95f48b098732b78834fd29b4f43f", "score": "0.59304494", "text": "function determineCourses() {\r\n\t\t\t\t\r\n\r\n\t\t\t}", "title": "" }, { "docid": "1feb1a5fefa9451a090a5c1f60e6269f", "score": "0.5900862", "text": "function showCourse(){\n\t\n\tvar subCatalogueId = document.getElementById('LessonSubCatalogueId').value;\t\n\tif(subCatalogueId == ''){\t\t\n\t\tdocument.getElementById('courseDiv').style.display = '';\t\t\n\t} \n\t\n}", "title": "" }, { "docid": "15327d06f14abbf7b2eae348311bb7d5", "score": "0.5805249", "text": "function generalCourseInfo(courseId, callback){\n\nconsole.log('======= Course Info = ' + courseId);\n\n var error, data;\n\n query = `Select * FROM table_course_general WHERE courseid='${courseId}';`;\n\n client.query(query, function(err, result) {\n\n if (!err && result.rows.length > 0){\n // If no Error get info and send back to the user\n data = result.rows[0];\n callback(error, data);\n\n }else {\n error = err || `I don't have that course :(, check whether you have made a mistake`;\n callback(error, data);\n }\n });\n\n}", "title": "" }, { "docid": "6207db0a0c0691611a648aab47e40988", "score": "0.57870656", "text": "static fetchCourse(course_id) {\n return this._fetchObject(this.COURSES_URL, course_id);\n }", "title": "" }, { "docid": "7fa0afeba473339377bcf1feaa2694a0", "score": "0.575259", "text": "function readCourseData(course) {\n // Object with the course info\n const courseInfo = {\n id: course.querySelector('a').getAttribute('data-id'),\n imagen: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.precio span').textContent,\n quantity: 1,\n };\n\n // Check if a course already exists in the shopping cart\n const exists = shoppingCartProducts.some(\n course => course.id === courseInfo.id\n );\n if (exists) {\n // Update the quantity of the product\n const courses = shoppingCartProducts.map((course) => {\n if (course.id === courseInfo.id) {\n course.quantity++;\n return course;\n } else {\n return course;\n }\n });\n shoppingCartProducts = [...courses];\n } else {\n // Add product to the Shopping Cart Products Array\n shoppingCartProducts = [...shoppingCartProducts, courseInfo];\n }\n\n shoppingCartHTML();\n}", "title": "" }, { "docid": "06fddbacdeab535dd3fed6d744203622", "score": "0.5739573", "text": "function setData(){\n\t\t\n\t\t$.ajax({\n\t\t\turl : \"/currentCode\",\n\t\t\tmethod: \"GET\",\n\t\t\tsuccess : function(foundCourse){\n\t\t\t\tif(foundCourse!==false){\n\t\t\t\t\t$(\"#course\").html(foundCourse.code);\n\t\t\t\t\tvar tableData = [];\n\t\t\t\t\tfor(g =0; g<foundCourse.notes.length;g++){\n\t\t\t\t\t\ttableData.push(foundCourse.notes[g].title);\n\t\t\t\t\t}\n\t\t\t\t\tif(tableData.length!==0){\n\t\t\t\t\t\tcreateTable(tableData, false);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tvar linkList = document.getElementById(\"linkTable\");\n\t\t\t\t\t\t$(linkTable).empty();\n\t\t\t\t\t\tvar p = document.createElement(\"p\");\n\t\t\t\t\t\tp.innerHTML = \"There are no notes for this course yet\";\n\t\t\t\t\t\tlinkList.appendChild(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "8e8d675f58a111233c8d0b7d43c983b2", "score": "0.5730921", "text": "function displayOnlineCourses(){\n\t$(\"#education\").append(HTMLonlineClasses);\n\t$(\"#education\").append(HTMLonlineStart);\n\tfor (course in onlineCourses.courses){\n\t\tvar titleAndSchool = onlineCourses.courses[course].title + \" - \" + onlineCourses.courses[course].school;\n\t\tvar formattedOnlineTitle = HTMLonlineTitle.replace(\"%data%\", titleAndSchool);\n\t\tvar formattedOnlineDates = HTMLonlineDates.replace(\"%data%\", onlineCourses.courses[course].dates);\n\t\tvar formattedOnlineURL = HTMLonlineURL.replace(\"%data%\", onlineCourses.courses[course].url);\n\t\t$(\".online-entry:last\").append(formattedOnlineTitle);\n\t\t$(\".online-entry:last\").append(formattedOnlineDates);\n\t\t$(\".online-entry:last\").append(formattedOnlineURL);\n\t}\n}", "title": "" }, { "docid": "9f3a1730d53704acabf445e725c815ae", "score": "0.56685394", "text": "async function getProgrammeCourses(id) {\n try {\n setShow(true);\n setProgrammeCourses([]);\n setLoadingCourses(true);\n\n const res = await fetch(\"/programmes/offered-courses/\" + id, {\n method: \"GET\",\n });\n const parseData = await res.json();\n setProgrammeCourses(parseData);\n setLoadingCourses(false);\n \n \n } catch (err) {\n console.error(err.message);\n }\n }", "title": "" }, { "docid": "7868765a6f8cd8308894ba35e242be92", "score": "0.5645899", "text": "function ciniki_artclub_info() {\n\tthis.init = function() {\n\t\t//\n\t\t// Setup the main panel to list the collection\n\t\t//\n\t\tthis.menu = new M.panel('Files',\n\t\t\t'ciniki_artclub_info', 'menu',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.menu');\n\t\tthis.menu.data = {};\n\t\tthis.menu.sections = {\n\t\t\t'_menu':{'label':'', 'list':{\n\t\t\t\t'membership':{'label':'Membership', 'fn':'M.ciniki_artclub_info.showMembership(\\'M.ciniki_artclub_info.showMenu();\\');'},\n\t\t\t\t}},\n\t\t\t};\n\t\tthis.menu.addClose('Back');\n\n\t\t//\n\t\t// The panel to display the add form\n\t\t//\n\t\tthis.membership = new M.panel('Membership Details',\n\t\t\t'ciniki_artclub_info', 'membership',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.membership');\n\t\tthis.membership.data = {};\t\n\t\tthis.membership.sections = {\n\t\t\t'membership-details-html':{'label':'Membership Details', 'type':'htmlcontent'},\n\t\t\t'_buttons':{'label':'', 'buttons':{\n\t\t\t\t'edit':{'label':'Edit', 'fn':'M.ciniki_artclub_info.showEditMembership(\\'M.ciniki_artclub_info.showMembership();\\');'},\n\t\t\t\t}},\n\t\t\t'applications':{'label':'Application Forms',\n\t\t\t\t'type':'simplegrid', 'num_cols':1,\n\t\t\t\t'headerValues':null,\n\t\t\t\t'cellClasses':[''],\n\t\t\t\t'addTxt':'Add Application',\n\t\t\t\t'addFn':'M.ciniki_artclub_info.showAddApplication(\\'M.ciniki_artclub_info.showMembership();\\');',\n\t\t\t\t}\n\t\t};\n\t\tthis.membership.cellValue = function(s, i, j, d) {\n\t\t\tif( j == 0 ) { return d.file.name; }\n\t\t};\n\t\tthis.membership.rowFn = function(s, i, d) {\n\t\t\treturn 'M.ciniki_artclub_info.showEditApplication(\\'M.ciniki_artclub_info.showMembership();\\', \\'' + d.file.id + '\\');'; \n\t\t};\n\t\tthis.membership.sectionData = function(s) { \n\t\t\treturn this.data[s];\n\t\t};\n\t\tthis.membership.addClose('Back');\n\n\t\t//\n\t\t// The panel to display the edit membership details form\n\t\t//\n\t\tthis.editmembership = new M.panel('File',\n\t\t\t'ciniki_artclub_info', 'editmembership',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.editmembership');\n\t\tthis.editmembership.file_id = 0;\n\t\tthis.editmembership.data = null;\n\t\tthis.editmembership.sections = {\n\t\t\t'_description':{'label':'Description', 'type':'simpleform', 'fields':{\n\t\t\t\t'membership-details':{'label':'', 'type':'textarea', 'size':'large', 'hidelabel':'yes'},\n\t\t\t}},\n\t\t\t'_save':{'label':'', 'buttons':{\n\t\t\t\t'save':{'label':'Save', 'fn':'M.ciniki_artclub_info.saveMembership();'},\n\t\t\t}},\n\t\t};\n\t\tthis.editmembership.fieldValue = function(s, i, d) { \n\t\t\treturn this.data[i]; \n\t\t}\n\t\tthis.editmembership.fieldHistoryArgs = function(s, i) {\n\t\t\treturn {'method':'ciniki.artclub.settingsHistory', 'args':{'business_id':M.curBusinessID, 'setting':i}};\n\t\t};\n\t\tthis.editmembership.addButton('save', 'Save', 'M.ciniki_artclub_info.saveMembership();');\n\t\tthis.editmembership.addClose('Cancel');\n\n\n\t\t//\n\t\t// The panel to display the add form\n\t\t//\n\t\tthis.addapplication = new M.panel('Add File',\n\t\t\t'ciniki_artclub_info', 'addapplication',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.editapplication');\n\t\tthis.addapplication.default_data = {'type':'2'};\n\t\tthis.addapplication.data = {};\t\n// FIXME:\t\tthis.add.uploadDropFn = function() { return M.ciniki_artclub_info.uploadDropImagesAdd; };\n\t\tthis.addapplication.sections = {\n\t\t\t'_file':{'label':'File', 'fields':{\n\t\t\t\t'uploadfile':{'label':'', 'type':'file', 'hidelabel':'yes'},\n\t\t\t}},\n\t\t\t'info':{'label':'Information', 'type':'simpleform', 'fields':{\n\t\t\t\t'name':{'label':'Title', 'type':'text'},\n\t\t\t}},\n//\t\t\t'_description':{'label':'Description', 'type':'simpleform', 'fields':{\n//\t\t\t\t'description':{'label':'', 'type':'textarea', 'size':'small', 'hidelabel':'yes'},\n//\t\t\t}},\n\t\t\t'_save':{'label':'', 'buttons':{\n\t\t\t\t'save':{'label':'Save', 'fn':'M.ciniki_artclub_info.addApplication();'},\n\t\t\t}},\n\t\t};\n\t\tthis.addapplication.fieldValue = function(s, i, d) { \n\t\t\tif( this.data[i] != null ) {\n\t\t\t\treturn this.data[i]; \n\t\t\t} \n\t\t\treturn ''; \n\t\t};\n\t\tthis.addapplication.addButton('save', 'Save', 'M.ciniki_artclub_info.addApplication();');\n\t\tthis.addapplication.addClose('Cancel');\n\n\t\t//\n\t\t// The panel to display the edit form\n\t\t//\n\t\tthis.editapplication = new M.panel('File',\n\t\t\t'ciniki_artclub_info', 'editapplication',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.editapplications');\n\t\tthis.editapplication.file_id = 0;\n\t\tthis.editapplication.data = null;\n\t\tthis.editapplication.sections = {\n\t\t\t'info':{'label':'Details', 'type':'simpleform', 'fields':{\n\t\t\t\t'name':{'label':'Title', 'type':'text'},\n\t\t\t}},\n\t\t\t'_save':{'label':'', 'buttons':{\n\t\t\t\t'save':{'label':'Save', 'fn':'M.ciniki_artclub_info.saveApplication();'},\n\t\t\t\t'download':{'label':'Download', 'fn':'M.ciniki_artclub_info.downloadFile(M.ciniki_artclub_info.editapplication.file_id);'},\n\t\t\t\t'delete':{'label':'Delete', 'fn':'M.ciniki_artclub_info.deleteApplication();'},\n\t\t\t}},\n\t\t};\n\t\tthis.editapplication.fieldValue = function(s, i, d) { \n\t\t\treturn this.data[i]; \n\t\t}\n\t\tthis.editapplication.sectionData = function(s) {\n\t\t\treturn this.data[s];\n\t\t};\n\t\tthis.editapplication.fieldHistoryArgs = function(s, i) {\n\t\t\treturn {'method':'ciniki.artclub.fileHistory', 'args':{'business_id':M.curBusinessID, \n\t\t\t\t'file_id':this.file_id, 'field':i}};\n\t\t};\n\t\tthis.editapplication.addButton('save', 'Save', 'M.ciniki_artclub_info.saveApplication();');\n\t\tthis.editapplication.addClose('Cancel');\n\t}\n\n\tthis.start = function(cb, appPrefix, aG) {\n\t\targs = {};\n\t\tif( aG != null ) {\n\t\t\targs = eval(aG);\n\t\t}\n\n\t\t//\n\t\t// Create container\n\t\t//\n\t\tvar appContainer = M.createContainer(appPrefix, 'ciniki_artclub_info', 'yes');\n\t\tif( appContainer == null ) {\n\t\t\talert('App Error');\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.showMenu(cb);\n\t}\n\n\tthis.showMenu = function(cb) {\n\t\tthis.menu.refresh();\n\t\tthis.menu.show(cb);\n\t};\n\n\tthis.showMembership = function(cb) {\n\t\tthis.membership.data = {};\n\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.settingsGet', \n\t\t\t{'business_id':M.curBusinessID, 'processhtml':'yes'}, function(rsp) {\n\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif( rsp.settings != null && rsp.settings['membership-details'] != null ) {\n\t\t\t\t\tM.ciniki_artclub_info.membership.data['membership-details-html'] = rsp.settings['membership-details-html'];\n\t\t\t\t} else {\n\t\t\t\t\tM.ciniki_artclub_info.membership.data['membership-details-html'] = '';\n\t\t\t\t}\n\t\t\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.fileList', \n\t\t\t\t\t{'business_id':M.curBusinessID, 'type':'1'}, function(rsp) {\n\t\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tM.ciniki_artclub_info.membership.data['applications'] = rsp.files;\n\t\t\t\t\t\tM.ciniki_artclub_info.membership.refresh();\n\t\t\t\t\t\tM.ciniki_artclub_info.membership.show(cb);\n\t\t\t\t\t});\n\t\t\t});\n\t};\n\n\tthis.showEditMembership = function(cb) {\n\t\tthis.editmembership.data = {};\n\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.settingsGet', \n\t\t\t{'business_id':M.curBusinessID}, function(rsp) {\n\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif( rsp.settings != null && rsp.settings['membership-details'] != null ) {\n\t\t\t\t\tM.ciniki_artclub_info.editmembership.data['membership-details'] = rsp.settings['membership-details'];\n\t\t\t\t} else {\n\t\t\t\t\tM.ciniki_artclub_info.editmembership.data['membership-details'] = '';\n\t\t\t\t}\n\t\t\t\tM.ciniki_artclub_info.editmembership.refresh();\n\t\t\t\tM.ciniki_artclub_info.editmembership.show(cb);\n\t\t\t});\n\t};\n\n\tthis.saveMembership = function() {\n\t\tvar c = this.editmembership.serializeFormData('no');\n\t\tif( c != null ) {\n\t\t\tvar rsp = M.api.postJSONFormData('ciniki.artclub.settingsUpdate', \n\t\t\t\t{'business_id':M.curBusinessID}, c,\n\t\t\t\tfunction(rsp) {\n\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tM.ciniki_artclub_info.editmembership.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} else {\n\t\t\tM.ciniki_artclub_info.editmembership.close();\n\t\t}\n\t};\n\n\tthis.showAddApplication = function(cb) {\n\t\tthis.addapplication.reset();\n\t\tthis.addapplication.data = {'type':1};\n\t\tthis.addapplication.refresh();\n\t\tthis.addapplication.show(cb);\n\t};\n\n\tthis.addApplication = function() {\n\t\tvar c = this.addapplication.serializeFormData('yes');\n\n\t\tif( c != '' ) {\n\t\t\tvar rsp = M.api.postJSONFormData('ciniki.artclub.fileAdd', \n\t\t\t\t{'business_id':M.curBusinessID, 'type':1}, c,\n\t\t\t\t\tfunction(rsp) {\n\t\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tM.ciniki_artclub_info.addapplication.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t} else {\n\t\t\tM.ciniki_artclub_info.addapplication.close();\n\t\t}\n\t};\n\n\tthis.showEditApplication = function(cb, fid) {\n\t\tif( fid != null ) {\n\t\t\tthis.editapplication.file_id = fid;\n\t\t}\n\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.fileGet', \n\t\t\t{'business_id':M.curBusinessID, 'file_id':this.editapplication.file_id}, function(rsp) {\n\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tM.ciniki_artclub_info.editapplication.data = rsp.file;\n\t\t\t\tM.ciniki_artclub_info.editapplication.refresh();\n\t\t\t\tM.ciniki_artclub_info.editapplication.show(cb);\n\t\t\t});\n\t};\n\n\tthis.saveApplication = function() {\n\t\tvar c = this.editapplication.serializeFormData('no');\n\n\t\tif( c != '' ) {\n\t\t\tvar rsp = M.api.postJSONFormData('ciniki.artclub.fileUpdate', \n\t\t\t\t{'business_id':M.curBusinessID, 'file_id':this.editapplication.file_id}, c,\n\t\t\t\t\tfunction(rsp) {\n\t\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tM.ciniki_artclub_info.editapplication.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\t};\n\n\tthis.deleteApplication = function() {\n\t\tif( confirm('Are you sure you want to delete \\'' + this.editapplication.data.name + '\\'? All information about it will be removed and unrecoverable.') ) {\n\t\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.fileDelete', {'business_id':M.curBusinessID, \n\t\t\t\t'file_id':M.ciniki_artclub_info.editapplication.file_id}, function(rsp) {\n\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tM.ciniki_artclub_info.editapplication.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t};\n\n\tthis.downloadFile = function(fid) {\n\t\twindow.open(M.api.getUploadURL('ciniki.artclub.fileDownload', {'business_id':M.curBusinessID, 'file_id':fid}));\n\t};\n}", "title": "" }, { "docid": "7c9da6e12794c0ab9ddd434c41f519b0", "score": "0.56084746", "text": "async function getCourseDetailsById(id) {\n /*\n * Execute three sequential queries to get all of the info about the\n * specified course, including its reviews and photos.\n */\n const course = await getCourseById(id);\n if (course) {\n course.assigments = await getAssignmentsByCourseId(id);\n }\n return course;\n}", "title": "" }, { "docid": "66492e5e2d1c76dafc28ad219cbc68da", "score": "0.55809224", "text": "function readCourse(req, res) {\n var sql = 'SELECT * FROM course WHERE cid = $1';\n ser.readEntity(req,res,sql);\n }", "title": "" }, { "docid": "3eff0414bf30f5dedf41c22ee24bd8f7", "score": "0.55706257", "text": "getCourse(id) {\n return this.courses[id];\n }", "title": "" }, { "docid": "2e8ccc26b1d0eaf819c688baf5fc11bd", "score": "0.5561766", "text": "function getCourse(id) {\n var courseAPI = \"https://api.swingbyswing.com/v2/courses/\" + id + \"?includes=practice_area,nearby_courses,recent_media,recent_comments,recent_rounds,best_rounds,current_rounds,course_stats_month,course_stats_year&access_token=\" + accessToken;\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (xhttp.readyState == 4 && xhttp.status == 200) {\n model = JSON.parse(xhttp.responseText);\n courseLatLon = model.course.location;\n initMap(courseLatLon);\n scoreInit();\n document.getElementById(\"holeSpan\").innerHTML = model.course.hole_count;\n document.getElementById(\"parSpan\").innerHTML = model.course.tee_types[1].par;\n document.getElementById(\"lengthSpan\").innerHTML = model.course.tee_types[1].yards;\n }\n };\n xhttp.open(\"GET\", courseAPI, true);\n xhttp.send();\n}", "title": "" }, { "docid": "795b727db00d9a6bb73f208b64f8e340", "score": "0.556107", "text": "function loadInformation(idProfessor, idCourse, priority)\n{\n var priorityColor = getPriorityColor(priority);\n becomeDivYellow(idCourse, priorityColor); // paint the actual course.\n var div = lookDivCourses(idCourse);\n setForced(div, \"1\");\n setReserved(div, \"1\");\n // Get all the information related to the professor and course..\n // historic information... like how many times the professor has given the course.\n}", "title": "" }, { "docid": "a5d27cfe2cc5b6e2e80e2f1d9dc97caa", "score": "0.5560754", "text": "function getDesc() {\n const c = document.getElementById('selectCourse');\n const carea = document.getElementById('searchCourse');\n while (c.lastElementChild !== c.firstElementChild) c.removeChild(c.lastElementChild);\n showComponent();\n\n const s = document.getElementById('selectSubject').value;\n if(s === \"\") {\n carea.style.display = \"none\";\n }\n else {\n carea.style.display = \"block\";\n var courseList = [];\n subjectsAndDesc.forEach(e => { if (e.subject === s) courseList.push(e); })\n fetch(`/api/catalog/${s}`)\n .then((res) => res.json())\n .then(data => {\n for(let i = 0; i < courseList.length; i++) {\n const item = document.createElement('option');\n item.setAttribute(\"value\", data[i].courseCode);\n item.appendChild(document.createTextNode(`${data[i].courseCode} ${courseList[i].description}`));\n c.appendChild(item);\n }\n })\n }\n}", "title": "" }, { "docid": "afdc02d929b85cc4877149f25e8a118d", "score": "0.5541321", "text": "function indCoursePage(oneElm) {\n updateUI();\n const ind = document.getElementById(\"indPage\");\n\n ind.querySelector(\"img\").src = oneElm.querySelector(\"img\").src;\n ind.querySelector(\"#name\").innerHTML = oneElm.querySelector(\"#clubName\").textContent;\n ind.querySelector(\"#advisor\").innerHTML = oneElm.querySelector(\"#advName\").textContent;\n ind.querySelector(\"#room\").innerHTML = oneElm.querySelector(\"#roomNum\").textContent;\n ind.querySelector(\"#time\").innerHTML = \"Meet time: \" + oneElm.querySelector(\"#time\").textContent;\n ind.querySelector(\"#description\").innerHTML = oneElm.querySelector(\"#desc\").textContent;\n\n document.getElementById(\"time\").style.display = \"block\";\n document.getElementById(\"desc\").style.display = \"block\";\n ind.style.display = \"block\";\n\n}", "title": "" }, { "docid": "ed6350e402d7fe6fbf6f7a58cddb5775", "score": "0.5540541", "text": "function getCourseInfo() {\n\tconst coursePromise = fetch('https://golf-courses-api.herokuapp.com/courses/11819').then((response) =>\n\t\tresponse.json()\n\t);\n\treturn coursePromise;\n}", "title": "" }, { "docid": "d519848dde9c64a7986670d2a1c1a52c", "score": "0.55106086", "text": "function getCourse(id) {\n messages.publish('db', {\n request: 'course',\n returnMsg: 'db.schedule.course',\n id: id\n });\n }", "title": "" }, { "docid": "df3c9b4bd6922f934b46f64ede9256cc", "score": "0.55012196", "text": "function editCourses(id) {\n let coursename = $('input[name=\"edit_course_title\"]');\n let courseID = $('input[name=\"edit_course_id\"]');\n\n ref.on(\"value\", function(data) {\n let courses = data.val();\n for (let key in courses) {\n let course = courses[key];\n if (course.courseID == id) {\n coursename.val(`${course.coursename}`);\n courseID.val(`${course.courseID}`);\n break;\n }\n }\n });\n}", "title": "" }, { "docid": "e43b844f7d05b23a6a31a8d78b4e5c85", "score": "0.5477727", "text": "function updateDisplay() {\r\n\tfor(var key in classNodes){\r\n\t\tif(classNodes[key].isAvailable() == false){\r\n\t\t\tdocument.getElementById(key+\"label\").className = \"hiddencourse\";\r\n\t\t}\r\n\t\telse if(document.getElementById(key+\"label\").className == \"coursetaken\"){\r\n\t\t\tdocument.getElementById(key+\"label\").className = \"coursetaken\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.getElementById(key+\"label\").className = \"course\";\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "d86497ad9941b0b76385ba3c2f0d3fe7", "score": "0.5472734", "text": "function makeCourseDataListSetting(){\n\tvar courseDataListSetting = {\n columns:[\n {EN:'ID', ZH:'编号', sortName:'prefix_id', width:70, isMustShow:true},\n {EN:'Name', ZH:'名称', sortName:'course_name_sort', width:100, isMustShow:true, align : 'left'},\n {EN:'Brief', ZH:'简介', width:180, autoWidth: true, align : 'left'},\n {EN:'Target Attendees', ZH:'目标人群', width:150, align : 'left'},\n {EN:'Duration', ZH:'持续时间', sortName:'course_duration', width:100},\n {EN:'Type', ZH:'类别', sortName:getListI18NSortField('courseType_type_name_sort'), width:100},\n {EN:'Tag', ZH:'标签', sortName:'course_tag', width:80, align : 'left'},\n {EN:'If-Certificated', ZH:'是否认证', sortName:'course_is_certificated', width:130},\n {EN:'Update History', ZH:'更新历史', width:150},\n {EN:'Author', ZH:'作者', sortName:'course_author_name_sort', width:100},\n {EN:'History Trainer', ZH:'历史培训者', width:150}\n ],\n language: configI18n(),\n criteria: courseCriteria,\n hasPageSize:false,\n minHeight: 240,\n pageSizes: [],\n hasAttachmentIcon: true,\n hasAddIcon : true,\n addIconHandler : function(row){\n\t\t\tvar courseId = row.find(\".dataList-div-addIcon\").attr(\"pk\");\n\t\t selectCourseBlock(row.find(\".ID\").text(), row.find(\".Name\").text(), \"C\", courseId);\n\t\t},\n\t\tisRepeat : true,\n url: $('#basePath').val()+'course/searchCourse',\n updateShowField: {\n \turl: $('#basePath').val()+'searchCommon/searchCommon_updateShowFields?searchFlag=3',// 0 is course\n callback: function(data){\n \tif(data && data.error){\n \t\talert(\"save fail!\");\n }\n }\n },\n updateShowSize: {\n url: $('#basePath').val()+'searchCommon/searchCommon_updateShowSize?searchFlag=3',// 0 is course\n callback: function(data){\n if(data && data.error){\n alert(\"save fail!\");\n }\n }\n }\n// ,\n// contentHandler : function(str){\n// \t\treturn resultContentHandle(str);\n// }\n \n\t};\n\treturn courseDataListSetting;\n}", "title": "" }, { "docid": "9e2e04da7179ac57230f3bc565637b12", "score": "0.54695493", "text": "function showDetailOf(id){\n\tvar currId = id;\n\tvar not = objArray[id];\n\t//console.log('show ' + not);\n\t\n\t//color header\n\t$('#noti_header').css('border-top-color',colorArray[not.category]);\n\t\n\t//eventually hide breadcrumb\n\t$('#breadcrumb').hide();\n\t\n\t$('#noti_text').text(\"\");\n\t\n\tif (not.category == \"twitter\"){\t\t\n\t\t$('#noti_title').text(not.set);\n\t\t$('#noti_text').append('<h3>' + not.author + '</h3>');\n\t\t$('#noti_text').append(not.text);\n\t\t$('#noti_text').append('<p><a target=\"_blank\" href=\"' + not.link + '\"> Open on twitter' + '</a></p>');\n\t\tfillComments(not);\n\t}else if (not.category == \"comments\"){\n\t\t$('#noti_title').text(not.set);\n\t\t$('#noti_text').append('<h3>' + not.author + '</h3>');\n\t\t$('#noti_text').append(not.text);\n\t\t$('#noti_text').append('<p><a target=\"_blank\" href=\"' + not.link + '\"> Open in new window' + '</a></p>');\n\t\t$('#noti_comment_container').hide();\n\t}else if (not.category == \"files\"){\n\t\t$('#noti_title').text(not.course);\n\t\t$('#breadcrumb').show();\n\t\tvar breadcrumbs = not.breadcrumb.split(\"/\");\n\t\t$('#breadcrumb1').text(breadcrumbs[0]);\n\t\t$('#breadcrumb2').text(breadcrumbs[1]);\n\t\t$('#breadcrumb3').text(breadcrumbs[2]);\n\t\t$('#noti_text').append('<h3>' + not.author + '</h3>');\n\t\t$('#noti_text').append(not.text);\n\t\tfillComments(not);\n\t}else if (not.category == \"schedule\"){\n\t\t$('#noti_title').text(not.course);\n\t\t$('#noti_text').append('<h3>' + not.author + '</h3>');\n\t\t$('#noti_text').append(not.text);\n\t\tfillComments(not);\n\t}else if (not.category == \"rss\"){\n\t\t$('#noti_title').text(not.author);\n\t\t$('#noti_text').append('<h3>' + not.title + '</h3>');\n\t\t$('#noti_text').append(not.text);\n\t\t$('#noti_text').append('<p><a target=\"_blank\" href=\"' + not.link + '\"> Open in new window' + '</a></p>');\n\t\t$('#noti_comment_container').hide();\n\t}\n}", "title": "" }, { "docid": "7edc5ac9629b5b771849a056dc7ea01e", "score": "0.5465188", "text": "function activateInfoPanel(node) {\n nameHeading.innerText = node.data('full_name');\n jobHeading.innerText = node.data('job_title');\n while(jobList.firstChild) {\n jobList.removeChild(jobList.firstChild);\n }\n node.data('season_list').forEach( function(job) {\n let jobCard = document.createElement('li');\n jobCard.classList.add('list-group-item');\n jobCard.innerText = job;\n jobList.appendChild(jobCard);\n });\n infoPanel.classList.add('visible');\n}", "title": "" }, { "docid": "aa3677b37b4f31a33a391e9595462778", "score": "0.5460616", "text": "function onCourseSelectClick( e, cell ){\n var row = cell.getRow();\n // set header of association table\n $(\"#root-choice\").val(row.getData()[\"NAME\"]);\n // set type\n $(\"#root-type\").text(\"COURSE\");\n // note that we send the *cert* data obj - we filter by course\n resetAssocTable(\"course\", certData_obj, row.getData()[\"COURSE_ID\"]);\n // disable the course ADD buttons and enable cert ADD buttons\n $(\".course-add-button\").prop('disabled', true);\n $(\".cert-add-button\").prop('disabled', false);\n $(\"#nav-courses-tab\").tab('show');\n }", "title": "" }, { "docid": "67d8a2e9172181b310c21b9bb2ea88c2", "score": "0.54494005", "text": "addCourse(course) {\n this.courses[course.getID()] = course;\n }", "title": "" }, { "docid": "6d584ea5b74b470c963667cf5aa82325", "score": "0.5446653", "text": "function setMemberMenu(courses) {\n for (let i = 0; i < courses.length; i++) {\n let course = courses[i];\n let str = '<div class=\"menu-item d-flex justify-content-between my-3 p-3\">' +\n '<div class=\"menu-item-text\" >' +\n '<h2 class=\"item-name\">' + course.name +\n '</h2><h4 class=\"item-description\" >' +\n course.description +\n '</h4><h6 class=\"item-tags\" >' + course.stags +\n '</h6></div >' +\n '<div class=\"menu-item-price align-self-end\">' +\n '<h1 class=\"item-price\">' + course.mprice + '$' +\n '</h1></div ></div >';\n document.getElementById(course.category).innerHTML += str;\n }\n}", "title": "" }, { "docid": "f3b69aa64d05bd6ca7ccac1951683223", "score": "0.5445488", "text": "function getCourseDetail(courseID){\n let message={\n code:'404',\n courses:{}\n };\n for(var i =0; i< courses.length; i++){\n if(courseID == courses[i].id){\n message.code='200';\n message.courses = courses[i];\n break;\n }\n }\n return message;\n\n}", "title": "" }, { "docid": "42759839cdd497e6534b65b0701dd99d", "score": "0.5444348", "text": "function getCourseId(courseNode){ \n return courseNode.id;\n }", "title": "" }, { "docid": "c0bf41ccf1569ef8c7dbdb2705db017e", "score": "0.5442609", "text": "function onChange(){\n setCourses(courseStore.getCourses());\n\n }", "title": "" }, { "docid": "329491d7006c6414c5f6654e48c48d5a", "score": "0.54281574", "text": "renderCourses () {\n return this.state.courses.map(course => (\n <CoursesPanel\n course={course}\n key={course._id}\n getCourses={this.getCourses}\n setCourse={this.setCourse} />\n ))\n }", "title": "" }, { "docid": "6b9a81ac85e9f46dfc285804e65a1b0b", "score": "0.54230016", "text": "function hideCourse(){\n\t\n\tvar catalogueId = document.getElementById('LessonCatalogueId').value;\t\n\tif(catalogueId == ''){\t\t\n\t\tdocument.getElementById('courseDiv').style.display = 'none';\t\t\n\t} \n\t\n}", "title": "" }, { "docid": "f9057efef26fe8d78cc6f2d5acd4a5ba", "score": "0.54179984", "text": "async getCourseDetails(databaseFileName, season, programme, classId, course, date) {\n const mappedCourse = course.replace(\"[\", \"*\").replace(\"]\", \"-\")\n return await service.doFetch(GET_COURSE_DETAILS_URI(databaseFileName, season, programme, classId, mappedCourse, date), getAuthorizationHeader())\n }", "title": "" }, { "docid": "5cf19fe4edb1ba680b4cdf098822d233", "score": "0.53995574", "text": "function updateScheduleModal(e) {\n currentCourse = courseList.find(element => element.id === e.target.id);\n // console.log(currentCourse);\n let scheduleModalBody = document.getElementById('scheduleModalBody');\n scheduleModalBody.innerText = currentCourse.title + '\\n' + currentCourse.deptShort + ' ' + currentCourse.courseNo + ' - ' + currentCourse.sectionNo; \n }", "title": "" }, { "docid": "f213a171dda4bec3754ceff28e5456d9", "score": "0.5393082", "text": "function showCourseSelect(){\n if(term != \"\"){\n $(\"#content\").html(defaultContent);\n $('#term-input-group').hide();\n $('#course-input-group').show();\n updateClassTable();\n updateRestrictionTable();\n }\n}", "title": "" }, { "docid": "7a5ff0f92a18427d275819fc943be38e", "score": "0.53791916", "text": "async function loadCourses() {\n await fetch('http://127.0.0.1:8000/materias')\n .then(res => res.json())\n .then(data => {\n let rta = ``;\n data.forEach(curso => {\n rta += generateCourseCard(\n curso.nombre,\n curso.grado,\n arregloColores[curso.color],\n curso.id\n );\n });\n contenedorCursos.innerHTML = rta;\n });\n}", "title": "" }, { "docid": "b57cb251be92d0e8c77988079abab11b", "score": "0.53680044", "text": "constructor(id, creditsNeeded) {\n this.id = parseInt(id);\n this.creditsNeeded = parseInt(creditsNeeded) || 0;\n this.courses = {};\n this.majors = {};\n }", "title": "" }, { "docid": "17da64199a80bae0e472a85b23ce53af", "score": "0.53596336", "text": "function getCourseData() {\n\n courseraService.getCourses().then(function(response) {\n\n function createCategories(courseData) {\n if (courseData !== undefined) {\n var categories = {};\n for (var i = 0; i < courseData.length; i++) {\n if (courseData[i].domainTypes !== undefined) {\n if (!(courseData[i].domainTypes[0].domainId in categories)) {\n categories[courseData[i].domainTypes[0].domainId] = { 'name': courseData[i].domainTypes[0].domainId, 'sites': [] };\n }\n }\n }\n vm.categories = categories;\n }\n\n }\n\n function createMainObj(data) {\n var arr = [];\n for (var j = 0; j < data.elements.length; j++) {\n var obj = {};\n obj[\"photoUrl\"] = data.elements[j].photoUrl;\n obj[\"name\"] = data.elements[j].name;\n obj[\"description\"] = data.elements[j].description;\n obj[\"domainTypes\"] = data.elements[j].domainTypes;\n obj[\"partnerIds\"] = data.elements[j].partnerIds;\n obj[\"slug\"] = data.elements[j].slug;\n arr.push(obj);\n }\n\n for (var j = 0; j < arr.length; j++) {\n for (var k = 0; k < data.linked['partners.v1'].length; k++) {\n if (arr[j]['partnerIds'][0] == data.linked['partners.v1'][k].id) {\n arr[j][\"partnerName\"] = data.linked['partners.v1'][k].name\n }\n\n }\n }\n\n\n vm.courseData = arr; \n }\n\n function pushIntoCategories() {\n for (var i = 0; i < vm.courseData.length; i++) {\n var p = vm.courseData[i];\n for (var j = 0; j < p[\"domainTypes\"].length; j++) {\n vm.categories[p[\"domainTypes\"][j].domainId].sites.push(p);\n }\n }\n }\n\n function randomizeCat() {\n // category route shows the 6 random courses from each category, so randomize and get first 6\n for (var key in vm.categories) {\n if (vm.categories[key].sites.length === 0) {\n continue;\n }\n vm.categories[key].sites.sort(function() {\n return .5 - Math.random()\n });\n vm.categories[key].featured = vm.categories[key].sites.slice(0, 6);\n }\n\n }\n\n createCategories(response.data.elements);\n createMainObj(response.data);\n pushIntoCategories();\n randomizeCat();\n });\n }", "title": "" }, { "docid": "52c682a47a050401069db7dbaeb9f850", "score": "0.53587824", "text": "function loadCoursesCallback(data) {\n courses = [];\n for (i in data) {\n if (data.hasOwnProperty(i)) {\n courses[i] = {data:data[i], attr:{id:\"course\" + data[i].id, rel: \"course\"}};\n courses[i].data.title = courses[i].data.name;\n }\n }\n return courses;\n}", "title": "" }, { "docid": "76e346ef154959962d8b8f18d47feacf", "score": "0.53455746", "text": "function ciniki_tenants_info() {\n\n //\n // Edit the tenant information\n //\n this.info = new M.panel('Tenant Information', 'ciniki_tenants_info', 'info', 'mc', 'medium', 'sectioned', 'ciniki.tenants.info');\n this.info.sections = {\n 'general':{'label':'General', 'fields':{\n 'tenant.name':{'label':'Name', 'type':'text'},\n 'tenant.category':{'label':'Category', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n 'active':function() { return (M.stMode==null&&(M.userPerms&0x01)==1?'yes':'no');}, \n },\n 'tenant.sitename':{'label':'Sitename', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n// 'active':function() { return (M.modOn('ciniki.web')&&(M.userPerms&0x01)==1?'yes':'no');}, \n },\n 'tenant.tagline':{'label':'Tagline', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n 'active':function() { return (M.modOn('ciniki.web')?'yes':'no');}, \n },\n }},\n 'contact':{'label':'Contact', \n// 'visible':function() {return M.modOn('ciniki.web') ? 'yes' : 'no'; },\n 'fields':{\n 'contact.person.name':{'label':'Name', 'type':'text'},\n 'contact.phone.number':{'label':'Phone', 'type':'text'},\n 'contact.cell.number':{'label':'Cell', 'type':'text'},\n 'contact.tollfree.number':{'label':'Tollfree', 'type':'text'},\n 'contact.fax.number':{'label':'Fax', 'type':'text'},\n 'contact.email.address':{'label':'Email', 'type':'text'},\n 'contact.website.url':{'label':'Website', 'type':'text'},\n }},\n 'address':{'label':'Address', \n// 'visible':function() {return M.modOn('ciniki.web') ? 'yes' : 'no'; },\n 'fields':{\n 'contact.address.street1':{'label':'Street', 'type':'text'},\n 'contact.address.street2':{'label':'Street', 'type':'text'},\n 'contact.address.city':{'label':'City', 'type':'text'},\n 'contact.address.province':{'label':'Province', 'type':'text'},\n 'contact.address.postal':{'label':'Postal', 'type':'text'},\n 'contact.address.country':{'label':'Country', 'type':'text'},\n }}\n };\n this.info.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.tenants.getDetailHistory', 'args':{'tnid':M.curTenantID, 'field':i}};\n }\n this.info.fieldValue = function(s, i, d) { return this.data[i]; }\n this.info.liveSearchCb = function(s, i, value) {\n if( i == 'tenant.category' ) {\n M.api.getJSONBgCb('ciniki.tenants.searchCategory', {'tnid':M.curTenantID, 'start_needle':value, 'limit':15}, function(rsp) {\n M.ciniki_tenants_info.info.liveSearchShow(s, i, M.gE(M.ciniki_tenants_info.info.panelUID + '_' + i), rsp.results);\n });\n }\n };\n this.info.liveSearchResultValue = function(s, f, i, j, d) {\n if( f == 'tenant.category' && d.result != null ) { return d.result.name; }\n return '';\n };\n this.info.liveSearchResultRowFn = function(s, f, i, j, d) { \n if( f == 'tenant.category' && d.result != null ) {\n return 'M.ciniki_tenants_info.info.updateField(\\'' + s + '\\',\\'' + f + '\\',\\'' + escape(d.result.name) + '\\');';\n }\n };\n this.info.updateField = function(s, fid, result) {\n M.gE(this.panelUID + '_' + fid).value = unescape(result);\n this.removeLiveSearch(s, fid);\n };\n this.info.open = function(cb) {\n if( M.curTenant.hamMode != null && M.curTenant.hamMode == 'yes' ) {\n this.title = 'Station Information';\n } else {\n this.title = 'Tenant Information';\n }\n M.api.getJSONCb('ciniki.tenants.getDetails', {'tnid':M.curTenantID, 'keys':'tenant,contact'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_info.info;\n p.data = rsp.details;\n p.show(cb);\n });\n }\n this.info.save = function() {\n // Serialize the form data into a string for posting\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.tenants.updateDetails', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_tenants_info.info.close();\n });\n } else {\n this.close();\n }\n }\n this.info.addButton('save', 'Save', 'M.ciniki_tenants_info.info.save();');\n this.info.addClose('Cancel');\n\n this.start = function(cb, appPrefix) {\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_tenants_info', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n \n this.info.open(cb);\n }\n}", "title": "" }, { "docid": "80409fbeac886f76d8ebb31e707d2b99", "score": "0.5325024", "text": "function getMoreCourses(){\n $.getJSON('../controller/ctrolIndex.php',{page:page_begin,accion:1},function(r){\n page_begin += 2;//aumentamos el comienzo de las fila en 2\n if(r.message == 'yes_data'){\n var data = r.data;\n var htmlCourses = \"\";\n console.log(data);\n \n $.each(data,function(i){\n var descripFinal = \"\";\n var arrayDescrip = data[i][3].split(' ');\n if(arrayDescrip.length < 40){\n descripFinal = data[i][3];\n }else{\n for(var j = 0; j < 41; j++){\n descripFinal += ' ' + arrayDescrip[j];\n }\n descripFinal += \".......\";\n }\n \n htmlCourses += '<div class=\"col-md-6 cursosAjax\" style=\"height:250px; display:none;\">\\\n <div class=\"col-md-2 col-sm-3 text-center\">\\\n <a class=\"story-title\" href=\"#\"><img alt=\"\" src=\"' + data[i][5] + '\" style=\"width:100px;height:100px\" class=\"\"></a>\\\n </div>\\\n <div class=\"col-sm-offset-1 col-md-9 col-sm-9\">\\\n <h3>' + data[i][4] + '</h3>\\\n <div class=\"row\">\\\n <div class=\"col-xs-12\"><b>Descripción:</b></div>\\\n </div>\\\n <div class=\"row\">\\\n <div class=\"col-xs-12\">' + descripFinal + '</div>\\\n </div>\\\n <div class=\"row\">\\\n <div class=\"col-xs-9\">\\\n <h4><span class=\"label label-default\" style=\"cursor:pointer;\" onclick=\"getDataDetailCourse(' + data[i][0] + ');\">Leer más</span></h4>\\\n </div>\\\n </div>\\\n </div>\\\n </div>';\n });\n\n $(\"#contentCourses\").append(htmlCourses);\n $(\"#contentCourses\").children('.cursosAjax').fadeIn(); \n }else{\n $(\"#moreCourses\").css({display:'none'});//Ocultamos el btn de mas ya que no hay mas cursos\n }\n });\n}", "title": "" }, { "docid": "42353572336efcb3785061b280d02f11", "score": "0.531662", "text": "async function updateCourseInformation(subject, catalogNumber) {\n const { err, info } = await waterloo.getCourseInformation(subject, catalogNumber);\n if (err) return err;\n\n try {\n await courses.setCourseInfo(subject, catalogNumber, info);\n return null;\n } catch (err) {\n console.error(err);\n return err;\n }\n}", "title": "" }, { "docid": "c10d68c09e96457f7bca7e2ca49dc664", "score": "0.5314695", "text": "function formatCourse (course) {\n var material = course.material\n material.cover = helper.getImageUrl(material.cover)\n course.statusTitle = helper.getCourseStatus(course.status)\n course.lesson_time = course.lesson_time.substr(0, 16)\n course.sign_up_time = course.sign_up_time.substr(0, 16)\n course.ageLabel = labelModule.getLabel(material.age).title\n course.targetLabel = labelModule.getLabel(material.target).title\n course.themeLabel = labelModule.getLabel(material.theme).title\n course.sceneLabel = labelModule.getLabel(material.scene).title\n\n return course\n}", "title": "" }, { "docid": "bcba5f66a3d087d6dd00f7eee29371cf", "score": "0.5309851", "text": "function showEnsDetail(el) {\n\t// logDebug(\"[ELEMENT EN COURS] \"+$(el).attr(\"class\"));\n\n\tvar coord_ens = $(el).find(\".json-mag\");\n\t// logDebug($(coord_ens).html());\n\tvar cEns = JSON.parse($(coord_ens).html());\n\t//logDebug(cEns);\n\t//Rajouter le lien de partage\n\tvar shareLink = \"<span class=\\\"fidshare\\\" onClick=\\\"shareTrigger('Découvrez les avantages de \"+cEns.nom+\" sur Fidlink !','\"+GLOBAL_playStoreURL+\"');\\\"><i class=\\\"fa fa-share-alt\\\"></i></span>\";\n\t//Rajouter le lien d'appel\n\t//var callLink = \"<a class=\\\"fidtel\\\" href=\\\"tel:\"+clean_phone(cEns.tel)+\"\\\"><i class=\\\"fa fa-phone\\\"></i></a>\";\n\tvar callLink = \"<a class=\\\"fidtel\\\" href=\\\"#\\\" onclick=\\\"window.open('tel:\"+clean_phone(cEns.tel)+\"', '_system'); logDebug('Appel tel a \"+cEns.nom+\"');return false;\\\"><i class=\\\"fa fa-phone\\\"></i></a>\";\n\t\n\t$(\"#gen-content-div2 h3.heading-title\").html(cEns.nom + callLink + shareLink);\n\t\n\t$(\".sel-ens\").removeClass(\"sel-ens\");\n\t$(el).addClass(\"sel-ens\");\n\n\t// Chargement de la map\n\t$(\"#enseigne-map\").attr(\"class\", \"body-spinner\");\n\tdrawEnsMap(\"enseigne-map\", cEns);\n\t$(\"#enseigne-map\").attr(\"class\", \"\");\n\t// Ramener en haut de carte\n\t$(\"#gen-content-div2\").scrollTop(0);\n}", "title": "" }, { "docid": "25f31a55fa19a103eb428ba97a5c6523", "score": "0.530589", "text": "async function getCourse(event) {\n setIsLoading(true);\n const bodyParam = {\n body: {\n oid: config.aws_org_id,\n eid: userDetails.eid,\n pid: pid,\n bpid: bid,\n courseid: ttitle[event.target.value].tid,\n bcourseid: ttitle[event.target.value].bcid,\n ptitle: ptitle,\n },\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n };\n try {\n const response = await API.post(\n config.aws_cloud_logic_custom_name,\n Constants.GET_COURSE,\n bodyParam\n );\n console.log(\"response\", response);\n if(response === undefined || response === null || response[\"errorType\"] === \"TypeError\" || Object.keys(response).length === 0 ){\n setCourseData(null);\n setIsLoading(false);\n }\n else{\n setCourseData(response);\n setIsLoading(false);\n }\n\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "b7b82dd2959a2d949733b6ae674d1259", "score": "0.53033537", "text": "function CISList() {\r\n\t\tfor(var i=0;i<CISCourses.length;i++) {\r\n\t\t\tcoursesNeeded[i] = CISCourses[i].prefix + \" \" + CISCourses[i].courseNumber;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "65b52dce25442bfa159f55b87e0d7f9a", "score": "0.5293845", "text": "function getCourseDescription(subject, catalogNumber, callback) {\n uwclient.get(`/courses/${subject}/${catalogNumber}.json`, function(err, res) {\n if (err) {\n console.error(err);\n return callback(err, null);\n }\n if (!Object.keys(res.data).length) return callback('No course found.', null);\n const { title, description } = res.data;\n callback(null, { subject, catalogNumber, title, description });\n });\n}", "title": "" }, { "docid": "8d3ee9d60aa2c44fda00238dfd6d52d2", "score": "0.5284031", "text": "function setupTool() {\n const discoverOnly = document.getElementById('discoverOnly').value;\n runAllCourses(discoverOnly);\n}", "title": "" }, { "docid": "5becc9742d316ad535d4f1a5ecfbe4b8", "score": "0.5281493", "text": "function populateMajorClasses() {\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n document.getElementById(\"MajorCourses\").innerHTML = this.responseText;\r\n }\r\n }\r\n\r\n // Get request to php using major and year started to query from database\r\n xmlhttp.open(\"Get\", \"getcourses.php?major=\" + receivePickList(\"Major\") + \"&year=\" + receivePickList(\"yearStarted\"), false);\r\n xmlhttp.send();\r\n}", "title": "" }, { "docid": "09949921bd557b17259cf114b6429444", "score": "0.5278838", "text": "function getLink(id){\n return '/course/'+id;\n }", "title": "" }, { "docid": "5169305af34d85ded5f1690ab705f722", "score": "0.5274987", "text": "function displayStudentInfo() {\n\tvar studentInfo = \"Student Information :<br>ID : \" + varshaK.studentID\n\t\t\t+ \"<br>Name : \" + varshaK.studentName;\n\t// Get the element where the information is to be displayed and update its\n\t// contents with that of 'studentInfo'\n\tdocument.getElementById('student_data').innerHTML = studentInfo;\n\n}", "title": "" }, { "docid": "11ed57cf48251c490e72cb6ae21783f3", "score": "0.5266695", "text": "function loadElements(generatedSchedule) {\n\tvar semesterContainer = document.getElementById(\"semesterContainer\");\n\tsemesterContainer.innerHTML = \"\";\n $(semesterContainer).append($(\"<h2 id='schedule-label'>Generated Schedule</h2>\")); // Generated Schedule\n var num = 0; // variable to determine how many courses entered\n for (var i = 0; i < generatedSchedule.length; i++) { // iterate through number of semesters\n\n var semester = document.createElement(\"div\"); // semester div\n semester.className = \"semester\";\n // label for the semester \"Semester 1\"\n var head = document.createElement(\"h3\");\n head.className = \"semester-label\";\n head.innerHTML = \"Semester \" + (i + 1);\n semester.appendChild(head);\n // break lines in semester surrounding the column infoTable\n $(semester).append($(\"<hr class='semester-divider'>\"));\n semester.appendChild(createInfoTable());\n $(semester).append($(\"<hr class='semester-divider'>\"));\n \n // iterate through the course in each semester\n for (var j = 0; j < generatedSchedule[i].length; j++) {\n\n\t\t\tvar classDiv = document.createElement(\"div\"); // div for class row\n\t\t\tclassDiv.className = \"course\";\n \n\t\t\tvar courseID = generatedSchedule[i][j] // get the courseID\n // courseID element\n\t\t\tvar id = document.createElement(\"span\");\n id.className = \"course-id\";\n id.innerHTML = courseID;\n classDiv.appendChild(id);\n\n // loop to search catalog for courseName and courseCredits\n // if it is not in catalog will display NOT FOUND\n\t\t\tvar courseName = \"NOT FOUND\";\n\t\t\tvar courseCredits = \"NOT FOUND\";\n\t\t\tfor(var k = 0; k < courseCatalog.length; k++) {\n\n\t\t\t\tif(courseCatalog[k].Id == courseID) {\n\t\t\t\t\tcourseName = courseCatalog[k].Name;\n // some courses have min and max number of credits so this will display it properly\n\t\t\t\t\tif(courseCatalog[k].Min_Credits == courseCatalog[k].Max_Credits) {\n\t\t\t\t\t\tcourseCredits = courseCatalog[k].Min_Credits;\n\t\t\t\t\t} else {\n\t\t\t\t\tcourseCredits = courseCatalog[k].Min_Credits + \"-\" + courseCatalog[k].Max_Credits;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n \n // courseName element \n var name = document.createElement(\"span\");\n\t\t\tname.className = \"course-name\";\n name.innerHTML = courseName;\n classDiv.appendChild(name);\n \n // courseCredits element\n var credit = document.createElement(\"span\");\n\t\t\tcredit.className = \"course-credit\";\n credit.innerHTML = courseCredits;\n classDiv.appendChild(credit);\n \n // dropdowm menu containter of selecting desired semesters\n var semListCon = document.createElement(\"div\");\n semListCon.className = \"semester-label\";\n\t\t\tvar semList = document.createElement(\"div\");\n semList.className = \"dropdown-check-list\";\n // labels each checkbox for what number course it is **only way to iterate through them from what I found**\n $(semList).append($(\"<span class='anchor' value=\" + num + \">Semesters</span>\")); \n num++; //increment num\n var uList = document.createElement(\"ul\");\n uList.className = \"items\";\n for(var k = 0; k < generatedSchedule.length; k++) {\n var item = document.createElement(\"li\");\n item.innerHTML = \"<input type='checkbox' class='semCheck' checked='true' />\" + (k + 1);\n uList.appendChild(item);\n }\n semList.appendChild(uList);\n semListCon.appendChild(semList);\n classDiv.appendChild(semListCon);\n\n // add course div to semester container and a line to break up classes\n semester.appendChild(classDiv);\n $(semester).append($(\"<hr class='course-divider'>\"));\n }\n // add semester to semesterContainer then a break between semesters\n semesterContainer.appendChild(semester);\n\t\tsemesterContainer.appendChild(document.createElement(\"br\"));\n }\n\t// set up the checkboxes and add modify schedule button to bottom of page\n\tsetUpCheckBoxes();\n\t$(semesterContainer).append($(\"<button type='button' class='btn btn-primary btn-lg btn-block' id='modifyButton'>Modify Schedule</button>\"));\n}", "title": "" }, { "docid": "6fc02cbb78e90e6429bc3d562b87725f", "score": "0.52594584", "text": "function fetch()\n\t{\n\t\t$(\"#fetch_citations_from\").click(function()\n\t\t{\n\t\t\tvar userStr=$(\"#fetch_citations_username\").val();\n\t\t\t//alert(userStr);\n\t\t\tvar username=\"/\"+userStr.charAt(0)+\"/\"+userStr.substr(0,2)+\"/\"+userStr;\n\t\t\talert(username);\t\t\t\n\t\t\tsakai.api.Server.loadJSON(\"/_user\"+username+\"/public/citationdata\",function(success,data)\n\t\t\t{\n\t\t\t\t//alert(success);\n\t\t\t\tif (success)\n\t\t\t\t{\n\t\t\t\t\tcitation_info=data;\n\t\t\t\t\t//alert(\"asd\");\n\t\t\t\t//alert($(citation_info).length);\n\t\t\t\tfor (var key in citation_info) \n\t\t\t\t{\n \t\t\t\t\tif (citation_info.hasOwnProperty(key)) \n\t\t\t\t\t{\n \t\t\t\t\t\tvar count1=0;\n\t\t\t\t\t\tcount1++;\n\t\t\t\t\t\t$(\"#fetched_citations\").append( \"TY:\"+citation_info[key].TY+ \"<br />\"+\"TL:\"+citation_info[key].TL+\"<br />\"+\"N1:\"+citation_info[key].N1+\"<br />\"+\"AU:\"+citation_info[key].AU+\"<br />ER<br><br />\");\n \t\t\t\t\t}\n //alert(count1);\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\talert(\"sorry \"+ userStr+\" has no public citations\");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "1cbc2d88bb6c28894dd14101f3eab1cb", "score": "0.5258354", "text": "function addHTMLCourseToSchedule(term,x)\n{\n var Name = term+\"-registered-course-list\";\n \n \n for(let i=0; i<= courseArr.length-1;i++)\n {\n if(courseArr[i].courseNUM==x)\n {\n document.getElementById(Name).innerHTML += \"<div class='one-course'><div class='course-visualization-box'><section class='course-title'> <h4><strong>\"+courseArr[i].courseNUM+\"</strong></h4> </section><section class='course-title'> <h4><strong>\"+courseArr[i].courseName+\"</strong></h4> </section></div><div class='course-visualization-box'><section class='course-title'><strong>Time:</strong> \"+courseArr[i].fallHours+\" <strong></section><section class='course-title'>Days: </strong> \"+courseArr[i].fallDays+\" </section><section class='course-title'><strong>Location:</strong> \"+courseArr[i].fallLocation+\" </section><section class='course-title' id='course-credits'><strong>Credits:</strong> \"+courseArr[i].credits+\" </section></div> </div>\";\n }\n }\n \n\n}", "title": "" }, { "docid": "e6574f95b4073580969c42c9542b6314", "score": "0.5236472", "text": "function labelOnMouseover(element) {\r\n\tvar course = element.id.substr(0,element.id.length-\"label\".length);\r\n\t//show the title\r\n\tdocument.getElementById(\"coursetitle\").innerHTML=classes[course].title;\r\n\t//show the credits the course is worth\r\n\tdocument.getElementById(\"coursecredits\").innerHTML=classes[course].credits;\r\n\t//show the course description\r\n\tdocument.getElementById(\"coursedescription\").innerHTML=classes[course].description;\r\n\r\n}", "title": "" }, { "docid": "991c461b96620b48f1b4d0bfa9a944b6", "score": "0.52343696", "text": "function getclusterInfo( n ) {\n //*********\n // info to display on html page\n //*********\n\n info = '<div>'\n // close button\n info+='<div style=\"position:fixed; width:30px; margin-left:-15px; margin-top:-11px; padding-bottom:2px; text-align:center; font-size:18px; font-weight:500; color:black; cursor:pointer; background-color: #ddd; border-radius:0 0 3px 0;\" onClick=\"clusterInfoDiv.html(\\'\\').attr(\\'class\\',\\'panel_off\\');\">x</div>'\n\n // general info\n\n info += '<div class=\"stuff\" style=\"text-align:right;margin-top:10px;font-size:18px\"><b>'+ n.title+'</b></div>'\n info += '<div class=\"stuff\" style=\"text-align:right;font-size:13px;\"><span style=\"opacity:0.4\"><i>Published in</i></span> ' + n.journal + '<br/></div>'\n info += '<div class=\"stuff\" style=\"text-align:right;font-size:13px;\"><span style=\"opacity:0.4\"><i>Type:</span> </i>'+ n.doctype +', <span style=\"opacity:0.4\"><i>Publication year:</i></span> ' + n.year + '<br/></div><br/>'\n\n // selector\n /*sel = '<select id=\"myjump\" style=\"width:100%\">'\n keepitem.forEach(function(elt){sel += '<option value=\"'+elt+'\">'+itemfoos[elt][2]+'</option>'})\n sel += '</select>'\n info += '<div class=\"stuff\" style=margin-top:5px;font-size:13px\"><strong>Jump to:</strong><br/>'+sel+'</div>'\n */\n\n // all tables\n info += '<div class=\"stuff\" style=\"font-size:11px;\">'\n keepitem.forEach(function(elt){\n // most used items\n if(elt.length<3){info += itemsTablesP(n.stuff[elt], elt, itemfoos[elt][0],itemfoos[elt][2])}\n })\n info += '</div>' \n\n // end\n info+='</div>'\n return info;\n }", "title": "" }, { "docid": "1e2e1d7e8623f4cfa761905663138fe2", "score": "0.5232177", "text": "function getAllCourses(course) {\r $.ajax({\r url: '/api/admin/studentclass/findAllCourse',\r type: \"GET\",\r datatype: \"JSON\",\r data: '',\r success: function (result) {\r var option = '<option value=\"\" disabled selected>---select course---</option>';\r for (var i in result) {\r option += '<option class=\"courseOption\" value=\"' + result[i].courid + '\">' + result[i].cournm + '</option>';\r }\r $(\"#\" + course).html(option);\r }\r });\r}", "title": "" }, { "docid": "6872b217d4e97286407d8696843bb8e1", "score": "0.5227734", "text": "function showCourses() {\n setActive(courseArr, document.getElementById(\"active-title\"), document.getElementById(\"active-list\"), \"My Courses: \")\n}", "title": "" }, { "docid": "6d99f5a6bb86809c3b22e23cd9dc6892", "score": "0.52271307", "text": "function loadCoursesLevel(){\n\n console.log(\"Loading courses\");\n \n document.title=\"All courses by level\";\n \n $.ajax({\n method: \"POST\",\n crossDomain: true, \n url: \"http://bigbiggym.altervista.org/server/getAllCourses_level.php\", \n success: function(response) {\n console.log(JSON.parse(response));\n var courses = JSON.parse(response);\n var el = \"\";\n var intermediate = \"\";\n var advanced = \"\";\n var beginner = \"\";\n var i=0;\n \n \n $(\"#anchor\").hide();\n\n \n for (i=0; i<courses.length; i++) {\n if (courses[i].Level != \"beginner\") {\n break;\n \n }\n beginner += \"<div class='col-md-4'>\";\n beginner += \"<img src='images/\" + courses[i].Name + \"/main.png' height='200' width='230' />\";\n beginner += \"<h3>\" + courses[i].Name + \"</h3>\";\n beginner += \"<p id='courseDetail'>\" + courses[i].ShortDescription + \"</p>\";\n\n beginner += \"<p>Category: \" + courses[i].Category + \"</p>\";\n beginner += \"<p>Level: \" + courses[i].Level + \"</p>\";\n\n beginner += \"<button onclick=\\\"parent.location='course.html?name=\" + courses[i].Name + \"&from=all'\\\"class='btn' type='button' id='std-btn'>More Info</button>\";\n beginner += \"</div>\";\n \n }\n \n if (beginner != \"\") {\n var header=\"\";\n beginner += \"</div>\";\n header = \"<div class='row'>\";\n header += \"<div class='col-lg-12'>\";\n header += \"<h3 class='page-header'>Beginner</h3> \"; \n header += \"</div>\";\n header += \"</div>\";\n header += \"<div class='row'>\";\n beginner = header+ beginner;\n }\n \n \n for (i; i<courses.length; i++) {\n if (courses[i].Level != \"intermediate\") {\n break;\n \n }\n \n intermediate += \"<div class='col-md-4'>\";\n intermediate += \"<img src='images/\" + courses[i].Name + \"/main.png' height='200' width='230' />\";\n intermediate += \"<h3>\" + courses[i].Name + \"</h3>\";\n intermediate += \"<p id='courseDetail'>\" + courses[i].ShortDescription + \"</p>\";\n intermediate += \"<p>Category: \" + courses[i].Category + \"</p>\";\n intermediate += \"<p>Level: \" + courses[i].Level + \"</p>\";\n\n intermediate += \"<button onclick=\\\"parent.location='course.html?name=\"+courses[i].Name+\"&from=all'\\\"class='btn' type='button' id='std-btn'>More Info</button>\";\n intermediate += \"</div>\";\n \n }\n \n if (intermediate != \"\") {\n var header=\"\";\n intermediate += \"</div>\";\n header = \"<div class='row'>\";\n header += \"<div class='col-lg-12'>\";\n header += \"<h3 class='page-header'>Intermediate</h3> \"; \n header += \"</div>\";\n header += \"</div>\";\n header += \"<div class='row'>\";\n intermediate = header+ intermediate;\n }\n \n for (i; i<courses.length; i++) {\n if (courses[i].Level != \"advanced\") {\n break;\n \n }\n advanced += \"<div class='col-md-4'>\";\n advanced += \"<img src='images/\" + courses[i].Name + \"/main.png' height='200' width='230' />\";\n advanced += \"<h3>\" + courses[i].Name + \"</h3>\";\n advanced += \"<p id='courseDetail'>\" + courses[i].ShortDescription + \"</p>\";\n\n advanced += \"<p>Category: \" + courses[i].Category + \"</p>\";\n advanced += \"<p>Level: \" + courses[i].Level + \"</p>\";\n\n advanced += \"<button onclick=\\\"parent.location='course.html?name=\"+courses[i].Name+\"&from=all'\\\"class='btn' type='button' id='std-btn'>More Info</button>\";\n advanced += \"</div>\";\n \n }\n \n if (advanced != \"\") {\n var header=\"\";\n advanced += \"</div>\";\n header = \"<div class='row'>\";\n header += \"<div class='col-lg-12'>\";\n header += \"<h3 class='page-header'>Advanced</h3> \"; \n header += \"</div>\";\n header += \"</div>\";\n header += \"<div class='row'>\";\n advanced = header+ advanced;\n }\n \n el = beginner + intermediate + advanced; \n \n \n \n console.log(el);\n $(\"#container\").html(el);\n },\n error: function(request,error) \n {\n console.log(\"Error\");\n }\n });\n}", "title": "" }, { "docid": "c1c4d02a0a3a6ec43a6e3a3151147370", "score": "0.5226949", "text": "function setMenu(courses) {\n for (let i = 0; i < courses.length; i++) {\n let course = courses[i];\n let str = '<div class=\"menu-item d-flex justify-content-between my-3 p-3\">' +\n '<div class=\"menu-item-text\" >' +\n '<h2 class=\"item-name\">' + course.name +\n '</h2><h4 class=\"item-description\" >' +\n course.description +\n '</h4><h6 class=\"item-tags\" >' + course.stags +\n '</h6></div >' +\n '<div class=\"menu-item-price align-self-end\">' +\n '<h1 class=\"item-price\">' + course.price +'$'+\n '</h1></div ></div >';\n document.getElementById(course.category).innerHTML += str;\n } \n}", "title": "" }, { "docid": "51ed4295c8426b9ef40c8fe881ae571a", "score": "0.5224424", "text": "function fill_assign_city_for_edit(id){\n jQuery('#visible_row').css('display','none');\n jQuery('#hidden_row').css('display','block');\n var cate_name = jQuery('#cate_'+id).text();\n var cate_id = jQuery('#category_'+id).text();\n jQuery('#set_hidden_city_update').text(cate_name);\n jQuery('#set_hidden_city_update').attr('val',cate_id);\n jQuery('#city_hidden_id').val(id);\n}", "title": "" }, { "docid": "31290b53d8138de53cae8dde5daf95cf", "score": "0.5220773", "text": "function ciniki_courses_registrations() {\n //\n // registrations panel\n //\n this.menu = new M.panel('Registrations',\n 'ciniki_courses_registrations', 'menu',\n 'mc', 'large narrowaside', 'sectioned', 'ciniki.courses.registrations.menu');\n this.menu.offering_id = 0;\n this.menu.sections = {\n// 'search':{'label':'', 'type':'livesearch'},\n 'prices':{'label':'Add Registration', 'type':'simplegrid', 'num_cols':2 , 'aside':'yes'},\n '_buttons':{'label':'', 'aside':'yes', 'buttons':{\n 'registrationspdf':{'label':'Class List (PDF)', 'fn':'M.ciniki_courses_registrations.menu.registrationsPDF(M.ciniki_courses_registrations.menu.offering_id);'},\n 'attendancepdf':{'label':'Attendance List (PDF)', 'fn':'M.ciniki_courses_registrations.menu.attendancePDF(M.ciniki_courses_registrations.menu.offering_id);'},\n 'registrationsexcel':{'label':'Class List (Excel)', 'fn':'M.ciniki_courses_registrations.menu.registrationsExcel(M.ciniki_courses_registrations.menu.offering_id);'},\n 'email':{'label':'Email Class', 'fn':'M.ciniki_courses_registrations.menu.emailShow();'},\n }},\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':4,\n 'noData':'No registrations',\n 'sortable':'yes',\n 'sortTypes':['text', 'text'],\n 'cellClasses':['multiline', 'multiline', ''],\n },\n 'messages':{'label':'Emails', 'type':'simplegrid', 'num_cols':2,\n 'cellClasses':['multiline', 'multiline'],\n 'headerValues':['Name/Date', 'Email/Subject'],\n 'sortable':'yes',\n 'sortTypes':['text','text'],\n 'noData':'No Emails Sent',\n },\n };\n this.menu.cellValue = function(s, i, j, d) {\n if( s == 'registrations' ) {\n switch(j) {\n case 0: return '<span class=\"maintext\">' + d.registration.customer_name + '</span>';\n case 1: return '<span class=\"maintext\">' + d.registration.student_name + '</span>';\n case 2: return '<span class=\"maintext\">' + d.registration.yearsold + '</span>';\n case 3: return '<span class=\"maintext\">' + d.registration.invoice_status_text + '</span>';\n case 4: return '<span class=\"maintext\">' + d.registration.registration_amount_display + '</span>';\n }\n } \n if( s == 'prices' ) {\n switch(j) {\n case 0: return d.price.name;\n case 1: return d.price.unit_amount_display;\n }\n }\n if( s == 'messages' ) {\n switch(j) {\n case 0: return '<span class=\"maintext\">' + d.customer_name + '</span>' \n + '<span class=\"subtext\">' + d.status_text + ' - ' + d.date_sent + '</span>';\n case 1: return '<span class=\"maintext\">' + d.customer_email + '</span>' \n + '<span class=\"subtext\">' + d.subject + '</span>';\n }\n }\n }\n this.menu.sectionData = function(s) {\n return this.data[s];\n }\n this.menu.noData = function(s) { return this.sections[s].noData; }\n this.menu.rowFn = function(s, i, d) {\n if( s == 'registrations' ) {\n return 'M.startApp(\\'ciniki.courses.sapos\\',null,\\'M.ciniki_courses_registrations.menu.open();\\',\\'mc\\',{\\'registration_id\\':\\'' + d.registration.id + '\\',\\'source\\':\\'offering\\'});';\n }\n if( s == 'prices' ) {\n return 'M.startApp(\\'ciniki.courses.sapos\\',null,\\'M.ciniki_courses_registrations.menu.open();\\',\\'mc\\',{\\'offering_id\\':M.ciniki_courses_registrations.menu.offering_id,\\'price_id\\':\\'' + d.price.id + '\\',\\'source\\':\\'offering\\'});';\n }\n if( s == 'messages' ) {\n return 'M.startApp(\\'ciniki.mail.main\\',null,\\'M.ciniki_courses_registrations.menu.open();\\',\\'mc\\',{\\'message_id\\':\\'' + d.id + '\\'});';\n }\n }\n this.menu.registrationsPDF = function(oid) {\n M.api.openFile('ciniki.courses.offeringRegistrations', {'tnid':M.curTenantID, 'output':'pdf', 'offering_id':oid});\n }\n this.menu.attendancePDF = function(oid) {\n M.api.openFile('ciniki.courses.offeringRegistrations', {'tnid':M.curTenantID, 'template':'attendance', 'output':'pdf', 'offering_id':oid});\n }\n this.menu.emailShow = function() {\n var customers = [];\n for(var i in this.data.registrations) {\n customers[i] = {\n 'id':this.data.registrations[i].registration.customer_id,\n 'name':this.data.registrations[i].registration.customer_name,\n };\n }\n M.startApp('ciniki.mail.omessage',\n null,\n 'M.ciniki_courses_registrations.menu.open();',\n 'mc',\n {'subject':'Re: ' + this.data.offering.name + ' (' + this.data.offering.condensed_date + ')', \n 'list':customers, \n 'object':'ciniki.courses.offering',\n 'object_id':this.offering_id,\n });\n }\n this.menu.registrationsExcel = function(oid) {\n M.api.openFile('ciniki.courses.offeringRegistrations', {'tnid':M.curTenantID, 'output':'excel', 'offering_id':oid});\n }\n this.menu.open = function(cb, oid) {\n this.data = {};\n if( oid != null ) { this.offering_id = oid; }\n M.api.getJSONCb('ciniki.courses.offeringRegistrationList', \n {'tnid':M.curTenantID, 'offering_id':this.offering_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_courses_registrations.menu;\n p.data = rsp;\n p.sections.registrations.headerValues = ['Name', 'Student', 'Age', 'Paid', 'Amount'];\n p.sections.registrations.num_cols = 5;\n p.refresh();\n p.show(cb);\n });\n }\n this.menu.addClose('Back');\n\n //\n // The panel for editing a registrant\n //\n this.edit = new M.panel('Registrant',\n 'ciniki_courses_registrations', 'edit',\n 'mc', 'medium', 'sectioned', 'ciniki.courses.registrations.edit');\n this.edit.data = null;\n this.edit.offering_id = 0;\n this.edit.registration_id = 0;\n this.edit.sections = { \n 'customer_details':{'label':'Customer', 'type':'simplegrid', 'num_cols':2,\n 'cellClasses':['label',''],\n 'addTxt':'Edit',\n 'addFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_courses_registrations.updateEditCustomer(null);\\',\\'mc\\',{\\'next\\':\\'M.ciniki_courses_registrations.updateEditCustomer\\',\\'customer_id\\':M.ciniki_courses_registrations.edit.customer_id});',\n },\n 'invoice':{'label':'Invoice', 'visible':'no', 'type':'simplegrid', 'num_cols':5,\n 'headerValues':['Invoice #', 'Date', 'Customer', 'Amount', 'Status'],\n 'cellClasses':['',''],\n },\n '_customer_notes':{'label':'Customer Notes', 'fields':{\n 'customer_notes':{'label':'', 'hidelabel':'yes', 'hint':'', 'size':'small', 'type':'textarea'},\n }},\n '_notes':{'label':'Private Notes', 'fields':{\n 'notes':{'label':'', 'hidelabel':'yes', 'hint':'', 'size':'small', 'type':'textarea'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_courses_registrations.saveRegistration();'},\n 'saveandinvoice':{'label':'Save and Invoice', 'fn':'M.ciniki_courses_registrations.saveRegistration(\\'yes\\');'},\n 'delete':{'label':'Delete', 'fn':'M.ciniki_courses_registrations.deleteRegistration();'},\n }},\n }; \n this.edit.fieldValue = function(s, i, d) { return this.data[i]; }\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.courses.offeringRegistrationHistory', 'args':{'tnid':M.curTenantID, \n 'registration_id':this.registration_id, 'offering_id':this.offering_id, 'field':i}};\n }\n this.edit.sectionData = function(s) {\n if( s == 'invoice' ) { return this.data[s]!=null?{'invoice':this.data[s]}:{}; }\n return this.data[s];\n }\n this.edit.cellValue = function(s, i, j, d) {\n if( s == 'customer_details' ) {\n switch(j) {\n case 0: return d.detail.label;\n case 1: return d.detail.value.replace(/\\n/, '<br/>');\n }\n } \n if( s == 'invoice' ) {\n switch(j) {\n case 0: return d.invoice_number;\n case 1: return d.invoice_date;\n case 2: return (d.customer!=null&&d.customer.display_name!=null)?d.customer.display_name:'';\n case 3: return d.total_amount_display;\n case 4: return d.payment_status_text;\n }\n }\n };\n this.edit.rowFn = function(s, i, d) { \n if( s == 'invoice' ) { return 'M.startApp(\\'ciniki.sapos.invoice\\',null,\\'M.ciniki_courses_registrations.showEdit();\\',\\'mc\\',{\\'invoice_id\\':\\'' + d.id + '\\'});'; }\n return ''; \n };\n this.edit.addButton('save', 'Save', 'M.ciniki_courses_registrations.saveRegistration();');\n this.edit.addClose('Cancel');\n\n //\n // The add invoice panel, which display the price list for quantity\n //\n this.newinvoice = new M.panel('Create Invoice',\n 'ciniki_courses_registrations', 'newinvoice',\n 'mc', 'medium', 'sectioned', 'ciniki.courses.registrations.newinvoice');\n this.newinvoice.data = null;\n this.newinvoice.customer_id = 0;\n this.newinvoice.offering_id = 0;\n this.newinvoice.registration_id = 0;\n this.newinvoice.quantity = 1;\n this.newinvoice.sections = {\n 'prices':{'label':'Price List', 'fields':{\n 'price_id':{'label':'Price', 'type':'select', 'options':{}},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Create Invoice', 'fn':'M.ciniki_courses_registrations.createInvoice();'},\n }},\n };\n this.newinvoice.fieldValue = function(s, i, d) { return this.data[i]; }\n this.newinvoice.addClose('Cancel');\n\n //\n // Arguments:\n // aG - The arguments to be parsed into args\n //\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) {\n args = eval(aG);\n }\n\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_courses_registrations', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n\n this.menu.open(cb, args.offering_id);\n }\n\n this.showAdd = function(cb, oid) {\n // Setup the edit panel for when the customer edit returns\n if( cb != null ) { this.edit.cb = cb; }\n if( oid != null ) { this.edit.offering_id = oid; }\n M.startApp('ciniki.customers.edit',null,cb,'mc',{'next':'M.ciniki_courses_registrations.showFromCustomer','customer_id':0});\n };\n\n this.showFromCustomer = function(cid) {\n \n this.showEdit(this.edit.cb, cid, this.edit.offering_id, 0);\n };\n\n this.showEdit = function(cb, cid, oid, rid) {\n this.edit.reset();\n if( cid != null ) { this.edit.customer_id = cid; }\n if( oid != null ) { this.edit.offering_id = oid; }\n if( rid != null ) { this.edit.registration_id = rid; }\n\n // Check if this is editing a existing registration or adding a new one\n if( this.edit.registration_id > 0 ) {\n this.edit.sections._buttons.buttons.delete.visible = 'yes';\n M.api.getJSONCb('ciniki.courses.offeringRegistrationGet', {'tnid':M.curTenantID, \n 'registration_id':this.edit.registration_id, 'customer':'yes', 'invoice':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_courses_registrations.edit;\n p.data = rsp.registration;\n p.offering_id = rsp.registration.offering_id;\n p.customer_id = rsp.registration.customer_id;\n p.sections.invoice.visible=(M.curTenant.modules['ciniki.sapos']!=null)?'yes':'no';\n// p.sections.invoice.addTxt=(rsp.registration.invoice_id==0)?'Invoice Customer':'';\n// p.sections._buttons.buttons.saveandinvoice.visible='no';\n p.sections._buttons.buttons.saveandinvoice.visible=(M.curTenant.modules['ciniki.sapos']!=null&&rsp.registration.invoice_id==0)?'yes':'no';\n p.refresh();\n p.show(cb);\n });\n } else if( this.edit.customer_id > 0 ) {\n this.edit.sections._buttons.buttons.delete.visible = 'no';\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, \n 'customer_id':this.edit.customer_id, 'phones':'yes', 'emails':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_courses_registrations.edit;\n p.data = {'customer_details':rsp.details};\n// p.sections.invoice.addTxt = '';\n p.sections._buttons.buttons.saveandinvoice.visible = (M.curTenant.modules['ciniki.sapos']!=null)?'yes':'no';\n p.refresh();\n p.show(cb);\n });\n }\n };\n\n this.editCustomer = function(cb, cid) {\n M.startApp('ciniki.customers.edit',null,cb,'mc',{'customer_id':cid});\n };\n\n this.updateEditCustomer = function(cid) {\n if( cid != null && this.edit.customer_id != cid ) {\n this.edit.customer_id = cid;\n }\n if( this.edit.customer_id > 0 ) {\n var rsp = M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, \n 'customer_id':this.edit.customer_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_courses_registrations.edit;\n p.data.customer = rsp.details;\n p.refreshSection('customer_details');\n p.show();\n });\n } \n };\n\n this.saveRegistration = function(inv) {\n// var quantity = this.edit.formFieldValue(this.edit.sections.registration.fields.num_seats, 'num_seats');\n var quantity = 1;\n if( this.edit.registration_id > 0 ) {\n var c = this.edit.serializeForm('no');\n if( this.edit.data.customer_id != this.edit.customer_id ) {\n c += 'customer_id=' + this.edit.customer_id + '&';\n }\n if( c != '' ) {\n M.api.postJSONCb('ciniki.courses.offeringRegistrationUpdate', \n {'tnid':M.curTenantID, \n 'registration_id':M.ciniki_courses_registrations.edit.registration_id}, c,\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n var p = M.ciniki_courses_registrations.edit;\n if( inv != null && inv == 'yes' ) {\n M.ciniki_courses_registrations.newInvoice('M.ciniki_courses_registrations.showEdit(null,null,'+p.registration_id+',null);', p.offering_id, p.customer_id, p.registration_id, quantity);\n } else {\n p.close();\n }\n });\n } else {\n if( inv != null && inv == 'yes' ) {\n M.ciniki_courses_registrations.newInvoice('M.ciniki_courses_registrations.showEdit(null,null,'+this.edit.registration_id+',null);', this.edit.offering_id, this.edit.customer_id, this.edit.registration_id, quantity);\n } else {\n this.edit.close();\n }\n }\n } else {\n var c = this.edit.serializeForm('yes');\n M.api.postJSONCb('ciniki.courses.offeringRegistrationAdd', \n {'tnid':M.curTenantID, 'offering_id':this.edit.offering_id,\n 'customer_id':this.edit.customer_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n if( inv != null && inv == 'yes' ) {\n M.ciniki_courses_registrations.newInvoice(M.ciniki_courses_registrations.edit.cb, M.ciniki_courses_registrations.edit.offering_id, M.ciniki_courses_registrations.edit.customer_id, rsp.id, quantity);\n } else {\n M.ciniki_courses_registrations.edit.close();\n }\n });\n }\n };\n\n this.deleteRegistration = function() {\n M.confirm(\"Are you sure you want to remove this registration?\",null,function() {\n var rsp = M.api.getJSONCb('ciniki.courses.offeringRegistrationDelete', \n {'tnid':M.curTenantID, \n 'registration_id':M.ciniki_courses_registrations.edit.registration_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_courses_registrations.edit.close(); \n });\n });\n };\n\n this.newInvoice = function(cb, oid, cid, rid, quantity) {\n if( oid != null ) { this.newinvoice.offering_id = oid; }\n if( cid != null ) { this.newinvoice.customer_id = cid; }\n if( rid != null ) { this.newinvoice.registration_id = rid; }\n if( quantity != null ) { this.newinvoice.quantity = quantity; }\n M.api.getJSONCb('ciniki.courses.offeringPriceList', {'tnid':M.curTenantID,\n 'offering_id':this.newinvoice.offering_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_courses_registrations.newinvoice;\n p.prices = rsp.prices;\n p.data = {'price_id':0};\n // Setup the price list\n p.sections.prices.fields.price_id.options = {};\n for(i in rsp.prices) {\n p.sections.prices.fields.price_id.options[rsp.prices[i].price.id] = rsp.prices[i].price.name + ' ' + rsp.prices[i].price.unit_amount_display;\n if( i == 0 ) {\n p.data.price_id = rsp.prices[i].price.id;\n }\n }\n p.refresh();\n p.show(cb);\n });\n };\n\n this.createInvoice = function() {\n var items = [];\n items[0] = {\n 'status':0,\n 'object':'ciniki.courses.offering_registration',\n 'object_id':this.newinvoice.registration_id,\n 'description':'',\n 'quantity':this.newinvoice.quantity,\n 'unit_amount':0,\n 'unit_discount_amount':0,\n 'unit_discount_percentage':0,\n 'taxtype_id':0,\n 'notes':'',\n };\n var price_id = this.newinvoice.formFieldValue(this.newinvoice.sections.prices.fields.price_id, 'price_id');\n var prices = this.newinvoice.prices;\n // Find the price selected\n for(i in prices) {\n if( prices[i].price.id == price_id ) {\n items[0].price_id = prices[i].price.id;\n items[0].code = '';\n items[0].description = prices[i].price.course_name + (prices[i].price.name!=''?' - '+prices[i].price.name:'');\n items[0].unit_amount = prices[i].price.unit_amount;\n items[0].unit_discount_amount = prices[i].price.unit_discount_amount;\n items[0].unit_discount_percentage = prices[i].price.unit_discount_percentage;\n items[0].taxtype_id = prices[i].price.taxtype_id;\n items[0].flags = 0x20;\n }\n }\n M.startApp('ciniki.sapos.invoice',null,this.newinvoice.cb,'mc',{'customer_id':this.newinvoice.customer_id,'items':items});\n };\n}", "title": "" }, { "docid": "042b0a22165530f0e5f51be0118b1f1c", "score": "0.52144605", "text": "function selectCourseBlock(prifixId, courseName, prifixType, courseId, planId) {\n\tvar $selectedClassDiv = $('<div class=\"selectedCourseDiv\"><div>').appendTo($(\"#slideCourseResult\"));\n\t$selectedClassDiv.data(\"courseId\", courseId+\"_\"+prifixType);\n\tif (planId) {\n\t\t$selectedClassDiv.data(\"planId\", planId);\n\t}\n\tvar $courseNameValue = $('<div class=\"courseNameValue\"></div>').appendTo($selectedClassDiv).text(courseName);//For popup.\n\t$('<span class=\"selectedCourseLeft\"></span>').appendTo($selectedClassDiv);\n\tvar $selectedCourseMid = $('<span class=\"selectedCourseMid\"></span>').appendTo($selectedClassDiv);\n\t$('<span class=\"idSpan\"></span>').appendTo($selectedCourseMid).text(prifixId);\n\tvar $nameSpan = $('<span class=\"nameSpan\"></span>').appendTo($selectedCourseMid);\n\t$nameSpan.text(courseName);\n\tvar $closeSpan = $('<span class=\"closeSpan\"></span>').appendTo($selectedCourseMid);\n\t$('<span class=\"selectedCourseRight\"></span>').appendTo($selectedClassDiv);\n\tvar totalCount = parseInt($(\"#tiemCount\").text()) + 1;\n\t$selectedClassDiv.css( {\n\t\t'top' : totalCount % 2 ? '0px':'24px',\n 'left' : parseInt((totalCount-1) / 2) * 300\n });\n\t$closeSpan.bind(\"click\", function(){\n\t\tremoveSelectedFromPopup($selectedClassDiv);\n\t});\n\tif (totalCount % 2 && totalCount > 6) {\n\t\t$('#courseResultLeft').removeClass('resultLeftDisable').addClass('resultLeft');\n }\n\t//slide to head after add new node.\n\tvar totalRow = (parseInt(totalCount / 2) + totalCount % 2);\n\tvar newMargin = (totalRow - 3) * 300 + parseInt($(\"#slideCourseResult\").css('margin-left'));\n\tif (newMargin > 0 && (totalCount % 2)) {\n\t\t$(\"#slideCourseResult\").animate( {\n 'margin-left' : '-=' + newMargin.toString()\n }, 50, function(){\n \t$('#courseResultRight').removeClass('resultRight').addClass('resultRightDisable');\n });\n\t}\n\t$(\"#tiemCount\").html(totalCount);\n\t//Set toolTip.\n\tif ($courseNameValue.width()>208) {\n\t\t$nameSpan.poshytip({\n\t\t\tallowTipHover : true ,\n\t\t\tclassName: 'tip-green',\n\t\t\tcontent: $courseNameValue.text()\n\t\t});\n\t}\n}", "title": "" }, { "docid": "357618a0d3c6ce5b5cc4c20c7a21f2e6", "score": "0.5213878", "text": "function showDetails(node){\n\tvar treePanel = View.panels.get(\"abRepmAddEditLeaseInABuildingCtryTree\");\n\tvar controller = View. controllers.get(\"abRepmAddEditLeaseInABuilding_ctrl\");\n\tvar lastNodeClicked = treePanel.lastNodeClicked;\n\tvar lsId = null;\n\tif (lastNodeClicked.level.levelIndex == 2) {\n\t\tcontroller.blId = lastNodeClicked.data[\"bl.bl_id\"];\n\t\tcontroller.regnId = lastNodeClicked.data[\"bl.regn_id\"];\n\t\tcontroller.siteId = lastNodeClicked.data[\"bl.site_id\"];\n\t}else if (lastNodeClicked.level.levelIndex == 3) {\n\t\t// maybe parent node was changed\n\t\tcontroller.blId = lastNodeClicked.parent.data[\"bl.bl_id\"];\n\t\tcontroller.regnId = lastNodeClicked.parent.data[\"bl.regn_id\"];\n\t\tcontroller.siteId = lastNodeClicked.parent.data[\"bl.site_id\"];\n\n\t\tlsId = lastNodeClicked.data[\"ls.ls_parent_id\"];\n\t\trefreshPanels(lsId, 3);\n\t} else if (lastNodeClicked.level.levelIndex == 4){\n\t\t// maybe parent node was changed\n\t\tcontroller.blId = lastNodeClicked.parent.parent.data[\"bl.bl_id\"];\n\t\tcontroller.regnId = lastNodeClicked.parent.parent.data[\"bl.regn_id\"];\n\t\tcontroller.siteId = lastNodeClicked.parent.parent.data[\"bl.site_id\"];\n\n\t\tlsId = lastNodeClicked.data[\"ls.ls_id\"];\n\t\trefreshPanels(lsId, 4);\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "67b5699388150b792b0dd3b2d1d63927", "score": "0.52095747", "text": "function createCourse(course) {\n $course = $(\"<option />\").text(course[\"name\"]).attr(\"value\", course[\"_id\"]);\n\n return $course;\n\n }", "title": "" }, { "docid": "3227489414f879e1e44b5010640041f8", "score": "0.52089465", "text": "function Course(name, id) {\n this.name = name\n this.id = id\n}", "title": "" }, { "docid": "bd0a1b6ffb5341227c2d18b031eb6e46", "score": "0.5190727", "text": "function init() {\n $('#id_coursename').change(function() {\n $('#id_activityname').load('getter.php?coursenameid=' + $('#id_coursename').val());\n });\n\t\n\t $('#id_coursename_act').change(function() {\n $('#id_activity_act').load('getter.php?coursid=' + $('#id_coursename_act').val());\n });\n}", "title": "" }, { "docid": "4e6022211f3c745566f530a83575f317", "score": "0.51899946", "text": "function createCourse() {\n let f = document.getElementById('addCourseForm');\n let name = f.elements['name'].value;\n let description = f.elements['description'].value;\n let price = f.elements['price'].value;\n let mPrice = f.elements['mprice'].value;\n let img = 'null';\n let category = f.elements['category'].value;\n let stags = getTags();\n if (checkNewCourseValidity() == true) {\n createCourse2(name, description, price, mPrice, img, category, stags);\n }\n}", "title": "" }, { "docid": "51eb56fd76e770ecb599b04f45b90277", "score": "0.5171835", "text": "function loadData(){\n\n\tconsole.log($('#city').val());\n\tinitMap();\n\n/*\t$.getJSON(\"https://www.udacity.com/public-api/v0/courses\", function(data) {\n\t $.each(data.courses, function(count) {\n\t \t$('#courselist').append('<li>'+ data.courses[count].title +'</li>');\n\t //console.log(data.courses[count].title);\n\t //console.log(data.courses[count].homepage);\n\t });\n\t});\n*/\n\treturn false;\n}", "title": "" }, { "docid": "622b08e378007abbf775527f196b4c22", "score": "0.517042", "text": "function assignCourse(idCourse, idProf, nameCourse, nameProf)\n{\n var divCourse = lookDivCourses(idCourse);\n var button = divCourse.childNodes[5];\n var state = divCourse.childNodes[7];\n var groupAssigned = divCourse.childNodes[5].childNodes[1].childNodes[1].childNodes[3].childNodes[1];\n var numGroup = groupAssigned.value;\n var idGroup = groupAssigned.value;\n\n var groupSelected = null;\n\n /* Remove the group that I choose.*/\n for(var i=0; i < groupAssigned.length; i++)\n {\n if (groupAssigned[i].value == groupAssigned.value)\n {\n groupSelected = groupAssigned[i]; // Select the group.\n idGroup = groupSelected.value; // id group\n numGroup = groupAssigned[i].text; // number group.\n groupAssigned.removeChild(groupAssigned[i]); // Delete the group of the html.\n break;\n }\n }\n\n /* If there's no more groups to assign. */\n if (groupAssigned.length <= 1)\n {\n button.style.display = \"none\"; // Hide the button\n divCourse.style.opacity = 0.2; // Make dark.\n state.value = \"0\"; // The state is disabled.\n } \n\n var div = addParagraphCourse(nameProf, numGroup, groupSelected); // Get the div with the values assigned;\n\n var text = divCourse.childNodes[3]; // Get the div of the p values.\n\n // If there are 6 or more groups values able.\n if((groupAssigned.length >= 6))\n {\n var length = text.childNodes.length; // Number of text assigned to a course.\n for(var i = 0; i < length; i++)\n {\n var childText = text.childNodes[i];\n // If the text is a paragraph.\n if (childText.tagName == \"P\")\n {\n text.removeChild(childText); // Remove the paragraph.\n length -= 1;\n }\n }\n }\n\n div.id = idCourse; // Assign the idCourse.\n div.setAttribute(\"data-value\", idProf); // Assign the idProfessor.\n text.appendChild(div); // Add the assigned to the html.\n\n increaseLoadProfessor(idProf); // Assign the course.\n var course = registerCourse(idCourse, idProf, nameCourse, nameProf, idGroup, numGroup); // Register the new course.\n}", "title": "" }, { "docid": "f50c6d0d971cfc132a9f9666448e8929", "score": "0.5162132", "text": "function fetchMyCourses(){\n $.ajax({\n url: webServLink+\"manage-purchased-courses.php\",\n cache:false, data: {LoggedInUserId:sessionStorage.IADETuserId, action: 'fetch'},\n success : function(data, status) { \n if(data.status === 1){\n $('#filterablePurchasedLoggedCPDs').empty();\n $.each(data.info, function(i, item){\n if(item.itemType=='course') fetchCoursesById(item.course);\n if(item.itemType=='category') fetchCoursesByCategory(item.course);\n });\n } \n } \n });\n}", "title": "" }, { "docid": "5eee13cae97576ea63c0035367b107ad", "score": "0.51613593", "text": "function p_set_card_info(ent_model,data_info){\n set_context_info(\"c_data_info\",data_info);\n var meta = ent_model._config.meta;\n for(var key in meta){\n if(p_is_ele_not_null(key)){\n $(\"#\"+key).val(data_info[key]);\n }\n }\n}", "title": "" }, { "docid": "8bc188869aad6186173b7974abef1fd9", "score": "0.5156947", "text": "_handleCreateCourse(params) {\n postRequest(APIRoutes.getCoursesPath(), this._onSuccess, standardError, params=params);\n }", "title": "" }, { "docid": "85f555fdd49b0ce37221dae2d0c129e2", "score": "0.51569366", "text": "function CSList() {\r\n\t\tfor(var i=0;i<CSCourses.length;i++){\r\n\t\t\tcoursesNeeded[i] = CSCourses[i].prefix + \" \" + CSCourses[i].courseNumber;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e22fdfa71b606d646f9a6094d23e824b", "score": "0.5156251", "text": "function getUserInfo()\n {\n var url = window.location.href;\n var split = url.split(\"/\");\n courseId = split[4].split(\":\")[1];\n weekId = split[6];\n\n if (courseId.includes(\"type\")){\n courseId = courseId.split(\"+type\")[0]; \n }\n\n waitForElement();\n }", "title": "" }, { "docid": "205b8f8774ab5f760176005af9c83a67", "score": "0.5147969", "text": "function initDetailInfo(seq){\n\t\n//\tswal(\"상세화면은 순차적으로 오픈할 예정입니다.\", { icon: \"warning\", });\n//\tif(true){\n//\t\treturn;\n//\t}\n\t//$('#detailForm')[0].reset(); \n\tlet codeIdx = seq;\n\t\n\t//// call api module and draw plz ^^;\n\tvar req = {\n \t\tcodeIdx: codeIdx, \n \n\t};\n\t \n\tvar target = 'commonCodeInfo';\n\tvar method = 'select';\n \n fn_callApi(method, target, req, function (response) {\n \t\n \tif(response.code == 200) {\n \t\tvar data = response.data.result[0];\n\t \t\t \n\t \t\tvar code = data.code;\n\t \t\tvar codeValue = data.codeValue;\n\t \t\t \n\t\t\t$(\"#codeIdx\").val(codeIdx);\n\t\t\t$('#code').val(code);\n\t\t\t$(\"#codeValue\").val(codeValue);\n\t \t\tCRUD = 'update';\n \t}\n });//end FindUserInfoList\n}", "title": "" }, { "docid": "8138e8147feb1168ed45b5432f6264fb", "score": "0.51452446", "text": "function populateCitations() {\n\t\tvar out = \"<button class='citationPanel_new textbutton'>New Source</button><br>\";\n\t\tfor(i=0;i<citation.length;i++) {\n\t\t\tif(citation[i] != undefined && citation[i] != \"undefined\") {\n\t\t\t\tc = citation[i];\n\t\t\t\tconsole.warn(c);\n\t\t\t\tout = out + \"<div class='citationPanel_citation' data-id='\"+i+\"' style='background-color:\"+theme.normbg+\"; border: solid 1px \"+theme.coloralt+\";padding-left: 5px;padding-right: 10px;border-color: #aaa;color: \"+theme.normcolor+\";' id='CITATIONPANELEXAMPLE'>\"\n\t\t\t\ttry {\n\t\t\t\t\tout = out + c['Title']+\"<br>&emsp;\";\n\t\t\t\t\tout = out + \"<i>\"+c['AuthorFirst']+\" \"+c['AuthorLast']+\"</i>\";\n if(c['Volume'].length > 0)\n out += \"<br>&emsp;<span style='font-size:10pt'>Vol. \"+c['Volume']+\" \"+c['Edition']+\" ed.</span>\";\n if(c['Url'].length > 0)\n out += \"<br>&emsp;<span class='PanelUrl' data-url='\"+c['Url']+\"' style='font-size:10pt;border-bottom:dashed 1px black;text-decoration:none;cursor:pointer;color:\"+theme.normcolor+\"'><span class='fa fa-link'></span>&nbsp;Vist Site</span></span>\";\n\t\t\t\t} catch(e) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t\tif(c['Title'] != undefined)\n\t\t\t\t\t\tout = out + c['Title'];\n\t\t\t\t\telse\n\t\t\t\t\t\tout = out + \"Untitled\";\n\t\t\t\t}\n\t\t\t\tout = out + \"<hr><br></div>\";\n\t\t\t}\n\t\t}\n\t\tif(citation.length == 0)\n\t\t\tout += \"&emsp;&emsp;<span style='font-size:28pt;font-weight:100;'>:(</span><br><br>You haven't added any citations.\";\n\t\tpostPanelOutput(out);\n\t\t$('.citationPanel_citation, .PanelUrl').on('click', function() {\n if($(this).attr('data-url') != undefined)\n window.open($(this).attr('data-url'), '_blank');\n else\n getCitationI($(this).attr('data-id'));\n\t\t});\n\t\t$('.citationPanel_new').on('click', function() {\n\t\t\tinitiateCitationEditor(\"panelonly\");\n\t\t});\n\t}", "title": "" }, { "docid": "23bc3010e90d30273cd13f4c38f04ebc", "score": "0.51448137", "text": "function gameInfo() {\n\tvar url = curActive + \"Info.action\";\n\t_id.o(\"topId\").style.display = \"block\";\n\trunAccordion(\"5\");\n\t_id.o(\"info5Div\").style.display = \"block\";\n\t_id.i(\"info5Div\", \"<iframe src=\\\"\" + url + \"\\\" id=\\\"tktFrame\\\" style=\\\"width:100%;height:100%\\\" frameborder=\\\"0\\\"></iframe>\");\n\t_id.o(\"info5Div\").style.marginLeft = \"30px\";\n\t_id.o(\"info5Div\").style.marginTop = \"60px\";\n}", "title": "" }, { "docid": "2cab4c9e806886033fcc93479c6592e2", "score": "0.5141326", "text": "function loadInfoToPanel(e) {\n loadlist(e,'#panelContent');\n}", "title": "" }, { "docid": "eaf2f5d18238c7603504b2939672a6ad", "score": "0.51405555", "text": "function getCoursesByID(sqlObj, index) {\n\t\tvar query = \"SELECT s.SkillName as name, es.Experience, e.ExpertID, es.ExpertSkillsID FROM ExpertSkills es \";\n\t\tquery += \"INNER JOIN Experts e ON es.FK_ExpertID = e.ExpertID \";\n\t\tquery += \"INNER JOIN Skills s ON s.SkillID = es.FK_SkillID \";\n\t\tquery += \"WHERE s.FK_CategoryID = 3 AND e.ExpertID = ? \";\n\t\tsqlObj.setQuery(query, index);\n\t\tsqlObj.executeQuery('profile_course', 2);\n\t}", "title": "" }, { "docid": "b5a83f1f5506abd4148e133ae67bc5ac", "score": "0.51373076", "text": "function addCourse(studentId, courseId) {\n\t\n\t// Make the AJAX call to the backend\n\t$.post(\"scripts/add_course.php\",\n\t\t\t{uid: studentId, cid: courseId});\n}", "title": "" }, { "docid": "5db229f2cdfe4abae4e04d1f62d85fc7", "score": "0.51352257", "text": "function showCourses() {\r\n course_container.style.display = \"\";\r\n student_container.style.display = \"none\";\r\n}", "title": "" }, { "docid": "cca0c07e06e8685678842328b7913390", "score": "0.51348764", "text": "function garevna_disciplines () {\r\n\t\t\r\n\t\tvar parent_object = this; // контекст вызова\r\n\t\tvar disciplines_area = undefined;\r\n\t\tvar economics_data = undefined;\r\n\t\tvar economics_area = undefined;\r\n\t\tvar computer_data = undefined;\r\n\t\tvar computer_area = undefined;\r\n\t\tvar commentLine = undefined;\r\n\t\t\r\n\t\tvar selectPanelId = 'garevna_select_papers_panel';\r\n\t\tvar infoPanelId = 'garevna_publicat_info_panel';\r\n\t\t// --------------------------------------------------------------------------------------------- loadData\r\n\t\t(function loadData () {\r\n\t\t\tvar educat_worker = new Worker('/js/json_loader.js');\r\n\t\t\teducat_worker.postMessage('/data_files/disciplines.json');\r\n\t\t\teducat_worker.addEventListener('message', function(e) {\r\n\t\t\t\tif(!e.data) {\r\n\t\t\t\t\talert(\"Извините, файл /data_files/disciplines.json не обнаружен\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tgetData(e.data, this);\r\n\t\t\t\t}\r\n\t\t\t}, false);\r\n\t\t})();\r\n\t\t// =============================================================================================== getData\r\n\t\tfunction getData ($data, context) {\r\n\t\t\teconomics_data = $data.economics;\r\n\t\t\tcomputer_data = $data.computer;\r\n\t\t\tdisciplines_area = document.createElement('div');\r\n\t\t\tdisciplines_area.id = \"garevna_disciplines\";\r\n\t\t\tdisciplines_area.className = \"flex-div\";\r\n\t\t\tparent_object.appendChild(disciplines_area);\r\n\t\t\t\r\n\t\t\teconomics_area = document.createElement('div');\r\n\t\t\t//economics_area.style.border = \"inset 1px white\";\r\n\t\t\tdisciplines_area.appendChild(economics_area);\r\n\t\t\tbuildButtonsArea (economics_data, economics_area);\r\n\t\t\t\r\n\t\t\tcomputer_area = document.createElement('div');\r\n\t\t\t//computer_area.style.border = \"inset 1px white\";\r\n\t\t\tdisciplines_area.appendChild(computer_area);\r\n\t\t\tbuildButtonsArea (computer_data, computer_area);\r\n\t\t\t\r\n\t\t\tcommentLine = garevna_lib.createPanel (\"garevna_disciplines_info\", 'bottom');\r\n\t\t\tparent_object.appendChild(commentLine);\r\n\t\t\tcommentLine.innerHTML = \"Выберите раздел\";\r\n\t\t\t\r\n\t\t\tparent_object.resize_callback = disciplines_resize;\r\n\t\t\tdisciplines_resize ();\r\n\t\t};\r\n\t\t// ========================================================================================== buildButtonsArea\r\n\t\tfunction buildButtonsArea ($data, $obj) {\r\n\t\t\t\r\n\t\t\t$obj.className = 'flex-div';\r\n\t\t\t$obj.backimg = $data.main_image;\r\n\t\t\t//$obj.style.backgroundImage = 'url(' + $obj.backimg + ')';\r\n\t\t\t$obj.style.backgroundRepeat = 'no-repeat';\r\n\t\t\t//$obj.style.backgroundSize = '80px';\r\n\t\t\t$obj.style.boxShadow = 'inset 2px 2px 2px rgba(0,0,0,0.5)';\r\n\t\t\t$obj.style.borderRadius = '5px';\r\n\t\t\t$obj.style.backgroundPosition = 'bottom right';\r\n\t\t\tvar i, btn;\r\n\t\t\tfor (i=0; i<$data.button_images.length; i++) {\r\n\t\t\t\tbtn = document.createElement('input');\r\n\t\t\t\tbtn.type = 'image';\r\n\t\t\t\tbtn.style.boxSizing = 'border-box';\r\n\t\t\t\tbtn.style.position = 'relative';\r\n\t\t\t\tbtn.src = $data.button_images[i];\r\n\t\t\t\tbtn.style.width = window.innerWidth*0.1 + 'px';\r\n\t\t\t\tbtn.style.height = window.innerHeight*0.1 + 'px';\r\n\t\t\t\t//btn.style.opacity = '0';\r\n\t\t\t\tbtn.ref = $data.url[i];\r\n\t\t\t\tbtn.txt = $data.txt[i];\r\n\t\t\t\tbtn.onmouseover = function (event) {\r\n\t\t\t\t\tevent.stopPropagation();\r\n\t\t\t\t\tvar obj = this;\r\n\t\t\t\t\tTweenLite.to(obj, 1, { scale:1.2, boxShadow:\"5px 5px 5px rgba(0,0,0,0.5)\" });\r\n\t\t\t\t\tcommentLine.innerHTML = '<img src=\"' + this.src + '\" style=\"width:55px; height:auto; position:relative; bottom:25px; float:left;\" />&nbsp;<span class=\"magenta\" style=\"color:white\">' + this.txt + '</span>'\r\n\t\t\t\t\t// commentLine.innerHTML = this.txt;\r\n\t\t\t\t}\r\n\t\t\t\tbtn.onmouseout = function (event) {\r\n\t\t\t\t\tcommentLine.innerHTML = '';\r\n\t\t\t\t\tTweenLite.to(this, 1, { scale:1, boxShadow:\"none\" });\r\n\t\t\t\t}\r\n\t\t\t\tbtn.onclick = function (event) {\r\n\t\t\t\t\twindow.open(this.ref, '_blank');\r\n\t\t\t\t}\r\n\t\t\t\t$obj.appendChild(btn);\r\n\t\t\t}\r\n\t\t\t$obj.onmouseover = function (event) {\r\n\t\t\t\t//this.style.backgroundImage = 'none';\r\n\t\t\t\t//var childs = this.childNodes;\r\n\t\t\t\t//TweenLite.to(childs, 1, {opacity:1});\r\n\t\t\t\t//TweenLite.to(childs, 5, { position:'relative', right:'inherit', bottom:'inherit' });\r\n\t\t\t\tcommentLine.innerHTML = '<img src=\"' + $data.main_image + '\" style=\"width:55px; height:auto; position:relative; bottom:25px; float:left;\" />&nbsp;<span class=\"magenta\" style=\"color:white\">' + $data.title + '</span>';\r\n\t\t\t}\r\n\t\t\t$obj.onmouseout = function (event) {\r\n\t\t\t\t\r\n\t\t\t\t//this.style.backgroundImage = 'url(' + this.backimg + ')';\r\n\t\t\t\t//var childs = this.childNodes;\r\n\t\t\t\tcommentLine.innerHTML = '';\r\n\t\t\t\t//TweenLite.to(childs, 1, {opacity:0});\r\n\t\t\t\t//TweenLite.to(childs, 5, { position:'absolute', bottom:'0', right:'0'});\r\n\t\t\t}\r\n\t\t};\r\n\t\t// =========================================================================================== \r\n\t\tfunction disciplines_resize () {\r\n\t\t\tconsole.info('disciplines resize');\r\n\t\t\tvar dim = garevna_lib.getParentObjectSize(parent_object);\r\n\t\t\tvar w = dim.w * 0.9 + 'px';\r\n\t\t\tvar h = dim.h * 0.9 + 'px';\r\n\t\t\t\r\n\t\t\tdisciplines_area.style.width = w;\r\n\t\t\tdisciplines_area.style.height = h;\r\n\t\t\t\r\n\t\t\tvar $dim = garevna_lib.getParentObjectSize(disciplines_area);\r\n\t\t\t$w = $dim.w*0.45;\r\n\t\t\t$h = $dim.h*0.9;\r\n\t\t\t\r\n\t\t\teconomics_area.style.maxWidth = $w + 'px';\r\n\t\t\teconomics_area.style.height = $h + 'px';\r\n\t\t\teconomics_area.style.marginLeft = $dim.w*0.05 + 'px';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tcomputer_area.style.maxWidth = $w + 'px';\r\n\t\t\tcomputer_area.style.height = $h + 'px';\r\n\t\t\tcomputer_area.style.marginLeft = $dim.w*0.05 + 'px';\r\n\t\t\t\r\n\t\t\tvar childs_econ = economics_area.childNodes;\r\n\t\t\tvar childs_comp = computer_area.childNodes;\r\n\t\t\tvar num = Math.max(childs_econ.length, childs_comp.length);\r\n\t\t\tvar x = ($w*$h)/num;\r\n\t\t\t\r\n\t\t\tvar nx = Math.floor($w/x);\r\n\t\t\tvar ny = Math.floor($h/x);\r\n\t\t\tvar s = nx*ny;\r\n\t\t\twhile (s < num) {\r\n\t\t\t\tx -=0.1*x;\r\n\t\t\t\tnx = Math.floor($w/x);\r\n\t\t\t\tny = Math.floor($h/x);\r\n\t\t\t\ts = nx*ny;\r\n\t\t\t}\r\n\t\t\tvar s = x + 'px';\r\n\t\t\tvar i;\r\n\t\t\tfor (i=0; i<childs_econ.length; i++) {\r\n\t\t\t\tchilds_econ[i].style.width = s;\r\n\t\t\t\tchilds_econ[i].style.height = s;\r\n\t\t\t}\r\n\t\t\tfor (i=0; i<childs_comp.length; i++) {\r\n\t\t\t\tchilds_comp[i].style.width = s;\r\n\t\t\t\tchilds_comp[i].style.height = s;\r\n\t\t\t}\r\n\t\t}\r\n}", "title": "" }, { "docid": "22df52b704c2485b710994e7cf5964ac", "score": "0.51306885", "text": "function Course(courseTitle, courseID)\r\n{\r\n this.courseTitle = courseTitle;\r\n this.courseID = courseID;\r\n}", "title": "" } ]
85e327b2462f0467d086481a85e554f2
For IE8 and IE9.
[ { "docid": "b753ca25d2b8da3eb4db8ce28f448821", "score": "0.0", "text": "function handleEventsForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" } ]
[ { "docid": "d3ece7638b9f0a83dea29424f0e9eede", "score": "0.71892583", "text": "function isLowIE9() {\r\n var e = window.navigator.userAgent.toString().toUpperCase();\r\n var flag = false;\r\n if (e.indexOf(\"MSIE\") >= 0) {\r\n\r\n if (e.indexOf(\"MSIE 6.0\") > 0) flag = true;\r\n if (e.indexOf(\"MSIE 7.0\") > 0) flag = true;\r\n if (e.indexOf(\"MSIE 8.0\") > 0) flag = true;\r\n\r\n }\r\n\r\n\r\n return flag;\r\n\r\n }", "title": "" }, { "docid": "e2c8c17e12ba4d94d9e5060cdf70307a", "score": "0.7018611", "text": "function less_IE8() {\n if (/msie [1-8]{1}[^0-9]/.test(navigator.userAgent.toLowerCase())) {\n return true;\n }\n}", "title": "" }, { "docid": "3069c6df370503abec12f9c2103fe32f", "score": "0.6990977", "text": "function isIE9() {\n var userAgent = navigator.userAgent.toLowerCase();\n return userAgent.indexOf(\"trident/5.0\") > 0 || userAgent.indexOf(\"msie 9.0\") > 0;\n }", "title": "" }, { "docid": "3069c6df370503abec12f9c2103fe32f", "score": "0.6990977", "text": "function isIE9() {\n var userAgent = navigator.userAgent.toLowerCase();\n return userAgent.indexOf(\"trident/5.0\") > 0 || userAgent.indexOf(\"msie 9.0\") > 0;\n }", "title": "" }, { "docid": "4a3eb5b80bc8c673ae24d96fcc875fb4", "score": "0.67857254", "text": "function IEcompatibility() {\n\t// Only do anything if this is IE\n\tif(Browser.ie){\n\t\tvar __fix = $$(\"#kbbcode-size-options\", \"#kbbcode-size-options span\", \n\t\t\t\t\t\t\"#kbbcode-colortable\", \"#kbbcode-colortable td\");\n\t\tif (__fix) {\n\t\t\t__fix.setProperty('unselectable', 'on');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "608598a1ac132fa128b43743c58c26b6", "score": "0.6689359", "text": "function isIE8() {\n if (window.attachEvent && !window.addEventListener) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "50695d756ff1d378b08881c1ec9d841b", "score": "0.65084034", "text": "function lpPatch_IE8(){\n\tif (typeof Array.prototype.indexOf !== 'function') {\n\t\tArray.prototype.indexOf = function(obj, start) {\n\t\t for (var i = (start || 0), j = this.length; i < j; i++) {\n\t\t if (this[i] === obj) { return i; }\n\t\t }\n\t\t return -1;\n\t\t} \n\t}\n\t\n\tif(typeof String.prototype.trim !== 'function') {\n\t\tString.prototype.trim = function() {\n\t \treturn this.replace(/^\\s+|\\s+$/g, ''); \n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "9a72a50b568ccb27896da1ffec405d08", "score": "0.64540815", "text": "function isIE() {\n return navigator.userAgent.toLowerCase().indexOf(\"trident\") > 0;\n }", "title": "" }, { "docid": "9a72a50b568ccb27896da1ffec405d08", "score": "0.64540815", "text": "function isIE() {\n return navigator.userAgent.toLowerCase().indexOf(\"trident\") > 0;\n }", "title": "" }, { "docid": "d54ae04ec379ad8ac2c91d1651cb7508", "score": "0.6431494", "text": "function seven_isIE () {\n\t\t\tvar myNav = navigator.userAgent.toLowerCase();\n\t\t\treturn (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n\t\t}", "title": "" }, { "docid": "442714d07a8d493f596e5315ef86807d", "score": "0.6362608", "text": "function fixIESelect() {\n return false;\n }", "title": "" }, { "docid": "2152f0bd4e8e4768ab723459bf2cc0e8", "score": "0.63479495", "text": "function compIE(){\r\n\tvar agent = navigator.userAgent;\r\n\tif(agent.indexOf(\"MSIE 7.0\") > -1 || agent.indexOf(\"MSIE 8.0\") > - 1 || agent.indexOf(\"Trident 4.0\") > -1 || document.documentMode && document.documentMode <= 5)\r\n\t\treturn true;\r\n\treturn false;\r\n}", "title": "" }, { "docid": "fe75098d2a86b13b8b9d1e738e4432aa", "score": "0.62849253", "text": "function isIE9OrLower() {\n\t\tvar userAgent = navigator.userAgent.toLowerCase();\n\t\treturn (userAgent.indexOf('msie') != -1) ? parseInt(userAgent.split('msie')[1]) < 10 : false;\n\t}", "title": "" }, { "docid": "81305d673773188ecebc9288c007e756", "score": "0.6247649", "text": "function preIE10Check() {\n if (window.attachEvent && !window.navigator.msPointerEnabled) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "e4f3983791d2b785b06426f1ccf303fe", "score": "0.6229919", "text": "function isIE() {\r\n return (navigator.userAgent.toLowerCase().indexOf('msie ') != -1) || (!!navigator.userAgent.match(/Trident.*rv[:]*11\\./));\r\n}", "title": "" }, { "docid": "cd3c6a4754643c956ec26ac05d5801ee", "score": "0.6197086", "text": "function ie() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./))\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "75da6e8908aec346c00d1c75ca37ee61", "score": "0.61709774", "text": "function isIE() {\n return (navigator.userAgent.toLowerCase().indexOf('msie ') != -1) || (!!navigator.userAgent.match(/Trident.*rv[:]*11\\./));\n}", "title": "" }, { "docid": "acc3b29b5a7c023cf906ac7ade614043", "score": "0.6158672", "text": "function isIE() {\n return jQuery.browser.msie;\n }", "title": "" }, { "docid": "a18045b8b837ca46776870f53e74c2e8", "score": "0.61451566", "text": "function isLessThanIe9() {\n var b = document.createElement('b');\n b.innerHTML = '<!--[if IE lte 9]><i></i><![endif]-->';\n return b.getElementsByTagName('i').length === 1;\n }", "title": "" }, { "docid": "191ece80589f9000373cafc41eecd62d", "score": "0.61313784", "text": "function autoComplete_func_isIE7() { // Private method\n return navigator.userAgent.indexOf(\"MSIE 7\") > -1 && navigator.userAgent.indexOf(\"Opera\") == -1;\n}", "title": "" }, { "docid": "27ab8612e391d5ed3874ea116d705c7a", "score": "0.6119342", "text": "function is_IE()\n{\n\tif (navigator.userAgent.indexOf(\"MSIE\")>-1) return true;\n\treturn false\n}", "title": "" }, { "docid": "e5668908463061db807cce417a1f9f91", "score": "0.6098509", "text": "function isIE() {\n return (navigator.appName == \"Microsoft Internet Explorer\");\n}", "title": "" }, { "docid": "425a3d4d27d49cc6fcf5e944531b9db4", "score": "0.6088588", "text": "function mg_is_old_IE() {\r\n\t\tif( navigator.appVersion.indexOf(\"MSIE 8.\") != -1 ) {return true;}\r\n\t\telse {return false;}\r\n\t}", "title": "" }, { "docid": "ae6c7dc1d496ddae5ea9a0dde1dff903", "score": "0.6074193", "text": "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "title": "" }, { "docid": "aff1f4253be041fa0ab719f589965c65", "score": "0.6072221", "text": "function msieversion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) { \n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n if (ieVersion === 9) {$('body').addClass('no-js ie' + ieVersion);}\n return ieVersion;\n }\n else { return false; }\n }", "title": "" }, { "docid": "aff1f4253be041fa0ab719f589965c65", "score": "0.6072221", "text": "function msieversion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) { \n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n if (ieVersion === 9) {$('body').addClass('no-js ie' + ieVersion);}\n return ieVersion;\n }\n else { return false; }\n }", "title": "" }, { "docid": "ab007143daef069aacda96c93fbba20e", "score": "0.6055239", "text": "function msieversion() {\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf(\"MSIE \");\r\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\r\n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\r\n if (ieVersion === 9) {\r\n $('body').addClass('no-js ie' + ieVersion);\r\n }\r\n return ieVersion;\r\n } else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "2acecf1fcbfb13b5fb2edf544ab17d0d", "score": "0.6026759", "text": "function fixIE() {\n if (!Array.indexOf) {\n Array.prototype.indexOf = function(arg) {\n var index = -1;\n for (var i = 0; i < this.length; i++){\n var value = this[i];\n if (value == arg) {\n index = i;\n break;\n } \n }\n return index;\n };\n }\n\n if (!window.console) {\n window.console = {};\n window.console.log = window.console.debug = function(message) {\n return;\n var body = document.getElementsByTagName('body')[0];\n var messageDiv = document.createElement('div');\n messageDiv.innerHTML = message;\n body.insertBefore(messageDiv, body.lastChild);\n };\n } \n}", "title": "" }, { "docid": "0ca24198d20c471a5443799216ac57dc", "score": "0.60239065", "text": "function isIE () {\n\tvar myNav = navigator.userAgent.toLowerCase();\n\treturn (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "title": "" }, { "docid": "a880282db4d1f21f0237cfd55d22f4be", "score": "0.60147053", "text": "function uTestBrowserIE()\n{\n return (uBrowserID == uIE);\n}", "title": "" }, { "docid": "ed95ba61ce526f33548e53e8a172e551", "score": "0.59858984", "text": "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1], 10) : false;\n }", "title": "" }, { "docid": "1d7575534d278b1f596de4b06eaa4ab8", "score": "0.59817094", "text": "function isIE() {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n }", "title": "" }, { "docid": "08f9ee99c985a065581026a9518ec1f3", "score": "0.5981705", "text": "function fixIeBug(e){return browser.msie?e.length-e.replace(/\\r*/g,\"\").length:0}", "title": "" }, { "docid": "c4c2b6da09f26341b3dfd075a86296d7", "score": "0.5979868", "text": "function isIE() {\n\t\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t\t}", "title": "" }, { "docid": "8e9cfdc01b94625160804eadc9218893", "score": "0.5975253", "text": "function isIE() {\n\tif (navigator.appName.indexOf(\"Explorer\")>0)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "6480b01985c9cf7e7fa9344cb70e4259", "score": "0.59291714", "text": "function isIE()\n{\n return document.all;\n}", "title": "" }, { "docid": "32ca706bded10af611494703c1a873bb", "score": "0.5916504", "text": "function isIE () {\n var ms_ie = false;\n var ua = window.navigator.userAgent;\n var old_ie = ua.indexOf('MSIE ');\n var new_ie = ua.indexOf('Trident/');\n\n if ((old_ie > -1) || (new_ie > -1)) {\n ms_ie = true;\n }\n\n return ms_ie ;\n}", "title": "" }, { "docid": "d3b7ff18a1e0ed99d3517fa7e4bd13c6", "score": "0.5905284", "text": "function isIE() { //ie?\n if (!!window.ActiveXObject || \"ActiveXObject\" in window)\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "bdc6fe8cdf085b775382f3820d60c196", "score": "0.59011906", "text": "function Re(e){return!0===Ie(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "24f5b019d6814caba71964842f1eb7d8", "score": "0.5879892", "text": "function is_IE() {\n return (window.navigator.userAgent.match(/MSIE|Trident/) !== null);\n}", "title": "" }, { "docid": "7b9197afbe74cf981fb04424e22403b4", "score": "0.5871901", "text": "function msieversion() \n{\n\ttry{\n\t var ua = window.navigator.userAgent;\n\t var msie = ua.indexOf(\"MSIE \");\n\t\n\t if (msie > 0) // Check for Internet Explorer\n\t {\n\t \tvar version = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n\t \tif (version < 9) {\n\t \t\treturn true;\n\t \t}\n\t }\n\t} catch (err) {\n\t\t//ignore any error\n\t}\n return false;\n}", "title": "" }, { "docid": "8e2ebb9e48f664cd9b9d06b23661b3ef", "score": "0.5868145", "text": "function autoComplete_func_isIE() { // Private method\n return autoComplete_func_isIE5() || autoComplete_func_isIE6() || autoComplete_func_isIE7() ;\n}", "title": "" }, { "docid": "72451153a8831740b8c7023e3cb65416", "score": "0.58570963", "text": "function isIE() {\n return Prototype.Browser.IE;\n}", "title": "" }, { "docid": "ac2938f439ce1484417f55e35dec61d7", "score": "0.5840877", "text": "function checkIeVersion() {\n var ie = gees.tools.internetExplorerVersion();\n if (ie == 7 || ie == 8 || ie == 9) {\n gees.dom.get('name_field').value = 'name';\n gees.dom.get('text_field').value = 'description';\n }\n}", "title": "" }, { "docid": "a76be2844489c76580fa110a93a7883b", "score": "0.5822187", "text": "function vpb_IE_detected()\n{\n var ua = window.navigator.userAgent;\n var old_ie = ua.indexOf('MSIE ');\n var new_ie = ua.indexOf('Trident/');\n\n if ((old_ie > -1) || (new_ie > -1)) \n\t{\n return true;\n } else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "ffa5d65564d30f96037853067e810368", "score": "0.58209807", "text": "function detectIE() {\n\tvar isie = false;\n\tvar ua = window.navigator.userAgent;\n\tvar msie = ua.indexOf('MSIE ');\n\tvar trident = ua.indexOf('Trident/');\n\tvar edge = ua.indexOf('Edge/');\n\tif (msie > 0) {\n\t\t// IE 10 or older\n\t\tisie = true;\n\t\tvar ieVer = parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t} else if (trident > 0) {\n\t\t// IE 11\n\t\tisie = true;\n\t\tvar rv = ua.indexOf('rv:');\n\t\tvar ieVer = parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t} else if (edge > 0) {\n\t\t// Edge (IE 12+)\n\t\tisie = true;\n\t\tvar ieVer = parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t}\n\tif (isie == true) {\n\t\t$('html').addClass('ie');\n\t\tif (ieVer == 11) $('html').addClass('ie11');\n\t}\n}", "title": "" }, { "docid": "41f3ebd066dd18bb9fb4b86629e624ba", "score": "0.58156276", "text": "function isIE() {\n\t//Create var for userAgent\n\tuserAg = navigator.userAgent;\n\t//Create var to store return of index of strings\n\tvar is_ie = userAg.indexOf(\"MSIE \") > -1 || userAg.indexOf(\"Trident/\") > -1 || userAg.indexOf(\"Edge\") > -1;\n\t//return result\n\treturn is_ie;\n}", "title": "" }, { "docid": "ea31f2f7508f1454f33ec6f9038960b3", "score": "0.5803946", "text": "function autoComplete_func_isIE55() { // Private method\n return navigator.userAgent.indexOf(\"MSIE 5.5\") > -1;\n}", "title": "" }, { "docid": "7fa37e6c49b003b2291050f30ee36589", "score": "0.5785291", "text": "IE ():boolean {\n\n\t\treturn this.agent.match(/Trident/i) ? true : false;\n\t}", "title": "" }, { "docid": "046b38c08284db6fa44bb2f4070b00f1", "score": "0.57829297", "text": "_detectBrowserSupport () {\n\t\t\n\t\tvar check = true;\n\n\t\t// nothing below IE9\n\t\tif (!document.addEventListener) check = false;\n\n\t\t// nothing below IE10\n\t\t// if (!window.onpopstate) check = false;\n\n\t\treturn check;\n\t}", "title": "" }, { "docid": "17e7230551b8701cd2de8fb624fa6624", "score": "0.5768446", "text": "function isBrowserIE () {\n var ua = window.navigator.userAgent\n var msie = ua.indexOf('MSIE ')\n var trident = ua.indexOf('Trident/')\n var edge = ua.indexOf('Edge/')\n if (msie > 0 || trident > 0 || edge > 0) {\n return true\n }\n }", "title": "" }, { "docid": "c9abf995680acc9944bb777f65b807ad", "score": "0.57647914", "text": "function isIe678 () {\n\t\tvar IE = eval('\"v\"==\"\\v\"');\n\t\treturn \tIE;\n\t}", "title": "" }, { "docid": "61b79ab88d179f549ac4064f7ba9dab8", "score": "0.574963", "text": "function clickIE4(){\nif (event.button==2){\nreturn false;\n}\n}", "title": "" }, { "docid": "c3920bffaefb5059519471168ba8b0ed", "score": "0.5739531", "text": "function isIE() {\n var nav = navigator.userAgent.toLowerCase();\n\n return (nav.indexOf('msie') != -1) ? parseInt(nav.split('msie')[1]) : false;\n }", "title": "" }, { "docid": "2211943686f3e395bbdbf68cbe3b3e6a", "score": "0.5718534", "text": "function isInternetExplorer() {\n\t if (typeof navigator === 'undefined') {\n\t return false;\n\t }\n\t\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "d8dabbb73e5185e2944459fc1b48a184", "score": "0.57040554", "text": "function ieViewportFix() {\n\n \t\t\tvar msViewportStyle = document.createElement(\"style\");\n\n \t\t\tmsViewportStyle.appendChild(\n \t\t\t\tdocument.createTextNode(\n \t\t\t\t\t\"@-ms-viewport { width: device-width; }\"\n \t\t\t\t)\n \t\t\t);\n \t\t\tif (navigator.userAgent.match(/IEMobile\\/10\\.0/)) {\n\n \t\t\t\tmsViewportStyle.appendChild(\n \t\t\t\t\tdocument.createTextNode(\n \t\t\t\t\t\t\"@-ms-viewport { width: auto !important; }\"\n \t\t\t\t\t)\n \t\t\t\t);\n \t\t\t}\n\n \t\t\tdocument.getElementsByTagName(\"head\")[0].\n \t\t\tappendChild(msViewportStyle);\n \t\t}", "title": "" }, { "docid": "61d832d00823fd4a1cb580ace2045213", "score": "0.56772125", "text": "function iedetect(v) {\n\n\t var r = RegExp('msie' + (!isNaN(v) ? ('\\\\s' + v) : ''), 'i');\n\t\treturn r.test(navigator.userAgent);\n\t\t\t\n\t}", "title": "" }, { "docid": "8b205e0308ebe3bc711b997bbdbbeeff", "score": "0.5676731", "text": "function isInternetExplorer() {\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "8b205e0308ebe3bc711b997bbdbbeeff", "score": "0.5676731", "text": "function isInternetExplorer() {\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "949a5ece132c55dfdc03560f00817aec", "score": "0.56668425", "text": "function autoComplete_func_isIE6() { // Private method\n return navigator.userAgent.indexOf(\"MSIE 6\") > -1 && navigator.userAgent.indexOf(\"Opera\") == -1;\n}", "title": "" }, { "docid": "55b94c3484f5b5f52564984b57919a68", "score": "0.5662509", "text": "function detectIE() {\n if (navigator.userAgent.indexOf(\"MSIE\") >= 0) {\n window.location = \"/static/badbrowser.html\";\n }\n return false;\n}", "title": "" }, { "docid": "38911acb607a0151be127e73ae9d16bc", "score": "0.565696", "text": "function checkVersion() {\n\t\tvar msg = \"You're not using Internet Explorer.\";\n\t\tvar ver = getInternetExplorerVersion();\n\t\tif ( ver > -1 ) {\n\t\t\tif ( ver >= 8.0 ) {\n\t\t\t\tmsg = \"You're using a recent copy of Internet Explorer.\"\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmsg = \"You should upgrade your copy of Internet Explorer.\";\n\t\t\t}\n\t\t}\n\t\tconsole.log( msg );\n\t}", "title": "" }, { "docid": "8d2b15ff4d4b5fb678692cd10374a9d9", "score": "0.56548375", "text": "function isIE(e,i){var t,n=\"IE\",m=document.createElement(\"B\"),o=document.documentElement;return e&&(n+=\" \"+e,i&&(n=i+\" \"+n)),m.innerHTML=\"<!--[if \"+n+']><b id=\"iecctest\"></b><![endif]-->',o.appendChild(m),t=!!document.getElementById(\"iecctest\"),o.removeChild(m),t}", "title": "" }, { "docid": "cc63f0933558c7c04857b6a1e61b21d8", "score": "0.5634285", "text": "function detectIE() {\r\n\tvar ua = window.navigator.userAgent;\r\n\tvar msie = ua.indexOf('MSIE ');\r\n\tif (msie > 0) {\r\n\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n\t}\r\n\tvar trident = ua.indexOf('Trident/');\r\n\tif (trident > 0) {\r\n\t\tvar rv = ua.indexOf('rv:');\r\n\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n\t}\r\n\tvar edge = ua.indexOf('Edge/');\r\n\tif (edge > 0) {\r\n\t\treturn parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "eedc0558e519f3a9790550a43bdd1af5", "score": "0.5634084", "text": "function podPress_is_modern_ie() {\r\n\t\tif ( -1 != navigator.userAgent.search(/Trident\\/([0-9]+\\.[0-9]+)/gi) && true == podPress_is_v1_gtoreq_v2(RegExp.$1, '5') && -1 != navigator.userAgent.search(/MSIE\\s([0-9]+\\.[0-9]+)/gi) && true == podPress_is_v1_gtoreq_v2(RegExp.$1, '9') ) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "984a251de97574316360c652d20efcd9", "score": "0.5628696", "text": "function ie(a){this.ra=a}", "title": "" }, { "docid": "d5ba5e49cac89e4761c898a04d7dfae8", "score": "0.5623509", "text": "function resizingWindowIsIE()\n{\n\tif (navigator.appName == 'Microsoft Internet Explorer') {\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "a73b36aa0fec388c306727161e8eac08", "score": "0.5617889", "text": "function isInternetExplorer() {\n\t if (typeof navigator === 'undefined') {\n\t return false;\n\t }\n\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "a73b36aa0fec388c306727161e8eac08", "score": "0.5617889", "text": "function isInternetExplorer() {\n\t if (typeof navigator === 'undefined') {\n\t return false;\n\t }\n\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "a9c98b7a2aa0554c2eb13cffb7a5ff99", "score": "0.5617283", "text": "function IE(e) {\n if (navigator.appName == \"Microsoft Internet Explorer\" && (event.button == \"2\" || event.button == \"3\")) {\n return false;\n }\n}", "title": "" }, { "docid": "ee4cef9beb9ed16e7ad99cdd04761036", "score": "0.55977213", "text": "function autoComplete_func_isIE5() { // Private method\n return navigator.userAgent.indexOf(\"MSIE 5\") > -1;\n}", "title": "" }, { "docid": "96265df9c6c6898598bb74b6709a0a1c", "score": "0.55915487", "text": "function supportOldIE() {\n var oldIeVersion = document && (function() {\n var version = 3,\n div = document.createElement('div'),\n iElems = div.getElementsByTagName('i');\n\n // Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment\n while (\n div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->',\n iElems[0]\n ) {}\n return version > 4 ? version : undefined;\n }());\n\n if (oldIeVersion < 9) {\n // Support old IE by patching ko.components.register to ensure that we have called\n // document.createElement(componentName) at least once before trying to parse any\n // markup that might use a custom element with that name\n var allCustomComponentNames = [];\n ko.components.register = (function(underlyingRegisterFunc) {\n return function(componentName) {\n allCustomComponentNames.push(componentName);\n underlyingRegisterFunc.apply(this, arguments);\n document.createElement(componentName);\n };\n })(ko.components.register);\n\n // Also to enable custom elements on old IE, we have to call document.createElement(name)\n // on every document fragment that ever gets created. This is especially important\n // if you're also using jQuery, because its parseHTML code works by setting .innerHTML\n // on some element inside a temporary document fragment.\n // It would be nicer if jQuery exposed some API for registering custom element names,\n // but it doesn't.\n document.createDocumentFragment = (function(originalDocumentCreateDocumentFragment) {\n return function() {\n // Note that you *can't* do originalDocumentCreateDocumentFragment.apply(this, arguments)\n // because IE6/7 complain \"object doesn't support this method\". Fortunately the function\n // doesn't take any parameters, and doesn't need a \"this\" value.\n var docFrag = originalDocumentCreateDocumentFragment();\n ko.utils.arrayForEach(allCustomComponentNames, docFrag.createElement.bind(docFrag));\n return docFrag;\n };\n })(document.createDocumentFragment);\n }\n }", "title": "" }, { "docid": "18528522b7576338ac8cc3c7c2ebab51", "score": "0.55852497", "text": "isIE() {\n return Boolean(\n (Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(window, 'ActiveXObject')) ||\n 'ActiveXObject' in window\n )\n }", "title": "" }, { "docid": "6eebce56dfb5fe5f32552bd478a16494", "score": "0.5581351", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null) rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.55803746", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.55803746", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.55803746", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.55803746", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.55803746", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.55803746", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "651eba6a09f0113a62a30ea5127c2a5f", "score": "0.5565348", "text": "function isIE() {\n ua = navigator.userAgent;\n /* MSIE used to detect old browsers and Trident used to newer ones*/\n var is_ie = ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n\n return is_ie;\n}", "title": "" }, { "docid": "2add3bba6885e37d0566bf2921e8079f", "score": "0.5554187", "text": "function ie(e,r){var n=o(e),a=void 0===w[0]\nr=void 0===r||!!r,t.animate&&!a&&i(_,t.cssClasses.tap,t.animationDuration),E.forEach((function(e){re(e,function(e,r){return null===e||!1===e||void 0===e?w[r]:(\"number\"==typeof e&&(e=String(e)),e=t.format.from(e),!1===(e=D.toStepping(e))||isNaN(e)?w[r]:e)}(n[e],e),!0,!1)})),E.forEach((function(e){re(e,w[e],!0,!0)})),te(),E.forEach((function(e){$(\"update\",e),null!==n[e]&&r&&$(\"set\",e)}))}", "title": "" }, { "docid": "55d5bce26c1f8a2cfe3f7522fad58667", "score": "0.55450875", "text": "function ie03Clr(){ \r\n\tz_ie03_nav_details_flag = false;\r\n}", "title": "" }, { "docid": "5851ecbd4150ce06cca597adf5ae012f", "score": "0.55369455", "text": "function clickEventIE() {\r\n\tif (document.all) {\t\t\r\n\t\treturn false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "ae04f7c7fdcf8a83d3cebf3e82a69061", "score": "0.55341214", "text": "function isIE() {\n let ua = navigator.userAgent;\n /* MSIE used to detect old browsers and Trident used to newer ones*/\n return ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n}", "title": "" }, { "docid": "ee6d3913e9735540272a2ab053617422", "score": "0.5533861", "text": "function isIE( version, comparison ){\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n\t\t var ieTest = $div.find('a').length;\n\t\t $div.remove();\n\t\t return ieTest;\n\t\t}", "title": "" }, { "docid": "ee6d3913e9735540272a2ab053617422", "score": "0.5533861", "text": "function isIE( version, comparison ){\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n\t\t var ieTest = $div.find('a').length;\n\t\t $div.remove();\n\t\t return ieTest;\n\t\t}", "title": "" }, { "docid": "ee6d3913e9735540272a2ab053617422", "score": "0.5533861", "text": "function isIE( version, comparison ){\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n\t\t var ieTest = $div.find('a').length;\n\t\t $div.remove();\n\t\t return ieTest;\n\t\t}", "title": "" }, { "docid": "ee6d3913e9735540272a2ab053617422", "score": "0.5533861", "text": "function isIE( version, comparison ){\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n\t\t var ieTest = $div.find('a').length;\n\t\t $div.remove();\n\t\t return ieTest;\n\t\t}", "title": "" }, { "docid": "54c8909cc23e9c652582119487006690", "score": "0.5531279", "text": "function _overflowFixAdd() { ($.browser.msie) ? $(\"body, html\").css({ overflowX: 'visible' }) : $(\"body\").css({ overflowX: 'visible' }); }", "title": "" }, { "docid": "a27a261f63ba68bbdb845b4910768cda", "score": "0.55193484", "text": "function needsLayeringShim() {\n return isIE && (isWinXP || isWinVista || isWin7);\n}", "title": "" }, { "docid": "ac1cea8c14c29d6a71593b7a114a3532", "score": "0.55173606", "text": "function manageIconIE(icon) {\r\n\t\t\t\tif($.browser.msie) {\r\n\t\t\t\t\t$('.'+icon).html('');\r\n\t\t\t\t\t$('.'+icon+' > .empty').hide();\r\n\t\t\t\t}\r\n\t\t\t}", "title": "" }, { "docid": "64f0928a381df4828329148a76d9a656", "score": "0.5511919", "text": "function ieimgposition(nextsh,opt) {\n\n\t\t\tif (isIE(8)) {\n\n\t\t\t\t\tvar ie8img = nextsh.find('.ieeightfallbackimage');\n\n\t\t\t\t\tvar ie8w = ie8img.width(),\n\t\t\t\t\t\tie8h = ie8img.height();\n\n\n\n\t\t\t\t\tif (opt.startwidth/opt.startheight <nextsh.data('owidth')/nextsh.data('oheight'))\n\t\t\t\t\t\tie8img.css({width:\"auto\",height:\"100%\"})\n\t\t\t\t\telse\n\t\t\t\t\t\tie8img.css({width:\"100%\",height:\"auto\"})\n\n\n\t\t\t\t\tsetTimeout(function() {\n\n\n\t\t\t\t\t\tvar ie8w = ie8img.width(),\n\t\t\t\t\t\t ie8h = ie8img.height();\n\n\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"center center\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"center top\" || nextsh.data('bgposition')==\"top center\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"center bottom\" || nextsh.data('bgposition')==\"bottom center\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"right top\" || nextsh.data('bgposition')==\"top right\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:\"0px\", right:\"0px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"right bottom\" || nextsh.data('bgposition')==\"bottom right\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", right:\"0px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"right center\" || nextsh.data('bgposition')==\"center right\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", right:\"0px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"left bottom\" || nextsh.data('bgposition')==\"bottom left\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", left:\"0px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"left center\" || nextsh.data('bgposition')==\"center left\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:\"0px\"});\n\t\t\t\t\t},20);\n\t\t\t\t}\n\t\t}", "title": "" }, { "docid": "64f0928a381df4828329148a76d9a656", "score": "0.5511919", "text": "function ieimgposition(nextsh,opt) {\n\n\t\t\tif (isIE(8)) {\n\n\t\t\t\t\tvar ie8img = nextsh.find('.ieeightfallbackimage');\n\n\t\t\t\t\tvar ie8w = ie8img.width(),\n\t\t\t\t\t\tie8h = ie8img.height();\n\n\n\n\t\t\t\t\tif (opt.startwidth/opt.startheight <nextsh.data('owidth')/nextsh.data('oheight'))\n\t\t\t\t\t\tie8img.css({width:\"auto\",height:\"100%\"})\n\t\t\t\t\telse\n\t\t\t\t\t\tie8img.css({width:\"100%\",height:\"auto\"})\n\n\n\t\t\t\t\tsetTimeout(function() {\n\n\n\t\t\t\t\t\tvar ie8w = ie8img.width(),\n\t\t\t\t\t\t ie8h = ie8img.height();\n\n\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"center center\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"center top\" || nextsh.data('bgposition')==\"top center\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"center bottom\" || nextsh.data('bgposition')==\"bottom center\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"right top\" || nextsh.data('bgposition')==\"top right\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:\"0px\", right:\"0px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"right bottom\" || nextsh.data('bgposition')==\"bottom right\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", right:\"0px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"right center\" || nextsh.data('bgposition')==\"center right\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", right:\"0px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"left bottom\" || nextsh.data('bgposition')==\"bottom left\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", left:\"0px\"});\n\n\t\t\t\t\t\tif (nextsh.data('bgposition')==\"left center\" || nextsh.data('bgposition')==\"center left\")\n\t\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:\"0px\"});\n\t\t\t\t\t},20);\n\t\t\t\t}\n\t\t}", "title": "" } ]
b26f5abe8c86e4ad4a704d404ce4fd16
Always generate prev for scrollable hint
[ { "docid": "327c0e8036d3232c66fa2009986033cb", "score": "0.65242565", "text": "genPrev() {\n const slot = this.$scopedSlots.prev ? this.$scopedSlots.prev({}) : this.$slots.prev || this.__cachedPrev;\n return this.$createElement('div', {\n staticClass: 'v-slide-group__prev',\n class: {\n 'v-slide-group__prev--disabled': !this.hasPrev\n },\n on: {\n click: () => this.onAffixClick('prev')\n },\n key: 'prev'\n }, [slot]);\n }", "title": "" } ]
[ { "docid": "be809c2f88bf9a7ede3a2ae50867a20f", "score": "0.70038176", "text": "function prevScroll() {\n jQuery17(\"#next\").show();\n var first = jQuery17(\"#article-slider li\").first();\n if (first.attr('data-carousel-index') === \"0\") {\n jQuery17(\"#prev\").hide();\n }\n }", "title": "" }, { "docid": "92ccab2faec00d252ad647582bedbced", "score": "0.6985987", "text": "scrollPrev() {\n if (this.currentX === 0) {\n this.currentY -= 1\n this.currentX = 2\n } else {\n this.currentX -= 1\n }\n this.viewTile()\n }", "title": "" }, { "docid": "b944e5bf8345f69cd668a43507d4d63a", "score": "0.68715936", "text": "prev() {\n }", "title": "" }, { "docid": "d992c4a698821d8aeea264a8c8cbefaf", "score": "0.6603198", "text": "function fnPrev(ev) {\n var event = ev || window.event;\n if (now > 0) {\n now--;\n } else {\n //轮播处于第一个page#1时\n now = orginLen - 1;\n oUL.style.left = -(li_width * orginLen) + 'px';\n }\n scroll();\n }", "title": "" }, { "docid": "de63dc1eed3274fb87eb257048c2e8f5", "score": "0.6602525", "text": "function prevScroll(e) {\n e.preventDefault()\n}", "title": "" }, { "docid": "db5c086d6f8d71fa1c9223f47031074e", "score": "0.65571934", "text": "@action\n prev() {\n this.currentIndex--;\n\n if (this.currentIndex < 0) {\n this.currentIndex = this.loop ? this.itemsCount - 1 : 0;\n }\n\n this._resetPositionIndexes(false);\n this._transform(false);\n }", "title": "" }, { "docid": "f5e2c3bb08d2f93318083eebfcebf963", "score": "0.65315455", "text": "function prev() {\n\t slide(false, false);\n\t }", "title": "" }, { "docid": "59d34b3736bbb56186cffb4f8ee3e922", "score": "0.6513203", "text": "function prevItem() {\n hideItems();\n currentIndex = currentIndex > 0 ? currentIndex - 1 : slidesLength - 1;\n updateIndexes();\n showItems();\n }", "title": "" }, { "docid": "f7eeff8ad859fda18959bfc3acb9a99e", "score": "0.65061253", "text": "prev() {\n if (this.disabled) return;\n const element = this.shadowRoot.querySelector('#container');\n if (this.selected > 0 || this.loop) {\n this._setAnimating(true);\n element.selectPrevious();\n }\n }", "title": "" }, { "docid": "187d5ca9b1175542c63ea649ea360454", "score": "0.64829385", "text": "prev () {\n this.goTo(this.getCurrentIndex() - 1);\n }", "title": "" }, { "docid": "476aeda581215bcdabe36a03c1dcaf66", "score": "0.64670384", "text": "function keyFindPrev() {\n if (gFindBar.regexSearch) {\n if (!gFindBar.lines.length) return;\n gFindBar.regexFindPrevious = true;\n gFindBar._find();\n }\n else {\n gFindBar.onFindAgainCommand(true);\n }\n}", "title": "" }, { "docid": "313beadf7d06ac256f95a2b4f8f7a8ce", "score": "0.64667517", "text": "focusPrev(n) {\n this.focus(n - 1 < 0 ? this.articleButtons.length - 1 : n - 1);\n }", "title": "" }, { "docid": "6aa234fe0939752df8afe7114fe9be68", "score": "0.6456399", "text": "prev() {\n impress().prev();\n }", "title": "" }, { "docid": "aa512c84b7c6190308aa5941916ab64c", "score": "0.64449567", "text": "function prev() {\n\t\n\timagebox.jumpto(\n\t\t\n\t\t// wrap to end\n\t\t_options.continuousGalleries && current === 0? gallery.length-1:\n\t\t// previous image\n\t\tcurrent > 0? current-1:\n\t\t// don't jump\n\t\tnull\n\t);\n}", "title": "" }, { "docid": "3fac6b164f5fd05aae23dd2c0b16b751", "score": "0.6442766", "text": "function prevScrollKeys(e) {\n if (keys[e.keyCode]) {\n prevScroll(e)\n return false\n }\n}", "title": "" }, { "docid": "9c58ab7c0147c65c6cc0f6fef5789a3e", "score": "0.6412068", "text": "function pagerPrev() {\n\tshowPage(curPage - 1);\n}", "title": "" }, { "docid": "f9539b275304e75cb588b4b5226a79da", "score": "0.64105606", "text": "scrollToPrevious() {\n const scrollPosition = this.scrollContainer.scrollLeft;\n const current = this.scrollStops.findIndex((stop, index) => stop >= scrollPosition && (this.isRtl || index === this.scrollStops.length - 1 || this.scrollStops[index + 1] > scrollPosition));\n const right = Math.abs(this.scrollStops[current + 1]);\n let nextIndex = this.scrollStops.findIndex(stop => Math.abs(stop) + this.width > right);\n\n if (nextIndex >= current || nextIndex === -1) {\n nextIndex = current > 0 ? current - 1 : 0;\n }\n\n this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition);\n }", "title": "" }, { "docid": "33df8c12eb5a4c748fd237c71a8d447a", "score": "0.6397699", "text": "function prev() {\n\n // Jika halaman bukan yang paling awal\n if (indexHalaman != 0) {\n\n // Kurangi 1 index halaman\n indexHalaman--;\n\n // Jika koreksi bernilai true\n if (koreksi) {\n\n // Jalankan fungsi addSoal dan ubahIndex dengan memberikan argumen nilai true\n addSoal(true);\n ubahIndex(true);\n\n // Jika koreksi bernilai false\n } else {\n\n // Jalankan fungsi addSoal, ubahIndex, dan pilihanKlik tanpa memberikan argumen\n addSoal();\n\n ubahIndex();\n pilihanKlik();\n }\n }\n }", "title": "" }, { "docid": "70cee4843a98fa5b1404cc17d1338d2c", "score": "0.63898695", "text": "prev() {\n if(this.page > 1) {\n this.page --;\n }\n }", "title": "" }, { "docid": "c5448edec4f18350268191c8eed867bb", "score": "0.63834685", "text": "function prev() {\n\t\t slide(false, false);\n\t\t }", "title": "" }, { "docid": "3d6e982a6df6dd75704392accc6f517e", "score": "0.6353503", "text": "handlePrevious(event) {\n event.preventDefault();\n if (this.state.relativeHoldoingWord > 0){\n //one before last word - could press next now\n if (this.state.relativeHoldoingWord === this.state.wordsLength){\n this.setState({nextDisabled: false});\n }\n //#1 word - could not press previous anymore\n if (this.state.relativeHoldoingWord === 2){\n this.setState({previousDisabled: true});\n }\n var previous = this.state.relativeHoldoingWord -1;\n this.setState({relativeHoldoingWord: previous});\n }\n }", "title": "" }, { "docid": "cb307f80d3c9170f47342b18976fd8de", "score": "0.63369995", "text": "function prev() {\n return selectOption(currInd-1);\n }", "title": "" }, { "docid": "fab406f81d0f4ff4a5543c49cd089339", "score": "0.6330272", "text": "showPreviousKanji(e) {\n let evt = new Event(\"back-next\");\n // if moving back from last kanji in array, change styling of next button\n if (this.index === this.kanjiArray.length - 1) {\n evt.next = true;\n document.dispatchEvent(evt);\n }\n // if you are going back to first kanji in array, change styling of back btn\n if (this.index === 1) {\n evt.back = true;\n document.dispatchEvent(evt);\n }\n // if currently not viewing the first kanji in array, subtract index and go back one\n if (this.index > 0) {\n this.index--;\n \n this.getKanji(\"\");\n }\n }", "title": "" }, { "docid": "4bca1caf1317fa1058c2d87a424d121c", "score": "0.63196445", "text": "function prev() {\n if (iWant.selectedVerb == 'read') {\n if (iWant.index >= 6) {\n iWant.index -= 6;\n }\n else {\n iWant.index = 12;\n }\n }\n else {\n if (iWant.index > 0) {\n iWant.index -= 2;\n }\n }\n next();\n}", "title": "" }, { "docid": "ecb15766bddd658bf3c7575611b8b679", "score": "0.6270317", "text": "function _previousStep() {\n if (this._currentStep === 0) {\n return false;\n }\n this._lastStep = this._currentStep;\n var nextStep = this._introItems[--this._currentStep];\n if ( typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n \n window.targetElement = nextStep;\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "4067719c1214e6c7ee42333719b50f1e", "score": "0.62569386", "text": "function prevSlide() {\n position = $slider.find(\".show\").index() - 1;\n if (position < 0) position = size - 1;\n changeCarousel(position);\n }", "title": "" }, { "docid": "4067719c1214e6c7ee42333719b50f1e", "score": "0.62569386", "text": "function prevSlide() {\n position = $slider.find(\".show\").index() - 1;\n if (position < 0) position = size - 1;\n changeCarousel(position);\n }", "title": "" }, { "docid": "4067719c1214e6c7ee42333719b50f1e", "score": "0.62569386", "text": "function prevSlide() {\n position = $slider.find(\".show\").index() - 1;\n if (position < 0) position = size - 1;\n changeCarousel(position);\n }", "title": "" }, { "docid": "9643e9a4477ed7fd9312b8ccef88a78a", "score": "0.62460136", "text": "function handlePrev() {\n let scrollX = sliderScrollX + Math.round(window.innerWidth / 2)\n\n if (scrollX > 0) {\n scrollX = 0\n }\n\n setSliderScrollX(scrollX)\n }", "title": "" }, { "docid": "3e29df7a420776b7276ede1e19b37785", "score": "0.6230101", "text": "loadPrev() {\n if (this.prevResults === true) {\n this.page--;\n this.refresh();\n }\n }", "title": "" }, { "docid": "0b8d4fa4095d7e521c2ccb1e315ae979", "score": "0.6214777", "text": "onPrev() {\n this.slider.slickPrev();\n }", "title": "" }, { "docid": "6ad430e2cdecbebad9bfdd7e60c2a570", "score": "0.62131554", "text": "prev() {\n return this.move(-1);\n }", "title": "" }, { "docid": "898dce2ae3ae5b8c33ec7121995f8111", "score": "0.621255", "text": "function handleListPrev() {\n $('.js-prev-button').click(event => {\n if(startIndex - maxResults >= 0) {\n startIndex -= maxResults; \n }\n\n else {\n startIndex = 0;\n }\n\n const userSearchTitle = $('.initial-search-title').val();\n const params = {\n q: userSearchTitle,\n printType: 'books',\n key: googleKey,\n 'maxResults': maxResults,\n 'startIndex': startIndex\n };\n\n getBooksList(params);\n });\n}", "title": "" }, { "docid": "530ab7b25ffd3166d1599749ca8a1398", "score": "0.61961037", "text": "Prev()\n {\n if(!IsEmpty()) {\n if(curr.getLink() == head.getLink()) {\n\n } else {\n pos = GetPos();\n SetPos(pos-1);\n }\n }\n }", "title": "" }, { "docid": "a75abdf2c67b277f67aa844fad30837f", "score": "0.6176598", "text": "function prev(){\n\tnewSlide = sliderInt -1;\n\tshowSlide(newSlide);\n}", "title": "" }, { "docid": "cd47d376f35da3961efa96fd8959ab53", "score": "0.6129311", "text": "prevItems () {\n let newFirstItemIndex = this.currentItemIndex - this.itemsToShow;\n if (newFirstItemIndex < 0 ) {\n newFirstItemIndex = 0\n }\n this.currentItemIndex = newFirstItemIndex;\n }", "title": "" }, { "docid": "d0fed54ba880d866d268f4d33d1bca8a", "score": "0.6114819", "text": "function prev() {\n\t\t\tvm.load = true;\n\t\t\tif (vm.currentPage > 1) {\n\t\t\t\tvm.currentPage--;\n\t\t\t\tpaginate();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ac0da935f87ac4835cc37f00a442c891", "score": "0.6114397", "text": "function prevSlide() {\n const opts = $slideshow.data(\"cycle.API\").getSlideOpts();\n const currSlide = opts.currSlide;\n if (currSlide > 0) {\n $slideshows.cycle(\"goto\", currSlide - 1);\n }\n setDisabledState();\n }", "title": "" }, { "docid": "56d249a3b0c6a3f01f2554332d97b71f", "score": "0.610933", "text": "function vchat_scroll_popup_photo_prev()\n{\n\tvar unique_photo_id = $(\"#current_vchat_status_id\").val();\n\tvar total = $(\"#total_vchat_photos_to_scroll\").val();\n\tvar current = $(\"#current_vchat_scrolled_photo\").val();\n\t\n\tif( parseInt(current) > 1 )\n\t{\n\t\tvar current_now = parseInt(current) == 1 ? 1 : parseInt(current)-1;\n\t\t\n\t\tvar photo_link = $(\"#hidden_photo_link_\"+parseInt(unique_photo_id)+\"_\"+parseInt(current_now)).val();\n\t\t$(\".vholder\").html('<img src=\"'+photo_link+'\">');\n\t\t\n\t\t$(\"#current_vchat_scrolled_photo\").val(parseInt(current_now));\n\t\t$(\"#vchat_curnt\").html(parseInt(current_now));\n\t\t\n\t\tvar current = $(\"#current_vchat_scrolled_photo\").val();\n\t\t\n\t\tif(parseInt(current) < parseInt(total))\n\t\t{\n\t\t\t$(\"#vchat_right_a\").hide();\n\t\t\t$(\"#vchat_right_b\").show();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"#vchat_right_b\").hide();\n\t\t\t$(\"#vchat_right_a\").show();\n\t\t}\n\t}\n\telse \n\t{\n\t\t$(\"#vchat_left_b\").hide();\n\t\t$(\"#vchat_left_a\").show();\n\t}\n\t\n\tvar current = $(\"#current_vchat_scrolled_photo\").val();\n\t\n\tif(parseInt(current) == 1)\n\t{\n\t\t$(\"#vchat_left_b\").hide();\n\t\t$(\"#vchat_left_a\").show();\n\t}\n\telse if(parseInt(current) > 1)\n\t{\n\t\t$(\"#vchat_left_a\").hide();\n\t\t$(\"#vchat_left_b\").show();\n\t}\n\telse {}\n}", "title": "" }, { "docid": "b74c3b7994c5ff95b8eac5834b0a155f", "score": "0.6103847", "text": "prev() {\n if (this.options.waitForAnimationEnd === true && this.slideAnimation.hasEnded() === false) {\n return;\n }\n this.slider.prev();\n }", "title": "" }, { "docid": "875dcdfcb145c131544980d3894686b2", "score": "0.6091275", "text": "function prev(id2) {\n $(\"#loadr\").show();\n $(\"#index\")\n .removeAttr(\"style\")\n .hide();\n traerTabla(id2, 1);\n a--;\n}", "title": "" }, { "docid": "adb401ac997831d6e7cc0528e25ad455", "score": "0.6082196", "text": "clickPreviousButtonListener(){\n this.removeResultCallback();\n if (this.algorithm.previous() == undefined) this.algorithm.start();\n this.rerenderCallback();\n this.removeInfoPaneCallback();\n }", "title": "" }, { "docid": "6ba176d96bb70c8ea778ae1be69bfea0", "score": "0.6079147", "text": "previous_page() {\n if (this.index - this.items_per_page >= 0) {\n this.index = this.index - this.items_per_page;\n this.update();\n } else {\n this.index = 0;\n this.update();\n }\n }", "title": "" }, { "docid": "2bb14de546833e9d1ad54931ab49e452", "score": "0.6076203", "text": "previousHandler() {\n this.showSpinner=true;\n if (this.page > 1) {\n this.page = this.page - 1; //decrease page by 1\n this.displayRecordPerPage(this.page);\n }\n this.showSpinner=false;\n }", "title": "" }, { "docid": "739732940e07e6eb12875d1babe92fe5", "score": "0.60690945", "text": "function onPrevButtonClick(objButton) {\n\n\t\tif (g_functions.isButtonDisabled(objButton))\n\t\t\treturn (true);\n\n\t\tif (g_options.strippanel_buttons_role == \"advance_item\")\n\t\t\tg_gallery.prevItem();\n\t\telse\n\t\t\tg_objStrip.scrollBack();\n\t}", "title": "" }, { "docid": "08910e6adcf44733fba38ed7d00da6dc", "score": "0.60685444", "text": "function previousPage () {\n var i, tab;\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth >= ctrl.offsetLeft) break;\n }\n ctrl.offsetLeft = fixOffset(tab.offsetLeft + tab.offsetWidth - elements.canvas.clientWidth);\n }", "title": "" }, { "docid": "fddd2b0a87eb90fecb5f2a3ba40158ef", "score": "0.60604703", "text": "function prevResume() {\n const resumeData = iterator.prev();\n checkDisabledButton(data, resumeData);\n\n if (resumeData.value) {\n const resume = resumeData.value;\n fillPage(resume);\n }\n }", "title": "" }, { "docid": "3ca78da94aa1a4016ab926d3aac75607", "score": "0.6055108", "text": "function goPreviousScrollPosition () {\n var offset = 0\n var delay = 0\n if (asideRight.comments.css('display') === 'block') {\n asideRight.comments.animate({\n scrollTop: asideRight.scroll.comments - offset\n }, delay)\n } else {\n asideRight.reviews.animate({\n scrollTop: asideRight.scroll.reviews - offset\n }, delay)\n }\n }", "title": "" }, { "docid": "9bef014bc9189d707d2af43102f53f28", "score": "0.60539573", "text": "function findPrevInput() {\n\t\t\t\tscope.done = false;\n\t\t\t\tif(scope.indexStack.length > 0) {\n\t\t\t\t\tconsole.log('moving back index');\n\t\t\t\t\tscope.spans[scope.index].classList.remove(\"char-selected\");\n\t\t\t\t\tvar ind = scope.indexStack.shift();\n\t\t\t\t\tscope.spans[ind].innerHTML = \".\";\n\t\t\t\t\tscope.index = ind;\n\t\t\t\t\tscope.spans[scope.index].className += \" char-selected\";\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(\"beginning reached!\");\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "c9eb469425b6e62ba1841d15899ca537", "score": "0.6053406", "text": "function prevcard()\n {\n \n if(prev_card>0)\n {\n next_card=prev_card;\n prev_card-=num_cards;\n //getting the amount of the distance to move the slider\n let dis=cards[prev_card].style.left;\n slider.style.transform=\"translateX(-\"+dis+\")\";\n if(prev_card==0)\n {\n \t//if no prev card is hide the prev button\n \t prev_button.style.display=\"none\";\n }\n next_button.style.display=\"inline\";\n }\n }", "title": "" }, { "docid": "c69a4db3ab164f431595e56cfeb4c48c", "score": "0.6050768", "text": "function previousBtnFunction(prev, next) {\n prev.addEventListener('click', function () {\n counter--;\n if (counter > 0) {\n prev.classList.remove(\"d-none\");\n } else {\n prev.classList.add(\"d-none\");\n }\n if (counter > parseInfoFromApi.length - 1) {\n next.classList.add(\"d-none\");\n } else {\n next.classList.remove(\"d-none\");\n }\n\n apiContent[i].innerHTML = apiPathAdresses[i].insertHtmlData(parseInfoFromApi);\n });\n }", "title": "" }, { "docid": "2cec747132bfc563ff5982e5f90f533b", "score": "0.60418177", "text": "get previous() { return this._previous; }", "title": "" }, { "docid": "bd6200ea818329e2b2c9a09dce8531e6", "score": "0.6024968", "text": "prev() {\n if (!this.canBeReduced()) { return }\n this.enableBothBtn()\n this.reduceRange()\n this.setTrackReviewList()\n if (this.canBeReduced()) { return }\n this.disableBtn(prev)\n }", "title": "" }, { "docid": "51fad9cbe834737e38c7b72128a75ed1", "score": "0.6004731", "text": "async prevResultsPage() {\n this.searchOffset -= 10;\n if (this.searchOffset < 0) {\n this.searchOffset = 0;\n }\n this.searchResults = await this.search();\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "932bbb453ac099de703303aeaf947e56", "score": "0.59856474", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n --this._currentStep;\n\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n var continueStep = this._introBeforeChangeCallback.call(this);\n }\n\n // if `onbeforechange` returned `false`, stop displaying the element\n if (continueStep === false) {\n ++this._currentStep;\n return false;\n }\n\n var nextStep = this._introItems[this._currentStep];\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "932bbb453ac099de703303aeaf947e56", "score": "0.59856474", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n --this._currentStep;\n\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n var continueStep = this._introBeforeChangeCallback.call(this);\n }\n\n // if `onbeforechange` returned `false`, stop displaying the element\n if (continueStep === false) {\n ++this._currentStep;\n return false;\n }\n\n var nextStep = this._introItems[this._currentStep];\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "4144efb4cd3ebadbf5c4d6b4f493d94e", "score": "0.59849846", "text": "function liuyePrevious() \n{\n if(lyliuyes.length<1) return;\n\t if(theLiuyeId==0) {\n\t\t //alert(\"跳到最后一条\");\n\t\t theLiuyeId=lyliuyes.length-1;\n\t}\n\t else{\n\t\t theLiuyeId--;\n\t }\n\t showLiuYe();\n}", "title": "" }, { "docid": "02f77ab78c81a7b491095ba55e070f9a", "score": "0.5984647", "text": "handlePrevSlide(){\n if(this.index <= 0) return this.handleChangeAcive(0)\n this.index -= 1;\n this.handleChangeAcive(this.index)\n }", "title": "" }, { "docid": "5551943f4a007ab9e50184e6c4ecba8a", "score": "0.5983351", "text": "prev()\n {\n $('._menu--prev', this.container).click((e) =>\n {\n this.slide.dirPrev();\n return false;\n });\n }", "title": "" }, { "docid": "01dd98bd7edd718af07089cf6cc8e48b", "score": "0.5981436", "text": "function scrollPreviousUser() {\n showModal(employees, employees[index - 1], index - 1)\n }", "title": "" }, { "docid": "4cdd77161d78268cd13d930f9b2b926b", "score": "0.59767777", "text": "function onPrevious() {\r\n var currentPage = cswPrivate.currentPage;\r\n var previousPage = cswPrivate.currentPage - 1;\r\n\r\n //if we're not already on the first page\r\n if (currentPage != 1) {\r\n //set the page, then re-render the visible options accordingly\r\n cswPrivate.currentPage = previousPage;\r\n updateVisibleOptions();\r\n //update the page text at the bottom of the page\r\n cswPrivate.pageInfo(cswPrivate.pageDisplay);\r\n }//if we're not already on the first page\r\n }//onPrevious()", "title": "" }, { "docid": "07bea4193103c699779d891e43ee63e8", "score": "0.5971965", "text": "function createPrevButton(i) {\r\n var stepName = \"step\" + i;\r\n $(\"#\" + stepName + \"commands\").append(\"<a href='#' id='\" + stepName + \"Prev' class='prev'>< Back</a>\");\r\n\r\n $(\"#\" + stepName + \"Prev\").bind(\"click\", function(e) {\r\n delEvents();\r\n $(\"#\" + stepName).hide();\r\n if(islongprev || ($(\"#id\" + i).attr('class') == 'NULL')) {\r\n $(\"#step\" + (i - 1) + \" fieldset div\").removeAttr('class');\r\n $(\"#step\" + (i - 2)).show();\r\n $(submmitButtonName).hide();\r\n selectStep(i - 2);\r\n islongnext = true;\r\n } else {\r\n $(\"#step\" + (i - 1)).show();\r\n $(submmitButtonName).hide();\r\n selectStep(i - 1);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "276f8400b4b9dc0bf83ff4d4898c134a", "score": "0.5969771", "text": "function onPrevPage() {\n if (pageNum <= 1) {\n return;\n }\n pageNum--;\n $('#page_num').text(pageNum);\n display_ocr_image(doc_result_item);\n display_entities();\n\n}", "title": "" }, { "docid": "a9e3a16f0f6a411a89ad5c6e679968d9", "score": "0.5969159", "text": "function _previousItemOnKeyUp() {\n let previousItem = $element.find(`.${CSS_PREFIX}-list-item`).eq(lx.activeItemIndex - 1);\n\n if (previousItem.length === 0) {\n lx.activeItemIndex = $element.find(`.${CSS_PREFIX}-list-item`).length - 1;\n\n previousItem = $element\n .find(`.${CSS_PREFIX}-list-item`)\n .eq(lx.activeItemIndex)\n .focus();\n } else {\n lx.activeItemIndex--;\n }\n\n previousItem.focus();\n }", "title": "" }, { "docid": "a63393eef812fbd92a9f8ab2476ecadb", "score": "0.5964929", "text": "prev() {\n return this.current(--this.index);\n }", "title": "" }, { "docid": "a74bfb4e148c86bb7ca7f37cb0608f60", "score": "0.59593225", "text": "function bindPrevStep() {\n $(config.actions.prev).on('click.steps', function(evt) {\n evt.preventDefault();\n prevStep();\n });\n }", "title": "" }, { "docid": "f222449e8d1bf010f098316c6c1d7079", "score": "0.5946585", "text": "prev() {\n\t\tif (this.test.currentQuestion - 1 < 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis.collectAnswer();\n\t\tthis.test.currentQuestion--;\n\t\tthis.test.showQuestion();\n\t}", "title": "" }, { "docid": "e2e4be208d3ce55a588f805621c6a612", "score": "0.5943909", "text": "function onPrev(e) {\n // Stop bubbling:\n e.preventDefault();\n e.stopPropagation();\n\n // Update nodes:\n if (e.type === 'mouseup' || e.type === 'touchend') {\n wrapper.classList.remove('sl-avoid-user-select');\n } else {\n wrapper.classList.add('sl-avoid-user-select');\n updateState('prev');\n updateImage()\n updateInfo();\n updateThumbails('prev');\n };\n }", "title": "" }, { "docid": "a959a8b4ca74e0943f4e63a691c79bfe", "score": "0.5924929", "text": "function usersPaginationPrev() {\n usersPageNumber -= 1;\n\n usersPagination(usersPageNumber);\n usersPaginationControls(usersPagesTotal);\n}", "title": "" }, { "docid": "26a390bc525846d1f6de908ca76de2cb", "score": "0.5918504", "text": "function showprevpage(){\n setCurrentpage(prevpage);\n }", "title": "" }, { "docid": "e57f5f6e847c76ffb03449e2f2c920bf", "score": "0.5917294", "text": "function prevPage() {\n pageNumber--;\n backBtn.disabled = false; \n getThoseArticles(); \n }", "title": "" }, { "docid": "180356e05a087c30ba195fd46a7e4bb2", "score": "0.5909067", "text": "function showPrev() {\n if (index === 0) {\n index = 0;\n return;\n }\n index--;\n $(\".optionBox span\").removeClass();\n\n $(\".optionBox span\").attr(\"onclick\", \"checkAnswer(this)\");\n printQuestion(index);\n}", "title": "" }, { "docid": "7bb2b588e3a904b000fc5ee778a6df20", "score": "0.5889691", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "7bb2b588e3a904b000fc5ee778a6df20", "score": "0.5889691", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "7bb2b588e3a904b000fc5ee778a6df20", "score": "0.5889691", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "7bb2b588e3a904b000fc5ee778a6df20", "score": "0.5889691", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "7bb2b588e3a904b000fc5ee778a6df20", "score": "0.5889691", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "e69ab47ed403d32e4fa732cd5ee86f50", "score": "0.5887642", "text": "prev() {\n\t\tvar page = this.page,\n\t\t\ttotal = this.total;\n\n\t\tthis.dispatchRequest_({\n\t\t\tpage: (this.circular && (page === 0)) ? total - 1 : Math.max(0, --page)\n\t\t});\n\t}", "title": "" }, { "docid": "a195a592c74fa7278a975b10f21bde9a", "score": "0.58864313", "text": "function table_prev (id) {\n var start = parseInt(document.getElementById('table_start_' + id).value,10);\n var perpage = parseInt(document.getElementById('table_perpage_' + id).value,10);\n\n var stop = start;\n start = start - perpage;\n var show_prev = 1;\n if (start <= 0) {\n start = 0;\n stop = perpage;\n show_prev = 0;\n }\n\n document.getElementById('table_start_' + id).value = start;\n\n fill_table(id, start, stop, show_prev, 1);\n\n}", "title": "" }, { "docid": "1d85642d10d398e3f35949c348154943", "score": "0.5883028", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof this._introBeforeChangeCallback !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "e0babf9c14f0491a8817182c2dd95177", "score": "0.58797175", "text": "prev () {\n if (this.currentPos > 0) {\n --this.currentPos\n }\n return this\n }", "title": "" }, { "docid": "6608c855b1048e108b94a75ce3566d26", "score": "0.58776027", "text": "previous () {\n }", "title": "" }, { "docid": "3df619d821a0597d7882e0c56e48d9ef", "score": "0.58727", "text": "prevPage() {\n this.pageNumber--;\n }", "title": "" }, { "docid": "3df619d821a0597d7882e0c56e48d9ef", "score": "0.58727", "text": "prevPage() {\n this.pageNumber--;\n }", "title": "" }, { "docid": "3df619d821a0597d7882e0c56e48d9ef", "score": "0.58727", "text": "prevPage() {\n this.pageNumber--;\n }", "title": "" }, { "docid": "83f59a2c9dac6ac9b224b31061cec80a", "score": "0.5870707", "text": "function prev(){\r\n\tsetCurrent(current-1);\r\n\tshowImage();\r\n}", "title": "" }, { "docid": "aebcdc06305beded529dfd854472e69d", "score": "0.58657026", "text": "function previousSuggestion(){\n\t\t\tvar suggestionNodes = layer.childNodes;\n\n\t\t\tif (suggestionNodes.length > 0 && current > 0) {\n\t\t\t\tvar node = suggestionNodes[--current];\n\t\t\t\thighlightSuggestion(node);\n\n\t\t\t\ttextbox.value = node.firstChild.nodeValue;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "cd7839917ffe6810aa0c42739e41d0e0", "score": "0.58581793", "text": "function prev(e) {\n e.preventDefault()\n e.stopPropagation()\n slide(false)\n }", "title": "" }, { "docid": "a58e6e7d98dc4fef3d378e5053a96f31", "score": "0.5856911", "text": "function previousPage () {\n var i, tab, elements = getElements();\n\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth >= ctrl.offsetLeft) break;\n }\n\n if (elements.canvas.clientWidth > tab.offsetWidth) {\n //Canvas width *greater* than tab width: usual positioning\n ctrl.offsetLeft = fixOffset(tab.offsetLeft + tab.offsetWidth - elements.canvas.clientWidth);\n } else {\n /**\n * Canvas width *smaller* than tab width: positioning at the *beginning* of current tab to let\n * pagination \"for loop\" to break correctly on previous tab when previousPage() is called again\n */\n ctrl.offsetLeft = fixOffset(tab.offsetLeft);\n }\n }", "title": "" }, { "docid": "d6c7fa0b8aaa3ef9a4a87d4c923f2704", "score": "0.5852815", "text": "function previousPage () {\n var i, tab, elements = getElements();\n\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth >= ctrl.offsetLeft) break;\n }\n \n if (elements.canvas.clientWidth > tab.offsetWidth) {\n //Canvas width *greater* than tab width: usual positioning\n ctrl.offsetLeft = fixOffset(tab.offsetLeft + tab.offsetWidth - elements.canvas.clientWidth);\n } else {\n /**\n * Canvas width *smaller* than tab width: positioning at the *beginning* of current tab to let \n * pagination \"for loop\" to break correctly on previous tab when previousPage() is called again\n */\n ctrl.offsetLeft = fixOffset(tab.offsetLeft); \n }\n }", "title": "" }, { "docid": "d6c7fa0b8aaa3ef9a4a87d4c923f2704", "score": "0.5852815", "text": "function previousPage () {\n var i, tab, elements = getElements();\n\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth >= ctrl.offsetLeft) break;\n }\n \n if (elements.canvas.clientWidth > tab.offsetWidth) {\n //Canvas width *greater* than tab width: usual positioning\n ctrl.offsetLeft = fixOffset(tab.offsetLeft + tab.offsetWidth - elements.canvas.clientWidth);\n } else {\n /**\n * Canvas width *smaller* than tab width: positioning at the *beginning* of current tab to let \n * pagination \"for loop\" to break correctly on previous tab when previousPage() is called again\n */\n ctrl.offsetLeft = fixOffset(tab.offsetLeft); \n }\n }", "title": "" }, { "docid": "280533c8b3c5691076ca2e905c12bedd", "score": "0.58491874", "text": "function _previousStep() {\n\t this._direction = 'backward';\n\t\n\t if (this._currentStep === 0) {\n\t return false;\n\t }\n\t\n\t var nextStep = this._introItems[--this._currentStep];\n\t if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n\t this._introBeforeChangeCallback.call(this, nextStep.element);\n\t }\n\t\n\t _showElement.call(this, nextStep);\n\t }", "title": "" }, { "docid": "110e6b1717a067ec67b2279b1ad40b01", "score": "0.5848824", "text": "function prevPage() {\n if (current_page > 0) {\n pageSelected(current_page - 1);\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "cfd7d91bde012d2d4fb48c00c036c5bd", "score": "0.5848365", "text": "function scrollToPrevious(scroll_blocks, max_scroll_blocks, scroll_blocks_interval, increment, $tl, quick) {\r\n\r\n\t\t//Subtract the interval to the scroll blocks\r\n\t\tscroll_blocks -= scroll_blocks_interval;\r\n\r\n\t\t//If smaller than 0\r\n\t\tif(scroll_blocks <= 0) {\r\n\r\n\t\t\t//It is 0\r\n\t\t\tscroll_blocks = 0;\r\n\t\t}\r\n\r\n\t\t//Update the position\r\n\t\tupdateScrollBlocks(scroll_blocks, increment, $tl, quick);\r\n\r\n\t\t//Hide all the info\r\n\t\tslideAllInfoUp($tl);\r\n\r\n\t\treturn scroll_blocks;\r\n\t}", "title": "" }, { "docid": "b8464156d229d0bf3d448d0059ad10dd", "score": "0.58431256", "text": "function show_previous() {\r\n var count = 0;\r\n\r\n $('#input_span_' + first_shown).nextAll('span[id^=input_span_]').slice(0, 6).each(function()\r\n {\r\n $(this).addClass('temp_hidden');\r\n count++;\r\n\r\n });\r\n\r\n $('#input_span_' + first_shown).prevAll('span[id^=input_span_]').slice(0, 6).each(function()\r\n {\r\n $(this).removeClass('temp_hidden');\r\n });\r\n last_shown -= count;\r\n first_shown -= count;\r\n if (first_shown <= 0)\r\n $('#up_img').addClass('hidden');\r\n\r\n $('#down_img').removeClass('hidden');\r\n}", "title": "" }, { "docid": "2cbbd767205a6fc500dba48cdb05fd12", "score": "0.5842176", "text": "selPrev() {\n let sel = this.mSelection.items.slice();\n for (let s of sel) {\n if (s.prev) {\n this.mSelection.remove(s);\n this.mSelection.add(s.prev);\n }\n }\n return false;\n }", "title": "" }, { "docid": "6580808bb3789c4c29dd8506ee48fe94", "score": "0.5841957", "text": "function prevStep(){\n setStep(step-1);\n }", "title": "" }, { "docid": "62e753d5c6f558984031847dd322d9d5", "score": "0.5839719", "text": "handlePrevPage() {\n const { page } = this.props;\n // Note: data for Griddle needs to be zero-indexed\n const currentPage = page - 1;\n if (currentPage < 1) {\n this.handleSetPage(currentPage);\n return;\n }\n this.handleSetPage(currentPage - 1);\n }", "title": "" }, { "docid": "db98c377e9f8581df0d198e7adacaf19", "score": "0.5838846", "text": "previous() {\n this.step--;\n\n if(this.currentElement)\n this.toggleResizeObserver(false);\n\n this.makeStep();\n }", "title": "" } ]
85146d8a5df13d306a3d20df19ccb5df
Join the network by starting a server and then looking for peers.
[ { "docid": "75be8875b0275c31ed3dbfeda7fd9ba6", "score": "0.64960754", "text": "start() {\n\t\tif(this.started) return Promise.resolve(false);\n\n\t\tdebug('About to join network as ' + this.id);\n\n\t\tconst options = {\n\t\t\tid: this.id,\n\t\t\tname: this.name,\n\t\t\tendpoint: this.endpoint\n\t\t};\n\n\t\tthis.started = true;\n\t\treturn Promise.all(\n\t\t\tthis.transports.map(t => t.start(options))\n\t\t).then(() => {\n\t\t\treturn true;\n\t\t}).catch(err => {\n\t\t\tthis.started = false;\n\t\t\tthrow err;\n\t\t})\n\t}", "title": "" } ]
[ { "docid": "91104306ff06367d41ce9eef1b8e1f30", "score": "0.6488729", "text": "function join() {\n var message = new Buffer(wrapToString(MSG.JOIN));\n\n nickname = randomNickname();\n\n socket.send(\n message,\n 0,\n message.length,\n remote.port,\n remote.address,\n function(err) {\n if (err) {\n log('ERROR: could not join: ' + err);\n } else {\n log('INFO: joined!');\n joined = true;\n converseTimer = setInterval(converse, CONVERSE_INTERVAL);\n }\n });\n}", "title": "" }, { "docid": "a99b2d9c34874384b947394d7164f68b", "score": "0.6200894", "text": "function join (options) {\n if (options.peerId.length !== 12) {\n return this.emit('we-ready', new Error('Unvalid peerId length, must be 48 bits, received: ' + options.peerId).toString())\n }\n\n if (peerTable[options.peerId]) {\n return this.emit('we-ready', new Error('peerId already exists').toString())\n }\n\n peerTable[options.peerId] = {\n socket: this,\n notify: typeof options.notify === 'boolean' && options.notify === true,\n fingers: options.fingers || {\n '0': {\n ideal: idealFinger(new Id(options.peerId), '0').toHex(),\n current: undefined\n }}\n }\n\n log('peer joined: ' + options.peerId)\n this.emit('we-ready')\n if (Object.keys(peerTable).length === 1) {\n return log('This was the first peer join, do nothing')\n }\n notify()\n if (peerTable[options.peerId].fingers['0'].current === undefined) {\n if (!peerTable[options.peerId].notify) {\n return\n }\n updateFinger(options.peerId, '0')\n }\n\n // notify if to other peers if this new Peer is a best finger for them\n function notify () {\n const newId = options.peerId\n const peerIds = Object.keys(peerTable)\n // check for all the peers\n // if same id skip\n // if notify === false skip\n // check the first finger that matches the criteria for ideal or next to ideal\n peerIds.forEach((peerId) => {\n if (newId === peerId) {\n return // skip ourselves\n }\n if (!peerTable[peerId].notify) {\n return // skip if it doesn't want to be notified of available peers\n }\n\n // if it had none, notify to get a successor\n if (peerTable[peerId].fingers['0'].current === undefined) {\n peerTable[peerId].fingers['0'].current = newId\n peerTable[peerId].socket.emit('we-update-finger', {\n row: '0',\n id: newId\n })\n return\n }\n\n const rows = Object.keys(peerTable[peerId].fingers)\n // find the first row that could use this finger\n rows.some((row) => {\n const finger = peerTable[peerId].fingers[row]\n const bestCandidate = fingerBestFit(\n new Id(peerId),\n new Id(finger.ideal),\n new Id(finger.current),\n new Id(newId))\n if (bestCandidate) {\n peerTable[peerId].fingers[row].current = newId\n peerTable[peerId].socket.emit('we-update-finger', {\n row: row,\n id: newId\n })\n return true\n }\n })\n })\n }\n}", "title": "" }, { "docid": "75176e436b75c699c35fcf6b6fb8684d", "score": "0.5746433", "text": "connectToPeers()\n\t{\t\n\t\t//for each peer adds the current connection to it.\n\t\tpeers.forEach(peer => {\n\t\t\t// ws://localhost:5001\n\t\t\tconst socket = new Websocket(peer);\n\n\t\t\tsocket.on('open', () => this.connectSocket(socket));\n\t\t});\n\t}", "title": "" }, { "docid": "cd5d52f0fa102bf462f4b2912ca380c8", "score": "0.571447", "text": "onPeerList (peerList) {\n if (peerList.length === 0) {\n log('Room::join - no-one is here :( Wait for new peers.');\n } else {\n log('Room::join -', peerList.length, 'peers found!', peerList);\n }\n\n peerList.forEach(peerInfo => {\n var peer = this.createNewPeer(peerInfo);\n this.dispatchOffer(peer);\n });\n }", "title": "" }, { "docid": "8dba85f25a0d926d5a1f28c2c0887c5e", "score": "0.56205493", "text": "function connect () {\n console.log('called connect');\n // loop over the queue of waiting peers and\n while (queue.length>0) {\n // TODO: Check if peer already exists before re-doing\n // for each peer get pid\n var pid = queue.shift();\n\n var peer = createRTC(pid);\n peers.status = 'connecting';\n // update status into map\n peers.set(pid, peer);\n console.log(\"updated status for pid\", pid);\n\n // start connection\n connectRTC(pid, peer.conn)\n }\n}", "title": "" }, { "docid": "f5eca6caee495eb88a1bd92b3df854be", "score": "0.56115", "text": "function _joinRoom() {\n roomId = rooms[0].id;\n // Join the room\n socketInstance.post('/room/' + roomId + '/onlineUsers', { id: myChatId });\n }", "title": "" }, { "docid": "dd20b0b9996c2d2b4a09786f563b9ea3", "score": "0.55844027", "text": "function discoverMeshServerOnce() {\r\n var interfaces = os.networkInterfaces();\r\n for (var adapter in interfaces) {\r\n if (interfaces.hasOwnProperty(adapter)) {\r\n for (var i = 0; i < interfaces[adapter].length; ++i) {\r\n var addr = interfaces[adapter][i];\r\n multicastSockets[i] = dgram.createSocket({ type: (addr.family == 'IPv4' ? 'udp4' : 'udp6') });\r\n multicastSockets[i].bind({ address: addr.address, exclusive: false });\r\n if (addr.family == 'IPv4') {\r\n try {\r\n multicastSockets[i].addMembership(membershipIPv4);\r\n //multicastSockets[i].setMulticastLoopback(true);\r\n multicastSockets[i].once('message', OnMulticastMessage);\r\n multicastSockets[i].send(settings.serverid, 16989, membershipIPv4);\r\n } catch (e) { }\r\n }\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "5ad3a8ce92fe23dde616021068b6a3bf", "score": "0.553785", "text": "function joinVideo(){\n var rtc = require('../peer/peerConnection').rtc;\n (!videoInitialized) && initializeVideo(callPeers);\n function callPeers(){\n remotePeers.call(exports.videoStream, callHandler);\n }\n}", "title": "" }, { "docid": "d9573869b24a166429810d948ce9a73a", "score": "0.5512913", "text": "async function connectToPeers() {\n\n if (peers.length >= maxOutgoingPeers) { return }\n\n for (let i = 0; i < p2pNetwork.p2pNodesToConnect.length; i++) {\n if (peers.length >= maxOutgoingPeers) { break }\n\n let peer = {\n p2pNetworkNode: undefined,\n httpClient: undefined\n }\n\n peer.p2pNetworkNode = p2pNetwork.p2pNodesToConnect[i] // peer.p2pNetworkNode.node.networkServices.tradingSignals\n switch (networkService) {\n case 'Trading Signals': {\n if (peer.p2pNetworkNode.node.networkServices === undefined || peer.p2pNetworkNode.node.networkServices.tradingSignals === undefined) {\n // We will ignore all the Network Nodes that don't have this service defined.\n continue\n }\n break\n }\n case 'Network Statistics': {\n continue // This is not yet implemented.\n }\n }\n /*\n DEBUG NOTE: If you are having trouble undestanding why you can not connect to a certain network node, then you can activate the following Console Logs, otherwise you keep them commented out.\n */\n /*\n console.log('[INFO] Checking if the Network Node belonging to User Profile ' + peer.p2pNetworkNode.userProfile.name + ' is reachable via http to be ready to send a message to the ' + networkService + ' network service.')\n */\n if (isPeerConnected(peer) === true) { continue }\n\n await isPeerOnline(peer)\n .then(isOnline)\n .catch(isOffline)\n\n function isOnline() {\n /*\n console.log('[INFO] This node is reponding to PING messages via http. Network Node belonging to User Profile ' + peer.p2pNetworkNode.userProfile.name + ' it is reachable via http.')\n */\n peers.push(peer)\n }\n function isOffline() {\n /*\n console.log('[WARN] Network Node belonging to User Profile ' + peer.p2pNetworkNode.userProfile.name + ' it is NOT reachable via http.')\n */\n }\n }\n\n function isPeerConnected(peer) {\n for (let i = 0; i < peers.length; i++) {\n let connectedPeer = peers[i]\n if (connectedPeer.p2pNetworkNode.node.id === peer.p2pNetworkNode.node.id) {\n return true\n }\n }\n }\n\n async function isPeerOnline(peer) {\n /*\n This function is to check if a network node is online and will \n receive an http request when needed.\n */\n let promise = new Promise(sendTestMessage)\n return promise\n\n async function sendTestMessage(resolve, reject) {\n /*\n Test if the peer is actually online.\n */\n if (peer.httpClient !== undefined) { return }\n\n peer.httpClient = SA.projects.network.modules.webHttpNetworkClient.newNetworkModulesHttpNetworkClient()\n peer.httpClient.initialize(callerRole, thisObject.p2pNetworkClientIdentity, peer.p2pNetworkNode)\n\n\n await peer.httpClient.sendTestMessage(networkService)\n .then(isConnected)\n .catch(isNotConnected)\n\n function isConnected() {\n resolve()\n }\n function isNotConnected() {\n reject()\n }\n }\n }\n }", "title": "" }, { "docid": "ec6e35ef58ebf603fd5a7ef42f1c1230", "score": "0.5442832", "text": "joinRoom(room, hostExist, listensers) {\n trace(`Entering room '${room}'...`);\n this.socket.emit('join', room, hostExist, listensers);\n }", "title": "" }, { "docid": "810d9c53c5d8db0c1af6f50577fcc1ca", "score": "0.5422136", "text": "function joinClient() {\n\tvar playerName = document.getElementById('playerName').value;\n\tif (playerName.length != 0) {\n\t\tsocket.emit('join', {name: playerName});\n\t}\n}", "title": "" }, { "docid": "454ad6a44f410db3264222e0fc1343f3", "score": "0.5393172", "text": "listen()\n\t{\n\t\t//Starts the server/\n\t\tconst server = new Websocket.Server({port: P2P_PORT});\n\t\tserver.on('connection', socket => this.connectSocket(socket));\n\t\t\n\t\t//connects to peers.\n\t\tthis.connectToPeers();\n\n\t\tconsole.log(`Listening for peer-to-peer connections on: ${P2P_PORT}`);\n\t}", "title": "" }, { "docid": "673c52fbbbbcd0352fe54dadcc813081", "score": "0.53860986", "text": "function join(args) {\n return new Promise((resolve, reject) => {\n const { db } = args;\n const dbKey = db.key.toString('hex');\n\n // Create the discovery-swarm.\n const config = datDefaults({\n id: dbKey,\n stream: peer => {\n return db.replicate({\n live: true,\n userData: db.local.key,\n });\n },\n });\n const swarm = discovery(config);\n let authorizedPeers = [];\n\n // Listen for connection events.\n swarm.on('connection', async peer => {\n // console.log('conn', peer);\n\n /**\n * Passing the peer key discussed here:\n *\n * https://github.com/karissa/hyperdiscovery/pull/12#pullrequestreview-95597621\n * - mafintosh\n * - JimmyBoh\n * - karissa\n * - substack\n *\n * `peerKey` was set as `userData` in `db.replicate` call above.\n *\n */\n\n const peerKey = peer.remoteUserData ? Buffer.from(peer.remoteUserData) : undefined;\n if (peerKey) {\n const { isAuthorized } = await authorize({ db, peerKey });\n const hex = peerKey.toString('hex');\n if (isAuthorized && !authorizedPeers.includes(hex)) {\n authorizedPeers = [...authorizedPeers, hex];\n console.log('authorized peer:', hex);\n }\n }\n });\n\n // Join the swarm.\n swarm.join(dbKey, undefined, () => {\n resolve({ config });\n });\n });\n}", "title": "" }, { "docid": "675d2681306a4a0893f85f8fef8d8c58", "score": "0.53764623", "text": "join (username) {\n log('Room::joining as', username);\n\n this.socket.emit('join', username);\n\n this.socket.on('offer', this.onReceivedOffer.bind(this)); //answerOffer.bind(this));\n this.socket.on('answer', this.onReceivedAnswer.bind(this));\n this.socket.on('candidate', this.onReceivedRemoteCandidate.bind(this)); //saveIceCandidate.bind(this));\n this.socket.on('peer-list', this.onPeerList.bind(this));\n this.socket.on('peer-disconnected', this.onPeerDisconnected.bind(this));\n\n this.socket.on('join-error', this.callbacks.joinError.bind(this));\n }", "title": "" }, { "docid": "fee90d597e3cd14b68642355fbaca00f", "score": "0.5356555", "text": "async cmd_join_guild(params) {\n let [ to ] = params\n\n let toGuild = GUILDS[to.toUpperCase()]\n\n if ( !toGuild ) throw {\n reason: `guild \"${to}\" not found`,\n }\n\n console.log(`join_guild: ${to} ${toGuild}`)\n\n return this.query({\n url: \"/guild/sendjoinrequest/\",\n body: {\n guild_id: toGuild,\n },\n })\n }", "title": "" }, { "docid": "9116b0f5173dbbfbc94ecb4e73d02bec", "score": "0.53249246", "text": "start() {\n const { server, port } = this\n\n server.listen(port, () => {\n this.log(`Start at http://localhost:${port}. Starting election...`)\n this.getLeader()\n })\n }", "title": "" }, { "docid": "477f409176a5ca2aacc9e54892ce2c67", "score": "0.51761043", "text": "function startServer(){\n listDevices.startAttendaceServer(UserName);\n startMessageServer();\n console.log('did');\n}", "title": "" }, { "docid": "bb0a9b89a615eaa5652393070b01acb4", "score": "0.5150804", "text": "join() {\n if (this.ancestor) this.ancestor.dispatchEvent(Events.createRequest(this));\n }", "title": "" }, { "docid": "95a218e381e09a34b7b4f8c9def2ce6a", "score": "0.51454306", "text": "start (callback) {\n each(this.availableTransports(this._peerInfo), (ts, cb) => {\n // Listen on the given transport\n this.transport.listen(ts, {}, null, cb)\n }, callback)\n }", "title": "" }, { "docid": "95a218e381e09a34b7b4f8c9def2ce6a", "score": "0.51454306", "text": "start (callback) {\n each(this.availableTransports(this._peerInfo), (ts, cb) => {\n // Listen on the given transport\n this.transport.listen(ts, {}, null, cb)\n }, callback)\n }", "title": "" }, { "docid": "ab94b086ece9444fe927ce031ab57d49", "score": "0.5143634", "text": "function startServer() {\n\tserver = require(__dirname + '/NetworkServer');\n\tserver.startServer();\n}", "title": "" }, { "docid": "cdce66152fb930130998b8df88e9d3bf", "score": "0.5130105", "text": "start() {\n // maybe add routine for removing old messages still in queue to avoid backup\n // on catastrophic neighbor failures\n var node = this._node;\n this._active = true;\n this._connecting = true;\n this._ipc.connectToNet(node.id(), node.host(), node.port());\n this._ipc.of[node.id()].on(\"connect\", this._handleConnect.bind(this));\n this._ipc.of[node.id()].on(\"disconnect\", this._handleDisconnect.bind(this));\n }", "title": "" }, { "docid": "c0947f8cdf2bea5a6c5663eb2bdcbd46", "score": "0.50860083", "text": "async playerJoin(client, playerId, gameId)\n {\n const host = this._getHost(gameId);\n\n if (!(await host.canPlayerJoin(client, playerId))) {\n throw new Error('cannot join when allowJoin is false');\n }\n\n this.log.info('player %s joining game %s', playerId, gameId);\n\n // tell gamelist we've a new player\n await this.net.sendCommand('gamelist', 'playerJoined', {gameId, playerId});\n\n // master list\n this.clients.push({client, playerId, gameId});\n\n // let the host do its thang\n host.addClient(client, playerId);\n }", "title": "" }, { "docid": "78b9d3d751834cda3404520d179092df", "score": "0.50783706", "text": "function join(address, password) {\n return new Promise(function(resolve, reject) {\n var network = networks[address];\n if (network) {\n if (network.encryption_wpa || network.encryption_wpa2) {\n execConnectWPA(network, password, function(err, stdout, stderr) {\n if (err || stderr) {\n wifi.error(err);\n wifi.error(stderr);\n reject(err || stderr);\n } else {\n resolve();\n }\n });\n } else if (network.encryption_wep) {\n execConnectWEP(network, password, function(err, stdout, stderr) {\n if (err || stderr) {\n wifi.error(err);\n wifi.error(stderr);\n reject(err || stderr);\n } else {\n resolve();\n }\n });\n } else {\n execConnectOpen(network, function(err, stdout, stderr) {\n if (err || stderr) {\n wifi.error(err);\n wifi.error(stderr);\n reject(err || stderr);\n } else {\n resolve();\n }\n });\n }\n } else {\n reject(\"Could not find the network with address \" + address);\n }\n });\n }", "title": "" }, { "docid": "447e55864b5d68fc4e3fed1e1a829124", "score": "0.5043024", "text": "function startPeerCommunications(peerName) {\n\n // start server with port zero so it will get new port for us.\n startServerSocket(0);\n\n serverport = server.address().port;\n console.log(\" server listens port :\" + serverport);\n\n Mobile('StartBroadcasting').callNative(peerName, serverport, function (err) {\n console.log(\"StartPeerCommunications returned : \" + err + \", port: \" + port);\n if (err != null && err.length > 0) {\n Mobile('ShowToast').callNative(\"Can not Start boardcasting: \" + err, true, function () {\n //callback(arguments);\n });\n }\n });\n }", "title": "" }, { "docid": "6c99043f133536dd7598a4113f46b9b6", "score": "0.50383615", "text": "function startServers() {\r\n\t\tvar servers = impress.config.servers,\r\n\t\t\tworkerId = 0;\r\n\t\tfor (var serverName in servers) {\r\n\t\t\tvar server = servers[serverName],\r\n\t\t\t\tsingle = impress.config.cluster.strategy == \"single\",\r\n\t\t\t\tspecialization = impress.config.cluster.strategy == \"specialization\",\r\n\t\t\t\tcloned = impress.config.cluster.strategy == \"multiple\" || impress.config.cluster.strategy == \"sticky\",\r\n\t\t\t\tmaster = impress.cluster.isMaster,\r\n\t\t\t\tcertificate = null;\r\n\r\n\t\t\tif (server.protocol == \"https\") {\r\n\t\t\t\tif (server.key && server.cert) {\r\n\t\t\t\t\tvar certDir = impress.configDir+'/ssl/';\r\n\t\t\t\t\tcertificate = {\r\n\t\t\t\t\t\tkey: impress.fs.readFileSync(certDir+server.key),\r\n\t\t\t\t\t\tcert: impress.fs.readFileSync(certDir+server.cert)\r\n\t\t\t\t\t};\r\n\t\t\t\t} else fatalError('SSL certificate is not configured for HTTPS');\r\n\t\t\t}\r\n\t\t\tif (master) {\r\n\t\t\t\tif (single) {\r\n\t\t\t\t\tif (server.protocol == \"https\")\r\n\t\t\t\t\t\tserver.listener = impress.https.createServer(certificate, impress.dispatcher);\r\n\t\t\t\t\telse server.listener = impress.http.createServer(impress.dispatcher);\r\n\t\t\t\t\tif (impress.websocket) impress.websocket.upgradeServer(server.listener);\r\n\t\t\t\t} else if (cloned) {\r\n\t\t\t\t\tif (impress.config.cluster.strategy == \"sticky\")\r\n\t\t\t\t\t\tserver.listener = impress.net.createServer(balancer);\r\n\t\t\t\t\telse server.listener = {\r\n\t\t\t\t\t\tclose: function(callback) { callback(); },\r\n\t\t\t\t\t\ton: function() { },\r\n\t\t\t\t\t\tlisten: function() { }\r\n\t\t\t\t\t};\r\n\t\t\t\t} else if (specialization && isFirstStart) impress.fork(workerId++, serverName);\r\n\t\t\t\tconsole.log(' listen on '+server.address+':'+server.port);\r\n\t\t\t} else if (cloned || impress.serverName == serverName) {\r\n\t\t\t\tif (server.protocol == \"https\")\r\n\t\t\t\t\tserver.listener = impress.https.createServer(certificate, impress.dispatcher);\r\n\t\t\t\telse server.listener = impress.http.createServer(impress.dispatcher);\r\n\t\t\t\tif (impress.websocket) impress.websocket.upgradeServer(server.listener);\r\n\t\t\t}\r\n\t\t\tif (server.listener) {\r\n\t\t\t\tserver.listener.slowTime = duration(server.slowTime || impress.defaultSlowTime);\r\n\t\t\t\tserver.listener.on('error', function(e) {\r\n\t\t\t\t\tif (e.code == 'EADDRINUSE' || e.code == 'EACCESS' || e.code == 'EACCES') fatalError('Can`t bind to host/port');\r\n\t\t\t\t});\r\n\t\t\t\tserver.listener.serverName = serverName;\r\n\t\t\t\tif ((master && !specialization) || (!master && !cloned)) {\r\n\t\t\t\t\tif (server.nagle === false) {\r\n\t\t\t\t\t\tserver.listener.on('connection', function(socket) {\r\n\t\t\t\t\t\t\tsocket.setNoDelay();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tserver.listener.listen(server.port, server.address);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (impress.config.cluster.strategy == \"sticky\") server.listener.listen(null);\r\n\t\t\t\t\telse server.listener.listen(server.port, server.address);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "afb466931d0929b2f93a0fa39349fd04", "score": "0.50276035", "text": "function joinRoom() {\n const roomId = this.id.substr(5, this.id.length-5)\n player.updatePlayer1(false);\n //player.setPlayerType(false);\n socket.emit('joinGame', { name: player.name, room: this.id });\n\n //player = new Player(player.name, P2);\n }", "title": "" }, { "docid": "b8a017e851f0262fb4a50fd0bff41c53", "score": "0.5022238", "text": "function recv_join(message) {\n print_msg(\"[12][Push] add listener...\");\n Subscribe(['push', 'publish']);\n Subscribe(hickey.subscribe);\n //self.syncChange(hickey.subscribe);\n\n\n //right now, push connect is successful, then display devices on main panel.\n _connected = true;\n\n if (hickey.handler.device_list != null) {\n hickey.handler.device_list(_deviceList);\n }\n\n print_msg(\"[13][Push] now main panel can show device list...\");\n\n //inform client that there are some old data on server, get it by data\n if (message.length > 0) {\n getHistoryData(message);\n }\n\n //if join success\n sync_control();\n }", "title": "" }, { "docid": "88bf0b849649de99abf1b91ace2726fc", "score": "0.50204474", "text": "function AddPlayerOnJoin(player)\n{\n jcmp.players.forEach((p) =>\n {\n if (p.c && p.c.ready && p.friends && p.networkId != player.networkId)\n {\n const data = {\n name: player.c.general.name,\n id: player.networkId,\n level: player.c.exp.level,\n steam_id: player.c.general.steam_id,\n ping: player.client.ping,\n friend_status: p.is_friends(player.c.general.steam_id) ? \"Friends\" : \n p.friends_has_invited(player.c.general.steam_id) ? \"Pending\" : \n p.friends_was_requested(player.c.general.steam_id) ? \"Requested\" : \"None\",\n color: player.c.general.color\n };\n\n if (player.tag && player.tag.name && player.tag.color)\n {\n data.tag = \n {\n tagname: player.tag.name,\n tagcolor: player.tag.color\n }\n }\n\n jcmp.events.CallRemote('friends/network/add_entry', p, JSON.stringify(data));\n }\n })\n}", "title": "" }, { "docid": "be74fc3452fd39e7e7b06fff187ae14a", "score": "0.5009167", "text": "function joinRoom() {\n\tif (state == null) {\n\t\t// var campname = document.querySelector('#incoming').value;\n\t\tvar campname = 'dgnby';\n\t\t// TODO: check name is valid, alert() if not\n\t\tdatabase.ref('hosts/' + campname + '/').update({\n\t\t\t// add client signal data to database\n\t\t\tjoinData: signalClient,\n\t\t});\n\n\t\tvar hostData = firebase.database().ref('hosts/' + name + '/hostData');\n\t\t// wait for host to respond to client signal data\n\t\thostData.on('value', function(snapshot) {\n\t\t\tif(state == \"client\"){\n\t\t\t\tsetTimeout(function(){ readAnswer(campname); }, 200);\n\t\t\t}\n\t\t});\n\t\tstate = \"client\";\n\t}\n\tdocument.getElementById('hostbox').style.animation='0.2s fadeOut forwards';\n}", "title": "" }, { "docid": "060890cb7cfe422b4e668d20de4864fb", "score": "0.5004465", "text": "listen() {\n let others = this._context._services.get(this.name, this.type).filter(entry => {\n return entry.address == this.address;\n });\n if (others.length) {\n for (let node of others) {\n this.socket.connect(node.address);\n }\n }\n this.socket.bind(this.node.host + ':' + this.port);\n }", "title": "" }, { "docid": "751b27058b4b08a918128a499daef3e8", "score": "0.49961343", "text": "start() {\n return new Promise((resolve, reject) => {\n this.server = net.createServer(this.handleNewConnection.bind(this));\n\n // Handle an error from listen\n this.server.once('error', (err) => {\n this.server.removeAllListeners('error');\n reject(err);\n });\n\n // We are listening\n this.server.once('listening', () => {\n this.server.removeAllListeners('error');\n\n // Now let's start a sentinel server\n this.sentinelServer = net.createServer(this.handleSentinelConnection.bind(this));\n\n // Handle an error from listen\n this.sentinelServer.once('error', (err) => {\n this.sentinelServer.removeAllListeners('error');\n reject(err);\n });\n\n // We are listening\n this.sentinelServer.once('listening', () => {\n this.sentinelServer.removeAllListeners('error');\n debug('Server started');\n resolve(true);\n });\n\n this.sentinelServer.listen(this.opts.sentinelPort);\n });\n\n this.server.listen(this.opts.port);\n });\n }", "title": "" }, { "docid": "db4c5c6bcfe4ec82798f32ce132e37ad", "score": "0.4996076", "text": "function join(socket, roomCode, callback) {\n if (socket && socket.join) {\n socket.join(roomCode, callback);\n }\n}", "title": "" }, { "docid": "4b5a1f78db67e8062d08583dc68e9bbb", "score": "0.495483", "text": "joined() {\n this.transition(SessionAction.JoiningSuccess);\n this.waitingForJoinPromise.complete(null);\n }", "title": "" }, { "docid": "eee9cfa3226859fa54b60f56d815673c", "score": "0.495147", "text": "function joinRoom(userSocket, partnerSocket, allSockets, callback){\n // create room with socket id\n var room = userSocket.id.substring(2);\n userSocket.join(room);\n partnerSocket.join(room);\n\n // attach room name with sockets\n\n userSocket.room = room;\n partnerSocket.room = room;\n\n // remove sockets from array\n var connectedSockets = [];\n connectedSockets.push(userSocket);\n connectedSockets.push(partnerSocket);\n for(var i = 0; i<allSockets.length;i++){\n var j = allSockets.indexOf(userSocket);\n if (i === -1){}\n else{allSockets.splice(i, 1)};\n }\n for(var i = 0; i<allSockets.length;i++){\n var j = allSockets.indexOf(partnerSocket);\n if (i === -1){}\n else{allSockets.splice(i, 1)};\n }\n callback(null,'success'); \n}", "title": "" }, { "docid": "e77a33b2d26a175b99de84efed677d79", "score": "0.49457508", "text": "function joinChatRoom(player) {\n\n var sessionID = player.sessionID;\n var room = player.params.map;\n\n io.sockets.sockets[sessionID].join(room);\n console.log(getTime() + ' ' + player.params.name + '[' + player.playerID + '] ENTERED ' + room);\n}", "title": "" }, { "docid": "2aa748fd6702643bf583e1f3cb9d1602", "score": "0.49279454", "text": "function joinPublicRoom() {\n const publicRoom = drone.subscribe(PUBLIC_ROOM_NAME);\n publicRoom.on('open', error => {\n if (error) {\n return console.error(error);\n }\n console.log(`Successfully joined room ${PUBLIC_ROOM_NAME}`);\n });\n\n // Received array of members currently connected to the public room\n publicRoom.on('members', m => {\n members = m;\n me = members.find(m => m.id === drone.clientId);\n DOM.updateMembers();\n });\n\n // New member joined the public room\n publicRoom.on('member_join', member => {\n members.push(member);\n DOM.updateMembers();\n });\n\n // Member left public room (closed browser tab)\n publicRoom.on('member_leave', ({id}) => {\n const index = members.findIndex(member => member.id === id);\n members.splice(index, 1);\n DOM.updateMembers();\n });\n\n // Received public message\n publicRoom.on('message', message => {\n const {data, member} = message;\n if (member && member !== me) {\n addMessageToRoomArray(PUBLIC_ROOM_NAME, member, data);\n if (selectedRoom === PUBLIC_ROOM_NAME) {\n DOM.addMessageToList(data, member);\n }\n }\n });\n}", "title": "" }, { "docid": "7bbcaafd8a8ea737ef866b596ded9bb8", "score": "0.49127364", "text": "start (callback) {\n if (!this.modules.transport) {\n return callback(new Error('no transports were present'))\n }\n\n let ws\n let transports = this.modules.transport\n\n transports = Array.isArray(transports) ? transports : [transports]\n\n // so that we can have webrtc-star addrs without adding manually the id\n const maOld = []\n const maNew = []\n this.peerInfo.multiaddrs.toArray().forEach((ma) => {\n if (!ma.getPeerId()) {\n maOld.push(ma)\n maNew.push(ma.encapsulate('/ipfs/' + this.peerInfo.id.toB58String()))\n }\n })\n this.peerInfo.multiaddrs.replace(maOld, maNew)\n\n const multiaddrs = this.peerInfo.multiaddrs.toArray()\n transports.forEach((transport) => {\n if (transport.filter(multiaddrs).length > 0) {\n this.switch.transport.add(\n transport.tag || transport.constructor.name, transport)\n } else if (transport.constructor &&\n transport.constructor.name === 'WebSockets') {\n // TODO find a cleaner way to signal that a transport is always\n // used for dialing, even if no listener\n ws = transport\n }\n })\n\n series([\n (cb) => this.switch.start(cb),\n (cb) => {\n if (ws) {\n // always add dialing on websockets\n this.switch.transport.add(ws.tag || ws.constructor.name, ws)\n }\n\n // all transports need to be setup before discover starts\n if (this.modules.discovery) {\n return each(this.modules.discovery, (d, cb) => d.start(cb), cb)\n }\n cb()\n },\n (cb) => {\n // TODO: chicken-and-egg problem:\n // have to set started here because DHT requires libp2p is already started\n this._isStarted = true\n if (this._dht) {\n return this._dht.start(cb)\n }\n cb()\n },\n (cb) => {\n // detect which multiaddrs we don't have a transport for and remove them\n const multiaddrs = this.peerInfo.multiaddrs.toArray()\n transports.forEach((transport) => {\n multiaddrs.forEach((multiaddr) => {\n if (!multiaddr.toString().match(/\\/p2p-circuit($|\\/)/) &&\n !transports.find((transport) => transport.filter(multiaddr).length > 0)) {\n this.peerInfo.multiaddrs.delete(multiaddr)\n }\n })\n })\n cb()\n },\n (cb) => {\n this.emit('start')\n cb()\n }\n ], callback)\n }", "title": "" }, { "docid": "af451d9db809208694c04b6e0a223119", "score": "0.4905404", "text": "start (callback) {\n if (!this.modules.transport) {\n return callback(new Error('no transports were present'))\n }\n\n let ws\n let transports = this.modules.transport\n\n transports = Array.isArray(transports) ? transports : [transports]\n\n // so that we can have webrtc-star addrs without adding manually the id\n const maOld = []\n const maNew = []\n this.peerInfo.multiaddrs.toArray().forEach((ma) => {\n if (!ma.getPeerId()) {\n maOld.push(ma)\n maNew.push(ma.encapsulate('/ipfs/' + this.peerInfo.id.toB58String()))\n }\n })\n this.peerInfo.multiaddrs.replace(maOld, maNew)\n\n const multiaddrs = this.peerInfo.multiaddrs.toArray()\n transports.forEach((transport) => {\n if (transport.filter(multiaddrs).length > 0) {\n this.switch.transport.add(\n transport.tag || transport.constructor.name, transport)\n } else if (transport.constructor &&\n transport.constructor.name === 'WebSockets') {\n // TODO find a cleaner way to signal that a transport is always\n // used for dialing, even if no listener\n ws = transport\n }\n })\n\n series([\n (cb) => this.switch.start(cb),\n (cb) => {\n if (ws) {\n // always add dialing on websockets\n this.switch.transport.add(ws.tag || ws.constructor.name, ws)\n }\n\n // all transports need to be setup before discover starts\n if (this.modules.discovery) {\n return each(this.modules.discovery, (d, cb) => d.start(cb), cb)\n }\n cb()\n },\n (cb) => {\n // TODO: chicken-and-egg problem #1:\n // have to set started here because DHT requires libp2p is already started\n this._isStarted = true\n if (this._dht) {\n this._dht.start(cb)\n } else {\n cb()\n }\n },\n (cb) => {\n // TODO: chicken-and-egg problem #2:\n // have to set started here because FloodSub requires libp2p is already started\n if (this._options !== false) {\n this._floodSub.start(cb)\n } else {\n cb()\n }\n },\n\n (cb) => {\n // detect which multiaddrs we don't have a transport for and remove them\n const multiaddrs = this.peerInfo.multiaddrs.toArray()\n\n transports.forEach((transport) => {\n multiaddrs.forEach((multiaddr) => {\n if (!multiaddr.toString().match(/\\/p2p-circuit($|\\/)/) &&\n !transports.find((transport) => transport.filter(multiaddr).length > 0)) {\n this.peerInfo.multiaddrs.delete(multiaddr)\n }\n })\n })\n cb()\n },\n (cb) => {\n this.emit('start')\n cb()\n }\n ], callback)\n }", "title": "" }, { "docid": "48acb8ea0b6f9c18034bd53cfe1a3f65", "score": "0.4905288", "text": "function discoverMeshServer() { console.log(\"Looking for server...\"); discoveryInterval = setInterval(discoverMeshServerOnce, 5000); discoverMeshServerOnce(); }", "title": "" }, { "docid": "75f3b6ef3738d9ebb672d2d88fd7765d", "score": "0.48998624", "text": "async function joinClub() {\n try {\n const { data } = await props.client.mutate({\n mutation: queries.JOIN_CLUB,\n variables: { id: club.id }\n });\n\n if (data.joinClub) {\n setClub({ ...club, users: (await getClub(club.id)).users });\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }", "title": "" }, { "docid": "e041457caa11475c379e5f337e3e7760", "score": "0.4895375", "text": "function initialize() {\n // Create own peer object with connection to shared PeerJS server\n peer = new Peer(null, {\n debug: 2\n });\n\n peer.on('open', () => {\n // Workaround for peer.reconnect deleting previous id\n if (peer.id === null) {\n console.warn('Received null id from peer open');\n peer.id = lastPeerId;\n } else {\n lastPeerId = peer.id;\n }\n\n console.log('ID: ' + peer.id);\n recvId.textContent = peer.id;\n status.textContent = 'Awaiting connection...';\n status.className = classNames.secondary;\n });\n peer.on('connection', c => {\n // Allow only a single connection\n if (conn) {\n c.on('open', () => {\n c.send('Already connected to another client');\n setTimeout(() => {\n c.close();\n }, 500);\n });\n return;\n }\n\n conn = c;\n\n status.textContent = `Connected to: ${conn.peer}`;\n status.className = classNames.success;\n callButton.disabled = false;\n\n ready();\n });\n peer.on('disconnected', () => {\n status.textContent = 'Connection lost. Please reconnect';\n status.className = classNames.danger;\n\n console.warn('Connection lost. Please reconnect');\n\n // Workaround for peer.reconnect deleting previous id\n peer.id = lastPeerId;\n peer._lastServerId = lastPeerId;\n callButton.disabled = true;\n peer.reconnect();\n });\n peer.on('close', () => {\n conn = null;\n status.textContent = 'Connection destroyed. Please refresh';\n status.className = classNames.danger;\n\n console.warn('Connection destroyed');\n callButton.disabled = true;\n });\n peer.on('error', err => {\n status.textContent = err;\n status.className = classNames.danger;\n console.log(err);\n callButton.disabled = true;\n });\n\n addSelectorEvents();\n }", "title": "" }, { "docid": "9eaf920b207c2d32b28f7653ab199c69", "score": "0.48898873", "text": "start () {\n\t\tthis._logger.info(`Connecting to ${this.host}...`)\n\t\tthis._params.host = this.host\n\t\tthis._connection.connect(this._params)\n\t\tthis.started = true\n\t}", "title": "" }, { "docid": "22891eea4c1f38dda181a5ca6463033e", "score": "0.488233", "text": "function joinRoom(roomId) {\r\n player.roomId = roomId;\r\n ROOMS[roomId].addMember(player);\r\n socket.emit('roomJoined', {\r\n roomId,\r\n members: ROOMS[roomId].getMembers()\r\n });\r\n }", "title": "" }, { "docid": "72e821a3b9fde8e1a9c4cb8814208cf5", "score": "0.48768133", "text": "listen() {\n // use a server class inside the ws module, use either the user's port variable or the one we specified up there^\n const server = new WebSocket.Server({ port: P2P_PORT });\n // event listener sent to the server\n // fire callback whenever a new socket connects with this server\n server.on('connection', socket => this.connectSocket(socket));\n // make sure that later instances connect to this and other instances\n this.connectToPeers();\n\n console.log(`listening for peer to peer connections on ${P2P_PORT}`);\n }", "title": "" }, { "docid": "1cd8222a9090d881f14572ad4a919fec", "score": "0.48737606", "text": "function connect() {\n var target = $(\"#target-id\").val();\n conn = peer.connect(target);\n conn.on(\"open\", function () {\n updateConnectedTo(target);\n prepareMessaging();\n conn.on(\"data\", function (data) {\n displayMessage(data.message, data.timestamp, conn.peer);\n });\n console.log(conn);\n });\n}", "title": "" }, { "docid": "6ce9b42a8de4d525f109e60b6a2bb00f", "score": "0.48672867", "text": "function startDownloadServer(usernameFromPeerJS,roomNameFromPeerJS) {\n\tusername = usernameFromPeerJS\n rtc.room_info(rtccopy_server, roomNameFromPeerJS);\n\tinit(roomNameFromPeerJS); \n}", "title": "" }, { "docid": "2bc40870f9e95340efcde0e15d3a9be2", "score": "0.4838108", "text": "usePeer(peer){\n switch (peer.connectionStatus) {\n case CONNECTION_STATUS.CONNECTED:\n //Give mission\n this._findNewMission(peer);\n break;\n case CONNECTION_STATUS.PENDING:\n case CONNECTION_STATUS.PENDING_TUNNEL:\n break;\n case CONNECTION_STATUS.CANCELLED:\n case CONNECTION_STATUS.DISCONNECTED:\n default:\n ConnectionsManager.connect(peer);\n break;\n }\n }", "title": "" }, { "docid": "3a18577d455176185d15a2106a9ac721", "score": "0.48277795", "text": "function join(call, callback) {\n users.push(call);\n notifyChat({ user: \"Server\", text: \"new user joined ...\" });\n}", "title": "" }, { "docid": "369bd9a3b037e6129b72f22a31714d46", "score": "0.47852486", "text": "async function _initBootstrapAndRefreshPeers (req, targetIPFSPeerAddresses, redisKey) {\n req.logger.info(redisKey, 'Initializing Bootstrap Peers:')\n const ipfs = req.app.get('ipfsAPI')\n\n // Get own IPFS node's peer addresses\n const ipfsID = await ipfs.id()\n if (!ipfsID.hasOwnProperty('addresses')) {\n throw new Error('failed to retrieve ipfs node addresses')\n }\n const ipfsPeerAddresses = ipfsID.addresses\n\n // For each targetPeerAddress, add to trusted peer list and open connection.\n for (let targetPeerAddress of targetIPFSPeerAddresses) {\n if (targetPeerAddress.includes('ip6') || targetPeerAddress.includes('127.0.0.1')) continue\n if (ipfsPeerAddresses.includes(targetPeerAddress)) {\n req.logger.info(redisKey, 'ipfs addresses are same - do not connect')\n continue\n }\n\n // Add to list of bootstrap peers.\n let results = await ipfs.bootstrap.add(targetPeerAddress)\n req.logger.info(redisKey, 'ipfs bootstrap add results:', results)\n\n // Manually connect to peer.\n results = await ipfs.swarm.connect(targetPeerAddress)\n req.logger.info(redisKey, 'peer connection results:', results.Strings[0])\n }\n}", "title": "" }, { "docid": "23e5f7214ec71713dc2c9a52dd615ef5", "score": "0.4777594", "text": "function start() {\n // in case we fail over to a new server,\n // listen for wsock-open events\n openListener = wss.addOpenListener(wsOpen);\n wss.sendEvent('topo2Start');\n $log.debug('topo2 comms started');\n }", "title": "" }, { "docid": "3f5591d2134d84b699a65352e3a46317", "score": "0.47757444", "text": "function findPeers() {\n if (Windows.Networking.Proximity.PeerFinder.supportedDiscoveryTypes &\n Windows.Networking.Proximity.PeerDiscoveryTypes.browse) {\n\n Windows.Networking.Proximity.PeerFinder.findAllPeersAsync().done(\n function (peerInfoCollection) {\n if (peerInfoCollection.length > 0) {\n // Connect to first peer found - example only.\n // In your app, provide the user with a list of available peers.\n connectToPeer(peerInfoCollection[0]);\n }\n },\n function (err) {\n id(\"messageDiv\").innerHTML += \"Error finding peers: \" + err + \"<br />\";\n });\n } else {\n id(\"messageDiv\").innerHTML +=\n\t\t \"Peer discovery using Wi-Fi Direct is not supported.<br />\";\n }\n }", "title": "" }, { "docid": "ac584ff37fcca617dc2d2fa2591d18c5", "score": "0.4765053", "text": "async cmd_accept_join_guild(params) {\n let [ botName ] = params\n\n let bot = BOTS[botName.toUpperCase()]\n\n if ( !bot ) throw {\n reason: `bot \"${botName}\" not found`,\n }\n\n console.log(`gm_accept_join: ${botName} ${bot.id}`)\n\n return this.query({\n url: \"/guild/handlejoinrequest/\",\n body: {\n hero_id: bot.id,\n accept: 1,\n },\n })\n }", "title": "" }, { "docid": "aabaf3d395fa8ec7acd2321054d95fae", "score": "0.4759609", "text": "continue(){\n for(let peer of this.peers){\n this.usePeer(peer);\n }\n }", "title": "" }, { "docid": "0f04d7cc849c5b9d318b34f779395f3d", "score": "0.47480127", "text": "function connectToPeer() {\n\t//Connect to the opponent.\n\tconnection = peer.connect(gameState.opponentID)\n\tconnection.on('open', () => {\n\t\tgameState.connected = true\n\t\tplayerShip = new Ship(playerOne, true)\n\t\tconnection.send({ action: 'init', payload: playerOne })\n\t})\n\tconnection.on('data', data => {\n\t\t//Update the playerTwo object with the new data.\n\t\tplayerTwo = Object.assign(playerTwo, data.payload)\n\t\tswitch (data.action) {\n\t\t\tcase 'init':\n\t\t\t\topponentShip = new Ship(playerTwo, false)\n\t\t\t\tbreak\n\t\t\tcase 'fire':\n\t\t\t\topponentShip.fire({\n\t\t\t\t\tshooter: playerTwo,\n\t\t\t\t\ttarget: playerOne,\n\t\t\t\t\tgameState\n\t\t\t\t})\n\t\t\t\tbreak\n\t\t\tcase 'move':\n\t\t\t\topponentShip.move(playerTwo)\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tbreak\n\t\t}\n\t})\n}", "title": "" }, { "docid": "1c1d8d7a436444f1afd21e6a9c6d5b1e", "score": "0.4737482", "text": "joinGame(aNickname) {\n this.nickname = aNickname;\n // Create a 'join' message and queue it in ClientNetChannel\n this.netChannel.addMessageToQueue(true, Constants.CMDS.PLAYER_JOINED, {nickname: \"rickd\"});\n }", "title": "" }, { "docid": "73faabd0b4d7a0dd9529ef4d86b141be", "score": "0.47345534", "text": "async startPinging()\n\t{\n\t\tlogger.debug('startPinging()');\n\n\t\tthis._destinations.forEach((destination) =>\n\t\t{\n\t\t\tif (!destination.closed)\n\t\t\t\tdestination.startPinging();\n\t\t});\n\t}", "title": "" }, { "docid": "3207bf11c6f4c07c870356ded716ab41", "score": "0.47278225", "text": "function join() {\n var roomName = roomField.value\n , userName = userField.value\n\n roomStore.set(\"room-name\", roomName)\n roomStore.set(\"user-name\", userName)\n\n roomField.value = \"\"\n userField.value = \"\"\n\n room.emit(\"join\", roomName, userName)\n}", "title": "" }, { "docid": "e21c0e942610d4b167aa7b73c83db417", "score": "0.4721511", "text": "function ConnectToServer () {\n Network.Connect(\"127.0.0.1\", 25000);\n}", "title": "" }, { "docid": "e1c0e8b244b3b631404bf247a8afca10", "score": "0.47140425", "text": "function fetchConnected(base, options) {\n if (options === void 0) { options = Object.create(null); }\n return request_1.default({\n base: base,\n url: '/peers/connected',\n options: options\n });\n}", "title": "" }, { "docid": "ad6f894f2fd01cee7adc8fdb4ce60866", "score": "0.4707033", "text": "async syncPeers() {\n let curPeers = await this.worker.getPeers();\n let { peers } = this.store.getState().blockchain;\n\n if (peersChanged(peers, curPeers)) {\n this.store.dispatch(setPeers(curPeers));\n }\n }", "title": "" }, { "docid": "4a3cf5b63e41ac5bed0cade0f80f3ad2", "score": "0.46801025", "text": "function join(chain_) {\n return chain (identity, chain_);\n }", "title": "" }, { "docid": "980bb8deebfd596629cd334144df1cb6", "score": "0.46780956", "text": "listen() {\n const server = new Websocket.Server({ port: P2P_PORT }); // static class Server present in websocket modules\n server.on('connection', socket => this.connectSocket(socket)); // event listener which listens for incoming messages sent to the websocket server\n this.connecToPeers();\n console.log(`Listening for P2P connections on the port: ${ P2P_PORT}`);\n }", "title": "" }, { "docid": "691887f25eeb3631caa771312a44d3ab", "score": "0.4664969", "text": "connect() {\n if (!this.channels || this.channels.length < 1)\n return;\n this.channels.forEach((infos) => {\n let conn = new Mixer.ChatService(this.client).join(infos.id).then((response) => {\n let channel = new channel_1.Channel(this, infos.id, response.body);\n channel.connect();\n infos.channel = channel;\n }).catch((e) => {\n console.log(\"Cannot connect to channel #\" + infos.id);\n });\n });\n }", "title": "" }, { "docid": "d4a63e6a928d23bc935390a1ce66bc3a", "score": "0.4664921", "text": "function joinRoom(socket, room) {\n socket.join(room);\n // Count the number of connected users to the room\n var active_connections = io.sockets.manager.rooms['/' + room].length;\n io.sockets.in(room).emit(\"user:connect\", active_connections);\n}", "title": "" }, { "docid": "9c0faf9722553bd03d5e200dd6402e31", "score": "0.46639585", "text": "function join()\n{\n\tvar mess = $('#m').val()\n\tsocket.emit('join', mess);\n\t$('#m').val('');\n\t$('#join').html('');\n\treturn false;\n}", "title": "" }, { "docid": "2096b13bdca4a47a9354aa36df168f3b", "score": "0.46638077", "text": "function joinGame(nickname, id){\n\tg_socket.emit(\"usernameUpdate\", {username: nickname, gameToJoinId: id});\n}", "title": "" }, { "docid": "c621aa0fd5d3079e6873c91160e5dc42", "score": "0.46427163", "text": "function startServer() {\r\n\tif ((process.argv[2] == 'help' || !process.argv[2]) && useCommandLine) {\r\n\t\tconsole.log('node index.js {local,online} [shutdownKey] [port]');\r\n\t\tprocess.exit(0);\r\n\t}\r\n\tvar local = process.argv[2] == 'local';\r\n\tvar shutdownK = process.argv[3] || 'q';\r\n\tvar port = process.argv[4] || 8000;\r\n\tif (local) {\r\n\t\tinitServer('localhost', port);\r\n\t} else {\r\n\t\tvar ip = ipGetter.address();\r\n\t\tconsole.log('Connect to: http://' + ip + ':8000/');\r\n\t\tinitServer(ip, port);\r\n\t}\r\n\tif (useCommandLine) {\r\n\t\tbindShutdownKey(shutdownK);\r\n\t}\r\n\tnetInit();\r\n\tMaps.forEach(map => map.data.id = newID(false));\r\n\tlog(0, 'Map id\\'s set');\r\n\tloadMap(Maps[0]);\r\n\tsetInterval(mainLoop, msPerFrame);\r\n}", "title": "" }, { "docid": "e0b8935650855ee38c33d0ba6334493d", "score": "0.46398786", "text": "function join(chain_) {\n return chain(identity, chain_);\n }", "title": "" }, { "docid": "ea4d13dd364f83dcca7bde1137476684", "score": "0.4636205", "text": "sendJoinPortalRequest() {\n log.debug('Sending request to join portal.');\n\n // Emit \"join portal\" request\n const msgHeader = new MessageBuilder().\n setType(JOIN_PORTAL_REQUEST).\n setPortalHostPeerId(this.portalHostPeerId).\n setSenderPeerId(this.localPeerId).\n setTargetPeerId(this.portalHostPeerId).\n getResult();\n const message = new MessageBuilder().\n setHeader(msgHeader).\n getResult();\n this.emitter.emit('enqueue-message', message);\n }", "title": "" }, { "docid": "e5251584db49976810dbbc873849cb7a", "score": "0.46361965", "text": "function sendPeerList(req, res){\n\tTorrent\n\t.findOne({_id: req.query.info_hash})\n\t.select('seeder_count leecher_count completed_count')\n\t.exec(announceErrorWrapper(req, res, function(err, torrent){\n\n\t\tif (torrent == null)\n\t\t\tthrow new AnnounceError('Torrent does not exist in the database');\n\t\t\n\t\tPeer\n\t\t.find({torrent: req.query.info_hash, peer_id: {$ne: req.query.peer_id}})\n\t\t.select('peer_id ip port')\n\t\t.exec(announceErrorWrapper(req, res, function(err, peers){\n\t\t\tpeers = makePeerList(req, res, peers);\n\n\t\t\tres.send(Bencode.encode({\n\t\t\t\tinterval: 300,\n\t\t\t\tcomplete: torrent.seeder_count,\n\t\t\t\tincomplete: torrent.leecher_count,\n\t\t\t\tpeers: peers\n\t\t\t}));\n\t\t}));\n\t}));\n}", "title": "" }, { "docid": "2f8eb6f7105e62d1eb0b80b8989cc996", "score": "0.46273088", "text": "function checkAndStart() {\n console.error(isStarted);\n console.error(localStream);\n console.error(isChannelReady);\n if (!isStarted && typeof localStream != 'undefined' && isChannelReady) { \n\tcreatePeerConnection();\n isStarted = true;\n if (isInitiator) {\n doCall();\n }\n }\n}", "title": "" }, { "docid": "7bfce0e509319d741a8908f1e84311a9", "score": "0.46262255", "text": "function joinPersonalRoom() {\n const roomName = createPrivateRoomName(drone.clientId);\n const myRoom = drone.subscribe(roomName);\n myRoom.on('open', error => {\n if (error) {\n return console.error(error);\n }\n console.log(`Successfully joined room ${roomName}`);\n });\n\n myRoom.on('message', message => {\n const {data, clientId} = message;\n const member = members.find(m => m.id === clientId);\n if (member) {\n addMessageToRoomArray(createPrivateRoomName(member.id), member, data);\n if (selectedRoom === createPrivateRoomName(clientId)) {\n DOM.addMessageToList(data, member);\n }\n } else {\n /* Message is sent from golang using the REST API.\n * You can handle it like a regular message but it won't have a connection\n * session attached to it (this means no member argument)\n */\n }\n });\n}", "title": "" }, { "docid": "8651eea4b6daba1e25465274e58ea221", "score": "0.46171543", "text": "function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }", "title": "" }, { "docid": "b164db993ecc5682b49affd4ba49ba01", "score": "0.4616371", "text": "function joinExisitingRoom({ roomId }) {\r\n //Join room\r\n socket.join(roomId);\r\n\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, roomId);\r\n\r\n // Send room data to socket\r\n const drawingDataByRoom = getDrawingData().filter(\r\n (dataObj) => dataObj.room === roomId\r\n );\r\n const userArray = getUsersArray();\r\n io.to(roomId).emit(\"roomData\", {\r\n roomId: roomId,\r\n data: drawingDataByRoom,\r\n users: userArray.filter(\r\n (user) => user.room === roomId && user.name !== \"\"\r\n ),\r\n });\r\n }", "title": "" }, { "docid": "e0194037ff4640279b96cd7f64167560", "score": "0.46154317", "text": "function connect(receiverPeerId) {\r\n if (conn) {\r\n conn.close();\r\n alert('some connect is close')\r\n }\r\n conn = peer.connect(receiverPeerId, {\r\n reliable: true\r\n });\r\n state = `connected to remote peer ${receiverPeerId}`\r\n listen();\r\n\r\n}", "title": "" }, { "docid": "2eb91394c89dc1c7fa44ced64d28cede", "score": "0.4607256", "text": "function startServer(options) {\n if (options.master) {\n remote(options, function() {\n server(options);\n });\n } else {\n console.log('lack of option master');\n }\n}", "title": "" }, { "docid": "9a86e4a0c38665edb5bbe8b555e103b2", "score": "0.46058208", "text": "listenForJoinTag(currentBlockNumber) {\n this.processor = steemState(client, dsteem, currentBlockNumber, 100, GAME_ID);\n try {\n this.processor.on(JOIN_TAG, (block) => {\n console.log(\"Listen for join tag block\", block);\n var data = block.data;\n if (this.username === data.username && this.gameData.typeID === data.typeID) {\n console.log(\"accepted join block\");\n this.gameData.startingColor = block.data.startingColor;\n this.opponentUsername = block.username;\n this.opponentKey = block.pKey;\n this.initializePeer(true);\n }\n });\n this.processor.start();\n } catch (err) {\n console.error(err);\n if (this.processor !== null)\n this.processor.stop();\n alert(\"Game request failed\");\n }\n\n this.failedToJoinTimeout = setTimeout(() => {//TODO put timeouts in more places, for different parts of the process\n if (this.peer == null) {\n if (this.processor !== null)\n this.processor.stop();\n PubSub.publish('spinner', { spin: false });\n alert(\"Failed to find opponent within 5 minutes\");\n }\n }, maxWaitingTime);\n }", "title": "" }, { "docid": "6c74f3a1d909c9136e07f5f4ae00bb8a", "score": "0.46047378", "text": "start() {\n this.connectionManager.connect().catch((err) => {\n logger.error('Unable to start the bot %j', err);\n });\n }", "title": "" }, { "docid": "79d8acaea6d7eb521e5599a4c4ab15d8", "score": "0.46024317", "text": "connect() {\n if (this.host === undefined || this.port === undefined) {\n log.error('No host or port specified: %s:%d', this.host. this.port);\n return;\n }\n\n if (!this.connected) {\n var scope = this;\n scope.clearState();\n this.server = net.connect(this.port, this.host, () => {\n scope.connected = true;\n log.info('Connected to server @%s:%d', scope.host, scope.port);\n log.debug('Running callbacks for connect @%s:%d', scope.host, scope.port);\n for (var i in scope.callbacks.connected) {\n scope.callbacks.connected[i](scope);\n }\n });\n this.server.on('data', this.processData.bind(this));\n this.server.on('end', this.onDisconnect.bind(this));\n }\n }", "title": "" }, { "docid": "a0a8d69c4217d985af4da1d2eda4e237", "score": "0.45954493", "text": "function start () {\n room.sendToPeers(GAME_START)\n onStart()\n}", "title": "" }, { "docid": "d3df4d8f86b2a51f939dd0e79e5b5478", "score": "0.4593337", "text": "function connect(id, port) {\n\t//Convert our URL to an IP address\n\tvar serverIP = [ id & 0xFF, (id >> 8) & 0xFF, (id >> 16) & 0xFF, (id >> 24) & 0xFF ].join('.');\n\tserverAddr = new enet.Address(serverIP, port);\n\tserverAddr.hostToString = function(){return [ serverAddr._host & 0xFF, (serverAddr._host >> 8) & 0xFF, (serverAddr._host >> 16) & 0xFF, (serverAddr._host >> 24) & 0xFF ].join('.');};\n\tconsole.log(\"Got server address.\");\n\t\n\t//Establish connection to our server\n\tconsole.log(\"Connecting to server \" + serverAddr.hostToString() + \":\" + serverAddr.port() + \"...\");\n\tpeer = client.connect(\n\t\tserverAddr,\n\t\t1, //Channels we're going to use (AoS does not work in surround)\n\t\t3, //Data\n\t\tfunction peerConnectCallback(err) {\n\t\t\tif(err) {\n\t\t\t\tconsole.log(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t);\n\tglobal.peer = peer;\n}", "title": "" }, { "docid": "f8a23369d22e6959f2a1cdd6dd551c20", "score": "0.45918536", "text": "join(member) {\n\t\tthis.members.add(member);\n\t}", "title": "" }, { "docid": "659cfa4668398b60c8bd48ad4d094b32", "score": "0.45816353", "text": "function start() {\n\tsocket.connect(port, host);\n}", "title": "" }, { "docid": "f9ebb7969a980b185a007e4e99cd716d", "score": "0.45746058", "text": "function advertiseForPeers(launchedFromTap) {\n Windows.Networking.Proximity.PeerFinder.displayName = displayNameTextBox.Text;\n\n if (Windows.Networking.Proximity.PeerFinder.supportedDiscoveryTypes &\n Windows.Networking.Proximity.PeerDiscoveryTypes.triggered) {\n\n Windows.Networking.Proximity.PeerFinder.addEventListener(\n \"triggeredconnectionstatechanged\", triggeredConnectionStateChanged);\n\n id(\"messageDiv\").innerHTML +=\n \"You can tap to connect a peer device that is \" +\n \"also advertising for a connection.<br />\";\n } else {\n id(\"messageDiv\").innerHTML +=\n\t\t \"Tap to connect is not supported.<br />\";\n }\n\n if (!launchedFromTap) {\n if (!(Windows.Networking.Proximity.PeerFinder.SupportedDiscoveryTypes &\n Windows.Networking.Proximity.PeerDiscoveryTypes.Browse)) {\n id(\"messageDiv\").innerHTML +=\n \"Peer discovery using Wi-Fi Direct is not supported.<br />\";\n }\n }\n\n if (!started) {\n Windows.Networking.Proximity.PeerFinder.start();\n started = true;\n }\n }", "title": "" }, { "docid": "80190e8cba6bbddeae754cf90f1db7b4", "score": "0.45717156", "text": "function join(msg)\r\n{\r\n console.log(\"----> Client joining \" + msg[\"room\"]);\r\n web.io.emit(\"servermessage\", {\r\n \"room\": msg[\"room\"],\r\n \"command\": \"send_room\",\r\n \"data\": getRoom(msg[\"room\"])\r\n });\r\n}", "title": "" }, { "docid": "020a076905b57aeb545895a7fd5fae3d", "score": "0.45638746", "text": "connectToRoom() {\n const activeRoom = get(this, 'roomId');\n if (activeRoom) {\n const sessionManager = get(this, 'webrtc');\n sessionManager.joinRoom(activeRoom);\n }\n }", "title": "" }, { "docid": "cfd4fc2bb89bda704ddd21f6cab5f59a", "score": "0.4561866", "text": "function start() {\n room.sendToPeers(GAME_START);\n onStart();\n}", "title": "" }, { "docid": "a13b7a4f91fbe9eee24e508f820fe371", "score": "0.45603907", "text": "function joinRoomListener (e) {\r\n displayChatMessage(\"Chat ready!\");\r\n displayChatMessage(\"Number of people now online: \" + chatRoom.getNumOccupants());\r\n displayChatMessage(\"Number of people now online: \" + chatRoom.getNumOccupants());\r\n}", "title": "" }, { "docid": "ff1f2f40368b5300ef5872a55045391f", "score": "0.4555871", "text": "function searchForPlayers() {\n searchingForGame = true;\n views.setSeachingPlayers();\n socket.emit('lookingForGame', authId);\n console.log(\"waiting for game \" + authId)\n socket.on('startMatch', (otherId) => {\n startMultiPlayer(otherId);\n });\n}", "title": "" }, { "docid": "34c1493ec8e19ca8b1f585d1b23ec6a9", "score": "0.45517075", "text": "_onPeer(peer) {\n this.discoveryMap.set(peer.id, {\n port: peer.port,\n address: peer.host,\n connected: false\n });\n // peer.host // remote address\n // peer.port // remote port\n // peer.id // peerId\n // peer.retries // the number of times tried to connect to this peer\n }", "title": "" }, { "docid": "1e84b0942a09a3adcd2f9cb2b8f88fea", "score": "0.45477873", "text": "function setupPeer(port, address, timeout, local) {\n\n var peer = dgram.createSocket({type:'udp4',reuseAddr:true});\n var local = local || false\n\n peer.on('message', (msg, rinfo) => {\n\n console.log(msg)\n\n });\n\n peer.on('connect', () => {\n\n connect = true\n\n var message = Buffer.from('peer message.')\n peer.send(message)\n\n\n\n\n \t// console.log(\"connected as peer.\")\n // // console.log(peer)\n // setInterval(function() {\n //\n //\n // peer.connect(port, address)\n // console.log(message)\n //\n // // peer.connect(remote_port,remote_addr)\n // // peer.send(message, remote_port, remote_addr)\n // // peer.close()\n // }, 20)\n // // peer.send(message)\n\n })\n\n peer.on('listening', () => {\n\n console.log('listening as peer.')\n\n });\n\n peer.on('close', () => {\n // console.log(peer)\n console.log('peer closed.')\n\n });\n\n peer.on('error', () => {\n console.log(\"error.\")\n })\n\n\n var timeout = timeout || 0\n var connect = false\n\n peer.bind(bind_port, '0.0.0.0')\n\n\n if ( local ) {\n\n setTimeout(function() {\n\n console.log(\"timeout.\")\n\n if ( ! connect ) {\n\n connect = true\n // console.log(peer)\n peer = dgram.createSocket({type:'udp4',reuseAddr:true});\n peer.bind(bind_port, '0.0.0.0')\n peer.connect(port, address)\n\n\n peer.on('connect', () => {\n\n connect = true\n console.log(\"connected.\")\n setTimeout(function(){\n\n peer.disconnect()\n\n }, 50)\n\n\n })\n \n peer.on('error', () => {\n console.log(\"fail.\")\n })\n\n peer.on('message', (msg, rinfo) => {\n\n console.log( \"incomming: \" + msg)\n\n })\n\n peer.on('close', () => {\n console.log(\"closed.\")\n })\n\n\n\n }\n\n }.bind(null, port, address), timeout)\n\n\n\n\n }\n\n else {\n\n setTimeout(function() {\n\n console.log(\"timeout.\")\n\n setInterval(function() {\n\n if ( ! connect ) {\n\n connect = true\n // console.log(peer)\n peer = dgram.createSocket({type:'udp4',reuseAddr:true});\n peer.bind(bind_port, '0.0.0.0')\n peer.connect(port, address)\n\n\n peer.on('connect', () => {\n\n connect = true\n\n var message = Buffer.from('peer message.')\n peer.send(message)\n\n\n })\n\n peer.on('message', (msg, rinfo) => {\n\n console.log(\"incomming: \" + msg)\n\n });\n\n peer.on('error', () => {\n console.log(\"fail.\")\n })\n\n\n setTimeout(function(){\n\n peer.close(function() {\n // console.log(\"callback\")\n connect = false\n\n })\n\n }, 500)\n }\n }.bind(null,port,address),20)\n\n }.bind(null, port, address), timeout)\n\n\n\n }\n\n\n\n\n // console.log(peer)\n // peer.connect(remote_port, remote_addr)\n\n\n}", "title": "" }, { "docid": "ce89fd5d2f0e19e4e6c11075051143c8", "score": "0.45472968", "text": "function startStream () {\n if (!isPeerConnectionCreated && localStream && isRemotePeerAvailble) {\n createPeerConnection();\n peerConnection.addStream(localStream);\n isPeerConnectionCreated = true;\n if (isRoomCreated) {\n createOffer();\n }\n }\n}", "title": "" }, { "docid": "b0d779dedfec0f22701ac59002170308", "score": "0.452606", "text": "function establish_peer_connection(tgtNode, proxyNode) { // tell proxyNode to introduce me tgtNode\n if (dc[tgtNode] && dc[tgtNode].readyState === \"open\") {\n return false; // conexion ya establecida\n }\n if (proxyNode === undefined)\n {\n proxyNode = handle_next(tgtNode, 0);\n if (proxyNode === id) {\n if (dc[successor] && (dc[successor].readyState === \"open\")) {\n proxyNode = successor;\n } else if (dc[boot] && (dc[boot].readyState === \"open\")) {\n proxyNode = boot;\n } else if (dc[successorNode] && (dc[successorNode].readyState === \"open\")) {\n proxyNode = successorNode;\n } else {\n return false; // sin candidato para proxyNode \n }\n }\n }\n console.info(\"ESTABLISH_PEER_CONNECTION: between me: \" + id + \"[\" + hash + \"]---> \" + proxyNode + \"[\" + Sha1.digest(proxyNode, bitwise) + \"] ---> \" + tgtNode + \"[\" + Sha1.digest(tgtNode, bitwise) + \"]\");\n console.log(\" \");\n\n if (tgtNode === proxyNode) { // localhost\n pc_loopback = new RTCPeerConnection(pc_config);\n setPcLoopback();\n setDcLoopback(dc_config, hash);\n pc_loopback.createOffer(gotLocalOffer, gotError, ms_config);\n } else {\n if (pc[tgtNode] === undefined) { // si tinc prioritat sempre podre crear un altre, per reconectar, en cas contrari si sh'ha perdut i no em busca donçs esta perdut \n pc[tgtNode] = new RTCPeerConnection(pc_config);\n setPcHandlers(tgtNode);\n setDcHandlers(tgtNode, Sha1.digest(tgtNode, bitwise), dc_config);\n pc[tgtNode].createOffer(gotLocalOffer, gotError, ms_config);\n } else {\n stillAlive(tgtNode);\n }\n }\n function gotLocalOffer(sdpOffer) {\n if (tgtNode === proxyNode) { // localhost\n pc_loopback.setLocalDescription(sdpOffer, gotSetOffer, gotError);\n } else {\n pc[tgtNode].setLocalDescription(sdpOffer, gotSetOffer, gotError);\n }\n }\n function gotSetOffer() { // wait answer \n\n var localOffer;\n var myVar = setInterval(function() {\n if (pc[tgtNode] && pc[tgtNode].remoteDescription !== undefined) {\n clearInterval(myVar); // connection already on progress en progress\n }\n console.info(\"TGT NODE : \" + tgtNode);\n console.log(pc[tgtNode]);\n\n if ((pc[tgtNode] && (navigator.mozGetUserMedia || pc[tgtNode].iceGatheringState === \"complete\")) || (tgtNode === id && (navigator.mozGetUserMedia || pc_loopback.iceGatheringState === \"complete\"))) {\n localOffer = (tgtNode === id) ? pc_loopback.localDescription : pc[tgtNode].localDescription;\n var tgtHash = Sha1.digest(tgtNode, bitwise);\n var msg = {\n type: \"lookup\", // aixo ja fa lo de buscar closest, buscara el node mateix en m hops \n rmi: \"establish\", // \n srcNode: id,\n srcHash: hash,\n tgtNode: tgtNode,\n tgtHash: tgtHash,\n msg: \"sdpOffer... I [\" + id + \"]:[\" + hash + \"] want to connect with [\" + tgtNode + \"]:[\" + tgtHash + \"]\",\n // default -> lookup & loopback utils\n proxyNode: proxyNode, // next step intermediary\n proxyStack: [id], // starting with self, afterward push... push\n path: [id], // stack of route taken\n hop: 0,\n // particular\n sdp: localOffer\n };\n\n // send localDescription to remoteNode & wait \n if (tgtNode === proxyNode) { // localhost // localhost // o try catch\n handle_peer_offerResponse(msg);\n } else {\n send(proxyNode, msg);\n }\n clearInterval(myVar);\n } else {\n console.log(\"waiting iceGatheringState to complete\");\n }\n }, 2000);\n }\n }", "title": "" }, { "docid": "8cc06d8bf01fbc6809d59a52086a440d", "score": "0.45251703", "text": "connect (onConnect) {\n logdebug('connect called')\n this.connecting = true\n if (onConnect) this.once('connect', onConnect) // call user function here\n\n /* pxp not supported\n // first, try to connect to pxp web seeds so we can get web peers\n // once we have a few, start filling peers via any random\n // peer discovery method\n if (this._connectPxpWeb && !this.fConnectPlainWeb && this._params.webSeeds && this._webAddrs.length) {\n this.once('webSeed', () => this._fillPeers()) // connect after pxp discovery\n return this._connectPxpWebSeeds()\n }\n */\n\n // if we aren't using web seeds, start filling with other methods\n this._fillPeers()\n }", "title": "" }, { "docid": "7be8dc327fcc9b16fcc63f7d6069a8a9", "score": "0.45177445", "text": "startServer(callback) {\n if (!started) {\n started = true;\n\n server.listen(share.testPort, () => {\n callback();\n });\n } else {\n callback();\n }\n }", "title": "" }, { "docid": "1f0dbda7dcb353b16412dfedeca23723", "score": "0.45104966", "text": "function pollPeers () {\n var peersTables = Array.prototype.slice.call(document.querySelectorAll('table.peers tbody'))\n if (!peersTables.length)\n return // only update if peers are in the ui\n phoenix.ssb.gossip.peers(function (err, peers) {\n if (err)\n return\n peersTables.forEach(function (tb) { \n tb.innerHTML = ''\n com.peers(phoenix, peers).forEach(function (row) {\n tb.appendChild(row)\n })\n })\n })\n}", "title": "" }, { "docid": "9bb717409ef24875621f93dd35b689f7", "score": "0.45090386", "text": "joinRoom(data) {\n socket.emit('join-room', data);\n }", "title": "" }, { "docid": "759dbfc909206ce4a7b8ea7b99048e0b", "score": "0.45063558", "text": "function connect() {\n\n socket.emit(\"resetMeeteing\");\n $.getJSON(url, function(data) {\n socket.emit(\"takeControl\",userName);\n identity = data.identity;\n \n // Bind button to join Room.\n \n roomName = \"Lobby\"\n\n log(\"Joining room '\" + roomName + \"'...\");\n var connectOptions = {\n name: roomName,\n logLevel: \"error\",\n video:{width:600},\n audio:true\n\n };\n\n if (previewTracks) {\n connectOptions.tracks = previewTracks;\n }\n\n // Join the Room with the token from the server and the\n // LocalParticipant's Tracks.\n Video.connect(data.token, connectOptions).then(roomJoined, function(error) {\n log(\"Could not connect to Twilio: \" + error.message);\n });\n });\n}", "title": "" }, { "docid": "7ebe76823f07b77d462f90273169e228", "score": "0.44970846", "text": "function startConnect() {\n connection.connect(function (err) {\n if (err) throw err;\n // run the start function after the connection is made to prompt the user\n console.log(\"connected as id \" + connection.threadId + \"\\n\");\n displayProducts();\n });\n}", "title": "" } ]
79f23142c506bb07abc6453536ea14d0
END: Convenient Panel Methods.
[ { "docid": "7bbbff910f27a98e423f9c669142248c", "score": "0.0", "text": "_handleKeydown(event) {\n if ((event.key === \"Escape\" /* Escape */ || event.key === \"Enter\" /* Enter */ || event.key === \"Tab\" /* Tab */) && this.panelOpen) {\n this.closePanel();\n event.stopPropagation();\n }\n }", "title": "" } ]
[ { "docid": "5aa3fe7f272464d06a68f6bdcee725f3", "score": "0.6817621", "text": "get panelClass() { return this._panelClass; }", "title": "" }, { "docid": "5aa3fe7f272464d06a68f6bdcee725f3", "score": "0.6817621", "text": "get panelClass() { return this._panelClass; }", "title": "" }, { "docid": "5aa3fe7f272464d06a68f6bdcee725f3", "score": "0.6817621", "text": "get panelClass() { return this._panelClass; }", "title": "" }, { "docid": "bc28aacc4e9e72a77fb1aab5d16030b6", "score": "0.6779779", "text": "getPanel() {\n return this.getPanelWindow().Panel;\n }", "title": "" }, { "docid": "f879cea606590d80eae4aeb9ec9c563c", "score": "0.67697513", "text": "make_control_panel()\n {}", "title": "" }, { "docid": "50a3c6818c1ef970a62778db0987551c", "score": "0.67155474", "text": "function WicketSourcePanel() {\r\n}", "title": "" }, { "docid": "ca703708dae922b05b820af71536bf90", "score": "0.6688333", "text": "get panelType() {\n return this.panelType_;\n }", "title": "" }, { "docid": "f3641f4457335f48124a75502c6b9e1b", "score": "0.6656359", "text": "function simplePanel() {\n\n this.Handle = \"simplePanel\";\n\n this.draw = function (context) {\n var ele = new definitionObject();\n var b = new initDraw(context);\n b.upline_pos = [{x:ele.upLine.getPosition()[0].x, y:ele.upLine.getPosition()[0].y}, {x:ele.upLine.getPosition()[1].x + b.widthDifference, y:ele.upLine.getPosition()[1].y},]\n b.downline_pos = [{x:ele.downLine.getPosition()[0].x, y:ele.downLine.getPosition()[0].y}, {x:ele.downLine.getPosition()[1].x+ b.widthDifference, y:ele.downLine.getPosition()[1].y},]\n b.leftline_pos = [{x:ele.leftLine.getPosition()[0].x, y:ele.leftLine.getPosition()[0].y}, {x:ele.leftLine.getPosition()[1].x, y:ele.leftLine.getPosition()[1].y},]\n b.rightline_pos = [{x:ele.rightLine.getPosition()[0].x+ b.widthDifference, y:ele.rightLine.getPosition()[0].y},{x:ele.rightLine.getPosition()[1].x+ b.widthDifference, y:ele.rightLine.getPosition()[1].y},]\n \n b.upArrowline_pos = [{x:b.upline_pos[0].x, y:165}, {x:b.upline_pos[1].x, y:165},]\n b.ulArrowP_pos = [{x:b.upline_pos[0].x, y:175},{x:b.upline_pos[0].x, y:155}]\n b.urArrowP_pos = [{x:b.upline_pos[1].x, y:175},{x:b.upline_pos[1].x, y:155}]\n b.ulTip_pos = {x:b.upline_pos[0].x, y:165};\n b.urTip_pos = {x:b.upline_pos[1].x, y:165};\n\n b.downArrowline_pos = [{x:b.downline_pos[0].x, y:935}, {x:b.downline_pos[1].x, y:935},]\n b.dlArrowP_pos = [{x:b.downline_pos[0].x, y:945},{x:b.downline_pos[0].x, y:925}] \n b.drArrowP_pos = [{x:b.downline_pos[1].x, y:945},{x:b.downline_pos[1].x, y:925}]\n b.dlTip_pos = {x:b.downline_pos[0].x, y:935};\n b.drTip_pos = {x:b.downline_pos[1].x, y:935};\n\n b.rArrowline_pos = [{x:b.rightline_pos[0].x+77, y:b.rightline_pos[0].y}, {x:b.rightline_pos[1].x+77, y:b.rightline_pos[1].y},]\n b.rgupArrowP_pos = [{x:b.rightline_pos[0].x-10+77, y:b.rightline_pos[0].y}, {x:b.rightline_pos[1].x+10+77, y:b.rightline_pos[0].y}]\n b.rgdownArrowP_pos = [{x:b.rightline_pos[1].x-10+77, y:b.rightline_pos[1].y},{x:b.rightline_pos[1].x+10+77, y:b.rightline_pos[1].y}]\n b.rgupTip_pos = {x:b.rightline_pos[0].x+77, y:b.rightline_pos[0].y};\n b.rgdownTip_pos ={x:b.rightline_pos[1].x+77, y:b.rightline_pos[1].y};\n\n\n b.lArrowline_pos = [{x:52, y:b.leftline_pos[0].y}, {x:52, y:b.leftline_pos[1].y},]\n b.lfupArrowP_pos = [{x:40 , y:b.leftline_pos[0].y}, {x:65, y:b.leftline_pos[0].y}]\n b.lfdownArrowP_pos = [{x:40, y:b.leftline_pos[1].y},{x:65, y:b.leftline_pos[1].y}]\n b.lfupTip_pos = {x:52, y:b.leftline_pos[0].y};\n b.lfdownTip_pos ={x:52, y:b.leftline_pos[1].y};\n \n \n b.upletter = {x:ele.upmainGroup.getPosition().x+b.widthDifference/2,y:ele.upmainGroup.getPosition().y}\n b.downletter.x = ele.upmainGroup.getPosition().x+b.widthDifference/2;\n b.rightletter.x = ele.rightmainGroup.getPosition().x + b.widthDifference\n\n\n b.ruRectmove = {x:ele.ruRect.getPosition().x + b.widthDifference, y:ele.ruRect.getPosition().y};\n b.rbRectmove = {x:ele.rbRect.getPosition().x + b.widthDifference, y:ele.rbRect.getPosition().y};\n b.luRectmove = {x:ele.luRect.getPosition().x, y:ele.luRect.getPosition().y};\n b.lbRectmove = {x:ele.lbRect.getPosition().x, y:ele.lbRect.getPosition().y};\n\n b.BULine = [{x:ele.BULine.getPosition()[0].x,y:ele.BULine.getPosition()[0].y},{x:ele.BULine.getPosition()[1].x+b.widthDifference,y:ele.BULine.getPosition()[1].y}]\n\n b.BLLine = [{x:ele.BLLine.getPosition()[0].x,y:ele.BLLine.getPosition()[0].y},{x:ele.BLLine.getPosition()[1].x,y:ele.BLLine.getPosition()[1].y}]\n \n b.BRLine = [{x:ele.BRLine.getPosition()[0].x+b.widthDifference,y:45},{x:ele.BRLine.getPosition()[1].x+b.widthDifference,y:75}]\n \n b.BDLine = [{x:ele.BDLine.getPosition()[0].x,y:ele.BDLine.getPosition()[0].y},{x:ele.BDLine.getPosition()[1].x+b.widthDifference,y:ele.BDLine.getPosition()[1].y}]\n \n \n b.draw();\n };\n\n this.convertToPNG = function () {\n var d = new Date();\n function download(\n filename, // string\n blob // Blob\n ) {\n if (window.navigator.msSaveOrOpenBlob) {\n window.navigator.msSaveBlob(blob, filename);\n } else {\n const elem = window.document.createElement('a');\n elem.href = window.URL.createObjectURL(blob);\n elem.download = filename;\n document.body.appendChild(elem);\n elem.click();\n document.body.removeChild(elem);\n }\n }\n \n var svg = document.querySelector('svg');\n var data = (new XMLSerializer()).serializeToString(svg);\n var canvas = document.createElement('canvas');\n \n canvg(canvas, data, {\n renderCallback: function () {\n canvas.toBlob(function (blob) {\n download(`${d.getDate()}day-${d.getHours()}hour/${d.getMinutes()}min.png`, blob);\n });\n }\n });\n return \"\";\n };\n\n this.cleanUp = function () {\n };\n\n this.reset = function () {\n\n };\n }", "title": "" }, { "docid": "a14aab1beb3d8e0027e13bbaee95e1e9", "score": "0.6590324", "text": "openPanel() {\n this._attachOverlay();\n this._floatLabel();\n }", "title": "" }, { "docid": "c0fddddae846f47e9654db603145da34", "score": "0.6511816", "text": "function initPanel(){\n\t\t\n\t\tvar objGallerySize = g_gallery.getSize();\n\t\tvar galleryWidth = objGallerySize.width;\t\n\t\t\n\t\t//init srip panel width\n\t\tg_objStripPanel.setOrientation(\"bottom\");\n\t\tg_objStripPanel.setWidth(galleryWidth);\n\t\tg_objStripPanel.run();\n\t\t\n\t\t//set panel size\n\t\tvar objStripPanelSize = g_objStripPanel.getSize();\t\t\n\t\tvar panelHeight = objStripPanelSize.height;\n\t\t\n\t\tif(g_objTextPanel){\n\t\t\tpanelHeight += g_mustOptions.slider_textpanel_height;\n\t\t\t\n\t\t\tif(g_objButtonHidePanel){\n\t\t\t\tvar hideButtonHeight = g_objButtonHidePanel.outerHeight();\n\t\t\t\tpanelHeight += hideButtonHeight;\n\t\t\t}\t\t\n\t\t}\n\t\telse{\t\n\t\t\tvar maxButtonsHeight = 0;\n\t\t\t\n\t\t\tif(g_objButtonHidePanel)\n\t\t\t\tmaxButtonsHeight = Math.max(g_objButtonHidePanel.outerHeight(), maxButtonsHeight);\n\t\t\t\n\t\t\tif(g_objButtonFullscreen)\n\t\t\t\tmaxButtonsHeight = Math.max(g_objButtonFullscreen.outerHeight(), maxButtonsHeight);\n\t\t\t\n\t\t\tif(g_objButtonPlay)\n\t\t\t\tmaxButtonsHeight = Math.max(g_objButtonPlay.outerHeight(), maxButtonsHeight);\n\t\t\t\n\t\t\tpanelHeight += maxButtonsHeight;\n\t\t\n\t\t}\n\t\t\n\t\tg_functions.setElementSize(g_objPanel, galleryWidth, panelHeight);\n\t\t\n\t\t//position strip panel\n\t\tvar stripPanelElement = g_objStripPanel.getElement();\n\t\t\tg_functions.placeElement(stripPanelElement, \"left\", \"bottom\");\n\t\t\n\t\t//init hide panel button\n\t\tif(g_objButtonHidePanel){\n\t\t\tvar buttonTip = g_objButtonHidePanel.children(\".ug-default-button-hidepanel-tip\");\n\t\t\tg_functions.placeElement(buttonTip, \"center\", \"middle\");\n\t\t\t\n\t\t\t//set opacity and bg color from the text panel\t\t\t\n\t\t\tif(g_objTextPanel){\t\t\t\t\n\t\t\t\tvar objHideButtonBG = g_objButtonHidePanel.children(\".ug-default-button-hidepanel-bg\");\n\t\t\t\t\n\t\t\t\tvar hidePanelOpacity = g_objTextPanel.getOption(\"textpanel_bg_opacity\");\t\t\t\t\n\t\t\t\tobjHideButtonBG.fadeTo(0, hidePanelOpacity);\n\n\t\t\t\tvar bgColor = g_objTextPanel.getOption(\"textpanel_bg_color\");\t\t\t\t\n\t\t\t\tobjHideButtonBG.css({\"background-color\":bgColor});\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//position buttons on the text panel:\n\t\tvar paddingPlayButton = 0;\n\t\tvar panelButtonsOffsetY = 0;\n\t\tif(g_objButtonHidePanel){\n\t\t\tpanelButtonsOffsetY = hideButtonHeight;\n\t\t}\n\t\t\n\t\tif(g_objButtonFullscreen){\n\t\t\tg_functions.placeElement(g_objButtonFullscreen, \"right\", \"top\",0 , panelButtonsOffsetY);\n\t\t\tpaddingPlayButton = g_objButtonFullscreen.outerWidth();\n\t\t}\n\t\t\n\t\tif(g_objButtonPlay){\n\t\t\tvar buttonPlayOffsetY = panelButtonsOffsetY;\n\t\t\tif(!g_objTextPanel)\n\t\t\t\tbuttonPlayOffsetY++; \n\t\t\t\t\n\t\t\tg_functions.placeElement(g_objButtonPlay, \"right\", \"top\", paddingPlayButton, buttonPlayOffsetY);\t\t\t\n\t\t\tpaddingPlayButton += g_objButtonPlay.outerWidth();\n\t\t}\n\t\t\n\t\t//run the text panel\n\t\tif(g_objTextPanel){\n\t\t\t\n\t\t\tvar textPanelOptions = {};\n\t\t\ttextPanelOptions.slider_textpanel_padding_right = g_options.theme_text_padding_right + paddingPlayButton;\n\t\t\ttextPanelOptions.slider_textpanel_padding_left = g_options.theme_text_padding_left;\t\t\t\t\t\n\t\t\t\n\t\t\tif(g_objButtonHidePanel){\n\t\t\t\ttextPanelOptions.slider_textpanel_margin = hideButtonHeight;\n\t\t\t}\n\t\t\t\n\t\t\tg_objTextPanel.setOptions(textPanelOptions);\n\t\t\t\n\t\t\tg_objTextPanel.positionPanel();\t\t\t\n\t\t\tg_objTextPanel.run();\n\t\t}\n\t\t\n\t\t//place hide panel button\n\t\tif(g_objButtonHidePanel){\n\t\t\t\t\t\t\n\t\t\tif(g_objTextPanel)\t\t//place at the beginning of hte panel\n\t\t\t\tg_functions.placeElement(g_objButtonHidePanel,\"left\", \"top\");\n\t\t\t\n\t\t\telse{\t\t//place above the strip panel\n\t\t\t\tvar stripPanelHeight = stripPanelElement.outerHeight();\n\t\t\t\tg_functions.placeElement(g_objButtonHidePanel,\"left\", \"bottom\", 0, stripPanelHeight);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "2f38526c5eb8664298f509d18f789e46", "score": "0.6393664", "text": "function DOMSidePanel()\n{\n}", "title": "" }, { "docid": "1bc7a0381ed8ada98dfd4e7a8b4e50f2", "score": "0.636616", "text": "function ShowPanel(PanelName) {\n\n var Panels = GetClass(\"Panel\");\n for( let Panel of Panels ) {\n Panel.style.display = \"none\";\n }\n\n GetID(PanelName).style.display = \"block\";\n }", "title": "" }, { "docid": "3d2d3e6794dbdb4614c97c298d77ce0f", "score": "0.63347596", "text": "_getPanelId() {\n return this.panel.id;\n }", "title": "" }, { "docid": "3d2d3e6794dbdb4614c97c298d77ce0f", "score": "0.63347596", "text": "_getPanelId() {\n return this.panel.id;\n }", "title": "" }, { "docid": "3d2d3e6794dbdb4614c97c298d77ce0f", "score": "0.63347596", "text": "_getPanelId() {\n return this.panel.id;\n }", "title": "" }, { "docid": "3d2d3e6794dbdb4614c97c298d77ce0f", "score": "0.63347596", "text": "_getPanelId() {\n return this.panel.id;\n }", "title": "" }, { "docid": "b4c1b19c008ae846587fcce4e5a2c723", "score": "0.63074136", "text": "function Panel(title, content_builder, panel_setup, content_resizable){\r\n\r\n\tvar controller = function(state){\r\n\t\tstate = state == null ? {} : state\r\n\t\tvar parent = state.parent\r\n\t\tvar open = state.open\r\n\r\n\t\t// 1) search for panel and return it if it exists...\r\n\t\tvar panel = getPanel(title)\r\n\r\n\t\t// 2) if no panel exists, create it\r\n\t\t// \t\t- content_builder() must return panel content\r\n\t\tif(panel.length == 0){\r\n\t\t\tpanel = makeSubPanel(title, content_builder(), parent, open, content_resizable)\r\n\t\t\t\t.attr('id', title)\r\n\r\n\t\t\tpanel_setup(panel)\r\n\r\n\t\t\t// trigger the open event...\r\n\t\t\tif(isPanelVisible(panel)){\r\n\t\t\t\tpanel.trigger('panelOpening', panel)\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tvar v = isPanelVisible(panel)\r\n\r\n\t\t\tif(open && !v){\r\n\t\t\t\topenPanel(panel)\r\n\r\n\t\t\t} else if(!open && v){\r\n\t\t\t\tclosePanel(panel)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// XXX set panel position, size, ...\r\n\r\n\t\treturn panel\r\n\t}\r\n\r\n\tPANELS[title] = controller\r\n\r\n\treturn controller\r\n}", "title": "" }, { "docid": "cc6d28dac52ab37d5ce2d31aff4b7852", "score": "0.63010526", "text": "function Panel() {\n\t _super.call(this);\n\t this.addClass(PANEL_CLASS);\n\t this.layout = this.constructor.createLayout();\n\t }", "title": "" }, { "docid": "82fa52f52f685ae8f85866c784b8b23a", "score": "0.6208846", "text": "_hide() {\n this.panelElem.addClass(\"hidden\");\n }", "title": "" }, { "docid": "1ac1192dab39cb9e4c543d05befd14b1", "score": "0.6201367", "text": "function wcPanel(type, options) {\n this.$container = null;\n this._parent = null;\n this.$icon = null;\n\n if (options.icon) {\n this.icon(options.icon);\n }\n if (options.faicon) {\n this.faicon(options.faicon);\n }\n\n this._panelObject = null;\n this._initialized = false;\n\n this._type = type;\n this._title = type;\n this._titleVisible = true;\n if (options.title) {\n this.title(options.title);\n }\n\n this._layout = null;\n\n this._buttonList = [];\n\n this._actualPos = {\n x: 0.5,\n y: 0.5,\n };\n\n this._actualSize = {\n x: 0,\n y: 0,\n };\n\n this._resizeData = {\n time: -1,\n timeout: false,\n delta: 150,\n };\n\n this._pos = {\n x: 0.5,\n y: 0.5,\n };\n\n this._moveData = {\n time: -1,\n timeout: false,\n delta: 150,\n };\n\n this._size = {\n x: -1,\n y: -1,\n };\n\n this._minSize = {\n x: 100,\n y: 100,\n };\n\n this._maxSize = {\n x: Infinity,\n y: Infinity,\n };\n\n this._scroll = {\n x: 0,\n y: 0,\n };\n\n this._scrollable = {\n x: true,\n y: true,\n };\n\n this._overflowVisible = false;\n this._moveable = true;\n this._closeable = true;\n this._resizeVisible = true;\n this._isVisible = false;\n\n this._events = {};\n\n this.__init();\n}", "title": "" }, { "docid": "626ba9b80dd9d42570a808b5b5889dcb", "score": "0.61806124", "text": "getPanel(id) {\n return this.getComposite(id);\n }", "title": "" }, { "docid": "1b1880ed1b90ea2116696953ebb023cc", "score": "0.6144985", "text": "function render_panel() {\n if (shouldAbortRender()) {\n return;\n }\n\n var panel = scope.panel;\n var stack = panel.stack ? true : null;\n\n // Populate element\n var options = {\n hooks: { draw: [updateLegendValues] },\n legend: { show: false },\n series: {\n stackpercent: panel.stack ? panel.percentage : false,\n stack: panel.percentage ? null : stack,\n lines: {\n show: panel.lines,\n zero: false,\n fill: translateFillOption(panel.fill),\n lineWidth: panel.linewidth,\n steps: panel.steppedLine\n },\n bars: {\n show: panel.bars,\n fill: 1,\n barWidth: 1,\n zero: false,\n lineWidth: 0\n },\n points: {\n show: panel.points,\n fill: 1,\n fillColor: false,\n radius: panel.points ? panel.pointradius : 2\n // little points when highlight points\n },\n shadowSize: 1\n },\n yaxes: [],\n xaxis: {},\n grid: {\n minBorderMargin: 0,\n markings: [],\n backgroundColor: null,\n borderWidth: 0,\n hoverable: true,\n color: '#c8c8c8'\n },\n selection: {\n mode: \"x\",\n color: '#666'\n },\n crosshair: {\n mode: panel.tooltip.shared || dashboard.sharedCrosshair ? \"x\" : null\n }\n };\n\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n series.applySeriesOverrides(panel.seriesOverrides);\n series.data = series.getFlotPairs(panel.nullPointMode, panel.y_formats);\n\n // if hidden remove points and disable stack\n if (scope.hiddenSeries[series.alias]) {\n series.data = [];\n series.stack = false;\n }\n }\n\n if (data.length && data[0].stats.timeStep) {\n options.series.bars.barWidth = data[0].stats.timeStep / 1.5;\n }\n\n addTimeAxis(options);\n addGridThresholds(options, panel);\n addAnnotations(options);\n configureAxisOptions(data, options);\n\n sortedSeries = _.sortBy(data, function(series) { return series.zindex; });\n\n function callPlot() {\n try {\n $.plot(elem, sortedSeries, options);\n } catch (e) {\n console.log('flotcharts error', e);\n }\n\n addAxisLabels();\n }\n\n if (shouldDelayDraw(panel)) {\n // temp fix for legends on the side, need to render twice to get dimensions right\n callPlot();\n setTimeout(callPlot, 50);\n legendSideLastValue = panel.legend.rightSide;\n }\n else {\n callPlot();\n }\n }", "title": "" }, { "docid": "85a42ec01c27a0b195f6295c2edc3fbf", "score": "0.61300236", "text": "function handlePanelClick(event) {\n showPanel(event.CurrentTarget);\n }", "title": "" }, { "docid": "05a5f85e52cc966c01e85c9d91d81f35", "score": "0.61209697", "text": "function StackPanel( par, orientation ) {\n\n}", "title": "" }, { "docid": "d4a6a38a51fad31724351fe36254cef0", "score": "0.6103862", "text": "function PanelElement(vehicleState) {\r\n this.layer = 0;\r\n}", "title": "" }, { "docid": "bf4f5ca4d9a3b21652097469b489a0b3", "score": "0.6092036", "text": "displayPanels() {\n // first, remove the clicked button\n SnipButton.destroy();\n\n this.hidePanels();\n\n // get the selection and its text\n let selection = this.getSelection();\n let selectionText = this.getSelectionText( selection );\n\n // temporary save the selected text\n if (selectionText) {\n this.tempSelectedText = selectionText;\n }\n // restore temporary saved selected text\n else if (this.tempSelectedText) {\n selectionText = this.tempSelectedText;\n }\n\n if (this.isUserLoggedIn) {\n if (selectionText) {\n // show a panel that will handle the selected text\n this.isPanelOpen = true;\n PanelShade.show();\n PanelSave.show(selectionText);\n\n // clear temporary selected text\n this.tempSelectedText = null\n }\n }\n else {\n this.isPanelOpen = true;\n PanelShade.show();\n PanelLogin.show();\n }\n }", "title": "" }, { "docid": "8d32b995c7adec76a7d35419d7bf0376", "score": "0.6089817", "text": "function openPanels(){\r\n\t// XXX\r\n}", "title": "" }, { "docid": "b05a060da0d83d9c679a94f475207645", "score": "0.6089745", "text": "function togglePanel(targetElement) {\n\n}", "title": "" }, { "docid": "fe1a3b579f03fc48f50130a4e43233c5", "score": "0.60601985", "text": "function PanelCollection(postfix) {\n this.buttonBar = doc.getElementById(\"wmd-button-bar\" + postfix);\n this.preview = doc.getElementById(\"wmd-preview\" + postfix);\n this.input = doc.getElementById(\"wmd-input\" + postfix);\n }", "title": "" }, { "docid": "68263cb9047f618a5e94f5e0d1a4b953", "score": "0.60477823", "text": "function render_panel() {\n var plot, chartData;\n\n // IE doesn't work without this\n elem.css({height:scope.panel.height||scope.row.height});\n\n // Make a clone we can operate on.\n chartData = _.clone(scope.data);\n chartData = scope.panel.missing ? chartData : \n _.without(chartData,_.findWhere(chartData,{meta:'missing'}));\n chartData = scope.panel.other ? chartData : \n _.without(chartData,_.findWhere(chartData,{meta:'other'}));\n\n // Populate element.\n require(['jquery.flot.pie'], function(){\n // Populate element\n try {\n // Add plot to scope so we can build out own legend \n if(scope.panel.chart === 'bar') {\n plot = $.plot(elem, chartData, {\n legend: { show: false },\n series: {\n lines: { show: false, },\n bars: { show: true, fill: 1, barWidth: 0.8, horizontal: false },\n shadowSize: 1\n },\n yaxis: { show: true, min: 0, color: \"#c8c8c8\" },\n xaxis: { show: false },\n grid: {\n borderWidth: 0,\n borderColor: '#eee',\n color: \"#eee\",\n hoverable: true,\n clickable: true\n },\n colors: querySrv.colors\n });\n }\n if(scope.panel.chart === 'pie') {\n var labelFormat = function(label, series){\n return '<div style=\"font-size:8pt;text-align:center;padding:2px;color:white;\">'+\n label+'<br/>'+Math.round(series.percent)+'%</div>';\n };\n\n plot = $.plot(elem, chartData, {\n legend: { show: false },\n series: {\n pie: {\n innerRadius: scope.panel.donut ? 0.4 : 0,\n tilt: scope.panel.tilt ? 0.45 : 1,\n radius: 1,\n show: true,\n combine: {\n color: '#999',\n label: 'The Rest'\n },\n stroke: {\n width: 0\n },\n label: { \n show: scope.panel.labels,\n radius: 2/3,\n formatter: labelFormat,\n threshold: 0.1 \n }\n }\n },\n //grid: { hoverable: true, clickable: true },\n grid: { hoverable: true, clickable: true },\n colors: querySrv.colors\n });\n }\n\n // Populate legend\n if(elem.is(\":visible\")){\n //scripts.wait(function(){\n scope.legend = plot.getData();\n if(!scope.$$phase) {\n scope.$apply();\n }\n //});\n }\n } catch(e) {\n elem.text(e);\n }\n });\n }", "title": "" }, { "docid": "ae386d6cc3d4c3689ca8e8450b76b271", "score": "0.6045358", "text": "function UIPanel (x,y,width,height)\r\n{\r\n\tUIElement.call(this,x,y,width,height,\"panel\");\r\n}", "title": "" }, { "docid": "b4e7c63bb0b4bf66b9452f6c4a354faa", "score": "0.6031711", "text": "registerPanel(descriptor) {\n super.registerComposite(descriptor);\n }", "title": "" }, { "docid": "958903930a08b8683e6fa72d31e1526b", "score": "0.6017567", "text": "function handlePanelClick(event){\n showPanel(event.currentTarget);\n }", "title": "" }, { "docid": "68f87ef15665505068c79cbdf0e7c1e3", "score": "0.6007943", "text": "function drawPanel(px, py, pw, ph, panelColor) {\r\n var panel = new zebra.ui.Panel();\r\n panel.setBounds(px, py, pw, ph);\r\n panel.setBackground(panelColor);\r\n\r\n return panel;\r\n\r\n}", "title": "" }, { "docid": "fac3f83b65c5861744962334c4dae571", "score": "0.59920394", "text": "_initMainPanel(){\n var that = this;\n\n // compass toggle\n this._mainPanel.addBoolean(\"Compass\", 1, function(mustShow){\n that._quadScene.getOrientationHelper().setVisibility( mustShow );\n });\n\n // bounding box toggle\n this._mainPanel.addBoolean(\"Bounding box\", 1, function(mustShow){\n that._quadScene.getBoundingBoxHelper().setVisibility( mustShow );\n });\n document.getElementById(\"Bounding box\").parentElement.parentElement.style[\"margin-top\"] = \"0px\";\n\n // Lo-rez plane view toggle\n this._mainPanel.addBoolean(\"Lo-res projection\", 1, function(mustShow){\n if(mustShow){\n that._planeManager.disableLayerHiRez(1);\n that._planeManager.showLowRezPlane();\n }else{\n that._planeManager.enableLayerHiRez(1);\n that._planeManager.hideLowRezPlane();\n }\n\n });\n document.getElementById(\"Lo-res projection\").parentElement.parentElement.style[\"margin-top\"] = \"0px\";\n\n // rez lvl slider\n this._mainPanel.addRange(\"Zoom level\", 0, 6, 0, 1,\n // on change\n function( value ){\n value = Math.floor( value );\n that._updateResolutionDescription(\n value,\n that._quadScene.getLevelManager().getLevelInfo(that._resolutionLevel, \"key\") + \" ➤ \"\n );\n },\n // on finish\n function( value ){\n value = Math.floor( value );\n that._resolutionLevel = value;\n that._quadScene.setResolutionLevel( value );\n\n }\n );\n\n // resolution info\n this._mainPanel.addText(\"Resolution\", \"\");\n this._mainPanel.overrideStyle(\"Resolution\", \"background-color\", \"transparent\");\n document.getElementById('Resolution').readOnly = true;\n document.getElementById(\"Resolution\").parentElement.style[\"margin-top\"] = \"0px\";\n\n // multiplane position (unit x, y, z)\n this._mainPanel.addText(\"Position\", \"\", function(){} );\n this._mainPanel.overrideStyle(\"Position\", \"text-align\", \"center\");\n // when pressing ENTER on this field\n document.getElementById(\"Position\").addEventListener(\"keypress\", function( e ){\n if (e.keyCode == 13) {\n var newPosition = that._mainPanel.getValue(\"Position\")\n .split(',')\n .map(function(elem){return parseFloat(elem)});\n\n that._quadScene.setMultiplanePosition(newPosition[0], newPosition[1], newPosition[2]);\n }\n });\n\n // mutiplane position voxel (to match A3D slices index)\n this._mainPanel.addText(\"Position voxel\", \"\", function(){} );\n this._mainPanel.overrideStyle(\"Position voxel\", \"text-align\", \"center\");\n document.getElementById(\"Position voxel\").parentElement.style[\"margin-top\"] = \"0px\";\n // on pressing ENTER on this field\n document.getElementById(\"Position voxel\").addEventListener(\"keypress\", function( e ){\n if (e.keyCode == 13) {\n var axisInfo = that._axisInfo;\n\n var newPositionVoxel = that._mainPanel.getValue(\"Position voxel\")\n .split(',')\n .map(function(elem){return parseFloat(elem)});\n\n var positionUnitX = newPositionVoxel[0] / axisInfo.x.originalSize;\n if(axisInfo.x.reversed){\n positionUnitX = 1 - positionUnitX;\n }\n positionUnitX = positionUnitX * (axisInfo.x.originalSize / axisInfo.x.finalSize) + (axisInfo.x.offset / axisInfo.x.finalSize);\n\n var positionUnitY = newPositionVoxel[1] / axisInfo.y.originalSize;\n if(axisInfo.y.reversed){\n positionUnitY = 1 - positionUnitY;\n }\n positionUnitY = positionUnitY * (axisInfo.y.originalSize / axisInfo.y.finalSize) + (axisInfo.y.offset / axisInfo.y.finalSize);\n\n var positionUnitZ = newPositionVoxel[2] / axisInfo.z.originalSize;\n if(axisInfo.z.reversed){\n positionUnitZ = 1 - positionUnitZ;\n }\n positionUnitZ = positionUnitZ * (axisInfo.z.originalSize / axisInfo.z.finalSize) + (axisInfo.z.offset / axisInfo.z.finalSize);\n\n that._quadScene.setMultiplanePosition(positionUnitX, positionUnitY, positionUnitZ);\n }\n });\n\n\n // multiplane rotation\n this._mainPanel.addText(\"Rotation\", \"\", function(){} );\n this._mainPanel.overrideStyle(\"Rotation\", \"margin-top\", \"0px\");\n this._mainPanel.overrideStyle(\"Rotation\", \"text-align\", \"center\");\n document.getElementById(\"Rotation\").parentElement.style[\"margin-top\"] = \"0px\";\n\n // when pressing ENTER on this field\n document.getElementById(\"Rotation\").addEventListener(\"keypress\", function( e ){\n if (e.keyCode == 13) {\n var newRotation = that._mainPanel.getValue(\"Rotation\")\n .split(',')\n .map(function(elem){return parseFloat(elem)});\n\n that._quadScene.setMultiplaneRotation(newRotation[0], newRotation[1], newRotation[2]);\n }\n });\n\n // Button reset rotation\n this._mainPanel.addButton(\"Reset rotation\", function(){\n that._quadScene.setMultiplaneRotation(0, 0, 0);\n\n });\n this._mainPanel.overrideStyle(\"Reset rotation\", \"width\", \"100%\");\n document.getElementById(\"Reset rotation\").parentElement.style[\"margin-top\"] = \"0px\";\n\n }", "title": "" }, { "docid": "50c6d6d1cdccc2a3d870bcdab6f8c3c8", "score": "0.59920394", "text": "_initMainPanel(){\n var that = this;\n\n // compass toggle\n this._mainPanel.addBoolean(\"Compass\", 1, function(mustShow){\n that._quadScene.getOrientationHelper().setVisibility( mustShow );\n });\n\n // bounding box toggle\n this._mainPanel.addBoolean(\"Bounding box\", 1, function(mustShow){\n that._quadScene.getBoundingBoxHelper().setVisibility( mustShow );\n });\n document.getElementById(\"Bounding box\").parentElement.parentElement.style[\"margin-top\"] = \"0px\";\n\n // Lo-rez plane view toggle\n this._mainPanel.addBoolean(\"Lo-res projection\", 1, function(mustShow){\n if(mustShow){\n that._planeManager.disableLayerHiRez(1);\n that._planeManager.showLowRezPlane();\n }else{\n that._planeManager.enableLayerHiRez(1);\n that._planeManager.hideLowRezPlane();\n }\n\n });\n document.getElementById(\"Lo-res projection\").parentElement.parentElement.style[\"margin-top\"] = \"0px\";\n\n // rez lvl slider\n this._mainPanel.addRange(\"Zoom level\", 0, 6, 0, 1,\n // on change\n function( value ){\n value = Math.floor( value );\n that._updateResolutionDescription(\n value,\n that._quadScene.getLevelManager().getLevelInfo(that._resolutionLevel, \"key\") + \" ➤ \"\n );\n },\n // on finish\n function( value ){\n value = Math.floor( value );\n that._resolutionLevel = value;\n that._quadScene.setResolutionLevel( value );\n\n }\n );\n\n // resolution info\n this._mainPanel.addText(\"Resolution\", \"\");\n this._mainPanel.overrideStyle(\"Resolution\", \"background-color\", \"transparent\");\n document.getElementById('Resolution').readOnly = true;\n document.getElementById(\"Resolution\").parentElement.style[\"margin-top\"] = \"0px\";\n\n // multiplane position (unit x, y, z)\n this._mainPanel.addText(\"Position\", \"\", function(){} );\n this._mainPanel.overrideStyle(\"Position\", \"text-align\", \"center\");\n // when pressing ENTER on this field\n document.getElementById(\"Position\").addEventListener(\"keypress\", function( e ){\n if (e.keyCode == 13) {\n var newPosition = that._mainPanel.getValue(\"Position\")\n .split(',')\n .map(function(elem){return parseFloat(elem)});\n\n that._quadScene.setMultiplanePosition(newPosition[0], newPosition[1], newPosition[2]);\n }\n });\n\n // mutiplane position voxel (to match A3D slices index)\n this._mainPanel.addText(\"Position voxel\", \"\", function(){} );\n this._mainPanel.overrideStyle(\"Position voxel\", \"text-align\", \"center\");\n document.getElementById(\"Position voxel\").parentElement.style[\"margin-top\"] = \"0px\";\n // on pressing ENTER on this field\n document.getElementById(\"Position voxel\").addEventListener(\"keypress\", function( e ){\n if (e.keyCode == 13) {\n var axisInfo = that._axisInfo;\n\n var newPositionVoxel = that._mainPanel.getValue(\"Position voxel\")\n .split(',')\n .map(function(elem){return parseFloat(elem)});\n\n var positionUnitX = newPositionVoxel[0] / axisInfo.x.originalSize\n if(axisInfo.x.reversed){\n positionUnitX = 1 - positionUnitX;\n }\n positionUnitX = positionUnitX * (axisInfo.x.originalSize / axisInfo.x.finalSize) + (axisInfo.x.offset / axisInfo.x.finalSize)\n\n var positionUnitY = newPositionVoxel[1] / axisInfo.y.originalSize\n if(axisInfo.y.reversed){\n positionUnitY = 1 - positionUnitY;\n }\n positionUnitY = positionUnitY * (axisInfo.y.originalSize / axisInfo.y.finalSize) + (axisInfo.y.offset / axisInfo.y.finalSize)\n\n var positionUnitZ = newPositionVoxel[2] / axisInfo.z.originalSize\n if(axisInfo.z.reversed){\n positionUnitZ = 1 - positionUnitZ;\n }\n positionUnitZ = positionUnitZ * (axisInfo.z.originalSize / axisInfo.z.finalSize) + (axisInfo.z.offset / axisInfo.z.finalSize)\n\n that._quadScene.setMultiplanePosition(positionUnitX, positionUnitY, positionUnitZ);\n }\n });\n\n\n // multiplane rotation\n this._mainPanel.addText(\"Rotation\", \"\", function(){} );\n this._mainPanel.overrideStyle(\"Rotation\", \"margin-top\", \"0px\");\n this._mainPanel.overrideStyle(\"Rotation\", \"text-align\", \"center\");\n document.getElementById(\"Rotation\").parentElement.style[\"margin-top\"] = \"0px\";\n\n // when pressing ENTER on this field\n document.getElementById(\"Rotation\").addEventListener(\"keypress\", function( e ){\n if (e.keyCode == 13) {\n var newRotation = that._mainPanel.getValue(\"Rotation\")\n .split(',')\n .map(function(elem){return parseFloat(elem)});\n\n that._quadScene.setMultiplaneRotation(newRotation[0], newRotation[1], newRotation[2]);\n }\n });\n\n // Button reset rotation\n this._mainPanel.addButton(\"Reset rotation\", function(){\n that._quadScene.setMultiplaneRotation(0, 0, 0);\n\n });\n this._mainPanel.overrideStyle(\"Reset rotation\", \"width\", \"100%\");\n document.getElementById(\"Reset rotation\").parentElement.style[\"margin-top\"] = \"0px\";\n\n }", "title": "" }, { "docid": "d9be45b6cda83145d9d31abacc79a35c", "score": "0.59814703", "text": "function handlePanelClick(event){\n showPanel(event.currentTarget);\n }", "title": "" }, { "docid": "51bee516896d06ae80051d3f0fb41390", "score": "0.5961181", "text": "get classList() { return this.panelClass; }", "title": "" }, { "docid": "50100c4c2021586372a1164dd5f1a791", "score": "0.59576863", "text": "function SelectionPanel(/** name of SelectionPanel */name,/** an array of SelectionGroups */groups){if(groups===void 0){groups=[];}var _this=_super.call(this,name)||this;_this.name=name;_this.groups=groups;_this._buttonColor=\"#364249\";_this._buttonBackground=\"#CCCCCC\";_this._headerColor=\"black\";_this._barColor=\"white\";_this._barHeight=\"2px\";_this._spacerHeight=\"20px\";_this._bars=new Array();_this._groups=groups;_this.thickness=2;_this._panel=new _stackPanel__WEBPACK_IMPORTED_MODULE_2__[\"StackPanel\"]();_this._panel.verticalAlignment=_control__WEBPACK_IMPORTED_MODULE_3__[\"Control\"].VERTICAL_ALIGNMENT_TOP;_this._panel.horizontalAlignment=_control__WEBPACK_IMPORTED_MODULE_3__[\"Control\"].HORIZONTAL_ALIGNMENT_LEFT;_this._panel.top=5;_this._panel.left=5;_this._panel.width=0.95;if(groups.length>0){for(var i=0;i<groups.length-1;i++){_this._panel.addControl(groups[i].groupPanel);_this._addSpacer();}_this._panel.addControl(groups[groups.length-1].groupPanel);}_this.addControl(_this._panel);return _this;}", "title": "" }, { "docid": "eabd7b4695b6958b405f0e1556763df9", "score": "0.59534115", "text": "function updatePanelInfo(p) {\n\tdocument.getElementById(\"numPanels\").innerHTML = \"Panels: \" + numPanels;\n\tdocument.getElementById(\"azimuth\").innerHTML = \"Azimuth: \"\n\t\t\t+ p.azimuth % 360 + \"&deg\";\n\tdocument.getElementById(\"tilt\").innerHTML = \"Tilt: \"\n\t\t\t+ p.tilt + \"&deg\";\n}", "title": "" }, { "docid": "38f56eeb5711fbd141f2846cf2e197e2", "score": "0.5936648", "text": "function panelClick(e) {\n\n this.classList.add(\"open\");\n panels.forEach(panel => { if(panel !== this) panel.classList.remove(\"open\") })\n}", "title": "" }, { "docid": "0f3669fd41312a0b9925a45c9537a47c", "score": "0.59185994", "text": "function init(_panel) {\n // * * * * * *\n var panel = (_panel instanceof Panel) ? _panel : new Window(\"palette\", \"AEToolbox 1.3.1\",[0,0,170,300]);\n // * * * * * *\n if (panel !== null) {\n // 1-5. Draw buttons\n //-----------------------------------------------------\n // buttons coordinates are X start, Y start, X end, Y end\n var butYoffset = 10;\n var butYoffsetCap = 4;\n //--\n var butXstart = 8;\n var butXend = 149;\n var butYstart = 15 + butYoffset;\n var butYend = 43 + butYoffset;\n var butYinc = 30;\n //--\n var colXstart = 4;\n var colXend = 165;\n var colYstart = 4 + butYoffset;\n var colYendBase = 33;\n var colXinc = 170;\n\n // Basic group\n var col0butCount = 8;\n panel.basicGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col0butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.basicGroup0 = panel.basicGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"Nulls for Pins\");\n panel.basicGroup1 = panel.basicGroup.add(\"button\", [butXstart,butYstart+(butYinc*1),butXend,butYend+(butYinc*1)], \"Parent Chain\");\n panel.basicGroup2 = panel.basicGroup.add(\"button\", [butXstart,butYstart+(butYinc*2),butXend,butYend+(butYinc*2)], \"Locator Null\");\n panel.basicGroup3 = panel.basicGroup.add(\"button\", [butXstart,butYstart+(butYinc*3),butXend,butYend+(butYinc*3)], \"Move to Position\");\n panel.basicGroup4 = panel.basicGroup.add(\"button\", [butXstart,butYstart+(butYinc*4),butXend,butYend+(butYinc*4)], \"Make Loop\");\n panel.basicGroup5 = panel.basicGroup.add(\"button\", [butXstart,butYstart+(butYinc*5),butXend,butYend+(butYinc*5)], \"Random Position\");\n panel.basicGroup6 = panel.basicGroup.add(\"button\", [butXstart,butYstart+(butYinc*6),butXend,butYend+(butYinc*6)], \"Graph Audio\");\n panel.basicGroup7 = panel.basicGroup.add(\"button\", [butXstart,butYstart+(butYinc*7),butXend,butYend+(butYinc*7)], \"Isolate Color\");\n \n // Advanced group\n var col1butCount = 6;\n panel.advGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col1butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.advGroup0 = panel.advGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"Bake Keyframes\");\n panel.advGroup1 = panel.advGroup.add(\"button\", [butXstart,butYstart+(butYinc*1),butXend,butYend+(butYinc*1)], \"Lock Y Rotation\");\n panel.advGroup2 = panel.advGroup.add(\"button\", [butXstart,butYstart+(butYinc*2),butXend,butYend+(butYinc*2)], \"Auto Z Rotation\");\n panel.advGroup3 = panel.advGroup.add(\"button\", [butXstart,butYstart+(butYinc*3),butXend,butYend+(butYinc*3)], \"Parentable Null\");\n panel.advGroup4 = panel.advGroup.add(\"button\", [butXstart,butYstart+(butYinc*4),butXend,butYend+(butYinc*4)], \"Sine Generator\");\n panel.advGroup5 = panel.advGroup.add(\"button\", [butXstart,butYstart+(butYinc*5),butXend,butYend+(butYinc*5)], \"Crossfade\");\n \n // Rigging group\n var col2butCount = 7;\n panel.rigGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col2butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.rigGroup0 = panel.rigGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"Blink Rig\");\n panel.rigGroup1 = panel.rigGroup.add(\"button\", [butXstart,butYstart+(butYinc*1),butXend,butYend+(butYinc*1)], \"Jaw Rig\");\n panel.rigGroup2 = panel.rigGroup.add(\"button\", [butXstart,butYstart+(butYinc*2),butXend,butYend+(butYinc*2)], \"Snake Rig\");\n panel.rigGroup3 = panel.rigGroup.add(\"button\", [butXstart,butYstart+(butYinc*3),butXend,butYend+(butYinc*3)], \"Beam Rig\");\n panel.rigGroup4 = panel.rigGroup.add(\"button\", [butXstart,butYstart+(butYinc*4),butXend,butYend+(butYinc*4)], \"Camera Rig\");\n panel.rigGroup5 = panel.rigGroup.add(\"button\", [butXstart,butYstart+(butYinc*5),butXend,butYend+(butYinc*5)], \"MoSketch Rig\");\n panel.rigGroup6 = panel.rigGroup.add(\"button\", [butXstart,butYstart+(butYinc*6),butXend,butYend+(butYinc*6)], \"Photo Rig\");\n \n // Depth group\n var col3butCount = 7;\n panel.depthGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col3butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.depthGroup0 = panel.depthGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"Split s3D Pair\");\n panel.depthGroup1 = panel.depthGroup.add(\"button\", [butXstart,butYstart+(butYinc*1),butXend,butYend+(butYinc*1)], \"Merge s3D Pair\");\n panel.depthGroup2 = panel.depthGroup.add(\"button\", [butXstart,butYstart+(butYinc*2),butXend,butYend+(butYinc*2)], \"s3D Dispmap\");\n panel.depthGroup3 = panel.depthGroup.add(\"button\", [butXstart,butYstart+(butYinc*3),butXend,butYend+(butYinc*3)], \"Depth Fill\");\n panel.depthGroup4 = panel.depthGroup.add(\"button\", [butXstart,butYstart+(butYinc*4),butXend,butYend+(butYinc*4)], \"Depth Sort\");\n panel.depthGroup5 = panel.depthGroup.add(\"button\", [butXstart,butYstart+(butYinc*5),butXend,butYend+(butYinc*5)], \"Stereo Controller\");\n panel.depthGroup6 = panel.depthGroup.add(\"button\", [butXstart,butYstart+(butYinc*6),butXend,butYend+(butYinc*6)], \"Gray to RGB\");\n \n // Picture-in-picture / Reformatting group\n var col4butCount = 5;\n panel.pipGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col4butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.pipGroup0 = panel.pipGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"Vive Recording\");\n panel.pipGroup1 = panel.pipGroup.add(\"button\", [butXstart,butYstart+(butYinc*1),butXend,butYend+(butYinc*1)], \"Holoflix\");\n panel.pipGroup2 = panel.pipGroup.add(\"button\", [butXstart,butYstart+(butYinc*2),butXend,butYend+(butYinc*2)], \"RGBD Toolkit\");\n panel.pipGroup3 = panel.pipGroup.add(\"button\", [butXstart,butYstart+(butYinc*3),butXend,butYend+(butYinc*3)], \"InstaGrid\");\n panel.pipGroup4 = panel.pipGroup.add(\"button\", [butXstart,butYstart+(butYinc*4),butXend,butYend+(butYinc*4)], \"4K Stereo 360\");\n\n // Image Effect group\n var col5butCount = 3;\n panel.imageGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col5butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.imageGroup0 = panel.imageGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"Soften 1\");\n panel.imageGroup1 = panel.imageGroup.add(\"button\", [butXstart,butYstart+(butYinc*1),butXend,butYend+(butYinc*1)], \"Soften 2\");\n panel.imageGroup2 = panel.imageGroup.add(\"button\", [butXstart,butYstart+(butYinc*2),butXend,butYend+(butYinc*2)], \"High Pass\");\n\n // Guide group\n var col6butCount = 2;\n panel.guideGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col6butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.guideGroup0 = panel.guideGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"Onion Skin\");\n panel.guideGroup1 = panel.guideGroup.add(\"button\", [butXstart,butYstart+(butYinc*1),butXend,butYend+(butYinc*1)], \"Skeleton View\");\n \n // Export group\n var col7butCount = 4;\n panel.exportGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col7butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.exportGroup0 = panel.exportGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"Camera to Maya\");\n panel.exportGroup1 = panel.exportGroup.add(\"button\", [butXstart,butYstart+(butYinc*1),butXend,butYend+(butYinc*1)], \"Unity Anim\");\n panel.exportGroup2 = panel.exportGroup.add(\"button\", [butXstart,butYstart+(butYinc*2),butXend,butYend+(butYinc*2)], \"JSON Export Test\");\n panel.exportGroup3 = panel.exportGroup.add(\"button\", [butXstart,butYstart+(butYinc*3),butXend,butYend+(butYinc*3)], \"XML Export Test\");\n\n // Import group\n var col8butCount = 1;\n panel.importGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col8butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.importGroup0 = panel.importGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"GML to Position\");\n\n // Plugin group\n var col9butCount = 3;\n panel.pluginGroup = panel.add(\"panel\", [colXstart, colYstart, colXend, colYendBase+(col9butCount*butYinc)+butYoffset+butYoffsetCap], \"\", {borderStyle: \"etched\"});\n panel.pluginGroup0 = panel.pluginGroup.add(\"button\", [butXstart,butYstart+(butYinc*0),butXend,butYend+(butYinc*0)], \"RSMB Twos\");\n panel.pluginGroup1 = panel.pluginGroup.add(\"button\", [butXstart,butYstart+(butYinc*1),butXend,butYend+(butYinc*1)], \"Particular Rig\");\n panel.pluginGroup2 = panel.pluginGroup.add(\"button\", [butXstart,butYstart+(butYinc*2),butXend,butYend+(butYinc*2)], \"Freeform Pro Rig\");\n\n // 2-5. Link buttons to functions\n //-----------------------------------------------------\n panel.basicGroup0.onClick = nullsForPins;\n panel.basicGroup1.onClick = parentChain;\n panel.basicGroup2.onClick = locatorNull;\n panel.basicGroup3.onClick = moveToPos;\n panel.basicGroup4.onClick = makeLoop;\n panel.basicGroup5.onClick = randomPos;\n panel.basicGroup6.onClick = graphAudio;\n panel.basicGroup7.onClick = isolateColor;\n //--\n panel.advGroup0.onClick = bakePinKeyframes;\n panel.advGroup1.onClick = lockRotation;\n panel.advGroup2.onClick = autoOrientZ;\n panel.advGroup3.onClick = parentableNull;\n panel.advGroup4.onClick = sineWave;\n panel.advGroup5.onClick = crossfader;\n //--\n panel.rigGroup0.onClick = charBlink;\n panel.rigGroup1.onClick = charJaw;\n panel.rigGroup2.onClick = charSnake;\n panel.rigGroup3.onClick = charBeam;\n panel.rigGroup4.onClick = handheldCamera;\n panel.rigGroup5.onClick = threeDmoSketch;\n panel.rigGroup6.onClick = photoRig;\n //--\n panel.depthGroup0.onClick = splitStereoPair;\n panel.depthGroup1.onClick = mergeStereoPair;\n panel.depthGroup2.onClick = stereoDispMap;\n panel.depthGroup3.onClick = depthFill;\n panel.depthGroup4.onClick = depthSort;\n panel.depthGroup5.onClick = stereoController;\n panel.depthGroup6.onClick = doRgbToGray;\n //--\n panel.imageGroup0.onClick = softLayeredImage1;\n panel.imageGroup1.onClick = softLayeredImage2;\n panel.imageGroup2.onClick = highPass;\n //--\n panel.pipGroup0.onClick = viveRecording;\n panel.pipGroup1.onClick = holoflix720p;\n panel.pipGroup2.onClick = rgbdtk;\n panel.pipGroup3.onClick = instaGrid;\n panel.pipGroup4.onClick = stereo360;\n //--\n panel.guideGroup0.onClick = onionSkin;\n panel.guideGroup1.onClick = skeleView;\n //--\n panel.exportGroup0.onClick = cameraToMaya;\n panel.exportGroup1.onClick = unityAnim;\n panel.exportGroup2.onClick = jsonExport;\n panel.exportGroup3.onClick = xmlExport;\n //--\n panel.importGroup0.onClick = gmlToPos;\n //--\n panel.pluginGroup0.onClick = rsmbTwos;\n panel.pluginGroup1.onClick = charParticle;\n panel.pluginGroup2.onClick = freeformRig;\n // 3-5. Tooltips\n //-----------------------------------------------------\n panel.basicGroup0.helpTip = \"Creates a controller null for each puppet pin on a layer.\"; //nullsForPins;\n panel.basicGroup1.helpTip = \"Parent a chain of layers one to another.\"; //parentChain;\n panel.basicGroup2.helpTip = \"Creates a new null at the location of each selected layer.\"; //locatorNull;\n panel.basicGroup3.helpTip = \"Moves all layers to the location of the last selected layer.\"; //moveToPos;\n panel.basicGroup4.helpTip = \"Puts a cycle expression on Time Remap.\"; //makeLoop;\n panel.basicGroup5.helpTip = \"Randomizes a layer's position.\"; //randomPos;\n panel.basicGroup6.helpTip = \"Converts audio to keyframes and enables the graph view.\"; //graphAudio;\n panel.basicGroup7.helpTip = \"Keys out everything but selected color.\"; //isolateColor;\n //--\n panel.advGroup0.helpTip = \"Bakes expressions and puppet pins to keyframes.\"; //bakePinKeyframes;\n panel.advGroup1.helpTip = \"Forces a layer to always face the camera.\"; //lockRotation;\n panel.advGroup2.helpTip = \"Smart 2D auto-rotation.\"; //autoOrientZ;\n panel.advGroup3.helpTip = \"Creates a null with expressions that solve certain parenting problems.\"; //parentableNull;\n panel.advGroup4.helpTip = \"Applies sine-wave motion controls to a layer.\"; //sineWave;\n panel.advGroup5.helpTip = \"Fades a layer into a duplicate of itself for a seamless loop.\"; //crossfader;\n //-- \n panel.rigGroup0.helpTip = \"Turns a blink layer inside the comp on and off.\"; //charBlink;\n panel.rigGroup1.helpTip = \"Rigs a jaw layer inside the comp for audio control.\"; //charJaw;\n panel.rigGroup2.helpTip = \"Rigs a puppet-pin layer for automated snake-like movement.\"; //charSnake;\n panel.rigGroup3.helpTip = \"Creates a 3D laser effect with start and end nulls.\"; //charBeam;\n panel.rigGroup4.helpTip = \"Creates a camera rigged for point-of-interest and DoF control.\"; //handheldCamera;\n panel.rigGroup5.helpTip = \"Creates a null with 3D controls for use with Motion Sketch.\"; //threeDmoSketch;\n panel.rigGroup6.helpTip = \"Creates precomps that each display one frame from a sequence.\"; //photoRig;\n //--\n panel.depthGroup0.helpTip = \"Splits a stereo 3D pair video into two left and right comps.\"; //splitStereoPair;\n panel.depthGroup1.helpTip = \"Merges two left and right comps into a stereo 3D pair comp.\"; //mergeStereoPair;\n panel.depthGroup2.helpTip = \"Creates an s3D pair from the first layer, using the second layer for displacement.\"; //stereoDispMap;\n panel.depthGroup3.helpTip = \"Creates a grayscale depth fill based on distance to camera.\"; //stereoDispMap;\n panel.depthGroup4.helpTip = \"Sorts layer order by depth.\"; //depthSort;\n panel.depthGroup5.helpTip = \"Creates a stereo controller null for a single camera.\"; //stereoController;\n panel.depthGroup6.helpTip = \"Converts between rgb and grayscale depth maps.\"; //doRgbToGray;\n //--\n panel.pipGroup0.helpTip = \"Splits a quad Vive recording into separate layers.\" //viveRecording;\n panel.pipGroup1.helpTip = \"Splits a Holoflix clip into RGB and depth comps.\" //holoflix720p;\n panel.pipGroup2.helpTip = \"Splits an RGBD Toolkit clip into RGB and depth comps.\" //rgbdtk;\n panel.pipGroup3.helpTip = \"Turns six Instagram clips into a 3 x 2 HD grid.\" //instaGrid;\n panel.pipGroup4.helpTip = \"Creates a 4K OU 360 stereo comp.\" //stereo360;\n //--\n panel.imageGroup0.helpTip = \"Duplicates layers with composite modes and blur, v1.\"; //softLayeredImage;\n panel.imageGroup1.helpTip = \"Duplicates layers with composite modes and blur, v2.\"; //softLayeredImage;\n panel.imageGroup2.helpTip = \"Creates a high pass layer.\"; //highPass;\n //--\n panel.guideGroup0.helpTip = \"Creates an adjustment layer that applies an onion skin effect.\"; //onionSkin;\n panel.guideGroup1.helpTip = \"View connections between parent and child layers.\"; //skeleView;\n //--\n panel.exportGroup0.helpTip = \"Export camera to Maya.\"; //cameraToMaya;\n panel.exportGroup1.helpTip = \"Export keyframes to Unity anim.\"; //unityAnim;\n panel.exportGroup2.helpTip = \"Export keyframes to JSON.\"; //jsonExport;\n panel.exportGroup3.helpTip = \"Export keyframes to XML.\"; //xmlExport;\n //--\n panel.importGroup0.helpTip = \"Import position keyframes from GML.\"; //gmlToPos;\n //--\n panel.pluginGroup0.helpTip = \"Reelsmart Motion Blur for animation on twos.\"; //rsmbTwos;\n panel.pluginGroup1.helpTip = \"Particular null controller for particles.\"; //charParticle;\n panel.pluginGroup2.helpTip = \"Freeform Pro rig for volumetric video.\"; //charParticle;\n\n // 4-5. Selector\n //-----------------------------------------------------\n var selector = panel.add(\"dropdownlist\",[colXstart, colYstart, colXend, colYendBase],[ \"Basic\", \"Advanced\", \"Rigging\", \"Depth\", \"Reformat\", \"Image\", \"Guide\", \"Export\", \"Import\", \"Plugins\" ]);\n\n selector.onChange = function() {\n panel.basicGroup.visible = false;\n panel.advGroup.visible = false;\n panel.rigGroup.visible = false;\n panel.depthGroup.visible = false;\n panel.pipGroup.visible = false;\n panel.imageGroup.visible = false;\n panel.guideGroup.visible = false;\n panel.exportGroup.visible = false; \n panel.importGroup.visible = false; \n panel.pluginGroup.visible = false; \n\n if (selector.selection == 0) { // Basic\n panel.basicGroup.visible = true;\n } else if (selector.selection == 1) { // Advanced\n panel.advGroup.visible = true;\n } else if (selector.selection == 2) { // Rigging\n panel.rigGroup.visible = true;\n } else if (selector.selection == 3) { // Depth\n panel.depthGroup.visible = true;\n } else if (selector.selection == 4) { // PiP\n panel.pipGroup.visible = true;\n } else if (selector.selection == 5) { // Image\n panel.imageGroup.visible = true;\n } else if (selector.selection == 6) { // Guide\n panel.guideGroup.visible = true;\n } else if (selector.selection == 7) { // Export\n panel.exportGroup.visible = true;\n } else if (selector.selection == 8) { // Import\n panel.importGroup.visible = true;\n } else if (selector.selection == 9) { // Plugins\n panel.pluginGroup.visible = true;\n } \n }\n\n selector.selection = 0;\n\n }\n return panel\n}", "title": "" }, { "docid": "178e9468a78ebd2df400cee64fe05ac0", "score": "0.5915269", "text": "addPanel(_p) {\n this.panels.push(_p);\n this.editorLayout.root.contentItems[0].addChild(_p.config);\n this.activePanel = _p;\n }", "title": "" }, { "docid": "92b6fb2c80030cd99b6faa82efdd09b6", "score": "0.5911604", "text": "openPanel() {\n if (!this.disabled) {\n this.panelOpen ? this.overlay.closePanel() : this.overlay.openPanel();\n }\n }", "title": "" }, { "docid": "d0316d8fada33147fbb10cb5ee8c8c7f", "score": "0.5890845", "text": "function strip_panel_styling() {\n Panel.add_style_class_name('panel-effect-transparency');\n}", "title": "" }, { "docid": "62099a1c1d23a02c7921ba1f10827aa1", "score": "0.5886811", "text": "function panelHelper( options ) {\n var self = this;\n var process = options.process;\n var chart = options.chart;\n var render = options.render;\n var targets = options.targets;\n var dataset_id = options.dataset_id || options.chart.get( 'dataset_id' );\n var dataset_groups = options.dataset_groups || options.chart.groups;\n Datasets.request({\n chart : chart,\n dataset_id : dataset_id,\n dataset_groups : dataset_groups,\n success : function( result ) {\n try {\n if ( targets.length == result.length ) {\n var valid = true;\n for ( var group_index in result ) {\n var group = result[ group_index ];\n if ( !render( targets[ group_index ], [ group ] ) ) {\n valid = false;\n break;\n }\n }\n if ( valid ) {\n chart.state( 'ok', 'Multi-panel chart drawn.' );\n }\n } else if ( targets.length == 1 ) {\n if ( render( targets[ 0 ], result ) ) {\n chart.state( 'ok', 'Chart drawn.' );\n }\n } else {\n chart.state( 'failed', 'Invalid panel count.' );\n }\n process.resolve();\n } catch ( err ) {\n console.debug( 'FAILED: tabular-utilities::panelHelper() - ' + err );\n chart.state( 'failed', err );\n process.reject();\n }\n }\n });\n }", "title": "" }, { "docid": "cd4c56e59421a8a7a1122c4cd7504ae7", "score": "0.58823794", "text": "showMenuPanel(type = '', tabFocus = false) {\n const target = this.elements.container.querySelector(`#plyr-settings-${this.id}-${type}`); // Nothing to show, bail\n\n if (!is.element(target)) {\n return;\n } // Hide all other panels\n\n\n const container = target.parentNode;\n const current = Array.from(container.children).find(node => !node.hidden); // If we can do fancy animations, we'll animate the height/width\n\n if (support.transitions && !support.reducedMotion) {\n // Set the current width as a base\n container.style.width = `${current.scrollWidth}px`;\n container.style.height = `${current.scrollHeight}px`; // Get potential sizes\n\n const size = controls.getMenuSize.call(this, target); // Restore auto height/width\n\n const restore = event => {\n // We're only bothered about height and width on the container\n if (event.target !== container || !['width', 'height'].includes(event.propertyName)) {\n return;\n } // Revert back to auto\n\n\n container.style.width = '';\n container.style.height = ''; // Only listen once\n\n off.call(this, container, transitionEndEvent, restore);\n }; // Listen for the transition finishing and restore auto height/width\n\n\n on.call(this, container, transitionEndEvent, restore); // Set dimensions to target\n\n container.style.width = `${size.width}px`;\n container.style.height = `${size.height}px`;\n } // Set attributes on current tab\n\n\n toggleHidden(current, true); // Set attributes on target\n\n toggleHidden(target, false); // Focus the first item\n\n controls.focusFirstMenuItem.call(this, target, tabFocus);\n }", "title": "" }, { "docid": "26673bcc1058a66b71efdd439c0e94d3", "score": "0.5875882", "text": "function zenbuChartElement_configSubpanel() {\n if(!this.config_options_div) { return; }\n \n var configdiv = this.config_options_div;\n\n var datasourceElement = this.datasource();\n \n var labelDiv = configdiv.appendChild(document.createElement('div'));\n labelDiv.setAttribute(\"style\", \"font-size:12px; font-family:arial,helvetica,sans-serif;\");\n var span1 = labelDiv.appendChild(document.createElement('span'));\n span1.setAttribute(\"style\", \"font-size:12px; margin-right:7px; font-family:arial,helvetica,sans-serif; font-weight:bold;\");\n span1.innerHTML =\"Visualization:\";\n\n //display_type\n var display_type = this.display_type;\n if(this.newconfig && this.newconfig.display_type != undefined) { display_type = this.newconfig.display_type; }\n if(display_type==\"bubble\") { display_type=\"scatter2D\"; } \n\n //var tdiv2 = configdiv.appendChild(document.createElement(\"div\"));\n //tdiv2.style.marginTop = \"5px\";\n var span1 = labelDiv.appendChild(document.createElement('span'));\n span1.setAttribute('style', \"margin: 2px 1px 0px 15px;\");\n span1.innerHTML = \"chart type: \";\n var select = labelDiv.appendChild(document.createElement('select'));\n //select.setAttribute(\"style\", \"font-size:10px;\");\n select.className = \"dropdown\";\n select.setAttribute(\"onchange\", \"reportElementReconfigParam(\\\"\"+ this.elementID +\"\\\", 'display_type', this.value);\");\n var types = [\"scatter2D\", \"bar\", \"line\", \"scatter3D\", \"ternary\", \"boxplot\", \"violin\"]; // \"piechart\", \"doughnut\"];\n for(var i=0; i<types.length; i++) {\n var val1 = types[i];\n var option = select.appendChild(document.createElement('option'));\n option.setAttribute(\"value\", val1);\n if(val1 == display_type) { option.setAttribute(\"selected\", \"selected\"); }\n option.innerHTML = val1;\n }\n\n var datasource_mode = datasourceElement.datasource_mode;\n if(this.newconfig && this.newconfig.datasource_mode != undefined) { \n datasource_mode = this.newconfig.datasource_mode; \n }\n\n if(datasource_mode == \"edge\") {\n var focus_feature_mode = this.focus_feature_mode;\n if(this.newconfig && this.newconfig.focus_feature_mode != undefined) { focus_feature_mode = this.newconfig.focus_feature_mode; }\n \n tdiv2 = configdiv.appendChild(document.createElement('div'));\n tdiv2.setAttribute('style', \"margin: 2px 1px 0px 5px;\");\n tdiv2.innerHTML = \"edge source options:\";\n\n tdiv2 = configdiv.appendChild(document.createElement('div'));\n tdiv2.style.marginLeft = \"10px\";\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.setAttribute('style', \"margin: 2px 1px 0px 5px;\");\n tspan2.innerHTML = \"focus feature filter: \";\n \n tradio = tdiv2.appendChild(document.createElement('input'));\n tradio.setAttribute('type', \"radio\");\n tradio.setAttribute('name', this.elementID + \"_config_focus_feature_mode_radio\");\n tradio.setAttribute('value', \"ignore\");\n tradio.setAttribute(\"onclick\", \"reportElementReconfigParam(\\\"\"+ this.elementID +\"\\\", 'focus_feature_mode', 'ignore');\");\n if(focus_feature_mode==\"ignore\") { tradio.setAttribute('checked', \"checked\"); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"ignore\";\n var msg = \"<div style='text-align:left; padding:3px;'>the focus_feature is ignored and ALL edges in datasource will be plotted</div>\";\n tradio.setAttribute(\"onmouseover\", \"eedbMessageTooltip(\\\"\"+msg+\"\\\",200);\");\n tradio.setAttribute(\"onmouseout\", \"eedbClearSearchTooltip();\");\n tspan2.setAttribute(\"onmouseover\", \"eedbMessageTooltip(\\\"\"+msg+\"\\\",200);\");\n tspan2.setAttribute(\"onmouseout\", \"eedbClearSearchTooltip();\");\n\n\n tradio = tdiv2.appendChild(document.createElement('input'));\n tradio.setAttribute('type', \"radio\");\n tradio.setAttribute('name', this.elementID + \"_config_focus_feature_mode_radio\");\n tradio.setAttribute('value', \"current\");\n tradio.setAttribute(\"onclick\", \"reportElementReconfigParam(\\\"\"+ this.elementID +\"\\\", 'focus_feature_mode', 'current');\");\n if(focus_feature_mode==\"current\") { tradio.setAttribute('checked', \"checked\"); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"current\";\n var msg = \"<div style='text-align:left; padding:3px;'>the focus_feature is used so only edges connected to the focus_feature will be plotted</div>\";\n tradio.setAttribute(\"onmouseover\", \"eedbMessageTooltip(\\\"\"+msg+\"\\\",230);\");\n tradio.setAttribute(\"onmouseout\", \"eedbClearSearchTooltip();\");\n tspan2.setAttribute(\"onmouseover\", \"eedbMessageTooltip(\\\"\"+msg+\"\\\",230);\");\n tspan2.setAttribute(\"onmouseout\", \"eedbClearSearchTooltip();\");\n\n \n tradio = tdiv2.appendChild(document.createElement('input'));\n tradio.setAttribute('type', \"radio\");\n tradio.setAttribute('name', this.elementID + \"_config_focus_feature_mode_radio\");\n tradio.setAttribute('value', \"progressive\");\n tradio.setAttribute(\"onclick\", \"reportElementReconfigParam(\\\"\"+ this.elementID +\"\\\", 'focus_feature_mode', 'progressive');\");\n if(focus_feature_mode==\"progressive\") { tradio.setAttribute('checked', \"checked\"); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"dual progressive\";\n var msg = \"<div style='text-align:left; padding:3px;'>both the current and previous focus_feature will be used and mapped to different axes progressively. Points are linked via the feature2 of the progressive edges.<br>This special mode allows for creating correlation or concordance type plots.</div>\";\n tradio.setAttribute(\"onmouseover\", \"eedbMessageTooltip(\\\"\"+msg+\"\\\",280);\");\n tradio.setAttribute(\"onmouseout\", \"eedbClearSearchTooltip();\");\n tspan2.setAttribute(\"onmouseover\", \"eedbMessageTooltip(\\\"\"+msg+\"\\\",280);\");\n tspan2.setAttribute(\"onmouseout\", \"eedbClearSearchTooltip();\");\n }\n \n this.hide_legend_color_config = false;\n\n if(display_type==\"bubble\" || display_type==\"scatter2D\") { \n this.configBubbleChart(datasourceElement); \n //legend mode at bottom\n //this.configLegendGroupMode(datasourceElement);\n }\n if((display_type==\"bar\")||(display_type==\"line\")) { \n this.configBarChart(datasourceElement); \n //this.configLegendGroupMode(datasourceElement);\n }\n if(display_type==\"scatter3D\") { \n this.configPlotly3D(datasourceElement);\n }\n if(display_type==\"ternary\") { \n this.configTernary(datasourceElement);\n }\n if((display_type==\"boxplot\") || (display_type == \"violin\")) { \n this.configBoxPlot(datasourceElement);\n this.configLegendGroupMode(datasourceElement);\n }\n if((display_type==\"scatter3D\") || (display_type==\"ternary\")) { \n this.configLegendGroupMode(datasourceElement); //legend mode at bottom\n }\n \n configdiv.appendChild(document.createElement('hr'));\n}", "title": "" }, { "docid": "4b998c227beb9475ec4a8769d2772dd8", "score": "0.58648175", "text": "function makePanel(_ref2) {\n var title = _ref2.title,\n content = _ref2.content;\n // TASK 5- Instantiate all the elements needed for a panel\n var panel = document.createElement('div');\n var panelBar = document.createElement('div');\n var panelContent = document.createElement('div');\n var panelTitle = document.createElement('h3');\n var panelButtons = document.createElement('div');\n var openButton = document.createElement('button');\n var closeButton = document.createElement('button'); // document.body.prepend(panel);\n // TASK 6- Setup the structure of our elements\n\n /*\n <div> // panel\n <div> // panelBar\n <h3></h3> // panelTitle\n <div> // panelButtons \n <button></button> // openButton\n <button></button> // closeButton\n </div>\n </div>\n <div></div> // panelContent\n </div>\n */\n\n panel.appendChild(panelBar);\n panel.appendChild(panelContent);\n panelBar.appendChild(panelTitle);\n panelBar.appendChild(panelButtons);\n panelButtons.appendChild(openButton);\n panelButtons.appendChild(closeButton); // TASK 7- Add proper class names to our elements (See index.html for reference)\n // paying attention to the elements that need to start out hidden\n\n panel.classList.add('panel');\n panelBar.classList.add('panel-bar');\n panelButtons.classList.add('panel-buttons');\n openButton.classList.add('panel-btn-open');\n closeButton.classList.add('panel-btn-close', 'hide-btn');\n panelContent.classList.add('panel-content', 'toggle-on'); // TASK 8- Set text content using arguments as raw material\n // and also using the open and close arrows imported at the top of the file\n\n panelTitle.textContent = title;\n panelContent.textContent = content;\n openButton.textContent = open;\n closeButton.textContent = close; // TASK 9- When the 'open' or 'close' buttons are clicked, the content is toggled on/off:\n // - the open button needs to go away (the 'hide-btn' class name controls this)\n // - the close button needs to show (the 'hide-btn' class name controls this)\n // - the contents need to show (the 'toggle-on' class name controls this)\n\n panelButtons.addEventListener('click', function () {\n openButton.classList.toggle('hide-btn');\n closeButton.classList.toggle('hide-btn');\n panelContent.classList.toggle('toggle-on');\n console.log(panelTitle.textContent);\n }); // don't forget to return the panel!\n\n return panel;\n} //const panelElement = makePanel({title:'MJ', content:'ggg'});", "title": "" }, { "docid": "e1be4da4eaaea0c1d496d08a013af849", "score": "0.58607894", "text": "_toggle() {\n if (!this.disabled) {\n this.panel.toggle();\n }\n }", "title": "" }, { "docid": "e1be4da4eaaea0c1d496d08a013af849", "score": "0.58607894", "text": "_toggle() {\n if (!this.disabled) {\n this.panel.toggle();\n }\n }", "title": "" }, { "docid": "e1be4da4eaaea0c1d496d08a013af849", "score": "0.58607894", "text": "_toggle() {\n if (!this.disabled) {\n this.panel.toggle();\n }\n }", "title": "" }, { "docid": "e1be4da4eaaea0c1d496d08a013af849", "score": "0.58607894", "text": "_toggle() {\n if (!this.disabled) {\n this.panel.toggle();\n }\n }", "title": "" }, { "docid": "89285f40fc575b818e1706124fca6a7a", "score": "0.58586806", "text": "function createpanel(title,imagesrc,dataid){ \r\n \t arr.push(title);\r\n txt = title.split(\"\")\r\n str=``;\r\n\t\t var deg = 180 / txt.length,\r\n\t\t origin = -88;\r\n\t\t txt.forEach((ea) => {\r\n\t\t ea = \"<p style='height:100px;position:absolute;transform:rotate(\"+origin+\"deg);transform-origin:0 100%'>\"+ea+\"</p>\";\r\n\t\t str += ea;\r\n\t\t origin += deg;\r\n\t\t });\r\n\t\t return `<div class=\"col-sm-3\">\r\n\t\t\t\t\t<div class=\"panel panel1\">\r\n\t\t\t\t\t\t<div class=\"panelheading\">`+str+`\r\n \t\t\t\t\t\t</div>\r\n \t\t\t\t\t\t<h3 style=\"display: none;\">`+title+`</h3>\r\n\t\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t <img class = 'playlistimg2' src='`+imagesrc+`'/>\r\n\t\t\t\t\t\t <div class=\"gly\" id = '`+dataid+`'>\r\n\t\t\t\t\t\t <span class='glyphicon glyphicon-pencil edit' data-toggle=\"modal\" data-target=\"#myModal\" data-backdrop=\"static\" data-dismiss=\"modal\"></span>\r\n\t\t\t\t\t\t <span class='glyphicon glyphicon-remove remove'></span>\r\n\t\t\t\t\t\t <span class='glyphicon glyphicon-play-circle play'></span></div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div> `\r\n }", "title": "" }, { "docid": "de5b0fdb96b1fc080045e5eb7b1ca172", "score": "0.5855455", "text": "function AbilityPanel(parent, ability, unit) {\n // Create panel\n this.panel = $.CreatePanel(\"Panel\", parent, \"\");\n this.panel.BLoadLayoutSnippet(\"AbilityPanel\");\n this.panel.SetPanelEvent(\"onmouseover\", this.showTooltip.bind(this));\n this.panel.SetPanelEvent(\"onmouseout\", this.hideTooltip.bind(this));\n this.panel.SetPanelEvent(\"onactivate\", this.onLeftClick.bind(this));\n this.panel.SetPanelEvent(\"oncontextmenu\", this.onRightClick.bind(this));\n // Set up panel logic\n this.ability = ability;\n this.abilityName = Abilities.GetAbilityName(ability);\n this.ownerUnit = unit;\n this.level = 0;\n this.maxLevel = Abilities.GetMaxLevel(this.ability);\n this.learning = false;\n this.autocast = false;\n this.state = AbilityState.Default;\n this.pips = [];\n // Set the ability image.\n var image = this.panel.FindChildTraverse(\"AbilityImage\");\n image.abilityname = this.abilityName;\n image.contextEntityIndex = this.ownerUnit;\n // Set a special style for passive abilities\n if (Abilities.IsPassive(this.ability)) {\n this.panel.FindChildTraverse(\"AbilityFrame\").AddClass(\"Passive\");\n }\n // Set a special style for autocast abilities\n if (Abilities.IsAutocast(this.ability)) {\n this.panel.FindChildTraverse(\"AutocastPanel\").style.visibility = \"visible\";\n }\n // We do not want to know this for enemies - but we can\n if (!Entities.IsEnemy(unit)) {\n // Add ability pips.\n this.addLevelPips();\n // Set the level of the ability.\n this.setLevel(Abilities.GetLevel(this.ability));\n }\n // Hide mana label by default\n this.panel.FindChildTraverse(\"ManaLabel\").style.visibility = \"collapse\";\n // Set hotkey panel.\n var hotkey = Abilities.GetKeybind(this.ability);\n if (Abilities.IsPassive(this.ability)) {\n this.panel.FindChildTraverse(\"HotkeyLabel\").style.visibility = \"collapse\";\n }\n else {\n this.panel.FindChildTraverse(\"HotkeyLabel\").text = hotkey;\n }\n }", "title": "" }, { "docid": "5f30c5f148be1641ea54d78a863d62d9", "score": "0.5845872", "text": "function PanelWindow() {\r\n BaseWindow.apply(this, arguments);\r\n}", "title": "" }, { "docid": "8188b3c41ac80d8f7a9f9ebfd3f5bce8", "score": "0.5845202", "text": "get panel() {\n return this.container.querySelector(\".tooltip-panel\");\n }", "title": "" }, { "docid": "a94526940cdec415a06334178f66e93a", "score": "0.5831847", "text": "function dhtmlXLayoutPanel(){}", "title": "" }, { "docid": "8223c83500e7aaf0d2ae3ff5321a1786", "score": "0.58208025", "text": "function showPanel(cssClass) {\n $(\".js-panel\").hide();\n $(cssClass).show();\n}", "title": "" }, { "docid": "8f76b627b94154649c1c29aeefab45e5", "score": "0.58120257", "text": "function debugPanel(padre, id){\n\n this.padre = padre || \"<body>\";\n this.ident = id || \"dPanel\";\n\n //texto que aparecera inicialmente al crear el panel\n this.textoIni = \"deBug Panel version 0.1\\n\";\n\n //id del boton (null si no esta creado)\n this.bident = null;\n\n //Indica si el panel esta oculto o no (0-Oculto, 1-Visible)\n this.oculto = 1;\n\n //Propiedades CSS del Panel\n //--------------------------\n this.anchura = \"99%\";\n this.altura = ((window.innerHeight) / 1.3) + \"px\";\n this.cfondo = \"#000\";\n this.ctexto = \"#FFF\";\n this.familia = \" 'Courier New', monospace\";\n this.tamTexto = \"0.9em\";\n this.pclases = \"\"; //clases por defecto para el panel\n this.bclases = \"\"; //clases extra para el boton\n //--------------------------\n\n\n\n //Función que enlaza el panel en el arbol DOM\n //y le coloca las propiedades CSS\n this.iniciar = function(){\n\n try{\n //Creamos el panel y su contenido\n var nuevo = document.createElement(\"div\");\n var texto = document.createTextNode(this.textoIni);\n nuevo.appendChild(texto);\n\n //colocamos sus propiedades\n nuevo.style.width = this.anchura;\n nuevo.style.height = this.altura;\n nuevo.style.backgroundColor = this.cfondo;\n nuevo.style.color = this.ctexto;\n nuevo.style.fontFamily = this.familia;\n nuevo.style.fontSize = this.tamTexto;\n\n nuevo.id = this.ident;\n\n\n //por defecto el panel es visible\n //si se crea un boton, el panel se esconde\n nuevo.style.display = \"block\";\n this.oculto = 1;\n\n //Clases para el panel\n nuevo.className = this.pclases;\n\n //Enlazamos al padre\n var padre = document.getElementById(this.padre);\n padre.appendChild(nuevo);\n\n\n }\n catch(e){\n console.log(\"Error creando panel: \"+e);\n return -1;\n }\n\n }//iniciar\n\n //Metodo para escribir en el panel de depuracion\n //cad: cadena a mostrar\n //limpiar: 0 añade al contenido del panel, 1 limpia el panel antes de escribir\n this.mostrarMensaje = function(cad,limpiar){\n try{\n var panel = document.getElementById(this.ident);\n if (limpiar) panel.innerHTML = cad;\n else panel.innerHTML += \"<br>\"+cad;\n }\n catch(e){\n console.log(\"Fallo de escritura en panel \"+this.ident);\n return -1;\n }\n }//mostrarMensaje\n\n //Añade una clase o lista de clases al panel o al boton\n //clase: nombre de la/s clase/s como se pondria en HTML\n //objeto: 0 panel, 1 boton (por defecto panel)\n this.addClase = function(clase,objeto){\n var obj = objeto || 0;\n\n if (obj > 1) obj = 1;\n if (obj < 0) obj = 0;\n\n var item = null;\n switch (obj){\n case 0: item = document.getElementById(this.ident);\n break;\n case 1: item = document.getElementById(this.bident);\n break;\n }\n\n if (item != null){\n item.className = clase;\n }\n else{\n console.log(\"No puedo acceder al elemento \"+this.ident);\n }\n }//addClase\n\n\n //Muestra/Oculta el panel de depuracion\n function cambiarPanel(oculto,ident){\n var salida=1;\n try{\n var panel = document.getElementById(ident);\n\n switch (oculto){\n case 0: //esta oculto, debo mostrarlo\n panel.style.display = \"block\";\n salida = 1;\n break;\n case 1: //esta visible, debo ocultarlo\n panel.style.display = \"none\";\n salida = 0;\n break;\n default: console.log(\"El valor 'oculto' no es correcto\");\n break;\n }//switch\n return salida;\n }\n catch(e){\n console.log(\"Error actualizando visibilidad del panel: \"+e);\n return -1;\n }\n }//alternarPanel\n\n\n //Coloca un boton que muestra/oculta\n //el panel de depuracion\n //padre: nodo padre del arbol DOM\n //nombre: value del boton (por defecto DEBUG)\n //id: id del boton (por defecto bdebug)\n this.boton = function (padre,nombre,id){\n\n var value = nombre || \"debug\";\n var ident = id || \"bdebug\";\n\n this.bident = ident; //actualizamos el id del boton\n\n try{\n\n //La creacion del boton esconde el panel\n var panel = document.getElementById(this.ident);\n panel.style.display = \"none\";\n this.oculto = 0;\n\n //creamos el boton\n var boton = document.createElement(\"input\");\n\n //Colocamos sus atributos\n boton.type = \"button\";\n boton.id = ident;\n boton.name = ident;\n boton.value = value;\n\n //variables para el onclick\n var oculto = this.oculto;\n var pident = this.ident;\n\n boton.onclick = function(){\n oculto = cambiarPanel(oculto,pident);\n };\n\n\n //Enlazamos al padre\n var padre = document.getElementById(padre);\n padre.appendChild(boton);\n\n\n }\n catch(e){\n console.log(\"Error creando boton: \"+e);\n return -1;\n }\n }//boton\n\n\n //------------------------------------------------\n //Al crear la clase se ejecuta el metodo 'iniciar'\n this.iniciar();\n\n}//clase", "title": "" }, { "docid": "93c9d5b58bedd7776d44e0cb41dd02bd", "score": "0.5809916", "text": "deregisterPanel(id) {\n super.deregisterComposite(id);\n }", "title": "" }, { "docid": "3715b39e1acdb0dc377aafd367385663", "score": "0.58091617", "text": "function DraggablePanel() {\n weavecore.ILinkableObject.call(this);\n\n Object.defineProperties(this, {\n 'panelX': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(null, weavedata.NumberUtils.verifyNumberOrPercentage))\n },\n 'panelY': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(null, weavedata.NumberUtils.verifyNumberOrPercentage))\n },\n 'panelWidth': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(null, weavedata.NumberUtils.verifyNumberOrPercentage))\n },\n 'panelHeight': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(null, weavedata.NumberUtils.verifyNumberOrPercentage))\n },\n 'maximized': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(false, verifyMaximized.bind(this)), handleMaximizedChange.bind(this), true)\n },\n 'minimized': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(false, verifyMinimized.bind(this)), handleMinimizedChange.bind(this), true)\n },\n 'zOrder': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableNumber(0, weavecore.StandardLib.isDefined), handleZOrderChange.bind(this), true)\n },\n 'panelTitle': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(), this.handlePanelTitleChange.bind(this), true)\n },\n 'enableMoveResize': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'enableSubMenu': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(false))\n },\n 'minimizable': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'maximizable': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'enableZOrder': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'closeable': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'enableBorders': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'panelBorderColor': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableNumber(NaN), handleBorderColorChange, true)\n },\n 'panelBackgroundColor': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableNumber(NaN), handleBackgroundColorChange, true)\n },\n 'buttonRadius': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableNumber(3, isFinite), panelNeedsUpdate, true)\n },\n 'panelStyleList': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(), handlePanelStyleListChange, true)\n }\n });\n }", "title": "" }, { "docid": "3715b39e1acdb0dc377aafd367385663", "score": "0.58091617", "text": "function DraggablePanel() {\n weavecore.ILinkableObject.call(this);\n\n Object.defineProperties(this, {\n 'panelX': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(null, weavedata.NumberUtils.verifyNumberOrPercentage))\n },\n 'panelY': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(null, weavedata.NumberUtils.verifyNumberOrPercentage))\n },\n 'panelWidth': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(null, weavedata.NumberUtils.verifyNumberOrPercentage))\n },\n 'panelHeight': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(null, weavedata.NumberUtils.verifyNumberOrPercentage))\n },\n 'maximized': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(false, verifyMaximized.bind(this)), handleMaximizedChange.bind(this), true)\n },\n 'minimized': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(false, verifyMinimized.bind(this)), handleMinimizedChange.bind(this), true)\n },\n 'zOrder': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableNumber(0, weavecore.StandardLib.isDefined), handleZOrderChange.bind(this), true)\n },\n 'panelTitle': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(), this.handlePanelTitleChange.bind(this), true)\n },\n 'enableMoveResize': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'enableSubMenu': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(false))\n },\n 'minimizable': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'maximizable': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'enableZOrder': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'closeable': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'enableBorders': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableBoolean(true), panelNeedsUpdate, true)\n },\n 'panelBorderColor': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableNumber(NaN), handleBorderColorChange, true)\n },\n 'panelBackgroundColor': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableNumber(NaN), handleBackgroundColorChange, true)\n },\n 'buttonRadius': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableNumber(3, isFinite), panelNeedsUpdate, true)\n },\n 'panelStyleList': {\n value: WeaveAPI.SessionManager.registerLinkableChild(this, new weavecore.LinkableString(), handlePanelStyleListChange, true)\n }\n });\n }", "title": "" }, { "docid": "af0d31d470e5315a30a950af29ffd060", "score": "0.580694", "text": "function apply_panel_transparency() {\n Panel.add_style_class_name('panel-transparency');\n}", "title": "" }, { "docid": "e9ee55d80614b6f9f857dba0b35ba2cd", "score": "0.5805743", "text": "function changePanel(){\n container[0].classList.toggle('panel-change');\n}", "title": "" }, { "docid": "894b4929a3dce25323c6d96fd583aaab", "score": "0.58040935", "text": "function closeMyMealPanel()\n{\n erasePanel('myMealPanel');\n}", "title": "" }, { "docid": "dbeb63fa43743ce9386d2414754b96a4", "score": "0.58040076", "text": "function BeamlinePanel(args) {\r\n\tvar _this = this;\r\n\tthis.width = \"800\";\r\n\tthis.height = \"800\";\r\n\r\n\tif (args != null) {\r\n\t\tif (args.width != null) {\r\n\t\t\tthis.width = args.width;\r\n\t\t}\r\n\t\tif (args.height != null) {\r\n\t\t\tthis.height = args.height;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "1d2001cc9d3e108dd28bd19272e790e2", "score": "0.5801739", "text": "function displayPanel(id, data) {\n tileId = id;\n if (document.getElementsByClassName(\"panel\").length == 0) {\n document.getElementById(\"addPanel\").style.display = \"block\";\n var newDiv = document.createElement(\"div\");\n newDiv.className = \"panel\";\n newDiv.id = \"panel-body\";\n newDiv.innerHTML = panel;\n\n document.getElementById(\"addPanel\").appendChild(newDiv);\n document.getElementById(\"myText\").value = data;\n counter(id);\n save(id);\n del(id);\n }\n}", "title": "" }, { "docid": "ed40b777c2d462a148912108d9334453", "score": "0.58011144", "text": "function showPanel(id) {\n $('.ko-show').removeClass('ko-show');\n $(id).addClass('ko-show');\n }", "title": "" }, { "docid": "7a7d54b8b856a47c8ffdd92c780ac22c", "score": "0.57908386", "text": "function showPanel(name) {\n document.getElementById(\"configuration\").style.display = 'none';\n document.getElementById(\"editor\").style.display = 'none';\n document.getElementById(name).style.display = '';\n}", "title": "" }, { "docid": "c1b89a8c34856ca338a4cb86fba9a823", "score": "0.57797945", "text": "function addPanelRenseignement() {\n $('#panelProperties').removeClass('hidden');\n $('#saveBtn').on('click', this, function() {\n saveFeature();\n });\n }", "title": "" }, { "docid": "5e00fe98adf1dc400efc03ba5f1a415a", "score": "0.5773793", "text": "function initdata() {\n\n var Event = YAHOO.util.Event;\n YAHOO.util.Event.addListener(\"show1\", \"click\", function() {\n \n YAHOO.module.container.panel1 = new YAHOO.widget.Panel('panel1', {\n constraintoviewport:true,\n close: false,\n autofillheight: \"body\", // default value, specified here to highlight its use in the example\n width: '500px',\n height: '500px',\n xy: [100, 100]\n });\n\n YAHOO.module.container.panel1.setHeader(\"<div class='tl'></div><span>\"+ panelName +\"</span><div class='tr'></div>\");\n YAHOO.module.container.panel1.setBody('<div id=\"layout\"> '+\n '' +\n '</div>');\n YAHOO.module.container.panel1.setFooter(\"<span>Copyright Realworld </span>\");\n \n YAHOO.module.container.panel1.beforeRenderEvent.subscribe(function() {\n Event.onAvailable('layout', function() {\n layout = new YAHOO.widget.Layout('layout', {\n height: 430,\n width: 450,\n units: [\n {\n position: 'top',\n height: 25,\n header: 'Description'\n \n },\n {\n position: 'bottom',\n height: 150,\n id: 'status',\n body: 'Status',\n collapse: true,\n scroll: true\n },\n {\n position: 'center',\n body: 'if you cannot see this content then please use the latest flash player, you can download it from adobe',\n gutter: '0 2 0 0'\n \n }\n ]\n });\n \n layout.on('render', function() {\n var l = layout.getUnitByPosition('center');\n l.set('body', '<div id=\"chart\"></div>');\n Event.onAvailable(\"chart\",function(){\n mychart = new YAHOO.widget.PieChart( \"chart\", pieData,pieDataColumn\n );\n } );\n \n var b = layout.getUnitByPosition('bottom');\n b.set('body', '<div id=\"datatable\"></div>');\n var table = new YAHOO.widget.DataTable( \"datatable\", dataTablecolumns, jsonData, tblConfig);\n \n }, layout, true);\n layout.render();\n });\n });\n\n YAHOO.module.container.panel1.render();\n YAHOO.util.Event.addListener(\"hide1\", \"click\", YAHOO.module.container.panel1.hide, YAHOO.module.container.panel1, true);\n });\n}", "title": "" }, { "docid": "25abb32a899c0180e2a386de79828444", "score": "0.57712877", "text": "function switchPN (e) {\n $.each($('.panelx'),function(id,item){\n var ke = id+1;\n if(ke==e){\n $('#panel'+ke).removeAttr('style');\n $('h4').html($(this).attr('title'));\n }else{\n $('#panel'+ke).attr('style','display:none;');\n }\n });\n }", "title": "" }, { "docid": "6aa5fdcefb1d52e8ef69dc88d2109a14", "score": "0.5769406", "text": "add(panel) {\n let id = Object.keys(this.children).length;\n panel.parentID = id;\n this.children[id] = panel;\n if (typeof panel.style.x === 'string') { //x in % \n panel.style.x = (parseInt(panel.style.x) / 100) * this.style.w;\n }\n if (typeof panel.style.y === 'string') { //y in %\n panel.style.y = (parseInt(panel.style.y) / 100) * this.style.h;\n }\n if (typeof panel.style.w === 'string') { //width in %\n panel.style.w = (parseInt(panel.style.w) / 100) * this.style.w;\n }\n if (typeof panel.style.h === 'string') { //height in %\n panel.style.h = (parseInt(panel.style.h) / 100) * this.style.h;\n }\n this.rerender();\n }", "title": "" }, { "docid": "b3a39934c2d0765997a306b82f40789c", "score": "0.5761348", "text": "function toggleProjectionPanel(){\n var el = Ext.get('SelectSRS');\n el.getHeight()==0 ? el.setHeight(50,true):el.setHeight(0,true);\n Ext.get('lblSRS').toggleClass('open');\n closeRfbPanel();\n closeYearsPanel();\n}", "title": "" }, { "docid": "5acdd7ab6a8d64c130c6ae1d93e67c81", "score": "0.57519764", "text": "function xTabPanelGroup(id, w, h, th, clsTP, clsTG, clsTD, clsTS) // object prototype\n{\n // Private Methods\n\n function onClick() //r7\n {\n paint(this);\n return false;\n }\n function onFocus() //r7\n {\n paint(this);\n }\n function paint(tab)\n {\n tab.className = clsTS;\n xZIndex(tab, highZ++);\n xDisplay(panels[tab.xTabIndex], 'block'); //r6\n\n if (selectedIndex != tab.xTabIndex) {\n xDisplay(panels[selectedIndex], 'none'); //r6\n tabs[selectedIndex].className = clsTD;\n\n selectedIndex = tab.xTabIndex;\n }\n }\n\n // Public Methods\n\n this.select = function(n) //r7\n {\n if (n && n <= tabs.length) {\n var t = tabs[n-1];\n if (t.focus) t.focus();\n else t.onclick();\n }\n }\n\n this.onUnload = function()\n {\n if (xIE4Up) for (var i = 0; i < tabs.length; ++i) {tabs[i].onclick = null;}\n }\n\n // Constructor Code (note that all these vars are 'private')\n\n var panelGrp = xGetElementById(id);\n if (!panelGrp) { return null; }\n var panels = xGetElementsByClassName(clsTP, panelGrp);\n var tabs = xGetElementsByClassName(clsTD, panelGrp);\n var tabGrp = xGetElementsByClassName(clsTG, panelGrp);\n if (!panels || !tabs || !tabGrp || panels.length != tabs.length || tabGrp.length != 1) { return null; }\n var selectedIndex = 0, highZ, x = 0, i;\n xResizeTo(panelGrp, w, h);\n xResizeTo(tabGrp[0], w, th);\n xMoveTo(tabGrp[0], 0, 0);\n w -= 2; // remove border widths\n var tw = w / tabs.length;\n for (i = 0; i < tabs.length; ++i) {\n xResizeTo(tabs[i], tw, th);\n xMoveTo(tabs[i], x, 0);\n x += tw;\n tabs[i].xTabIndex = i;\n tabs[i].onclick = onClick;\n tabs[i].onfocus = onFocus; //r7\n xDisplay(panels[i], 'none'); //r6\n xResizeTo(panels[i], w, h - th - 2); // -2 removes border widths\n xMoveTo(panels[i], 0, th);\n }\n highZ = i;\n tabs[0].onclick();\n}", "title": "" }, { "docid": "3668236fab537721fa6e0ad60ec79ffd", "score": "0.5751401", "text": "function EquipmentInformationPanel() {\n _super.call(this);\n this.width = 250;\n this.height = 400;\n this.backGround = new egret.Bitmap();\n this.backGround.texture = RES.getRes(\"BlackBackground_png\");\n this.backGround.width = 250;\n this.backGround.height = 400;\n this.addChild(this.backGround);\n this.backGround.x = 0;\n this.backGround.y = 0;\n this.backGround.alpha = 0.8;\n this.equipmentIconBitmap = new egret.Bitmap();\n this.equipmentIconBitmap.width = 60;\n this.equipmentIconBitmap.height = 60;\n this.addChild(this.equipmentIconBitmap);\n this.equipmentIconBitmap.x = 30;\n this.equipmentIconBitmap.y = 30;\n this.nameField = new egret.TextField();\n this.nameField.width = 200;\n this.nameField.height = 50;\n this.addChild(this.nameField);\n this.nameField.size = 24;\n this.nameField.x = 30;\n this.nameField.y = this.equipmentIconBitmap.y + this.equipmentIconBitmap.height + 50;\n this.propertiesField = new egret.TextField();\n this.propertiesField.width = 200;\n this.propertiesField.height = 300;\n this.addChild(this.propertiesField);\n this.propertiesField.textColor = 0xffffff;\n this.propertiesField.size = 20;\n this.propertiesField.x = 30;\n this.propertiesField.y = this.nameField.y + 55;\n this.jewelInformationField = new egret.TextField();\n this.jewelInformationField.width = 200;\n this.jewelInformationField.height = 300;\n this.addChild(this.jewelInformationField);\n this.jewelInformationField.size = 20;\n this.jewelInformationField.x = 30;\n this.jewelInformationField.y = this.propertiesField.y + 110;\n }", "title": "" }, { "docid": "4cc82ccd07a4f5df833f42612963ee5d", "score": "0.57488537", "text": "hidePanel() {\n $('.panel').hide();\n this.clear();\n }", "title": "" }, { "docid": "d771bf4aee559e4995ccb50aea7a22be", "score": "0.5734921", "text": "function AutoProcRightPanel(args) {\r\n\tvar _this = this;\r\n\tthis.width = \"800\";\r\n\tthis.height = \"800\";\r\n\t/** Events * */\r\n\tthis.onAutoProcGraphSelected = new Event(this);\r\n\r\n\tthis.data = null;\r\n\tthis.tabs = null;\r\n\r\n\t// the different panels in the tab\r\n\tthis.xdsPanel = null;\r\n\tthis.xscalePanel = null;\r\n\tthis.scalaPanel = null;\r\n\tthis.scalePackPanel = null;\r\n\tthis.truncatePanel = null;\r\n\tthis.dimplePanel = null;\r\n\r\n\tif (args != null) {\r\n\t\tif (args.width != null) {\r\n\t\t\tthis.width = args.width;\r\n\t\t}\r\n\t\tif (args.height != null) {\r\n\t\t\tthis.height = args.height;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "adea9b2b76bf3350305f12e88261f171", "score": "0.5725831", "text": "function setPanels() {\n panels = $(panelClass, panelId);\n uniquePanels = numPanels;\n numPanels = panels.length;\n }", "title": "" }, { "docid": "c5d1ce8217351747aad41b9f620a7b18", "score": "0.5724072", "text": "function optionsPanel() {\n $(\".window__message i\").not(this).siblings().removeClass(\"panel--active\");\n $(this).siblings().toggleClass(\"panel--active\");\n }", "title": "" }, { "docid": "ed254cdff6c85762d43c34be028c8107", "score": "0.5722661", "text": "function createPanel( pw, ph, director ){\n\t\tdashBG = new CAAT.Foundation.ActorContainer().\n\t\t\t\t\tsetPreferredSize( pw, ph ).\n\t\t\t\t\tsetBounds( 0, 0, pw, ph ).\n\t\t\t\t\tsetClip(false);\t\t\t\n\t\t\t\n\t\t__createBannerContainer();\n\t\t//create bottom panel\n\t\tfor(var i=0;i<dashBoardEle.length;i++){\n\t\t\tvar oActor = game.__addImageOnScene( director.getImage(dashBoardEle[i][0]), 1, 1 );\n\t\t\toActor.\t\t\t\n\t\t\t\tsetLocation(dashBoardEle[i][1], Number(dashBoardEle[i][2])+70);\t\t\t\n\t\t\tdashBG.addChild(oActor);\n\t\t\toActor.mouseDown = game.popupMDownHandler;\t\t\t\n\t\t}\n\t\t\n\t\t__createDashBoardButton();\n\t\t__createDashBoardTxt();\n\t\t__createSubstanceBtn();\n\t\tgame.__createSubstancePopup();\n\t\t\n\t\t\n\t\treturn dashBG;\n\t}", "title": "" }, { "docid": "55120be14cd95b4fb57e2510ccfd2aa7", "score": "0.5716919", "text": "createPanel(demand){\n return (<DemandPanel demand = {demand} />);\n }", "title": "" }, { "docid": "62c470ccb8ed290659a4ec8700eadffd", "score": "0.57151085", "text": "_initAnnotationPanel(){\n var that = this;\n\n\n\n // open file button\n this._annotationPanel.addFileChooser(\n \"Annotation file\",\n \"Open\",\n \"\",\n function( file ){\n that._annotationCollection.loadAnnotationFileDialog( file );\n }\n );\n\n // save annot button\n this._annotationPanel.addButton(\"Export annotations\", null);\n this._annotationPanel.overrideStyle(\"Export annotations\", \"width\", \"100%\");\n document.getElementById(\"Export annotations\").parentElement.style[\"margin-top\"] = \"0px\";\n\n // dropdown menu\n this._annotationPanel.addDropDown(\"Annotations\", [],\n function( dropdownObj ){\n var annotation = that._annotationCollection.getAnnotation( dropdownObj.value );\n\n if(annotation){\n that._displayAnnotInfo( annotation );\n }\n }\n );\n\n\n\n // callback when a new annot is added in the core, a new item shows on the menu\n that._annotationCollection.onAddingAnnotation( function(name){\n var dropdownObj = that._annotationPanel.getControl(\"Annotations\");\n dropdownObj.addItem(name);\n console.log( dropdownObj );\n\n //dropdownObj.setValue(name);\n\n var annotation = that._annotationCollection.getAnnotation( name );\n\n if(annotation){\n that._displayAnnotInfo( annotation );\n }\n })\n\n /*\n this._annotationPanel.getControl(\"Annotations\").removeItem(\"pouet2\");\n */\n\n // editable field for annotation name\n this._annotationPanel.addText(\"Annotation name\", \"\", function(){} );\n this._annotationPanel.overrideStyle(\"Annotation name\", \"text-align\", \"center\");\n\n // editable description of the annot\n this._annotationPanel.addTextArea(\"Annotation description\", \"\", function(){} );\n document.getElementById(\"Annotation description\").parentElement.style[\"margin-top\"] = \"0px\";\n\n // Pannel of buttons for dealing with existing annot\n this._annotationPanel.addHTML(\"panelEditExistingAnnot\", this._buildPanelEditExistingAnnot());\n document.getElementById(\"panelEditExistingAnnot\").parentElement.style[\"margin-top\"] = \"0px\";\n\n\n // Button to create a new annotation\n this._annotationPanel.addButton(\"Start new annotation\", function(){\n // show and hide the relevant componants\n that._annotationPanel.hideControl(\"panelEditExistingAnnot\");\n that._annotationPanel.showControl(\"panelCreateAnnot\");\n that._annotationPanel.showControl(\"Validate annotation\");\n that._annotationPanel.hideControl(\"Start new annotation\");\n\n // prevent the user from doing stupid interactions\n that._annotationPanel.disableControl(\"Annotations\");\n that._annotationPanel.disableControl(\"Export annotations\");\n that._annotationPanel.disableControl(\"Annotation file\");\n\n // enable creation\n // (the temp annot will 'really' be created at the first click)\n that._annotationCollection.enableAnnotCreation();\n });\n this._annotationPanel.overrideStyle(\"Start new annotation\", \"width\", \"100%\");\n\n // Button to validate a homemade annotation\n this._annotationPanel.addButton(\"Validate annotation\", function(){\n // show and hide the relevant componants\n that._annotationPanel.showControl(\"panelEditExistingAnnot\");\n that._annotationPanel.hideControl(\"panelCreateAnnot\");\n that._annotationPanel.hideControl(\"Validate annotation\");\n that._annotationPanel.showControl(\"Start new annotation\");\n\n // allow the user to interact\n that._annotationPanel.enableControl(\"Annotations\");\n that._annotationPanel.enableControl(\"Export annotations\");\n that._annotationPanel.enableControl(\"Annotation file\");\n\n // done with the creation\n that._annotationCollection.addTemporaryAnnotation();\n\n });\n this._annotationPanel.overrideStyle(\"Validate annotation\", \"width\", \"100%\");\n this._annotationPanel.hideControl(\"Validate annotation\");\n\n // homemade annot options\n this._annotationPanel.addHTML(\"panelCreateAnnot\", this._buildPanelCreateAnnot());\n document.getElementById(\"panelCreateAnnot\").parentElement.style[\"margin-top\"] = \"0px\";\n this._annotationPanel.hideControl(\"panelCreateAnnot\");\n }", "title": "" }, { "docid": "93880114bde17ee020cc8f40623f3e15", "score": "0.57107896", "text": "_initAnnotationPanel(){\n var that = this;\n\n\n\n // open file button\n this._annotationPanel.addFileChooser(\n \"Annotation file\",\n \"Open\",\n \"\",\n function( file ){\n that._annotationCollection.loadAnnotationFileDialog( file );\n }\n );\n\n // save annot button\n this._annotationPanel.addButton(\"Export annotations\", null);\n this._annotationPanel.overrideStyle(\"Export annotations\", \"width\", \"100%\");\n document.getElementById(\"Export annotations\").parentElement.style[\"margin-top\"] = \"0px\";\n\n // dropdown menu\n this._annotationPanel.addDropDown(\"Annotations\", [],\n function( dropdownObj ){\n var annotation = that._annotationCollection.getAnnotation( dropdownObj.value );\n\n if(annotation){\n that._displayAnnotInfo( annotation );\n }\n }\n );\n\n\n\n // callback when a new annot is added in the core, a new item shows on the menu\n that._annotationCollection.onAddingAnnotation( function(name){\n var dropdownObj = that._annotationPanel.getControl(\"Annotations\");\n dropdownObj.addItem(name);\n console.log( dropdownObj );\n\n //dropdownObj.setValue(name);\n\n var annotation = that._annotationCollection.getAnnotation( name );\n\n if(annotation){\n that._displayAnnotInfo( annotation );\n }\n });\n\n /*\n this._annotationPanel.getControl(\"Annotations\").removeItem(\"pouet2\");\n */\n\n // editable field for annotation name\n this._annotationPanel.addText(\"Annotation name\", \"\", function(){} );\n this._annotationPanel.overrideStyle(\"Annotation name\", \"text-align\", \"center\");\n\n // editable description of the annot\n this._annotationPanel.addTextArea(\"Annotation description\", \"\", function(){} );\n document.getElementById(\"Annotation description\").parentElement.style[\"margin-top\"] = \"0px\";\n\n // Pannel of buttons for dealing with existing annot\n this._annotationPanel.addHTML(\"panelEditExistingAnnot\", this._buildPanelEditExistingAnnot());\n document.getElementById(\"panelEditExistingAnnot\").parentElement.style[\"margin-top\"] = \"0px\";\n\n\n // Button to create a new annotation\n this._annotationPanel.addButton(\"Start new annotation\", function(){\n // show and hide the relevant componants\n that._annotationPanel.hideControl(\"panelEditExistingAnnot\");\n that._annotationPanel.showControl(\"panelCreateAnnot\");\n that._annotationPanel.showControl(\"Validate annotation\");\n that._annotationPanel.hideControl(\"Start new annotation\");\n\n // prevent the user from doing stupid interactions\n that._annotationPanel.disableControl(\"Annotations\");\n that._annotationPanel.disableControl(\"Export annotations\");\n that._annotationPanel.disableControl(\"Annotation file\");\n\n // enable creation\n // (the temp annot will 'really' be created at the first click)\n that._annotationCollection.enableAnnotCreation();\n });\n this._annotationPanel.overrideStyle(\"Start new annotation\", \"width\", \"100%\");\n\n // Button to validate a homemade annotation\n this._annotationPanel.addButton(\"Validate annotation\", function(){\n // show and hide the relevant componants\n that._annotationPanel.showControl(\"panelEditExistingAnnot\");\n that._annotationPanel.hideControl(\"panelCreateAnnot\");\n that._annotationPanel.hideControl(\"Validate annotation\");\n that._annotationPanel.showControl(\"Start new annotation\");\n\n // allow the user to interact\n that._annotationPanel.enableControl(\"Annotations\");\n that._annotationPanel.enableControl(\"Export annotations\");\n that._annotationPanel.enableControl(\"Annotation file\");\n\n // done with the creation\n that._annotationCollection.addTemporaryAnnotation();\n\n });\n this._annotationPanel.overrideStyle(\"Validate annotation\", \"width\", \"100%\");\n this._annotationPanel.hideControl(\"Validate annotation\");\n\n // homemade annot options\n this._annotationPanel.addHTML(\"panelCreateAnnot\", this._buildPanelCreateAnnot());\n document.getElementById(\"panelCreateAnnot\").parentElement.style[\"margin-top\"] = \"0px\";\n this._annotationPanel.hideControl(\"panelCreateAnnot\");\n }", "title": "" }, { "docid": "0b18916c52ef30fd1189689e80666aa3", "score": "0.57015216", "text": "function BoxPanel() {\n\t _super.call(this);\n\t this.addClass(BOX_PANEL_CLASS);\n\t }", "title": "" }, { "docid": "c5642ae28f8102e8020c72dfe085e100", "score": "0.57003105", "text": "getActivePanel() {\n return this.activePanel;\n }", "title": "" }, { "docid": "8fcff1d70ccdfb60441c3aef456dd05c", "score": "0.5697751", "text": "getPanels() {\n return this.getComposites();\n }", "title": "" }, { "docid": "c8de8f82d92a21de19b8c40023377c71", "score": "0.56974036", "text": "hasPanel() {\n return !!this.panel;\n }", "title": "" }, { "docid": "e8cc66ae3ea8cbcaf1f34b19c57ae566", "score": "0.569697", "text": "function ChartPanel(args) {\r\n\tvar _this = this;\r\n\tthis.width = \"800\";\r\n\tthis.height = \"500\";\r\n\r\n\tif (args != null) {\r\n\t\tif (args.width != null) {\r\n\t\t\tthis.width = args.width;\r\n\t\t}\r\n\t\tif (args.height != null) {\r\n\t\t\tthis.height = args.height;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.data = null;\r\n}", "title": "" }, { "docid": "d9c25843c58bd0bcb38b3367a21fdca5", "score": "0.56958747", "text": "function xTabPanelGroup(id, w, h, th, clsTP, clsTG, clsTD, clsTS) // object prototype\r\n{\r\n // Private Methods\r\n\r\n function onClick() //r7\r\n {\r\n paint(this);\r\n return false;\r\n }\r\n function onFocus() //r7\r\n {\r\n paint(this);\r\n }\r\n function paint(tab)\r\n {\r\n tab.className = clsTS;\r\n xZIndex(tab, highZ++);\r\n xDisplay(panels[tab.xTabIndex], 'block'); //r6\r\n \r\n if (selectedIndex != tab.xTabIndex) {\r\n xDisplay(panels[selectedIndex], 'none'); //r6\r\n tabs[selectedIndex].className = clsTD;\r\n \r\n selectedIndex = tab.xTabIndex;\r\n }\r\n }\r\n\r\n // Public Methods\r\n\r\n this.select = function(n) //r7\r\n {\r\n if (n && n <= tabs.length) {\r\n var t = tabs[n-1];\r\n if (t.focus) t.focus();\r\n else t.onclick();\r\n }\r\n }\r\n\r\n this.onUnload = function()\r\n {\r\n if (xIE4Up) for (var i = 0; i < tabs.length; ++i) {tabs[i].onclick = null;}\r\n }\r\n\r\n // Constructor Code (note that all these vars are 'private')\r\n\r\n var panelGrp = xGetElementById(id);\r\n if (!panelGrp) { return null; }\r\n var panels = xGetElementsByClassName(clsTP, panelGrp);\r\n var tabs = xGetElementsByClassName(clsTD, panelGrp);\r\n var tabGrp = xGetElementsByClassName(clsTG, panelGrp);\r\n if (!panels || !tabs || !tabGrp || panels.length != tabs.length || tabGrp.length != 1) { return null; }\r\n var selectedIndex = 0, highZ, x = 0, i;\r\n xResizeTo(panelGrp, w, h);\r\n xResizeTo(tabGrp[0], w, th);\r\n xMoveTo(tabGrp[0], 0, 0);\r\n w -= 2; // remove border widths\r\n var tw = w / tabs.length;\r\n for (i = 0; i < tabs.length; ++i) {\r\n xResizeTo(tabs[i], tw, th); \r\n xMoveTo(tabs[i], x, 0);\r\n x += tw;\r\n tabs[i].xTabIndex = i;\r\n tabs[i].onclick = onClick;\r\n tabs[i].onfocus = onFocus; //r7\r\n xDisplay(panels[i], 'none'); //r6\r\n xResizeTo(panels[i], w, h - th - 2); // -2 removes border widths\r\n xMoveTo(panels[i], 0, th);\r\n }\r\n highZ = i;\r\n tabs[0].onclick();\r\n}", "title": "" }, { "docid": "6589b871800d972d5cc1bae8775176eb", "score": "0.5694487", "text": "function getColorChooser(){\r\n\t\tvar pan = new Ext.Panel({\r\n\t\t\theight\t\t: 190,\r\n\t\t\twidth\t\t: 550,\r\n\t\t\tdefaults\t: {border : false},\r\n\t\t\t//renderTo\t: 'colorChooserPlaceId',\r\n\t\t\titems\t\t: [\r\n\t\t\t\t\t\t\t\tnew Ext.FormPanel({\r\n\t\t\t\t\t\t\t\t\tcls\t\t\t: 'frame-padding',\r\n\t\t\t\t\t\t\t\t\tdefaults\t: {border : false},\r\n\t\t\t\t\t\t\t\t\tlabelWidth\t: 40,\r\n\t\t\t\t\t\t\t\t\titems\t\t: [\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tgetSlider('red','rdId')\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\t\tgetSlider('green','grId')\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\t\tgetSlider('blue','blId')\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\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlayout\t\t: 'column',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefaults\t: {border:false},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\titems\t:[{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout\t\t: 'form',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolumnWidth\t: 0.35,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabelWidth\t: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefaults\t: {border:false},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titems\t: [{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\txtype\t\t: 'textfield',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid\t\t\t: 'hexReprezId',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treadOnly\t: true,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfieldLabel\t: 'Hex'\r\n\t\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\t\t\txtype\t\t: 'textfield',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid\t\t\t: 'rgbReprezId',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treadOnly\t: true,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfieldLabel\t: 'RGB'\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\t\tcolumnWidth\t: 0.65,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thtml\t\t: '<table height=45 width=\"100%\" id = \"demoColorId\"><tr>&nbsp;<td></td></tr></table>'\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}]\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t]\r\n\t\t});\r\n\t\t//refreshColor();\r\n\t\treturn pan;\r\n\t}", "title": "" }, { "docid": "eab0d3c0b00bcc207e577058694a3680", "score": "0.56939995", "text": "function panelToggle() {\n toggle_visibility('panel');\n changeWidth('map-container');\n resizeMap(map);\n}", "title": "" }, { "docid": "bb0cf2548cbd60742b3b25ba5ba506eb", "score": "0.5690104", "text": "function PatrolBOX(){}", "title": "" }, { "docid": "b929d95d19aa6b3c200e0e5971ac632c", "score": "0.5683071", "text": "function createPanel(){\n var panel = document.createElement('div');\n panel.classList.add('panel');\n panel.classList.add('panel-default')\n var panelBody = document.createElement('div');\n panelBody.classList.add('panel-body');\n var panelFooter = document.createElement('div');\n panelFooter.classList.add('panel-footer');\n panel.appendChild(panelBody);\n panel.appendChild(panelFooter);\n return panel;\n }", "title": "" }, { "docid": "5b001c18c56c1b3a3951299f13f9eb50", "score": "0.5679495", "text": "function removePanel(panel){\r\n\tpanel = typeof(panel) == typeof('str')\r\n\t\t? getPanel(panel)\r\n\t\t: panel\r\n\t/*\r\n\tif(PANEL_CLOSE_METHOD == 'hide'){\r\n\t\treturn closePanel(panel)\r\n\t\t\t.hide()\r\n\t} else {\r\n\t\treturn closePanel(panel)\r\n\t\t\t.remove()\r\n\t}\r\n\t*/\r\n\treturn closePanel(panel)\r\n\t\t.hide()\r\n}", "title": "" }, { "docid": "6fa316d909ef4935cb36d0338980d30e", "score": "0.5678349", "text": "function createPanel( pw, ph, director ){\n\t\tdashBG = new CAAT.Foundation.ActorContainer().\n\t\t\t\t\tsetPreferredSize( pw, ph ).\n\t\t\t\t\tsetBounds( 0, 0, pw, ph ).\n\t\t\t\t\tsetClip(false);\t\t\n\t\t//create bottom panel\n\t\tfor(var i=0;i<dashBoardEle.length;i++){\n\t\t\tvar oActor = game.__addImageOnScene( director.getImage(dashBoardEle[i][0]), 1, 1 );\n\t\t\toActor.\t\t\t\n\t\t\t\tsetLocation(dashBoardEle[i][1], dashBoardEle[i][2]);\t\t\t\n\t\t\tif(i == dashBoardEle.length-1) {\n\t\t\t\t__createBannerContainer();\t\n\t\t\t}\n\t\t\tdashBG.addChild(oActor);\t\t\t\n\t\t}\t\t\t\t\n\t\t__createDashBoardTxt();\n\t\t__createDashBoardButton();\n\t\t__createInputTxtBox('launchSpeed', '50px', '556px', '515px');\n\t\t__createInputTxtBox('orbitalRadius', '50px', '556px', '545px');\n\t\treturn dashBG;\n\t}", "title": "" }, { "docid": "16191fa03addc6a98409c08af7e3a405", "score": "0.5677551", "text": "function showPanel(e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n dropContainer.className = 'visible';\r\n return false;\r\n}", "title": "" }, { "docid": "db61891ba0d37968c60dc8a937507f36", "score": "0.5674169", "text": "initializePanels() {\n const panelItems = [];\n let panelIndex = 0;\n for (\n let i = 0;\n i < this._carouselItems.length;\n i += this.itemsPerPanel\n ) {\n panelItems.push({\n index: panelIndex,\n key: `panel-${panelIndex}`,\n items: this._carouselItems.slice(i, i + this.itemsPerPanel),\n ariaHidden:\n this.activeIndexPanel === i ? FALSE_STRING : TRUE_STRING\n });\n panelIndex += 1;\n }\n this.panelItems = panelItems;\n this.panelStyle = `transform: translateX(-${\n this.activeIndexPanel * 100\n }%);`;\n }", "title": "" }, { "docid": "c1673685f7d7e04c67221a7e731a3580", "score": "0.5671731", "text": "function DewarPanel(args) {\r\n\tvar _this = this;\r\n\tthis.width = 550;\r\n\tthis.height = 500;\r\n\r\n\tif (args != null) {\r\n\t\tif (args.width != null) {\r\n\t\t\tthis.width = args.width;\r\n\t\t}\r\n\t\tif (args.height != null) {\r\n\t\t\tthis.height = args.height;\r\n\t\t}\r\n\t}\r\n\t// index of the dewar in the dewar tabs\r\n\tthis.dewarIndex = -1;\r\n\t// dewarId (from the database)\r\n\tthis.dewarId = -1;\r\n\tthis.contextPath = \"\";\r\n\t// pucks tab\r\n\tthis.puckTab = null;\r\n\t// list of the puck panels\r\n\tthis.listPuckPanel = null;\r\n\t\r\n\t//Events\r\n\t// add puck\r\n\tthis.onAddPuckButtonClicked = new Event(this);\r\n\t// edit dewar\r\n\tthis.onEditDewarButtonClicked = new Event(this);\r\n\t// remove dewar\r\n\tthis.onRemoveDewarButtonClicked = new Event(this);\r\n\t// edit puck\r\n\tthis.onEditPuckButtonClicked = new Event(this);\r\n\t// remove puck\r\n\tthis.onRemovePuckButtonClicked = new Event(this);\r\n\t// save puck\r\n\tthis.onSavePuckButtonClicked = new Event(this);\r\n\t// copy puck\r\n\tthis.onCopyPuckButtonClicked = new Event(this);\r\n\t// paste puck\r\n\tthis.onPastePuckButtonClicked = new Event(this);\r\n\t// copy sample\r\n\tthis.onCopySampleButtonClicked = new Event(this);\r\n}", "title": "" }, { "docid": "dc53f3c05ddbd91ad33ff0844f5e206a", "score": "0.5670032", "text": "function ParcelPanel(args) {\n\tthis.id = BUI.id();\n\tthis.height = 500;\n\tthis.width = 500;\n\n\tthis.isSaveButtonHidden = false;\n\tthis.isHidden = false;\n\n\tif (args != null) {\n\t\tif (args.height != null) {\n\t\t\tthis.height = args.height;\n\t\t}\n\t\tif (args.width != null) {\n\t\t\tthis.width = args.width;\n\t\t}\n\t}\n\t\n\tthis.onSavedClick = new Event(this);\n}", "title": "" } ]
a7112c06bb06c5f2652a2485929aa34d
The ready event handler and self cleanup method
[ { "docid": "1f61c56bf7ddad8f9914f6cf27f039e5", "score": "0.0", "text": "function completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}", "title": "" } ]
[ { "docid": "a5c485379ee917157bf91dbeb32b198c", "score": "0.7365059", "text": "onready() {}", "title": "" }, { "docid": "0b9b64afbc55efee8163443235f43d22", "score": "0.73077095", "text": "whenReady() {\n //\n }", "title": "" }, { "docid": "4f96fecef0ad8efb86594d9a7261d114", "score": "0.71238387", "text": "function onReady() {\n\t\t// domReady = true;\n\n\t\tthis.setBodyType();\n\t\tthis.setFavicon();\n\t\tthis.replaceHolderImgs();\n\n\t}", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.70596856", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.70596856", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.70596856", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.70596856", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.70596856", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "2b81ebfae36b39692514ac3cf2afe1c3", "score": "0.7059564", "text": "ready() {\n }", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.7042607", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "258f16216474183a1e0ea03663e2729b", "score": "0.70334196", "text": "function readyHandler() {\r\n\t\t\tif (!event_utils.domLoaded) {\r\n\t\t\t\tevent_utils.domLoaded = true;\r\n\t\t\t\tcallback(event);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.6910091", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.6910091", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.6910091", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.6910091", "text": "ready() { }", "title": "" }, { "docid": "97ac6b127627d0d04e10a0c2f8f0cdbf", "score": "0.6895621", "text": "_ready() {\n\n }", "title": "" }, { "docid": "e28cda0ae8c751cc61645ce24e508673", "score": "0.6862275", "text": "function qodefOnDocumentReady() {\n\n }", "title": "" }, { "docid": "5af463e11291bc2e416f35e30d9ac86e", "score": "0.6825584", "text": "function ready() {\n\t\t// Initialise the events.\n\t\tinit();\n\n\t\t// Set up a MutationObserver to check for comments loaded late.\n\t\tobserveChanges();\n\t}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.67045325", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.67045325", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.67045325", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.67045325", "text": "ready() {}", "title": "" }, { "docid": "527e691dc09a6ca8d1910b7c54d04318", "score": "0.66994125", "text": "ready() {\n this._root = this._createRoot();\n super.ready();\n this._firstRendered();\n }", "title": "" }, { "docid": "527e691dc09a6ca8d1910b7c54d04318", "score": "0.66994125", "text": "ready() {\n this._root = this._createRoot();\n super.ready();\n this._firstRendered();\n }", "title": "" }, { "docid": "b64cfa23f053398cca3a3bc3a8eed065", "score": "0.6591491", "text": "function readyHandler(){if(!eventUtils.domLoaded){eventUtils.domLoaded=true;callback(event);}}", "title": "" }, { "docid": "826706fed07c9407736510a8cbfb5e0a", "score": "0.6587533", "text": "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n }", "title": "" }, { "docid": "7a4734041db5cc4980751695f7b9c774", "score": "0.6582671", "text": "ready() {\n\t\t\t\tsuper.ready();\n\n\t\t\t\tafterNextRender(this, function() {\n \n\t\t\t\t});\n }", "title": "" }, { "docid": "b4a723b9c538d3eb7d72b4b04f8b0603", "score": "0.6577741", "text": "function completed() {\n document.removeEventListener( \"DOMContentLoaded\", completed );\n window.removeEventListener( \"load\", completed );\n jQuery.ready();\n }", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.65647024", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.65647024", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.65647024", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "04940ab1ba16de4957e87e15ab9de309", "score": "0.6559988", "text": "function completed() {\n\t document.removeEventListener(\"DOMContentLoaded\", completed, false);\n\t window.removeEventListener(\"load\", completed, false);\n\t jQuery.ready();\n\t }", "title": "" }, { "docid": "752d1fcf3a6eda86677d252503ccf3bf", "score": "0.65521723", "text": "function ready () {\n\n}", "title": "" }, { "docid": "55a20ac7a79a0bfe8bdf14214f669b02", "score": "0.6536818", "text": "function Ready() {\r\n\t\t\r\n\t\t// log('AGO_Module - Ready' );\r\n\t}", "title": "" }, { "docid": "2b8711d255a99fa9a1624307d8020d28", "score": "0.65323627", "text": "function qodefOnWindowLoad() {\n\t\tuncoveringFooter();\n\t}", "title": "" }, { "docid": "d5d17afe02a575e4e081c40f836e198b", "score": "0.652018", "text": "ready() {\n super.ready();\n this.$.nxResource.addEventListener('loading-changed', () => {\n this._setLoading(this.$.nxResource.loading);\n });\n }", "title": "" }, { "docid": "673db009d36605ea0da443d54c3174e9", "score": "0.65192884", "text": "function systemReady() {\n\t\t//console.log(\"Interactions:systemReady\");\n\t\t\n\t\t/*$(\"div.top-menu.container\").off(\"click\", \".quit\");\n\t\tvar lang = $(\"html\").attr(\"lang\");\n\t\t$(\".quit\").attr(\"href\", \"content/tools/quit_\" + lang + \".html\").attr(\"data-effect\", \"mfp-zoom-in\").addClass(\"wb-lbx\").attr(\"id\", \"quitButton\");\n\t\twb.add('.wb-lbx');*/\n\t\t\n\t\t/*$(\"*\").focus(function(){\n\t\t\tconsole.log($(this));\n\t\t});*/\n\t}", "title": "" }, { "docid": "d9e4c24344200058cabce4a10eb7358f", "score": "0.6512111", "text": "function completed() {\n\t\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\t\twindow.removeEventListener(\"load\", completed);\n\t\t\tjQuery.ready();\n\t\t}", "title": "" }, { "docid": "d9e4c24344200058cabce4a10eb7358f", "score": "0.6512111", "text": "function completed() {\n\t\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\t\twindow.removeEventListener(\"load\", completed);\n\t\t\tjQuery.ready();\n\t\t}", "title": "" }, { "docid": "9f8fe56a8396663a314209f3d5901122", "score": "0.6497107", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}", "title": "" }, { "docid": "9e1b83b93ac411d0964eb0de74998c99", "score": "0.64933604", "text": "function completed() {\n\n\t\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t\t\tif (document.addEventListener || window.event.type === \"load\" || document.readyState === \"complete\") {\n\n\t\t\t\tdetach();\n\t\t\t\tjQuery.ready();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dfc60be1c464ac4c53681994ce42079a", "score": "0.6486457", "text": "function onReady(event) {\n\n arduino.removeEventListener(IOBoardEvent.READY, onReady);\n \n initGUILedListeners();\n initGUIPotListeners();\n initGUILdrListeners();\n initGUISpeakerListeners();\n initGUIButtonListeners(); // not used yet \n \n }", "title": "" }, { "docid": "046bfd6c1237f7729d1ac9b18a27b478", "score": "0.64861494", "text": "ready() {\n\n this.updateSelect();\n this.updateScript();\n\n this.$btn.addEventListener('confirm', () => {\n this.$loading.style.display = 'block';\n this.runScript();\n });\n\n this.$update.addEventListener('confirm', () => {\n this.updateSelect();\n this.updateScript();\n });\n\n this.$select.addEventListener('change', () => {\n this.updateMarkDown();\n this.updateScript();\n });\n\n this.$loading.style.display = 'none';\n }", "title": "" }, { "docid": "60afaf3e0ce8ac1e87e1fb5eda3ddaf9", "score": "0.64787245", "text": "onReady() {\n\n }", "title": "" }, { "docid": "4b117b3982f4065563b60cc94f6df66d", "score": "0.64749104", "text": "function onDOMReady() {\n // Make sure that the DOM is not already loaded\n if (isReady) return;\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if (!document.body) return setTimeout(onDOMReady, 0);\n // Remember that the DOM is ready\n isReady = true;\n // Make sure this is always async and then finishin init\n setTimeout(function() {\n app._finishInit();\n }, 0);\n }", "title": "" }, { "docid": "46600b986dc6a4af170dc05955a60466", "score": "0.64713013", "text": "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called", "title": "" }, { "docid": "d47f6b373414c202becdd9597e2bdb07", "score": "0.64680004", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed,false);window.removeEventListener(\"load\",completed,false);jQuery.ready();}", "title": "" }, { "docid": "d47f6b373414c202becdd9597e2bdb07", "score": "0.64680004", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed,false);window.removeEventListener(\"load\",completed,false);jQuery.ready();}", "title": "" }, { "docid": "2d598f6a1bce62fa2fb08aeb24da431d", "score": "0.64608455", "text": "function onReady() \n\t{\t\t\n\t\t// If we're still loading libs, don't progress!\t\t\n\t\tif(libsLoaded<libsToLoad)\n\t\t{\t\t\n\t\t\treturn;\n\t\t}\n\t\t\t\t\n\t\tif(flagEmbedCalled)\n\t\t{\n\t\t\t// Embed body support scripts\n\t\t\tembedSupportBodyScripts();\n\t\t\t\n\t\t\t// Embed CSS\n\t\t\tembedCSS();\n\t\t\t\n\t\t\t// Prepare to launch the embed\n\t\t\tsetTimeout( executeJsEmbed, 500);\n\t\t}\t\n\t}", "title": "" }, { "docid": "b09dee334948e0022695808c1b191e05", "score": "0.6447311", "text": "ready() {\n const that = this;\n\n super.ready();\n\n that._isParentPositionStatic = window.getComputedStyle(that.parentElement || document.querySelector('body')).position === 'static';\n that._handleSelector(that.selector);\n that._applyPosition();\n that._handleEventListeners();\n that._handleResize();\n\n that.value = that.$.content.innerHTML = that.value ? that.value : that.innerHTML;\n that._handleTemplate();\n }", "title": "" }, { "docid": "706fe91b5f2b6ccf6bd30973fe29aa02", "score": "0.64306515", "text": "function completed() {\n \tdocument.removeEventListener( \"DOMContentLoaded\", completed, false );\n \twindow.removeEventListener( \"load\", completed, false );\n \tjQuery.ready();\n }", "title": "" }, { "docid": "0334fef3cd8bb3fe27ae54fb87c87d8c", "score": "0.64232594", "text": "function readyListener (e) {\r\n start();\r\n }", "title": "" }, { "docid": "f6d0cd65965f93372a9735c52066915e", "score": "0.64206946", "text": "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageLoad();\n }", "title": "" }, { "docid": "7465b08dc5c551a5d43fc22efbd45a6b", "score": "0.64183176", "text": "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n }", "title": "" }, { "docid": "63273e87939816dd9b743bcc5d3ab859", "score": "0.641613", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "title": "" }, { "docid": "63273e87939816dd9b743bcc5d3ab859", "score": "0.641613", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "title": "" }, { "docid": "63273e87939816dd9b743bcc5d3ab859", "score": "0.641613", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "title": "" }, { "docid": "63273e87939816dd9b743bcc5d3ab859", "score": "0.641613", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "title": "" }, { "docid": "63273e87939816dd9b743bcc5d3ab859", "score": "0.641613", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "title": "" }, { "docid": "63273e87939816dd9b743bcc5d3ab859", "score": "0.641613", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "title": "" }, { "docid": "61720da8f2d99d1c239905dcf412d5c3", "score": "0.6404238", "text": "function onready() {\r\n myconnection = true;\r\n connectcb();\r\n readycb();\r\n }", "title": "" }, { "docid": "aac79836dc71d3b90859885a397e72e6", "score": "0.63979137", "text": "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed, false);\n window.removeEventListener(\"load\", completed, false);\n jQuery.ready();\n }", "title": "" }, { "docid": "e98a6c1aab9fd551c87705c7bfebd3a9", "score": "0.63952833", "text": "ready() {\n this.__dataReady = true;\n // Run normal flush\n this._flushProperties();\n }", "title": "" }, { "docid": "6d71ff87fbb62e56638b5dcf0588b22d", "score": "0.63927", "text": "function completed() {\n document.removeEventListener(\n 'DOMContentLoaded',\n completed,\n )\n window.removeEventListener('load', completed)\n jQuery.ready()\n }", "title": "" }, { "docid": "12b624fa05fe5674b34420abe599d2ca", "score": "0.6362682", "text": "function sysOnDocumentReady() {\n sys.body.removeClass('is-loading');\n landingCalcHeights();\n systemLoader();\n videoBgSize();\n }", "title": "" }, { "docid": "d1e5cc5138944cdc4390eb2c46167129", "score": "0.6355009", "text": "function edgtfOnDocumentReady() {\n \tedgtfTitleFullWidthResize();\n edgtfEventImagesSlider();\n edgtfEventsRelatedProducts();\n edgtfInitEventsLoadMore();\n edgtfInitEventListCarousel();\n }", "title": "" }, { "docid": "73556bd73ddc6d5363b79002a07184f7", "score": "0.6353075", "text": "function onReady() {\n module = this; //IMPORTANT: get a hold of themed module object.\n setupEvenHandlers();\n }", "title": "" }, { "docid": "3cad611b274fc120ac305def7f182c3f", "score": "0.6352426", "text": "function pageReady(){\n legacySupport();\n\n initHeaderScroll();\n _window.on('scroll', throttle(initHeaderScroll, 25))\n _window.on('resize', debounce(initHeaderScroll, 200))\n\n initScrollMonitor();\n initMasks();\n initSelects();\n initReadmore();\n initLazyLoad();\n\n initMasonry();\n setTimeout(initMasonry, 300);\n parseSvg();\n initValidations();\n\n _window.on('resize', debounce(initMasonry, 200));\n }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6343617", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6343617", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6343617", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6343617", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6343617", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6343617", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6343617", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6343617", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "46033b9a2689c5d3d341486f8c3070a5", "score": "0.6332483", "text": "function qodefOnDocumentReady() {\n\t\tqodefInitRecipe();\n qodefReInitRecipe();\n\t}", "title": "" }, { "docid": "11e6a086a1f52e732e04dd1a7358c8a6", "score": "0.6330764", "text": "function ready() {\n\t\tif(config.logging) log('DonkeyKongVC.ready()');\n\n\t\t//SET STATE\n\t\tif(supportsWebGL()){\n\t\t\tcreate3DScene();\n\t\t\t$(mainStage).addClass('mode__3D');\n\t\t\t$(art).addClass('hasBackgroundImage');\n\t\t}else{\n\t\t\tcreateFlipBook();\n\t\t\t$(mainStage).addClass('mode__2D');\n\t\t\t$(art).css({background:'black'});\n\t\t}\n\n\t\t//INIT INTERACTION\n\t\tdisableSelectionOnMobileBrowsers(art);//Prevent selection of art elements.\n\t\t//FastClick.attach(art);//Allow faster interaction on mobile. This prevents double-clicks.\n\t\t$(window).bind('resize', onResize);\n\t\t$(window).bind('mousemove', onMouseMove);//Now start responding the user's cursor.\n\n\t\treadied = true;\n\t}", "title": "" }, { "docid": "f4555c3c0e428654f968649f631a1bcd", "score": "0.6327148", "text": "function completed() {\n\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t\tif ( document.addEventListener || event.type === \"load\" || document.readyState === \"complete\" ) {\n\t\t\tdetach();\n\t\t\tjQuery.ready();\n\t\t}\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "6d7e2029109ea5795417a56f37a69ad1", "score": "0.632598", "text": "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "title": "" }, { "docid": "9cb83cd056688b6b82412b79a7776356", "score": "0.63255256", "text": "function isReady() {\n\t\t\t$body.addClass('ready');\n\t\t\tready = true;\n\t\t\t$window.off('resize', readyHandler);\n\t\t}", "title": "" }, { "docid": "60bf4b579e52bfe90a3e29369585a605", "score": "0.63215226", "text": "function pageReady(){\n legacySupport();\n updateHeaderActiveClass();\n initHeaderScroll();\n\n initPopups();\n initSliders();\n initScrollMonitor();\n initMasks();\n initValidations();\n // initLazyLoad();\n\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "title": "" }, { "docid": "991967f71d320c5182f52d87053c5748", "score": "0.63173294", "text": "function completed() {\n\n\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t\tif ( document.addEventListener ||\n\t\t\twindow.event.type === \"load\" ||\n\t\t\tdocument.readyState === \"complete\" ) {\n\n\t\t\tdetach();\n\t\t\tjQuery.ready();\n\t\t}\n\t}", "title": "" }, { "docid": "5f6f24a37fe71f1cb683d6c09c490662", "score": "0.63158935", "text": "function completed(event) {\n\t\t\t\t\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t\t\t\t\t\tif (w3c || event.type === LOAD || doc[READYSTATE] === COMPLETE) {\n\t\t\t\t\t\t\tdetach();\n\t\t\t\t\t\t\tready();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "title": "" }, { "docid": "5be2ba1af49f4cd0fcd44c73ccfa76bf", "score": "0.63071895", "text": "function ready() {\n\t\tif(config.logging) log('SuperMarioWorld.ready()');\n\n\t\t//INIT INTERACTION\n\t\tdisableSelectionOnMobileBrowsers(art);//Prevent selection of art elements.\n\t\t//FastClick.attach(art);//Allow faster interaction on mobile. This prevents double-clicks.\n\t\t$(window).bind('resize', onResize);\n\t\t$(marioAndYoshi).bind('click', marioAndYoshi__onClick);\n\t\t$(marioAndYoshi).bind('mouseover', circleMask__hoverEffect__over);\n\t\t$(marioAndYoshi).bind('mouseout', circleMask__hoverEffect__out);\n\t\t$(foods).bind('click', foods__onClick);\n\n\t\t//SET INITIAL STATE\n\t\tshowFood(foods[0]);//Show the first food, so Yoshi can eat it.\n\t\twaitForPanting();\n\t\tif(audioLoaded && !courseClearAudioHasPlayed){\n\t\t\tcourseClearAudioHasPlayed = true;\n\t\t\twindow._AVManager.playAudio(courseClearAudioPrototype);\n\t\t}\n\n\t\treadied = true;\n\t}", "title": "" }, { "docid": "c8b37cb8d247acdc0353a32b8a719e60", "score": "0.63051754", "text": "function ready () {\n\t this._isAttached = true\n\t this._isReady = true\n\t this._callHook('ready')\n\t}", "title": "" }, { "docid": "c8b37cb8d247acdc0353a32b8a719e60", "score": "0.63051754", "text": "function ready () {\n\t this._isAttached = true\n\t this._isReady = true\n\t this._callHook('ready')\n\t}", "title": "" }, { "docid": "334e3e44c6de9fcff2d5a5ea49eaea7c", "score": "0.63029313", "text": "function pageReady(){\n legacySupport();\n updateHeaderActiveClass();\n initHeaderScroll();\n\n initPopups();\n initSliders();\n initScrollMonitor();\n initMasks();\n initSelectric();\n initValidations();\n // custom\n inputFile();\n // videoEvents(); \n customTabs(); \n scrollTop();\n checkBox();\n // formSend();\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n\n // AVAILABLE in _components folder\n // copy paste in main.js and initialize here\n // initPerfectScrollbar();\n // initLazyLoad();\n // initTeleport();\n // parseSvg();\n // revealFooter();\n // _window.on('resize', throttle(revealFooter, 100));\n }", "title": "" }, { "docid": "1b125557ea68137a855c52f80ed586db", "score": "0.629726", "text": "function onready () {\n if (--pending === 0 && onload)\n onload();\n }", "title": "" }, { "docid": "4cf1e7ec0948a138134d07694cf06fa1", "score": "0.62962246", "text": "ready() {\n super.ready();\n\n Polymer.RenderStatus.afterNextRender(this, function () {\n\n });\n }", "title": "" }, { "docid": "2aee29785d1d58fa1d000a6539167e6b", "score": "0.6289483", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "ec4256d445510f9f4787eea3d6662151", "score": "0.6286397", "text": "function qodeOnWindowLoad() {\r\n qodeInitElementorExpendableSection();\r\n }", "title": "" } ]
c7eff82261ac49c18f611e406168f161
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
[ { "docid": "9f521435975e63db80293d35f134f9bf", "score": "0.0", "text": "function xhrInterceptor() {\n var originalXHR = window.XMLHttpRequest;\n var xhrSend = XMLHttpRequest.prototype.send;\n var xhrOpen = XMLHttpRequest.prototype.open;\n originalXHR.getRequestConfig = [];\n function ajaxEventTrigger(event) {\n var ajaxEvent = new CustomEvent(event, { detail: this });\n window.dispatchEvent(ajaxEvent);\n }\n function customizedXHR() {\n var liveXHR = new originalXHR();\n liveXHR.addEventListener('readystatechange', function () {\n ajaxEventTrigger.call(this, 'xhrReadyStateChange');\n }, false);\n liveXHR.open = function (method, url, async, username, password) {\n this.getRequestConfig = arguments;\n return xhrOpen.apply(this, arguments);\n };\n liveXHR.send = function (body) {\n return xhrSend.apply(this, arguments);\n };\n return liveXHR;\n }\n window.XMLHttpRequest = customizedXHR;\n }", "title": "" } ]
[ { "docid": "51bb3732e1e895252cd69e7942ccc7c6", "score": "0.5351376", "text": "get Android() {}", "title": "" }, { "docid": "a2e90e3226ecd5bc8757eedf8bed540a", "score": "0.4905915", "text": "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "title": "" }, { "docid": "706afbac628a85c33373f8e6d5739ed3", "score": "0.4854607", "text": "onChildAppStart () {\n\n }", "title": "" }, { "docid": "44dfde9906fa1c183245d889a94dcfc2", "score": "0.48257184", "text": "private internal function m248() {}", "title": "" }, { "docid": "650ff554859977bab92401016e1b7806", "score": "0.4787349", "text": "private public function m246() {}", "title": "" }, { "docid": "a4498ac27796e5f809bc9e12297c7fcf", "score": "0.47423014", "text": "onMessageStart() { }", "title": "" }, { "docid": "89b26217dbb31b99166108a3b89a800d", "score": "0.47285512", "text": "createStream () {\n\n }", "title": "" }, { "docid": "0fa53cc979bbaa8b26867904dc83baa6", "score": "0.47095534", "text": "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.4695136", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.4695136", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.4676178", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "0da4302d140fca8aa5bdffe288668813", "score": "0.46523333", "text": "onComponentMount() {\n\n }", "title": "" }, { "docid": "e20d36a8b26e163da19fe04ae884c878", "score": "0.46466222", "text": "constructor() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "6b1058340f927cec4da531568795c919", "score": "0.46392593", "text": "supportsPlatform() {\n return true;\n }", "title": "" }, { "docid": "befdecdf4a7bf48d9420b7d26c55916d", "score": "0.46310723", "text": "function _____SHARED_functions_____(){}", "title": "" }, { "docid": "d137af80c61e1e90ad9432eae8f932d5", "score": "0.45859143", "text": "constructor() {\n }", "title": "" }, { "docid": "f66ee57414255f4244ad5d088c1767f9", "score": "0.45854202", "text": "constructor() {\n\t\t// ...\n\t}", "title": "" }, { "docid": "a13b5679efa0326457eefcbcd955f21d", "score": "0.45678926", "text": "static get tag(){return\"hal-9000\"}", "title": "" }, { "docid": "5215baaefb03e630793f49ff4d2431f8", "score": "0.45665687", "text": "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "title": "" }, { "docid": "ad91cf774842c7f01d01e1212f9f184d", "score": "0.45628", "text": "constructor () { super() }", "title": "" }, { "docid": "0d35f05226dd779572b4914e72f16346", "score": "0.45577613", "text": "requestContainerInfo() {}", "title": "" }, { "docid": "5022f798dc87979c97341ab472260586", "score": "0.4549963", "text": "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "title": "" }, { "docid": "3c14b613d3831c26158ab7d9d59b4074", "score": "0.45495", "text": "static get STATUS() {\n return 0;\n }", "title": "" }, { "docid": "0b7423ba7d3171e8e75de880e5b2e542", "score": "0.454887", "text": "static create () {}", "title": "" }, { "docid": "eec1c9bcf710a011c15ca8b5b2a4f0b6", "score": "0.45337138", "text": "get() {}", "title": "" }, { "docid": "934e2bb0faf68bb56b22f4efdf92f3af", "score": "0.4528999", "text": "didMount() {\n }", "title": "" }, { "docid": "c8cf005c18d1b328d6d35dd990666949", "score": "0.4528538", "text": "_onMessage() {\n throw new Error(\"not implemented\");\n }", "title": "" }, { "docid": "7a378e5761f31c9ce07eb5ed13895298", "score": "0.45113158", "text": "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "title": "" }, { "docid": "77c8a2ae2e5e971058ea55414a9df3df", "score": "0.45029008", "text": "onReady() {}", "title": "" }, { "docid": "7c073382645e58804c6f7a6d808b45ae", "score": "0.4490148", "text": "function sdk(){\n}", "title": "" }, { "docid": "67fb1e0945a420ae9db984ef54bcf3d1", "score": "0.4487926", "text": "transient private protected internal function m182() {}", "title": "" }, { "docid": "87ba68c22404f14f983ab256193c0855", "score": "0.44810322", "text": "function version(){ return \"0.13.0\" }", "title": "" }, { "docid": "b42351186d39e9dcb30e6c46cddcfeee", "score": "0.44739294", "text": "constructor () {\r\n\t\t\r\n\t}", "title": "" }, { "docid": "b33f113b364cb6a949568de25eed0541", "score": "0.4468386", "text": "transient private internal function m185() {}", "title": "" }, { "docid": "611bd1ddc1b2b74bc9fbd7ea511e2bd6", "score": "0.44625273", "text": "function getVersion(){return _VERSION}", "title": "" }, { "docid": "36f21e25650d3be89976e1a67f0b6e20", "score": "0.44557703", "text": "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "title": "" }, { "docid": "89b8b2efd42d72c7d3e961a4bd8c2248", "score": "0.4453393", "text": "started () {}", "title": "" }, { "docid": "afcd2d9c184af913f1dbe719d1e5197f", "score": "0.44460705", "text": "constructor() {\r\n }", "title": "" }, { "docid": "e1fd6370f9dceb24ecc3cd7ebbb8a8e8", "score": "0.44373614", "text": "function SigV4Utils() { }", "title": "" }, { "docid": "81eda219db33b5a1ecc246ece2a71000", "score": "0.44359353", "text": "started() { }", "title": "" }, { "docid": "a3f1d4bd3000b937e285a6582425583b", "score": "0.44299448", "text": "InitVsaEngine() {\n\n }", "title": "" }, { "docid": "682da74dff986b3e866aabe9c806ae1a", "score": "0.4423088", "text": "started() {\r\n\r\n\t}", "title": "" }, { "docid": "2c6ccb426a6b20125595abdbab58ee7e", "score": "0.4413375", "text": "static get NOT_READY () {return 0}", "title": "" }, { "docid": "069fa12d6ffc4f1cb9ef54cc58fcb53a", "score": "0.44069594", "text": "initialize() {\n\n }", "title": "" }, { "docid": "53873a2057b8048d115000276c1b30be", "score": "0.44024247", "text": "started () {\n\n }", "title": "" }, { "docid": "53873a2057b8048d115000276c1b30be", "score": "0.44024247", "text": "started () {\n\n }", "title": "" }, { "docid": "53873a2057b8048d115000276c1b30be", "score": "0.44024247", "text": "started () {\n\n }", "title": "" }, { "docid": "f9ecb3f381b2ca8f9d9cf7369fa488f8", "score": "0.43905327", "text": "onMessageReceive() {}", "title": "" }, { "docid": "0c6425eaf76bccf7d0ad4cb5c4700373", "score": "0.43789524", "text": "_get () {\n throw new Error('_get not implemented')\n }", "title": "" }, { "docid": "f97925d34e944763d94c11ac8b79c5e8", "score": "0.4378156", "text": "initialize()\n {\n }", "title": "" }, { "docid": "ab3d1370bcb794d3e26977d98977c49c", "score": "0.4365931", "text": "get () {\n }", "title": "" }, { "docid": "28d6c8882b456d32efd62295bb8bb3fb", "score": "0.43558544", "text": "static final private internal function m106() {}", "title": "" }, { "docid": "1617b4034467c7c498a7fc169a85b34f", "score": "0.4355582", "text": "function getImplementation( cb ){\n\n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.43539047", "text": "constructor() {\n \n }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.43537718", "text": "constructor() { }", "title": "" }, { "docid": "379ee6e584dbcff5d038e8491b0ab04f", "score": "0.4350863", "text": "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.4348229", "text": "started() {}", "title": "" }, { "docid": "2b2aa45d638ae6fbfb3ac01f2dd61e31", "score": "0.43478873", "text": "heartbeat () {\n }", "title": "" }, { "docid": "cf9ce75761cad4941aee8bb5bc575522", "score": "0.43416616", "text": "transient final protected internal function m174() {}", "title": "" }, { "docid": "8f18d15e82287a7d7d98a3c433012329", "score": "0.43370178", "text": "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "title": "" }, { "docid": "17cebceac8bbe029c7640dddf0926714", "score": "0.43352035", "text": "get WSAPlayerX64() {}", "title": "" }, { "docid": "0ac879117f01703f674dc2a6cbc5b73b", "score": "0.43343797", "text": "onMessage() {}", "title": "" }, { "docid": "0ac879117f01703f674dc2a6cbc5b73b", "score": "0.43343797", "text": "onMessage() {}", "title": "" } ]
6afcb0b11057afab9e2fdab7b8524a4e
Computes the intersection of a line and this clipping edge.
[ { "docid": "68204b6cb4c2b2e7496d9de11fd6f0fc", "score": "0.0", "text": "computeIntersection(a, b) {\n const { x: x1, y: y1 } = a;\n const { x: x2, y: y2 } = b;\n return new three_1.Vector2((x1 * y2 - y1 * x2) / -(y1 - y2), 0).round();\n }", "title": "" } ]
[ { "docid": "6b86ce0dd80d6f34bca4863895222bcf", "score": "0.73965675", "text": "intersect (otherLine) {\n return ((this.intercept + this.offset) - (otherLine.intercept + otherLine.offset)) / (otherLine.slope - this.slope)\n }", "title": "" }, { "docid": "f6c02a5333c881848bd6f021ac8d9b5b", "score": "0.6825271", "text": "get_intersection_of_two_lines(line_1, line_2) {\n\n // calculate the determinant, ad - cb in a square matrix |a b|\n let det = line_1.a * line_2.b - line_2.a * line_1.b; /* |c d| */\n\n if (det) { // this makes sure the lines aren't parallel, if they are, det will equal 0\n let x = (line_2.b * line_1.c - line_1.b * line_2.c) / det;\n let y = (line_1.a * line_2.c - line_2.a * line_1.c) / det;\n return { x, y };\n }\n }", "title": "" }, { "docid": "1037405f873eadf9cbf61abafdc6c076", "score": "0.68248576", "text": "function lineIntersect(a,b,c,d){\n // http://paulbourke.net/geometry/lineline2d/\n var f = ((d.y - c.y)*(b.x - a.x) - (d.x - c.x)*(b.y - a.y)); \n if(f == 0){\n return null;\n }\n f = 1 / f;\n var fab = ((d.x - c.x)*(a.y - c.y) - (d.y - c.y)*(a.x - c.x)) * f ;\n if(fab < 0 || fab > 1){\n return null;\n }\n var fcd = ((b.x - a.x)*(a.y - c.y) - (b.y - a.y)*(a.x - c.x)) * f ;\n if(fcd < 0 || fcd > 1){\n return null;\n }\n return new V2(a.x + fab * (b.x-a.x), a.y + fab * (b.y - a.y) );\n }", "title": "" }, { "docid": "6377d2da7fefa0f833aa49f353c862e5", "score": "0.68218213", "text": "function fV_intersecting_lines(_line1,_line2){\n return lineIntersect(_line1.x1,_line1.y1,_line1.x2,_line1.y2, _line2.x1,_line2.y1,_line2.x2,_line2.y2);\n}", "title": "" }, { "docid": "96cdf6cfd83c0cb7e339017d692ce727", "score": "0.6736449", "text": "function geoLineIntersection(a, b) {\n\t var p = [a[0][0], a[0][1]];\n\t var p2 = [a[1][0], a[1][1]];\n\t var q = [b[0][0], b[0][1]];\n\t var q2 = [b[1][0], b[1][1]];\n\t var r = geoVecSubtract(p2, p);\n\t var s = geoVecSubtract(q2, q);\n\t var uNumerator = geoVecCross(geoVecSubtract(q, p), r);\n\t var denominator = geoVecCross(r, s);\n\n\t if (uNumerator && denominator) {\n\t var u = uNumerator / denominator;\n\t var t = geoVecCross(geoVecSubtract(q, p), s) / denominator;\n\n\t if ((t >= 0) && (t <= 1) && (u >= 0) && (u <= 1)) {\n\t return geoVecInterp(p, p2, t);\n\t }\n\t }\n\n\t return null;\n\t}", "title": "" }, { "docid": "94f1477acad5f93ed46de79788031427", "score": "0.6647847", "text": "function lineIntersectionPoint({ x: x1, y: y1 }, { x: x2, y: y2 }, { x: x3, y: y3 }, { x: x4, y: y4 }) {\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return false\n }\n denominator = ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1))\n // Lines are parallel\n if (denominator === 0) {\n return false\n }\n let ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator\n let ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator\n // is the intersection along the segments\n /*\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return false\n }\n */\n const segmentsIntersect = !(ua < 0 || ua > 1 || ub < 0 || ub > 1);\n // Return a object with the x and y coordinates of the intersection\n let x = x1 + ua * (x2 - x1);\n let y = y1 + ua * (y2 - y1);\n return { x, y, segmentsIntersect };\n}", "title": "" }, { "docid": "ab2ee81c86c52146fc44fff2db456c66", "score": "0.66278225", "text": "function checkLineLineIntersection(lin0, lin1){\n\t//http://stackoverflow.com/questions/4543506/algorithm-for-intersection-of-2-lines\n\t//linA*X + linB*Y = linC\n\tvar lin0a=lin0.y1-lin0.y0, lin0b=lin0.x0-lin0.x1, lin0c=lin0a*lin0.x0+lin0b*lin0.y0;\n\tvar lin1a=lin1.y1-lin1.y0, lin1b=lin1.x0-lin1.x1, lin1c=lin1a*lin1.x0+lin1b*lin1.y0;\n\tvar delta = lin0a*lin1b - lin1a*lin0b;\n\tif(Math.abs(delta)<1e-9) return null;//parallel lines\n\tvar x = (lin1b*lin0c - lin0b*lin1c)/delta;\n\tvar y = (lin0a*lin1c - lin1a*lin0c)/delta;\n\treturn { x: x, y:y };\n}", "title": "" }, { "docid": "debe8d7cda7057257372d677c0a7e95a", "score": "0.66164917", "text": "function LineIntersection(lineVertex, lineVector, pointA, pointB)\r\n{\r\n\tdebugger;\r\n\tvar c = VecSub(lineVertex, pointA);\r\n\tvar v = VecSub(pointB, pointA);\r\n\tvar d = VecLength(v);\r\n\tvar t = VecDot(v, c);\r\n\tvar q = VecAdd(pointA, VecScale(v, t/d));\r\n\tvar vq = VecSub(q, lineVertex);\r\n\tvar r = VecLength(vq) / VecDot(q, vq);\r\n\tvar F = VecAdd(lineVertex, VecScale(lineVector, r));\r\n\treturn F;\r\n\t//var r = VecDot(v, q);\r\n\t//t = (t + r) / d;\r\n\t// if 0 <= t <= d, then it's on the segment; otherwise it's off in space\r\n\t//if (t >= 0 && t <= d)\r\n\t//\treturn VecAdd(pointA, VecScale(v, t / d));\r\n\treturn;\r\n}", "title": "" }, { "docid": "36f6b9e1f5b09a58e2a3a2d2be90cdf2", "score": "0.6608909", "text": "function intersectLine(lineSegment1, lineSegment2) {\n\t var intersectionPoint = {};\n\n\t var x1 = lineSegment1.start.x, y1 = lineSegment1.start.y, x2 = lineSegment1.end.x, y2 = lineSegment1.end.y,\n\t x3 = lineSegment2.start.x, y3 = lineSegment2.start.y, x4 = lineSegment2.end.x, y4 = lineSegment2.end.y;\n\n\t var a1, a2, b1, b2, c1, c2; // Coefficients of line equations\n\t var r1, r2, r3, r4; // Sign values\n\n\t var denom, num; //Intermediate values\n\n\t // Compute a1, b1, c1, where line joining points 1 and 2 is \"a1 x + b1 y + c1 = 0\"\n\t a1 = y2 - y1;\n\t b1 = x1 - x2;\n\t c1 = x2 * y1 - x1 * y2;\n\n\t // Compute r3 and r4\n\t r3 = a1 * x3 + b1 * y3 + c1;\n\t r4 = a1 * x4 + b1 * y4 + c1;\n\n\t /* Check signs of r3 and r4. If both point 3 and point 4 lie on\n\t * same side of line 1, the line segments do not intersect.\n\t */\n\n\t if (r3 !== 0 &&\n\t r4 !== 0 &&\n\t cornerstoneMath.sign(r3) === cornerstoneMath.sign(r4)) {\n\t return;\n\t }\n\n\t /* Compute a2, b2, c2 */\n\n\t a2 = y4 - y3;\n\t b2 = x3 - x4;\n\t c2 = x4 * y3 - x3 * y4;\n\n\t /* Compute r1 and r2 */\n\n\t r1 = a2 * x1 + b2 * y1 + c2;\n\t r2 = a2 * x2 + b2 * y2 + c2;\n\n\t /* Check signs of r1 and r2. If both point 1 and point 2 lie\n\t * on same side of second line segment, the line segments do\n\t * not intersect.\n\t */\n\n\t if (r1 !== 0 &&\n\t r2 !== 0 &&\n\t cornerstoneMath.sign(r1) === cornerstoneMath.sign(r2)) {\n\t return;\n\t }\n\n\t /* Line segments intersect: compute intersection point.\n\t */\n\n\t denom = (a1 * b2) - (a2 * b1);\n\n\t /* The denom/2 is to get rounding instead of truncating. It\n\t * is added or subtracted to the numerator, depending upon the\n\t * sign of the numerator.\n\t */\n\n\t num = (b1 * c2) - (b2 * c1);\n\t var x = parseFloat(num / denom);\n\n\t num = (a2 * c1) - (a1 * c2);\n\t var y = parseFloat(num / denom);\n\n\t intersectionPoint.x = x;\n\t intersectionPoint.y = y;\n\n\t return intersectionPoint;\n\t }", "title": "" }, { "docid": "75f0a23939e0a35e9851cb62de658042", "score": "0.6599026", "text": "function checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n var denominator, a, b, numerator1, numerator2, result = {\n x: null,\n y: null,\n onLine1: false,\n onLine2: false\n };\n denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY));\n if (denominator == 0) {\n return result;\n }\n a = line1StartY - line2StartY;\n b = line1StartX - line2StartX;\n numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b);\n numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b);\n a = numerator1 / denominator;\n b = numerator2 / denominator;\n\n // if we cast these lines infinitely in both directions, they intersect here:\n result.x = line1StartX + (a * (line1EndX - line1StartX));\n result.y = line1StartY + (a * (line1EndY - line1StartY));\n/*\n // it is worth noting that this should be the same as:\n x = line2StartX + (b * (line2EndX - line2StartX));\n y = line2StartX + (b * (line2EndY - line2StartY));\n */\n // if line1 is a segment and line2 is infinite, they intersect if:\n if (a > 0 && a < 1) {\n result.onLine1 = true;\n }\n // if line2 is a segment and line1 is infinite, they intersect if:\n if (b > 0 && b < 1) {\n result.onLine2 = true;\n }\n // if line1 and line2 are segments, they intersect if both of the above are true\n return result;\n}", "title": "" }, { "docid": "b1be8ff31a2835ebc76374ffef1096b4", "score": "0.654624", "text": "intersectLine(a, ab, c, cd, error){\n\t\tvar b = a + ab\n\t\tvar d = c + cd\n\t\tvar det = (a.x - b.x) * (c.y - d.y) - (a.y - b.y) * (c.x - d.x)\n\t\tif( abs(det)< 3.){\n\t\t\treturn error\n\t\t}\n\t\tvar m = a.x * b.y - a.y * b.x\n\t\tvar n = c.x * d.y - c.y * d.x\n\t\treturn vec2(\n\t\t\t(m * (c.x - d.x) - (a.x - b.x) * n) / det,\n\t\t\t(m * (c.y - d.y) - (a.y - b.y) * n) / det\n\t\t)\n\t}", "title": "" }, { "docid": "b131e2e42316c785051114677c9c0ec0", "score": "0.6494814", "text": "function lineIntersectsLine(line1, line2)\r\n{\r\n\tlet m1 = line1.getSlope(), m2 = line2.getSlope();\r\n\tlet b1 = line1.getB(), b2 = line2.getB();\r\n\t// if the lines are parallel\r\n\tif(m1 == m2)\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\tlet x = (b2 - b1) / (m1 - m2);\r\n\tif(line1.getX1() <= x && x <= line1.getX2() && line2.getX1() <= x && x <= line2.getX2())\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "ead62b552e371417440ae9afed9b8b3d", "score": "0.6434772", "text": "function intersect_line_line(p1, p2, p3, p4) {\n var denom = ((p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y));\n\n // lines are parallel\n if (denom === 0) {\n return false;\n }\n\n var ua = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n var ub = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return false;\n }\n\n return new Vector(p1.x + ua * (p2.x - p1.x), p1.y + ua * (p2.y - p1.y));\n }", "title": "" }, { "docid": "244d6cb3ed6a6c003878e101bfd6f8a5", "score": "0.64316875", "text": "function intersectLineAndRectAndMask(line, rect, mask){\n // Intersection betwen Line and Rect\n let [isIntercept, pr1, pr2] = clipLineRectL(rect, line);\n if (!isIntercept){\n errMsg = \"intersectLineAndRectAndMask: Line must intersect with Rect. Something wrong here.\";\n console.error(errMsg);\n throw new Error(errMsg);\n }\n\n // Draw points on the lines\n let rasterDots = XiaolinWu.plot(pr1.x, pr1.y, pr2.x, pr2.y);\n\n // Pick up point that intersect with mask and calculate their dot product with the line.\n let dotsOnMask = [];\n let dotDist = [];\n for (var i = 0; i < rasterDots.length; i++) {\n if (mask.ucharPtr(rasterDots[i].y, rasterDots[i].x)[0] !==0){\n dotsOnMask.push({\n x: rasterDots[i].x,\n y: rasterDots[i].y,\n });\n\n let vx = line.data32F[0], vy = line.data32F[1];\n let px = line.data32F[2], py = line.data32F[3];\n let dist = vx * (rasterDots[i].x - px) + vy * (rasterDots[i].y - py);\n dotDist.push(dist);\n }\n }\n\n // Find the minimum and maximum of the dot product to find the border points.\n var idxMin = dotDist.indexOf(Math.min(...dotDist));\n var idxMax = dotDist.indexOf(Math.max(...dotDist));\n\n let pc1 = new cv.Point(dotsOnMask[idxMin].x, dotsOnMask[idxMin].y);\n let pc2 = new cv.Point(dotsOnMask[idxMax].x, dotsOnMask[idxMax].y);\n\n return [pr1, pr2, pc1, pc2];\n\n}", "title": "" }, { "docid": "3e1cecce7eb99719286df021cabae1dd", "score": "0.6419558", "text": "function lineIntersection(p0, p1, p2, p3) {\n\t\tvar s1 = p1.subtract(p0);\n\t\tvar s2 = p3.subtract(p2);\n\n\t\tvar s = (-s1.y * (p0.x - p2.x) + s1.x * (p0.y - p2.y)) / (-s2.x * s1.y + s1.x * s2.y);\n\t\tvar t = ( s2.x * (p0.y - p2.y) - s2.y * (p0.x - p2.x)) / (-s2.x * s1.y + s1.x * s2.y);\n\n\t\tif (s >= 0.0 && s <= 1.0 && t >= 0.0 && t <= 1.0) {\n\t\t\treturn new Vector(p0.x + (t * s1.x), p0.y + (t * s1.y));\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "ddfd73955d3c6b0ab4444aaa0ad03745", "score": "0.6411317", "text": "function intersectLines(line1, line2, onlyWithinLineSegments = true) {\n if ((line1.x1 === line1.x2 && line1.y1 === line1.y2) || (line2.x1 === line2.x2 && line2.y1 === line2.y2))\n return undefined; // ignore zero length lines\n let denominator = (line2.y2 - line2.y1) * (line1.x2 - line1.x1) - (line1.x2 - line1.x1) * (line1.y2 - line1.y1);\n if (denominator === 0)\n return undefined; // ignore parallel lines\n let distance1 = ((line2.x2 - line2.x1) * (line1.y1 - line2.y1) - (line2.y2 - line2.y1) * (line1.x1 - line2.x1)) / denominator;\n let distance2 = ((line1.x2 - line1.x1) * (line1.y1 - line2.y1) - (line1.y2 - line1.y1) * (line1.x1 - line2.x1)) / denominator;\n if (onlyWithinLineSegments)\n if (distance1 < 0 || distance1 > 1 || distance2 < 0 || distance2 > 1) // check that the intersection is within the line segements\n return undefined;\n let x = line1.x1 + distance1 * (line1.x2 - line1.x1);\n let y = line1.y1 + distance1 * (line1.y2 - line1.y1);\n return { x: x, y: y };\n}", "title": "" }, { "docid": "952ee68f6e46eac4c40430a10330f8d7", "score": "0.6403941", "text": "function clipLine(listener) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(λ, φ) {\n var point1 = [λ, φ],\n point2,\n v = visible(λ, φ),\n c = smallRadius\n ? v ? 0 : code(λ, φ)\n : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;\n if (!point0 && (v00 = v0 = v)) listener.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) {\n point1[0] += ε;\n point1[1] += ε;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n listener.lineStart();\n point2 = intersect(point1, point0);\n listener.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n listener.point(point2[0], point2[1]);\n listener.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n listener.lineStart();\n listener.point(t[0][0], t[0][1]);\n listener.point(t[1][0], t[1][1]);\n listener.lineEnd();\n } else {\n listener.point(t[1][0], t[1][1]);\n listener.lineEnd();\n listener.lineStart();\n listener.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) {\n listener.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) listener.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() { return clean | ((v00 && v0) << 1); }\n };\n }", "title": "" }, { "docid": "7b2bef85515ebb893b16350262998f53", "score": "0.6384873", "text": "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n\t var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n\t if (nearZero(delta)) { // parallel\n\t return false;\n\t }\n\t var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n\t if (namenda < 0 || namenda > 1) {\n\t return false;\n\t }\n\t var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n\t if (miu < 0 || miu > 1) {\n\t return false;\n\t }\n\t return true;\n\t }", "title": "" }, { "docid": "7b2bef85515ebb893b16350262998f53", "score": "0.6384873", "text": "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n\t var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n\t if (nearZero(delta)) { // parallel\n\t return false;\n\t }\n\t var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n\t if (namenda < 0 || namenda > 1) {\n\t return false;\n\t }\n\t var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n\t if (miu < 0 || miu > 1) {\n\t return false;\n\t }\n\t return true;\n\t }", "title": "" }, { "docid": "4b750966ab139c189a900804be00563e", "score": "0.63824326", "text": "function intersect_line_line(p1, p2, p3, p4) {\n\t\tvar denom = ((p4.y - p3.y)*(p2.x - p1.x) - (p4.x - p3.x)*(p2.y - p1.y));\n\n\t\t// lines are parallel\n\t\tif (denom === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar ua = ((p4.x - p3.x)*(p1.y - p3.y) - (p4.y - p3.y)*(p1.x - p3.x)) / denom;\n\t\tvar ub = ((p2.x - p1.x)*(p1.y - p3.y) - (p2.y - p1.y)*(p1.x - p3.x)) / denom;\n\n\t\tif (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn new Springy.Vector(p1.x + ua * (p2.x - p1.x), p1.y + ua * (p2.y - p1.y));\n\t}", "title": "" }, { "docid": "d66e6e3634552a13d63974d3b23d2423", "score": "0.6367547", "text": "function lineIntersect(p0, p1, p2, p3) {\n var A1 = p1.y - p0.y,\n B1 = p0.x - p1.x,\n C1 = A1 * p0.x + B1 * p0.y,\n A2 = p3.y - p2.y,\n B2 = p2.x - p3.x,\n C2 = A2 * p2.x + B2 * p2.y,\n denominator = A1 * B2 - A2 * B1;\n\n if (!denominator) {\n return null;\n }\n\n return {\n x: (B2 * C1 - B1 * C2) / denominator,\n y: (A1 * C2 - A2 * C1) / denominator,\n }\n }", "title": "" }, { "docid": "de4c3ff75445ed2ad78c360ec0711d14", "score": "0.63667315", "text": "function lineIntersect(p1, p2, p3, p4) {\n var d = (p4.y-p3.y) * (p2.x-p1.x) - (p4.x-p3.x)*(p2.y-p1.y);\n var u = (p4.x-p3.x) * (p1.y-p3.y) - (p4.y-p3.y)*(p1.x-p3.x);\n var v = (p2.x-p1.x) * (p1.y-p3.y) - (p2.y-p1.y)*(p1.x-p3.x);\n if (d < 0) {\n u = -u;\n v = -v;\n d = -d;\n }\n return 0 <= u && u <= d && 0 <= v && v <= d;\n }", "title": "" }, { "docid": "501a2a9f59ce976623deeb2cc6822231", "score": "0.63602746", "text": "function get_line_intersection(p0_x, p0_y, p1_x, p1_y, \r\n\t\tp2_x, p2_y, p3_x, p3_y) {\r\n\t\t\r\n\t\tvar inter_points = {\r\n\t\t\tinter_x: null,\r\n\t\t\tinter_y: null \r\n\t\t}\r\n\t\t\r\n\t\tvar s1_x, s1_y, s2_x, s2_y;\r\n\t\ts1_x = p1_x - p0_x; \r\n\t\ts1_y = p1_y - p0_y;\r\n\t\ts2_x = p3_x - p2_x; \r\n\t\ts2_y = p3_y - p2_y;\r\n\r\n\t\tvar s, t;\r\n\t\ts = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-s2_x * s1_y + s1_x * s2_y);\r\n\t\tt = ( s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-s2_x * s1_y + s1_x * s2_y);\r\n\r\n\t\tif (s >= 0 && s <= 1 && t >= 0 && t <= 1)\r\n\t\t{\r\n\t\t\t// Collision detected\r\n\t\t\tinter_points.inter_x = p0_x + (t * s1_x);\r\n\t\t\tinter_points.inter_y = p0_y + (t * s1_y);\r\n\t\t\treturn inter_points; \r\n\t\t}\r\n\r\n\t\treturn 0; // No collision\r\n\t}", "title": "" }, { "docid": "b40a919341daffb97739dc31e005d2b3", "score": "0.63523865", "text": "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n\t var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n\t if (nearZero(delta)) {\n\t // parallel\n\t return false;\n\t }\n\t var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n\t if (namenda < 0 || namenda > 1) {\n\t return false;\n\t }\n\t var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n\t if (miu < 0 || miu > 1) {\n\t return false;\n\t }\n\t return true;\n\t}", "title": "" }, { "docid": "4d2e770977bdbde1e991ca31bd8ec79c", "score": "0.6348176", "text": "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n if (nearZero(delta)) { // parallel\n return false;\n }\n var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n if (namenda < 0 || namenda > 1) {\n return false;\n }\n var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n if (miu < 0 || miu > 1) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "4d2e770977bdbde1e991ca31bd8ec79c", "score": "0.6348176", "text": "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n if (nearZero(delta)) { // parallel\n return false;\n }\n var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n if (namenda < 0 || namenda > 1) {\n return false;\n }\n var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n if (miu < 0 || miu > 1) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "490e8bbaeef0a01e062d1972ea229cae", "score": "0.63467014", "text": "function checkLineSegmentLineSegmentsIntersection(lin0, lin1){\n\tvar point = checkLineLineIntersection(lin0, lin1);\n\tif(point==null)return null;\n\tvar lin0bb = Line2Box(lin0), lin1bb = Line2Box(lin1);\n\tif(checkBoxPointCollision(lin0bb, point)==false || checkBoxPointCollision(lin1bb, point)==false)return null;\n\treturn point;\n}", "title": "" }, { "docid": "c0cf0972f284bd87d552c0fc5e56ac4f", "score": "0.6311913", "text": "function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff\n // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`.\n\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n\n if (nearZero(nmCrossProduct)) {\n return false;\n } // `vec_m` and `vec_n` are intersect iff\n // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\n // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\n // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\n\n\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\n\n if (q < 0 || q > 1) {\n return false;\n }\n\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n\n if (p < 0 || p > 1) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "9cc0750a44444d125aa4e0cb5245064b", "score": "0.629747", "text": "function lineCircleIntersection(pt1, pt2) {\n let v1 = { x: pt2.x - pt1.x, y: pt2.y - pt1.y };\n let v2 = { x: pt1.x - ship.ship.center.x, y: pt1.y - ship.ship.center.y };\n let b = -2 * (v1.x * v2.x + v1.y * v2.y);\n let c = 2 * (v1.x * v1.x + v1.y * v1.y);\n let d = Math.sqrt(b * b - 2 * c * (v2.x * v2.x + v2.y * v2.y - ship.ship.radius * ship.ship.radius));\n if (isNaN(d)) { // no intercept;\n return false;\n }\n // These represent the unit distance of point one and two on the line\n let u1 = (b - d) / c;\n let u2 = (b + d) / c;\n if (u1 <= 1 && u1 >= 0) { // If point on the line segment\n return true;\n }\n if (u2 <= 1 && u2 >= 0) { // If point on the line segment\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "a295b78b2a0bce169f92fe949c84f626", "score": "0.62373304", "text": "function fV_intersecting_lines_point(_line1,_line2){\n var intersect_point = lineIntersect2(_line1.x1,_line1.y1,_line1.x2,_line1.y2, _line2.x1,_line2.y1,_line2.x2,_line2.y2);\n if(intersect_point){\n return intersect_point;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "85240f6093ecf047a5bc7ed9dd651ce1", "score": "0.6202748", "text": "function fV_intersecting_linespts(_l1x1,_l1y1,_l1x2,_l1y2, _l2x1,_l2y1,_l2x2,_l2y2){\n return lineIntersect(_l1x1,_l1y1,_l1x2,_l1y2, _l2x1,_l2y1,_l2x2,_l2y2);\n}", "title": "" }, { "docid": "2fc15c260a66849c302fc94ed4198160", "score": "0.6200401", "text": "function directedIntersection(slope, x1, y1, px, py)\r\n{\r\n\t// if it's a horizontal line, just go up or down from (px, py)\r\n if(slope == 0)\r\n {\r\n \treturn [px, y1];\r\n }\r\n // if it's a vertical line, just go left or right\r\n if(slope == Infinity)\r\n {\r\n \treturn [x1, py];\r\n }\r\n let xCoord = (py + px/slope - y1 + slope*x1) / (slope + 1/slope);\r\n let yCoord = slope*xCoord + y1 - slope*x1;\r\n return [xCoord, yCoord];\r\n}", "title": "" }, { "docid": "198cd07256b93d751fa5672b1c695ae6", "score": "0.61634284", "text": "function line_intersects(p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) {\n\n\tvar s1_x, s1_y, s2_x, s2_y;\n\ts1_x = p1_x - p0_x;\n\ts1_y = p1_y - p0_y;\n\ts2_x = p3_x - p2_x;\n\ts2_y = p3_y - p2_y;\n\n\tvar s, t;\n\ts = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-s2_x * s1_y + s1_x * s2_y);\n\tt = ( s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-s2_x * s1_y + s1_x * s2_y);\n\n\tif (s >= 0 && s <= 1 && t >= 0 && t <= 1)\n\t{\n\t\t// Collision detected\n\t\treturn 1;\n\t}\n\n\treturn 0; // No collision\n}", "title": "" }, { "docid": "8105a473f987f77f35eef6113f9d27ad", "score": "0.61203337", "text": "function line_plane_intersect(pn, p_dist, pline, dest) {\n // four-dimensional representation of a plane\n var plane = _vec4_tmp;\n plane.set(pn);\n plane[3] = p_dist;\n\n // four-dimensional representation of line direction vector\n var line_dir = _vec4_tmp2;\n _vec3_tmp[0] = pline[3];\n _vec3_tmp[1] = pline[4];\n _vec3_tmp[2] = pline[5];\n line_dir.set(_vec3_tmp);\n line_dir[3] = 0;\n\n var denominator = __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"dot\"](plane, line_dir);\n\n // parallel case\n if (denominator == 0.0)\n return null;\n\n // four-dimensional representation of line point\n var line_point = _vec4_tmp2;\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](pline, _vec3_tmp);\n line_point.set(_vec3_tmp);\n line_point[3] = 1;\n\n var numerator = __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"dot\"](plane, line_point);\n\n var t = - numerator / denominator;\n\n // point of intersection\n dest[0] = pline[0] + t * pline[3];\n dest[1] = pline[1] + t * pline[4];\n dest[2] = pline[2] + t * pline[5];\n\n return dest;\n}", "title": "" }, { "docid": "7b9c78327d74f16b4c3f30fcf3a18d2b", "score": "0.60988593", "text": "function lineRectIntersect2(line, rect) {\n //if (point is inside rect)\n // intersect = point;\n\n // check left\n var leftLine = {start:{x: rect.x, y: rect.y}, end:{x: rect.x, y: rect.y + rect.h}};\n var intersectionPoint = intersection.intersect(line,leftLine);\n if (intersectionPoint.y >= leftLine.start.y && intersectionPoint.y <= leftLine.end.y && line.start.x <= leftLine.start.x ) {\n return intersectionPoint;\n }\n\n // check top\n var topLine = {start:{x: rect.x, y: rect.y}, end:{x: rect.x + rect.w, y: rect.y}};\n intersectionPoint = intersection.intersect(line, topLine);\n if (intersectionPoint.x >= topLine.start.x && intersectionPoint.x <= topLine.end.x && line.start.y <= topLine.start.y) {\n return intersectionPoint;\n }\n\n // check right\n var rightLine = {start:{x: rect.x + rect.w ,y: rect.y }, end:{x: rect.x + rect.w, y: rect.y + rect.h}};\n intersectionPoint = intersection.intersect(line, rightLine);\n if (intersectionPoint.y >= rightLine.start.y && intersectionPoint.y < rightLine.end.y && line.start.x >= rightLine.start.x) {\n return intersectionPoint;\n }\n\n // check down\n var down = {start:{x: rect.x, y: rect.y + rect.h}, end:{x: rect.x + rect.w, y: rect.y + rect.h}};\n intersectionPoint = intersection.intersect(line, down);\n return intersectionPoint;\n}", "title": "" }, { "docid": "77e070bfd05b506086c8a14f9303c10b", "score": "0.60935175", "text": "function whereDoLineSegmentsIntersect(p, p2, q, q2) {\n\n}", "title": "" }, { "docid": "05a4aa0fc680a24a780642c1e08789f6", "score": "0.6089827", "text": "function line_intersects(segment1, segment2) {\r\n var _segment = _slicedToArray(segment1, 4);\r\n\r\n var p0_x = _segment[0];\r\n var p0_y = _segment[1];\r\n var p1_x = _segment[2];\r\n var p1_y = _segment[3];\r\n\r\n var _segment2 = _slicedToArray(segment2, 4);\r\n\r\n var p2_x = _segment2[0];\r\n var p2_y = _segment2[1];\r\n var p3_x = _segment2[2];\r\n var p3_y = _segment2[3];\r\n\r\n var s1_x, s1_y, s2_x, s2_y;\r\n s1_x = p1_x - p0_x;\r\n s1_y = p1_y - p0_y;\r\n s2_x = p3_x - p2_x;\r\n s2_y = p3_y - p2_y;\r\n\r\n var s, t;\r\n s = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-s2_x * s1_y + s1_x * s2_y);\r\n t = (s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-s2_x * s1_y + s1_x * s2_y);\r\n\r\n return s >= 0 && s <= 1 && t >= 0 && t <= 1;\r\n}", "title": "" }, { "docid": "da08cc95b9ea7576b33e6ba5ff8dd6d1", "score": "0.60835916", "text": "function intersectLine(p1,p2,q1,q2){\n// Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n// p7 and p473.\nvar a1,a2,b1,b2,c1,c2;var r1,r2,r3,r4;var denom,offset,num;var x,y;\n// Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n// b1 y + c1 = 0.\na1=p2.y-p1.y;b1=p1.x-p2.x;c1=p2.x*p1.y-p1.x*p2.y;\n// Compute r3 and r4.\nr3=a1*q1.x+b1*q1.y+c1;r4=a1*q2.x+b1*q2.y+c1;\n// Check signs of r3 and r4. If both point 3 and point 4 lie on\n// same side of line 1, the line segments do not intersect.\nif(r3!==0&&r4!==0&&sameSign(r3,r4)){return}\n// Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\na2=q2.y-q1.y;b2=q1.x-q2.x;c2=q2.x*q1.y-q1.x*q2.y;\n// Compute r1 and r2\nr1=a2*p1.x+b2*p1.y+c2;r2=a2*p2.x+b2*p2.y+c2;\n// Check signs of r1 and r2. If both point 1 and point 2 lie\n// on same side of second line segment, the line segments do\n// not intersect.\nif(r1!==0&&r2!==0&&sameSign(r1,r2)){return}\n// Line segments intersect: compute intersection point.\ndenom=a1*b2-a2*b1;if(denom===0){return}offset=Math.abs(denom/2);\n// The denom/2 is to get rounding instead of truncating. It\n// is added or subtracted to the numerator, depending upon the\n// sign of the numerator.\nnum=b1*c2-b2*c1;x=num<0?(num-offset)/denom:(num+offset)/denom;num=a2*c1-a1*c2;y=num<0?(num-offset)/denom:(num+offset)/denom;return{x:x,y:y}}", "title": "" }, { "docid": "f07002a35bc68ab8702c583207c51f38", "score": "0.60827357", "text": "function clipLine(stream){var point0,// previous point\n\tc0,// code for previous point\n\tv0,// visibility of previous point\n\tv00,// visibility of first point\n\t_clean2;// no intersections\n\treturn{lineStart:function lineStart(){v00=v0=false;_clean2=1;},point:function point(lambda,phi){var point1=[lambda,phi],point2,v=visible(lambda,phi),c=smallRadius?v?0:code(lambda,phi):v?code(lambda+(lambda<0?pi$4:-pi$4),phi):0;if(!point0&&(v00=v0=v))stream.lineStart();// Handle degeneracies.\n\t// TODO ignore if not clipping polygons.\n\tif(v!==v0){point2=intersect(point0,point1);if(pointEqual(point0,point2)||pointEqual(point1,point2)){point1[0]+=epsilon$4;point1[1]+=epsilon$4;v=visible(point1[0],point1[1]);}}if(v!==v0){_clean2=0;if(v){// outside going in\n\tstream.lineStart();point2=intersect(point1,point0);stream.point(point2[0],point2[1]);}else{// inside going out\n\tpoint2=intersect(point0,point1);stream.point(point2[0],point2[1]);stream.lineEnd();}point0=point2;}else if(notHemisphere&&point0&&smallRadius^v){var t;// If the codes for two points are different, or are both zero,\n\t// and there this segment intersects with the small circle.\n\tif(!(c&c0)&&(t=intersect(point1,point0,true))){_clean2=0;if(smallRadius){stream.lineStart();stream.point(t[0][0],t[0][1]);stream.point(t[1][0],t[1][1]);stream.lineEnd();}else{stream.point(t[1][0],t[1][1]);stream.lineEnd();stream.lineStart();stream.point(t[0][0],t[0][1]);}}}if(v&&(!point0||!pointEqual(point0,point1))){stream.point(point1[0],point1[1]);}point0=point1,v0=v,c0=c;},lineEnd:function lineEnd(){if(v0)stream.lineEnd();point0=null;},// Rejoin first and last segments if there were intersections and the first\n\t// and last points were visible.\n\tclean:function clean(){return _clean2|(v00&&v0)<<1;}};}// Intersects the great circle between a and b with the clip circle.", "title": "" }, { "docid": "c433ddc25947b8f140b41e13c1d8c49e", "score": "0.60745114", "text": "static testLinesIntersect() {\n startTest(UtilEngineTest.groupName+'testLinesIntersect');\n // p1 to p2 is horizontal edge\n const p1 = new Vector(3.5355339059327378, 0.5);\n const p2 = new Vector(-3.5355339059327378, 0.5);\n // p3 to p4 is diagonal\n const p3 = new Vector(-3.497695148119348, 0.47209383993684373);\n const p4 = new Vector(-3.665778648699753, 0.5768083643426545);\n assertTrue(UtilEngine.linesIntersect(p1, p2, p3, p4) === null );\n // p5 to p2 is vertical edge\n const p5 = new Vector(-3.5355339059327378, -0.5);\n assertTrue(UtilEngine.linesIntersect(p5, p2, p3, p4) != null );\n}", "title": "" }, { "docid": "2d4d440c489af86196146c72640bcfcc", "score": "0.60657", "text": "function intersectLinesXY(x1, y1, x2, y2, x3, y3, x4, y4) {\n\n // Check if none of the lines are of length 0\n\tif ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n\t\treturn false\n\t}\n\n\tdenominator = ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1))\n\n // Lines are parallel\n\tif (denominator === 0) {\n\t\treturn false\n\t}\n\n\tlet ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator\n\tlet ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator\n\n // is the intersection along the segments\n\tif (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n\t\treturn false\n\t}\n\n // Return a object with the x and y coordinates of the intersection\n\tlet x = x1 + ua * (x2 - x1)\n\tlet y = y1 + ua * (y2 - y1)\n\n\treturn {x, y}\n}", "title": "" }, { "docid": "c721a6aa561d5cfd3063e8264ebc77ac", "score": "0.6060963", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "c721a6aa561d5cfd3063e8264ebc77ac", "score": "0.6060963", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "5fa189c91664dd8af7280f15a1c6469e", "score": "0.6029072", "text": "function getLinesIntersection(x1, y1, x2, y2, x3, y3, x4, y4) {\n // Check if none of the lines are of length 0\n\tif ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n\t\treturn false\n\t}\n\tdenominator = ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1))\n // Lines are parallel\n\tif (denominator === 0) {\n\t\treturn false\n\t}\n\tlet ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator\n\tlet ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator\n // is the intersection along the segments\n\tif (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n\t\treturn false\n\t}\n // Return a object with the x and y coordinates of the intersection\n\tconst x = x1 + ua * (x2 - x1)\n\tconst y = y1 + ua * (y2 - y1)\n\treturn {x, y}\n}", "title": "" }, { "docid": "308b52ae602fcbe7af6b451d7bbd90ad", "score": "0.60221034", "text": "function getLineIntersection(firstPoints, secondPoints) {\n var x1 = firstPoints[0][0],\n y1 = firstPoints[0][1],\n x2 = firstPoints[1][0],\n y2 = firstPoints[1][1],\n x3 = secondPoints[0][0],\n y3 = secondPoints[0][1],\n x4 = secondPoints[1][0],\n y4 = secondPoints[1][1];\n\n var determinant = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n\n if (Math.abs(determinant) < 1e-9) {\n return \"Lines are parallel\";\n } else {\n var x = ((x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)) / determinant;\n var y = ((x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4)) / determinant;\n return \"Intersection: (\" + x.toFixed(3) + \", \" + y.toFixed(3) + \")\";\n }\n}", "title": "" }, { "docid": "a0511cf8253bc844fee4de6394969504", "score": "0.601761", "text": "function segmentIntersection(s1p1x, s1p1y, s1p2x, s1p2y, s2p1x, s2p1y, s2p2x, s2p2y) {\n // Source: Sedgewick, _Algorithms in C_\n // (Tried various other functions that failed owing to floating point errors)\n var p = false;\n var hit = orient2D(s1p1x, s1p1y, s1p2x, s1p2y, s2p1x, s2p1y) *\n orient2D(s1p1x, s1p1y, s1p2x, s1p2y, s2p2x, s2p2y) <= 0 &&\n orient2D(s2p1x, s2p1y, s2p2x, s2p2y, s1p1x, s1p1y) *\n orient2D(s2p1x, s2p1y, s2p2x, s2p2y, s1p2x, s1p2y) <= 0;\n\n if (hit) {\n p = lineIntersection(s1p1x, s1p1y, s1p2x, s1p2y, s2p1x, s2p1y, s2p2x, s2p2y);\n if (p) { // colinear if p is false -- treating this as no intersection\n // Re-order operands so intersection point is closest to s1p1 (better numerical accuracy)\n // Source: Jonathan Shewchuk http://www.cs.berkeley.edu/~jrs/meshpapers/robnotes.pdf\n var nearest = nearestPoint(p[0], p[1], s1p1x, s1p1y, s1p2x, s1p2y, s2p1x, s2p1y, s2p2x, s2p2y);\n if (nearest == 1) {\n // use b a c d\n p = lineIntersection(s1p2x, s1p2y, s1p1x, s1p1y, s2p1x, s2p1y, s2p2x, s2p2y);\n } else if (nearest == 2) {\n // use c d a b\n p = lineIntersection(s2p1x, s2p1y, s2p2x, s2p2y, s1p1x, s1p1y, s1p2x, s1p2y);\n } else if (nearest == 3) {\n // use d c a b\n p = lineIntersection(s2p2x, s2p2y, s2p1x, s2p1y, s1p1x, s1p1y, s1p2x, s1p2y);\n }\n }\n }\n return p;\n}", "title": "" }, { "docid": "f6156ee1a18106ec1d578f7c19cce991", "score": "0.6013539", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math.pi : -_math.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart(); // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n\n if (v !== v0) {\n point2 = intersect(point0, point1);\n\n if (!point2 || (0, _pointEqual.default)(point0, point2) || (0, _pointEqual.default)(point1, point2)) {\n point1[0] += _math.epsilon;\n point1[1] += _math.epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n\n if (v !== v0) {\n clean = 0;\n\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t; // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n\n if (v && (!point0 || !(0, _pointEqual.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n } // Intersects the great circle between a and b with the clip circle.", "title": "" }, { "docid": "3f5a397b096417805c617e8463522e03", "score": "0.6006735", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math_js__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math_js__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual_js__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual_js__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math_js__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math_js__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual_js__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "0bad4f00c7f34c416ffbe7bd53fb2f5b", "score": "0.6000368", "text": "function clipLine(stream){var point0,// previous point\nc0,// code for previous point\nv0,// visibility of previous point\nv00,// visibility of first point\nclean;// no intersections\nreturn{lineStart:function(){v00=v0=false;clean=1},point:function(lambda,phi){var point1=[lambda,phi],point2,v=visible(lambda,phi),c=smallRadius?v?0:code(lambda,phi):v?code(lambda+(lambda<0?pi:-pi),phi):0;if(!point0&&(v00=v0=v))stream.lineStart();\n// Handle degeneracies.\n// TODO ignore if not clipping polygons.\nif(v!==v0){point2=intersect(point0,point1);if(!point2||pointEqual(point0,point2)||pointEqual(point1,point2)){point1[0]+=epsilon;point1[1]+=epsilon;v=visible(point1[0],point1[1])}}if(v!==v0){clean=0;if(v){\n// outside going in\nstream.lineStart();point2=intersect(point1,point0);stream.point(point2[0],point2[1])}else{\n// inside going out\npoint2=intersect(point0,point1);stream.point(point2[0],point2[1]);stream.lineEnd()}point0=point2}else if(notHemisphere&&point0&&smallRadius^v){var t;\n// If the codes for two points are different, or are both zero,\n// and there this segment intersects with the small circle.\nif(!(c&c0)&&(t=intersect(point1,point0,true))){clean=0;if(smallRadius){stream.lineStart();stream.point(t[0][0],t[0][1]);stream.point(t[1][0],t[1][1]);stream.lineEnd()}else{stream.point(t[1][0],t[1][1]);stream.lineEnd();stream.lineStart();stream.point(t[0][0],t[0][1])}}}if(v&&(!point0||!pointEqual(point0,point1))){stream.point(point1[0],point1[1])}point0=point1,v0=v,c0=c},lineEnd:function(){if(v0)stream.lineEnd();point0=null},\n// Rejoin first and last segments if there were intersections and the first\n// and last points were visible.\nclean:function(){return clean|(v00&&v0)<<1}}}", "title": "" }, { "docid": "c8bc4ac98516c9dcad8b2156fbcff511", "score": "0.5997046", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "c8bc4ac98516c9dcad8b2156fbcff511", "score": "0.5997046", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "c8bc4ac98516c9dcad8b2156fbcff511", "score": "0.5997046", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "c8bc4ac98516c9dcad8b2156fbcff511", "score": "0.5997046", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "c8bc4ac98516c9dcad8b2156fbcff511", "score": "0.5997046", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "c8bc4ac98516c9dcad8b2156fbcff511", "score": "0.5997046", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "c8bc4ac98516c9dcad8b2156fbcff511", "score": "0.5997046", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "c8bc4ac98516c9dcad8b2156fbcff511", "score": "0.5997046", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "edcdc1c07a40f117c1f13a68e4b17a5d", "score": "0.59941924", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math.pi : -_math.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || (0, _pointEqual2.default)(point0, point2) || (0, _pointEqual2.default)(point1, point2)) {\n point1[0] += _math.epsilon;\n point1[1] += _math.epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !(0, _pointEqual2.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n }", "title": "" }, { "docid": "edcdc1c07a40f117c1f13a68e4b17a5d", "score": "0.59941924", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math.pi : -_math.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || (0, _pointEqual2.default)(point0, point2) || (0, _pointEqual2.default)(point1, point2)) {\n point1[0] += _math.epsilon;\n point1[1] += _math.epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !(0, _pointEqual2.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n }", "title": "" }, { "docid": "e1479ce5049f835f32a53119485f1f5b", "score": "0.5988264", "text": "function getIntersectionPoints(line1, line2, isLimit) {\n var points = getIntersectionPointsByConstants(getLinearConstants(line1[0], line1[1]), getLinearConstants(line2[0], line2[1]));\n\n if (isLimit) {\n return getPointsOnLines(points, [line1, line2]);\n }\n\n return points;\n }", "title": "" }, { "docid": "49f3bc630069bfd1f55b01c443158106", "score": "0.59867835", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "d4f0d7064bc614b02bccd1583da12761", "score": "0.59848565", "text": "static line_plane_intersection(v1,v2,v3,p,v){\n var n = this.plane_normal(v1,v2,v3);\n //v = this.normalise(v);\n var w = this.minus(v1,p);\n var k = this.dotproduct(w,n)/this.dotproduct(v,n);\n if (k < 0)\n throw \"line plane wrong\";\n if (k>=1)\n return (this.add(p,this.mul(k,v)));\n else\n console.log(\"Error\");\n return null;\n }", "title": "" }, { "docid": "0533ed571a4805a4f72dabfefc47c226", "score": "0.5979375", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? math[\"m\" /* pi */] : -math[\"m\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += math[\"h\" /* epsilon */];\n point1[1] += math[\"h\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "27cddd1d5534442af53ad834c31954a6", "score": "0.59778976", "text": "function clipLine( stream ) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function ( lambda, phi ) {\n var point1 = [ lambda, phi ],\n point2,\n v = visible( lambda, phi ),\n c = smallRadius ?\n v ? 0 : code( lambda, phi ) :\n v ? code( lambda + ( lambda < 0 ? pi$3 : -pi$3 ), phi ) : 0;\n if ( !point0 && ( v00 = v0 = v ) ) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if ( v !== v0 ) {\n point2 = intersect( point0, point1 );\n if ( pointEqual( point0, point2 ) || pointEqual( point1, point2 ) ) {\n point1[ 0 ] += epsilon$2;\n point1[ 1 ] += epsilon$2;\n v = visible( point1[ 0 ], point1[ 1 ] );\n }\n }\n if ( v !== v0 ) {\n clean = 0;\n if ( v ) {\n // outside going in\n stream.lineStart();\n point2 = intersect( point1, point0 );\n stream.point( point2[ 0 ], point2[ 1 ] );\n }\n else {\n // inside going out\n point2 = intersect( point0, point1 );\n stream.point( point2[ 0 ], point2[ 1 ] );\n stream.lineEnd();\n }\n point0 = point2;\n }\n else if ( notHemisphere && point0 && smallRadius ^ v ) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if ( !( c & c0 ) && ( t = intersect( point1, point0, true ) ) ) {\n clean = 0;\n if ( smallRadius ) {\n stream.lineStart();\n stream.point( t[ 0 ][ 0 ], t[ 0 ][ 1 ] );\n stream.point( t[ 1 ][ 0 ], t[ 1 ][ 1 ] );\n stream.lineEnd();\n }\n else {\n stream.point( t[ 1 ][ 0 ], t[ 1 ][ 1 ] );\n stream.lineEnd();\n stream.lineStart();\n stream.point( t[ 0 ][ 0 ], t[ 0 ][ 1 ] );\n }\n }\n }\n if ( v && ( !point0 || !pointEqual( point0, point1 ) ) ) {\n stream.point( point1[ 0 ], point1[ 1 ] );\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if ( v0 ) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | ( ( v00 && v0 ) << 1 );\n }\n };\n }", "title": "" }, { "docid": "f65345b0000299a6addecd8e6ada921c", "score": "0.59748685", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? src_math_pi : -src_math_pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += math_epsilon;\n point1[1] += math_epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "e677afe34cea667815027d33de15a2ef", "score": "0.59730226", "text": "function cast(ray, line) {\n intersectx = (ray.l - line.l) / (line.k - ray.k);\n intersecty = line.k * intersectx + line.l;\n if (line.k === Infinity || line.k === -Infinity) {\n intersectx = line.x1;\n intersecty = ray.k * intersectx + ray.l;\n }\n if (ray.k === Infinity || ray.k === -Infinity) {\n intersectx = mouseX;\n intersecty = line.k * intersectx + line.l;\n }\n if (\n Math.floor(\n distance(intersectx, intersecty, line.x1, line.y1) +\n distance(intersectx, intersecty, line.x2, line.y2)\n ) <= Math.floor(distance(line.x1, line.y1, line.x2, line.y2)) &&\n Math.floor(\n distance(intersectx, intersecty, ray.x, ray.y) +\n distance(intersectx, intersecty, mouseX, mouseY)\n ) <= Math.floor(distance(mouseX, mouseY, ray.x, ray.y))\n ) {\n return [intersectx, intersecty];\n }\n}", "title": "" }, { "docid": "82f015ac5f132dc2d20312269bcf21f2", "score": "0.5964607", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n _clean; // no intersections\n\n\n return {\n lineStart: function lineStart() {\n v00 = v0 = false;\n _clean = 1;\n },\n point: function point(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart(); // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n\n if (v !== v0) {\n point2 = intersect(point0, point1);\n\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n\n if (v !== v0) {\n _clean = 0;\n\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t; // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n _clean = 0;\n\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function lineEnd() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function clean() {\n return _clean | (v00 && v0) << 1;\n }\n };\n } // Intersects the great circle between a and b with the clip circle.", "title": "" }, { "docid": "b8220cd49e7dcee2e81343d2a8174536", "score": "0.5962099", "text": "function getIntersectionPoint(x1, y1, x2, y2, x3, y3, x4, y4) {\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return false;\n }\n\n denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\n // Lines are parallel\n if (denominator === 0) {\n return false;\n }\n\n let ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n let ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator;\n\n // is the intersection along the segments\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return false;\n }\n\n // Return a object with the x and y coordinates of the intersection\n let x = x1 + ua * (x2 - x1);\n let y = y1 + ua * (y2 - y1);\n\n return { x, y };\n}", "title": "" }, { "docid": "e0279f3118a118a849e143784ce4143f", "score": "0.5960505", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"p\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"p\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "e0279f3118a118a849e143784ce4143f", "score": "0.5960505", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"p\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"p\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "3cf4c62c7ed344ce777efd68a36862a4", "score": "0.59590065", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n _clean2; // no intersections\n return {\n lineStart: function lineStart() {\n v00 = v0 = false;\n _clean2 = 1;\n },\n point: function point(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n _clean2 = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n _clean2 = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function lineEnd() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function clean() {\n return _clean2 | (v00 && v0) << 1;\n }\n };\n }", "title": "" }, { "docid": "5b93895d12d741a57f234c5e66b437e0", "score": "0.59558034", "text": "function intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n\n var a1, a2, b1, b2, c1, c2;\n var r1, r2 , r3, r4;\n var denom, offset, num;\n var x, y;\n\n // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = (p2.x * p1.y) - (p1.x * p2.y);\n\n // Compute r3 and r4.\n r3 = ((a1 * q1.x) + (b1 * q1.y) + c1);\n r4 = ((a1 * q2.x) + (b1 * q2.y) + c1);\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = (q2.x * q1.y) - (q1.x * q2.y);\n\n // Compute r1 and r2\n r1 = (a2 * p1.x) + (b2 * p1.y) + c2;\n r2 = (a2 * p2.x) + (b2 * p2.y) + c2;\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) {\n return /*DONT_INTERSECT*/;\n }\n\n // Line segments intersect: compute intersection point.\n denom = (a1 * b2) - (a2 * b1);\n if (denom === 0) {\n return /*COLLINEAR*/;\n }\n\n offset = Math.abs(denom / 2);\n\n // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n num = (b1 * c2) - (b2 * c1);\n x = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n num = (a2 * c1) - (a1 * c2);\n y = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n return { x: x, y: y };\n}", "title": "" }, { "docid": "5b93895d12d741a57f234c5e66b437e0", "score": "0.59558034", "text": "function intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n\n var a1, a2, b1, b2, c1, c2;\n var r1, r2 , r3, r4;\n var denom, offset, num;\n var x, y;\n\n // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = (p2.x * p1.y) - (p1.x * p2.y);\n\n // Compute r3 and r4.\n r3 = ((a1 * q1.x) + (b1 * q1.y) + c1);\n r4 = ((a1 * q2.x) + (b1 * q2.y) + c1);\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = (q2.x * q1.y) - (q1.x * q2.y);\n\n // Compute r1 and r2\n r1 = (a2 * p1.x) + (b2 * p1.y) + c2;\n r2 = (a2 * p2.x) + (b2 * p2.y) + c2;\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) {\n return /*DONT_INTERSECT*/;\n }\n\n // Line segments intersect: compute intersection point.\n denom = (a1 * b2) - (a2 * b1);\n if (denom === 0) {\n return /*COLLINEAR*/;\n }\n\n offset = Math.abs(denom / 2);\n\n // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n num = (b1 * c2) - (b2 * c1);\n x = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n num = (a2 * c1) - (a1 * c2);\n y = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n return { x: x, y: y };\n}", "title": "" }, { "docid": "5b93895d12d741a57f234c5e66b437e0", "score": "0.59558034", "text": "function intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n\n var a1, a2, b1, b2, c1, c2;\n var r1, r2 , r3, r4;\n var denom, offset, num;\n var x, y;\n\n // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = (p2.x * p1.y) - (p1.x * p2.y);\n\n // Compute r3 and r4.\n r3 = ((a1 * q1.x) + (b1 * q1.y) + c1);\n r4 = ((a1 * q2.x) + (b1 * q2.y) + c1);\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = (q2.x * q1.y) - (q1.x * q2.y);\n\n // Compute r1 and r2\n r1 = (a2 * p1.x) + (b2 * p1.y) + c2;\n r2 = (a2 * p2.x) + (b2 * p2.y) + c2;\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) {\n return /*DONT_INTERSECT*/;\n }\n\n // Line segments intersect: compute intersection point.\n denom = (a1 * b2) - (a2 * b1);\n if (denom === 0) {\n return /*COLLINEAR*/;\n }\n\n offset = Math.abs(denom / 2);\n\n // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n num = (b1 * c2) - (b2 * c1);\n x = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n num = (a2 * c1) - (a1 * c2);\n y = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n return { x: x, y: y };\n}", "title": "" }, { "docid": "496fbcd5b8743289a27fbd021c35d2bb", "score": "0.59478337", "text": "function lineIntersectLine(a, b, c, d) {\n // check if two segments are parallel or not\n // precondition is end point a, b is inside polygon, if line a->b is\n // parallel to polygon edge c->d, then a->b won't intersect with c->d\n var vectorP = [\n b[0] - a[0],\n b[1] - a[1]\n ];\n var vectorQ = [\n d[0] - c[0],\n d[1] - c[1]\n ];\n if (perp(vectorQ, vectorP) === 0)\n { return false; }\n // If lines are intersecting with each other, the relative location should be:\n // a and b lie in different sides of segment c->d\n // c and d lie in different sides of segment a->b\n if (twoSided(a, b, c, d) && twoSided(c, d, a, b))\n { return true; }\n return false;\n}", "title": "" }, { "docid": "8fba5783a214e7276d35ad1f3e73a629", "score": "0.59470296", "text": "function lineIntersection(point1, point2, point3, point4) {\n const s = (\n (point4.x - point3.x) * (point1.y - point3.y) - (point4.y - point3.y) * (point1.x - point3.x)\n ) / (\n (point4.y - point3.y) * (point2.x - point1.x) - (point4.x - point3.x) * (point2.y - point1.y)\n );\n\n return Point(\n point1.x + s * (point2.x - point1.x), point1.y + s * (point2.y - point1.y)\n );\n}", "title": "" }, { "docid": "ebd47977d222ed7ca24b2fef94f3dddb", "score": "0.59401065", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n _clean; // no intersections\n return {\n lineStart: function lineStart() {\n v00 = v0 = false;\n _clean = 1;\n },\n point: function point(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n _clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n _clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function lineEnd() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function clean() {\n return _clean | (v00 && v0) << 1;\n }\n };\n }", "title": "" }, { "docid": "aef0b031990ac03dae7e9a1a923123bf", "score": "0.5930354", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "aef0b031990ac03dae7e9a1a923123bf", "score": "0.5930354", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "aef0b031990ac03dae7e9a1a923123bf", "score": "0.5930354", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "aef0b031990ac03dae7e9a1a923123bf", "score": "0.5930354", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "aef0b031990ac03dae7e9a1a923123bf", "score": "0.5930354", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b0a0ceba4749289141aa33e24ff24c16", "score": "0.59225494", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b0a0ceba4749289141aa33e24ff24c16", "score": "0.59225494", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b0a0ceba4749289141aa33e24ff24c16", "score": "0.59225494", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b0a0ceba4749289141aa33e24ff24c16", "score": "0.59225494", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b0a0ceba4749289141aa33e24ff24c16", "score": "0.59225494", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b0a0ceba4749289141aa33e24ff24c16", "score": "0.59225494", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b0a0ceba4749289141aa33e24ff24c16", "score": "0.59225494", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b0a0ceba4749289141aa33e24ff24c16", "score": "0.59225494", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b0a0ceba4749289141aa33e24ff24c16", "score": "0.59225494", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "f6ed7a630c83de4a197406c60da74835", "score": "0.59217054", "text": "getLineOverlap(line1, line2) {\n\t\tlet denominator = (line1.x1 - line1.x2) * (line2.y1 - line2.y2) - (line1.y1 - line1.y2) * (line2.x1 - line2.x2);\n\t\tlet slope1 = (line1.y2 - line1.y1) / (line1.x2 - line1.x1);\n\t\tlet slope2 = (line2.y2 - line2.y1) / (line2.x2 - line2.x1);\n\n\t\t// If the deniminator is zero, of the slopes are the same, we've got parallel lines\n\t\tif (denominator === 0 || (slope1.toFixed(5) === slope2.toFixed(5))) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet bezierY = line1.y1 - line2.y1;\n\t\tlet bezierX = line1.x1 - line2.x1;\n\n\t\t// How to find the actual co-ordinates where the contact took place (screen-relative)\n\t\tlet numeratorX = ((line1.x1 * line1.y2) - (line1.y1 * line1.x2)) * (line2.x1 - line2.x2) - (line1.x1 - line1.x2) * ((line2.x1 * line2.y2) - (line2.y1 * line2.x2));\n\t\tlet numeratorY = ((line1.x1 * line1.y2) - (line1.y1 * line1.x2)) * (line2.y1 - line2.y2) - (line1.y1 - line1.y2) * ((line2.x1 * line2.y2) - (line2.y1 * line2.x2));\n\t\tlet numeratorLine2 = ((line2.x2 - line2.x1) * bezierY) - ((line2.y2 - line2.y1) * bezierX);\n\t\tlet numeratorLine1 = ((line1.x2 - line1.x1) * bezierY) - ((line1.y2 - line1.y1) * bezierX);\n\t\tlet bezierLine2 = (numeratorLine2 / denominator);\n\t\tlet bezierLine1 = (numeratorLine1 / denominator);\n\n\t\tlet pointX = numeratorX / denominator;\n\t\tlet pointY = numeratorY / denominator;\n\n\t\tif ((bezierLine2 > 0 && bezierLine2 < 1) && (bezierLine1 > 0 && bezierLine1 < 1)) {\n\t\t\treturn {\n\t\t\t\tx: pointX,\n\t\t\t\ty: pointY\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "689215c99a253099b5c268846f8a267a", "score": "0.5921302", "text": "function intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n var a1, a2, b1, b2, c1, c2;\n var r1, r2, r3, r4;\n var denom, offset, num;\n var x, y; // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = p2.x * p1.y - p1.x * p2.y; // Compute r3 and r4.\n\n r3 = a1 * q1.x + b1 * q1.y + c1;\n r4 = a1 * q2.x + b1 * q2.y + c1; // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n\n if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {\n return;\n } // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n\n\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = q2.x * q1.y - q1.x * q2.y; // Compute r1 and r2\n\n r1 = a2 * p1.x + b2 * p1.y + c2;\n r2 = a2 * p2.x + b2 * p2.y + c2; // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n\n if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {\n return;\n } // Line segments intersect: compute intersection point.\n\n\n denom = a1 * b2 - a2 * b1;\n\n if (denom === 0) {\n return;\n }\n\n offset = Math.abs(denom / 2); // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n\n num = b1 * c2 - b2 * c1;\n x = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n num = a2 * c1 - a1 * c2;\n y = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n return {\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "b10e5441e4fbf331f3df47c3c1923333", "score": "0.5919715", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$4 : -pi$4), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$4;\n point1[1] += epsilon$4;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "b10e5441e4fbf331f3df47c3c1923333", "score": "0.5919715", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$4 : -pi$4), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$4;\n point1[1] += epsilon$4;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "7ad2fe6377d600564f41cef4819dc0f9", "score": "0.59180343", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "7ad2fe6377d600564f41cef4819dc0f9", "score": "0.59180343", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "7ad2fe6377d600564f41cef4819dc0f9", "score": "0.59180343", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "7ad2fe6377d600564f41cef4819dc0f9", "score": "0.59180343", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "title": "" }, { "docid": "95985d40ae28a298e25f72c48ef6c124", "score": "0.59154165", "text": "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n _clean; // no intersections\n return {\n lineStart: function lineStart() {\n v00 = v0 = false;\n _clean = 1;\n },\n point: function point(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n _clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n _clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function lineEnd() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function clean() {\n return _clean | (v00 && v0) << 1;\n }\n };\n }", "title": "" }, { "docid": "75c0d7c06525bb0b08398be922c912a8", "score": "0.5914922", "text": "function getIntersectingSegment(polyline) {\n if (isSelfIntersecting(polyline)) {\n return new Graphic({\n geometry: getLastSegment(polyline),\n symbol: {\n type: \"simple-line\", // autocasts as new SimpleLineSymbol\n style: \"short-dot\",\n width: 3.5,\n color: \"yellow\"\n }\n });\n }\n return null;\n }", "title": "" } ]
3927e0156030d60724f810f846405368
function when home is clicked
[ { "docid": "d8e0cb458877adec740afe0683be862a", "score": "0.0", "text": "function Home() {\n //to empty the divs before the start function get all the books again\n document.getElementById(\"title\").innerHTML = \"\";\n document.getElementById(\"author\").innerHTML = \"\"; \n document.getElementById(\"stars\").innerHTML = \"\";\n document.getElementById(\"description\").innerHTML = \"\"; \n document.getElementById(\"cover\").innerHTML = \"\"; \n document.getElementById(\"reviews\").innerHTML = \"\"; \n // start function to get all books\n Start(); \n }", "title": "" } ]
[ { "docid": "a152faffd97c4597d479bf9c8c6de9d1", "score": "0.7768131", "text": "function onHomeClick(e) {\n\ttry {\n\t\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('preventIntroScreen');\n\t\tvar parentWindow = Alloy.Globals.NAVIGATION_CONTROLLER.getCurrentWindow();\n\t\tif (parentWindow != null && parentWindow.windowName === \"newHomeScreen\") {\n\t\t\tparentWindow.window.refreshHomeScreen();\n\t\t}\n\n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"prevent\", \"homeClick\", ex);\n\t}\n}", "title": "" }, { "docid": "b526782d9814aa183b0555b5769e5953", "score": "0.77015275", "text": "function onHomeClick(e) {\n\ttry {\n\t\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('preventScreen');\n\t\tvar parentWindow = Alloy.Globals.NAVIGATION_CONTROLLER.getCurrentWindow();\n\t\tif (parentWindow != null && parentWindow.windowName === \"home\") {\n\t\t\tparentWindow.window.refreshHomeScreen();\n\t\t}\n\n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"prevent\", \"homeClick\", ex);\n\t}\n}", "title": "" }, { "docid": "dcd27c04feccfe6835fccc340614c9fb", "score": "0.75666916", "text": "function handleHomeClick() {\n setShowHistory(false)\n }", "title": "" }, { "docid": "4e666b2ba4c4cd4b69ddfdedcefe15dc", "score": "0.7422987", "text": "function navHndlr_BackToHome() {\n $('nav').on('click', '.nav-home', event => {\n event.preventDefault();\n setActiveAppPhase($('.intro-page'));\n });\n}", "title": "" }, { "docid": "f28a6c9353eebde2daced5ad3f6fe994", "score": "0.73967355", "text": "toHome(){\n console.log('The user wants to go home');\n this._toHome();\n }", "title": "" }, { "docid": "8446a457ecda2b1d176036d76338ed1c", "score": "0.73269904", "text": "showHome() {\n\t\tthis.gotoPage(0);\n\t}", "title": "" }, { "docid": "ba5d7ae5d8e2eab1868cf1ff4792e329", "score": "0.72529584", "text": "function handleHomeButton () {\n\t$('button.home').on('click', (event) => {\n\t\twindow.location = '../Main.html';\n\t});\n}", "title": "" }, { "docid": "249cbf4bea60dfeb267e85d8daf897c8", "score": "0.72320396", "text": "goHome() {\n\t\tstoreActions.goHome();\n\t}", "title": "" }, { "docid": "d9472190f615e1a2a961b0e94209f135", "score": "0.7220616", "text": "function _goToHome() {\n $state.go(\"home\");\n }", "title": "" }, { "docid": "6b3e83b1614b0b2736654c9aa23da470", "score": "0.7205479", "text": "function onMapHomeClick()\t{adapter.onMapHomeClick();}", "title": "" }, { "docid": "b5e48bcffe338de8d638c2412946eff5", "score": "0.719225", "text": "function goHome() {\n menu();\n}", "title": "" }, { "docid": "4e671c085d40a29e3674cf38555fa4b9", "score": "0.7138807", "text": "function goHomePage()\n{\n\tswitchSpotMode(0);\n}", "title": "" }, { "docid": "19398b19c26b460f5b2f141d337020f3", "score": "0.7091833", "text": "function homeButton() {\n document.querySelector(\"#home\").onclick = function () {\n render();\n };\n}", "title": "" }, { "docid": "de542a562a454fa0607badbd78c9435b", "score": "0.7050727", "text": "function showHomeView()\n\t\t{\n\t\tcheckForPurchase();\n\t\tcheckGameCenter();\n\n\t\t// Hide OK Button & undim letters\n\t\t$okButton.removeClass('show');\n\t\t$letters.removeClass('dim');\n\n\t\t$game.removeClass('hide').removeClass('inFromRight').addClass('outToRight');\n\t\t$home.removeClass('outToLeft').addClass('inFromLeft');\n\n\t\t$clueBoard.addClass('hide');\n\t\tgameOver = false;\n\t\t}", "title": "" }, { "docid": "70c23848f458bbe2126f656d07a02232", "score": "0.70450544", "text": "static homeState() {\n // go to the top of the page \n window.scrollTo(0, 0);\n \n ui.removeAndSetActiveTab(ui.homeTab, ui.playTab, ui.settingsTab);\n\n location.hash = '#tab=home';\n\n let user = DB.getUserPreferences(),\n gameData = DB.getGameData();\n \n if( user === null || gameData === null ) {// if there is no registered user then we should show the notification \n ui.noRegisteredUser();\n } else {\n ui.showTable(gameData);\n }\n }", "title": "" }, { "docid": "cd7147558c19890de23b7d429b0a8c5e", "score": "0.70402634", "text": "function wire_up_navigation_home(){\n var home = document.getElementById(\"navigation_home\");\n home.addEventListener(\"click\",function(e){\n navigation_hide_all();\n const subsection = document.getElementById(\"main_subsection\");\n subsection.style.display = 'block';\n\n const indicator = document.getElementById(\"navigation_main_indicator\");\n indicator.classList.add(\"active\")\n }, false);\n}", "title": "" }, { "docid": "0715909f618019417ccb3f63d7444c39", "score": "0.7032351", "text": "function navigateHome() {\n\t$.mobile.changePage(\"#main\", \"slide\", false, true);\n}", "title": "" }, { "docid": "cabfdd99d1f67790bb2379041fd65438", "score": "0.7007934", "text": "function goHome(){\n\t\tif (!winHome) {\n\t\t\tvar winmain = require('/win/win_main');\n\t\t\twinHome = winmain.createApplicationWindow();\n\t\t}\n\t\twin.close();\n\t\twinHome.open();\n\t\twinHome.refresh();\n\t}", "title": "" }, { "docid": "39425b7cd33871612d1620f9ef7fbe9c", "score": "0.6982736", "text": "processGoHome() {\n window.todo.model.goHome();\n }", "title": "" }, { "docid": "6ae168228231068d5094093437af19fb", "score": "0.69698125", "text": "static displayHome() {\n Display.clearPopup();\n\n if(isLoggedIn) {\n browser.tabs.query({currentWindow: true, active: true})\n .then((tabs) => {\n if (tabs[0].url.toString().includes(\"gradescope.com/courses/\")) {\n document.querySelector(\"#popup-content\").classList.remove(\"hidden\");\n } else if (tabs[0].url.toString().includes(\"gradescope.com\")) {\n document.querySelector(\"#check-courseURL-content\").classList.remove(\"hidden\");\n } else {\n document.querySelector(\"#check-URL-content\").classList.remove(\"hidden\");\n }\n });\n }\n else {\n document.querySelector(\"#welcome\").classList.remove(\"hidden\");\n }\n\n //toggle icons\n if (document.getElementById(\"profile\").classList.contains(\"clicked\")) {\n document.getElementById(\"profile\").classList.remove(\"clicked\");\n document.getElementById(\"home\").classList.add(\"clicked\");\n }\n }", "title": "" }, { "docid": "80f31b08360eda5468970a07270358d2", "score": "0.69644046", "text": "function switchHome() {\n let timeline = new TimelineLite({\n onComplete: function() {\n document.location.href = \"../index.html\";\n }\n });\n\n let page = $(\"body\");\n let buttons = $(\"button\");\n page.css({\n \"background-color\": \"#111746\",\n \"display\": \" \"\n });\n buttons.css({ \"opacity\": \"0\" });\n timeline.to(page, .5, { autoAlpha: 0 });\n}", "title": "" }, { "docid": "811ebf5186a150fbe009a947141ca6f0", "score": "0.69564617", "text": "function reasoningHomeClick() {\n if ($('.js-slider-menu').hasClass('active')) {\n toggleSliderMenu();\n }\n}", "title": "" }, { "docid": "7fe3824411d64adbcf803a0fcdbfdf56", "score": "0.69485164", "text": "function home() {\n\t\t\tparent.$('#div_barra').hide();\n\t\t\tparent.$('#div_menu').hide();\n\t\t\tparent.$('#div_contenido').fadeIn();\n\t\t\tparent.llamar_Portada();\n\t\t}", "title": "" }, { "docid": "d7d48d85d285b531cd83d2ad2ea4641b", "score": "0.69290227", "text": "function goToHome() {\n\t// clean up markdown in container\n\tclear('#container');\n\tclear('#container2');\n\t$('#container').html(\"\");\n\t// fill in the container with the files\n\tfill('#container', \"\");\n\t// remove all items in side bar container\n\t// set view to home\n\tview = 'home';\n\t// toggle back container to not showing markdown\n\t$('#container').removeClass('markdown');\n}", "title": "" }, { "docid": "f13e95bd18e6cab71502b22ef29b51e8", "score": "0.6869384", "text": "function goHome(e) {\n e.preventDefault();\n setQuizContext({isStarted: false, isFinished: false, number: 0, score: 'Q', correctAnswer: true, questions: Questions});\n \n }", "title": "" }, { "docid": "f8084ac87e8b02d25da3f90e6d09a888", "score": "0.68642545", "text": "function goHome()\n{\n\n hide_map_page_divs();\n clear_current_variables();\n closeRightMenu();\n\n $(\"#containerDivId\").show();\n $(\"div#workspace-select\").show();\n\n}", "title": "" }, { "docid": "f358324e30c3ddbbe3c30a1a52edffe5", "score": "0.68567044", "text": "function click_home() {\r\n\t$(\".home-icon, .logo\").on(\"click\", function(){\r\n\t\tshow_loader();\r\n\t\thide_inner_section();\r\n\t\thide_outcome_page();\r\n\t\tshow_main_matter_sections();\r\n\t\thide_loader();\r\n\t\t$(\".question h3\").html();\r\n\t\t$(\".question span\").html();\r\n\t\treset_breadcrumb();\r\n\t\treset_outcome_page();\r\n\t push_state_window_history(\"\");\r\n\t});\r\n\t$('.home-icon, .logo').keypress(function(e){\r\n if(e.which == 13){//Enter key pressed\r\n\t\t\t$(this).click();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "29df866b2c35acc32c4f587677465353", "score": "0.6855909", "text": "#tapHome() {\n const button = this.#getReturnToHomeButton();\n if (button) {\n button.click();\n }\n }", "title": "" }, { "docid": "728fb36456a022428160b092d554f342", "score": "0.6838577", "text": "function home() {\n $(\"#the-meal-db\").click(function(){\n $(\"#home\").addClass('hidden');\n $(\"#recipe-search\").removeClass('hidden');\n });\n $(\"#nyt-reviews\").click(function(){\n $(\"#nyt-search\").removeClass('hidden');\n $(\"#home\").addClass('hidden');\n });\n\n}", "title": "" }, { "docid": "f649eaa1d949836448d78ef5cddb6b47", "score": "0.68277633", "text": "function loadHomePage() {\n // notify ifame load app icons (by view:'*')\n var isHome = false;\n var mainPage = _visit_box.pop();\n if (!mainPage) isHome = true;\n\n _this.tell('load-mainpage', {\n view: '*',\n mainPage: mainPage,\n isHome: isHome\n });\n }", "title": "" }, { "docid": "0b694853db4f3bafb055b7fd9b30544e", "score": "0.6827371", "text": "function toggleHome(shift) {\n shift.home = !shift.home;\n }", "title": "" }, { "docid": "1bb6c8f2234c3592613a4dcbb68cc022", "score": "0.67950094", "text": "function home (){\n\t\t\t\tvar subTitle = document.getElementById(\"subTitle\");\n\t\t\t\tsubTitle.textContent = \"Home\";\n\t\t\t\tvar element = document.getElementById(\"imgCol\");\n\t\t\t\telement.innerHTML = \"\";\n\t\t\t\t//this wont work anymore\n\t\t\t\t//getImages();\n\t\t\t\tnewsearch.view();\n\t\t\t}", "title": "" }, { "docid": "d416852513f39edaf39bf1d1eaa5e518", "score": "0.6783863", "text": "setViewToHome() {\n this.setViewMode(\"home\");\n }", "title": "" }, { "docid": "2ebe8039166815d5ee5e6d9a1d673ce3", "score": "0.67830455", "text": "launchHomeScreen() {\n KeepAwake.deactivate();\n this.redirectToHome();\n this.clearTimeouts();\n }", "title": "" }, { "docid": "4780be96fe4f5dd3cf7e2dcdcc724720", "score": "0.6777408", "text": "function linkHomeOpen() {\r\n //2\r\n closeStillOpen();\r\n //3\r\n if (screenSizeIsNotTooSmall()) {\r\n navBarLinks.each(function () {\r\n $(this).css('color', 'white');\r\n });\r\n }\r\n //4\r\n if (screenSizeIsTooSmall()) {\r\n $('nav').animate({ width: '70%' }, 300);\r\n $('nav a').animate({ fontSize: '2.8vh' }, 100);\r\n $('#nav-about').animate({ top: '0', left: '0' }, 50);\r\n $('#nav-home').animate({ top: '0', left: '0' }, 50);\r\n $('#nav-music').animate({ top: '0', left: '0' }, 50);\r\n $('#nav-news').animate({ top: '0', left: '0' }, 50);\r\n $('#nav-contact').animate({ top: '0', left: '0' }, 50);\r\n }\r\n }", "title": "" }, { "docid": "ba3a5b51b4b5ed1441f13d80c2f96e75", "score": "0.676925", "text": "function toHome() {\n window.location.replace('/#home');\n }", "title": "" }, { "docid": "f1057728d1846ca644ac43db61dd3f08", "score": "0.6768937", "text": "function showHome(){\n if(appStatus.keywordsShowing){\n $('#keywords').show();\n $('#backHome').hide();\n $('.keywords-text').hide();\n $('.letters-text').show();\n appStatus.keywordsShowing = false;\n updateUI(letters.initialLetters.split('')); \n } else {\n toggleSpaceDeleteBack();\n }\n }", "title": "" }, { "docid": "af322d20f0ac4e881669f49181de0f13", "score": "0.6766517", "text": "handleHomeClick() {\n this.setState({ goToHome: true });\n this.props.onSearch();\n }", "title": "" }, { "docid": "c2b2b1a6cf8d1261b665519d758b9424", "score": "0.67525995", "text": "function backToHome(){\n const homebackButton = document.querySelector('.homeback');\n homebackButton.addEventListener('click', function(){\n window.scrollTo({\n top:0,\n });\n resetSelection(); //Adjust new active Section.\n clearNavigationBar(); //Reset navigation bar.\n buildNavBar(); //Build new navigation bar with sutable section number.\n });\n }", "title": "" }, { "docid": "eb8711ec712d22759376dc5e610ca17b", "score": "0.6744146", "text": "function home(){\r\n history.push('/');\r\n history.go(0);\r\n }", "title": "" }, { "docid": "a174d97274f09c76bdc1fbd9c7ff4cd4", "score": "0.6731779", "text": "function onClickHome() {\n if (userType === \"educator\") {\n location.href = \"./educator-home.html\";\n } else if (userType === \"student\") {\n location.href = \"./student-home.html\";\n } else {\n location.href = \"../index.html\";\n }\n}", "title": "" }, { "docid": "dbc2b0c5084bea9cbf19cd962ae9e054", "score": "0.6729467", "text": "homeRoute() {\n this.closeModals();\n\n if (this.$route.name === 'home') {\n \tthis.$eventHub.$emit('refresh-home');\n }\n }", "title": "" }, { "docid": "66e9ce59322f47647f89b7c7b1bf7475", "score": "0.6707614", "text": "goTo(){\n this.home.click(); \n }", "title": "" }, { "docid": "244f8856aa35e89c7764bf432b534fb9", "score": "0.669606", "text": "toHome(){\n this._toHome();\n}", "title": "" }, { "docid": "7a1c821dcadcc7c84278e7441cf4c797", "score": "0.66909796", "text": "function goHome(feeds_url_id){ \r\n\t$('.goback').trigger('click');\r\n\t$('#one>.ui-header .info').html('');\r\n\t$('#megamenu>.header').css('background','#fff url(\"images/'+feeds_url_id+'.jpg\") 0px no-repeat'); \r\n\t$('#one>.ui-header').css('background','#fff url(\"images/'+feeds_url_id+'.jpg\") 0px no-repeat'); \r\n\t$('#one>.ui-header').css('background-size','100%'); \r\n\tif(feeds_url_id == \"\") $('#one>.ui-header').css('background','#fff url(\"images/image.jpg\") 0px no-repeat'); \r\n}", "title": "" }, { "docid": "133209cc98481b990830675bb5fa6e1d", "score": "0.6679425", "text": "navigateToHomePage() {\n this[NavigationMixin.Navigate]({\n type: 'standard__namedPage',\n attributes: {\n pageName: 'home'\n },\n });\n }", "title": "" }, { "docid": "9b1155da5857d7659842b68080e1de2b", "score": "0.666028", "text": "function renderHomePage(){\n document.querySelector(\".back-to-homepage\").addEventListener('click',(e)=>{\n e.preventDefault();\n resetNewRecipeElements();\n showHomePage();\n });\n\n document.querySelector(\".back-to-homepage-1\").addEventListener('click',(e)=>{\n e.preventDefault();\n showHomePage();\n });\n\n document.querySelector(\".back-to-homepage-2\").addEventListener('click',(e)=>{\n e.preventDefault();\n showHomePage();\n }); \n }", "title": "" }, { "docid": "5a97b6fd13f13eca0e250cfb5adbab6c", "score": "0.6659568", "text": "function homeButtonAlt() {\n location.href = \"index.html\";\n}", "title": "" }, { "docid": "f84d6d9192e95c097270e5ad227afffe", "score": "0.6657166", "text": "function backToHome(){\n\tif (pageSelected == 1){\n\t\tdocument.getElementById(\"main-content\").style.display = \"none\";\n\t\tdocument.getElementById(\"right-menu\").style.display = \"block\";\n\t\tdocument.getElementById(\"mob-toolbar\").style.display = \"block\";\n\t} else {\n\t\tdocument.getElementById('right-menu').style.display = \"none\";\n\t\tdocument.getElementById(\"left-menu\").style.display = \"block\";\n\t\tdocument.getElementById(\"mob-toolbar\").style.display = \"none\";\n\t}\n\tpageSelected = 0;\n}", "title": "" }, { "docid": "eadf191e47c82505e30e9acd68b3e043", "score": "0.66559607", "text": "function page_home_menu() {\n\t\t\tctx.save();\n\t\t\t//ctx.font = '24px DINPro-Light';\n\t\t\tcolor_menu.rollcolor();\n\t\t\tcolor_menu.changeFill();\n\t\t\tctx.font = '24px Luganskiy';\n\t\t\tctx.fillText('PERSON', 40, 58);\n\t\t\tctx.fillText('RESUME', 215, 58);\n\t\t\tctx.fillText('CONTACT', 390, 58);\n\t\t\tctx.restore();\n\t\t}", "title": "" }, { "docid": "91181bb996def8c0519e3847fbcffb3f", "score": "0.6642851", "text": "function openHome(container) {\r\n //console.log(\"home clicked\")\r\n removeHighlight();\r\n var homeButton = document.getElementById(\"home\");\r\n homeButton.className = \"active\";\r\n var homeText = \"<br>Hi User! Click on a date to see the maximum temperature and average humidity\";\r\n container.innerHTML=homeText;\r\n}", "title": "" }, { "docid": "6a855ee5ef1be3d3eeed3b909f314455", "score": "0.6641042", "text": "function handleHomeClick() {\n $('nav').on('click', '.name', function(event) {\n console.log('`handleHomeClick` ran');\n reasoningHomeClick();\n });\n console.log('`handleHomeClick` ran');\n}", "title": "" }, { "docid": "a4e5d25ce3e74f0fe1a88f232eb24c9f", "score": "0.6622793", "text": "function goToHome(){\n window.location.hash = '#/'\n }", "title": "" }, { "docid": "d6d5c81f6d4843931d25f269c33ec5b9", "score": "0.6614895", "text": "function loadHome() {\n var title = \"home\";\n // Activates the Home screen.\n header(\"Home\");\n changeLink(title);\n changeContent(title);\n \n // Loads user's name\n $(\".app-user-name\").text(name);\n \n // Reloads alerts and puts them on to the content.\n if(typeS) { getData(url + \"assign.json\", jsonAlerts); }\n if(typeI) { getData(url + \"assigner.json\", jsonAlerts); }\n}", "title": "" }, { "docid": "6883895a6289a29285524ce17836f5a4", "score": "0.6611032", "text": "function goHome(){\n window.location.href = \"/\";\n}", "title": "" }, { "docid": "58318aa331aa2440220b4f95765ff3d6", "score": "0.6597942", "text": "function goHome() {\n Ti.App.Properties.setBool('has_skipped_login', true);\n\n if (!showedMap) {\n Alloy.createController('index').getView().open();\n }\n\n $.login.close();\n}", "title": "" }, { "docid": "0d3c1285bd0879f31a4bed79a3a59862", "score": "0.6571485", "text": "function showHomeButton() {\n document.addEventListener('scroll', goBackToHome);\n}", "title": "" }, { "docid": "953b6d08c48cd428bbe9d3f562966e6f", "score": "0.65609205", "text": "home() {\n this[command](RETURN_HOME);\n }", "title": "" }, { "docid": "2e58a2105bbe7902ac20a2cb9e31130c", "score": "0.65601003", "text": "@keydown( 'cmd+h', 'ctrl+alt+h' )\n homeGroup(e) {\n e.preventDefault();\n window.home();\n }", "title": "" }, { "docid": "f939362f67b7a1985cbd7b1a7b0968fe", "score": "0.6557956", "text": "function goToHome(){\r\n window.location.href = \"/\";\r\n}", "title": "" }, { "docid": "aeba66377c612d4915f0eb181bc38765", "score": "0.65551996", "text": "function changeToHomeView() {\n hide(formView);\n hide(savedView);\n hide(homeButton);\n\n show(homeView);\n show(randomCoverButton);\n show(saveCoverButton);\n\n viewSavedButton.disabled = false;\n}", "title": "" }, { "docid": "7fbdb5ac84429f746e514afea01d709c", "score": "0.6532349", "text": "function homeButton() {\n location.href = \"../index.html\";\n}", "title": "" }, { "docid": "4a654127393594e9f6ee3ff1a08acced", "score": "0.6527493", "text": "function intiliaze (){\n\t\t\t\tdocument.getElementById(\"Home\").addEventListener(\"click\", home);\n\t\t\t\tdocument.getElementById(\"Newest\").addEventListener(\"click\", newest);\n\t\t\t\tdocument.getElementById(\"Fav\").addEventListener(\"click\", fav);\n\t\t\t\tdocument.getElementById(\"Most\").addEventListener(\"click\", most);\n\t\t\t\tdocument.getElementById(\"Kids\").addEventListener(\"click\", kids);\n\t\t\t}", "title": "" }, { "docid": "ff2787273c3483ae7833692c387aaa68", "score": "0.6517721", "text": "function goToHome()\n{\n goToFolder(engine.homeFolder());\n}", "title": "" }, { "docid": "32338dc47b2c4e8323400f631f13905b", "score": "0.651732", "text": "function showhome() {\n currentpage = document.getElementsByClassName(\"current\")[0]\n home = document.getElementById(\"home\");\n if (!home.classList.contains(\"current\")){\n currentpage.classList.remove(\"current\"),\n currentpage = document.getElementById(\"home\"),\n currentpage.classList.add(\"current\")\n }\n}", "title": "" }, { "docid": "872964b2e5844d880292ac5688a0947a", "score": "0.6516534", "text": "loadHomepage() {\n super.open('');\n }", "title": "" }, { "docid": "3721d47eafd1ace2303ada8ff6b05d36", "score": "0.65037614", "text": "function homeTap (x,y) {\n\tif (x>0 && x<101 && y>269 && y<340) {\n\t\tbuildForecastScreen(dayCompress(0), dayCompress(1), dayCompress(2), dayCompress(3));\n\t\tcurrentScreen = 'forecast'; \n\t} else if (x>255 && x<340 && y>269 && y<340) {\n\t\tbuildSettingsScreen();\n\t\tcurrentScreen = 'settings';\n\t}\n}", "title": "" }, { "docid": "0f926b9cb71b5499107c547e8dfb19e1", "score": "0.6482335", "text": "function goHome(showAllChildren = true) {\n if (showAllChildren) {\n $(\"#allCoins\").children().show();\n }\n $(\"#about\").hide();\n $(\"#liveReports\").hide();\n $(\"#coinNotFound\").empty();\n $(\"#home\").show();\n resetGraph();\n }", "title": "" }, { "docid": "b5acaaf653643c3ebd42d9c67b7603c3", "score": "0.647741", "text": "function goToHome() {\n electron_1.ipcRenderer.send(\"goToHome\");\n}", "title": "" }, { "docid": "cffd43eb9e140658c5256c7cc179d453", "score": "0.6474147", "text": "function topMenuClick(){\n \n var clicked = $(this); //get clicked element\n \n //Determine clicked button\n switch (clicked.attr('id')){\n case 'home':\n window.location.href = HOME_PAGE;\n break;\n case 'go-to-articles':\n window.location.href = UI_PAGE + \"articles.html\";\n break;\n }\n \n}//END topMenuCLick() function", "title": "" }, { "docid": "4d7469864ee8f8948ab4ada1b250f25d", "score": "0.64726204", "text": "function navigateToHome() {\n\t\t\twindow.location = \"/\";\n\t\t}", "title": "" }, { "docid": "26d446c80edd3345b24653ed2d987442", "score": "0.6455489", "text": "function gohome() {\n window.location.replace(\"./game\");\n}", "title": "" }, { "docid": "25593d2d3e7bba97111c89f28c3fff41", "score": "0.6452944", "text": "function Home(){\n event.preventDefault();\n $(\"#Home\").show();\n $(\"#OrderCar\").hide();\n $(\"#Catalog\").hide();\n $(\"#Cart\").hide();\n }", "title": "" }, { "docid": "0273aae7611250ec0507e50a5ec72aaf", "score": "0.6448414", "text": "function return_home()\n{\n window.location = document.getElementById('cfg').className;\n}", "title": "" }, { "docid": "37e33e4f7344c8bc3ee63adf22b07dc7", "score": "0.6444234", "text": "function backButton(){\n\tif (typeof BackApp == 'function'){\n\n\t}else{\n\t\t$('.boton-volver-header').click(function(){\n\t\t\thistory.back();\n\t\t});\n\t}\n\t//console.log(\"volver\");\n}", "title": "" }, { "docid": "ec0d8d6549120a1d5af99dbc3265cde6", "score": "0.6431601", "text": "function backTo_home(){\n\tdocument.getElementById('back-home-btn').style.display = 'none';\t\n\tdocument.getElementById('users-table').style.display = '';\n\tdocument.getElementById('posts-table').style.display = 'none';\n}", "title": "" }, { "docid": "8bb9f98a963386741fcb8026c5a1275f", "score": "0.64222527", "text": "function clickHome() {\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "8f46ef30de85be1cf5c9f033ecb8e956", "score": "0.641633", "text": "function home() {\n aktivnaStranica = \"home\";\n $(\".header h1\").html(\"Dani strukovnih nastavnika\");\n $(\"#sadrzaj\").removeClass(\"active\");\n $(\"#sadrzaj\").scrollTop(0);\n $(\".header\")\n .removeClass(\"sivo\")\n .removeClass(\"plavo\");\n $(\".nav_icons\").removeClass(\"aktiv-nav\");\n $(\".header-ikona\").attr(\"data-id\", \"nav\");\n}", "title": "" }, { "docid": "0f9f1433991c7633c239c759e6155389", "score": "0.64024806", "text": "returnHome() {\n this.position = 0;\n this.globalPosition = this.startingGlobalPosition;\n }", "title": "" }, { "docid": "4d7eb96afde88dc15cb53ffa36073c13", "score": "0.6394295", "text": "function scene_homepage() {\n\t\t\tpage_home_background();\n\t\t\tpage_home_waves();\n\t\t\tpage_home_menu();\n\t\t}", "title": "" }, { "docid": "35fcb9c08fddc587f30ca3634f456fcd", "score": "0.6388152", "text": "function loadHome() {\n updateContent(contentType.HOME);\n}", "title": "" }, { "docid": "55aeba805cbdca4656dd5a773fe7f96d", "score": "0.63835007", "text": "function goto_home_page()\n{\n\t//home.phtml finds the current user's home page id and redirects to it\n\ttop.document.location = '/home.phtml';\n}", "title": "" }, { "docid": "532f8246ee0d5006dd08fca4f0894b74", "score": "0.6366365", "text": "goToHome() {\n console.log('goToHome');\n this.__save();\n }", "title": "" }, { "docid": "3de066299d969d0efb4e78bb0032a87c", "score": "0.6358775", "text": "function Home() {\r\n location.href = \"index.html\";\r\n}", "title": "" }, { "docid": "378fd3cb6288ad3734b3fd4b1ddf7e5a", "score": "0.63576883", "text": "function home() {\n menuBtnHomeVar.classList.add(\"clicked-button-color\");\n homeVar.classList.add(\"clicked-button-color\");\n if (lastLink !== document.getElementById(\"home\")) {\n lastLink.classList.remove(\"clicked-button-color\");\n lastLinkMenu.classList.remove(\"clicked-button-color\");\n }\n lastLink = document.getElementById(\"home\");\n lastLinkMenu = document.getElementById(\"menuBtnHome\");\n}", "title": "" }, { "docid": "ec22c22f84ac30f06ebb62f75c30d716", "score": "0.63574463", "text": "pressHome () {\n if (this.buttonHasFocus) {\n this.index = 0;\n this.focus();\n }\n }", "title": "" }, { "docid": "05045a7a2f6211bd6572edf54070cf01", "score": "0.6355402", "text": "function showHome() {\n event.preventDefault();\n // no display\n displayQuestions.style.display = \"none\";\n displayHighScores.style.display = \"none\";\n // block display\n displayOpeningPage.style.display = \"block\";\n linkToHighScoresButton.style.display = \"block\";\n quizTimer.style.display = \"block\";\n // reset timer to 0 seconds\n clearTime()\n // accessing local storage to recover existing high scores\n highscores = JSON.parse(localStorage.getItem(\"highscores\"));\n}", "title": "" }, { "docid": "55adff86cda65021007dc5dfa63a2de2", "score": "0.6348326", "text": "function homePress(){\n document.getElementById(\"home_page\").style.display = \"inline\";\n\n // hide all other pages\n document.getElementById(\"myProfile_page\").style.display = \"none\";\n document.getElementById(\"items_page\").style.display = \"none\";\n document.getElementById(\"itemComments_page\").style.display = \"none\";\n}", "title": "" }, { "docid": "bf8eb17bb0fed5e3eb9bc21cb343b7db", "score": "0.63433665", "text": "function backToHome(){\n scoresPageEl.style.display = \"none\";\n gameOverPageEl.style.display = \"none\";\n homePageEl.style.display = \"flex\";\n timeLeft = 45;\n currentQuestionIndex = 0;\n}", "title": "" }, { "docid": "a8410f1d19f47b2c8bbce3254cd33b91", "score": "0.6337272", "text": "function home(){\n\t\tloadBooks();\n\t}", "title": "" }, { "docid": "5327a72e7beba8b15b019e8d0c6bd1c5", "score": "0.6332361", "text": "function onHealthDataClick(){\n\ttry{\n\t\tif (menueClicked == false) {\n\t\t\tmenueClicked = true;\n\t\t\tAlloy.Globals.NAVIGATION_CONTROLLER.openWindow('newHeathScreen');\n\t\t\tsetTimeout(function() {\n\t\t\t\tmenueClicked = false;\n\t\t\t}, 1000);\n\t\t}\n\t}catch(ex) {\n\t\tcommonFunctions.handleException(\"home\", \"onHealthDataClick\", ex);\n\t}\n}", "title": "" }, { "docid": "7d58a1ec983c200243aaf0d985c40164", "score": "0.6331681", "text": "function showHomeDisplay() {\n show([homeNavBar, browseTabBtn, favoritesTabBtn, menuTabBtn, sortByCourseHeading, rectangleGallerySection, circleGallerySection]);\n hide([browseNavBar, favoritesNavBar, menuNavBar, recipeNavBar, homeTabBtn]);\n}", "title": "" }, { "docid": "4ec63348dd484a55fe26858ee13f2311", "score": "0.6323191", "text": "function goHome() {\n if (jeffTemplate) {\n window.location.href = '#wrapper';\n }\n else if (sethTemplate) {\n document.getElementById('navTab1').style.display = 'block';\n document.getElementById('navTab2').style.display = 'none';\n document.getElementById('navTab3').style.display = 'none';\n templatesSection.style.display = 'none';\n colorsSection.style.display = 'none';\n backgroundsSection.style.display = 'none';\n aboutUsSection.style.display = 'none';\n sethHomeLink.style.background = sethStoreColor[1];\n sethAboutUsLink.style.background = '#f1f1f1';\n sethChooseLayoutLink.style.background = '#f1f1f1';\n }\n else if (joyTemplate) {\n header.style.display = 'block';\n templatesSection.style.display = 'none';\n colorsSection.style.display = 'none';\n aboutUsSection.style.display = 'none';\n backgroundsSection.style.display = 'none';\n header.style.animationName = 'slide-down';\n header.style.animationDuration = '1.5s';\n homeLink.style.backgroundColor = '#333';\n aboutUsLink.style.backgroundColor = '#000';\n chooseLayoutLink.style.backgroundColor = '#000';\n homeLink.addEventListener('mouseout', function() { this.style.backgroundColor = '#333'; });\n aboutUsLink.addEventListener('mouseout', function() { this.style.backgroundColor = '#000'; });\n chooseLayoutLink.addEventListener('mouseout', function() { this.style.backgroundColor = '#000'; });\n }\n}", "title": "" }, { "docid": "42270a3b47f01be2f1eec2dc2982fca9", "score": "0.632029", "text": "function setNavEvents() {\r\n\t\tget(\"home\").onclick = function() {changeTo(\"home\");};\r\n\t\tget(\"rr1\").onclick = function() {changeTo(\"rr1\");};\r\n\t\tget(\"rr2\").onclick = function() {changeTo(\"rr2\");};\r\n\t\tget(\"rr3\").onclick = function() {changeTo(\"rr3\");};\r\n\t\tget(\"pr\").onclick = function() {changeTo(\"pr\");};\r\n\t\tget(\"fthp\").onclick = function() {changeTo(\"fthp\");};\r\n\t}", "title": "" }, { "docid": "28c49b288700944aab4dcbf31591a6b5", "score": "0.6316396", "text": "function onBackButton() {\n\tif (isPage == \"main\") {\n\t\tif (isPlaying) {\n\t\t\tplayPause();\n\t\t}\n\t\tnavigator.app.exitApp();\n\t}\n\telse {\n\t\tloadMenu();\n\t}\n}", "title": "" }, { "docid": "217e4d11fa6e92900fd346d39d940125", "score": "0.6313108", "text": "function onForeground(){\n\tcheckHome(function(data){\n\t\tvar new_home = data.home;\n\t\tif ( new_home == home) { //didn't change location\n\t\t\tif ( ! new_home ) { //we're away \n\t\t\t\tstart_camera(true);\n\t\t\t} else {\n\t\t\t\tconnect();\n\t\t\t}\n\t\t} else { //we moved in or out the house, run setup for new environment\n\t\t\thome = new_home;\n\t\t\tinitialize();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "433bed759da5502a2cd41f5d083b06a3", "score": "0.6307641", "text": "function HOME(){\r\n\tcontent = document.getElementById(\"PSMWE_content\");\r\n\tcontent.innerHTML = HOMECnt; \r\n\tdocument.getElementById('QL').addEventListener('click', QL, false);\r\n\t/*document.getElementById('EH').addEventListener('click', EH, false);*/\r\n\tdocument.getElementById('CR').addEventListener('click', CR, false);\r\n\tdocument.getElementById('GI').addEventListener('click', GI, false);\r\n\tdocument.getElementById('EN').addEventListener('click', EN, false);\r\n\tdocument.getElementById('ST').addEventListener('click', ST, false);\r\n\tdocument.getElementById('OP').addEventListener('click', OP, false);\r\n\tdocument.getElementById('LL').addEventListener('click', LLLoginPopUp, false);\r\n /* if(LiveLinkState == true){clearInterval(LiveLinkFeedInt);LiveLinkState = false;}*/\r\n\tif(LVItNoDelayState == true){clearInterval(LVItNoDelay);LVItNoDelayState = false}\r\n\tclearInterval(CraftResponseInt);\r\n}", "title": "" }, { "docid": "eb7f89f395fb39284bbcb1d3e7ef86eb", "score": "0.63001996", "text": "returnHome() {\n // Calls the same function regardless of page but sends different message\n if(this.state.page === \"Info\") {\n\n // Calls on fuction that sets home page to be rendered\n // The message it's passing lets the application know where the user is coming from\n this.props.button(\"Leave Info Page\");\n }\n else {\n\n // Calls on fuction that sets home page to be rendered\n // The message it's passing lets the application know where the user is coming from\n this.props.button(\"Leave Personalised Page\")\n }\n \n }", "title": "" }, { "docid": "00f3f2f5b8ce0a467526bbe833185cda", "score": "0.6300031", "text": "function gotoHome() {\n window.location.href = \"index.html\";\n}", "title": "" }, { "docid": "b1ca4dbff3a287dd48c12dcd963bcfe4", "score": "0.6295204", "text": "onNavigateHome (){\r\n\tbrowserHistory.push(\"/Home\");\r\n}", "title": "" }, { "docid": "e177f5a4e367815bb086ef91ac88e50a", "score": "0.62932473", "text": "function Home(){\n\t$(\"body\").fadeOut(500, function() {\n\t\twindow.location = 'index.php';\n\t});\n}", "title": "" } ]
a1e6b58af0e2720a5addcc613ed7f811
each element of (new Classy)() is a ClassyWrapper
[ { "docid": "3c1e4d1d706a71660919e0e86f3ba06f", "score": "0.5627573", "text": "function ClassyWrapper(content) {\n var defs = options.$defaults || {};\n\n defs[$pk] = ID;\n\n _.defaults(content, defs);\n\n // set the defaults for the Object\n _.assign(this, content);\n\n // apply relationships\n applyHasMany(this);\n\n this.$id = function $id() {\n return this[$pk];\n };\n\n this.$value = function $value() {\n var n = {};\n\n _.each(this, function(v, k) {\n if (_.indexOf(k, '$') !== 0)\n n[k] = v;\n\n if (options.$hasMany[k]) {\n n[k] = v.$export ? v.$export() : [];\n }\n });\n\n return n;\n };\n\n this.$isActive = function $isActive() {\n return (this === this.constructor.$current());\n };\n\n this.$copy = function $copy(keepKey) {\n var v = this.$value();\n\n // remove the $pk key\n if (!keepKey)\n delete v[$pk];\n\n return context(v);\n };\n\n // rewrite some special methods (exceptions)\n }", "title": "" } ]
[ { "docid": "b9e399ad529d3dacb15fad6546fcab35", "score": "0.60759103", "text": "function Class(){}", "title": "" }, { "docid": "edbb2ab3a7f2b23e545242e3609beb3e", "score": "0.6031723", "text": "function _turboClasses()\n {\n var myArgs = Array.prototype.slice.call(arguments);\n _turboClassesAndAttributes(myArgs[0]);\n }", "title": "" }, { "docid": "24ac7e78acfc3ea24e8ac3c1f0334244", "score": "0.59907526", "text": "function c(obj){return document.getElementsByClassName(obj);}", "title": "" }, { "docid": "252d9d8ed6c24453e1c0db473524b5bd", "score": "0.5920519", "text": "function Class(){} // called upon a class to create a subclass", "title": "" }, { "docid": "229383ed7d1e2e3cb304fd5ec7bb8861", "score": "0.5915583", "text": "function ClassHandle() {\n}", "title": "" }, { "docid": "527ce43703e6ec702fe7a945d2d3f07f", "score": "0.5891801", "text": "_populateClassCaches() {\n var classSet = new Set();\n var classList = [];\n var thisConstructor = this.constructor;\n var maxLinks = 20;\n\n while (thisConstructor !== undefined && maxLinks) {\n maxLinks -= 1;\n var constructorName = thisConstructor.className;\n\n if (constructorName === undefined || constructorName === '') {\n break;\n }\n\n var constructorNameShort = constructorName.slice(constructorName.lastIndexOf('.') + 1);\n classList.push(constructorNameShort);\n classSet.add(thisConstructor);\n classSet.add(constructorName);\n classSet.add(constructorNameShort);\n thisConstructor = Object.getPrototypeOf(thisConstructor);\n }\n\n classList.push('object');\n this._storedClasses = classList;\n this._storedClassSet = classSet;\n }", "title": "" }, { "docid": "284fb10d7504330f0dc16fbe23d5fe21", "score": "0.5871073", "text": "function Class() {}", "title": "" }, { "docid": "284fb10d7504330f0dc16fbe23d5fe21", "score": "0.5871073", "text": "function Class() {}", "title": "" }, { "docid": "284fb10d7504330f0dc16fbe23d5fe21", "score": "0.5871073", "text": "function Class() {}", "title": "" }, { "docid": "ba691d10215e423dee4cb362aa049dab", "score": "0.5857591", "text": "visitClassType(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "9d50c72566eb7a89c776e61f5dd2000b", "score": "0.5837592", "text": "function Class(){} // Called on a class to create a subclass.", "title": "" }, { "docid": "068e76b93b44d0505c8b9b8c6f421f15", "score": "0.5833011", "text": "layeredClasses() {\n return this.layeredObjects().map(ea => ea.constructor);\n }", "title": "" }, { "docid": "f9f4c2cad87814cc8840d5f9ec7befd5", "score": "0.58202523", "text": "function Class(){ }", "title": "" }, { "docid": "1c0420c0f7d97578cd211d014dcfb44b", "score": "0.58196247", "text": "function ClassList(element) {\n\tthis.element = element;\n}", "title": "" }, { "docid": "466354f8e58a9740b6857ecf3869ec97", "score": "0.5690992", "text": "get myClasses() {\n return {\n 'object': myClass,\n 'listOfObjects': [myClass],\n 'dictionaryOfObjects': { valueClass: myClass },\n }\n }", "title": "" }, { "docid": "77095269f71dc8ccf85ac5ebcb97d402", "score": "0.56891096", "text": "get cls() {\n if (!this._cls) {\n this._cls = new DomClassList(super.get('cls'));\n }\n return this._cls;\n }", "title": "" }, { "docid": "3e8631f635d3222f98bd5e0a1c5592aa", "score": "0.56794256", "text": "visitClassBody(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "66b357212e395d0a9eadfc39f3dd1edd", "score": "0.56754744", "text": "visitClassInstanceCreationExpression(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.5674873", "text": "function Wrapper() {}", "title": "" }, { "docid": "a8a336d28d4364ce5b0ffca4011d8ba9", "score": "0.56282514", "text": "function ClassList(element) {\n this.element = element;\n }", "title": "" }, { "docid": "a8a336d28d4364ce5b0ffca4011d8ba9", "score": "0.56282514", "text": "function ClassList(element) {\n this.element = element;\n }", "title": "" }, { "docid": "abbc8e979ade9cae6948d820762a342a", "score": "0.5613867", "text": "function ny(a){return{addClass:function(b){a.classList.add(b)},removeClass:function(b){a.classList.remove(b)},hasClass:function(b){return a.classList.contains(b)}}}", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "a2ae74d521b64e1081e5d0339fcb6639", "score": "0.5599398", "text": "function Class() { }", "title": "" }, { "docid": "2f83124dd1e6ffd476e099b77d8f2081", "score": "0.55805176", "text": "function SuperclassBare() {}", "title": "" }, { "docid": "08089fe079a7d8534f18e12bc5ccffa4", "score": "0.55800694", "text": "static classList() {\n return {\n List: List,\n Item: Item,\n };\n }", "title": "" }, { "docid": "566b7e4b9e807303f3b239c8a294390c", "score": "0.55341315", "text": "injectClasses(element) {\n const applyClasses = function(x_class) {\n const [div, definitions] = this\n if (x_class && definitions.classes[x_class]) {\n definitions.classes[x_class].split(' ')\n .forEach(class_name => div.classList.add(class_name))\n }\n }\n\n this.elementAndChildren(element, 'x-class').forEach(div => {\n const x_classes = div.attributes['x-class'].value.split(' ')\n // passing a custom variable to the function as its \"this\"\n if (x_classes) { x_classes.forEach(applyClasses, [div, this.definitions]) }\n })\n }", "title": "" }, { "docid": "e0d45da5ca79efff243de64a2040e3b2", "score": "0.55285156", "text": "function t(n){const o={};for(const e in n){if(\"declaredClass\"===e)continue;const r=n[e];if(null!=r&&\"function\"!=typeof r)if(Array.isArray(r)){o[e]=[];for(let n=0;n<r.length;n++)o[e][n]=t(r[n]);}else \"object\"==typeof r?r.toJSON&&(o[e]=JSON.stringify(r)):o[e]=r;}return o}", "title": "" }, { "docid": "5cf0f5e09cc1414d70fad800e6271634", "score": "0.55002046", "text": "visitClassOrInterfaceType(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "8e46acb94fc41acd3e5f744e272597aa", "score": "0.54716", "text": "function create_dummy_iclass(module) {\n var iclass = {},\n proto = module.$$prototype;\n\n if (proto.hasOwnProperty('$$dummy')) {\n proto = proto.$$define_methods_on;\n }\n\n var props = Object.getOwnPropertyNames(proto),\n length = props.length, i;\n\n for (i = 0; i < length; i++) {\n var prop = props[i];\n $prop(iclass, prop, proto[prop]);\n }\n\n $prop(iclass, '$$iclass', true);\n $prop(iclass, '$$module', module);\n\n return iclass;\n }", "title": "" }, { "docid": "a9c0739c0f5b60e50df4bc83b7c8d75e", "score": "0.54373235", "text": "function instantiatedClass (within, claDef, moFile) {\n const claSpe = claDef.class_specifier\n const longCla = claSpe.long_class_specifier\n if (longCla) {\n const comp = longCla.composition\n if (!comp) {\n return null\n }\n const iniEleLis = comp.element_list\n const eleSec = comp.element_sections\n // Find public and protected element\n const pubEleLis = []\n const proEleLis = []\n if (eleSec) {\n eleSec.forEach(function (obj) {\n const temPub = obj.public_element_list\n const temPro = obj.protected_element_list\n if (temPub) {\n Array.prototype.push.apply(pubEleLis, temPub)\n }\n if (temPro) {\n Array.prototype.push.apply(proEleLis, temPro)\n }\n })\n }\n // All public element list\n Array.prototype.push.apply(pubEleLis, iniEleLis)\n // Find all instantiated classes\n const pubInstances = (pubEleLis.length > 0) ? searchInstances(pubEleLis) : null\n const proInstances = (proEleLis.length > 0) ? searchInstances(proEleLis) : null\n // Find all instantiated classes file path\n const pubInstancesFile = pubInstances ? instanceFilePath(pubInstances, within, moFile) : []\n const proInstancesFile = proInstances ? instanceFilePath(proInstances, within, moFile) : []\n var instantitatedFiles = pubInstancesFile.concat(proInstancesFile)\n // iteratively remove duplicate elements\n if (instantitatedFiles.length > 0) {\n instantitatedFiles = instantitatedFiles.filter(function (item, pos) { return instantitatedFiles.indexOf(item) === pos })\n return instantitatedFiles\n } else {\n return null\n }\n } else {\n return null\n }\n}", "title": "" }, { "docid": "ad867ed9a2dc343fbe5bf94f27b3885b", "score": "0.54199195", "text": "function _class() {\n _classCallCheck(this, _class);\n\n //loop constructors\n for (var c = 0; c < that._constructorMethods.length; c++) {\n //get arguments for this constructor\n var _args2 = arguments[c] || [],\n\n //call constructor, pass args, store result\n instance = new (Function.prototype.bind.apply(that._constructorMethods[c], [null].concat(_toConsumableArray(_args2))))(),\n\n //get own enumerable properties\n props = Object.keys(instance);\n //extend this with result \n for (var k = 0; k < props.length; k++) {\n var prop = props[k];\n this[prop] = instance[prop];\n }\n }\n }", "title": "" }, { "docid": "bdf011743b0306214ec2e3d2ace70524", "score": "0.54130965", "text": "function clazz(SuperClass,methods){var constructor=function constructor(){};constructor.prototype=new SuperClass();constructor.prototype.constructor=constructor;constructor.prototype.parent=SuperClass.prototype;constructor.prototype=$.extend(constructor.prototype,methods);return constructor;}", "title": "" }, { "docid": "9349b0a660891dd53c4d71042fdc33e9", "score": "0.54019076", "text": "function ImbaNodeClassList(dom,classes){\n\t\tthis._classes = classes || [];\n\t\tthis._dom = dom;\n\t}", "title": "" }, { "docid": "26c9676e380dd07c3e23b08d5b8520ec", "score": "0.5388678", "text": "methodsHolder() {\n if (this.isClass()) {\n return this;\n } else {\n return this.flClass;\n }\n }", "title": "" }, { "docid": "b81e2e3a31c34b0d5c91a897495c4071", "score": "0.5360809", "text": "function X(r,t){return r.getElementsByClassName(t)}", "title": "" }, { "docid": "3adb97d91a8b4f0980c49897f7c2f975", "score": "0.53603464", "text": "function instance$getClass() {\r\n return _;\r\n }", "title": "" }, { "docid": "8be00b564f809735c64075df58878118", "score": "0.5354635", "text": "_addClasses() {\n // Add slider class to main elements\n this.sliderElement.classList.add('vjslider');\n\n // Add slide class each slide\n this.slides.forEach((slide) => {\n slide.classList.add('vjslider__slide');\n });\n }", "title": "" }, { "docid": "ecd021eb6dbdac0d9fdd7bdf4d98ac85", "score": "0.5348909", "text": "function Class() {\r\n\r\n}", "title": "" }, { "docid": "8058abbd13ee580265749f8c5d301f5b", "score": "0.5342933", "text": "function $ClassMethodClass() {\n this.__class__ = \"<class 'classmethod'>\"\n}", "title": "" }, { "docid": "3b65a072026383432d71edb231ee8bc3", "score": "0.5326471", "text": "function tameClassPixie(Constructor) {\n return tamePixie(function (_ref) {\n var onError = _ref.onError,\n onOutput = _ref.onOutput;\n\n var callbacks = { onError: onError, onOutput: onOutput };\n var instance = void 0;\n var propsCache = void 0;\n\n return {\n update: function update(props) {\n propsCache = props;\n if (!instance) {\n instance = new Constructor(props, callbacks);\n }\n return instance.update(props, callbacks);\n },\n destroy: function destroy() {\n return instance.destroy(propsCache, callbacks);\n }\n };\n });\n}", "title": "" }, { "docid": "e31f6e0c69df30eb89c8790d78512e64", "score": "0.5305171", "text": "function _c(el) {\n return document.getElementsByClassName(el);\n}", "title": "" }, { "docid": "216c5390c2f8af4aa6396736b6586ed1", "score": "0.53010976", "text": "function BaseClass() {}", "title": "" }, { "docid": "19bebcb60cbfce7cc72a9e74589aaf91", "score": "0.52995384", "text": "function Class() {\n return c[Math.floor(Math.random() * c.length)];\n }", "title": "" }, { "docid": "a91390c2481099c1670e7ae340cc4457", "score": "0.52962196", "text": "function Class()\n{}", "title": "" }, { "docid": "48f97e48ced9f09e9e6f0342ea1e1bf3", "score": "0.52887833", "text": "function test0(){\r\n var arrObj0 = {};\r\n arrObj0[0] = 1;\r\n\r\n function v0(o)\r\n {\r\n for (var v1 = 0 ; v1 < 8 ; v1++)\r\n {\r\n class class7 {\r\n func56 (){\r\n }\r\n }\r\n o[v1] = v1;\r\n }\r\n }\r\n \r\n v0(arrObj0);\r\n\r\n \r\n}", "title": "" }, { "docid": "e3ff5530ba38dfbd8a8ad51cae56cd0e", "score": "0.52867216", "text": "function Yc(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Class extends value \"+String(t)+\" is not a constructor or null\");function n(){this.constructor=e}$c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "24ad704eda02f02b27afe6b08b80991d", "score": "0.52816963", "text": "function patchClass(className) {\n\t var OriginalClass = global[className];\n\t if (!OriginalClass) return;\n\t\n\t global[className] = function () {\n\t var a = bindArguments(arguments);\n\t switch (a.length) {\n\t case 0: this[originalInstanceKey] = new OriginalClass(); break;\n\t case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break;\n\t case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break;\n\t case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break;\n\t case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break;\n\t default: throw new Error('what are you even doing?');\n\t }\n\t };\n\t\n\t var instance = new OriginalClass();\n\t\n\t var prop;\n\t for (prop in instance) {\n\t (function (prop) {\n\t if (typeof instance[prop] === 'function') {\n\t global[className].prototype[prop] = function () {\n\t return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n\t };\n\t } else {\n\t Object.defineProperty(global[className].prototype, prop, {\n\t set: function (fn) {\n\t if (typeof fn === 'function') {\n\t this[originalInstanceKey][prop] = global.zone.bind(fn);\n\t } else {\n\t this[originalInstanceKey][prop] = fn;\n\t }\n\t },\n\t get: function () {\n\t return this[originalInstanceKey][prop];\n\t }\n\t });\n\t }\n\t }(prop));\n\t }\n\t\n\t for (prop in OriginalClass) {\n\t if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n\t global[className][prop] = OriginalClass[prop];\n\t }\n\t }\n\t}", "title": "" }, { "docid": "a3773428563ce53f94ba89785911c411", "score": "0.5279247", "text": "function WrappedPackages(java,classLoader) {\n var packages = classLoader.loadClass(\"edu.mit.simile.javaFirefoxExtensionUtils.Packages\").newInstance();\n\n var objectClass = (new java.lang.Object()).getClass();\n var argumentsToArray = function(args) {\n var a = java.lang.reflect.Array.newInstance(objectClass, args.length);\n for (var i = 0; i < args.length; i++) {\n java.lang.reflect.Array.set(a, i, args[i]);\n }\n return a;\n }\n\n this.getClass = function(className) {\n var classWrapper = packages.getClass(className);\n if (classWrapper) {\n return {\n n : function() {\n return classWrapper.callConstructor(argumentsToArray(arguments));\n },\n f : function(fieldName) {\n return classWrapper.getField(fieldName);\n },\n m : function(methodName) {\n return function() {\n return classWrapper.callMethod(methodName, argumentsToArray(arguments));\n };\n }\n };\n } else {\n return null;\n }\n };\n\n this.setTracing = function(enable) {\n classLoader.setTracing((enable) ? true : false);\n };\n}", "title": "" }, { "docid": "e7bb96582009544c2bd22e50f78d0051", "score": "0.5264005", "text": "function clazz$getClass() {\r\n return Class;\r\n }", "title": "" }, { "docid": "83192b9d9a9a6bd727dee408975eaef5", "score": "0.52504957", "text": "function classes () {\n return this.$formulate.classes({\n ...this.$props,\n ...this.pseudoProps,\n ...{\n attrs: this.filteredAttributes,\n classification: this.classification,\n hasErrors: this.hasVisibleErrors,\n hasValue: this.hasValue,\n helpPosition: this.logicalHelpPosition,\n isValid: this.isValid,\n labelPosition: this.logicalLabelPosition,\n type: this.type,\n value: this.proxy\n }\n })\n}", "title": "" }, { "docid": "b6dba7443fbd6f56b3d5f48977b8dd13", "score": "0.52455026", "text": "function itemWrap(el, wrapper, classes) {\n wrapper.classList.add(classes);\n el.parentNode.insertBefore(wrapper, el);\n wrapper.appendChild(el);\n }", "title": "" }, { "docid": "f81304e387a69f75d05748f3fd506faa", "score": "0.5222653", "text": "function Class(v) { return Object.prototype.toString.call(v).replace(/^\\[object *|\\]$/g, ''); }", "title": "" }, { "docid": "f81304e387a69f75d05748f3fd506faa", "score": "0.5222653", "text": "function Class(v) { return Object.prototype.toString.call(v).replace(/^\\[object *|\\]$/g, ''); }", "title": "" }, { "docid": "f81304e387a69f75d05748f3fd506faa", "score": "0.5222653", "text": "function Class(v) { return Object.prototype.toString.call(v).replace(/^\\[object *|\\]$/g, ''); }", "title": "" }, { "docid": "f81304e387a69f75d05748f3fd506faa", "score": "0.5222653", "text": "function Class(v) { return Object.prototype.toString.call(v).replace(/^\\[object *|\\]$/g, ''); }", "title": "" }, { "docid": "f81304e387a69f75d05748f3fd506faa", "score": "0.5222653", "text": "function Class(v) { return Object.prototype.toString.call(v).replace(/^\\[object *|\\]$/g, ''); }", "title": "" }, { "docid": "f81304e387a69f75d05748f3fd506faa", "score": "0.5222653", "text": "function Class(v) { return Object.prototype.toString.call(v).replace(/^\\[object *|\\]$/g, ''); }", "title": "" }, { "docid": "f81304e387a69f75d05748f3fd506faa", "score": "0.5222653", "text": "function Class(v) { return Object.prototype.toString.call(v).replace(/^\\[object *|\\]$/g, ''); }", "title": "" }, { "docid": "28b6c36c10a77696143606a6c0c3166a", "score": "0.52190995", "text": "_setClass() {\n return 'layer ' + this.classList.value;\n }", "title": "" }, { "docid": "4234cc2b4fe54e40ad120801b24432fa", "score": "0.5217289", "text": "addClasses(...args) {\n // Locally reference our instance variable for easier access / ease of use / caching\n var classList = this.classList;\n\n for (var i = 0, il = args.length; i < il; i++) {\n // Get our argument at index \"i\"\n var className = args[i];\n\n // Don't add to the class list if it is already in the list\n if (classList.indexOf(className) >= 0)\n // skip back to the top of the loop and ignore the code below\n continue;\n\n // Add class to list\n classList.push(className);\n }\n\n // If there is an element, update its classList to reflect the changes\n if (this.element)\n this.element.classList = this.classList.join(' ');\n }", "title": "" }, { "docid": "40411a31899455b9cd5fdcae52fea932", "score": "0.5212221", "text": "thisClassNotThose(element, setClass) { //...exclusiveClasses\n var idx, length = arguments.length;\n for(idx=2; idx < arguments.length; idx++){\n element.classList.remove(arguments[idx]);\n }\n element.classList.add(setClass);\n }", "title": "" }, { "docid": "c25fad9ac0a25f800f7fd4ba42aef2b2", "score": "0.5207046", "text": "static initialize(klass, selector){\n document.querySelectorAll(selector).forEach( elem => new klass(elem));\n }", "title": "" }, { "docid": "dd889c88a01211d572bc0f2415d92449", "score": "0.52046067", "text": "function Class_alloc(){}", "title": "" }, { "docid": "dd889c88a01211d572bc0f2415d92449", "score": "0.52046067", "text": "function Class_alloc(){}", "title": "" }, { "docid": "fbbf2aa74a5f50a250540b8021a0208e", "score": "0.51998377", "text": "function ClassList(defaultClasses) {\n this._classes = defaultClasses || [];\n\n this.add = function(classObj) {\n this._classes.push(classObj);\n };\n\n this.getInd = function(classID) {\n for (var i = 0; i < this._classes.length; i++) {\n if (this._classes[i].id == classID) {\n return i;\n }\n }\n console.error(\"Invalid ClassList ID: \" + classID);\n console.error(new Error().stack);\n return -1;\n };\n\n this.get = function(classID) {\n var ind = this.getInd(classID);\n return (ind > -1) ? this._classes[ind] : null;\n };\n\n this.at = function(ind) {\n return this._classes[ind];\n };\n\n this.remove = function(classID) {\n var ind = this.getInd(classID);\n if (ind > -1) {\n this.removeAt(ind);\n }\n };\n\n this.removeAt = function(ind) {\n this._classes.splice(ind, 1);\n };\n\n this.moveToFront = function(ind) {\n this._classes.unshift(this._classes.splice(ind, 1)[0]);\n };\n\n this.getLastItem = function() {\n return this._classes[this._classes.length - 1];\n };\n\n this.exists = function(classID) {\n for (var i = 0; i < this._classes.length; i++) {\n if (this._classes[i].id == classID) {\n return true;\n }\n }\n return false;\n };\n\n this.copy = function() {\n var listCopy = new ClassList();\n listCopy._classes = this._classes.slice();\n return listCopy;\n };\n\n this.getLength = function() {\n return this._classes.length;\n };\n\n this.toString = function() {\n var str = \"[\";\n for (var i = 0; i < this._classes.length; i++) {\n str += \"Class{id:\" + this._classes[i].id + \"}\";\n if (i < this._classes.length - 1) {\n str += \", \";\n }\n }\n return str + \"]\";\n };\n\n // TODO: consider using binary search/insert to speed things up a bit\n // May not be possible now with moveToFront()...\n}", "title": "" }, { "docid": "53239c91708cdc3f786610c53f11ed7b", "score": "0.5197679", "text": "function patchClass(className) {\n\t var OriginalClass = _global$1[className];\n\t if (!OriginalClass)\n\t return;\n\t _global$1[className] = function () {\n\t var a = bindArguments(arguments, className);\n\t switch (a.length) {\n\t case 0:\n\t this[originalInstanceKey] = new OriginalClass();\n\t break;\n\t case 1:\n\t this[originalInstanceKey] = new OriginalClass(a[0]);\n\t break;\n\t case 2:\n\t this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n\t break;\n\t case 3:\n\t this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n\t break;\n\t case 4:\n\t this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n\t break;\n\t default:\n\t throw new Error('Arg list too long.');\n\t }\n\t };\n\t var instance = new OriginalClass(function () { });\n\t var prop;\n\t for (prop in instance) {\n\t // https://bugs.webkit.org/show_bug.cgi?id=44721\n\t if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n\t continue;\n\t (function (prop) {\n\t if (typeof instance[prop] === 'function') {\n\t _global$1[className].prototype[prop] = function () {\n\t return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n\t };\n\t }\n\t else {\n\t Object.defineProperty(_global$1[className].prototype, prop, {\n\t set: function (fn) {\n\t if (typeof fn === 'function') {\n\t this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);\n\t }\n\t else {\n\t this[originalInstanceKey][prop] = fn;\n\t }\n\t },\n\t get: function () {\n\t return this[originalInstanceKey][prop];\n\t }\n\t });\n\t }\n\t }(prop));\n\t }\n\t for (prop in OriginalClass) {\n\t if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n\t _global$1[className][prop] = OriginalClass[prop];\n\t }\n\t }\n\t}", "title": "" }, { "docid": "bb07ab948d1df33b6376eb3e9b228148", "score": "0.5183729", "text": "constructor() {\n this.setClassOnBody(this.detectBrowser());\n }", "title": "" }, { "docid": "635db81f51602c248e9479ec44a9489d", "score": "0.5169042", "text": "function patchClass(className) {\n\t var OriginalClass = global[className];\n\t if (!OriginalClass) return;\n\n\t global[className] = function () {\n\t var a = bindArguments(arguments);\n\t switch (a.length) {\n\t case 0: this[originalInstanceKey] = new OriginalClass(); break;\n\t case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break;\n\t case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break;\n\t case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break;\n\t case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break;\n\t default: throw new Error('what are you even doing?');\n\t }\n\t };\n\n\t var instance = new OriginalClass();\n\n\t var prop;\n\t for (prop in instance) {\n\t (function (prop) {\n\t if (typeof instance[prop] === 'function') {\n\t global[className].prototype[prop] = function () {\n\t return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n\t };\n\t } else {\n\t Object.defineProperty(global[className].prototype, prop, {\n\t set: function (fn) {\n\t if (typeof fn === 'function') {\n\t this[originalInstanceKey][prop] = global.zone.bind(fn);\n\t } else {\n\t this[originalInstanceKey][prop] = fn;\n\t }\n\t },\n\t get: function () {\n\t return this[originalInstanceKey][prop];\n\t }\n\t });\n\t }\n\t }(prop));\n\t }\n\n\t for (prop in OriginalClass) {\n\t if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n\t global[className][prop] = OriginalClass[prop];\n\t }\n\t }\n\t}", "title": "" }, { "docid": "64ed3c11816c898e5695f8e5e5d29fc0", "score": "0.5167281", "text": "function objj_initialize(aClass) {\n\t// need to initialize top-down\n\tlet chain = [];\n\tlet targetClass = aClass;\n\twhile (targetClass.name !== 'CRObject') {\n\t\tif (!targetClass.initialized)\n\t\t\tchain.unshift(targetClass);\n\t\ttargetClass = Object.getPrototypeOf(targetClass);\n\t}\n\n\t// now check CRObject--we do this separately as mixin maintains state\n\tif (objj_CRObject.$initialized === false) {\n\t\tobjj_CRObject.$initialized = true;\n\t\tchain.unshift(CRObject);\n\t}\n\n\tfor (let i = 0; i < chain.length; i++) {\n\t\tlet targetClass = chain[i];\n\t\ttargetClass.initialize();\n\t\ttargetClass.$initialized = true;\n\t\ttargetClass.load();\n\t}\n\n\t// return arg so we can use as wrapper\n\treturn aClass;\n}", "title": "" }, { "docid": "bb7c91b0e924fbe9ce45e17883858e26", "score": "0.51631427", "text": "function getElementClassObject(classList) {\n var classObj = {};\n for (var i = 0; i < classList.length; i++) {\n classObj[classList.item(i)] = true;\n }\n return classObj;\n}", "title": "" }, { "docid": "b62f9986e43f4f0b3f3d3877203b778c", "score": "0.5158107", "text": "static hack (klass) {\n if (!this.hacks) {\n this.hacks = {}\n }\n return klass.names.map(name => {\n this.hacks[name] = klass\n return this.hacks[name]\n })\n }", "title": "" }, { "docid": "d499df612f078ffe0ff9a6ed115af2f5", "score": "0.5156289", "text": "function classes() {\n\t\tvar clss = Array.prototype.slice.call(arguments);\n\t\tMaps.fillKeys(ephemeraMap.classMap, clss, true);\n\t\tcheckCommonSubstr(clss);\n\t\tPubSub.pub('aloha.ephemera.classes', {\n\t\t\tephemera: ephemeraMap,\n\t\t\tnewClasses: clss\n\t\t});\n\t}", "title": "" }, { "docid": "9e60895f9b4a163d3d3318386fdadc31", "score": "0.5145843", "text": "function classes(a, b) {\n return a && b ? Array.isArray(a) ? a.concat(b) : [a, b] : a ? a : b;\n}", "title": "" }, { "docid": "29aee4babebbb205d37d0bb1f3eec83b", "score": "0.51458216", "text": "function _2class(vb, vl, _in, ch) {\n NOT_IMPLEMENTED();\n}", "title": "" }, { "docid": "51bee516896d06ae80051d3f0fb41390", "score": "0.5145742", "text": "get classList() { return this.panelClass; }", "title": "" }, { "docid": "51bee516896d06ae80051d3f0fb41390", "score": "0.5145742", "text": "get classList() { return this.panelClass; }", "title": "" }, { "docid": "51bee516896d06ae80051d3f0fb41390", "score": "0.5145742", "text": "get classList() { return this.panelClass; }", "title": "" }, { "docid": "d0701f73be0c2da0b30ddad1c01b22f5", "score": "0.51442355", "text": "function subclass() {}", "title": "" }, { "docid": "563560fef8b1900bf0dcf4d9e5a1b44c", "score": "0.5137348", "text": "function foo(...args) {\n class C {}\n C(...args);\n}", "title": "" }, { "docid": "60d43b91266908992354937694e5aa99", "score": "0.51358205", "text": "function Class() {\n if (!initializing && this.initialize) {\n this.initialize.apply(this, arguments);\n }\n //return this;\n }", "title": "" }, { "docid": "a2026201884e9e32d7e7092272a68d87", "score": "0.5135007", "text": "static hack(klass) {\n if (!this.hacks) {\n this.hacks = {}\n }\n return klass.names.map(name => {\n this.hacks[name] = klass\n return this.hacks[name]\n })\n }", "title": "" }, { "docid": "71ebd1d5d92edae00ba5fe3caa7a9743", "score": "0.5132787", "text": "function Class() {\n if (!initializing && this.init) {\n this.init.apply(this, arguments);\n }\n //return this;\n }", "title": "" }, { "docid": "76933db971644ceaf2f3ccf119133c7a", "score": "0.5129969", "text": "visitClassDeclaration(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "cc3fb1b0388928aba45f6b057533c84f", "score": "0.51287216", "text": "visitClassModifier(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "8117368a25628346f1bd4c3cef13b155", "score": "0.5125281", "text": "function patchClass(className) {\n\t var OriginalClass = global[className];\n\t if (!OriginalClass) return;\n\t\n\t global[className] = function (fn) {\n\t this[originalInstanceKey] = new OriginalClass(global.zone.bind(fn, true));\n\t // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks\n\t this[creationZoneKey] = global.zone;\n\t };\n\t\n\t var instance = new OriginalClass(function () {});\n\t\n\t global[className].prototype.disconnect = function () {\n\t var result = this[originalInstanceKey].disconnect.apply(this[originalInstanceKey], arguments);\n\t if (this[isActiveKey]) {\n\t this[creationZoneKey].dequeueTask();\n\t this[isActiveKey] = false;\n\t }\n\t return result;\n\t };\n\t\n\t global[className].prototype.observe = function () {\n\t if (!this[isActiveKey]) {\n\t this[creationZoneKey].enqueueTask();\n\t this[isActiveKey] = true;\n\t }\n\t return this[originalInstanceKey].observe.apply(this[originalInstanceKey], arguments);\n\t };\n\t\n\t var prop;\n\t for (prop in instance) {\n\t (function (prop) {\n\t if (typeof global[className].prototype !== 'undefined') {\n\t return;\n\t }\n\t if (typeof instance[prop] === 'function') {\n\t global[className].prototype[prop] = function () {\n\t return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n\t };\n\t } else {\n\t Object.defineProperty(global[className].prototype, prop, {\n\t set: function (fn) {\n\t if (typeof fn === 'function') {\n\t this[originalInstanceKey][prop] = global.zone.bind(fn);\n\t } else {\n\t this[originalInstanceKey][prop] = fn;\n\t }\n\t },\n\t get: function () {\n\t return this[originalInstanceKey][prop];\n\t }\n\t });\n\t }\n\t }(prop));\n\t }\n\t}", "title": "" } ]
29b4a9e2397bc0180b7f296d4e005805
Executes a GET request, following redirects
[ { "docid": "cb42763505f6c71b01595689aa929ca3", "score": "0.0", "text": "function get(input, options, callback) {\n var wrappedRequest = wrappedProtocol.request(input, options, callback);\n wrappedRequest.end();\n return wrappedRequest;\n }", "title": "" } ]
[ { "docid": "9f80cbb1fa334543a3e7968cca49d3a8", "score": "0.63655025", "text": "get (url, headers) {\n this.request('get', url, null, null, headers)\n }", "title": "" }, { "docid": "891def02ad7789a0b58aa45eef724802", "score": "0.6314538", "text": "doGet(serviceName, fullUrl, queryParams, headers) {\n const targetUrl = this.getTargetUrl(serviceName, fullUrl, queryParams);\n console.log('FORWARD GET', targetUrl);\n return axios.get(targetUrl, { headers: headers });\n }", "title": "" }, { "docid": "f05b921bfbeb9e106f9d34e1cdce8945", "score": "0.6194985", "text": "function get(url, request) {\n return send(__assign({}, request, { method: 'GET', url: url }));\n}", "title": "" }, { "docid": "335bbb2cce6e03f603eada147005ae06", "score": "0.6164266", "text": "function sendGET(callback) {\n $.get(servletPath, callback);\n}", "title": "" }, { "docid": "fb72264120a92e1d266d58a355f325f4", "score": "0.6161544", "text": "get(req, res) {}", "title": "" }, { "docid": "8d7ea4f7af0bd4833e463dfb1f8a17a3", "score": "0.615645", "text": "function processGET(request, response){\n var path = url.parse(request.url).pathname,\n query = url.parse(request.url, true).query;\n\n switch(path){\n\n // Echo what was sent\n case '/echo':\n response.writeHead(200, {\n 'Content-Type': 'text/plain'\n });\n response.write(JSON.stringify(query));\n response.end();\n break;\n\n // Cash balance JSON\n case '/browse/cashBalanceAj.action':\n outputFileAndEnd('cashBalanceAj.json', response);\n break;\n // Porfolio list\n case '/data/portfolioManagement':\n if(query['method'] && query['method'] == 'getLCPortfolios'){\n outputFileAndEnd('portfolioManagement_getLCPortfolios.json', response);\n } else {\n response.write('Unknown method: '+ query['method']);\n response.end();\n }\n break;\n // Start order\n case '/portfolio/recommendPortfolio.action':\n // Empty response\n response.write(\"\");\n response.end();\n break;\n // Place order and strut token\n case '/portfolio/placeOrder.action':\n outputFileAndEnd('placeOrder.html', response);\n break;\n default:\n response.write(\"Unknown GET: \"+ path);\n response.end();\n }\n}", "title": "" }, { "docid": "0e010b1ddeedf2e7d882d0d99e3cd6ea", "score": "0.61395276", "text": "function get (parsed, opts, fn) {\n debug('GET %o', parsed.href);\n\n var cache = getCache(parsed, opts.cache);\n\n // 5 redirects allowed by default\n var maxRedirects = opts.hasOwnProperty('maxRedirects') ? opts.maxRedirects : 5;\n debug('allowing %o max redirects', maxRedirects);\n\n // first check the previous Expires and/or Cache-Control headers\n // of a previous response if a `cache` was provided\n if (cache && isFresh(cache)) {\n\n // check for a 3xx \"redirect\" status code on the previous cache\n var location = cache.headers.location;\n var type = (cache.statusCode / 100 | 0);\n if (3 == type && location) {\n debug('cached redirect');\n fn(new Error('TODO: implement cached redirects!'));\n } else {\n // otherwise we assume that it's the destination endpoint,\n // since there's nowhere else to redirect to\n fn(new NotModifiedError());\n }\n return;\n }\n\n var mod;\n if (opts.http) {\n // the `https` module passed in from the \"http.js\" file\n mod = opts.http;\n debug('using secure `https` core module');\n } else {\n mod = http;\n debug('using `http` core module');\n }\n\n var options = extend({}, opts, parsed);\n\n // add \"cache validation\" headers if a `cache` was provided\n if (cache) {\n if (!options.headers) options.headers = {};\n\n var lastModified = cache.headers['last-modified'];\n if (lastModified != null) {\n options.headers['If-Modified-Since'] = lastModified;\n debug('added \"If-Modified-Since\" request header: %o', lastModified);\n }\n\n var etag = cache.headers.etag;\n if (etag != null) {\n options.headers['If-None-Match'] = etag;\n debug('added \"If-None-Match\" request header: %o', etag);\n }\n }\n\n var req = mod.get(options);\n req.once('error', onerror);\n req.once('response', onresponse);\n\n // http.ClientRequest \"error\" event handler\n function onerror (err) {\n debug('http.ClientRequest \"error\" event: %o', err.stack || err);\n fn(err);\n }\n\n // http.ClientRequest \"response\" event handler\n function onresponse (res) {\n var code = res.statusCode;\n\n // assign a Date to this response for the \"Cache-Control\" delta calculation\n res.date = new Date();\n res.parsed = parsed;\n\n debug('got %o response status code', code);\n\n // any 2xx response is a \"success\" code\n var type = (code / 100 | 0);\n\n // check for a 3xx \"redirect\" status code\n var location = res.headers.location;\n if (3 == type && location) {\n if (!opts.redirects) opts.redirects = [];\n var redirects = opts.redirects;\n\n if (redirects.length < maxRedirects) {\n debug('got a \"redirect\" status code with Location: %o', location);\n\n // flush this response - we're not going to use it\n res.resume();\n\n // hang on to this Response object for the \"redirects\" Array\n redirects.push(res);\n\n var newUri = url.resolve(parsed, location);\n debug('resolved redirect URL: %o', newUri);\n\n var left = maxRedirects - redirects.length;\n debug('%o more redirects allowed after this one', left);\n\n return get(url.parse(newUri), opts, fn);\n }\n }\n\n // if we didn't get a 2xx \"success\" status code, then create an Error object\n if (2 != type) {\n var err;\n if (304 == code) {\n err = new NotModifiedError();\n } else if (404 == code) {\n err = new NotFoundError();\n } else {\n // other HTTP-level error\n var message = http.STATUS_CODES[code];\n err = new Error(message);\n err.statusCode = code;\n err.code = code;\n }\n\n res.resume();\n return fn(err);\n }\n\n if (opts.redirects) {\n // store a reference to the \"redirects\" Array on the Response object so that\n // they can be inspected during a subsequent call to GET the same URI\n res.redirects = opts.redirects;\n }\n\n fn(null, res);\n }\n}", "title": "" }, { "docid": "4b0404dd24ddee5d13f13657e2cb33f4", "score": "0.6122504", "text": "get (url, req = {}) {\n return this.send(Object.assign({}, req, { method: 'GET', url }));\n }", "title": "" }, { "docid": "00ce36eee3c2d7627c3476e882b1adff", "score": "0.61079335", "text": "function doGet(url,\n access_token,\n successFunction,\n failureFunction) {\n doRequest(\"GET\",\n url,\n access_token,\n null,\n successFunction,\n failureFunction);\n}", "title": "" }, { "docid": "777fd137b95dc6a41eadbea274049a59", "score": "0.60965014", "text": "function get(parsed, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n debug('GET %o', parsed.href);\n const cache = getCache(parsed, opts.cache);\n // first check the previous Expires and/or Cache-Control headers\n // of a previous response if a `cache` was provided\n if (cache && isFresh(cache) && typeof cache.statusCode === 'number') {\n // check for a 3xx \"redirect\" status code on the previous cache\n const type = (cache.statusCode / 100) | 0;\n if (type === 3 && cache.headers.location) {\n debug('cached redirect');\n throw new Error('TODO: implement cached redirects!');\n }\n // otherwise we assume that it's the destination endpoint,\n // since there's nowhere else to redirect to\n throw new notmodified_1.default();\n }\n // 5 redirects allowed by default\n const maxRedirects = typeof opts.maxRedirects === 'number' ? opts.maxRedirects : 5;\n debug('allowing %o max redirects', maxRedirects);\n let mod;\n if (opts.http) {\n // the `https` module passed in from the \"http.js\" file\n mod = opts.http;\n debug('using secure `https` core module');\n }\n else {\n mod = http_1.default;\n debug('using `http` core module');\n }\n const options = Object.assign(Object.assign({}, opts), parsed);\n // add \"cache validation\" headers if a `cache` was provided\n if (cache) {\n if (!options.headers) {\n options.headers = {};\n }\n const lastModified = cache.headers['last-modified'];\n if (lastModified) {\n options.headers['If-Modified-Since'] = lastModified;\n debug('added \"If-Modified-Since\" request header: %o', lastModified);\n }\n const etag = cache.headers.etag;\n if (etag) {\n options.headers['If-None-Match'] = etag;\n debug('added \"If-None-Match\" request header: %o', etag);\n }\n }\n const req = mod.get(options);\n const res = yield once_1.default(req, 'response');\n const code = res.statusCode || 0;\n // assign a Date to this response for the \"Cache-Control\" delta calculation\n res.date = Date.now();\n res.parsed = parsed;\n debug('got %o response status code', code);\n // any 2xx response is a \"success\" code\n let type = (code / 100) | 0;\n // check for a 3xx \"redirect\" status code\n let location = res.headers.location;\n if (type === 3 && location) {\n if (!opts.redirects)\n opts.redirects = [];\n let redirects = opts.redirects;\n if (redirects.length < maxRedirects) {\n debug('got a \"redirect\" status code with Location: %o', location);\n // flush this response - we're not going to use it\n res.resume();\n // hang on to this Response object for the \"redirects\" Array\n redirects.push(res);\n let newUri = url_1.resolve(parsed.href, location);\n debug('resolved redirect URL: %o', newUri);\n let left = maxRedirects - redirects.length;\n debug('%o more redirects allowed after this one', left);\n // check if redirecting to a different protocol\n let parsedUrl = url_1.parse(newUri);\n if (parsedUrl.protocol !== parsed.protocol) {\n opts.http = parsedUrl.protocol === 'https:' ? https_1.default : undefined;\n }\n return get(parsedUrl, opts);\n }\n }\n // if we didn't get a 2xx \"success\" status code, then create an Error object\n if (type !== 2) {\n res.resume();\n if (code === 304) {\n throw new notmodified_1.default();\n }\n else if (code === 404) {\n throw new notfound_1.default();\n }\n // other HTTP-level error\n throw new http_error_1.default(code);\n }\n if (opts.redirects) {\n // store a reference to the \"redirects\" Array on the Response object so that\n // they can be inspected during a subsequent call to GET the same URI\n res.redirects = opts.redirects;\n }\n return res;\n });\n}", "title": "" }, { "docid": "777fd137b95dc6a41eadbea274049a59", "score": "0.60965014", "text": "function get(parsed, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n debug('GET %o', parsed.href);\n const cache = getCache(parsed, opts.cache);\n // first check the previous Expires and/or Cache-Control headers\n // of a previous response if a `cache` was provided\n if (cache && isFresh(cache) && typeof cache.statusCode === 'number') {\n // check for a 3xx \"redirect\" status code on the previous cache\n const type = (cache.statusCode / 100) | 0;\n if (type === 3 && cache.headers.location) {\n debug('cached redirect');\n throw new Error('TODO: implement cached redirects!');\n }\n // otherwise we assume that it's the destination endpoint,\n // since there's nowhere else to redirect to\n throw new notmodified_1.default();\n }\n // 5 redirects allowed by default\n const maxRedirects = typeof opts.maxRedirects === 'number' ? opts.maxRedirects : 5;\n debug('allowing %o max redirects', maxRedirects);\n let mod;\n if (opts.http) {\n // the `https` module passed in from the \"http.js\" file\n mod = opts.http;\n debug('using secure `https` core module');\n }\n else {\n mod = http_1.default;\n debug('using `http` core module');\n }\n const options = Object.assign(Object.assign({}, opts), parsed);\n // add \"cache validation\" headers if a `cache` was provided\n if (cache) {\n if (!options.headers) {\n options.headers = {};\n }\n const lastModified = cache.headers['last-modified'];\n if (lastModified) {\n options.headers['If-Modified-Since'] = lastModified;\n debug('added \"If-Modified-Since\" request header: %o', lastModified);\n }\n const etag = cache.headers.etag;\n if (etag) {\n options.headers['If-None-Match'] = etag;\n debug('added \"If-None-Match\" request header: %o', etag);\n }\n }\n const req = mod.get(options);\n const res = yield once_1.default(req, 'response');\n const code = res.statusCode || 0;\n // assign a Date to this response for the \"Cache-Control\" delta calculation\n res.date = Date.now();\n res.parsed = parsed;\n debug('got %o response status code', code);\n // any 2xx response is a \"success\" code\n let type = (code / 100) | 0;\n // check for a 3xx \"redirect\" status code\n let location = res.headers.location;\n if (type === 3 && location) {\n if (!opts.redirects)\n opts.redirects = [];\n let redirects = opts.redirects;\n if (redirects.length < maxRedirects) {\n debug('got a \"redirect\" status code with Location: %o', location);\n // flush this response - we're not going to use it\n res.resume();\n // hang on to this Response object for the \"redirects\" Array\n redirects.push(res);\n let newUri = url_1.resolve(parsed.href, location);\n debug('resolved redirect URL: %o', newUri);\n let left = maxRedirects - redirects.length;\n debug('%o more redirects allowed after this one', left);\n // check if redirecting to a different protocol\n let parsedUrl = url_1.parse(newUri);\n if (parsedUrl.protocol !== parsed.protocol) {\n opts.http = parsedUrl.protocol === 'https:' ? https_1.default : undefined;\n }\n return get(parsedUrl, opts);\n }\n }\n // if we didn't get a 2xx \"success\" status code, then create an Error object\n if (type !== 2) {\n res.resume();\n if (code === 304) {\n throw new notmodified_1.default();\n }\n else if (code === 404) {\n throw new notfound_1.default();\n }\n // other HTTP-level error\n throw new http_error_1.default(code);\n }\n if (opts.redirects) {\n // store a reference to the \"redirects\" Array on the Response object so that\n // they can be inspected during a subsequent call to GET the same URI\n res.redirects = opts.redirects;\n }\n return res;\n });\n}", "title": "" }, { "docid": "9228413f2977a110ea8371a9218dad9f", "score": "0.6067565", "text": "get(uri) {\n\n }", "title": "" }, { "docid": "03803469689f7a70b1864d35b82b546e", "score": "0.59437865", "text": "function doGet(request) {\n\tvar link = request.parameter.link;\n\tif(!link)\n\t\treturn;\n\tif(link.startsWith('/'))\n\t\tlink = link.substring(1);\n\n\tvar redirect = lookup('Links', link);\n\tif(!redirect)\n\t\t// Attempt to fall back to the \"default\" entry whose key is a single space.\n\t\tredirect = lookup('Links', ' ');\n\tif(!redirect)\n\t\treturn;\n\n\tif(request.parameter.plaintext)\n\t\treturn ContentService.createTextOutput(redirect);\n\telse\n\t\treturn HtmlService.createHtmlOutput('<script>window.top.location = \\'' + redirect + '\\'</script>');\n}", "title": "" }, { "docid": "071530b20a95649b35245acbf34b0afa", "score": "0.59352034", "text": "function doGET() {\n const api = 'api/resource';\n const filename = 'hello.txt';\n const compressed = false;\n \n // Send a HTTP GET request with required params and headers\n request.get({\n uri: `http://localhost:3600/${api}?filename=${filename}&compressed=${compressed}`,\n headers: {\n 'auth_email': '[email protected]',\n 'auth_client_id': 'id_x',\n 'auth_token': 'bigWombat'\n }\n }, function (err, res) {\n if (err) console.log(res.body);\n else console.log(res.body);\n });\n}", "title": "" }, { "docid": "e69ed29eeff54a06a0a76eb1edd69ff2", "score": "0.5923697", "text": "function get(addr){\n //log('abc');\n http.get(addr, (res) => {\n //print start line\n log(`HTTP/${res.httpVersion} ${res.statusCode} ${res.statusMessage}`);\n //print response header\n log(res.headers);\n log('');\n //print response body\n \n \n if(res.statusCode < 400 && res.statusCode >= 300) {\n get(res.headers.location);\n } else {\n res.pipe(process.stdout);\n } \n });\n\n\n}", "title": "" }, { "docid": "41bba3c2be475a7b1466080f1faf46e2", "score": "0.58939767", "text": "function get(request, response) {\n\trespond(request, response, \"GET\");\n}", "title": "" }, { "docid": "0c4310b3f3cf3b3efee41f0a0ded91fb", "score": "0.5890905", "text": "async get (url) {\n return this._requestor.get({ url: url }).catch(async err => {\n await this._reauthenticate(err)\n return this._requestor.get({ url: url })\n })\n }", "title": "" }, { "docid": "ea4d392c7bb2c62304ee1e1ce3b5e882", "score": "0.58741087", "text": "function getLink(url) {\n\trequest({url: url, followRedirect : false}, function (error, response, body) {\n\t\t\n\t\tif (!error && response.statusCode == 302) {\t\t\n\t\t\t//console.log('Get url : ' + response.headers['location']);\n checkCountry(url,response.headers['location']);\n\t\t\t//login(url,response.headers['location']);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "00218b68a19164e24c4d501d9a9cdded", "score": "0.58419335", "text": "function httpGet(queryString, callback)\n{\n var theUrl = urls.SERVER + queryString; \n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "title": "" }, { "docid": "4b3646609b7995cfca08106a029f389c", "score": "0.58413106", "text": "function get(url) {\n return request\n .get(url)\n .timeout(TIMEOUT);\n //.query({authtoken: token()});\n}", "title": "" }, { "docid": "d35b39eb991ae02b6043f569aef85989", "score": "0.58284605", "text": "function pendingReportCheck (url)\n{\n $.get(url, {},\n function(responseJSON){ \n if (responseJSON.status == 'ready') {\n top.location = responseJSON.url_redirect;\n }\n },\"json\"\n );\n}", "title": "" }, { "docid": "5852b0d567978c7e8e41fa8d65014bc9", "score": "0.5804143", "text": "get(page, data) {\n return request(\"get\", `${url}${page}`, data);\n }", "title": "" }, { "docid": "4235d611c34ce4edbb71dcf66703fbf0", "score": "0.5800596", "text": "function getRequest(index) {\r\n // GET request\r\n http.get(urls[index + 2], res => {\r\n let output = \"\"; // to store the data chunks\r\n\r\n res.setEncoding(\"utf8\"); // set encoding to utf8 to emit String objects\r\n\r\n // on data capture the data events in output\r\n res.on(\"data\", (data) => {\r\n output += data; // each chunk of data in added to the output\r\n }); // end res.on\r\n\r\n // on end handle the data\r\n res.on(\"end\", () => {\r\n results[index] = output; // store the data of the get request in the designated array index\r\n count--; // reduce number of urls to handle by one\r\n\r\n // when the urls are all handled\r\n if (count <= 0) {\r\n // go through all the results\r\n for (var k = 0; k < results.length; k++) {\r\n console.log(results[k]); // and print them\r\n } // end for\r\n } // end if\r\n }); // end res.on\r\n\r\n // on error STDOUT error events\r\n res.on(\"error\", err => {\r\n console.log(err);\r\n }); // end res.on\r\n }); // end http.get\r\n} // end getRequest", "title": "" }, { "docid": "1879861b689a0fdc10381c94d95f0bbf", "score": "0.5784643", "text": "function GET(request, response) {\n let path = request.url.toString();\n if (path.includes('?') === true) {\n path = path.substring(0, path.indexOf('?'));\n }\n switch (path) {\n case \"/contact/messages\": {\n getContactMessages(request, response);\n return;\n }\n case \"/dataset/eurostat\":\n case \"/dataset/who\": {\n getDataset(request, response);\n return;\n }\n case \"/dataset/eurostat/filters\":\n case \"/dataset/who/filters\": {\n getFilters(request, response);\n return;\n }\n case \"/users/requests\" : {\n getRequestedUsers(request, response);\n return;\n }\n default: {\n //create file path\n let filePath = '.' + request.url;\n if (filePath === './')\n filePath = './OPreV.html';\n\n //check if the file exists\n try {\n if (fs.existsSync(filePath)) {\n const extname = String(PATH.extname(filePath)).toLowerCase();\n const contentType = mimeTypes[extname] || 'application/octet-stream';// octet-stream is the default value if no mimeTypes is found\n if (filePath === \"./admin.html\") {\n let sessionID = getCookieValueFromCookies(request, \"sessionID\");\n if (sessionID != null && sessionID.length > 0)\n isUserLoggedIn(sessionID).then(r => {\n if (r === true)\n fs.readFile(filePath, function (error, content) {\n if (error) {\n console.log(\"ERROR reading the file: \" + filePath);\n setFailedRequestResponse(request, response, content, 404);\n } else {\n response.writeHead(200, {'Content-Type': contentType});\n response.end(content, 'utf-8');\n }\n });\n else\n setFailedRequestResponse(request, response, \"You are not logged in. You cannot access admin page.\", 403);\n });\n } else {\n fs.readFile(filePath, function (error, content) {\n if (error) {\n console.log(\"ERROR reading the file: \" + filePath);\n setFailedRequestResponse(request, response, content, 404);\n } else {\n response.writeHead(200, {'Content-Type': contentType});\n response.end(content, 'utf-8');\n }\n });\n }\n } else { //if the file doesn't exist then it's a bad REQUEST\n setFailedRequestResponse(request, response, \"BAD GET REQUEST\", 400);\n }\n } catch (err) {\n console.error(err)\n setFailedRequestResponse(request, response, \"Failed to read file\", 404);\n }\n }\n }\n}", "title": "" }, { "docid": "7c22bb1b810c5b9db6dc8bb969dbd796", "score": "0.5772742", "text": "function makeRequest() {\n\thttpDo(url, 'GET', readResponse);\n}", "title": "" }, { "docid": "e555a53705669d177fc7f85c45206800", "score": "0.5769838", "text": "function doget(url, data, cb, completecb) {\n wx.request({\n url: url,\n data: data,\n success(res) {\n typeof cb == \"function\" && cb(res)\n },\n complete() {\n typeof completecb == \"function\" && completecb()\n }\n })\n }", "title": "" }, { "docid": "4ea62913b2f126da7472f96ee058d448", "score": "0.5729305", "text": "function get(url, data = {}) {\r\n\treturn request (url, data, { method: 'GET' });\r\n}", "title": "" }, { "docid": "2598abb3fc9656cb3731dda6bd596fa3", "score": "0.57208055", "text": "function httpGet(theUrl)\n {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, true ); // false for synchronous request\n xmlHttp.send(null);\n //return xmlHttp.responseText;\n }", "title": "" }, { "docid": "a33ffb27f4814265cdd3924daa878edc", "score": "0.57064646", "text": "function sendGET(url)\n{\n var http = new ActiveXObject(\"MSXML2.ServerXMLHTTP.6.0\");\n http.open(\"GET\", url, true, \"admin\", \"admin\");\n http.send();\n}", "title": "" }, { "docid": "cf1e4cbf460b0670f4ea4625137ea52e", "score": "0.5699717", "text": "executeGetRequestToREST(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n\n // use xhr.onload and xhr.onerror if any troubles\n\n xhr.send();\n\n if (xhr.status != 200) {\n alert(xhr.status + ': ' + xhr.statusText);\n } else {\n console.log(\"JSON from url \" + url + \": \" + xhr.responseText);\n return xhr.responseText;\n\n }\n }", "title": "" }, { "docid": "75d00ad6af39cf310aa5675af5a083ed", "score": "0.56971407", "text": "function doGet(e){\n return handleResponse(e);\n}", "title": "" }, { "docid": "75d00ad6af39cf310aa5675af5a083ed", "score": "0.56971407", "text": "function doGet(e){\n return handleResponse(e);\n}", "title": "" }, { "docid": "faf25be43e2f06bce966093caa890681", "score": "0.5694305", "text": "function mainGet(req, res) {\n res.end();\n}", "title": "" }, { "docid": "1e4fc7fcf6d483fea2813db08be44eae", "score": "0.5693284", "text": "execute(url) {\n return this.http.get(url);\n }", "title": "" }, { "docid": "a88bc3724bc22b75f9611b57b30075ab", "score": "0.56818545", "text": "function doGet(e){\nreturn handleResponse(e);\n}", "title": "" }, { "docid": "d75fc7db242b4a44d043496f49ed2961", "score": "0.56811035", "text": "function _GET(url, successCB, failCB){\n $.ajax({\n type:\"GET\",\n url: url,\n success:function(resp){\n successCB(resp)\n },\n error: function(jqXHR, textStatus, error){\n failCB(jqXHR, textStatus, error);\n }\n });\n }", "title": "" }, { "docid": "a22e574687af95bf3fdab36ab9351087", "score": "0.5666689", "text": "function httpGet(path) {\n return fetch(path, getOptions('GET'))\n}", "title": "" }, { "docid": "e5084480742a9fe8a698a1c8d488382c", "score": "0.5662998", "text": "function simpleGet(uri, callback, passObj)\n{\n var xmlHttp=new XMLHttpRequest();\n function stateChanged()\n {\n\t if (xmlHttp.readyState == 4)\n\t {\n if (xmlHttp.status == 200)\n\t callback(xmlHttp.responseText, xmlHttp, passObj);\n else\n callback(null, xmlHttp, passObj)\n //alert('Unhandled AJAX ERROR uri=' + uri + \"\\nresponseCode=\" + xmlHttp.status + \" = \" + xmlHttp.statusText);\n }\n }\n xmlHttp.onreadystatechange = stateChanged \n xmlHttp.open(\"GET\", uri, true);\n if (passObj.req_headers) {\n for (headKey in passObj.req_headers) {\n xmlHttp.setRequestHeader(headKey, passObj.req_headers[headKey]);\n }\n }\n xmlHttp.send();\n}", "title": "" }, { "docid": "2ca49e6e63a05ef7b158e3f7f26c02aa", "score": "0.5662716", "text": "get(action, params) {\n return this.request(\"GET\", action, params)\n }", "title": "" }, { "docid": "f2146d993ff826cf8ab089f1e7e9712e", "score": "0.5624158", "text": "function request(type, path, headers, data, scb, fcb) {\n\n if (NProgress) NProgress.start();\n\n $.ajax({\n url: BACKEND_HOST + path,\n async: true,\n success: function (data) {\n if (NProgress) NProgress.done();\n if (scb) scb(data);\n },\n type: type,\n headers: headers,\n data: type.toLowerCase() === 'get' ? data : JSON.stringify(data),\n error: function (xhr, msg, error) {\n if (NProgress) NProgress.done();\n if (xhr.status === 401 || error === 'Unauthorized') { //when return 401 , goto login page\n removeCache(AUTHOBJ_KEY);\n removeCache('technologyUser');\n removeCache('technologyProvider');\n window.location.replace('/login.html?next=' + encodeURIComponent(window.location.href));\n }\n if (xhr.status >= 200 && xhr.status <= 204) {\n scb({});\n } else {\n if (fcb) {\n fcb(xhr, msg, error);\n }\n }\n },\n dataType: 'json',\n });\n }", "title": "" }, { "docid": "d74a3c4c063a531423ab0b0311ad61d2", "score": "0.56183964", "text": "function GET(url, fn, opts) {\n var req = new XMLHttpRequest();\n\n req.onreadystatechange = function () {\n if (req.readyState === 4 && (req.status === 200 || !req.status && req.responseText.length)) {\n fn(req.responseText, opts, url);\n }\n };\n req.open('GET', url, true);\n req.send('');\n }", "title": "" }, { "docid": "e32da33f15d8fd61704931f306734616", "score": "0.5603849", "text": "function GET() {\r\n http.response.setStatus(http.HttpStatus.HTTP_NOT_IMPLEMENTED);\r\n http.response.send();\r\n}", "title": "" }, { "docid": "11444a61aea80f6e5aced48ac4f99df8", "score": "0.55946726", "text": "function httpGet (index) {\n // checks the command line input and makes a call back based on response\n http.get(process.argv[2 + index], function (response) {\n // starts piping the data to the the results ,\n response.pipe(bl(function (err, data) {\n if (err) {\n return console.error(err)\n }\n // data is converted to a string which is placed in the results array\n results[index] = data.toString()\n // after every interation the count is incremented\n count++\n // after the countis done the printResultsmethod is called to print the results of the loop\n if (count === 3) {\n printResults()\n }\n }))\n })\n}", "title": "" }, { "docid": "0bb1a0ffd66cd681037c52d2388ac99a", "score": "0.558527", "text": "function handleGetRequest (req, res) {\n // Parse the query.\n console.log(req.url);\n parsedURL = url.parse(req.url, true);\n var q = parsedURL.query;\n console.log (q);\n var path = parsedURL.pathname;\n console.log (path);\n\n // Check if this is using the hello \"command\"\n if (path == \"/hello\") {\n handleHello (parsedURL.query.lang, res);\n }\n\n // Otherwise serve the requested file\n else {\n serveFile (path, res);\n }\n}", "title": "" }, { "docid": "79e992d1d6bf04bac094b19f85e0a709", "score": "0.5583048", "text": "function preprocessGetRequests()\n {\n // if we don't need to do anything, never mind\n if ((oData === null) || (oOptions.sMethod !== 'GET' && oOptions.sMethod !== 'HEAD'))\n {\n return;\n }\n\n // otherwise, append things\n sUri += ( sUri.indexOf( '?' ) === -1 ? '?' : '&' ) + oData;\n oData = null;\n }", "title": "" }, { "docid": "f032b66ccf857fa266c3287b201f6de3", "score": "0.55680597", "text": "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "title": "" }, { "docid": "f032b66ccf857fa266c3287b201f6de3", "score": "0.55680597", "text": "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "title": "" }, { "docid": "f032b66ccf857fa266c3287b201f6de3", "score": "0.55680597", "text": "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "title": "" }, { "docid": "6176deba637eeb3ec81543b4acf57a45", "score": "0.55658656", "text": "function testGET() {\n httpMethod(false, \"GET\", false)\n}", "title": "" }, { "docid": "cb4698b4e011d126fd686d7e63f00c3b", "score": "0.5564862", "text": "async get() {\n\t\ttry {\n\t\t\tconst data = await got(`${this.url}`);\n\t\t\treturn this.response(data.body)\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Unable to locate external endpoint'\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "cc954bcee197dfac31d880d6d61c7107", "score": "0.554508", "text": "function get(i) {\n http.get(process.argv[2 + i], function callback (response) {\n response.setEncoding('utf8')\n response.pipe(bl(function (err,data) {\n if (err) console.error(err)\n out[i] = data.toString()\n done++\n if (done === n_urls) {\n for (var j = 0; j < n_urls; j++)\n console.log(out[j])\n }\n }))\n response.on('error', console.error)\n })\n}", "title": "" }, { "docid": "dbd0604752a2803073a0be28a8d0d504", "score": "0.55337065", "text": "function DoRequest(){\n\t\t// If the user provides an URL then the HomeService will use that URL instead\n\t\t// The HomeService defaults to the omdb API URL using a default query\n\t\tif(vm.url != null){\n\t\t\tHomeService.url = vm.url;\n\t\t}\n\t\tHomeService.request().then(function(data){\n\t\t\tvm.response = data;\n\t\t});\n\t}", "title": "" }, { "docid": "1287e0d6c54b8d863969c8f7272440de", "score": "0.55224323", "text": "function getHttp (url) {\n return new Promise( function(resolve, reject) {\n http.get(url, function (res) {\n switch(res.statusCode) {\n case 200:\n resolve(res);\n break;\n case 302: // redirect\n resolve(httpGet(res.headers.location));\n break;\n default:\n reject(new Error(\"Unexpected status-code:\" + res.statusCode));\n }\n })\n });\n}", "title": "" }, { "docid": "64629c4e424d0af6db381c2681459770", "score": "0.55170614", "text": "function httpGet(theUrl)\r\n{\r\n var xmlHttp = null;\r\n \r\n xmlHttp = new XMLHttpRequest();\r\n xmlHttp.open( \"GET\", theUrl, false );\r\n xmlHttp.send( null );\r\n return xmlHttp.responseText;\r\n}", "title": "" }, { "docid": "4e923250c1ce2cd614512b3fd9dc2750", "score": "0.5512853", "text": "function GET(options) {\r\n queue.push(function(done) {\r\n\r\n request.get({\r\n headers: {\r\n 'x-riot-token': key\r\n },\r\n url: options.url,\r\n }, function(err, response, body) {\r\n responseHandler(err, response, body, options);\r\n done();\r\n });\r\n\r\n });\r\n\r\n // This will start the queue if it isn't already started.\r\n queue.start();\r\n}", "title": "" }, { "docid": "8dece08d736dd6023e0809259602d728", "score": "0.5505631", "text": "function _doQuery(url, callback) {\n\t\trequest(url, callback);\n}", "title": "" }, { "docid": "c71e1f3a6bccc552d8339004009137a2", "score": "0.5494227", "text": "function httpGet(theUrl)\n{\n var XMLHttpRequest = require(\"xmlhttprequest\").XMLHttpRequest;\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "b493ea491153285781764014f8752368", "score": "0.548962", "text": "function httpGet(theUrl)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false );\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "7b5c071ef3123e0a3a0980bfe387a1d0", "score": "0.5487336", "text": "GET(request, response) {\n this.handle(request, response,\n path => Fs.readFile(path));\n }", "title": "" }, { "docid": "707c1070f0b0f840dfea1966031b994d", "score": "0.5485027", "text": "function http_by_code(){\r\n var xhttp=new XMLHttpRequest();\r\n xhttp.onreadystatechange= function(){\r\n if(this.readyState==4 && this.status==200)\r\n { \r\n get(this);\r\n sessionStorage.removeItem(\"byCode\");\r\n }\r\n else if(this.readyState==4 && (this.status==404 || this.status==400))\r\n {\r\n error();\r\n }\r\n };\r\n xhttp.open(\"GET\",\"https://restcountries.eu/rest/v2/alpha?codes=\"+sessionStorage.getItem(\"byCode\"),true);\r\n xhttp.send();\r\n}", "title": "" }, { "docid": "4f5e531ed259fa7daf8682b285e61cec", "score": "0.54827756", "text": "getUrl(req, res) {\n shortcode = req.path.substring(1)\n console.log(`Fetching the url from ${baseUrl}${shortcode}`)\n Url.findOne({shortcode: shortcode}, (err, data) => {\n if (data) {\n console.log(`Entry is found in the database and redirecting to ${baseUrl}${shortcode}`)\n res.status(302).redirect(data.urlinput)\n } else {\n res.status(404).redirect('/404.html')\n }\n })\n }", "title": "" }, { "docid": "60e73fdcfad6a6b596c0cda8852f329b", "score": "0.5480794", "text": "get(path, callback) {\n if (this.req.url.toLowerCase() === path.toLowerCase() && this.req.method.toUpperCase() === 'GET') {\n callback(this.req, this.res)\n }\n }", "title": "" }, { "docid": "c6baf3b5ea2790933a7e656011d18b3c", "score": "0.5475875", "text": "function httpGet(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "e8a05f702619743d66f879a2987ac210", "score": "0.5474", "text": "function httpGet(theUrl){\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false );\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "50d0a86c090e5511be0edf55bfc5f919", "score": "0.54738957", "text": "function GET(url, params, callback, async, xml) {\r\n\tAJAX(false, url, params, callback, async, xml);\r\n}", "title": "" }, { "docid": "cb75a2f18e215f90938b5308478cf7d9", "score": "0.5473033", "text": "_request( url, res = [] ){\n\t\treturn fetch(url).then(r => {\n\t\t\treturn r.json();\n\t\t}).then(json => {\n\t\t\tres = res.concat(json.results);\n\t\t\tif ( json.next ) {\n\t\t\t\treturn this._request(json.next, res);\n\t\t\t}\n\t\t\treturn res;\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "8565f29a11bbefcd154b35b9ea7eb120", "score": "0.5467052", "text": "function get() {\n\n $.get(url).done(function (response) {\n var info = response[2].toString();\n var link = response[3];\n $(\"#search\").attr(\"href\", link);\n $(\"#info\").html(info + \"...\");\n console.log(response);\n\n });\n }", "title": "" }, { "docid": "521fe2b82c84e7d07eb72a44cc7fd5f0", "score": "0.54556954", "text": "function httpGet(url){\n var res = request( 'GET', url );\nresponse= res.getBody('utf-8')\n//console.log(response);\n return response;\n}", "title": "" }, { "docid": "fc87de2ab7a75e7fddd37b04d759a75d", "score": "0.5454171", "text": "function httpGet(theUrl) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", theUrl, false); // false for synchronous request\n xmlHttp.send(null);\n return xmlHttp.responseText;\n }", "title": "" }, { "docid": "47634ce5092ad555040007fd2883da91", "score": "0.5446993", "text": "function httpGet(theUrl) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", theUrl, false); // false for synchronous request\n xmlHttp.send();\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "400fae7df913fc78159df47e1a191b07", "score": "0.54450816", "text": "function httpGet(theUrl)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "85af5133cc71b869a754baaab7e011b5", "score": "0.54340714", "text": "function httpGet(theUrl) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "7c3dbff61bbcac090fa0e3e364e7a67b", "score": "0.5433822", "text": "function get(url, cb) {\n console.log('getting ', url);\n req = new XMLHttpRequest();\n req.open('GET', url, true);\n req.addEventListener('load', function() {\n console.log('loading req');\n if(req.status >= 200 && req.status < 400) {\n console.log(req.responseText);\n cb(req.responseText);\n }\n });\n req.send();\n}", "title": "" }, { "docid": "1c3d5a497d5219db901146994ac796e8", "score": "0.54331356", "text": "function get(options){return new _Promise(function(resolve,reject){request$1(options,function(err,response,body){if(err){reject(err);}else{resolve({body:body,response:response});}});});}// Evaluate a response to ensure it's something we should be keeping.", "title": "" }, { "docid": "78f2fd590dc42d8e708f99958993bac9", "score": "0.5431964", "text": "function http_by_call(){\r\n var xhttp=new XMLHttpRequest();\r\n xhttp.onreadystatechange= function(){\r\n if(this.readyState==4 && this.status==200)\r\n { \r\n get(this);\r\n sessionStorage.removeItem(\"byCall\");\r\n }\r\n else if(this.readyState==4 && (this.status==404 || this.status==400))\r\n {\r\n error();\r\n }\r\n };\r\n xhttp.open(\"GET\",\"https://restcountries.eu/rest/v2/callingcode/\"+sessionStorage.getItem(\"byCall\"),true);\r\n xhttp.send();\r\n}", "title": "" }, { "docid": "d1de60aaa4fb64d2a520479bbc190a03", "score": "0.54274845", "text": "async serveGetPage(req) {\n const spanName = `${self.__meta.name}:serveGetPage`;\n await self.apos.telemetry.startActiveSpan(spanName, async (span) => {\n span.setAttribute(SemanticAttributes.CODE_FUNCTION, 'serveGetPage');\n span.setAttribute(SemanticAttributes.CODE_NAMESPACE, self.__meta.name);\n\n try {\n req.slug = req.params[0];\n self.normalizeSlug(req);\n // Had to change the URL, so redirect to it. TODO: this\n // contains an assumption that we are mounted at /\n if (req.slug !== req.params[0]) {\n req.redirect = req.slug;\n }\n const builders = self.getServePageBuilders();\n const query = self.find(req);\n query.applyBuilders(builders);\n self.matchPageAndPrefixes(query, req.slug);\n await self.emit('serveQuery', query);\n req.data.bestPage = await query.toObject();\n self.evaluatePageMatch(req);\n\n span.setStatus({ code: self.apos.telemetry.api.SpanStatusCode.OK });\n } catch (err) {\n self.apos.telemetry.handleError(span, err);\n throw err;\n } finally {\n span.end();\n }\n });\n }", "title": "" }, { "docid": "d93b99c83d6e6b963055608fe76ed8b4", "score": "0.54229015", "text": "function get (parsed, opts, fn) {\n opts.http = https;\n http(parsed, opts, fn);\n}", "title": "" }, { "docid": "3d42d1c577c718e3aa84d9ffb733475b", "score": "0.54215974", "text": "function doRequest() {\n https\n .request('https://www.google.com', res => {\n res.on('data', () => {});\n res.on('end', () => {\n console.log('HTTPS:', Date.now() - start);\n });\n })\n .end();\n}", "title": "" }, { "docid": "5615cd87a9dd4960b1f6e38b1245feb5", "score": "0.54201776", "text": "function httpGet(theUrl) {\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.open(\"GET\", theUrl, false); // false for synchronous request\r\n xmlHttp.send(null);\r\n return xmlHttp.responseText;\r\n}", "title": "" }, { "docid": "58cad312c5945cf94edff26a8d967646", "score": "0.5417083", "text": "function httpGET(url, callback) {\n console.log('url: ', url)\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\n callback(xmlhttp.responseText);\n }\n }\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "8cc8b52282eb22e309ac231d83fc7faa", "score": "0.54040056", "text": "function enouthPoint() {\n var url = \"http://localhost:8080/game_logic/rest/Joueurs\";\n httpGetAsync(url, 200, function(res) {\n return res;\n }, function(status, error) {\n alert(\"status : \"+ status +\" / error : \" + error);\n var url = \"index.html\";\n //window.location = url;\n });\n}", "title": "" }, { "docid": "000646b78c7c498ddb70cc8e5008a6f8", "score": "0.54003376", "text": "function XmlHttpGET(xmlhttp, url) {\n try {\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send(null);\n } catch (e) {}\n}", "title": "" }, { "docid": "dc05b3c0d65b973c6e545ad8f5dc5745", "score": "0.5400069", "text": "function fetch (url, opts, then) {\n\n var url = fetch_query(url, opts);\n var headers = { 'User-Agent': Defaults.agent\n , 'Content-Type': Defaults['content-type']\n , 'Content-Length': 0\n , 'Accept': Defaults.accept\n , 'Cookie': opts.sessionID };\n\n var req ={ uri: url, json: true, headers: headers, method: 'GET'\n , rejectUnauthorized: false };\n return request(req, then);\n}", "title": "" }, { "docid": "1214069393f45d0c0cf826d92fb67790", "score": "0.5398886", "text": "function get(url) {\n return request\n .get(url)\n .timeout(TIMEOUT);\n}", "title": "" }, { "docid": "62d11d699ee3687c0f481321389d1a83", "score": "0.53984636", "text": "function getRequest(url) {\n let request = new XMLHttpRequest();\n request.open('GET', url, true);\n request.send()\n request.onload = function() {\n if (this.status >= 200 && this.status < 400) {\n shortestPath = JSON.parse(this.response)['route']\n markShortestPath(shortestPath)\n }\n }\n }", "title": "" }, { "docid": "6d1a059c0cf17dad306fc757f5c9aa1c", "score": "0.5397976", "text": "function doGet(urlGET, successCallback, errorCallback) {\n return $.ajax({\n type: 'GET',\n url: urlGET,\n beforeSend : function (request)\n {\n addJWT(request);\n },\n success: function(result){\n handleResult(result, successCallback, errorCallback);\n },\n error: function(){\n errorCallback('Ooops, noe uventet skjedde...');\n }\n });\n}", "title": "" }, { "docid": "db8fd4bd7cf1ae83ae9acd0421a0a03b", "score": "0.53955454", "text": "function follow(url, req, currentPath, res, next) {\n const protocol = url.startsWith('https') ? https : http;\n console.debug(`index.js: follow: https: ${protocol == https}, url: ${url}`);\n protocol.get(url, (resp) => {\n console.debug(`index.js: follow: resp.statusCode: ${resp.statusCode}`);\n if (resp.statusCode >= 300 && resp.statusCode < 400) {\n\n console.debug(`index.js: follow: redirected: resp.headers.location: ${resp.headers.location}`);\n follow(resp.headers.location, req, currentPath, res, next);\n\n let data = '';\n resp.on('data', (chunk) => {\n console.debug(`index.js: follow: redirected: Data:\n chunk.length: ${chunk.length},\n chunk: ${chunk.toString()}`);\n data += chunk;\n });\n resp.on('end', () => {\n console.debug(`index.js: follow: End:\n data: ${data}`);\n });\n } else {\n let data = [];\n resp.on('data', (chunk) => {\n // console.debug(`index.js: follow: Data: chunk length: ${chunk.length}`);\n data.push(chunk);\n }).on('end', () => {\n let buffer = Buffer.concat(data);\n console.debug(`index.js: follow: End: total chunk length: ${buffer.length}`);\n // console.log(buffer.toString('base64'));\n resSendData(req, currentPath, res, buffer);\n });\n }\n }).on(\"error\", (error) => {\n errorHandler(error, `index.js: follow`);\n\n // next();\n });\n console.log();\n}", "title": "" }, { "docid": "79c1763bdeacf297350cb64614fd05a0", "score": "0.53948295", "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: \"Only GET Operation is supported, \"\n\t\t\t}));\n\t\t} else if ($.request.method === $.net.http.GET) {\n\t\t\t//Perform Read to get entries\n\t\t\ttry {\n\t\t\t\t_getEntries();\n\t\t\t} catch (errorObj) {\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\tresult: gvErrorMessage\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "69eb161c3c1bf3e13561e075b9b2dfdf", "score": "0.5392559", "text": "async get(id, params) {}", "title": "" }, { "docid": "af06b1ff21f7945a498947e4c0eff086", "score": "0.5391861", "text": "static get (url, headers, body, options) {\n return aq.rest(url, 'GET', headers, body, options)\n }", "title": "" }, { "docid": "220b2a817d309fb14bd20440ebb50537", "score": "0.5390944", "text": "async function handleRequest(req, res) {\n const url = new URL(req.url, `http://${req.headers.host}`)\n const query = url.searchParams.get('q') || ''\n const terms = query.split(' ')\n\n // By default search Google\n let dest = `https://www.google.com/search?gbv=1&q=${encode(query)}`\n\n // BANG!\n if (terms[0][0] === '!') {\n switch (terms[0]) {\n case '!': // lucky\n dest = await feelingLucky(encode(terms.slice(1).join(' ')))\n break\n default:\n dest = `https://duckduckgo.com/?q=${encode(query)}`\n break\n }\n }\n\n res.writeHead(302, { location: dest })\n res.end()\n}", "title": "" }, { "docid": "f89d80448002e9432acd1eca653d18d9", "score": "0.5385838", "text": "function httpGet(theUrl)\n{\n var xmlHttp = null;\n\n xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false );\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "c7abd590f11b9e0dc8d2113f003ad11f", "score": "0.5371591", "text": "get( address, options ) {\n this.request( 'GET', address, options );\n }", "title": "" }, { "docid": "bf2c4e9c05eadeeabf98137ce6cfb253", "score": "0.5368704", "text": "function get(url, onsuccess) {\n\tvar request = new XMLHttpRequest();\n\trequest.onreadystatechange = function() {\n\t\tif ((request.readyState == 4) && (request.status == 200))\n\t\tonsuccess(request);\n\t}\n\trequest.open(\"GET\", url, true);\n\trequest.send();\n}", "title": "" }, { "docid": "72bb8f88d22b0a718580d5db0d368b97", "score": "0.5367948", "text": "function request(url, callback) {\n\tif (url.startsWith(\"https://\")) url = url.substr(8);\n\telse if (url.startsWith(\"http://\")) url = url.substr(7);\n\n\tvar urlbase = url.split(\"/\")[0];\n\tvar tempArray = url.split(\"/\");\n\ttempArray.reverse().pop();\n\ttempArray.reverse();\n\tvar path = \"/\" + tempArray.join(\"/\");\n\n\t//console.log(\"URL BASE: \" + urlbase);\n\t//console.log(\"Path: \" + path);\n\n\thttp.get({\n\t\thostname: urlbase,\n\t\tpath: path,\n\t\tagent: false\n\t}, (response) => {\n\t\tvar body = '';\n\t\tresponse.on('data', function(d) {\n body += d;\n //console.log(\"HTTP REQUEST GOT: \" + d)\n });\n\t\tresponse.on('end', function() {\n\t\t\tcallback(body);\n\t\t});\n\t})\n}", "title": "" }, { "docid": "5abb1377811ea45647e06675e5116d17", "score": "0.53620803", "text": "function httpGet (index) {\n http.get(process.argv[2 + index], function (response) {\n response.pipe(bl(function (err, data) {\n if (err)\n return console.error(err);\n //grabbing the results index and stringing it\n results[index] = data.toString();\n count++\n\n if (count ==xx= 3)\n printResults()\n\n }))\n })\n}", "title": "" }, { "docid": "c19968149cae106251308bda14a6b3d2", "score": "0.53597593", "text": "get(url) { // Get Request\r\n\r\n fetch(url) // bu url'ye gore bize bir JSON verisi donucek ve bunu da then ile yakalicaz\r\n .then(response => response.json()) // .text() de alabilirdik ama degisiklik yapmak icin .json() almak daha iyi.\r\n .then(data => console.log(data))\r\n .catch(err => console.error(err));\r\n\r\n }", "title": "" }, { "docid": "a7a50f14756837de3dec4d97749a51e0", "score": "0.53510064", "text": "function sendRequest(a){\n r.open(\"GET\",url+a,true);\n r.send();\n }", "title": "" }, { "docid": "773f7813eef6b99ebe7c0a871906bd7e", "score": "0.53506154", "text": "function doRequest(url,callback,data,action,headerFields) {\n var field,value,\n theData = data || null,\n requestor = getRequestor();\n requestor.open(action||\"GET\",url,!!callback); // Synchron <=> kein Callback\n if (callback) { requestor.onreadystatechange = function() {\n if (requestor.readyState ==4) {\n callback.call(requestor); // Mit requestor = this aufrufen\n }\n };\n }\n if (headerFields) {\n for (field in headerFields) {\n requestor.setRequestHeader(field,headerFields[field]);\n }\n }\n requestor.send(theData);\n return callback ? requestor : requestor.responseText;\n}", "title": "" }, { "docid": "a2a66fda97c9347ac82a686ebeaeb202", "score": "0.5345459", "text": "function loadMostRecent()\n{\n //tell the user that their request went through and send a get call to the server\n alert(\"loading most recent\");\n window.location.href = \"/records_most_recent\";\n}", "title": "" }, { "docid": "a9d29f663f01900ed13affe76bcf567c", "score": "0.53452414", "text": "function ajaxGET(url, onSuccess) {\n\t\tfetch(url, { credentials: \"include\" })\n\t\t\t.then(function(r) { \n\t\t\t\tif (r.status >= 200 && r.status < 300) {\n\t\t\t\t\treturn r.text();\n\t\t\t\t}\n\t\t\t})\n\t\t\t.then(onSuccess)\n\t\t\t.catch(function(e) { \n\t\t\t\tconsole.log(e);\n\t\t\t});\n\t}", "title": "" } ]
a23736c93dbdedfaf26d457992fbab6d
Call our weather API with the given position
[ { "docid": "55538d0727efe598d9ce25104eb70f56", "score": "0.6818572", "text": "async function getWeather(pos) {\n const lat = pos.coords.latitude\n const long = pos.coords.longitude\n try {\n const resp = await fetch(`/api/weather/${lat}/${long}`)\n if (!resp.ok) throw `Fetch /api/weather/${lat}/${long} failed with ${resp.statusText}`\n const data = await resp.json()\n\n weatherIcon.classList.add(`owi-${data.weather[0].icon}`)\n locationSpan.textContent = ` - ${data.name}`\n addWeatherDetails(`The weather currently is: &nbsp; ${data.weather[0].description}`)\n addWeatherDetails(`Current temperature: &nbsp; ${data.main.temp}°C`)\n addWeatherDetails(`Temperature feels like: &nbsp; ${data.main.feels_like}°C`)\n addWeatherDetails(`Cloud cover: &nbsp; ${data.clouds.all}%`)\n addWeatherDetails(`Volume of rain in last hour: &nbsp; ${data.rain ? data.rain['1h'] : 0}mm`)\n addWeatherDetails(`Wind speed: &nbsp; ${(data.wind.speed * 2.24).toFixed(1)} mph`)\n } catch (err) {\n error.classList.add('show')\n error.textContent = err\n }\n}", "title": "" } ]
[ { "docid": "5fb8e96b4482b7c8383af9cde670fee7", "score": "0.79058653", "text": "function weatherByPosition(position){\n\tlet url = apiUrl + 'weather?lat=' + \n\t\tposition.coords.latitude + \n\t\t'&lon='+ position.coords.longitude + \n\t\t'&units=' + units + '&APPID=' + API_KEY;\n\tXHRCall(url, 'json', prepareCurrentToDisplay);\n}", "title": "" }, { "docid": "47346654ba4767636b9d9d1c4d5b642d", "score": "0.7538601", "text": "function myLocation(position) {\n console.log(position);\n let currentLat = position.coords.latitude;\n let currentLon = position.coords.longitude;\n let apiKey = \"751f58f905d4f428f0ffbf70ca07ab69\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${currentLat}&lon=${currentLon}&appid=${apiKey}&units=metric`;\n\n axios.get(apiUrl).then(displayCurrentWeather);\n // Add API Forecast\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?lat=${currentLat}&lon=${currentLon}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(displayForecast);\n}", "title": "" }, { "docid": "232832f10f55d5d96927f1666a2fd05f", "score": "0.7514892", "text": "function getLocation(position) {\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let apiKey = \"3e712c360eb3016685312bd97cac9b63\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=metric`;\n axios.get(`${apiUrl}`).then(updateTemperature);\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=metric`;\n axios.get(`${apiUrl}`).then(displayForecast);\n}", "title": "" }, { "docid": "7e3989e65b41724e7a802809652d7b56", "score": "0.74246097", "text": "function myLocation(position) {\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n\n let units = \"metric\";\n let apiKey = \"708c6e03dd68365a43c77d48ed40d262\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}`;\n console.log(apiUrl);\n axios.get(apiUrl).then(showData);\n}", "title": "" }, { "docid": "11151448b31e41f971f32c12de39ff0d", "score": "0.7406312", "text": "function got_location(position){\r\n let lat = position.coords.latitude\r\n let lon = position.coords.longitude\r\n console.log('lon: ' + lon)\r\n console.log('lat: ' + lat )\r\n\r\n get_weather_current(lat,lon)\r\n}", "title": "" }, { "docid": "25d558c8aa54feec91491e61ed802ee4", "score": "0.7382626", "text": "function getWeather(position) {\r\n const weatherUrl = `http://api.openweathermap.org/data/2.5/weather?lat=${position.coords.latitude}&lon=${position.coords.longitude}&APPID=69d36a5e934afb5f52faa7defbdea27c&units=metric`;\r\n console.log(weatherUrl);\r\n const xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', weatherUrl, true);\r\n xhr.onload = () => {\r\n if (xhr.status == 200) {\r\n const data = JSON.parse(xhr.responseText);\r\n\r\n cityWeather = data.weather[0].main.toLowerCase();\r\n cityTemperature = Math.round(data.main.temp) + \"°C\";\r\n text.innerHTML = cityName + \" * \" + cityTemperature;\r\n updateBackground();\r\n }\r\n }\r\n xhr.send();\r\n }", "title": "" }, { "docid": "62cce5d528717ebbd2bb26fd49ebfd7f", "score": "0.7372301", "text": "function getLatitudeAndLongtitude(position){\n getLatitude = position.coords.latitude;\n getLongtitude = position.coords.longitude;\n api = url + \"lat=\" +getLatitude + \"&\" + \"lon=\" + getLongtitude;\n getData();\n getWeather(41.9028,12.4964,\"italy-temperature\",\"italy-city\",\"italy-country\",\"italy-icon\",\"italy-condition\");\n getWeather(37.983810,23.727539,\"athens-temperature\",\"athens-city\",\"athens-country\",\"athens-icon\",\"athens-condition\"); \n \n}", "title": "" }, { "docid": "fbb84644bc6880c3c4ec27bcb223b57e", "score": "0.73288035", "text": "function callWeatherAPI() {\n var url = makeURL(coord.latitude, coord.longitude);\n $.getJSON(url, getLocalWeather);\n}", "title": "" }, { "docid": "ce382887d736b7a337ccedc896dc3b44", "score": "0.73223454", "text": "function locationSuccess(pos) {\n console.log('Location success: ' + pos);\n getWeather(pos.coords.latitude, pos.coords.longitude);\n}", "title": "" }, { "docid": "e61086fc286a3349c59cb23a246832b9", "score": "0.7297363", "text": "function success(pos) {\r\n var crd = pos.coords;\r\n var lat = \"lat=\" + crd.latitude;\r\n var lon = \"lon=\" + crd.longitude;\r\n getWeather(lat, lon);\r\n \r\n }", "title": "" }, { "docid": "a942fcfd6914fc5a7588cd77d12afb0e", "score": "0.7279787", "text": "function getPosition(position) {\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKey}&units=${unit}`;\n axios.get(apiUrl).then(updateWeather, updateTime()); \n}", "title": "" }, { "docid": "418451366f4e520d71dd1e07f8e7bea1", "score": "0.7279455", "text": "function getWeather(position) {\n \n var key = \"e9f9dec3547457cf5b5704dc6cb080be\";\n\n $.ajax({\n url: \"https://api.darksky.net/forecast/\"+key+\"/\"+position.coords.latitude+\",\"+position.coords.longitude,\n dataType: \"jsonp\",\n success: function(data) {\n // console.log(data);\n // The temperature comes in Fahrenheit, so we convert to Celsius before showing\n TEMP.val = Math.round(data.currently.temperature);\n $(\".temperature__val\").html(TEMP.val +\"F\");\n // Set the other weather values\n $(\".weather__rain\").html(data.currently.precipProbability * 100 +\"%\");\n $(\".weather__wind\").html(data.currently.windSpeed +\" mi/h\");\n $(\".weather__humidity\").html(data.currently.humidity * 100 +\"%\");\n // Change the background to match the weather\n changeWeatherBackground(data.currently.icon);\n // Initiate the Skycons lib to generate the weather icon\n var skycons = new Skycons({\"color\": \"white\"});\n skycons.add(\"temperature__icon\", data.currently.icon);\n skycons.play();\n // Remove the height:100% attribute so the background can match\n $(\"html, body\").removeClass(\"total-height\");\n $(\".weather\").show();\n $(\".jumbo__button\").button('reset'); \n },\n error: function() {\n console.log(\"Couldn't find the data.\");\n $(\".jumbo__button\").button('reset'); \n }\n });\n }", "title": "" }, { "docid": "4fe3b888c927bdb113754c644dd69bcc", "score": "0.72539234", "text": "function success(pos) {\n let apiKey = \"e7404fca7e5b62ae35774a01b0feeac1\";\n let units = \"imperial\";\n let apiEndpoint = \"https://api.openweathermap.org/data/2.5/weather?\";\n let apiUrlLatLong = `${apiEndpoint}lat=${pos.coords.latitude}&lon=${pos.coords.longitude}&units=${units}&appid=${apiKey}`;\n\n axios.get(apiUrlLatLong).then(showWeather);\n}", "title": "" }, { "docid": "b87d047dbfc5b12b36f26037e775c815", "score": "0.7205048", "text": "function getWeatherFromGeo(position){\n // console.log(position);\n console.log('-------------------');\n //$(\"#forecastHolder\").hide();\n var req_url = \"http://api.wunderground.com/api/11e9326259bb14c8/conditions/forecast/q/\";\n var req_params = position.coords.latitude + \",\" + position.coords.longitude;\n console.log(req_params);\n var json_req = encodeURI(req_url+req_params+\".json\");\n console.log(json_req);\n $.getJSON( json_req, recieveData);\n } //end getWeatherFromForm", "title": "" }, { "docid": "c3d5c1ab13af567e4b375ee8c3220129", "score": "0.7186872", "text": "function getCurrentWeatherData(position) {\n\t// Build the OpenAPI URL for current Weather\n\tvar WeatherNowAPIurl = BASE_URL + \"lat=\" + position.coords.latitude\n\t\t\t+ \"&lon=\" + position.coords.longitude + UrlParams;\n\tvar WeatherForecast_url = Forecast_URL + \"lat=\" + position.coords.latitude\n\t\t\t+ \"&lon=\" + position.coords.longitude + ForeCast_Params;\n\t// OpenWeather API call for Current Weather\n\tvar xmlhttp = new XMLHttpRequest();\n\txmlhttp.onreadystatechange = function() {\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\tvar JSONobj = JSON.parse(xmlhttp.responseText);\n\t\t\tParse(JSONobj);\n\t\t}\n\t}\n\txmlhttp.open(\"GET\", WeatherNowAPIurl, true);\n\txmlhttp.send();\n\n\t// OpenWeather API call for Forecast Weather\n\tvar xmlhr = new XMLHttpRequest();\n\txmlhr.onreadystatechange = function() {\n\t\tif (xmlhr.readyState == 4 && xmlhr.status == 200) {\n\t\t\tvar JSobj = JSON.parse(xmlhr.responseText);\n\t\t\tForecast(JSobj);\n\t\t}\n\t}\n\txmlhr.open(\"GET\", WeatherForecast_url, true);\n\txmlhr.send();\n\n}", "title": "" }, { "docid": "167140b8545b6054f166c2d81d2a4c68", "score": "0.71720725", "text": "function getSucces(position) {\n \n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n \n var wString = \"http://api.openweathermap.org/data/2.5/forecast/daily?lat=\" + lat + \"&lon=\" + lon + \"&cnt=2&lang=nl\";\n //AJAXcall\n $.ajax({\n url: wString,\n dataType: 'jsonp',\n success: function (json) {\n today = generateWeather(json,0);\n\t\t\ttomorrow = generateWeather(json,1);\n\t\t\t\n\t\t\tprocessInformation(lat, lon, today, tomorrow);\n\t\t\t\n }\n });\n\n}", "title": "" }, { "docid": "ca4c007ecf81b64465ae9250c1d699e8", "score": "0.7144463", "text": "function searchLocation(position) {\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let apiKey = \"3b934571c44c2dc67989d927e97cc0f8\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=metric`;\n axios.get(`${apiUrl}`).then(showWeatherTemp);\n}", "title": "" }, { "docid": "227a09f174f2f473c11a3e7b9e1ddd71", "score": "0.7130583", "text": "function getLocation(position) {\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n let apiKey = \"7784a4cd4aa2e0c25ead7bd96d585b8a\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKey}&units=metric`;\n\n axios.get(apiUrl).then(showTemperature);\n axios.get(apiUrl).then(displayName);\n}", "title": "" }, { "docid": "6325084058c672e18cf27ace2ce733e6", "score": "0.7088557", "text": "function mainWeather(position){\n //var position = gm.info.getCurrentPosition();\n var lat = position.coords.latitude;\n var lng = position.coords.longitude;\n getPlaceKey(formatURL(lat, lng));\n}", "title": "" }, { "docid": "7b0f6b5117c346f6943b7b0ed7bbe8a6", "score": "0.70811325", "text": "function geoSuccess (position) {\n\t\tconsole.log(position);\n\n\t\tlat = position.coords.latitude;\n\t\tlong = position.coords.longitude;\n\n\t\twURL =\"http://api.openweathermap.org/data/2.5/weather?lat=\" + lat + \"&lon=\" + long + \"&appid=5a1518c003259fdaa613a1aa78664ff9&units=imperial\";\n\t\tweather();\n\t}", "title": "" }, { "docid": "fdc6b98be998ae2918b5d8158fa43a03", "score": "0.704839", "text": "function successFunction(position) {\n //opening fccAPI\n xhttp.open(\"GET\",\"https://fcc-weather-api.glitch.me/api/current?lat=\" + position.coords.latitude + \"&lon=\" + position.coords.longitude, true);\n xhttp.send();\n var lat = position.coords.latitude;\n var lng = position.coords.longitude;\n codeLatLng(lat, lng)\n}", "title": "" }, { "docid": "dad2b3d978dbb72fc381761470b1b19d", "score": "0.7026759", "text": "function determinePosition(position) {\n console.log(position);\n let apiKey = `a20670b64f2243817bd352afb3a3d0b5`;\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n console.log(lat);\n console.log(lon);\n\n let url = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&units=imperial&appid=${apiKey}`;\n axios.get(url).then(getCLInfo);\n}", "title": "" }, { "docid": "20cf0055bd1ddb4664f4a42273de4075", "score": "0.70209146", "text": "function updateFromGeolocation(position) {\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${position.coords.latitude}&lon=${position.coords.longitude}&units=${units}`;\n axios\n .get(`${apiUrl}&appid=${apiKey}`)\n .then(getLocationInfo)\n .then(getWeatherData);\n}", "title": "" }, { "docid": "be693c3a99a019d2c82035d8bce3771c", "score": "0.7018966", "text": "function showPosition(position) {\n coord.latitude = position.coords.latitude;\n coord.longitude = position.coords.longitude;\n callWeatherAPI();\n callForecastAPI();\n callForecastAPI2();\n}", "title": "" }, { "docid": "8389d2b0246b85b89c93ae9e038e6ed0", "score": "0.7013591", "text": "function showCoordinates(position) {\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n coordinates = \"&lat=\" + position.coords.latitude + \"&lon=\" + position.coords.longitude;\n // Check whether to use Fahrenheit or Celsius when making API query\n if (units == \"Fahrenheit\") {\n url = \"http://\" + api + apiKey + imperial + coordinates;\n } else {\n url = \"http://\" + api + apiKey + metric + coordinates;\n }\n console.log(url);\n \n // Make API query to OpenWeatherData (source: https://www.w3schools.com/xml/xml_http.asp)\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true);\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n responseText = xhr.responseText;\n // Format data as Javascript object\n weather = JSON.parse(responseText);\n console.log(weather);\n // Change source of weather icon as relevant\n iconURL = \"http://openweathermap.org/img/w/\" + weather.weather[\"0\"].icon + \".png\";\n document.getElementById(\"icon\").src = iconURL;\n // Update relevant weather information\n document.getElementById(\"weather1\").innerHTML = \"<br>\" + Math.round(weather.main.temp) + \"&deg;\";\n document.getElementById(\"weather2\").innerHTML = \"<i>\" + weather.name + \", \" + weather.sys.country + \"</i>\" + \"<br>\" + weather.weather[\"0\"].main + \" (\" + weather.weather[\"0\"].description + \"). High: \" + Math.round(weather.main.temp_max) + \"&deg; / Low: \" + Math.round(weather.main.temp_min) + \"&deg;\";\n }\n }\n xhr.send();\n}", "title": "" }, { "docid": "e484be05b76608680dc3eaef88f3a027", "score": "0.69972825", "text": "function getPosition(position) {\n \tvar latitude = \"lat=\" + position.coords.latitude;\n \tvar longitude = \"lon=\" + position.coords.longitude;\n \tgetWeather(latitude, longitude);\n }", "title": "" }, { "docid": "564104a2d16614c22b8c7ef76df27081", "score": "0.6990244", "text": "function getWeather(){\n gm.info.getCurrentPosition(mainWeather, true);\n}", "title": "" }, { "docid": "7354b34468ad43aa20631938fe39b81d", "score": "0.6976975", "text": "function setPosition(position) {console.log(position); \r\n let latitude = position.coords.latitude;\r\n let longitude = position.coords.longitude;\r\n\r\n //we're declaring getWeather to be called later\r\n getWeather(latitude, longitude);\r\n}", "title": "" }, { "docid": "7037d6b3c5e2162c16a21cd812d9c781", "score": "0.69701874", "text": "function showPosition(position) {\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let apiKey = \"edcd663668b8087c96e88fbd0856ea83\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=metric`;\n axios.get(`${apiUrl}&appid=${apiKey}`).then(sendCoordinates);\n\n let apiForecastUrl = \"https://api.openweathermap.org/data/2.5/onecall?\";\n let forecastUrl = `${apiForecastUrl}lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=metric`;\n axios.get(forecastUrl).then(showForecast);\n}", "title": "" }, { "docid": "f06c3043b6f1ae176dc50955fec1ea93", "score": "0.6961492", "text": "function success(pos) {\n //build request link from position coordinates\n const link =\n 'https://api.openweathermap.org/data/2.5/weather?APPID=adfb4f4555c4ea1714b082c7f54477ee&units=metric' +\n '&lat=' + pos.coords.latitude + '&lon=' + pos.coords.longitude;\n self.fetchData(link);\n }", "title": "" }, { "docid": "2f0509b2787258636a0a6d282ca8fa8d", "score": "0.69456017", "text": "function searchLocation(position) {\n let apiKey = \"d34052a4c2a560f7da6f367f25941f71\";\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n let unit = \"metric\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKey}&units=${unit}`;\n \n axios.get(apiUrl).then(showTempAndName);\n }", "title": "" }, { "docid": "97a33d139892a41dd31e9e111500c5a1", "score": "0.6927604", "text": "function userPosition(position) {\n let apiKey = \"5a533b6a6d16b85bbee4c6b85f37d1be\";\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n let units = \"imperial\"\n let url = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKey}&units=${units}`;\n axios.get(url).then(showTemperature);\n\n let forecastUrl = `https://api.openweathermap.org/data/2.5/forecast?lat=${lat}&lon=${lon}&appid=${apiKey}&units=${units}`;\n axios.get(forecastUrl).then(showForecast);\n}", "title": "" }, { "docid": "68ee876d3f7c8a5301e8dc8ee4b0da9d", "score": "0.6924908", "text": "function showCurrentPosition(position) {\n let units = \"imperial\";\n let apiKey = \"f9ed2779c7a88244e3c6c97a1ad830b5\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${position.coords.latitude}&lon=${position.coords.longitude}&appid=${apiKey}&units=${units}`;\n\n axios.get(apiUrl).then(displayWeatherConditions);\n}", "title": "" }, { "docid": "9588e2dcbe118988bb5b7af07fc26007", "score": "0.69137", "text": "function handlePosition(position) {\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n let apiKey = \"f300ea07549b278ccdffad6a05e9faa5\";\n let units = \"metric\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&units=${units}&appid=${apiKey}`;\n axios.get(apiUrl).then(showTemp);\n}", "title": "" }, { "docid": "7d94d4ab3467481414b630415eb20d21", "score": "0.6911684", "text": "function retrievePosition(position) {\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let units = \"metric\";\n let apiKey = \"0f2efbf7da0a99fa73f8d244bcbbe2f5\";\n let apiEndpoint = \"https://api.openweathermap.org/data/2.5/weather\";\n let apiUrl = `${apiEndpoint}?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}`;\n\n axios.get(apiUrl).then(showTemperature); ///showTemperature calls the function we already built above, so no need to create a new function\n}", "title": "" }, { "docid": "2159bcd36e105e62d2d47d9a28145b37", "score": "0.6905297", "text": "function success(position) {\n callWeatherAPI(\"\",position.coords.latitude,position.coords.longitude);\n isUserLocation = true;\n }", "title": "" }, { "docid": "9891a6a9023d7ec55bfcd23b7ac4919f", "score": "0.69006926", "text": "function setPosition(position){\r\n let latitude = position.coords.latitude;\r\n let longitude = position.coords.longitude;\r\n\r\n getWeather(latitude, longitude);\r\n}", "title": "" }, { "docid": "4d73eb4351985b9a925471d8293bc942", "score": "0.6896908", "text": "function success(position) {\n // Define location that geolocator gives\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n\n // Define URL to put into fetch API call\n let url =\n api +\n '?lat=' +\n latitude +\n '&lon=' +\n longitude +\n '&appid=' +\n apiKey +\n '&units=imperial';\n\n // Fetch API call\n fetch(url)\n .then((response) => response.json())\n .then((data) => {\n console.log(data);\n // Temperature data\n let temp = data.main.temp;\n // Icon data\n let iconName = data.weather[0].icon;\n // icon 'src' url\n let iconUrl = `http://openweathermap.org/img/wn/${iconName}.png`;\n // Add temperature to the header tag with id='temperature'\n temperature.innerHTML = Math.round(temp) + '° F';\n // Add city to the header tag with id='location'\n location.innerHTML = data.name;\n // Add src to the <img> tag with id='icon'\n icon.src = iconUrl;\n });\n }", "title": "" }, { "docid": "2adb80c3a9010a8cf46589ed5ddfdda9", "score": "0.6894969", "text": "function showPosition(position) {\n\t\t$.ajax({\n\t\t\ttype : \"GET\",\n\t\t\turl : \"http://api.openweathermap.org/data/2.5/weather?lat=\" + position.coords.latitude + \"&lon=\" + position.coords.longitude,\n\t\t\tdataType : \"jsonp\",\n\t\t\tsuccess : function(response) {\n\t\t\t\tvar temp = (response.main.temp - 273.15).toFixed(1);\n\t\t\t\t//console.log(response);\n\t\t\t\t$(\"#icon\").attr(\"src\", \"http://openweathermap.org/img/w/\" + response.weather[0].icon + \".png\");\n\t\t\t\t$(\"#temp\").text(temp + \" °C\" );\n\t\t\t\t$(\"#city_name\").text(response.name);\n\t\t\t\t$(\"#description\").text(response.weather[0].description);\n\t\t\t\t$(\"#wind\").text(\"Wind: \" + response.wind.speed + \"mps\");\n\t\t\t\t$(\"#humidity\").text(\"Humidity: \" + response.main.humidity + \"%\");\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "834cc6bc51f60dfb49166e96139d4d6d", "score": "0.6880513", "text": "function showLocation(position) {\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n let apiKeyTwo = \"d643ee59f43b44ad31e57464532264d8\";\n\n let apiUrlThree = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKeyTwo}&units=imperial`;\n let apiUrlFour = `https://api.openweathermap.org/data/2.5/forecast?lat=${lat}&lon=${lon}&appid=${apiKeyTwo}&units=imperial`;\n axios.get(apiUrlThree).then(displayTemperature);\n axios.get(apiUrlFour).then(displayForecast);\n}", "title": "" }, { "docid": "0634b1885ae58d4cc02b4d3fbbdf4772", "score": "0.68656284", "text": "function getweatherforecastByPosition(lat, lon, callback) {\n\t\n\trest('get', weatherforecastBaseUrl + 'lat=' + lat + '&lon=' + lon + '&units=imperial&APPID=' + weatherforecastApiKey, null, callback);\n\t\n}", "title": "" }, { "docid": "71ee5c5b3040936ba42434219ee053fe", "score": "0.68651396", "text": "function geoLocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition((position) => {\n position.timeout = .5\n const latitude = position.coords.latitude;\n const longitude = position.coords.longitude;\n const geoLocationForecastAPI = `https://api.openweathermap.org/data/2.5/forecast?lat=${latitude}&lon=${longitude}&units=metric&appid=${API_KEY}`\n const geoLocationWeatherAPI = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&units=metric&appid=${API_KEY}`\n getWeatherForecast(geoLocationForecastAPI)\n getWeatherToday(geoLocationWeatherAPI)\n });\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "8f3e75a75829ed0b8fc370ebfd4ab16d", "score": "0.6863012", "text": "function searchCoordinates(position) {\n const currentLat = position.coords.latitude;\n const currentLon = position.coords.longitude;\n let apiUrlCoordsToday = `weather?`;\n axios\n .get(\n `${apiUrl}${apiUrlCoordsToday}lat=${currentLat}&lon=${currentLon}&units=${units}&appid=${apiKey}`\n )\n .then(showWeather);\nlet apiUrlCoordsForecast = `onecall?`;\n axios\n .get(\n `${apiUrl}${apiUrlCoordsForecast}lat=${currentLat}&lon=${currentLon}&units=${units}&exclude=hourly,minutely&appid=${apiKey}`\n ).then(showForecast);\n}", "title": "" }, { "docid": "f5f6f44d1c8159e8a5b0aef41ac2453f", "score": "0.6860122", "text": "function getForecast(coordinates) {\n let apiKey = \"a05ae6cedba9f2ae2d858f2bc163bc51\";\n let apiURL = `https://api.openweathermap.org/data/2.5/onecall?lat=${coordinates.lat}&lon=${coordinates.lon}&appid=${apiKey}&units=imperial`;\n console.log(apiURL);\n axios.get(apiURL).then(displayForecast);\n}", "title": "" }, { "docid": "342d90113a62936e6b71b8e39705ac75", "score": "0.6829029", "text": "function upDateLocal(position) {\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n let apiKey = \"88a78e66d2f90d07860c0aa03d94e774\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKey}&units=metric`;\n let apiUrl2 = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&appid=${apiKey}`;\n let cityName = document.querySelector(\"#cityname\");\n cityName.innerHTML = \"Your Location\";\n axios.get(apiUrl).then(updateTempHelper);\n axios.get(apiUrl2).then(updateHourlyHelper2);\n}", "title": "" }, { "docid": "f2885c5d2f2fdf1df9087b1b65e38bf6", "score": "0.68236434", "text": "async function callWeather(location){\n // Fetch Current Weather API\n let currentWeatherData = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${location}&appid=${apiKey}&units=metric`);\n let weatherJSON = await currentWeatherData.json();\n\n // Get longitude and latitude from Current Weather API, and feed it into the One Call API for daily forecasts, and UV Index\n let lattitude = weatherJSON.coord.lat;\n let longitude = weatherJSON.coord.lon;\n\n // Fetch One Call API, using lattitude and longitude from Current Weather API\n let oneCallAPI = await fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${lattitude}&lon=${longitude}&units=metric&exclude=current,minutely,hourly,alerts&appid=${apiKey}`)\n let oneCallJSON = await oneCallAPI.json();\n\n // Build Object with all the data we need for our app\n requestedWeatherData = {\n cityName: weatherJSON.name,\n currentDate: new Date(weatherJSON.dt*1000),\n currentTemp: `${weatherJSON.main.temp} C`,\n currentHumidity: `${weatherJSON.main.humidity}%`,\n currentWind: `${weatherJSON.wind.speed} km/h`,\n currentUVI: oneCallJSON.daily[0].uvi,\n dailyForecast: oneCallJSON.daily // Don't forget index 0 is today!\n }\n}", "title": "" }, { "docid": "3cdd79f813e37616c4176c0592a18861", "score": "0.6823418", "text": "async function callWeather(location){\n // Fetch Current Weather API\n let currentWeatherData = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${location}&appid=${apiKey}&units=metric`);\n let weatherJSON = await currentWeatherData.json();\n\n // Get longitude and latitude from Current Weather API, passes it to the One Call API for daily forecasts and UV Index\n let latitude = weatherJSON.coord.lat;\n let longitude = weatherJSON.coord.lon;\n\n // Fetch One Call API, using latitude and longitude from Current Weather API\n let oneCallAPI = await fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${latitude}&lon=${longitude}&units=metric&exclude=current,minutely,hourly,alerts&appid=${apiKey}`)\n let oneCallJSON = await oneCallAPI.json();\n\n // Build Object with all the data we need\n requestedWeatherData = {\n cityName: weatherJSON.name,\n currentDate: new Date(weatherJSON.dt*1000),\n currentTemp: `${weatherJSON.main.temp} C`,\n currentHumidity: `${weatherJSON.main.humidity}%`,\n currentWind: `${weatherJSON.wind.speed} km/h`,\n currentUVI: oneCallJSON.daily[0].uvi,\n dailyForecast: oneCallJSON.daily\n }\n}", "title": "" }, { "docid": "1e9a4ca30e2df8653550060faedc5f6c", "score": "0.6813323", "text": "function getForecast(coordinates) {\n console.log(coordinates);\n let apiKey = \"3b934571c44c2dc67989d927e97cc0f8\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${coordinates.lat}&lon=${coordinates.lon}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(displayForecast);\n}", "title": "" }, { "docid": "3aec6c734c2f77934c34ba7fe55f0ffa", "score": "0.68130916", "text": "function searchLocation(position) {\n let apiKey = \"42e97aa1960c10d8826372a5ee85406c\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${position.coords.latitude}&lon=${position.coords.longitude}&exclude=minutely,hourly,alerts&appid=${apiKey}&units=metric`;\n \n fetch(apiUrl).then((response) => response.json()).then((data) => {\n document.querySelector(\"#searched-city\").innerHTML = data.timezone;\n celsiusTemperature = data.current.temp;\n currentTemperature.innerHTML = Math.round(celsiusTemperature);\n descriptionElement.innerHTML = data.current.weather[0].description;\n windElement.innerHTML = Math.round(data.current.wind_speed);\n realFeelTemperature = data.current.feels_like;\n realFeelElement.innerHTML = Math.round(realFeelTemperature);\n iconElement.src = `https://openweathermap.org/img/wn/${data.current.weather[0].icon}@2x.png`;\n forecastTemp1 = data.daily[0].temp.day;\n fcTemp1.innerHTML = Math.round(forecastTemp1);\n fcDesc1.innerHTML = data.daily[0].weather[0].description;\n fcIcon1.src = `https://openweathermap.org/img/wn/${data.daily[0].weather[0].icon}@2x.png`;\n forecastTemp2 = data.daily[1].temp.day;\n fcTemp2.innerHTML = Math.round(forecastTemp2);\n fcDesc2.innerHTML = data.daily[1].weather[0].description;\n fcIcon2.src = `https://openweathermap.org/img/wn/${data.daily[1].weather[0].icon}@2x.png`;\n forecastTemp3 = data.daily[2].temp.day;\n fcTemp3.innerHTML = Math.round(forecastTemp3);\n fcDesc3.innerHTML = data.daily[2].weather[0].description;\n fcIcon3.src = `https://openweathermap.org/img/wn/${data.daily[2].weather[0].icon}@2x.png`;\n\n let backs = data.current.weather[0].main;\n switch(backs) {\n case \"Clear\": document.getElementById(\"wrapper-bg\").style.backgroundImage =\n \"url('src/images/clear.gif')\";\n break;\n case \"Clouds\": document.getElementById(\"wrapper-bg\").style.backgroundImage =\n \"url('src/images/clouds.gif')\";\n break;\n case \"Drizzle\": document.getElementById(\"wrapper-bg\").style.backgroundImage =\n \"url('src/images/drizzle.gif')\";\n break;\n case \"Fog\": document.getElementById(\"wrapper-bg\").style.backgroundImage =\n \"url('src/images/fog.gif')\";\n break;\n case \"Rain\": document.getElementById(\"wrapper-bg\").style.backgroundImage =\n \"url('src/images/rain.gif')\";\n break;\n case \"Snow\": document.getElementById(\"wrapper-bg\").style.backgroundImage =\n \"url('src/images/snow.gif')\";\n break;\n case \"Thunderstorm\": document.getElementById(\"wrapper-bg\").style.backgroundImage =\n \"url('src/images/thunderstorm.gif')\";\n break;\n }\n })\n}", "title": "" }, { "docid": "03cd3353d61bb5e90c89c62308c0b652", "score": "0.68092406", "text": "function success(pos) {\n var crd = pos.coords;\n\n // Get the user's coordinates\n var userLat = pos.coords.latitude;\n var userLon = pos.coords.longitude;\n\n var apiKey = \"4471d8a288b1158a16e4a8e8f56a3e35\";\n //Automatically build a query URL based on user's location when site is loaded.\n var autoQueryURL = \"https://api.openweathermap.org/data/2.5/weather?lat=\" + userLat + \"&lon=\" + userLon + \"&units=imperial&appid=\" + apiKey;\n\n $.ajax({\n url: autoQueryURL,\n method: \"GET\",\n }).then(function (response) {\n autoRenderWeather(response);\n });\n}", "title": "" }, { "docid": "f5c9f774b6e86feb0832cbc769a1bfdf", "score": "0.6764265", "text": "function getCoord(position) {\n let apiKey = \"500879ecd691e9d1fcc3776605ed01a1\";\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n let apiUrlCoord = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&units=metric&appid=${apiKey}`;\n axios.get(apiUrlCoord).then(getCity);\n axios.get(apiUrlCoord).then(getTemp);\n}", "title": "" }, { "docid": "e99f71dc6bb0d6bca10f15563c64d56d", "score": "0.67517596", "text": "function setPosition(position) {\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n getWeather(latitude, longitude);\n}", "title": "" }, { "docid": "cc56ee139b7710ec776f6fe19f0d6128", "score": "0.67494357", "text": "function searchCoords(position) {\n let lat = position.coords.latitude;\n let long = position.coords.longitude;\n let units = \"imperial\";\n let apiKey = \"2c3b195efbedc960ba063392d31bc9bd\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${long}&units=${units}&appid=${apiKey}`;\n\n axios.get(apiUrl).then(showWeather);\n}", "title": "" }, { "docid": "dc046bbfda758acab7d1eae94b56b2e5", "score": "0.6731455", "text": "function showCurrentLocation(position)\n{\n // map initialise\n mapLatitude = position.coords.latitude;\n mapLongitude = position.coords.longitude;\n \n // request weather at current location\n var key = mapLatitude + \",\" + mapLongitude + \",\" + today.forecastDateString();\n var script = document.createElement('script');\n script.src = \"https://api.forecast.io/forecast/545d94fc22b966c9fe0d025fab265e6c/\" + key + \"?exclude=currently,minutely,hourly&units=ca&callback=this.currentLocationResponse\";\n document.body.appendChild(script);\n}", "title": "" }, { "docid": "39906331d4951a7ef9fc3ded388aaae1", "score": "0.6722945", "text": "function getWeather(callback){\n \n//GETs latitude and longitude of location\nif (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position){\n var latitude = position.coords.latitude;\n var longitude = position.coords.longitude;\n\n//GETs weather using longitude and latitude \n$.ajax({\n url: \"https://crossorigin.me/https://api.darksky.net/forecast/55405fea53ba2380b7bb2b045a95ddbc/\" + latitude + \",\" + longitude,\n dataType: 'json',\n //If success, calls callback function passed as parameter\n success: callback,\n error: function(){\n //If error, attempts GET again\n getWeather(displayF);\n }\n});\n})\n}\n}", "title": "" }, { "docid": "cc90d2f7cff4a9bc51aba9a9e84152a5", "score": "0.6718841", "text": "function getOpenWeatherData(pos) {\n\t/* Construct the URL. */\n\tvar url = 'http://api.openweathermap.org/data/2.5/weather?' +\n\t\t'lat=' +pos.coords.latitude + \n\t\t'&lon=' + pos.coords.longitude + \n\t\t'&units=imperial' + \n\t\t'&appid=' + openweathermap.api_key;\n\n\tvar xhr = new XMLHttpRequest();\n\n\txhr.onload = function() {\n\t\t/* On load, parse the temperature from the response and send it to the watch. */\n\t\t\n\t\t/* responseText will contain a JSON object with data info. */\n\t\tvar json = JSON.parse(this.responseText);\n\n\t\t/* Assemble dictionary to send. */\n\t\tvar dictionary = {\n\t\t\t'Temperature': json.main.temp\n\t\t};\n\n\t\t/* Send the message to the watch. */\n\t\tPebble.sendAppMessage(dictionary, function(e) {\n\t\t\tconsole.log('Weather info sent to Pebble successfully.');\n\t\t}, function(e) {\n\t\t\tconsole.log('Error sending weather info to Pebble.');\n\t\t});\n\t};\n\t\n\t/* Send the request. */\n\txhr.open('GET', url);\n\txhr.send();\n}", "title": "" }, { "docid": "711d005d72fd3c9b387e27972c81804e", "score": "0.67138654", "text": "function callWeatherApi() {\n var city = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Windhoek';\n displayLoading(); // * Format city name for url\n\n var lower = city.toLowerCase();\n var words = lower.split(' ');\n var search = words.join('+');\n var cityName = search; // * Call API\n // OpenWeather API: 5017fbfd06e50faffa83ae57bed333\n\n var apiKey = '5017fbfd06e50faffa83ae57bed3330f';\n var url = \"https://api.openweathermap.org/data/2.5/weather?q=\".concat(cityName, \"&appid=\").concat(apiKey); // * Get Response Promise\n // * Check for any error in the status code\n // * Return the resolved promise to json\n // * Catch the rejected promise in catch\n // * Then\n\n fetch(url, {\n mode: 'cors'\n }).then(function (response) {\n hideLoading();\n\n if (response.status === 401) {\n throw new Error('API key error.');\n }\n\n if (response.status === 404) {\n showErrorMessage('Enter a valid location.');\n throw new Error('Specified the wrong city name, ZIP-code or city ID.');\n }\n\n if (!response.ok) {\n showErrorMessage(\"Error \".concat(response.status));\n throw new Error(response.status);\n }\n\n return response.json();\n }).then(function (data) {\n return setCurrentWeather(data);\n }).catch(function (error) {\n console.log('catch:', error);\n });\n } // 03 Write the functions that process the JSON data you’re getting from the API", "title": "" }, { "docid": "67d13b903328fca711f54adcf3e38942", "score": "0.66949457", "text": "function locationSuccess(position) {\n\n var weatherAPI = 'http://api.openweathermap.org/data/2.5/weather?lat=' + position.coords.latitude +\n '&lon=' + position.coords.longitude\n\n $.getJSON(weatherAPI, function(response) {\n JSON.stringify({\n data: response\n });\n\n var city = response.name\n var icon = response.weather[0].icon\n var condition = response.weather[0].description\n var currentTemperature = convertTemperature(response.main.temp) + '°'\n var tempMin = convertTemperature(response.main.temp_min) + '°'\n var tempMax = convertTemperature(response.main.temp_max) + '°'\n\n addWeather(\n icon,\n city,\n currentTemperature,\n tempMin,\n tempMax,\n condition\n );\n });\n }", "title": "" }, { "docid": "74d11ad3613046b6a6e0848a32f3e089", "score": "0.6692216", "text": "function success(position) {\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n\n location.innerHTML = 'Latitude is ' + latitude + '° Longitude is ' + longitude + '°';\n\n $.getJSON(url + apiKey + \"/\" + latitude + \",\" + longitude + \"?callback=?\", function (data) {\n var icons = new Skycons({\n \"color\": \"#1BA5DF\"\n });\n var icon = data.currently.icon;\n\n $('#temp').html(data.currently.temperature + '°F');\n $('#minutely').html(data.currently.summary);\n $('#tmz').html(data.daily.summary);\n $('#alrt').html(data.currently.alert);\n\n //add to skyicons the weather information\n icons.add(document.getElementById(\"iconW\"), icon);\n //start animation\n icons.play();\n });\n }", "title": "" }, { "docid": "3c22b5c84863bd035e55d2d4839f2739", "score": "0.66726804", "text": "function weather() {\n var location = document.getElementById(\"location\");\n var apiKey = '2e3f338bc2f1aca78c89eed53e8c1358';\n var url = 'https://api.forecast.io/forecast/';\n\n // Utilize current location of the user's browser\n navigator.geolocation.getCurrentPosition(success, error);\n\n // If location and apiKey is sound it will perform weather data gathering.\n function success(position) {\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n\n location.innerHTML = 'Latitude is ' + latitude + '° Longitude is ' + longitude + '°';\n\n $.getJSON(url + apiKey + \"/\" + latitude + \",\" + longitude + \"?callback=?\", function (data) {\n var icons = new Skycons({\n \"color\": \"#1BA5DF\"\n });\n var icon = data.currently.icon;\n\n $('#temp').html(data.currently.temperature + '°F');\n $('#minutely').html(data.currently.summary);\n $('#tmz').html(data.daily.summary);\n $('#alrt').html(data.currently.alert);\n\n //add to skyicons the weather information\n icons.add(document.getElementById(\"iconW\"), icon);\n //start animation\n icons.play();\n });\n }\n\n // If location cannot be detected, API key is invalid and other erroneous factors happen it will inform the user that it failed to load the API.\n function error() {\n alert(\"Unable to retrieve your location. Please check your web browser or your internet connection\");\n console.log(\"Unable to retrieve your location. Please check your web browser or your internet connection\");\n console.log(location.innerHTML);\n }\n // Location loader\n location.innerHTML = \"Searching Your Current Location...\";\n console.log(\"Searching Your Current Location...\");\n }", "title": "" }, { "docid": "a89a94e097682a6a1024ed2c7ee9199b", "score": "0.66593236", "text": "function success(position) {\n\t\t\t\tlat = position.coords.latitude;\n\t\t\t\tlon = position.coords.longitude;\n\t\t\t\tconsole.log(\"Lat: \" + lat);\n\t\t\t\tconsole.log(\"Lon: \" + lon);\n\t\t\t\tupdateWeather();\n\t\t}", "title": "" }, { "docid": "d92752e9c7a7ad1f4f091e1f4b715402", "score": "0.6657921", "text": "function setPosition(position) {\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n\n getWeather(latitude, longitude);\n}", "title": "" }, { "docid": "9cba2b5bacbfaf9316f02cc18c11f80d", "score": "0.66488", "text": "setCoords(position) {\n lat = position.coords.latitude;\n long = position.coords.longitude;\n console.log(\"Lat: \" + lat + \" Long: \" + long)\n searchURL = \"https://api.openweathermap.org/data/2.5/forecast?lat=\" + lat + \"&lon=\" + long +\n \"&APPID=25e989bd41e3e24ce13173d8126e0fd6\"\n }", "title": "" }, { "docid": "15ae8d42e098e437de70885a3b8e08b5", "score": "0.66459864", "text": "function setPosition(position) {\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n\n getWeather(lat, lon);\n}", "title": "" }, { "docid": "1bcb2702c5cd567ef12768fb49a087d5", "score": "0.6632997", "text": "function getWeatherForcast(ws, lat, lon){\n request('https://api.darksky.net/forecast/130474c13d870a20cd8b548373536d63/'+lat+','+lon, function (error, response, body) {\n var forecast = JSON.parse(body);\n ws.send(JSON.stringify({\"action\": \"weather\", \"forecast\": forecast}));\n\n });\n}", "title": "" }, { "docid": "87084f586da2862318f12ab4e36f2808", "score": "0.66230154", "text": "function getForecast(coordinates) {\n let lon = coordinates.lon;\n let lat = coordinates.lat;\n let apiKey = \"7784a4cd4aa2e0c25ead7bd96d585b8a\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&appid=${apiKey}&units=metric`;\n\n axios.get(apiUrl).then(displayForecast);\n console.log(apiUrl);\n}", "title": "" }, { "docid": "226ef0e17143a8efcb3f651eb5f69202", "score": "0.6620162", "text": "function showPosition(position) {\n let lat = position.coords.latitude;\n let lon = position.coords.longitude;\n let apiKey = `f34dd80fa35cdc2d0ed6f98ed24a4a66`;\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKey}&units=metric`;\n\n axios.get(apiUrl).then(updateDetails);\n}", "title": "" }, { "docid": "c763ca03b8dd764e0f2a3a3f6464b8cd", "score": "0.6600739", "text": "function requestWeatherData (location, callback, coords) {\n const xml = new XMLHttpRequest();\n xml.onreadystatechange = () => {\n if (xml.readyState === 4 && xml.status === 200) {\n const data = parseWeatherData(JSON.parse(xml.responseText));\n callback(data);\n }\n }\n if (coords) {\n xml.open('GET', '/api/weather/coords/' + JSON.stringify(location), true);\n }else{\n xml.open('GET', '/api/weather/address/' + location, true);\n }\n xml.send(null);\n}", "title": "" }, { "docid": "4d2397d91abb5da764f06b528fa72a69", "score": "0.6600136", "text": "function success(pos) {\n let location = pos.coords;\n let latitude = location.latitude;\n let longitude = location.longitude;\n\n /*The Openweathermap API is called with a getJSON request using the coordinates from the geolocation */\n fetch(`https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&APPID=a823ad7bba736b25bf0604de42c11ee5`).then(function(response2) {\n return response2.json();\n }).then(function(response) {\n\n /* City and Country Name from API Information is passed into HTML */\n document.querySelector(\"#city\").textContent = `${response.name}, ${response.sys.country}`;\n\n /* Changes the weather icon depending on API weather ID */\n let weatherId = response.weather[0].icon;\n switch (weatherId) {\n case '01d':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-day-sunny\");\n break;\n case '02d':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-day-cloudy\");\n break;\n case '03d':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-cloud\");\n break;\n case '04d':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-cloudy\");\n break;\n case '09d':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-showers\");\n break;\n case '10d':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-day-showers\");\n break;\n case '11d':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-thunderstorm\");\n break;\n case '13d':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-snow\");\n break;\n case '50d':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-day-haze\");\n break;\n case '01n':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-night-clear\");\n break;\n case '02n':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-night-alt-cloudy\");\n break;\n case '03n':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-cloud\");\n break;\n case '04n':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-cloudy\");\n break;\n case '09n':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-showers\");\n break;\n case '10n':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-night-alt-showers\");\n break;\n case '11n':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-thunderstorm\");\n break;\n case '13n':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-snow\");\n break;\n case '50n':\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-fog\");\n break;\n\n default:\n document.getElementById(\"weather-icon\").setAttribute(\"class\", \"wi wi-refresh\");\n }\n\n /* Temperature in Kelvin from API is converted to Celsius and rounded to one decimal point */\n let tempCelsius = Math.round((response.main.temp - 273.15) * 10) / 10;\n document.getElementById(\"temperature\").innerHTML = `${tempCelsius}`;\n\n /* Capitalized weather description from API is passed into HTML */\n document.getElementById(\"weather-description\").innerHTML = `${response.weather[0].description}`;\n\n /* Wind speed and Cloudiness */\n let windInKmh = Math.round(response.wind.speed * 3.6);\n document.getElementById(\"wind-speed\").innerHTML = `wind speed: ${windInKmh} km/h`;\n\n document.getElementById(\"cloudiness\").innerHTML = `cloudiness: ${response.clouds.all}%`;\n\n /* Converts the API information about sunrise and sunset from epoch/unix to human readable date and stores it into HTML */\n let sunrise = timeFromUnix(response.sys.sunrise);\n let sunset = timeFromUnix(response.sys.sunset);\n\n document.querySelector('#sunrise').textContent = `sunrise: ${sunrise.hours}:${sunrise.minutes} UTC${sunrise.timezoneOffset}`;\n document.querySelector('#sunset').textContent = `sunset: ${sunset.hours}:${sunset.minutes} UTC${sunset.timezoneOffset}`;\n\n /* Module to change the temperature unit from Celsius to Fahrenheit */\n\n document.getElementById(\"temp-unit\").setAttribute(\"class\", \"temp-unit-active\"); // Displays the temperature unit as a link once the temperature has succesfully been loaded from the API\n\n /* The tempUnit function is called, when you click on the temperature unit. It converts between Celsius and Fahrenheit */\n function changeTempUnit() {\n let tempUnit = document.getElementById(\"temp-unit\").innerHTML;\n /* If the temperature unit is equal to °C convert the Kelvin API temp to Fahrenheit and display Fahrenheit */\n if (tempUnit === \"°C\") {\n let tempFahrenheit = Math.round((response.main.temp * (9/5) - 459.67) * 10) / 10;\n document.getElementById(\"temperature\").innerHTML = tempFahrenheit;\n document.getElementById(\"temp-unit\").innerHTML = \"°F\";\n document.getElementById(\"temp-unit\").addEventListener(\"click\", changeTempUnit);\n }\n /*else if the temperature unit is °F convert the Kelvin API temp to Celsius and display Celsius */\n else if (tempUnit === \"°F\") {\n let tempCelsius = Math.round((response.main.temp - 273.15) * 10) / 10;\n document.getElementById(\"temperature\").innerHTML = `${tempCelsius}`;\n document.getElementById(\"temp-unit\").innerHTML = \"°C\";\n document.getElementById(\"temp-unit\").addEventListener(\"click\", changeTempUnit);\n }\n else {\n document.getElementById(\"temp-unit\").innerHTML = \"N/A $Temp Unit Error$\"; // error message\n }\n }; // closes the changeTempUnit function\n\n /* Adds an event listener to the temperature unit. When clicked it changes between Fahrenheit and Celsius. */\n document.getElementById(\"temp-unit\").addEventListener(\"click\", changeTempUnit);\n\n // store the data of the successfull geolocation into the database, but only if data from the same day is not in the database\n\n // Count the number of objects stored in the visits objectStore\n let transaction = db.transaction(['visits'], 'readwrite');\n let objectStore = transaction.objectStore('visits');\n let objectStoreCount = objectStore.count();\n\n let lastVisit;\n let lastVisitminusOne;\n\n objectStoreCount.onsuccess = function(e) {\n count = objectStoreCount.result;\n console.log(`There are ${count} objects stored in the database`);\n };\n\n transaction.onerror = function() {\n console.log('Transaction not completed due to error. Counting of objectStore failed.')\n };\n\n // When the number of objects in objectStore has been counted, we access the last item\n transaction.oncomplete = function() {\n console.log('Transaction completed: Counting of objectStore finished.')\n\n // Access the last and next-to-last item of the objectStore\n let transaction2 = db.transaction(['visits'], 'readonly');\n let transaction3 = db.transaction(['visits'], 'readonly');\n let objectStore2 = transaction2.objectStore('visits');\n let objectStore3 = transaction3.objectStore('visits');\n let objectStoreGet = objectStore2.get(count);\n let objectStoreGet2 = objectStore3.get(count-1);\n\n // Store the information from the last entry in the database in lastVisit\n objectStoreGet.onsuccess = function(e) {\n lastVisit = e.target.result;\n };\n\n objectStoreGet2.onsuccess = function(e) {\n lastVisitMinusOne = e.target.result;\n };\n\n transaction2.onerror = function() {\n console.log('Transaction not completed due to error: Last object could not be stored in lastVisit');\n };\n\n transaction2.oncomplete = function() {\n console.log('Transaction completed: Last object in objectStore saved in lastVisit');\n };\n\n transaction3.onerror = function() {\n console.log('Transaction not completed due to error: Next to last object could not be stored in lastVisitMinusOne');\n };\n\n transaction3.oncomplete = function() {\n console.log('Transaction completed: Next to last object in objectStore saved in lastVisitMinusOne');\n\n // At this point the last entry in the database is stored in lastVisit and the next to last in lastVisitMinusOne\n // We only want to store the result of the geolocation in the database,\n // when the last entry is not from today. We want to show the lasVisit,\n // but only if it is not the lastVisit from today. Then we want to show the next to last visit\n\n\n let responsedate = timeFromUnix(response.sys.sunrise);\n\n // Check whether a lastVisit exists, if yes then store it, else compare it to today\n if(!(lastVisit)) {\n console.log('Data from today has been stored in the database, since you never visited before.');\n addData(response);\n } else {\n\n let lastVisitDate = timeFromUnix(lastVisit.sunrise);\n\n if(responsedate.year + responsedate.month + responsedate.date === lastVisitDate.year + lastVisitDate.month + lastVisitDate.date) {\n console.log('Data from today is already in the database. No additional information has been stored!');\n if(lastVisitMinusOne) {\n displayData(count-1);\n }\n } else {\n displayData(count);\n addData(response);\n console.log('Data from today has been stored in the database, since today you did not already visit the site.');\n }\n }\n\n }; // closes the oncomplete of the second transaction: getting the last item in the database\n\n }; // closes the oncomplete of the first transaction: counting the amount of stored items in objectStore\n\n }); // closes the fetch request\n\n}", "title": "" }, { "docid": "1587750a39f77b3f74d01889bc5286ad", "score": "0.6570216", "text": "function success(position) {\n // Obtaining current lat and lon\n var lat = position.coords.latitude;\n var long = position.coords.longitude;\n\n // Creating the API url to get JSON data\n var api = \"https://api.openweathermap.org/data/2.5/\";\n var weather = \"weather?\"\n var apiKey = \"&appid=782baf5721afe320477b796dedba34f7\";\n var units = \"&units=metric\";\n var urlWeather = api + weather + \"lat=\" + lat + \"&lon=\" + long + apiKey + units;\n\n // Show weather data from JSON\n $.getJSON(urlWeather, function(data) {\n $(\".city\").html(\"<p>\" + data.name + \"</p>\");\n $(\".temp\").html(\"<p>\" + data.main.temp + \" &deg;C</p>\");\n $(\".icon\").html(\"<img src='https://openweathermap.org/img/w/\" + data.weather[0].icon + \".png'>\");\n $(\".desc\").html(\"<p>\" + data.weather[0].description);\n\n // Change degrees between Celcius and Fahrenheit on btn click\n $(\".btn\").click(function degreesChange() {\n if ($(\".btn\").text() == \"Fahrenheit\") {\n $(\".btn\").html(\"Celcius\");\n $(\".temp\").html(\"<p>\" + Math.round((data.main.temp * 1.8 + 32) * 100) / 100 + \" &deg;F</p>\");\n } else {\n $(\".btn\").html(\"Fahrenheit\");\n $(\".temp\").html(\"<p>\" + data.main.temp + \" &deg;C</p>\");\n }\n });\n });\n}", "title": "" }, { "docid": "15828dad069442ba1a1521c931066176", "score": "0.6569366", "text": "function success(pos) {\n $(\".fa-spinner\").css(\"display\", \"none\");\n // get longitude and latitude from the position object passed in\n var lng = pos.coords.longitude;\n var lat = pos.coords.latitude;\n var key = \"7d3b03e7f55d602a5179b3cd15d5b9a2/\";\n var url = \"https://crossorigin.me/https://api.darksky.net/forecast/\";\n var units = \"units=ca\";\n var exclude = \"exclude=minutely,hourly,daily,alerts,flags\";\n var fullUrl = url + key + lat + \",\" + lng + \"?\" + units + \"&\" + exclude;\n\n var geocodingAPI =\n \"https://maps.googleapis.com/maps/api/geocode/json?latlng=\" +\n lat +\n \",\" +\n lng +\n \"&key=AIzaSyDEyUQJAGCpJKoJPnC4sgevwc_Wrc6oZXo\";\n\n $.getJSON(geocodingAPI, function(json) {\n if (json.status == \"OK\") {\n //Check result 0\n var result = json.results[0];\n //look for locality tag and administrative_area_level_1\n var city = \"\";\n var state = \"\";\n var country = \"\";\n for (\n var i = 0, len = result.address_components.length;\n i < len;\n i++\n ) {\n var ac = result.address_components[i];\n if (ac.types.indexOf(\"locality\") >= 0) {\n city = ac.long_name;\n }\n if (ac.types.indexOf(\"administrative_area_level_1\") >= 0) {\n state = ac.long_name;\n }\n if (ac.types.indexOf(\"country\") >= 0) {\n country = ac.long_name;\n }\n }\n if (state != \"\") {\n outputResult(\n \"#current-location\",\n city + \", \" + state + \". \" + country + \"!\"\n );\n }\n }\n });\n //Now to perform another AJAX call with DarkSky\n getCurrentWeather(fullUrl);\n } //END of success", "title": "" }, { "docid": "d15ae40ee55d607731a8fb6df82ef761", "score": "0.6565742", "text": "function getForecast(coordinates) {\n let apiKey = \"1a1c85ee290054195972d7e505026c70\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${coordinates.lat}&lon=${coordinates.lon}&appid=${apiKey}&units=imperial`;\n axios.get(apiUrl).then(displayForecast);\n}", "title": "" }, { "docid": "27f6e8af7b0fa7faf1227fb17f36fd48", "score": "0.6550038", "text": "function getWeatherData(position) {\n const headers = new Headers();\n const URL = `https://api.openweathermap.org/data/2.5/forecast/daily?${position}&cnt=7&units=imperial&APPID=${appid}`;\n\n return fetch(URL, {\n method: 'GET',\n headers: headers\n }).then(data => data.json())\n // .then(data=>console.log(data));\n}", "title": "" }, { "docid": "f7c74ae656a38e445ea055cd108facbc", "score": "0.65431666", "text": "function weather(latitude,longitude){\n var url= `https://fcc-weather-api.glitch.me/api/current?lat=${latitude}&lon=${longitude}`;\n $.getJSON(url,function(res) {\n console.log(res);\n updateDOM(res);\n // geoFindMe();\n })\n }", "title": "" }, { "docid": "ece516dfb23df8a4ea63fd2e289e34bf", "score": "0.6526479", "text": "function getForecast(coordinates) {\n let units = \"imperial\";\n let apiKey = \"2c3b195efbedc960ba063392d31bc9bd\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${coordinates.lat}&lon=${coordinates.lon}&units=${units}&appid=${apiKey}`;\n axios.get(apiUrl).then(showForecast);\n}", "title": "" }, { "docid": "377ff0072cbf918c56cedea234180ad7", "score": "0.65169305", "text": "function myWeather(){\n navigator.geolocation.getCurrentPosition(success, error);\n}", "title": "" }, { "docid": "93a08b94cfe51e2c7c0a88df9486194e", "score": "0.65107423", "text": "function getWeather()\n{\n navigator.geolocation.getCurrentPosition(weatherCallback, onError);\n}", "title": "" }, { "docid": "1d64d7c6e6165eea682228d8fbb2eefe", "score": "0.6507559", "text": "function geoFindMe() {\n\n function success(position) {\n const lat = position.coords.latitude;\n const long = position.coords.longitude;\n\n fetch(`https://api.openweathermap.org/data/2.5/find?lat=${lat}&lon=${long}&cnt=1&units=imperial&appid=829ea0216deb875e615d6f69f6226188`)\n .then((response) => {\n console.log(response)\n return response.json()\n })\n .then((weather) => {\n console.log(weather)\n weather = weather.list[0]\n displayCurrentWeather(weather)\n })\n }\n\n function error() {\n console.log('Location is not available.')\n }\n\n if (!navigator.geolocation) {\n console.log('Location is not supported by your browser.')\n } else {\n navigator.geolocation.getCurrentPosition(success, error);\n }\n\n}", "title": "" }, { "docid": "fadb21ba4600d759bbc146f694963420", "score": "0.6490057", "text": "function weatherApiCall(agent){\n // Get the city and date from the request\n var city = agent.parameters['geo-city']; // city is a required parameter\n console.log('city: ' + city);\n // Get the date for the weather forecast (if present)\n var date = '';\n if (agent.parameters.date) {\n date = agent.parameters.date;\n console.log('Date: ' + date);\n }\n return callWeatherApi(city, date).then((output) => {\n agent.add(output); //message\n }).catch(() => {\n agent.add('Sorry, I cannot give you information about the weather');\n });\n }", "title": "" }, { "docid": "539b5c5a06b7732623feca6ee3670eef", "score": "0.6478945", "text": "function getWeather(darkSkyKey, coordinates) {\n $.ajax('https://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/' + darkSkyKey + '/' + coordinates.lat + ',' + coordinates.lng)\n .done(function (data) {\n console.log(data);\n renderTodayWX(data);\n renderTommorrowWX(data);\n renderRestOfWkWX(data);\n });\n}", "title": "" }, { "docid": "26f26abd686d9dae7a7f475a659cdc55", "score": "0.6478485", "text": "function getWeather(latitude,longitude) {\n\n\t//\tDarksky API KEY. Once the daily max is reached it will stop returning data.\n\t//\tRegister for an API Key by creating an account at https://developer.forecast.io/register\n\tvar apikey = \"[REPLACE WITH DARK SKY API KEY]\";\n\n\tvar input = {\n\t method : 'get',\n\t returnedContentType : 'json',\n\t path : \"forecast/\" + apikey + \"/\" + latitude + \",\" + longitude\n\t};\n\n\treturn MFP.Server.invokeHttp(input);\n}", "title": "" }, { "docid": "d66c0855c274291c87ea832d359f7917", "score": "0.6472821", "text": "function getForecast(weatherData) {\n let callType = \"onecall\"\n let params = {lat: weatherData.coord.lat, lon: weatherData.coord.lon, appid: apiKey};\n let weatherUrl = buildUrl(callType,params);\n $.ajax({\n url: weatherUrl,\n method: \"GET\"\n }).then(setForecast);\n}", "title": "" }, { "docid": "27bf6b3ba3b7df7c4e5c6d7d4de3eec1", "score": "0.6458038", "text": "function showCoords(response) {\n console.log(response.data.coord);\n let searchInput = document.querySelector(\"#search-text-input\");\n let cityLat = response.data.coord.lat;\n let cityLon = response.data.coord.lon;\n let apiUrlCityToday = `weather?q=`;\n axios\n .get(\n `${apiUrl}${apiUrlCityToday}${searchInput.value}&units=${units}&appid=${apiKey}`\n )\n .then(showWeather); \nlet apiUrlCoordsForecast = `onecall?`;\n axios\n .get(\n `${apiUrl}${apiUrlCoordsForecast}lat=${cityLat}&lon=${cityLon}&units=${units}&exclude=hourly,minutely&appid=${apiKey}`\n ).then(showForecast); \n}", "title": "" }, { "docid": "d8da8df206bba6c031946c526da61882", "score": "0.6454322", "text": "function getWeather() {\n\tif (searchBox.getPlaces().length > 0)\n\t{\n\t\tvar loc = searchBox.getPlaces().pop();\n\t\tvar latLon = loc.geometry.location.lat() + \",\" + loc.geometry.location.lng();\n\t\tgetCity(latLon);\n\t\tgetForecast(latLon);\n\t}\n\telse {\n\t\talert(\"Could not retrieve location. Please enter a new location\");\n\t}\n}", "title": "" }, { "docid": "62f1c2f6d5ffb9a226bdba2dcd26f961", "score": "0.64451635", "text": "function success(position) {\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n getAddress(lon, lat);\n getWeather(lon, lat);\n }", "title": "" }, { "docid": "dbbf1d3d33b2f0bcc727456e2f584644", "score": "0.6429189", "text": "function onSuccess(position)\n\t\t\t{\n\t\t\t\tArea = position.coords.latitude.toString() + \",\" + position.coords.longitude\n\t\t\t\t\t.toString();\n\t\t\t\tQuery = 'http://api.apixu.com/v1/forecast.json?key=' + apixuKey + '&q=' +\n\t\t\t\t\tArea + '&days=7&lang=nl';\n\t\t\t\tsendJson(Query);\n\t\t\t}", "title": "" }, { "docid": "04f7ad4c8e5402777d3505e0306c9e0e", "score": "0.6423286", "text": "function Weather(city) {\n $.ajax({\n url: 'https://api.openweathermap.org/data/2.5/weather?q=' + city + \"&units=imperial\" +\n \"&APPID=b5ffc1b446f183868b291ba8f08a28ae\",\n method: \"GET\",\n dataType: \"json\",\n success: function(data) {\n console.log(data);\n let widget = show(data);\n $(\"#show\").html(widget);\n $(\"#city\").val('');\n\n\n FiveDaysForecast(data.coord.lat, data.coord.lon);\n uvishow(data.coord.lat, data.coord.lon);\n\n }\n });\n\n\n }", "title": "" }, { "docid": "6520b10e1274dbed6b5805086b4845c3", "score": "0.641535", "text": "function geoLocationSuccess(position) {\n\t\tvar lat = position.coords.latitude;\n\t var lon = position.coords.longitude;\n\t var url = \"https://api.metwit.com/v2/weather/?location_lat=\" + lat + \"&location_lng=\" + lon;\n\n\t $.getJSON(url, function( result ) {\t \t\t\n\t\t\thero.geo._data = result.objects[1]; \t\t \t\t\n \t})\n \t.fail(function(){\n \t\thero.geo._data = null; \t\t\n \t\t\n \t\thero.log('Unable to retrieve GeoLocation Data'); \t\t \t\t\n \t})\n\t}", "title": "" }, { "docid": "63b57524365391fae9c5c3b013a25d05", "score": "0.6414733", "text": "function showPosition (position) {\n\tvar lat = Math.round(position.coords.latitude, 10);\n\tvar lon = Math.round(position.coords.longitude, 10);\n\tgetLocationWeather(lat, lon);\n}", "title": "" }, { "docid": "ea84bbf1f1e7dc9599f421d7382ac06a", "score": "0.6411304", "text": "function geoSuccess(position) {\n\n var latitude = position.coords.latitude;\n var longitude = position.coords.longitude;\n\n var lat = 'lat=' + latitude.toFixed(2);\n var lon = '&lon=' + longitude.toFixed(2);\n\n //add current cities json info to html\n $.getJSON(getAPIKeyWithCurrentLocation() ,function(weather){\n $('.loader').hide();\n $('.tempButtons').show();\n\n // City Temp\n var cityTemp = JSON.stringify(weather.main.temp);\n cityTemp = Math.floor(cityTemp);\n $('#temp').text(cityTemp);\n\n // City Name\n $('#location').text(removeQuotes(JSON.stringify(weather.name)));\n\n // Weather Description\n var weatherDescription = removeQuotes(JSON.stringify(weather.weather[0].description));\n $('#weatherDescription').text(titleCase(weatherDescription));\n\n // Wind Speed\n var windSpeed = JSON.stringify(weather.wind.speed);\n $('#wind').text(Math.floor(windSpeed));\n\n // Humidity\n var humidity = JSON.stringify(weather.main.humidity);\n $('#humidity').text(humidity);\n\n // Weather Icons\n var weatherIcons = weather.weather[0].icon;\n\n $celsius.click(function() {\n addCelsiusTemp(cityTemp);\n });\n\n $fahrenheit.click(function() {\n addFahrenTemp(cityTemp);\n });\n\n displayWeatherIcon(weatherIcons);\n\n });\n\n function displayWeatherIcon(weatherIcons) {\n switch (weatherIcons) {\n //Clear Sky\n case \"01d\":\n case \"01n\":\n $icons.append(sunnyIcon);\n break;\n //Few Clouds\n case \"02d\":\n case \"02n\":\n $icons.append(cloudyIcon);\n break;\n //Scattered clouds\n case \"03d\":\n case \"03n\":\n $icons.append(cloudyIcon);\n break;\n //Broken clouds\n case \"04d\":\n case \"04n\":\n $icons.append(cloudyIcon);\n break;\n //Shower rain\n case \"09d\":\n case \"09n\":\n $icons.append(sunShowerIcon);\n break;\n //Rain\n case \"10d\":\n case \"10n\":\n $icons.append(rainyIcon);\n break;\n //ThunderStom\n case \"11d\":\n case \"11n\":\n $icons.append(thunderStormIcon);\n break;\n //Snow\n case \"13d\":\n case \"13n\":\n $icons.append(snowFlurriesIcon);\n break;\n //Mist\n case \"50d\":\n case \"50n\":\n $icons.append(rainyIcon);\n break;\n default:\n $icons.append(sunnyIcon);\n break;\n }\n }\n\n function getAPIKeyWithCurrentLocation() {\n var apiUrl = \"https://api.openweathermap.org/data/2.5/weather?\";\n var units = \"&units=imperial\";\n var apiKey = \"&APPID=98ee2d73f7eef59301620cf461192eb7\";\n var latLon = lat + lon;\n aipUrl = apiUrl + latLon + units + apiKey;\n\n return aipUrl;\n }\n\n function addCelsiusTemp(cityTempRounded) {\n $('#temp').text(convertFahrenToCelsius(cityTempRounded));\n $celsius.addClass('tempActive');\n $fahrenheit.removeClass('tempActive');\n }\n\n function convertFahrenToCelsius(tempInFaren) {\n return Math.floor((tempInFaren-32) * (5/9));\n }\n\n function addFahrenTemp(cityTempRounded) {\n $('#temp').text(cityTempRounded);\n $fahrenheit.addClass('tempActive');\n $celsius.removeClass('tempActive');\n }\n\n function titleCase(str) {\n str = str.split(' ');\n var length = str.length;\n for (var i = 0; i < length; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substring(1);\n }\n return str.join(' ');\n }\n\n function removeQuotes(str) {\n return str.replace(/\\\"/g, \"\");\n }\n }", "title": "" }, { "docid": "2a34ac45d16bb63259be82978d0ec52a", "score": "0.640454", "text": "function predeterminedCurrentCall(location) {\n $.ajax({\n url: \"https://api.openweathermap.org/data/2.5/weather?q=\" + location + \"&units=imperial&appid=715ee435d9e6cc809bc1cb6b62581405\",\n method: \"GET\"\n }).then(function (response) {\n $(\"#cityName h2\").html(response.name);\n $(\"#currentForecast .card-text:first\").append(\"<span> Time: </span>\" + response.dt + \" UTC (Unix time) <img src='https://openweathermap.org/img/wn/\" + response.weather[0].icon + \"@2x.png'><br>\");\n $(\"#currentForecast .card-text:first\").append(\"<span> Temperature: </span>\" + response.main.temp + \"&#8457<br>\");\n $(\"#currentForecast .card-text:first\").append(\"<span> Temp feels like: </span>\" + response.main.feels_like + \"&#8457<br>\");\n $(\"#currentForecast .card-text:first\").append(\"<span> Humidity: </span>\" + response.main.humidity + \"&#37;<br>\");\n $(\"#currentForecast .card-text:first\").append(\"<span> Weather Condition: </span>\" + response.weather[0].main + \", \" + response.weather[0].description + \"<br>\");\n $(\"#currentForecast .card-text:first\").append(\"<span> Windspead & Direction: </span>\" + response.wind.speed + \" mph\" + \" at \" + response.wind.deg + \"&deg;<br>\");\n //using the current weather response to get lat and lon, inorder to get UV index response\n var queryURL2 = \"https://api.openweathermap.org/data/2.5/uvi?lat=\" + response.coord.lat + \"&lon=\" + response.coord.lon + \"&appid=715ee435d9e6cc809bc1cb6b62581405\";\n $.ajax({\n url: queryURL2,\n method: \"GET\"\n }).then(function (response) {\n $(\"#currentForecast .card-text:first\").append(\"<span> UV Index: </span> <span class='uvIndex'>\" + response.value + \"</span> <br>\");\n if (response.value < 3) {\n $(\".uvIndex\").css(\"background-color\", \"green\");\n }\n if (response.value >= 3 && response.value < 6) {\n $(\".uvIndex\").css(\"background-color\", \"yellow\");\n }\n if (response.value >= 6) {\n $(\".uvIndex\").css(\"background-color\", \"red\");\n }\n //closes ajax.then call\n });\n //closes parent ajax.then call \n });\n //closes predeterminedCurrentCall function\n }", "title": "" }, { "docid": "f780677e5e9636102ece05854077e469", "score": "0.639738", "text": "function getCurrentWeather() {\n \n var queryURL = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=imperial&appid=${APIKey}`\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n\n var currentWeatherResponse = response;\n\n lat = response.coord.lat;\n lon = response.coord.lon;\n\n queryURL = `https://api.openweathermap.org/data/2.5/uvi?lat=${lat}&lon=${lon}&appid=${APIKey}`;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n var currentUV = response;\n\n displayCurrentWeather(currentWeatherResponse, currentUV);\n });\n });\n}", "title": "" }, { "docid": "17c75da45a5a8adb4d3d2a2387f1de78", "score": "0.6394696", "text": "function weatherInfo(){\n navigator.geolocation.getCurrentPosition(showCond, onError);\n \n}", "title": "" }, { "docid": "47e4cbbb1c66dc1dd88d4cacc4aa081d", "score": "0.63946235", "text": "function getWeather(location) {\n let { lat } = location;\n let { lon } = location;\n let city = location.name;\n let apiUrl = `${weatherApiUrl}/data/2.5/onecall?lat=${lat}&lon=${lon}&units=imperial&exclude=minutely,hourly&appid=${apiKey}`;\n \n fetch(apiUrl)\n .then(function (res) {\n return res.json();\n })\n .then(function (data) {\n renderItems(city, data);\n })\n .catch(function (err) {\n console.error(err);\n });\n}", "title": "" }, { "docid": "94a0117d24d1c3ddfe9fdc9c492755cb", "score": "0.63905984", "text": "function getWeatherLocation() {\n navigator.geolocation.getCurrentPosition(onWeatherSuccess, onWeatherError, { enableHighAccuracy: true });\n}", "title": "" }, { "docid": "9c538151087e8a900d254e4a013e72b5", "score": "0.63692886", "text": "getLocation() {\n navigator.geolocation.getCurrentPosition(\n (posData) => fetchWeather(posData.coords.latitude,posData.coords.longitude)\n .then(res => this.setState({\n temp: Math.round(res.temp),\n weather: res.weather\n })), \n (error) => alert(error) ,\n {timeout:10000}\n )\n }", "title": "" }, { "docid": "3efa69261f33528244f7d7884d4e15d6", "score": "0.6368085", "text": "function getForecastWeather(coord, settings) {\n let config = {\n method: 'get',\n url:\n API_CONFIG.url +\n 'onecall?lat=' +\n coord.lat +\n '&lon=' +\n coord.lon +\n '&exclude=current' +\n '&appid=' +\n API_CONFIG.key +\n '&units=' +\n settings.units,\n headers: {},\n };\n return axios(config);\n}", "title": "" }, { "docid": "75ec42d429bbc55ffbec3d48bbd875dd", "score": "0.6367039", "text": "function getOneCall(name, icon, lat, lon) {\n\n $.ajax({\n url: 'https://api.openweathermap.org/data/2.5/onecall?lat=' + lat + '&lon=' + lon + '&exclude=minutely,hourly,alerts&units=imperial&appid=14a17e4b1eca2f426f4a1fdcd85e2f0f'\n }).then(function (data) {\n\n let city = name\n let weatherIcon = icon\n let temp = data.current.temp\n let wind = data.current.wind_speed\n let humidity = data.current.humidity\n let uvi = data.current.uvi\n displayDaily(city, weatherIcon, temp, wind, humidity, uvi)\n displayWeekly(data)\n\n })\n}", "title": "" }, { "docid": "83fa73de5e9b48bd74e0bec2052a9d5e", "score": "0.6359107", "text": "function fetchCoordinates(city) {\n const COORD_API_URL = 'https://api.openweathermap.org/geo/1.0/direct?q=' + city + '&limit=5&appid=' + api_key;\n\n fetch(COORD_API_URL)\n .then(\n function(response) {\n response.json().then(function(data) {\n var lat = data[0].lat;\n var lon = data[0].lon;\n\n fetchCurrentForecast(lat, lon, city);\n });\n }\n )\n .catch(function (err) {\n alert('Not able to find city!');\n return;\n })\n}", "title": "" }, { "docid": "2106bca009c939f2945bfecef6ad8983", "score": "0.63548857", "text": "function showLocation(position) {\n var geoLatitude = position.coords.latitude;\n var geoLongitude = position.coords.longitude;\n // alert(\"Latitude : \" + geoLatitude + \" Longitude: \" + geoLongitude);\n\n /* localStorage.setItem('geoLatitude', geoLatitude.toString());\n localStorage.setItem('geoLongitude', geoLongitude.toString());*/\n console.log(geoLatitude.toString(),geoLongitude.toString());\n\n callOpenWeatherAPI(geoLatitude.toString(),geoLongitude.toString());\n callAPIByCityName(\"Ghent\");\n}", "title": "" } ]
3f26981524367ce7b4d32d3ea08fb2f4
R is 4x4 padded rotation, scale is 3D vector, target/return is 3x3 normal transform. if scale components are 0, /shrug guess they're 1 now. You call it lazy, I call it robust ;)
[ { "docid": "cf70a53bfad8d92c5db47f28cf9c0a06", "score": "0.6913714", "text": "static normal(R, scale, target=null)\n\t{\n\t\tconst x = (scale.x == 0 ? 1 : 1/scale.x);\n\t\tconst y = (scale.y == 0 ? 1 : 1/scale.y);\n\t\tconst z = (scale.z == 0 ? 1 : 1/scale.z);\n\t\tif (target === null)\n\t\t{\n\t\t\treturn new Float32Array([\n\t\t\t\tR[0]*x, R[1]*x, R[2]*x,\n\t\t\t\tR[4]*y, R[5]*y, R[6]*y,\n\t\t\t\tR[8]*z, R[9]*z, R[10]*z\n\t\t\t]);\n\t\t}\n\n\t\ttarget[0] = R[0]*x;\n\t\ttarget[1] = R[1]*x;\n\t\ttarget[2] = R[2]*x;\n\t\ttarget[3] = R[4]*y;\n\t\ttarget[4] = R[5]*y;\n\t\ttarget[5] = R[6]*y;\n\t\ttarget[6] = R[8]*z;\n\t\ttarget[7] = R[9]*z;\n\t\ttarget[8] = R[10]*z;\n\t\treturn target;\n\t}", "title": "" } ]
[ { "docid": "3eadd7fe0e931335c524a8113f572239", "score": "0.65448374", "text": "decompose(scale, rotation, translation) {\n if (this._isIdentity) {\n if (translation) {\n translation.setAll(0);\n }\n if (scale) {\n scale.setAll(1);\n }\n if (rotation) {\n rotation.copyFromFloats(0, 0, 0, 1);\n }\n return true;\n }\n const m = this._m;\n if (translation) {\n translation.copyFromFloats(m[12], m[13], m[14]);\n }\n const usedScale = scale || preallocatedVariables_1$3.MathTmp.Vector3[0];\n usedScale.x = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);\n usedScale.y = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]);\n usedScale.z = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]);\n if (this.determinant() <= 0) {\n usedScale.y *= -1;\n }\n if (usedScale.x === 0 || usedScale.y === 0 || usedScale.z === 0) {\n if (rotation) {\n rotation.copyFromFloats(0.0, 0.0, 0.0, 1.0);\n }\n return false;\n }\n if (rotation) {\n // tslint:disable-next-line:one-variable-per-declaration\n const sx = 1 / usedScale.x, sy = 1 / usedScale.y, sz = 1 / usedScale.z;\n Matrix.FromValuesToRef(m[0] * sx, m[1] * sx, m[2] * sx, 0.0, m[4] * sy, m[5] * sy, m[6] * sy, 0.0, m[8] * sz, m[9] * sz, m[10] * sz, 0.0, 0.0, 0.0, 0.0, 1.0, preallocatedVariables_1$3.MathTmp.Matrix[0]);\n Quaternion_1$2.Quaternion.FromRotationMatrixToRef(preallocatedVariables_1$3.MathTmp.Matrix[0], rotation);\n }\n return true;\n }", "title": "" }, { "docid": "b561432fb996ad32c03a4b979456ad9f", "score": "0.63992655", "text": "scale(scale) {\n return new Vector4(this.x * scale, this.y * scale, this.z * scale, this.w * scale);\n }", "title": "" }, { "docid": "4223a0e884d87cfc262c56df51fa8ef9", "score": "0.6371847", "text": "scale(scale) {\n return new Vector4(this.x * scale, this.y * scale, this.z * scale, this.w * scale);\n }", "title": "" }, { "docid": "fac08fec6b00461e9b2ff09337b96f5c", "score": "0.618859", "text": "composeFromOrigin(translation, quaternion, scale, origin) {\n let matrix = this.elements;\n\n // Quaternion math\n const x = quaternion.elements[0], y = quaternion.elements[1], z = quaternion.elements[2], w = quaternion.elements[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n const sx = scale.x;\n const sy = scale.y;\n const sz = scale.z; // scale along Z is always equal to 1 anyway\n\n const ox = origin.x;\n const oy = origin.y;\n const oz = origin.z;\n\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n\n matrix[0] = out0;\n matrix[1] = out1;\n matrix[2] = out2;\n matrix[3] = 0;\n matrix[4] = out4;\n matrix[5] = out5;\n matrix[6] = out6;\n matrix[7] = 0;\n matrix[8] = out8;\n matrix[9] = out9;\n matrix[10] = out10;\n matrix[11] = 0;\n matrix[12] = translation.x + ox - (out0 * ox + out4 * oy + out8 * oz);\n matrix[13] = translation.y + oy - (out1 * ox + out5 * oy + out9 * oz);\n matrix[14] = translation.z + oz - (out2 * ox + out6 * oy + out10 * oz);\n matrix[15] = 1;\n\n return this;\n }", "title": "" }, { "docid": "c18daa8e019369ad44431c80d7f6a630", "score": "0.6101324", "text": "compose(translation, quaternion, scale) {\n let matrix = this.elements;\n\n // Quaternion math\n const x = quaternion.elements[0], y = quaternion.elements[1], z = quaternion.elements[2], w = quaternion.elements[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = scale.x;\n const sy = scale.y;\n const sz = scale.z;\n\n matrix[0] = (1 - (yy + zz)) * sx;\n matrix[1] = (xy + wz) * sx;\n matrix[2] = (xz - wy) * sx;\n matrix[3] = 0;\n matrix[4] = (xy - wz) * sy;\n matrix[5] = (1 - (xx + zz)) * sy;\n matrix[6] = (yz + wx) * sy;\n matrix[7] = 0;\n matrix[8] = (xz + wy) * sz;\n matrix[9] = (yz - wx) * sz;\n matrix[10] = (1 - (xx + yy)) * sz;\n matrix[11] = 0;\n matrix[12] = translation.x;\n matrix[13] = translation.y;\n matrix[14] = translation.z;\n matrix[15] = 1;\n\n return this;\n }", "title": "" }, { "docid": "7260a8c30960af14e96fe2b03f84a5ed", "score": "0.6045604", "text": "scale(scale) {\n return new Vector3(this.x * scale, this.y * scale, this.z * scale);\n }", "title": "" }, { "docid": "d45df311b2955cc9438141b6ea9510aa", "score": "0.5999725", "text": "setRotationScale(scale_rotation){\n this.scale_rotation = scale_rotation;\n }", "title": "" }, { "docid": "30f20862281b453c678a25f0503fa6e6", "score": "0.58968604", "text": "static ComposeToRef(scale, rotation, translation, result) {\n Matrix.ScalingToRef(scale.x, scale.y, scale.z, preallocatedVariables_1$3.MathTmp.Matrix[1]);\n rotation.toRotationMatrix(preallocatedVariables_1$3.MathTmp.Matrix[0]);\n preallocatedVariables_1$3.MathTmp.Matrix[1].multiplyToRef(preallocatedVariables_1$3.MathTmp.Matrix[0], result);\n result.setTranslation(translation);\n }", "title": "" }, { "docid": "d90edcb7f9b1cfebe74396cc205c5447", "score": "0.58378446", "text": "_calculateTransform () {\n const modelMatrix = this._uniforms.u_modelMatrix;\n\n twgl.m4.identity(modelMatrix);\n twgl.m4.translate(modelMatrix, this._position, modelMatrix);\n\n const rotation = (270 - this._direction) * Math.PI / 180;\n twgl.m4.rotateZ(modelMatrix, rotation, modelMatrix);\n\n // Adjust rotation center relative to the skin.\n let rotationAdjusted = twgl.v3.subtract(this.skin.rotationCenter, twgl.v3.divScalar(this.skin.size, 2));\n rotationAdjusted = twgl.v3.multiply(rotationAdjusted, this.scale);\n rotationAdjusted = twgl.v3.divScalar(rotationAdjusted, 100);\n rotationAdjusted[1] *= -1; // Y flipped to Scratch coordinate.\n rotationAdjusted[2] = 0; // Z coordinate is 0.\n\n twgl.m4.translate(modelMatrix, rotationAdjusted, modelMatrix);\n\n const scaledSize = twgl.v3.divScalar(twgl.v3.multiply(this.skin.size, this._scale), 100);\n scaledSize[2] = 0; // was NaN because the vectors have only 2 components.\n twgl.m4.scale(modelMatrix, scaledSize, modelMatrix);\n\n this._transformDirty = false;\n }", "title": "" }, { "docid": "3d507c417067004f658786b817b97ef0", "score": "0.5834928", "text": "scaleToRef(scale, result) {\n return result.copyFromFloats(this.x * scale, this.y * scale, this.z * scale);\n }", "title": "" }, { "docid": "4d53a6c2d187dd68ce579db25a982bcc", "score": "0.58280605", "text": "scale(scale) {\n return new Color4(this.r * scale, this.g * scale, this.b * scale, this.a * scale);\n }", "title": "" }, { "docid": "83be9f96f9451147bea4967a460ee940", "score": "0.5817908", "text": "_calculateTransform() {\n if (this._rotationTransformDirty) {\n const rotation = (270 - this._direction) * Math.PI / 180; // Calling rotationZ sets the destination matrix to a rotation\n // around the Z axis setting matrix components 0, 1, 4 and 5 with\n // cosine and sine values of the rotation.\n // twgl.m4.rotationZ(rotation, this._rotationMatrix);\n // twgl assumes the last value set to the matrix was anything.\n // Drawable knows, it was another rotationZ matrix, so we can skip\n // assigning the values that will never change.\n\n const c = Math.cos(rotation);\n const s = Math.sin(rotation);\n this._rotationMatrix[0] = c;\n this._rotationMatrix[1] = s; // this._rotationMatrix[2] = 0;\n // this._rotationMatrix[3] = 0;\n\n this._rotationMatrix[4] = -s;\n this._rotationMatrix[5] = c; // this._rotationMatrix[6] = 0;\n // this._rotationMatrix[7] = 0;\n // this._rotationMatrix[8] = 0;\n // this._rotationMatrix[9] = 0;\n // this._rotationMatrix[10] = 1;\n // this._rotationMatrix[11] = 0;\n // this._rotationMatrix[12] = 0;\n // this._rotationMatrix[13] = 0;\n // this._rotationMatrix[14] = 0;\n // this._rotationMatrix[15] = 1;\n\n this._rotationTransformDirty = false;\n } // Adjust rotation center relative to the skin.\n\n\n if (this._rotationCenterDirty && this.skin !== null) {\n // twgl version of the following in function work.\n // let rotationAdjusted = twgl.v3.subtract(\n // this.skin.rotationCenter,\n // twgl.v3.divScalar(this.skin.size, 2, this._rotationAdjusted),\n // this._rotationAdjusted\n // );\n // rotationAdjusted = twgl.v3.multiply(\n // rotationAdjusted, this._scale, rotationAdjusted\n // );\n // rotationAdjusted = twgl.v3.divScalar(\n // rotationAdjusted, 100, rotationAdjusted\n // );\n // rotationAdjusted[1] *= -1; // Y flipped to Scratch coordinate.\n // rotationAdjusted[2] = 0; // Z coordinate is 0.\n // Locally assign rotationCenter and skinSize to keep from having\n // the Skin getter properties called twice while locally assigning\n // their components for readability.\n const rotationCenter = this.skin.rotationCenter;\n const skinSize = this.skin.size;\n const center0 = rotationCenter[0];\n const center1 = rotationCenter[1];\n const skinSize0 = skinSize[0];\n const skinSize1 = skinSize[1];\n const scale0 = this._scale[0];\n const scale1 = this._scale[1];\n const rotationAdjusted = this._rotationAdjusted;\n rotationAdjusted[0] = (center0 - skinSize0 / 2) * scale0 / 100;\n rotationAdjusted[1] = (center1 - skinSize1 / 2) * scale1 / 100 * -1; // rotationAdjusted[2] = 0;\n\n this._rotationCenterDirty = false;\n }\n\n if (this._skinScaleDirty && this.skin !== null) {\n // twgl version of the following in function work.\n // const scaledSize = twgl.v3.divScalar(\n // twgl.v3.multiply(this.skin.size, this._scale),\n // 100\n // );\n // // was NaN because the vectors have only 2 components.\n // scaledSize[2] = 0;\n // Locally assign skinSize to keep from having the Skin getter\n // properties called twice.\n const skinSize = this.skin.size;\n const scaledSize = this._skinScale;\n scaledSize[0] = skinSize[0] * this._scale[0] / 100;\n scaledSize[1] = skinSize[1] * this._scale[1] / 100; // scaledSize[2] = 0;\n\n this._skinScaleDirty = false;\n }\n\n const modelMatrix = this._uniforms.u_modelMatrix; // twgl version of the following in function work.\n // twgl.m4.identity(modelMatrix);\n // twgl.m4.translate(modelMatrix, this._position, modelMatrix);\n // twgl.m4.multiply(modelMatrix, this._rotationMatrix, modelMatrix);\n // twgl.m4.translate(modelMatrix, this._rotationAdjusted, modelMatrix);\n // twgl.m4.scale(modelMatrix, scaledSize, modelMatrix);\n // Drawable configures a 3D matrix for drawing in WebGL, but most values\n // will never be set because the inputs are on the X and Y position axis\n // and the Z rotation axis. Drawable can bring the work inside\n // _calculateTransform and greatly reduce the ammount of math and array\n // assignments needed.\n\n const scale0 = this._skinScale[0];\n const scale1 = this._skinScale[1];\n const rotation00 = this._rotationMatrix[0];\n const rotation01 = this._rotationMatrix[1];\n const rotation10 = this._rotationMatrix[4];\n const rotation11 = this._rotationMatrix[5];\n const adjusted0 = this._rotationAdjusted[0];\n const adjusted1 = this._rotationAdjusted[1];\n const position0 = this._position[0];\n const position1 = this._position[1]; // Commented assignments show what the values are when the matrix was\n // instantiated. Those values will never change so they do not need to\n // be reassigned.\n\n modelMatrix[0] = scale0 * rotation00;\n modelMatrix[1] = scale0 * rotation01; // modelMatrix[2] = 0;\n // modelMatrix[3] = 0;\n\n modelMatrix[4] = scale1 * rotation10;\n modelMatrix[5] = scale1 * rotation11; // modelMatrix[6] = 0;\n // modelMatrix[7] = 0;\n // modelMatrix[8] = 0;\n // modelMatrix[9] = 0;\n // modelMatrix[10] = 1;\n // modelMatrix[11] = 0;\n\n modelMatrix[12] = rotation00 * adjusted0 + rotation10 * adjusted1 + position0;\n modelMatrix[13] = rotation01 * adjusted0 + rotation11 * adjusted1 + position1; // modelMatrix[14] = 0;\n // modelMatrix[15] = 1;\n\n this._transformDirty = false;\n }", "title": "" }, { "docid": "4f14769b3fea938dff490af96a5df114", "score": "0.5816175", "text": "transform ( translationVector, theta, axis, scalingVector ) {\n \n modelViewMatrix = mat4.create();\n mat4.lookAt( modelViewMatrix, eye, at, up );\n\n var ctm = mat4.create();\n var q = quat.create();\n \n if ( axis === \"X\" ) {\n mat4.fromRotationTranslationScale( ctm, quat.rotateX( q, q, theta ), translationVector, scalingVector );\n } else if ( axis === \"Y\" ) {\n mat4.fromRotationTranslationScale( ctm, quat.rotateY( q, q, theta ), translationVector, scalingVector );\n } else if ( axis === \"Z\" ) {\n mat4.fromRotationTranslationScale( ctm, quat.rotateZ( q, q, theta ), translationVector, scalingVector );\n } else {\n throw Error( \"Axis isn't specified correctly.\" );\n }\n \n // calculates and sends the modelViewMatrix\n mat4.mul( modelViewMatrix, modelViewMatrix, ctm );\n this.gl.uniformMatrix4fv( modelViewLoc, false, modelViewMatrix );\n\n // calculates and sends the normalMatrix using modelViewMatrix\n normalMatrix = mat3.create();\n mat3.normalFromMat4( normalMatrix, modelViewMatrix );\n this.gl.uniformMatrix3fv( normalMatrixLoc, false, normalMatrix );\n\n }", "title": "" }, { "docid": "62467ef0c3fd45f3dcd98b6416d4e381", "score": "0.58012486", "text": "scale(scale) {\n const result = new Vector2(0, 0);\n this.scaleToRef(scale, result);\n return result;\n }", "title": "" }, { "docid": "6931fa6dcfb40ace1e40841d94ce018a", "score": "0.5789872", "text": "scale(scale) {\n const result = new Matrix();\n this.scaleToRef(scale, result);\n return result;\n }", "title": "" }, { "docid": "39b81762d69db144d3c83b0d02f7e954", "score": "0.57680917", "text": "function scale4(a, b, c) {\r\n var result = mat4();\r\n result[0][0] = a;\r\n result[1][1] = b;\r\n result[2][2] = c;\r\n return result;\r\n}", "title": "" }, { "docid": "67c83de6801a5656cdc3fe7070fd5d06", "score": "0.5764861", "text": "static Compose(scale, rotation, translation) {\n const result = new Matrix();\n Matrix.ComposeToRef(scale, rotation, translation, result);\n return result;\n }", "title": "" }, { "docid": "f7a4a1e6bdc6a3e79f4ed1c86bfb2f6a", "score": "0.57637364", "text": "static SCALE(_vector, _scaling) {\n let scaled = FudgeCore.Recycler.get(Vector3);\n scaled.set(_vector.x * _scaling, _vector.y * _scaling, _vector.z * _scaling);\n return scaled;\n }", "title": "" }, { "docid": "105f9865f7f22c65d46ca857a672c9a7", "score": "0.5756411", "text": "scale(scale) {\n return new Color3(this.r * scale, this.g * scale, this.b * scale);\n }", "title": "" }, { "docid": "0b5fd1ea6cd4647bc73c78ff3bfb5f8a", "score": "0.5730721", "text": "function scale4(a, b, c) {\n var result = mat4();\n result[0][0] = a;\n result[1][1] = b;\n result[2][2] = c;\n return result;\n }", "title": "" }, { "docid": "0b5fd1ea6cd4647bc73c78ff3bfb5f8a", "score": "0.5730721", "text": "function scale4(a, b, c) {\n var result = mat4();\n result[0][0] = a;\n result[1][1] = b;\n result[2][2] = c;\n return result;\n }", "title": "" }, { "docid": "9ed63c9451c6972cd9b60ba4e5bf15e9", "score": "0.5725237", "text": "function Matrix4() {\n this.m = [ [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]];\n\n this.Set3V = function(v1,v2,v3) {\n this.m[0][0] = v1.v[0];\n this.m[0][1] = v1.v[1];\n this.m[0][2] = v1.v[2];\n\n this.m[1][0] = v2.v[0];\n this.m[1][1] = v2.v[1];\n this.m[1][2] = v2.v[2];\n\n this.m[2][0] = v3.v[0];\n this.m[2][1] = v3.v[1];\n this.m[2][2] = v3.v[2];\n return this;\n }\n\n this.Translate = function (x, y, z) {\n var t = [ [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [x, y, z, 1]];\n return this.Multiply(t);\n }\n\n this.Scale = function (x, y, z) {\n var s = [ [x, 0, 0, 0],\n [0, y, 0, 0],\n [0, 0, z, 0],\n [0, 0, 0, 1]];\n return this.Multiply(s);\n }\n\n this.Rotate = function (axis, angle) {\n var s = Math.sin(angle);\n var c0 = Math.cos(angle);\n var c1 = 1 - c0;\n\n // assume normalised input vector\n var u = axis[0];\n var v = axis[1];\n var w = axis[2];\n\n var r = [\n [(u * u * c1) + c0, (u * v * c1) + (w * s), (u * w * c1) - (v * s), 0],\n [(u * v * c1) - (w * s), (v * v * c1) + c0, (v * w * c1) + (u * s), 0],\n [(u * w * c1) + (v * s), (v * w * c1) - (u * s), (w * w * c1) + c0, 0],\n [0, 0, 0, 1]\n ];\n\n return this.Multiply(r);\n }\n\n this.Multiply = function (b) {\n var dst = [\n [ ((this.m[0][0] * b[0][0]) + (this.m[0][1] * b[1][0]) + (this.m[0][2] * b[2][0]) + (this.m[0][3] * b[3][0])),\n ((this.m[0][0] * b[0][1]) + (this.m[0][1] * b[1][1]) + (this.m[0][2] * b[2][1]) + (this.m[0][3] * b[3][1])),\n ((this.m[0][0] * b[0][2]) + (this.m[0][1] * b[1][2]) + (this.m[0][2] * b[2][2]) + (this.m[0][3] * b[3][2])),\n ((this.m[0][0] * b[0][3]) + (this.m[0][1] * b[1][3]) + (this.m[0][2] * b[2][3]) + (this.m[0][3] * b[3][3])) ],\n [ ((this.m[1][0] * b[0][0]) + (this.m[1][1] * b[1][0]) + (this.m[1][2] * b[2][0]) + (this.m[1][3] * b[3][0])),\n ((this.m[1][0] * b[0][1]) + (this.m[1][1] * b[1][1]) + (this.m[1][2] * b[2][1]) + (this.m[1][3] * b[3][1])),\n ((this.m[1][0] * b[0][2]) + (this.m[1][1] * b[1][2]) + (this.m[1][2] * b[2][2]) + (this.m[1][3] * b[3][2])),\n ((this.m[1][0] * b[0][3]) + (this.m[1][1] * b[1][3]) + (this.m[1][2] * b[2][3]) + (this.m[1][3] * b[3][3])) ],\n [ ((this.m[2][0] * b[0][0]) + (this.m[2][1] * b[1][0]) + (this.m[2][2] * b[2][0]) + (this.m[2][3] * b[3][0])),\n ((this.m[2][0] * b[0][1]) + (this.m[2][1] * b[1][1]) + (this.m[2][2] * b[2][1]) + (this.m[2][3] * b[3][1])),\n ((this.m[2][0] * b[0][2]) + (this.m[2][1] * b[1][2]) + (this.m[2][2] * b[2][2]) + (this.m[2][3] * b[3][2])),\n ((this.m[2][0] * b[0][3]) + (this.m[2][1] * b[1][3]) + (this.m[2][2] * b[2][3]) + (this.m[2][3] * b[3][3])) ],\n [ ((this.m[3][0] * b[0][0]) + (this.m[3][1] * b[1][0]) + (this.m[3][2] * b[2][0]) + (this.m[3][3] * b[3][0])),\n ((this.m[3][0] * b[0][1]) + (this.m[3][1] * b[1][1]) + (this.m[3][2] * b[2][1]) + (this.m[3][3] * b[3][1])),\n ((this.m[3][0] * b[0][2]) + (this.m[3][1] * b[1][2]) + (this.m[3][2] * b[2][2]) + (this.m[3][3] * b[3][2])),\n ((this.m[3][0] * b[0][3]) + (this.m[3][1] * b[1][3]) + (this.m[3][2] * b[2][3]) + (this.m[3][3] * b[3][3])) ]];\n this.m = dst;\n return this;\n }\n\n this.makeOrtho = function(left, right, bottom, top, znear, zfar) {\n var X = -(right + left) / (right - left);\n var Y = -(top + bottom) / (top - bottom);\n var Z = -(zfar + znear) / (zfar - znear);\n var A = 2 / (right - left);\n var B = 2 / (top - bottom);\n var C = -2 / (zfar - znear);\n\n this.m = [[A, 0, 0, 0],\n [0, B, 0, 0],\n [0, 0, C, 0],\n [X, Y, Z, 1]];\n return this;\n }\n\n this.makePerspective = function(fovy, aspect, znear, zfar) {\n var ymax = znear * Math.tan(fovy * Math.PI / 360.0);\n var ymin = -ymax;\n var xmin = ymin * aspect;\n var xmax = ymax * aspect;\n\n this.makeFrustum(xmin, xmax, ymin, ymax, znear, zfar);\n return this;\n }\n\n this.makeFrustum = function(left, right, bottom, top, znear, zfar) {\n var X = 2 * znear / (right - left);\n var Y = 2 * znear / (top - bottom);\n var A = (right + left) / (right - left);\n var B = (top + bottom) / (top - bottom);\n var C = -(zfar + znear) / (zfar - znear);\n var D = -2 * zfar * znear / (zfar - znear);\n\n this.m = [[X, 0, 0, 0],\n [0, Y, 0, 0],\n [A, B, C, -1],\n [0, 0, D, 1]];\n return this;\n }\n\n this.Flatten = function () {\n var f = [];\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4 ; j++) {\n f.push(this.m[i][j]);\n }\n }\n return f;\n }\n\n this.ToString = function () {\n var s = '';\n for (var i = 0; i < 4; i++) {\n s = s.concat(this.m[i].toString());\n s = s.concat(',');\n }\n // now replace the commas with spaces\n s = s.replace(/,/g, ' ');\n return s;\n }\n\n this.ToEuler = function() {\n\n var clamp = function(x,a,b) {\n return (x<a)?a:((x>b)?b:x);\n }\n\n // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n var m11 = this.m[0][0], m12 = this.m[1][0], m13 = this.m[2][0];\n var m21 = this.m[0][1], m22 = this.m[1][1], m23 = this.m[2][1];\n var m31 = this.m[0][2], m32 = this.m[1][2], m33 = this.m[2][2];\n\n var _x, _y, _z;\n\n /*\n _y = Math.asin( clamp( m13, - 1, 1 ) );\n if ( Math.abs( m13 ) < 0.99999 ) {\n _x = Math.atan2( - m23, m33 );\n _z = Math.atan2( - m12, m11 );\n } else {\n _x = Math.atan2( m32, m22 );\n _z = 0;\n }\n */\n\n _y = Math.asin( - clamp( m31, - 1, 1 ) );\n if ( Math.abs( m31 ) < 0.99999 ) {\n _x = Math.atan2( m32, m33 );\n _z = Math.atan2( m21, m11 );\n } else {\n _x = 0;\n _z = Math.atan2( - m12, m22 );\n }\n\n var deg = 180.0/Math.PI;\n var heading = deg * _y;\n var bank = deg * _z;\n var attitude = deg * _x;\n //console.log('heading ' + heading);\n //console.log('attitude ' + attitude);\n //console.log('bank ' + bank);\n return { heading:heading, attitude:attitude, bank:bank };\n }\n}", "title": "" }, { "docid": "9a847a358fde51308c6df8479f421271", "score": "0.57095104", "text": "function scale4(a, b, c) {\n var result = mat4();\n result[0][0] = a;\n result[1][1] = b;\n result[2][2] = c;\n return result;\n}", "title": "" }, { "docid": "9a847a358fde51308c6df8479f421271", "score": "0.57095104", "text": "function scale4(a, b, c) {\n var result = mat4();\n result[0][0] = a;\n result[1][1] = b;\n result[2][2] = c;\n return result;\n}", "title": "" }, { "docid": "9a847a358fde51308c6df8479f421271", "score": "0.57095104", "text": "function scale4(a, b, c) {\n var result = mat4();\n result[0][0] = a;\n result[1][1] = b;\n result[2][2] = c;\n return result;\n}", "title": "" }, { "docid": "901252983422d5c17180d5d4cbdd63f8", "score": "0.56903476", "text": "function scale4(a, b, c) {\n var result = mat4();\n result[0][0] = a;\n result[1][1] = b;\n result[2][2] = c;\n return result;\n}", "title": "" }, { "docid": "9ea7da8411e5c91f2cd0a83d2f0a4724", "score": "0.56827897", "text": "scaleToRef(scale, result) {\n result.x = this.x * scale;\n result.y = this.y * scale;\n result.z = this.z * scale;\n result.w = this.w * scale;\n return this;\n }", "title": "" }, { "docid": "9ea7da8411e5c91f2cd0a83d2f0a4724", "score": "0.56827897", "text": "scaleToRef(scale, result) {\n result.x = this.x * scale;\n result.y = this.y * scale;\n result.z = this.z * scale;\n result.w = this.w * scale;\n return this;\n }", "title": "" }, { "docid": "877b3e0728c7e0b37fbfd3e206bbda9e", "score": "0.56703836", "text": "function scale4(a, b, c) {\n var result = mat4();\n result[0][0] = a;\n result[1][1] = b;\n result[2][2] = c;\n return result;\n}", "title": "" }, { "docid": "58940509ab56005ece835a69917cf30c", "score": "0.56503606", "text": "scaleToRef(scale, result) {\n result.r = this.r * scale;\n result.g = this.g * scale;\n result.b = this.b * scale;\n result.a = this.a * scale;\n return this;\n }", "title": "" }, { "docid": "a7461a64213a850111f539c192298d80", "score": "0.5622954", "text": "static scale(v) {\r\n\t\tres = identity(); \t\tres.M[0] = v.x; \r\n\t\tres.M[5] = v.y; \t\tres.M[10] = v.z; \r\n\t\treturn res; \r\n\t}", "title": "" }, { "docid": "e8cb71c8ef72373e9fee7b00c8e6aa21", "score": "0.561306", "text": "scaleToRef(scale, result) {\n result.r = this.r * scale;\n result.g = this.g * scale;\n result.b = this.b * scale;\n return this;\n }", "title": "" }, { "docid": "8c2caaf333c780ab06d47f8aaa2c7e40", "score": "0.55842185", "text": "scaleToRef(scale, result) {\n result.x = this.x * scale;\n result.y = this.y * scale;\n result.z = this.z * scale;\n result.w = this.w * scale;\n return this;\n }", "title": "" }, { "docid": "da53821a0fd30b96cf7a984bd46ef7f2", "score": "0.5579977", "text": "compensate(scale) {\n return this.relative({ x: (scale - 1) / 2, y: (scale - 1) / 2 });\n }", "title": "" }, { "docid": "5708030ecef1c8369816484b4e52ce7f", "score": "0.5546428", "text": "scale(scale) {\n this.r *= scale;\n this.g *= scale;\n this.b *= scale;\n return this;\n }", "title": "" }, { "docid": "15436fa98cf078b21ef12e98c2ccbc27", "score": "0.55416626", "text": "getRotationMatrixToRef(result) {\n const scale = preallocatedVariables_1$3.MathTmp.Vector3[0];\n if (!this.decompose(scale)) {\n Matrix.IdentityToRef(result);\n return this;\n }\n const m = this._m;\n // tslint:disable-next-line:one-variable-per-declaration\n const sx = 1 / scale.x, sy = 1 / scale.y, sz = 1 / scale.z;\n Matrix.FromValuesToRef(m[0] * sx, m[1] * sx, m[2] * sx, 0.0, m[4] * sy, m[5] * sy, m[6] * sy, 0.0, m[8] * sz, m[9] * sz, m[10] * sz, 0.0, 0.0, 0.0, 0.0, 1.0, result);\n return this;\n }", "title": "" }, { "docid": "4dd29b00e4c33d3fdfcae01007e8ca46", "score": "0.5533876", "text": "static createTranslationAndScaleXYZ(tx, ty, tz, scaleX, scaleY, scaleZ, result) {\n return Matrix4d.createRowValues(scaleX, 0, 0, tx, 0, scaleY, 0, ty, 0, 0, scaleZ, tz, 0, 0, 0, 1, result);\n }", "title": "" }, { "docid": "b13f370bc5a58b095597228fe529568f", "score": "0.5530928", "text": "function getTransformValues(el) {\r\n var st = window.getComputedStyle(el, null); // sometimes returns null\r\n var tr = st && st.getPropertyValue(\"-webkit-transform\") ||\r\n st && st.getPropertyValue(\"-moz-transform\") ||\r\n st && st.getPropertyValue(\"-ms-transform\") ||\r\n st && st.getPropertyValue(\"-o-transform\") ||\r\n st && st.getPropertyValue(\"transform\") ||\r\n \"fail...\";\r\n \r\n // rotation matrix - http://en.wikipedia.org/wiki/Rotation_matrix\r\n if (tr === undefined || tr == \"none\" || tr == \"fail...\") {\r\n return {\r\n scale: 1.0,\r\n angle: 0\r\n }\r\n }\r\n var values = tr.split('(')[1];\r\n values = values.split(')')[0];\r\n values = values.split(',');\r\n var a = values[0];\r\n var b = values[1];\r\n var c = values[2];\r\n var d = values[3];\r\n \r\n return {\r\n scale: Math.sqrt(a*a + b*b),\r\n angle: Math.round(Math.atan2(b,a) * (180/Math.PI))\r\n }\r\n }", "title": "" }, { "docid": "e2e7912bd514159c25991ac221efe226", "score": "0.5466679", "text": "function generateTransform( transformData ) {\n\n\t\tvar lTranslationM = new THREE.Matrix4();\n\t\tvar lPreRotationM = new THREE.Matrix4();\n\t\tvar lRotationM = new THREE.Matrix4();\n\t\tvar lPostRotationM = new THREE.Matrix4();\n\n\t\tvar lScalingM = new THREE.Matrix4();\n\t\tvar lScalingPivotM = new THREE.Matrix4();\n\t\tvar lScalingOffsetM = new THREE.Matrix4();\n\t\tvar lRotationOffsetM = new THREE.Matrix4();\n\t\tvar lRotationPivotM = new THREE.Matrix4();\n\n\t\tvar lParentGX = new THREE.Matrix4();\n\t\tvar lGlobalT = new THREE.Matrix4();\n\n\t\tvar inheritType = ( transformData.inheritType ) ? transformData.inheritType : 0;\n\n\t\tif ( transformData.translation ) lTranslationM.setPosition( tempVec.fromArray( transformData.translation ) );\n\n\t\tif ( transformData.preRotation ) {\n\n\t\t\tvar array = transformData.preRotation.map( THREE.Math.degToRad );\n\t\t\tarray.push( transformData.eulerOrder );\n\t\t\tlPreRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );\n\n\t\t}\n\n\t\tif ( transformData.rotation ) {\n\n\t\t\tvar array = transformData.rotation.map( THREE.Math.degToRad );\n\t\t\tarray.push( transformData.eulerOrder );\n\t\t\tlRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );\n\n\t\t}\n\n\t\tif ( transformData.postRotation ) {\n\n\t\t\tvar array = transformData.postRotation.map( THREE.Math.degToRad );\n\t\t\tarray.push( transformData.eulerOrder );\n\t\t\tlPostRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );\n\n\t\t}\n\n\t\tif ( transformData.scale ) lScalingM.scale( tempVec.fromArray( transformData.scale ) );\n\n\t\t// Pivots and offsets\n\t\tif ( transformData.scalingOffset ) lScalingOffsetM.setPosition( tempVec.fromArray( transformData.scalingOffset ) );\n\t\tif ( transformData.scalingPivot ) lScalingPivotM.setPosition( tempVec.fromArray( transformData.scalingPivot ) );\n\t\tif ( transformData.rotationOffset ) lRotationOffsetM.setPosition( tempVec.fromArray( transformData.rotationOffset ) );\n\t\tif ( transformData.rotationPivot ) lRotationPivotM.setPosition( tempVec.fromArray( transformData.rotationPivot ) );\n\n\t\t// parent transform\n\t\tif ( transformData.parentMatrixWorld ) lParentGX = transformData.parentMatrixWorld;\n\n\t\t// Global Rotation\n\t\tvar lLRM = lPreRotationM.multiply( lRotationM ).multiply( lPostRotationM );\n\t\tvar lParentGRM = new THREE.Matrix4();\n\t\tlParentGX.extractRotation( lParentGRM );\n\n\t\t// Global Shear*Scaling\n\t\tvar lParentTM = new THREE.Matrix4();\n\t\tvar lLSM;\n\t\tvar lParentGSM;\n\t\tvar lParentGRSM;\n\n\t\tlParentTM.copyPosition( lParentGX );\n\t\tlParentGRSM = lParentTM.getInverse( lParentTM ).multiply( lParentGX );\n\t\tlParentGSM = lParentGRM.getInverse( lParentGRM ).multiply( lParentGRSM );\n\t\tlLSM = lScalingM;\n\n\t\tvar lGlobalRS;\n\t\tif ( inheritType === 0 ) {\n\n\t\t\tlGlobalRS = lParentGRM.multiply( lLRM ).multiply( lParentGSM ).multiply( lLSM );\n\n\t\t} else if ( inheritType === 1 ) {\n\n\t\t\tlGlobalRS = lParentGRM.multiply( lParentGSM ).multiply( lLRM ).multiply( lLSM );\n\n\t\t} else {\n\n\t\t\tvar lParentLSM = new THREE.Matrix4().copy( lScalingM );\n\n\t\t\tvar lParentGSM_noLocal = lParentGSM.multiply( lParentLSM.getInverse( lParentLSM ) );\n\n\t\t\tlGlobalRS = lParentGRM.multiply( lLRM ).multiply( lParentGSM_noLocal ).multiply( lLSM );\n\n\t\t}\n\n\t\t// Calculate the local transform matrix\n\t\tvar lTransform = lTranslationM.multiply( lRotationOffsetM ).multiply( lRotationPivotM ).multiply( lPreRotationM ).multiply( lRotationM ).multiply( lPostRotationM ).multiply( lRotationPivotM.getInverse( lRotationPivotM ) ).multiply( lScalingOffsetM ).multiply( lScalingPivotM ).multiply( lScalingM ).multiply( lScalingPivotM.getInverse( lScalingPivotM ) );\n\n\t\tvar lLocalTWithAllPivotAndOffsetInfo = new THREE.Matrix4().copyPosition( lTransform );\n\n\t\tvar lGlobalTranslation = lParentGX.multiply( lLocalTWithAllPivotAndOffsetInfo );\n\t\tlGlobalT.copyPosition( lGlobalTranslation );\n\n\t\tlTransform = lGlobalT.multiply( lGlobalRS );\n\n\t\treturn lTransform;\n\n\t}", "title": "" }, { "docid": "d99a65cab7671f476f7e4781302f3400", "score": "0.54494435", "text": "function Transform(size) {\n this.rReal = new Float64Array(size),\n this.gReal = new Float64Array(size),\n this.bReal = new Float64Array(size),\n this.rImag = new Float64Array(size),\n this.gImag = new Float64Array(size),\n this.bImag = new Float64Array(size);\n}", "title": "" }, { "docid": "360277d018763d6c598b54be7a3d5047", "score": "0.544442", "text": "toMatrix3d(result) {\n const rot = result !== undefined ? result : new Matrix3d_1.Matrix3d();\n const axisOrder = this.order;\n const x = this.xAngle, y = this.yAngle, z = this.zAngle;\n const a = x.cos();\n let b = x.sin();\n const c = y.cos();\n let d = y.sin();\n const e = z.cos();\n let f = z.sin();\n if (OrderedRotationAngles.treatVectorsAsColumns) {\n b = -b;\n d = -d;\n f = -f;\n }\n if (axisOrder === 0 /* XYZ */) {\n const ae = a * e, af = a * f, be = b * e, bf = b * f;\n rot.setRowValues(c * e, af + be * d, bf - ae * d, -c * f, ae - bf * d, be + af * d, d, -b * c, a * c);\n }\n else if (axisOrder === 5 /* YXZ */) {\n const ce = c * e, cf = c * f, de = d * e, df = d * f;\n rot.setRowValues(ce + df * b, a * f, cf * b - de, de * b - cf, a * e, df + ce * b, a * d, -b, a * c);\n }\n else if (axisOrder === 2 /* ZXY */) {\n const ce = c * e, cf = c * f, de = d * e, df = d * f;\n rot.setRowValues(ce - df * b, cf + de * b, -a * d, -a * f, a * e, b, de + cf * b, df - ce * b, a * c);\n }\n else if (axisOrder === 6 /* ZYX */) {\n const ae = a * e, af = a * f, be = b * e, bf = b * f;\n rot.setRowValues(c * e, c * f, -d, be * d - af, bf * d + ae, b * c, ae * d + bf, af * d - be, a * c);\n }\n else if (axisOrder === 1 /* YZX */) {\n const ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n rot.setRowValues(c * e, f, -d * e, bd - ac * f, a * e, ad * f + bc, bc * f + ad, -b * e, ac - bd * f);\n }\n else if (axisOrder === 4 /* XZY */) {\n const ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n rot.setRowValues(c * e, ac * f + bd, bc * f - ad, -f, a * e, b * e, d * e, ad * f - bc, bd * f + ac);\n }\n if (OrderedRotationAngles.treatVectorsAsColumns)\n rot.transposeInPlace();\n return rot;\n }", "title": "" }, { "docid": "3b619f2ab654186d671977ddcdbf7801", "score": "0.5440455", "text": "scale(scaler){\n return new Vector2(this._x*scaler,this._y*scaler)\n }", "title": "" }, { "docid": "b040d0c83cfcb75dca7f01a863e9cd56", "score": "0.5429926", "text": "function ModelScale(orig, scale, dest) {\n // 1-to-1 from orig to dest, no need to copy as buffer\n for (i = 0; i < 3; ++i) { for (j = 0; j < 4; ++j) {\n dest[j + 4 * i] = orig[j + 4 * i] * scale[i];\n } }\n for (i = 12; i < 15; ++i) { dest[i] = orig[i]; }\n}", "title": "" }, { "docid": "287ac3e42ba612232dce4994a192dd0f", "score": "0.5423098", "text": "function matrix3d (scale, translate) {\n var k = scale / 256\n var r = scale % 1 ? Number : Math.round\n return 'matrix3d(' + [k, 0, 0, 0, 0, k, 0, 0, 0, 0, k, 0, r(translate[0] *\n scale), r(translate[1] * scale), 0, 1] + ')'\n}", "title": "" }, { "docid": "01f751cd83e8f2ea03e6d4b9c6900adc", "score": "0.53821886", "text": "static Z(_scale = 1) {\n const vector = FudgeCore.Recycler.get(Vector3);\n vector.data.set([0, 0, _scale]);\n return vector;\n }", "title": "" }, { "docid": "a0484bac9ad064ce47510ff48f08789f", "score": "0.5357153", "text": "constructor (position=new Vector(), rotation=new Quaternion(), scale=new Vector(1, 1, 1))\n\t{\n\t\t//TODO:\n\t\tthis.position = position;\n\t\tthis.rotation = \n\t}", "title": "" }, { "docid": "25f7caed3105621a5d4dbf9bf4e999dd", "score": "0.535236", "text": "apply() {\n var transform = mat4.create();\n mat4.identity(transform);\n\n mat4.translate(transform, transform, [this.x_center, this.y_center, this.z_center]);\n\n mat4.rotate(transform, transform, this.elapsedAngle, this.arcVec);\n\n mat4.translate(transform, transform, [this.radius * Math.cos(this.angVec), 0, -this.radius * Math.sin(this.angVec)]);\n\n\n mat4.rotate(transform, transform, this.stepAngle, this.arcVec);\n \n\n let outVec = [transform[12], transform[13], transform[14]];\n return outVec;\n }", "title": "" }, { "docid": "ccd6153b6c5e95134289a831e0e7aadd", "score": "0.53345674", "text": "scaleAndAddToRef(scale, result) {\n return result.addInPlaceFromFloats(this.x * scale, this.y * scale, this.z * scale);\n }", "title": "" }, { "docid": "79ff88b1a3dfd02575ede0c5dd84a441", "score": "0.53310686", "text": "globalRotate(anchor, scale, scale_mul=1.0){\n if(!!this._locked){return ;}\n this._locked = true;\n let rx = deg2rad(scale[0] * scale_mul);\n let ry = deg2rad(scale[1] * scale_mul);\n let rz = deg2rad(scale[2] * scale_mul);\n this.world_rotation[0] += rx; this.world_rotation[0] %= ROUND_RAD;\n this.world_rotation[1] += ry; this.world_rotation[0] %= ROUND_RAD;\n this.world_rotation[2] += rz; this.world_rotation[0] %= ROUND_RAD;\n\n mat4.rotateX(this.world_matrix, rx, anchor[0]);\n mat4.rotateY(this.world_matrix, ry, anchor[1]);\n mat4.rotateZ(this.world_matrix, rz, anchor[2]);\n \n let stack = [this];\n while(stack.length > 0){\n let node = stack.pop();\n for(let i=0;i<node.children.length;++i){\n node.children[i].world_matrix = matcpy(this.world_matrix);\n node.children[i].world_rotation = clone(this.world_rotation);\n if(node.children[i].children.length > 0){\n stack.push(node.children[i]);\n }\n }\n }\n this._locked = false;\n }", "title": "" }, { "docid": "f7713ed586a274e811824986d8949a0d", "score": "0.53307027", "text": "transform(transformation) {\n const transposedMatrix = preallocatedVariables_1.MathTmp.Matrix[0];\n Matrix_1.Matrix.TransposeToRef(transformation, transposedMatrix);\n const m = transposedMatrix.m;\n const x = this.normal.x;\n const y = this.normal.y;\n const z = this.normal.z;\n const d = this.d;\n const normalX = x * m[0] + y * m[1] + z * m[2] + d * m[3];\n const normalY = x * m[4] + y * m[5] + z * m[6] + d * m[7];\n const normalZ = x * m[8] + y * m[9] + z * m[10] + d * m[11];\n const finalD = x * m[12] + y * m[13] + z * m[14] + d * m[15];\n return new Plane(normalX, normalY, normalZ, finalD);\n }", "title": "" }, { "docid": "6f5fc23714046a1e9dc9ba753119664b", "score": "0.5329498", "text": "scaleToRef(scale, result) {\n result.x = this.x * scale;\n result.y = this.y * scale;\n return this;\n }", "title": "" }, { "docid": "8b90fc6bb14e3b8b862496ca5cc7d3e6", "score": "0.53226495", "text": "static decomposeRigidTransform(m) {\n const m00 = m[0], m01 = m[1], m02 = m[2], m03 = m[3];\n const m10 = m[4], m11 = m[5], m12 = m[6], m13 = m[7];\n const m20 = m[8], m21 = m[9], m22 = m[10], m23 = m[11];\n const m30 = m[12], m31 = m[13], m32 = m[14], m33 = m[15];\n\n const position = [m30, m31, m32];\n const orientation = [0, 0, 0, 0];\n\n const trace = m00 + m11 + m22;\n if (trace > 0) {\n const S = Math.sqrt(trace + 1) * 2;\n orientation[3] = 0.25 * S;\n orientation[0] = (m12 - m21) / S;\n orientation[1] = (m20 - m02) / S;\n orientation[2] = (m01 - m10) / S;\n } else if (m00 > m11 && m00 > m22) {\n const S = Math.sqrt(1.0 + m00 - m11 - m22) * 2;\n orientation[3] = (m12 - m21) / S;\n orientation[0] = 0.25 * S;\n orientation[1] = (m01 + m10) / S;\n orientation[2] = (m20 + m02) / S;\n } else if (m11 > m22) {\n const S = Math.sqrt(1.0 + m11 - m00 - m22) * 2;\n orientation[3] = (m20 - m02) / S;\n orientation[0] = (m01 + m10) / S;\n orientation[1] = 0.25 * S;\n orientation[2] = (m12 + m21) / S;\n } else {\n const S = Math.sqrt(1.0 + m22 - m00 - m11) * 2;\n orientation[3] = (m01 - m10) / S;\n orientation[0] = (m20 + m02) / S;\n orientation[1] = (m12 + m21) / S;\n orientation[2] = 0.25 * S;\n }\n\n return { position, orientation };\n }", "title": "" }, { "docid": "383c8e4e863c58669dc10979640f7999", "score": "0.5300314", "text": "function update()\n{\n\tthis.transformationMatrix = MatrixGenerator.scalingMatrix(this.scale.x, this.scale.y, this.scale.z);\n\tthis.transformationMatrix.mul(MatrixGenerator.translation(-this.origin.x, -this.origin.y, -this.origin.z));\n this.transformationMatrix.mul(MatrixGenerator.rotationMatrix(this.rotation.x, this.rotation.y, this.rotation.z));\n this.transformationMatrix.mul(MatrixGenerator.translation(this.position.x, this.position.y, this.position.z));\n}", "title": "" }, { "docid": "cf5795fb39c07de49a80c68b6ac98c3c", "score": "0.5300119", "text": "function matrix( transform ) {\r\n\ttransform = transform.split(\")\");\r\n\tvar\r\n\t\t\ttrim = $.trim\r\n\t\t, i = -1\r\n\t\t// last element of the array is an empty string, get rid of it\r\n\t\t, l = transform.length -1\r\n\t\t, split, prop, val\r\n\t\t, prev = supportFloat32Array ? new Float32Array(6) : []\r\n\t\t, curr = supportFloat32Array ? new Float32Array(6) : []\r\n\t\t, rslt = supportFloat32Array ? new Float32Array(6) : [1,0,0,1,0,0]\r\n\t\t;\r\n\r\n\tprev[0] = prev[3] = rslt[0] = rslt[3] = 1;\r\n\tprev[1] = prev[2] = prev[4] = prev[5] = 0;\r\n\r\n\t// Loop through the transform properties, parse and multiply them\r\n\twhile ( ++i < l ) {\r\n\t\tsplit = transform[i].split(\"(\");\r\n\t\tprop = trim(split[0]);\r\n\t\tval = split[1];\r\n\t\tcurr[0] = curr[3] = 1;\r\n\t\tcurr[1] = curr[2] = curr[4] = curr[5] = 0;\r\n\r\n\t\tswitch (prop) {\r\n\t\t\tcase _translate+\"X\":\r\n\t\t\t\tcurr[4] = parseInt(val, 10);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _translate+\"Y\":\r\n\t\t\t\tcurr[5] = parseInt(val, 10);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _translate:\r\n\t\t\t\tval = val.split(\",\");\r\n\t\t\t\tcurr[4] = parseInt(val[0], 10);\r\n\t\t\t\tcurr[5] = parseInt(val[1] || 0, 10);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _rotate:\r\n\t\t\t\tval = toRadian(val);\r\n\t\t\t\tcurr[0] = Math.cos(val);\r\n\t\t\t\tcurr[1] = Math.sin(val);\r\n\t\t\t\tcurr[2] = -Math.sin(val);\r\n\t\t\t\tcurr[3] = Math.cos(val);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _scale+\"X\":\r\n\t\t\t\tcurr[0] = +val;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _scale+\"Y\":\r\n\t\t\t\tcurr[3] = val;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _scale:\r\n\t\t\t\tval = val.split(\",\");\r\n\t\t\t\tcurr[0] = val[0];\r\n\t\t\t\tcurr[3] = val.length>1 ? val[1] : val[0];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _skew+\"X\":\r\n\t\t\t\tcurr[2] = Math.tan(toRadian(val));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _skew+\"Y\":\r\n\t\t\t\tcurr[1] = Math.tan(toRadian(val));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _matrix:\r\n\t\t\t\tval = val.split(\",\");\r\n\t\t\t\tcurr[0] = val[0];\r\n\t\t\t\tcurr[1] = val[1];\r\n\t\t\t\tcurr[2] = val[2];\r\n\t\t\t\tcurr[3] = val[3];\r\n\t\t\t\tcurr[4] = parseInt(val[4], 10);\r\n\t\t\t\tcurr[5] = parseInt(val[5], 10);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t// Matrix product (array in column-major order)\r\n\t\trslt[0] = prev[0] * curr[0] + prev[2] * curr[1];\r\n\t\trslt[1] = prev[1] * curr[0] + prev[3] * curr[1];\r\n\t\trslt[2] = prev[0] * curr[2] + prev[2] * curr[3];\r\n\t\trslt[3] = prev[1] * curr[2] + prev[3] * curr[3];\r\n\t\trslt[4] = prev[0] * curr[4] + prev[2] * curr[5] + prev[4];\r\n\t\trslt[5] = prev[1] * curr[4] + prev[3] * curr[5] + prev[5];\r\n\r\n\t\tprev = [rslt[0],rslt[1],rslt[2],rslt[3],rslt[4],rslt[5]];\r\n\t}\r\n\treturn rslt;\r\n}", "title": "" }, { "docid": "0ebb878f885c4449e664b264944b4ddd", "score": "0.5297631", "text": "scale(value) {\n return new Quaternion(this.x * value, this.y * value, this.z * value, this.w * value);\n }", "title": "" }, { "docid": "3ba33ec0162a779dd0f17ff79f5fb8b6", "score": "0.5256994", "text": "function Quaternion() {\n\tthis.x = 0.0;\n\tthis.y = 0.0;\n\tthis.z = 0.0;\n\tthis.w = 1.0;\n\tif (arguments.length == 4) {\n\t\tthis.x = arguments[0];\n\t\tthis.y = arguments[1];\n\t\tthis.z = arguments[2];\n\t\tthis.w = arguments[3];\n\t}\n\t\n\tthis.getInverse = function() {\n\t\treturn new Quaternion(-this.x, -this.y, -this.z, this.w);\n\t}\n\t\n\tthis.getMagnitude = function() {\n\t\treturn vectorLen([this.x, this.y, this.z, this.w]);\n\t}\n\t\n\tthis.normalize = function() {\n\t\tvar iLen = 1.0/this.getMagnitude();\n\t\tthis.x *= iLen;\n\t\tthis.y *= iLen;\n\t\tthis.z *= iLen;\n\t\tthis.w *= iLen;\n\t}\n\t\n\tthis.getMatrix = function() {\n\t\tvar xx = this.x * this.x;\n\t\tvar xy = this.x * this.y;\n\t\tvar xz = this.x * this.z;\n\t\tvar xw = this.x * this.w;\n\n\t\tvar yy = this.y * this.y;\n\t\tvar yz = this.y * this.z;\n\t\tvar yw = this.y * this.w;\n\n\t\tvar zz = this.z * this.z;\n\t\tvar zw = this.z * this.w;\n\t\t\n\t\tvar mat = IdentityMatrix();\n\n\t\tmat[0] = 1 - 2 * ( yy + zz );\n\t\tmat[4] = 2 * ( xy - zw );\n\t\tmat[8] = 2 * ( xz + yw );\n\n\t\tmat[1] = 2 * ( xy + zw );\n\t\tmat[5] = 1 - 2 * ( xx + zz );\n\t\tmat[9] = 2 * ( yz - xw );\n\n\t\tmat[2] = 2 * ( xz - yw );\n\t\tmat[6] = 2 * ( yz + xw );\n\t\tmat[10] = 1 - 2 * ( xx + yy );\n\t\t\n\t\treturn mat;\n\t}\n}", "title": "" }, { "docid": "129192e0de9bb24e9838fa4880b68dd2", "score": "0.5238384", "text": "function constructAffineFixingRotation(elem) {\n var rawTrans = helpers.getElementTransform(elem);\n var matr;\n if(!rawTrans) {\n matr = new PureCSSMatrix();\n } else {\n matr = new PureCSSMatrix(rawTrans);\n }\n var current_affine = affineTransformDecompose(matr);\n current_affine.r = getTotalRotation(rawTrans);\n return current_affine;\n }", "title": "" }, { "docid": "27cbfe401008c6a278a34e71f0e6866c", "score": "0.5224001", "text": "static scaling(_x, _y, _z) {\n let matrix = new Mat4;\n matrix.data = new Float32Array([\n _x, 0, 0, 0,\n 0, _y, 0, 0,\n 0, 0, _z, 0,\n 0, 0, 0, 1\n ]);\n return matrix;\n }", "title": "" }, { "docid": "b229cfa325197be2deb2e499f3179fff", "score": "0.5221692", "text": "scaleAndAddToRef(scale, result) {\n result.x += this.x * scale;\n result.y += this.y * scale;\n result.z += this.z * scale;\n result.w += this.w * scale;\n return this;\n }", "title": "" }, { "docid": "b229cfa325197be2deb2e499f3179fff", "score": "0.5221692", "text": "scaleAndAddToRef(scale, result) {\n result.x += this.x * scale;\n result.y += this.y * scale;\n result.z += this.z * scale;\n result.w += this.w * scale;\n return this;\n }", "title": "" }, { "docid": "b8e753b2b2a1a2dc3266ea3ad4207f51", "score": "0.5220952", "text": "scaleAndAddToRef(scale, result) {\n result.r += this.r * scale;\n result.g += this.g * scale;\n result.b += this.b * scale;\n result.a += this.a * scale;\n return this;\n }", "title": "" }, { "docid": "cc1aabec13f4d82c3e3c17973b57f324", "score": "0.52177167", "text": "getRotation () {\n var r = this.rotation || {x:0, y:0, z:0};\n return {\n x: r.x || 0,\n y: r.y || 0,\n z: r.z || 0\n };\n }", "title": "" }, { "docid": "45c44f3531e88879368fecfd9c4b439f", "score": "0.5209764", "text": "setFromRotationMatrix(m) {\n // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n const \n m11 = m.a1, m12 = m.a2, m13 = m.a3,\n m21 = m.b1, m22 = m.b2, m23 = m.b3,\n m31 = m.c1, m32 = m.c2, m33 = m.c3,\n trace = m11 + m22 + m33;\n\n if (trace > 0) {\n const s = 0.5 / Math.sqrt(trace + 1.0);\n this.x = (m32 - m23) * s;\n this.y = (m13 - m31) * s;\n this.z = (m21 - m12) * s;\n this.w = 0.25 / s;\n } else if (m11 > m22 && m11 > m33) {\n const s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n this.x = 0.25 * s;\n this.y = (m12 + m21) / s;\n this.z = (m13 + m31) / s;\n this.w = (m32 - m23) / s;\n } else if (m22 > m33) {\n const s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n this.x = (m12 + m21) / s;\n this.y = 0.25 * s;\n this.z = (m23 + m32) / s;\n this.w = (m13 - m31) / s;\n } else {\n const s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n this.x = (m13 + m31) / s;\n this.y = (m23 + m32) / s;\n this.z = 0.25 * s;\n this.w = (m21 - m12) / s;\n }\n\n return this;\n }", "title": "" }, { "docid": "f14682206e31d332da6d107c9af92cfa", "score": "0.5205152", "text": "set_from_rotation_matrix(m) {\n\t\tlet m11 = m[ 0]\n\t\tlet m21 = m[ 1]\n\t\tlet m31 = m[ 2]\n\t\tlet m12 = m[ 4]\n\t\tlet m22 = m[ 5]\n\t\tlet m32 = m[ 6]\n\t\tlet m13 = m[ 8]\n\t\tlet m23 = m[ 9]\n\t\tlet m33 = m[10]\n\t\tlet trace = m11 + m22 + m33\n\t\tif (trace > 0) {\n\t\t\tlet s = 0.5 / sqrt(trace + 1.0)\n\t\t\tthis[2] = 0.25 / s\n\t\t\tthis[0] = (m32 - m23) * s\n\t\t\tthis[1] = (m13 - m31) * s\n\t\t\tthis[2] = (m21 - m12) * s\n\t\t} else if (m11 > m22 && m11 > m33) {\n\t\t\tlet s = 2.0 * sqrt(1.0 + m11 - m22 - m33)\n\t\t\tthis[2] = (m32 - m23) / s\n\t\t\tthis[0] = 0.25 * s\n\t\t\tthis[1] = (m12 + m21) / s\n\t\t\tthis[2] = (m13 + m31) / s\n\t\t} else if (m22 > m33) {\n\t\t\tlet s = 2.0 * sqrt(1.0 + m22 - m11 - m33)\n\t\t\tthis[2] = (m13 - m31) / s\n\t\t\tthis[0] = (m12 + m21) / s\n\t\t\tthis[1] = 0.25 * _s2\n\t\t\tthis[2] = (m23 + m32) / s\n\t\t} else {\n\t\t\tlet s = 2.0 * sqrt(1.0 + m33 - m11 - m22)\n\t\t\tthis[2] = (m21 - m12) / s\n\t\t\tthis[0] = (m13 + m31) / s\n\t\t\tthis[1] = (m23 + m32) / s\n\t\t\tthis[2] = 0.25 * s\n\t\t}\n\t\treturn this\n\t}", "title": "" }, { "docid": "ad4cda67ccf5416d5c79d1afd512d4ca", "score": "0.5202883", "text": "transform4(a) {\n const x = a.x * this.m11 + a.y * this.m21 + a.z * this.m31 + a.w * this.m41;\n const y = a.x * this.m12 + a.y * this.m22 + a.z * this.m32 + a.w * this.m42;\n const z = a.x * this.m13 + a.y * this.m23 + a.z * this.m33 + a.w * this.m43;\n const w = a.x * this.m14 + a.y * this.m24 + a.z * this.m34 + a.w * this.m44;\n return new Vec4(x, y, z, w);\n }", "title": "" }, { "docid": "5e25acdd4699210a9b4c477cae99a675", "score": "0.5194977", "text": "static X(_scale = 1) {\n const vector = FudgeCore.Recycler.get(Vector3);\n vector.set(_scale, 0, 0);\n return vector;\n }", "title": "" }, { "docid": "398c9f8031c8e7e522cfec8b06fabee4", "score": "0.51921755", "text": "scaleAndAddToRef(scale, result) {\n result.r += this.r * scale;\n result.g += this.g * scale;\n result.b += this.b * scale;\n return this;\n }", "title": "" }, { "docid": "3ffa69d2e70f25081e9a85c657fe3354", "score": "0.5191758", "text": "function scaleJoint(joint) {\n return {\n x: (-joint.cameraX * SCL) + width / 2,\n y: (joint.cameraY * SCL) + height / 2,\n z: (joint.cameraZ * SCL),\n }\n}", "title": "" }, { "docid": "952c860b8ca3b8f5aebac988c3f06581", "score": "0.5169169", "text": "function scale(x, y, z) {\n\n if (Array.isArray(x) && x.length == 3) {\n z = x[2];\n y = x[1];\n x = x[0];\n }\n\n var result = mat4();\n result[0] = x;\n result[5] = y;\n result[10] = z;\n result[15] = 1.0;\n\n return result;\n}", "title": "" }, { "docid": "3146f7e058121c411464e90a353db457", "score": "0.5165175", "text": "getRotationMult(){\n return Math.pow(Math.log10(1 + this.state.distance), 0.5) * this.scale_rotation;\n }", "title": "" }, { "docid": "f132f344be5715fc17e6739e08c1996a", "score": "0.5163657", "text": "static unitTransform4(m) {\n m.m[15] !== 1 && (m = m.divScalar(m.m[15]));\n // X * P = m => X = m * P^-1\n // prettier-ignore\n const Pinv = new M4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -m.m[12], -m.m[13], -m.m[14], 1);\n const pn = new V3(m.m[12], m.m[13], m.m[14]), pw = m.m[15];\n const pwSqrMinusPnSqr = Math.pow(pw, 2) - pn.squared();\n if (lt(pwSqrMinusPnSqr, 0)) {\n throw new Error('vanishing plane intersects unit sphere');\n }\n const c = pn.div(-pwSqrMinusPnSqr);\n const scale = pn.times(pw * pn.length() / (pn.squared() * -pwSqrMinusPnSqr));\n const scale1 = pw / -pwSqrMinusPnSqr;\n const scale2 = 1 / sqrt$1(pwSqrMinusPnSqr);\n const rotNX = M4.forSys(pn.unit(), pn.getPerpendicular().unit());\n return M4.product(m, Pinv, M4.translate(c), rotNX, M4.scale(scale1, scale2, scale2), rotNX.transposed());\n }", "title": "" }, { "docid": "e5f0096d74ca91e77943fd728512353f", "score": "0.515736", "text": "function Update() {\n\ttransform.LookAt(target);\n\tDebug.Log(transform.rotation);\n}", "title": "" }, { "docid": "04611f7fd42516662b5f2929a5e4d870", "score": "0.5126173", "text": "GetMaterialScale() {}", "title": "" }, { "docid": "83f59b6374b3254d7b624725b2620474", "score": "0.51066035", "text": "static Y(_scale = 1) {\n const vector = FudgeCore.Recycler.get(Vector3);\n vector.set(0, _scale, 0);\n return vector;\n }", "title": "" }, { "docid": "a3971ab8d786348ceb55cb31a9ee03c9", "score": "0.51057833", "text": "_applyScale(point) {\n let scale = this.getScale()\n return {\n x: point.x * scale,\n y: point.y * scale,\n z: point.z * scale,\n }\n }", "title": "" }, { "docid": "109f48e72276e3d9e810913a2f7ae242", "score": "0.5102097", "text": "commit() {\n // todo: check if some value exceeds the bounds, such as x < 0, or x + width > texture.width\n\n let textureWidth = this._texture.width;\n let textureHeight = this._texture.height;\n\n // calculate texture matrix\n /**\n * if sprite is rotated\n * 3----4 is rotated to 1----3\n * | | | |\n * | | | |\n * 1----2 2----4\n */\n if (this._rotated) {\n vec3.set(_s_tmp, this._width, this._height, 1.0);\n mat4.fromScaling(_textureMatrix, _s_tmp);\n mat4.fromZRotation(_mat4_tmp, -Math.PI / 2);\n mat4.multiply(_textureMatrix, _mat4_tmp, _textureMatrix);\n\n vec3.set(_t_tmp, this._x, textureHeight - this._y, 0.0);\n mat4.fromTranslation(_mat4_tmp, _t_tmp);\n mat4.multiply(_textureMatrix, _mat4_tmp, _textureMatrix);\n\n vec3.set(_s_tmp, 1 / textureWidth, 1 / textureHeight, 1.0);\n mat4.fromScaling(_mat4_tmp, _s_tmp);\n mat4.multiply(_textureMatrix, _mat4_tmp, _textureMatrix);\n } else {\n vec3.set(_s_tmp, this._width, this._height, 1.0);\n mat4.fromScaling(_textureMatrix, _s_tmp);\n\n vec3.set(_t_tmp, this._x, textureHeight - (this._y + this._height), 0.0);\n mat4.fromTranslation(_mat4_tmp, _t_tmp);\n mat4.multiply(_textureMatrix, _mat4_tmp, _textureMatrix);\n\n vec3.set(_s_tmp, 1 / textureWidth, 1 / textureHeight, 1.0);\n mat4.fromScaling(_mat4_tmp, _s_tmp);\n mat4.multiply(_textureMatrix, _mat4_tmp, _textureMatrix);\n }\n\n // calculate uvs\n let uvs = this._uvs;\n uvs[0].x = uvs[4].x = uvs[8].x = uvs[12].x = 0.0;\n uvs[1].x = uvs[5].x = uvs[9].x = uvs[13].x = this._left / this._width;\n uvs[2].x = uvs[6].x = uvs[10].x = uvs[14].x = 1.0 - this._right / this._width;\n uvs[3].x = uvs[7].x = uvs[11].x = uvs[15].x = 1.0;\n\n uvs[0].y = uvs[1].y = uvs[2].y = uvs[3].y = 0.0;\n uvs[4].y = uvs[5].y = uvs[6].y = uvs[7].y = this._bottom / this._height;\n uvs[8].y = uvs[9].y = uvs[10].y = uvs[11].y = 1.0 - this._top / this._height;\n uvs[12].y = uvs[13].y = uvs[14].y = uvs[15].y = 1.0;\n\n // multiply uv by texture matrix\n for (let i = 0; i < this._uvs.length; ++i) {\n vec3.transformMat4(this._uvs[i], this._uvs[i], _textureMatrix);\n }\n }", "title": "" }, { "docid": "d3d5d364cece4b31fffc0b376eb34c71", "score": "0.51018137", "text": "function setTRS(object3d,t,r,s){object3d.position.set(t.x,t.y,t.z);object3d.rotation.set(r.x,r.y,r.z,'ZYX');object3d.scale.set(s.x,s.y,s.z);}", "title": "" }, { "docid": "c807aa8e51e59a49427db7b09ef5fd7f", "score": "0.51011544", "text": "scaleAndAddToRef(scale, result) {\n result.x += this.x * scale;\n result.y += this.y * scale;\n result.z += this.z * scale;\n result.w += this.w * scale;\n return this;\n }", "title": "" }, { "docid": "da63f3422646630a7e2b89225bfb3ae6", "score": "0.50938296", "text": "setScale(scale, update=true){\n if(Array.isArray(scale)){\n this.setMatrixProperty('scale', scale, update);\n return;\n }\n if(scale.elements){\n this.setMatrixProperty('scale', scale, update);\n return;\n }\n this.setMatrixProperty('scale', scale, update);\n }", "title": "" }, { "docid": "bc81f01860cc376bf8f5772adc8f9ab0", "score": "0.5075435", "text": "function adjustCalculationForRotation (position, r) {\n\n\t\t// Cast position type numeric to avoid quotes in code. Ensure rotation value positive.\n\t\tvar p = parseInt(position, 10);\n\t\tif (r < 0) { r += 360; }\n\t\t\n\t\t// At 0 rotation, left to right: 1,2,3 top, 4,5,6 center, 7, 8, 9 bottom. Position 5 is center\n\t\t// of center row and does not change. Default to 5 during rotation when r != increment of 90.\n\t\tswitch(p) {\n\t\t\tcase 1:\n\t\t\t\tp = (r == 0) ? p : (r == 90) ? 7 : (r == 180) ? 9 : (r == 270) ? 3 : 5;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tp = (r == 0) ? p : (r == 90) ? 4 : (r == 180) ? 8 : (r == 270) ? 6 : 5;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tp = (r == 0) ? p : (r == 90) ? 1 : (r == 180) ? 7 : (r == 270) ? 9 : 5;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tp = (r == 0) ? p : (r == 90) ? 8 : (r == 180) ? 6 : (r == 270) ? 2 : 5;\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tp = (r == 0) ? p : (r == 90) ? 2 : (r == 180) ? 4 : (r == 270) ? 8 : 5;\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tp = (r == 0) ? p : (r == 90) ? 9 : (r == 180) ? 3 : (r == 270) ? 1 : 5;\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tp = (r == 0) ? p : (r == 90) ? 6 : (r == 180) ? 2 : (r == 270) ? 4 : 5;\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tp = (r == 0) ? p : (r == 90) ? 3 : (r == 180) ? 1 : (r == 270) ? 7 : 5;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tposition = p.toString();\n\t\treturn position;\n\t}", "title": "" }, { "docid": "4a89f6ab57556ff56990b5e6a3c421f5", "score": "0.5073047", "text": "constructor (transform, scale) {\n\t\tthis._transform = transform\n\t\tthis._scale = scale\n\t\tthis._class = Camera\n\t}", "title": "" }, { "docid": "9a954dc7bf15cef8fef35167b123b69c", "score": "0.5063578", "text": "getScaleTransform(x, y, input) {\n if (input == null) {\n input = new PdfTransformationMatrix();\n }\n input.scale(x, y);\n return input;\n }", "title": "" }, { "docid": "026128031310c3f4504b527ae4546a71", "score": "0.50631434", "text": "function mScale(p1, r){\n\t\t// s\n\t\tvar n = p1.length;\n\t\tvar out = [];\n\t\tfor(var i = 0; i < n; i++){\n\t\t\tout[i] = p1[i].scale(r);\n\t\t}\n\t\treturn out;\n\t}", "title": "" }, { "docid": "8fe540af75ff760e01064cbde109885f", "score": "0.5061774", "text": "scaleInPlace(scale) {\n this.x *= scale;\n this.y *= scale;\n this.z *= scale;\n return this;\n }", "title": "" }, { "docid": "fc0477fce5e8c840b81af23ac65d66a0", "score": "0.505882", "text": "constructor(r = Math)\n {\n this.grad3 = [[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0], \n [1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1], \n [0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]]; \n this.p = [];\n for (var i=0; i<256; i++) {\n this.p[i] = Math.floor(r.random()*256);\n }\n // To remove the need for index wrapping, double the permutation table length \n this.perm = []; \n for(var i=0; i<512; i++) {\n this.perm[i]=this.p[i & 255];\n }\n }", "title": "" }, { "docid": "8633c6983278ecf2d38a307229d3e8c8", "score": "0.50514954", "text": "constructor(fx, fy, r, txy){\n r = mod(r, 360);\n let c, s;\n // Handle the right angles as special cases because even tiny rounding errors are extremely visible there\n if ( r === 0 ) [c, s] = [ 1, 0]\n else if( r === 90 ) [c, s] = [ 0, 1]\n else if( r === 180 ) [c, s] = [-1, 0]\n else if( r === 270 ) [c, s] = [ 0,-1]\n else [c, s] = [Math.cos(r*PI/180), Math.sin(r*PI/180)]\n // Correct for the center of scaling AND rotation being (0.5, 0.5) instead of (0, 0)\n const dxy = txy.slice();\n const dx = (1 - fx * c + fy * s) * 0.5;\n const dy = (1 - fx * s - fy * c) * 0.5;\n for( let i=0; i<dxy.length; i+=2 ){\n dxy[i] += dx; dxy[i+1] += dy;\n }\n // Matrix:\n // ( fx*c -fx*s )\n // ( fy*s fy*c )\n super( fx*c, -fy*s, fx*s, fy*c, dxy );\n this.fx = fx;\n this.fy = fy;\n this.r = r;\n this.txy = txy;\n }", "title": "" }, { "docid": "d0f3fcc2f3b42ff5a10f4609a1a47a48", "score": "0.50492233", "text": "static ONE(_scale = 1) {\n const vector = FudgeCore.Recycler.get(Vector3);\n vector.set(_scale, _scale, _scale);\n return vector;\n }", "title": "" }, { "docid": "2361155b95a8566673f94c758e12d50d", "score": "0.50330293", "text": "_primaryTransform() {\n const scale = this.value / 100;\n return { transform: `scaleX(${scale})` };\n }", "title": "" }, { "docid": "c851ceef960e8dec5067a330cfc7b5eb", "score": "0.50326246", "text": "static Transform(vector, transformation) {\n const r = Vector2.Zero();\n Vector2.TransformToRef(vector, transformation, r);\n return r;\n }", "title": "" }, { "docid": "a47514f5bed81133203dd4b5d418f5fb", "score": "0.5030669", "text": "recalculateTransformation() {\n let localMatrix = this.localMatrix,\n localLocation = this.localLocation,\n localRotation = this.localRotation,\n localScale = this.localScale,\n worldMatrix = this.worldMatrix,\n worldLocation = this.worldLocation,\n worldRotation = this.worldRotation,\n worldScale = this.worldScale,\n pivot = this.pivot,\n inverseWorldLocation = this.inverseWorldLocation,\n inverseWorldRotation = this.inverseWorldRotation,\n inverseWorldScale = this.inverseWorldScale,\n parent = this.parent,\n children = this.children;\n\n if (parent) {\n let computedLocation,\n computedScaling;\n\n if (this.isSkeletal) {\n computedLocation = localLocation;\n } else {\n let parentPivot = parent.pivot;\n\n computedLocation = locationHeap;\n\n computedLocation[0] = localLocation[0] + parentPivot[0];\n computedLocation[1] = localLocation[1] + parentPivot[1];\n computedLocation[2] = localLocation[2] + parentPivot[2];\n //vec3.add(computedLocation, localLocation, parentPivot);\n }\n\n // If this node shouldn't inherit the parent's rotation, rotate it by the inverse.\n //if (this.dontInheritRotation) {\n //mat4.rotateQ(worldMatrix, worldMatrix, parent.inverseWorldRotation);\n //}\n\n // If this node shouldn't inherit the parent's translation, translate it by the inverse.\n //if (this.dontInheritTranslation) {\n //mat4.translate(worldMatrix, worldMatrix, parent.inverseWorldLocation);\n //}\n\n if (this.dontInheritScaling) {\n computedScaling = scalingHeap;\n\n let parentInverseScale = parent.inverseWorldScale;\n computedScaling[0] = parentInverseScale[0] * localScale[0];\n computedScaling[1] = parentInverseScale[1] * localScale[1];\n computedScaling[2] = parentInverseScale[2] * localScale[2];\n //vec3.mul(computedScaling, parent.inverseWorldScale, localScale);\n\n worldScale[0] = localScale[0];\n worldScale[1] = localScale[1];\n worldScale[2] = localScale[2];\n //vec3.copy(worldScale, localScale);\n } else {\n computedScaling = localScale;\n\n let parentScale = parent.worldScale;\n worldScale[0] = parentScale[0] * localScale[0];\n worldScale[1] = parentScale[1] * localScale[1];\n worldScale[2] = parentScale[2] * localScale[2];\n //vec3.mul(worldScale, parentScale, localScale);\n }\n\n mat4.fromRotationTranslationScaleOrigin(localMatrix, localRotation, computedLocation, computedScaling, pivot);\n\n mat4.mul(worldMatrix, parent.worldMatrix, localMatrix);\n\n quat.mul(worldRotation, parent.worldRotation, localRotation);\n } else {\n // Local matrix\n mat4.fromRotationTranslationScaleOrigin(localMatrix, localRotation, localLocation, localScale, pivot);\n\n // World matrix\n worldMatrix[0] = localMatrix[0];\n worldMatrix[1] = localMatrix[1];\n worldMatrix[2] = localMatrix[2];\n worldMatrix[3] = localMatrix[3];\n worldMatrix[4] = localMatrix[4];\n worldMatrix[5] = localMatrix[5];\n worldMatrix[6] = localMatrix[6];\n worldMatrix[7] = localMatrix[7];\n worldMatrix[8] = localMatrix[8];\n worldMatrix[9] = localMatrix[9];\n worldMatrix[10] = localMatrix[10];\n worldMatrix[11] = localMatrix[11];\n worldMatrix[12] = localMatrix[12];\n worldMatrix[13] = localMatrix[13];\n worldMatrix[14] = localMatrix[14];\n worldMatrix[15] = localMatrix[15];\n //mat4.copy(worldMatrix, localMatrix);\n\n // World rotation\n worldRotation[0] = localRotation[0];\n worldRotation[1] = localRotation[1];\n worldRotation[2] = localRotation[2];\n worldRotation[3] = localRotation[3];\n //quat.copy(worldRotation, localRotation);\n\n // World scale\n worldScale[0] = localScale[0];\n worldScale[1] = localScale[1];\n worldScale[2] = localScale[2];\n //vec3.copy(worldScale, localScale);\n }\n\n // Inverse world rotation\n inverseWorldRotation[0] = -worldRotation[0];\n inverseWorldRotation[1] = -worldRotation[1];\n inverseWorldRotation[2] = -worldRotation[2];\n inverseWorldRotation[3] = worldRotation[3];\n //quat.conjugate(inverseWorldRotation, worldRotation);\n\n // Inverse world scale\n inverseWorldScale[0] = 1 / worldScale[0];\n inverseWorldScale[1] = 1 / worldScale[1];\n inverseWorldScale[2] = 1 / worldScale[2];\n //vec3.inverse(this.inverseWorldScale, worldScale);\n\n\n // World location\n vec3.transformMat4(worldLocation, pivot, worldMatrix);\n\n // Inverse world location\n inverseWorldLocation[0] = -worldLocation[0];\n inverseWorldLocation[1] = -worldLocation[1];\n inverseWorldLocation[2] = -worldLocation[2];\n //vec3.negate(this.inverseWorldLocation, worldLocation);\n\n // Notify the children\n for (let i = 0, l = children.length; i < l; i++) {\n children[i].parentRecalculated();\n }\n\n return this;\n }", "title": "" }, { "docid": "a1ad37354d45a6da0bced30f41dac138", "score": "0.50223285", "text": "scaleToRef(scale, result) {\n for (let index = 0; index < 16; index++) {\n result._m[index] = this._m[index] * scale;\n }\n result._markAsUpdated();\n return this;\n }", "title": "" }, { "docid": "7ec9816100cb11bd00f6b1c005eb90fc", "score": "0.50171524", "text": "get scale() { return this._scale; }", "title": "" }, { "docid": "7ec9816100cb11bd00f6b1c005eb90fc", "score": "0.50171524", "text": "get scale() { return this._scale; }", "title": "" }, { "docid": "ce27754db68fec30a85e5edbb9390524", "score": "0.50069", "text": "transform(a) {\n const x = a.x * this.m11 + a.y * this.m21 + a.z * this.m31;\n const y = a.x * this.m12 + a.y * this.m22 + a.z * this.m32;\n const z = a.x * this.m13 + a.y * this.m23 + a.z * this.m33;\n return new Vec3(x, y, z);\n }", "title": "" }, { "docid": "70b93603ec50a99d97d6867e28f1b0bc", "score": "0.49975038", "text": "function i$3(t,r,n,a){const m=r.getComponentAabb(n,t,p),s=r.getObjectTransform(n);for(let c=0;c<8;++c)b$1[0]=1&c?m[0]:m[3],b$1[1]=2&c?m[1]:m[4],b$1[2]=4&c?m[2]:m[5],S(b$1,b$1,s.rotationScale),u$3(b$1,b$1,s.position),a[3*c]=b$1[0],a[3*c+1]=b$1[1],a[3*c+2]=b$1[2];return a}", "title": "" }, { "docid": "86e78cc139fda41d33c5bdfd84d01f4a", "score": "0.49947608", "text": "function vrToNormalized2D(X,Y,Z=0){\n\tscaleX = -0.03;\n\tscaleY = 0.034;\n\ttransformX = 0.427;\n\ttransformY = 0.508;\n\t\n\tx = scaleX * Y + transformX;\n\ty = scaleY * X + transformY;\n\t\n\treturn [x, y]\n}", "title": "" }, { "docid": "d12e36d3a5484d16874df5259e597411", "score": "0.498667", "text": "transform (x = 0, y = 0, angle = 0, scaleX = 1, scaleY = 1) {\n\n let c = Math.cos(angle);\n let s = Math.sin(angle) * this.rotationDirection;\n\n this[0] = c * scaleX;\n this[1] = -s * scaleY;\n this[2] = 0;\n this[3] = s * scaleX;\n this[4] = c * scaleY;\n this[5] = 0;\n this[6] = x;\n this[7] = y;\n this[8] = 1;\n\n return this;\n\n }", "title": "" }, { "docid": "b243ce3189a2be2a71c092344445159a", "score": "0.49788782", "text": "updateScaleMatrix()\n\t{\n\t\t//TODO:\n\t}", "title": "" }, { "docid": "2b72f24818442691262b5f839a83f8f9", "score": "0.49730486", "text": "scale(x,y,z) {\r\n\t mat4.scale(this.modelMatrix, this.modelMatrix, [x,y,z])\r\n\t}", "title": "" }, { "docid": "c176ca2fe88a96745b232cbc25404122", "score": "0.49717453", "text": "update() {\n\n if (this.tracking)\n {\n this.rotation = Math.atan2(this.body.velocity.y, this.body.velocity.x);\n }\n if (this.scaleSpeed > 0)\n {\n this.scale.x += this.scaleSpeed;\n this.scale.y += this.scaleSpeed;\n }\n }", "title": "" } ]
096e92994691b44e4eac37e82a7e717a
Returns this GameEvent as a string
[ { "docid": "e121a58ca7763775079c9163dd070696", "score": "0.6476522", "text": "toString() {\n return this.type + \": @\" + this.time;\n }", "title": "" } ]
[ { "docid": "bcbe1d06a669891941f9bf3989659237", "score": "0.7320065", "text": "toString () {\n\t\t\treturn `[Evt: ${this.name}]`;\n\t\t}", "title": "" }, { "docid": "edb8c60c3fc3013442805243a20b99a8", "score": "0.6987504", "text": "toString() {\n var eventTypeName = this.constructor.name,\n slotListStr=\"\", i=0, evtStr=\"\",\n decPl = oes.defaults.simLogDecimalPlaces;\n Object.keys( this).forEach( function (prop) {\n var propLabel = (this.constructor.labels && this.constructor.labels[prop]) ?\n this.constructor.labels[prop] : \"\";\n if (propLabel && this[prop] !== undefined) {\n slotListStr += (i>0 ? \", \" : \"\") + propLabel +\": \"+ JSON.stringify( this[prop]);\n i = i+1;\n }\n }, this);\n if (slotListStr) evtStr = `${eventTypeName}{ ${slotListStr}}`;\n else evtStr = eventTypeName;\n return `${evtStr}@${math.round(this.occTime,decPl)}`;\n }", "title": "" }, { "docid": "6591ced4f2b18321f7a6ecfa68e59cfa", "score": "0.6605858", "text": "toString(){\n return super.toString() + \"\\nYou have organized \" + this._specialEvents.length + \" events.\";\n }", "title": "" }, { "docid": "6591ced4f2b18321f7a6ecfa68e59cfa", "score": "0.6605858", "text": "toString(){\n return super.toString() + \"\\nYou have organized \" + this._specialEvents.length + \" events.\";\n }", "title": "" }, { "docid": "aec2c1688bb9be7274efea455ca1eced", "score": "0.6532591", "text": "toString() {\n return new ConsoleGameRenderer().render(this);\n }", "title": "" }, { "docid": "236a62774730ae88ead0b8982e136e2e", "score": "0.63206196", "text": "function getEventsString(){\n var outputStr = \"\";\n \n event_stack.forEach(function(item,index,array){\n outputStr += item;\n outputStr += \",\";\n });\n return outputStr;\n}", "title": "" }, { "docid": "eac3c39fa74961b1fffc0f01a935fdd0", "score": "0.60940975", "text": "toString() {\r\n return '[\"' + this.player + '\",\"' + this.getPosition() + '\"]';\r\n }", "title": "" }, { "docid": "020cddc366497108806313969b80963b", "score": "0.6090867", "text": "toString() {\n let str = '';\n for (var p in this) {\n str += p + ': ' + this[p] + '\\n';\n }\n return str;\n }", "title": "" }, { "docid": "3d73d2a37deab6d3e3f4a057bd92bb06", "score": "0.6089059", "text": "toString() {\n return this.to_str()\n }", "title": "" }, { "docid": "f8269b0ef04e14839262cd4094f1b29a", "score": "0.6085878", "text": "getEventName () {\n return _eventName;\n }", "title": "" }, { "docid": "ffd8686f6ac809377da393ddf100a6e0", "score": "0.6081637", "text": "getEventName () {\n return _eventName;\n }", "title": "" }, { "docid": "01a7495eeb45f836607ccc8641e96983", "score": "0.6055285", "text": "get eventText() {\r\n var _a;\r\n return (_a = this.message.action) === null || _a === void 0 ? void 0 : _a.text;\r\n }", "title": "" }, { "docid": "5fc3b3427b6236b84ea8d389853c5d89", "score": "0.60482454", "text": "get icalString()\n\t{\n\t\treturn this._calEvent.icalString;\n\t}", "title": "" }, { "docid": "86da077267a2727d6d70a2a2b3f820a8", "score": "0.602572", "text": "toString() {\n return JSON.stringify({\n type: this.type,\n data: utils.formatKeys(this.data, utils.toSnake),\n });\n }", "title": "" }, { "docid": "107bc481d72e314bbe324c24825ed00c", "score": "0.5942103", "text": "toString () {\n let str = '--Timers--\\n'\n for (let i in this.entries) {\n str += i + ': avg=' + this.entries[i].avg / this.entries[i].nb + ' (' + this.entries[i].nb + ' occurences)\\n'\n }\n return str\n }", "title": "" }, { "docid": "d9682ca87b8bb43262cc180a1ef875c0", "score": "0.5909698", "text": "toString () {\n\t\tconst now = Date.now ();\n\t\tconst lastStatusTime = (this.lastStatusTime > 0) ? `${this.lastStatusTime}/${this.lastStatusTime - now}` : `${this.lastStatusTime}`;\n\t\tconst lastInvokeTime = (this.lastInvokeTime > 0) ? `${this.lastInvokeTime}/${this.lastInvokeTime - now}` : `${this.lastInvokeTime}`;\n\t\treturn (`<Agent id=${this.agentId} targetHostname=${this.targetHostname} displayName=${this.displayName} applicationName=\"${this.applicationName}\" urlHostname=${this.urlHostname} version=${this.version} linkPath=${this.linkPath} taskCount=${this.taskCount} runCount=${this.runCount}/${this.maxRunCount} lastStatusTime=${lastStatusTime} lastInvokeTime=${lastInvokeTime} runDuration=${this.runDuration}>`);\n\t}", "title": "" }, { "docid": "8e3bf13c74310eeafc9bc6827e803d0c", "score": "0.5850215", "text": "function toStr() {\n return this.id;\n }", "title": "" }, { "docid": "0acdcebf68e4a256cb952a5dbd5e1b2a", "score": "0.5833815", "text": "toString() {\n return this._string;\n }", "title": "" }, { "docid": "76d5153bed63cc4dfcc15570ed0d4df0", "score": "0.5826445", "text": "function eventNumberToHtml() {\n document.getElementById(\"output\").innerHTML = currentEvent;\n}", "title": "" }, { "docid": "bce1f390f82d536b186c6572de162a18", "score": "0.5823744", "text": "toString () {\n return this._string;\n }", "title": "" }, { "docid": "5776632fd6e3987b7507bbcb6bd27b72", "score": "0.58153015", "text": "toJSON() {\n return this._events.toJS();\n }", "title": "" }, { "docid": "2d23ed1ad8555294b67e7b211935ed6c", "score": "0.57735527", "text": "get rawEvent() {\n return this._rawEvent;\n }", "title": "" }, { "docid": "2d23ed1ad8555294b67e7b211935ed6c", "score": "0.57735527", "text": "get rawEvent() {\n return this._rawEvent;\n }", "title": "" }, { "docid": "96281bbf0ceb715ada3c6f409b35fb22", "score": "0.5761402", "text": "toString() {\n return this.traceparent.toString();\n }", "title": "" }, { "docid": "19cfc388b1c986c1755c83b51bc20681", "score": "0.57534325", "text": "toString() {\n return `[Message; Text: ${this.text}; GUID: ${this.guid}]`;\n }", "title": "" }, { "docid": "5f9fb80d114a117743680cac569f64fe", "score": "0.57414854", "text": "function toString() {\n\t return static_1.html(this, this.options);\n\t}", "title": "" }, { "docid": "480de37b3e3cb212f8b9591a02ad1c96", "score": "0.5718211", "text": "toString() {\n return JSON.stringify(this.toJSON());\n }", "title": "" }, { "docid": "d046a0c4bf187c00aea7ef29193b28e6", "score": "0.5707312", "text": "get message() {\n return this._rawEvent.message;\n }", "title": "" }, { "docid": "e645be8dc70c8ec3c457d125246bdfcd", "score": "0.56965256", "text": "toString() {\n return JSON.stringify(this.toJSON());\n }", "title": "" }, { "docid": "8721b2761e4214087e0ea02a83b3a0b4", "score": "0.568367", "text": "toString() {\n return \"\" + this._value;\n }", "title": "" }, { "docid": "df8750e85be9a04402b6d394dabed6ca", "score": "0.5679782", "text": "toString() {\n return (0, $fae977aafc393c5c$export$60dfd74aa96791bd)(this);\n }", "title": "" }, { "docid": "f300166593652cbba9eabc6e2164fa07", "score": "0.5659796", "text": "function keystrokeSerialize() {\n return this.keyCode + \",\" + this.timeDown + \",\" + this.timeUp;\n}", "title": "" }, { "docid": "8df1747a887d6df6632019d3d55a1752", "score": "0.56315196", "text": "toString() { return inspect(this) }", "title": "" }, { "docid": "014b1ffd0cc1445d508ac93f091ebba8", "score": "0.56315154", "text": "toString() {\n return this._toString;\n }", "title": "" }, { "docid": "ab6b10a2e11481d96e3b28d01864ba6a", "score": "0.5623591", "text": "toString() {\n return (0, $fae977aafc393c5c$export$bf79f1ebf4b18792)(this);\n }", "title": "" }, { "docid": "6c4e8f5f60e51681f60f9ef8497e7f11", "score": "0.5611742", "text": "toString() {\n return (0, $fae977aafc393c5c$export$f59dee82248f5ad4)(this);\n }", "title": "" }, { "docid": "04cebbb4fa127290679673f304ebfa14", "score": "0.56015456", "text": "function _toString() {\n\t\tvar data = \"\";\n\n\t\tfor(var key in map)\n\t\t\tdata += key + \"=\" + map[key] + \"\\n\";\n\n\t\tconsole.log(\"data\", data);\n\n\t\treturn data;\n\t}", "title": "" }, { "docid": "280818e15ca2dd3b4f437584aa2040da", "score": "0.5593543", "text": "toString() {\n return (0, $fae977aafc393c5c$export$4223de14708adc63)(this);\n }", "title": "" }, { "docid": "7944ebb2074cb3f93e47c13a97fa0168", "score": "0.55907696", "text": "event_getArrayString() {\n return this._events;\n }", "title": "" }, { "docid": "6201ce55e1d382d76f0115affbfe7741", "score": "0.55771077", "text": "toString() {\n return \"Old Position: \" + this.oldPosition + \", New Position: \" + this.position;\n }", "title": "" }, { "docid": "9029376ff4b24d0eaf5da5dfd953b6ab", "score": "0.5559483", "text": "toString() {\n let str = \"\";\n this.forEach((key) => str += key + \" -> \" + this.get(key).toString() + \"\\n\");\n return str;\n }", "title": "" }, { "docid": "4cc8b42fa43a4284d27b91811cec3038", "score": "0.55594456", "text": "function toString(){\r\n\t\treturn this.axonValue();\r\n\t}", "title": "" }, { "docid": "a2734f889af44fdce5938f7681ff54af", "score": "0.55389524", "text": "toString() {\n this.format(false);\n }", "title": "" }, { "docid": "a2734f889af44fdce5938f7681ff54af", "score": "0.55389524", "text": "toString() {\n this.format(false);\n }", "title": "" }, { "docid": "8c108f3da454a60f79092ddf109cc941", "score": "0.55274105", "text": "toString() {\n return JSON.stringify(this.toJSON());\n }", "title": "" }, { "docid": "8c108f3da454a60f79092ddf109cc941", "score": "0.55274105", "text": "toString() {\n return JSON.stringify(this.toJSON());\n }", "title": "" }, { "docid": "db2322351256fd612896a8047d1a9eb0", "score": "0.5523815", "text": "function as_string() {\n return this.quien + \": \" + this.resultado();\n}", "title": "" }, { "docid": "5e33a7381bb4e0a1b3c34f50a679f100", "score": "0.5521247", "text": "toString(){\n return `Block -\n Timestamp : ${this.timestamp}\n Last Hash : ${this.lastHash}\n Hash : ${this.hash}\n Nonce : ${this.nonce}\n Difficulty : ${this.difficulty}\n Data : ${this.data}`\n }", "title": "" }, { "docid": "cbd2a3c96f098e0682fca0595e5f26e2", "score": "0.55193204", "text": "function formatEventForCardContent(event) {\n let result = \"\";\n\n if (event.summary) {\n result += \"Event Zusammenfassung: \" + event.summary + \" - \"\n }\n\n if (event.description) {\n result += \"Event Beschreibung: \" + event.description + \" - \"\n }\n\n if (event.location) {\n result += \"Event Location: \" + event.location + \" - \"\n }\n\n if (event.from) {\n result += \"Startet am: \" + event.from + \" - \"\n }\n\n if (event.to) {\n result += \"Endet am: \" + event.to + \" - \"\n }\n\n return result\n}", "title": "" }, { "docid": "1ec3f2c3219dbbab88827b4be43c8517", "score": "0.55161196", "text": "toString(): string {\n return this._.id();\n }", "title": "" }, { "docid": "0ef14a924a13234dce3577ed8df54ad5", "score": "0.54840446", "text": "function i(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "0ef14a924a13234dce3577ed8df54ad5", "score": "0.54840446", "text": "function i(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "c304ab121ac2239bdc75b14f01e52e97", "score": "0.5470648", "text": "get humanize() {\n return this._event.humanize;\n }", "title": "" }, { "docid": "47fe1bd89acfaf6c6a00b5a610e99f59", "score": "0.54678565", "text": "toString() {\n return \"[\" + this.getName() + \"]\";\n }", "title": "" }, { "docid": "15f90dfaadd85761378510b6c4001239", "score": "0.54664475", "text": "toString() {\n\n // return the identifier\n return this[identifier];\n }", "title": "" }, { "docid": "4835eede7e428c2d96b18c8ac83664ae", "score": "0.54653865", "text": "toString() {\n\t\treturn binaryToHex(this.data)\n\t}", "title": "" }, { "docid": "6a3d6c55ab4e74ff8440d0ffe580c1cd", "score": "0.5459211", "text": "toString() {\n return (this.x + \",\" + this.y + \"@\" + this.w) + \":\";\n }", "title": "" }, { "docid": "dbf2a545248edae576031e1b7541a24b", "score": "0.54590774", "text": "toString() {\n return '[GameMaster]';\n }", "title": "" }, { "docid": "8da1351604b3883761a62cdb44f6dfbd", "score": "0.54473865", "text": "function renderEvent(eachEvent){\n\tvar epochTime = eachEvent.time\n\tvar d = new Date(epochTime);\n\t//d.setUTCSeconds(epochTime);\n\tvar formattedDate = d.toLocaleDateString() + \" @ \" + d.toLocaleTimeString();\n\tlet eachEventHtml = \n\t\t`<div class=\"results-div text-box\">\n\t\t\t<a href=\"${eachEvent.link}\" name=\"${eachEvent.name}\" aria-label=\"${eachEvent.name}\">\n\t\t\t\t<h1 class=\"results-title\">${eachEvent.name}</h1>\n\t\t\t</a>\n\t\t\t<h2 class=\"results-datetime\">\n\t\t\t\tWhen: ${formattedDate}\n\t\t\t</h2>\n\t\t\t<div class=\"results-description\">\n\t\t\t${eachEvent.description}\n\t\t\t</div>\n\t\t\t<a href=\"#back-to-the-top\"><p class=\"return\">Return to the top</p></a>\n\t\t</div>`\n\n\treturn eachEventHtml;\n}", "title": "" }, { "docid": "cd28964cc657d290a8f12d2c9b90ce71", "score": "0.5438585", "text": "getName(event) {\n return parseStrFormat(event, this.title, this.isHTML);\n }", "title": "" }, { "docid": "15e3cc994c8e8591436cf61c295d65b6", "score": "0.5433684", "text": "function r(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "2c916d8afc5912f3fe27ab13bacfa3fa", "score": "0.54318213", "text": "encode()\n\t\t{\n\t\t\treturn \"\" + String.fromCharCode(this.packetId);\n\t\t}", "title": "" }, { "docid": "4eda4583fede8ce8a188019a6d4b2fe1", "score": "0.5423982", "text": "toString() {\n return `Name: ${this.name}, Age: ${this.age}`;\n }", "title": "" }, { "docid": "e178fac1f04e624ab9fad1eeb06279be", "score": "0.5414721", "text": "toString() {\n return \"Mouse(\" + this.x + \",\" + this.y + \")\";\n }", "title": "" }, { "docid": "e178fac1f04e624ab9fad1eeb06279be", "score": "0.5414721", "text": "toString() {\n return \"Mouse(\" + this.x + \",\" + this.y + \")\";\n }", "title": "" }, { "docid": "e2e5d3c1341d3bc8146702edd8f05c42", "score": "0.5391402", "text": "toString() {\n\t\treturn \"(\" + this.x + \",\" + this.y + \")\";\n\t}", "title": "" }, { "docid": "f680e0b648c29f76f1470160b467d291", "score": "0.5390873", "text": "get event() {\n return currentEvent;\n }", "title": "" }, { "docid": "ba1dc7764a72ae9dc5611ee94cc9b802", "score": "0.5386254", "text": "toString() {\n return JSON.stringify(this.stack);\n }", "title": "" }, { "docid": "54679da964c807248f7dec428042422b", "score": "0.5384508", "text": "toString() {\n return \"(center: \" + this.center.toString() + \", half-size: \" + this.halfSize.toString() + \")\";\n }", "title": "" }, { "docid": "9637180c42084bf3dcc273d9c1ad523c", "score": "0.5375073", "text": "toString() {\n let str = \"\";\n this.walk(function(chunk) {\n str += chunk;\n });\n return str;\n }", "title": "" }, { "docid": "aec9a217f054c6fd411e4008eabb3161", "score": "0.53661007", "text": "toString() {\n return this.match({\n stay: () => '[Transition Stay]',\n trans: (_name, _counter, _func) => '[Transition Trans]',\n end: () => '[Transition End]'\n });\n }", "title": "" }, { "docid": "888fafeb771e90bba6cdfc02d5894041", "score": "0.5362889", "text": "toString(){\n return `Block -\n TimeStamp : ${this.timestamp}\n lastHash : ${this.lastHash.substring(0, 10)}\n Hash : ${this.hash.substring(0, 10)}\n Nonce : ${this.nonce}\n DIFFICULTY : ${this.difficulty}\n Data : ${this.data}`;\n }", "title": "" }, { "docid": "52a6cc32cd3590b21345636feb7b177c", "score": "0.53479874", "text": "toString() {\r\n return (\r\n '\"boardXSize\":' + this.boardSizeX + ',\"boardYSize\":' + this.boardSizeY\r\n );\r\n }", "title": "" }, { "docid": "233b64937fff0acf9b05cb5029a03786", "score": "0.53408706", "text": "toJson () {\n const serialized = {};\n\n Object.keys(this).forEach(\n key => {\n const originalValue = this[key];\n\n // Dont persist blanks\n if (\n ! Util.exists(originalValue) ||\n Util.isArray(originalValue) && originalValue.length === 0 ||\n typeof originalValue === 'object' && Object.keys(originalValue).length === 0\n ) {\n return;\n }\n\n if (key === 'outcomes') {\n serialized[key] = originalValue.map(\n outcome => outcome.id\n );\n\n return;\n }\n\n if (key === 'coord') {\n // The coord might be stored nowhere else except in this event, so must be persisted fully.\n serialized[key] = originalValue;\n return;\n }\n\n serialized[key] = originalValue.id || Util.toJson(originalValue);\n }\n );\n\n return serialized;\n }", "title": "" }, { "docid": "7d3b9d84f620b10496a9493ead7fc7b8", "score": "0.5326954", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "title": "" }, { "docid": "3baaafd1755d05342496359eab01ffe8", "score": "0.5308552", "text": "toString() {\n return \"{TimedHandler: \" + this.handler + \"(\" + this.period + \")}\";\n }", "title": "" }, { "docid": "3baaafd1755d05342496359eab01ffe8", "score": "0.5308552", "text": "toString() {\n return \"{TimedHandler: \" + this.handler + \"(\" + this.period + \")}\";\n }", "title": "" }, { "docid": "13f12536955f9f0a6bc855c237cf8426", "score": "0.5304436", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data, this.replacer);\n }\n return str;\n }", "title": "" }, { "docid": "8ff1a7ce3fc98fc23d78a0d6fbc3c50b", "score": "0.53033257", "text": "toString() {\n return \"{Handler: \" + this.handler + \"(\" + this.name + \",\" + this.id + \",\" + this.ns + \")}\";\n }", "title": "" }, { "docid": "8ff1a7ce3fc98fc23d78a0d6fbc3c50b", "score": "0.53033257", "text": "toString() {\n return \"{Handler: \" + this.handler + \"(\" + this.name + \",\" + this.id + \",\" + this.ns + \")}\";\n }", "title": "" }, { "docid": "a99ec63f2b24a5b9128eb12312082252", "score": "0.53030264", "text": "get event() {\r\n return this._event;\r\n }", "title": "" }, { "docid": "bd2ccc6745acdbb6a5229ecfb45aca97", "score": "0.5301851", "text": "toString() {\n let result = super.toString();\n if (this.typeParameters) {\n const parameters = [];\n this.typeParameters.forEach((parameter) => {\n parameters.push(parameter.name);\n });\n result += \"<\" + parameters.join(\", \") + \">\";\n }\n if (this.type) {\n result += \":\" + this.type.toString();\n }\n return result;\n }", "title": "" }, { "docid": "0dae4319bbdc56e7bcba9a9af286a727", "score": "0.529675", "text": "toString() {\n return `_name: ${this._name} , _email: ${this._email}`\n }", "title": "" }, { "docid": "6e8c68b0f9c0ed843d5c1c082adddce6", "score": "0.52901554", "text": "toString() {\n return \"[class Key<\" + this.down.length.toString(10) + \",\" + this.pressed.length.toString(10) + \">]\";\n }", "title": "" }, { "docid": "52ed9b91a13b966f2e7cbeeab34fd4cd", "score": "0.52889246", "text": "toString(){ \r\n\t\treturn (`Name of person: ${this.name}`); \r\n\t}", "title": "" }, { "docid": "eb9a099d7aa95232ac8e9fab104ebc81", "score": "0.5286027", "text": "toString(){\n return `Nome: ${this.nome}\\n`+\n `CPF: ${this.cpf}\\n`+\n `Agencia: ${this.agencia}\\n`+\n `Saldo: ${this.saldo}\\n`\n }", "title": "" }, { "docid": "c3bac65ecd0518460965354c7ffcc52c", "score": "0.5284804", "text": "toString() {}", "title": "" }, { "docid": "8a1c2917b68daa7a3b86bddaa63e137e", "score": "0.5283589", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "title": "" }, { "docid": "8a1c2917b68daa7a3b86bddaa63e137e", "score": "0.5283589", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "title": "" }, { "docid": "8a1c2917b68daa7a3b86bddaa63e137e", "score": "0.5283589", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "title": "" }, { "docid": "8a1c2917b68daa7a3b86bddaa63e137e", "score": "0.5283589", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "title": "" }, { "docid": "8a1c2917b68daa7a3b86bddaa63e137e", "score": "0.5283589", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "title": "" }, { "docid": "719dc71e55411db794dc594b89c30cdd", "score": "0.5283043", "text": "toString () {\n return \"(\" + this.x + \", \" + this.y + \")\";\n }", "title": "" }, { "docid": "8c307c949e59b5e99c70b40619775585", "score": "0.52726173", "text": "toString() {\n return this.toArray().toString()\n }", "title": "" }, { "docid": "8ac7d1d5d681a330ad5b1d5f6468b496", "score": "0.5272413", "text": "toString() {\n return this.data;\n }", "title": "" }, { "docid": "813812ef43651e1eb1e731babbe3aee9", "score": "0.5259672", "text": "toString() {\n }", "title": "" }, { "docid": "facb3ec2fe4d09ab94f7b6eaeb22859f", "score": "0.5254334", "text": "toString(){\n\t\treturn this.symbol + \"->\" + this.q.toString();\n\t}", "title": "" }, { "docid": "55f1857eaf305e8589d774055490a1aa", "score": "0.525418", "text": "toString() {\n return this.moment.toString();\n }", "title": "" }, { "docid": "27429558438eb2a2871f988d26c6d83a", "score": "0.52467114", "text": "function ToString(type) {\n\t\tswitch(type) {\n\t\t\tcase \"keys\":\n\t\t\t\treturn fingering.ToString();\n\t\t\tbreak;\n\t\t\tcase \"note_tones\":\n\t\t\t\treturn note.ToString();\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn fingering.ToString();\n\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "cd62ebb4b2e446b204fc7e0ef637992e", "score": "0.5245086", "text": "toString() {\n return '[Scenes <' + this.sceneNum.toString() + '>]';\n }", "title": "" } ]
117ede17e48ab7ef17a99329162ed4b7
1. does not have block scope and that can lead to errors 2. you may redefine a var, but that makes no sense
[ { "docid": "36a900af10869fb4d53c3571d991e01a", "score": "0.66465896", "text": "function foo() {\n var local1 = 4;\n var local1 = 2; //why would anyone redefine a variable in the same scope?\n \n {\n var local2 = 7;\n console.log(local2);\n }\n \n console.log(local1);\n console.log(local2);\n}", "title": "" } ]
[ { "docid": "672c23d308a6dfad57d5984b1eeca7c7", "score": "0.7040555", "text": "function noRedeclaration() {\n\nvar val = 444;\n\n\n\nvar val = 333 ; // change var with let will throw an error if declared on the same scope\n\n console.log(val);\n return val\n}", "title": "" }, { "docid": "b87feca81dcf58bc7c99855ade02abf1", "score": "0.6796204", "text": "function blockScopedVar()\n{\n if (test())\n {\n var block = 7;\n }\n\n block = 13;\n}", "title": "" }, { "docid": "a1ef89dd335a4dc566845c67a2796733", "score": "0.67087954", "text": "function foo() {\r\n var a;\r\n console.log(a); // undefined\r\n a = 2;\r\n}", "title": "" }, { "docid": "517d553cd4db124b8c101ca6befc3af7", "score": "0.6658005", "text": "function test() {\n //try play around changing var/let/\n var x = 4,\n y = 3;\n console.log(x, y);\n {\n //new scope => it could be a for, a function a if or just a new scope { }\n //try play around changing var/let/\n var _y = 6;\n console.log(x, _y);\n }\n console.log(x, y);\n}", "title": "" }, { "docid": "7d6ea42ac82f9ea591c40fd3d52ea82c", "score": "0.66206306", "text": "function foo() {\n var a;\n var b;\n a = 2;\n console.log( a ); // 2\n console.log( b ); // undefined\n b = 2;\n}", "title": "" }, { "docid": "67588e918fd1722027807c4a54923ae2", "score": "0.66082937", "text": "function hoistVariable(){\n\tvar gio;\n\treturn gio;\n\tgio = \"giorgi\";\n}", "title": "" }, { "docid": "acc12f6a765e9f3d866c7d713bd276da", "score": "0.6605367", "text": "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "acc12f6a765e9f3d866c7d713bd276da", "score": "0.6605367", "text": "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "e8b2d4111e1b855af1c9906f1272e2f1", "score": "0.65445393", "text": "function foo() {\n\t\t\ta = 3;\n\t\t\texpect(a).toBe(3);\n\t\t\tvar a; // declaration is \"hoisted\" to the top of foo()\n\t\t}", "title": "" }, { "docid": "9eae8324081263e29c372835deee0ae8", "score": "0.64637434", "text": "function do_something2(){\n bar=11;\n console.log(bar);\n var bar;\n console.log(bar);\n}", "title": "" }, { "docid": "1b8af2f96aa893c92f5bb110d2823e7f", "score": "0.6461248", "text": "function hello() {\n a = 'hello';\n console.log(a);\n\n if (false) {\n var a = 'hello again';\n }\n}", "title": "" }, { "docid": "0b7d8d47c78c085634682a5f5ffe9457", "score": "0.643066", "text": "function tempFunction () {\n\tvar a,b,c;\n\t//.... Keep variable contained within this scope\n }", "title": "" }, { "docid": "37e8ea9afea3fd5a9a60859bcce06a13", "score": "0.64207345", "text": "function test() {\n a = 5;\n var a = 10;\n console.log(a); // will be 10\n}", "title": "" }, { "docid": "a384d03fe77f7f75b135e9a9ad6128e9", "score": "0.64004964", "text": "function mysteryScoping3() {\n let x = 'out of block';\n if (true) {\n let x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "7642a5b820f6cdf624f0cfa2ea2e1f99", "score": "0.63929933", "text": "function hoistVariable(){\n\treturn gio;\n\tvar gio = \"giorgi\";\n}", "title": "" }, { "docid": "5fde51acf3dedec22397a872a2c4bdd6", "score": "0.63803977", "text": "function scopeDemo() {\n {\n // You can mutate const variables but strings are immutable anyway\n const stubborn = 'I will never change';\n let blockLet = 'Let me be';\n var oldSchool = 'Who is var?';\n\n // if (true) {\n // const other = 'hi';\n // console.log(blockLet);\n // }\n // console.log(other); // -> ReferenceError\n\n // stubborn = 'Maybe I can change'; // -> TypeError\n blockLet = 'I am not what I used to be'; // -> this works\n oldSchool = 'I am the var'; // -> this also works\n }\n\n // console.log(stubborn); // -> ReferenceError\n // console.log(blockLet); // -> ReferenceError\n console.log(oldSchool); // -> this works\n }", "title": "" }, { "docid": "5416261e50f03c1babd379667ec7ac70", "score": "0.6370088", "text": "function mysteryScoping4() {\n let x = 'out of block';\n if (true) {\n let x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "6ff6a39b192a147aa7cb8b51aba86dea", "score": "0.63662225", "text": "function mysteryScoping2() {\n const x = 'out of block';\n if (true) {\n const x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "6ff6a39b192a147aa7cb8b51aba86dea", "score": "0.63662225", "text": "function mysteryScoping2() {\n const x = 'out of block';\n if (true) {\n const x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "6ff6a39b192a147aa7cb8b51aba86dea", "score": "0.63662225", "text": "function mysteryScoping2() {\n const x = 'out of block';\n if (true) {\n const x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "f8b8260bb7e196038ed1710048c5845e", "score": "0.6358769", "text": "function foo() {\n var x;\n bar();\n x = 1;\n}", "title": "" }, { "docid": "f12f8d35183ca56385a1ec563f976a8d", "score": "0.6345255", "text": "function foo1(){\n if(true){\n let x = 11;\n }\n // console.log(x); <-- ReferenceError\n}", "title": "" }, { "docid": "540abe3d7e20092a983111f079c6fe15", "score": "0.6320584", "text": "function bar(){\n var foo = \"baz\";\n }", "title": "" }, { "docid": "3727ee37659b5331aae33a79d7f2e4b5", "score": "0.6317343", "text": "function testVar(){\n\tvar a = 30;\n\tif(true) {\n\t\tvar a = 50;\n\t\tconsole.log(a);\n\t}\n\tconsole.log(a);\n}", "title": "" }, { "docid": "75018ea587879e9c928b5058f5a2b374", "score": "0.6290686", "text": "function foo() {\n\tvar bar;\n\tquux = 2;\n\tfunction zip() {\n var quux;\n\t}\n}", "title": "" }, { "docid": "fe4dff745021d7d3a3a0b1ffe34332c7", "score": "0.627544", "text": "function b() {\n var myVar;\n}", "title": "" }, { "docid": "439575dc40a37492393465cb186b5868", "score": "0.62670255", "text": "function foo() {\n\n var x = 1;\n\n if (x) {\n (function () {\n var x = 2;\n // some other code\n }());\n }\n\n // x is still 1\n}", "title": "" }, { "docid": "8a487bd2355db9f07d061daa8691cd64", "score": "0.626058", "text": "function do_something() {\n console.log(bar); // undefined\n console.log(foo); // ReferenceError\n var bar = 1;\n let foo = 2;\n}", "title": "" }, { "docid": "0ac5eda62975f2929d6ce1ac1ad5a33c", "score": "0.62600493", "text": "function test() {\n myVar = 'Hello, World';\n console.log(myvar); // myvar did not declare\n}", "title": "" }, { "docid": "9980ed032d73e857469328c35d169aea", "score": "0.62588745", "text": "function testVar() {\n var a = 30;\n if (true) {\n a = 50;\n console.log(a);\n }\n console.log(a);\n }", "title": "" }, { "docid": "e49abe1d53ee694a0131a76cb6eb20a5", "score": "0.6231629", "text": "function mysteryScoping5() {\n let x = 'out of block';\n if (true) {\n let x = 'in block';\n console.log(x);\n }\n let x = 'out of block again';\n console.log(x);\n}", "title": "" }, { "docid": "e49abe1d53ee694a0131a76cb6eb20a5", "score": "0.6231629", "text": "function mysteryScoping5() {\n let x = 'out of block';\n if (true) {\n let x = 'in block';\n console.log(x);\n }\n let x = 'out of block again';\n console.log(x);\n}", "title": "" }, { "docid": "1fe3a79eac92ed260776055574c25889", "score": "0.6218001", "text": "function hoist() {\n a = 20;\n var b = 100;\n }", "title": "" }, { "docid": "99d4567c44fe2d4f44031f34c4421b1c", "score": "0.6214325", "text": "function myLocalScope() {\n\n // Only change code below this line\n var myVar;\n console.log('inside myLocalScope', myVar);\n}", "title": "" }, { "docid": "f6c3e77e95c6a969569e3125cbdeb69c", "score": "0.62140316", "text": "function test () {\n\tvar a = 'ok'\n var error\n}", "title": "" }, { "docid": "6171f5fe36f141c6e9069c1f4159f453", "score": "0.6212957", "text": "function foo() {\n let foo,\n bar;\n if ( condition ) {\n bar = \"\";\n // statements\n }\n}", "title": "" }, { "docid": "63b5d1bcb3a12db16aca4d476cbb4107", "score": "0.6207429", "text": "function foo() {\n\n // some statements here\n\n var bar = \"\",\n qux;\n}", "title": "" }, { "docid": "22aaafdb05bd8f4af48bfc15e3055a5b", "score": "0.61933035", "text": "function foo() {\n a = 3;\n\n console.log( a ); // 3\n\n var a; // declaration is \"hoisted\"\n // to the top of `foo()`\n}", "title": "" }, { "docid": "19e5a13a3fba8e23426141b42c9dc815", "score": "0.6176935", "text": "function test_99() {\n // local scope\n let foo_99 = 21;\n}", "title": "" }, { "docid": "3df120266ece8b87a1269298f60fe62e", "score": "0.61757886", "text": "function letFunc () {\n // console.log(letVariable) // 20\n letVariable = 30\n // console.log(letVariable) // 30\n // let letVariable = 40\n // console.log(letVariable) // make error\n}", "title": "" }, { "docid": "7798fd38bf7470d97b77360f35586c4e", "score": "0.6166", "text": "function temp () {\n {\n let a = 10;\n }\n console.log(a);\n}", "title": "" }, { "docid": "02442bf5f72e08805b078e3c3347c813", "score": "0.6157614", "text": "function local() {\n var a = 2;\n console.log(a);\n }", "title": "" }, { "docid": "25a1b235c89259c66eefdff7d6d1cd06", "score": "0.61474234", "text": "function func() {\n if (true) {\n var tmp = 123;\n }\n console.log(tmp); // 123\n}", "title": "" }, { "docid": "0df67b341066390fa7cf039bd9ce1dab", "score": "0.614124", "text": "function variablehoisting_VisualedAs() {\n var x;\n console.log(x === undefined); // true\n x = 3;\n\n var myvar = 'my value';\n\n (function () {\n var myvar;\n console.log(myvar); // undefined\n myvar = 'local value';\n })();\n}", "title": "" }, { "docid": "84e06f613916c475e3157d1b9ee51a5d", "score": "0.6139069", "text": "function doSomethingElse() {\n let a = 1\n if (true) {\n let b = 2 // b é declarado dentro do if e não é visível fora\n }\n let c = a + b // Uncaught ReferenceError: b is not defined\n}", "title": "" }, { "docid": "146e2f152317add2b88a7a2bd2a1410b", "score": "0.6129748", "text": "function b() {\r\n let a = 4;\r\n}", "title": "" }, { "docid": "b3238b849e84552bbc48c16dcf6f9396", "score": "0.61244094", "text": "function foo() {\n var a = 1;\n\n function bar() {\n a = 2;\n //console.log(a); //2\n }\n bar();\n console.log(a);//2\n}", "title": "" }, { "docid": "66651a1f85b7e9c0ab9741efb066f735", "score": "0.6108712", "text": "function foo2(){\n let x = 5;\n if(true){\n let x = 10; // shadows outer x\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "2db82967cc30e8990851c3842ef26025", "score": "0.60960865", "text": "function foo() {\n\tvar bar;\n\tquux = 2;\n\tfunction zip() {\n var quux;\n bar = true;\n\t}\n\treturn zip;\n}", "title": "" }, { "docid": "96724edc7d7b0906761da5ed6833ffb7", "score": "0.6093577", "text": "function variableMasking() {\n\t{ // block 1\n\t\tconst blueVariable = 'blue';\n\t\tconsole.log(blueVariable); // blue\n\t}\n\tconsole.log(typeof blueVariable); // undefined\n\t{ // block 2\n\t\tconst blueVariable = 3;\n\t\tconsole.log(blueVariable); // 3\n\t}\n\tconsole.log(typeof blueVariable); // undefined\n}", "title": "" }, { "docid": "faa9bb79a40077ecf7f9532e1b8f4c5d", "score": "0.60926276", "text": "function b() {\r\n\tlet a = 4;\r\n}", "title": "" }, { "docid": "f005b20126ed65da27d16a90a1367501", "score": "0.60889107", "text": "function changeXTo2() {\n \"use strict\";\n var x = 2; // local\n}", "title": "" }, { "docid": "d8bf782061d931cbe5b56f28a52b1ef3", "score": "0.60855085", "text": "function blockScope() {\n let a = 1;\n if(true) {\n let a = 2; //prints 2. different variable a tied to conditional statement code block\n console.log(a)\n }\n console.log(a) //prints 1. different variable a tied to function body code block\n}", "title": "" }, { "docid": "b3bb8721880f4d99247c2a0c5fd742f8", "score": "0.6078562", "text": "function foo() {\n bar = 'mutation';\n }", "title": "" }, { "docid": "6770e7efe05d5a1e6f16fea247dfa4cb", "score": "0.6076399", "text": "function b(){\n let a = 4;\n}", "title": "" }, { "docid": "34f0711b7e368052b7a4feda337ce060", "score": "0.6073967", "text": "function bar() {\n var a = 2;\n //console.log(a); //2\n }", "title": "" }, { "docid": "135a5f5bf721a19c5315b5660fdc0be0", "score": "0.60619205", "text": "function scope1(){\n while(true){\n var x = 'mister x';\n break;\n }\n // even though x was defined inside the while block\n // we still have access to it because of the var semantics\n console.log('x is', x);\n}", "title": "" }, { "docid": "de5a20c337dd81276e9bc68f11e37f94", "score": "0.60422105", "text": "function f()\n{\n var b = 10; // 'b' is NOT a global variable\n}", "title": "" }, { "docid": "021ec365ef2ac5ff4946c22fc0576394", "score": "0.6040475", "text": "function sample() {\n\t\t\tlocalVariable.someWork = \"do\";\n\t\t\tlocalVariable.someFun = \"have\";\n\t\t}", "title": "" }, { "docid": "7f1c78217f75573ace290057fcf7bbae", "score": "0.6038554", "text": "function blockScoped(test) {\n if (test){\n let naam = \"Michael\";\n console.log(naam);\n }\n}", "title": "" }, { "docid": "775e50b56eb0c4026b3916c0eee1fa5f", "score": "0.6026306", "text": "function varTest() {\n var x = 1;\n {\n var x = 2; // same variable!\n console.log(x); // 2\n }\n console.log(x); // 2\n}", "title": "" }, { "docid": "a219f515e48fa7ebe99a1474312e18c7", "score": "0.6015188", "text": "function func() {\n const foo = 5;\n if (···) {\n const foo = 10; // shadows outer `foo`\n console.log(foo); // 10\n }\n console.log(foo); // 5\n}", "title": "" }, { "docid": "57d50d850f57d3e451f1c992e255a847", "score": "0.5998697", "text": "function foo() {\n {\n let x = 1;\n const y = 2;\n\n console.log('in block, x =', x);\n console.log('in block, y =', y);\n }\n\n //console.log('after block, x =', x); // not defined\n //console.log('after block, y =', y); // not defined\n}", "title": "" }, { "docid": "ebf5eaa23bfa5b2bc22c3e7ba9ac5993", "score": "0.5991116", "text": "function a(){} // Ignored //function \"a\" was never hoisted over variable assignment", "title": "" }, { "docid": "cad3c550d7eb32f9e2bc3690ab780312", "score": "0.5991055", "text": "function doesNotLeakVariables() {\n var localOne = 42;\n}", "title": "" }, { "docid": "11534135fba699f8e5d83b195dbf010d", "score": "0.5978833", "text": "function teste(){\n var local = 123\n\n}", "title": "" }, { "docid": "835487c623742a2e576b22286ff45d56", "score": "0.59738606", "text": "function testLet() {\n\tlet a = 30;\n\tif(true) {\n\t\tlet a = 50;\n\t\tconsole.log(a);\n\t}\n\tconsole.log(a);\n}", "title": "" }, { "docid": "f2a099ab67c8d4c767d64cfef532bd6f", "score": "0.5964766", "text": "function howLetProvidesBlockScope() {\n let apples = \"apples\";\n console.log(apples);\n // let apples = \"changing the value\";\n function innerFunction() {\n let apples = \"changing the value\";\n console.log(apples);\n function anotherNestedFunction() {\n let apples = \"Inside the nestedFunction\";\n console.log(apples);\n }\n anotherNestedFunction();\n }\n innerFunction();\n}", "title": "" }, { "docid": "70ee7783bda1ed1b99fbd1fb20384ab6", "score": "0.59576964", "text": "function differendScope() {\n var blockScopeVariable = \"differendVariable\";\n console.log(blockScopeVariable);\n}", "title": "" }, { "docid": "c7f3d6bff9e1916273d3420206619b1d", "score": "0.59571373", "text": "function blockScope() {\n let a = 'hello';\n\n if(true) {\n let b = 'goodbye';\n }\n\n // The let and const keywords do NOT hoist variables\n // This allows us to use nested block scopes as we like\n console.log(a);\n // console.log(b);\n}", "title": "" }, { "docid": "ba1fcb02fd08a305c80a79db786bae13", "score": "0.59563196", "text": "function asd() {\r\n let a=12;\r\n var b=12;\r\n}", "title": "" }, { "docid": "f4b2e9c9f779a42116fa40819811f249", "score": "0.5943575", "text": "function hello() {\n a = 'hello';\n}", "title": "" }, { "docid": "af95e190327bc092bb6f97e6524c1518", "score": "0.5928522", "text": "function testForMistypedVar() {\n\t\"use strict\";\n\ttry {\n\t\tvar temp = \"trial_variable\";\n\t\t// Mistyped variable name\n\t\ttmp = \"abc\";\n\t} catch (err) {\n\t\talert(\"Voilation:Duplicate variable been declared!!\");\n\t}\n\n}", "title": "" }, { "docid": "6c10e479d30cc010f0f1543e8c6a1e2b", "score": "0.59281784", "text": "function myLocalScope() {\r\n \"use strict\"; // you shouldn't need to edit this line\r\n var myVar;\r\n console.log(myVar);\r\n}", "title": "" }, { "docid": "0517ad5d22769d4ba9a32825d168cff6", "score": "0.5925953", "text": "function fn(){\n let d =42;\n \n for (let i=0; i<10; i+=1){\n \n }\n console.log(i);\n console.log(d);\n \n // attention: hoisting!\n let newvar = 108;\n}", "title": "" }, { "docid": "b3f190f9de3235aec1463491080f8935", "score": "0.59251827", "text": "function foo() {\n if (false) {\n var x = 1;\n }\n return ;\n var y = 1;\n}", "title": "" }, { "docid": "8d680dc5f2d3591a60698e040958fbae", "score": "0.5921233", "text": "function sample() {\n if (true) {\n let b = 20;\n var a = 10;\n }\n console.log(\"Var: \" + a);\n //console.log(\"Let: \" + b);\n}", "title": "" }, { "docid": "691ed89d9df4625e9bf1fbb544533a25", "score": "0.5911071", "text": "function initialiseVariable() {\n \n}", "title": "" }, { "docid": "510bfeb73a189d9c335944f2bb541807", "score": "0.59014815", "text": "function halloScope(){\n ini_global_scope_variable = \"ini adalah contoh global scope variable\" \n }", "title": "" }, { "docid": "eabf90bc5993f04f0b5662214bd0464c", "score": "0.5893397", "text": "function weirdScope(num){\n\n if(num < 100){\n var value =\"less than 100\" // the variable is created here \n \n }\n console.log(value)\n // used outside of the curly brackets it was defined in. Not possible in most languages\n // can lead to confusion\n}", "title": "" }, { "docid": "17f319cf10d5e4eb36d0479e38df7043", "score": "0.58917105", "text": "function switch_scope2(x: number) {\n switch (x) {\n case 0:\n a = \"\"; // error: assign before declaration\n break;\n case 1:\n var b = a; // error: use before declaration\n break;\n case 2:\n let a = \"\";\n break;\n case 3:\n a = \"\"; // error: skipped initializer\n break;\n case 4:\n var c:string = a; // error: skipped initializer\n break;\n }\n a = \"\"; // error: a no longer in scope\n}", "title": "" }, { "docid": "ffa9e2b4466649362d07fa49050c5445", "score": "0.58875155", "text": "function b() {\n let a = a;\n}", "title": "" }, { "docid": "75fdebbb599f34b5bdcd464ba6ec6933", "score": "0.5871414", "text": "function foo() {\n a = 3;\n console.log( a ); // 3\n console.log(this.a);\n var a; // declaration is \"hoisted\"\n// to the top of `foo()`\n}", "title": "" }, { "docid": "94810b586a5ad8a1adc694f525d1a7f5", "score": "0.5862775", "text": "function a() {\n\n if (1 / 2 > 0) {\n var res = 1/2;\n //the var variable works inside all function ont only inside if\n let res2 = 'res2';\n //the let variable only works here, inside of statment if\n console.log(nome);\n }\n console.log(`var res: ${res}`);\n // console.log(`let res2: ${res2}`); // - error\n}", "title": "" }, { "docid": "bd16a8fd39d584f70d4d962f2a7bd8ef", "score": "0.5859031", "text": "function doSomething() {\n for (var i = 0; i < 10; i++)\n console.log(i);\n // i value retains its value beacause of var declaration\n console.log(\"Finally i is\", i);\n for (var j = 0; j < 10; j++)\n console.log(j);\n // this will show error beacuse j has block scope\n // console.log(\"Finally j is \",j)\n}", "title": "" }, { "docid": "1546c83e42c3a5f2449835b618826988", "score": "0.58585155", "text": "function testVar() {\n var a = 30;\n let b = 30;\n if (true) {\n var a = 50;\n let b = 50;\n console.log('a local ' + a);\n console.log('b local ' + b);\n }\n console.log('a global ' + a);\n console.log('b global ' + b);\n}", "title": "" }, { "docid": "c0238f6b73ca99e4dff06fea5e925908", "score": "0.58490366", "text": "function a() {\n \n function b() {\n\n \t//var myVar = 3;\n\n console.log(myVar);\n }\n\n //var myVar = 2;\n \n\tb();\n}", "title": "" }, { "docid": "9b90527aa00c9dc4d629c11b54b9025b", "score": "0.5848587", "text": "function checkScope(){\n \"use strict\";\n var i = \"varScope\";\n {\n let i = \"new block let scope\";\n console.log(i);\n }\n console.log(i);\n}", "title": "" }, { "docid": "6a07a44c82ea7f30f548e8301f88adcd", "score": "0.5846712", "text": "function sayHi(){\n return elie;\n var elie = \"That is me\";\n}", "title": "" }, { "docid": "b2921141477821c759f0a699f8e8a6b7", "score": "0.5837046", "text": "function myFunc(){\n var x;\n console.log(x);\n x = \"100\";\n console.log(x);\n}", "title": "" }, { "docid": "8b5f85c3c39fad4934b4040458073f99", "score": "0.58350354", "text": "function fun1() {\n //Assign 5 to oopsGlobal Here\n oopsGlobal = 5;\n // if we dont put the keyword VAR before the name of the variable automatly the variable is global anyway\n}", "title": "" }, { "docid": "0cb39e7756878761141a98b18232793a", "score": "0.58291966", "text": "function foo() {\n let bar;\n let baz;\n}", "title": "" }, { "docid": "1b943cb3b690e797beeeaa4084ff4ec1", "score": "0.58249277", "text": "function func() {\n const x = 10;\n\n if(true) {\n const x = 5;\n console.log(x); // Returns 5\n }\n\n console.log(x); // Returns 10\n}", "title": "" }, { "docid": "b283cfb63f54a8a279c9bb345563b78f", "score": "0.5824582", "text": "function foo(bar) {\n if(bar) {\n console.log(baz); // referenceError\n let baz = bar;\n }\n}", "title": "" }, { "docid": "a7ba4d4c5e03839cdb96ce12b6631fa6", "score": "0.58230567", "text": "function g(){ \n var x = 2;\n // Here x is 2\n}", "title": "" }, { "docid": "8a54b286585ff8800adad5f713ef093a", "score": "0.58193904", "text": "function hoistTest(){\n var testVar;\n console.log(testVar);\n testVar = 10;\n console.log(testVar);\n}", "title": "" }, { "docid": "7573c38ebb154b7f24ef5880b25a17e5", "score": "0.581074", "text": "function checkScopeVar() {\n \"use strict\";\n var i = \"function scope\";\n if (true) {\n i = \"block scope\";\n log(\"Block scope i is: \", i);\n };\n log(\"Function Scope i is: \", i)\n return i;\n}", "title": "" }, { "docid": "e853a2ad51f0185ab0287b0838f4f51f", "score": "0.5785042", "text": "function letTest() {\n let x = 5;\n if (true) {\n let x = 55;\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "1095e74454113343ebc07ea85b599d84", "score": "0.5779513", "text": "function fire(bool) {\n var x;//Declared immediately at the beginning of the function.\n if (bool) {//\n x = 1; //blockscope: Not asigned with any value outside.\n console.log(x);\n }//\n else {\n console.log(x);\n }\n}", "title": "" }, { "docid": "070d1b0574143a76493be873f553c6f6", "score": "0.57792574", "text": "function itemOne() {\n var foo = \"bar\";\n foo = 1 + 2;\n}", "title": "" } ]
f2563c170ba07ec6225526a3608182ff
Handles responses to an ajax request: finds the right dataType (mediates between contenttype and expected dataType) returns the corresponding response
[ { "docid": "13e7f57cbc84a28659ba3eaaa71f03ce", "score": "0.0", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" } ]
[ { "docid": "797faa51731407d12006ffd2af716cc9", "score": "0.78496015", "text": "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.7837405", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.7837405", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.7837405", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.7837405", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "222801db63d552a509f38e64adc77e03", "score": "0.7757081", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\n\tif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\n\tfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "3da0f3c7c809785d365c5065a0cb0f26", "score": "0.77305895", "text": "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\n\tfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "5ea54cd2c4e5057ad4947ca96807ee3f", "score": "0.7727428", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\n\tfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "5ea54cd2c4e5057ad4947ca96807ee3f", "score": "0.7727428", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\n\tfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "5ea54cd2c4e5057ad4947ca96807ee3f", "score": "0.7727428", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\n\tfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "afaa793207c5a9653a0448a06bdc115a", "score": "0.7718662", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType=dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}} // Or just use first one\n\tfinalDataType=finalDataType||firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "bedb24ef78420c9082bce9833c3c452a", "score": "0.77154136", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\r\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\r\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\r\n\tif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\r\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\r\n\tfinalDataType=finalDataType||firstDataType;}// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "9ae73bac3796440b88ecc17d24f350bd", "score": "0.7640238", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType,\n ct,\n finalDataType,\n type,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "e40f0d4d6be86d0974c2fd00561d3f34", "score": "0.7638587", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\tvar firstDataType, ct, finalDataType, type,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "7772062ef567d3c1325bbbed71228c04", "score": "0.76112616", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "74df01afa4d05771ca06ba2e48858879", "score": "0.7607904", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "9b008157e21ae0c0575ac6d7d835248f", "score": "0.76001847", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes;\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n }\n else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597217", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597217", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597217", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597217", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597217", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7588686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7588686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7588686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7588686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7588686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "1986abb4af2e4c51ae9198dd7f47eacb", "score": "0.75866705", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "d1fccf4ae0aa12f4d27c07da800b3b5f", "score": "0.75863534", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a2e24728c2fa728dc691eb800a458dec", "score": "0.7579453", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "2f10474f96cd52c8354eeff7872a4e5a", "score": "0.7576657", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "2f10474f96cd52c8354eeff7872a4e5a", "score": "0.7576657", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "87b6ee412d1c6e0295485f82f555928e", "score": "0.7576149", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\tvar firstDataType, ct, finalDataType, type,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "6d979bd2258f84328ff9af842e82bbca", "score": "0.757483", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\t\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\t\tcontents = s.contents,\n\t\t\t\tdataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif ( ct === undefined ) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif ( ct ) {\n\t\t\t\tfor ( type in contents ) {\n\t\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check to see if we have a response for the expected dataType\n\t\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor ( type in responses ) {\n\t\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif ( finalDataType ) {\n\t\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t\t}\n\t\t\t\treturn responses[ finalDataType ];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fadbc3d050ff648416652ed5ecf815a1", "score": "0.7573355", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "fadbc3d050ff648416652ed5ecf815a1", "score": "0.7573355", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "d189f98a8917ce1b498975583a515524", "score": "0.75723964", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "d189f98a8917ce1b498975583a515524", "score": "0.75723964", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "d189f98a8917ce1b498975583a515524", "score": "0.75723964", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "67c340b902cf729cf009af9011866ec3", "score": "0.75608647", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "650bb882637bf16239d50a76c3de31f1", "score": "0.75607365", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "8baccf95f4918ef1ebebb0470d315a86", "score": "0.75597954", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "67c8ae9f0181bd7e57f197854bcda4fd", "score": "0.7558744", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "67c8ae9f0181bd7e57f197854bcda4fd", "score": "0.7558744", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "e80e0f84cef097975df4fe8349c8dc43", "score": "0.75474864", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n \tvar ct, type, finalDataType, firstDataType,\n \t\tcontents = s.contents,\n \t\tdataTypes = s.dataTypes;\n\n \t// Remove auto dataType and get content-type in the process\n \twhile ( dataTypes[ 0 ] === \"*\" ) {\n \t\tdataTypes.shift();\n \t\tif ( ct === undefined ) {\n \t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n \t\t}\n \t}\n\n \t// Check if we're dealing with a known content-type\n \tif ( ct ) {\n \t\tfor ( type in contents ) {\n \t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n \t\t\t\tdataTypes.unshift( type );\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n\n \t// Check to see if we have a response for the expected dataType\n \tif ( dataTypes[ 0 ] in responses ) {\n \t\tfinalDataType = dataTypes[ 0 ];\n \t} else {\n\n \t\t// Try convertible dataTypes\n \t\tfor ( type in responses ) {\n \t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n \t\t\t\tfinalDataType = type;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tif ( !firstDataType ) {\n \t\t\t\tfirstDataType = type;\n \t\t\t}\n \t\t}\n\n \t\t// Or just use first one\n \t\tfinalDataType = finalDataType || firstDataType;\n \t}\n\n \t// If we found a dataType\n \t// We add the dataType to the list if needed\n \t// and return the corresponding response\n \tif ( finalDataType ) {\n \t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n \t\t\tdataTypes.unshift( finalDataType );\n \t\t}\n \t\treturn responses[ finalDataType ];\n \t}\n }", "title": "" }, { "docid": "0378ce8f8489d6701d63460f648e44d8", "score": "0.7545951", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\tvar firstDataType, ct, finalDataType, type,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "0378ce8f8489d6701d63460f648e44d8", "score": "0.7545951", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\tvar firstDataType, ct, finalDataType, type,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "e7e11af6b8ddda2e53041fb3a474dbfc", "score": "0.7543194", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n\t\t\tvar ct,\n\t\t\t type,\n\t\t\t finalDataType,\n\t\t\t firstDataType,\n\t\t\t contents = s.contents,\n\t\t\t dataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile (dataTypes[0] === \"*\") {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif (ct === undefined) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif (ct) {\n\t\t\t\tfor (type in contents) {\n\t\t\t\t\tif (contents[type] && contents[type].test(ct)) {\n\t\t\t\t\t\tdataTypes.unshift(type);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check to see if we have a response for the expected dataType\n\t\t\tif (dataTypes[0] in responses) {\n\t\t\t\tfinalDataType = dataTypes[0];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor (type in responses) {\n\t\t\t\t\tif (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!firstDataType) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif (finalDataType) {\n\t\t\t\tif (finalDataType !== dataTypes[0]) {\n\t\t\t\t\tdataTypes.unshift(finalDataType);\n\t\t\t\t}\n\t\t\t\treturn responses[finalDataType];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e7e11af6b8ddda2e53041fb3a474dbfc", "score": "0.7543194", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n\t\t\tvar ct,\n\t\t\t type,\n\t\t\t finalDataType,\n\t\t\t firstDataType,\n\t\t\t contents = s.contents,\n\t\t\t dataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile (dataTypes[0] === \"*\") {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif (ct === undefined) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif (ct) {\n\t\t\t\tfor (type in contents) {\n\t\t\t\t\tif (contents[type] && contents[type].test(ct)) {\n\t\t\t\t\t\tdataTypes.unshift(type);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check to see if we have a response for the expected dataType\n\t\t\tif (dataTypes[0] in responses) {\n\t\t\t\tfinalDataType = dataTypes[0];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor (type in responses) {\n\t\t\t\t\tif (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!firstDataType) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif (finalDataType) {\n\t\t\t\tif (finalDataType !== dataTypes[0]) {\n\t\t\t\t\tdataTypes.unshift(finalDataType);\n\t\t\t\t}\n\t\t\t\treturn responses[finalDataType];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e7e11af6b8ddda2e53041fb3a474dbfc", "score": "0.7543194", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n\t\t\tvar ct,\n\t\t\t type,\n\t\t\t finalDataType,\n\t\t\t firstDataType,\n\t\t\t contents = s.contents,\n\t\t\t dataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile (dataTypes[0] === \"*\") {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif (ct === undefined) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif (ct) {\n\t\t\t\tfor (type in contents) {\n\t\t\t\t\tif (contents[type] && contents[type].test(ct)) {\n\t\t\t\t\t\tdataTypes.unshift(type);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check to see if we have a response for the expected dataType\n\t\t\tif (dataTypes[0] in responses) {\n\t\t\t\tfinalDataType = dataTypes[0];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor (type in responses) {\n\t\t\t\t\tif (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!firstDataType) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif (finalDataType) {\n\t\t\t\tif (finalDataType !== dataTypes[0]) {\n\t\t\t\t\tdataTypes.unshift(finalDataType);\n\t\t\t\t}\n\t\t\t\treturn responses[finalDataType];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ef3cedd4af5e9bc97e5fc7b0c47b49bb", "score": "0.75380224", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "ef3cedd4af5e9bc97e5fc7b0c47b49bb", "score": "0.75380224", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "ef3cedd4af5e9bc97e5fc7b0c47b49bb", "score": "0.75380224", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "c657280a7204366ae84f938094d08b5a", "score": "0.7537983", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "c657280a7204366ae84f938094d08b5a", "score": "0.7537983", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "c657280a7204366ae84f938094d08b5a", "score": "0.7537983", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7530402", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "4085b7b679cf8281a7dc8a5dad848ced", "score": "0.75298744", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.75229144", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522185", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" } ]
152db16013e42e2ea937772ad06f1bea
Scores the player hand
[ { "docid": "aac1ed3038ab8a0996d5504b47ffd7ae", "score": "0.75362563", "text": "scoreHand() {\n let aceCount = 0;\n let score = 0;\n //Adds the score from number and face cards and counts the aces\n for (let i = 0; i < this.hand.length; i++) {\n if (typeof this.hand[i].rank === \"number\") {\n score += this.hand[i].rank;\n } else if (this.hand[i].rank === \"ace\") {\n aceCount += 1;\n } else {\n score += 10;\n }\n }\n //For each Ace, asks if adding 10 would cause the player to break and if so, adds 1 instead\n for (let j = 0; j < aceCount; j++) {\n if (score + 11 <= 21) {\n score += 11;\n } else {\n score += 1;\n }\n }\n this.score = score;\n //If player's score is greater than 21, player has busted\n if (score > 21) {\n this.bust = true;\n }\n if (score === 21) {\n this.setStand();\n }\n }", "title": "" } ]
[ { "docid": "dc4af26d91d71a253f4564f0de5c12f9", "score": "0.73643553", "text": "getScore(){\n\t\tvar points = 0;\n\t\tfor(var i = 0; i < this.hand.length; i++){\n\t\t\tpoints += this.hand[i].getValue();\n\t\t}\n\t\treturn points;\n\t}", "title": "" }, { "docid": "31b13ddb7a9f6337cb8302fad75dbcab", "score": "0.71287686", "text": "function updateScore(winner) {\n switch(winner){\n case 'computer' :\n computerScore +=1;\n break;\n \n case 'human' :\n humanScore += 1;\n break;\n \n default :\n humanScore += 1;\n }\n}", "title": "" }, { "docid": "ad68e1a2a271c18e313e60f7035f1fcc", "score": "0.7119345", "text": "function getScore(player) {\n player.score = 0;\n for (var i = 0; i < player.hand.length; i++) {\n if (typeof player.hand[i].rank === 'number') {\n player.score += player.hand[i].rank;\n } else if (player.hand[i].rank !== 'ace') {\n player.score += 10;\n } else {\n player.score += 11;\n }\n }\n}", "title": "" }, { "docid": "d106c76d942e7092bd556e922fee3d9e", "score": "0.7101571", "text": "function scoring() {\n\n if (turns % 2 === 1 && playerpick === ans) {\n p1Points++;\n $(\"#p1Score\").text(p1Points);\n\n } else if (turns % 2 === 0 && playerpick === ans) {\n p2Points++;\n $(\"#p2Score\").text(p2Points);\n }\n }", "title": "" }, { "docid": "eb5273a44712fae872cad6261b340324", "score": "0.7053033", "text": "function updateScore(winner) {\n winner === 'human' ? humanScore++ : computerScore++;\n}", "title": "" }, { "docid": "e0ee8e857fcc7ccc40689e5e067867a8", "score": "0.7009178", "text": "function playerScoring() {\n playerScore = 0;\n for (let i = 0; i < player.length; i++) {\n playerScore += player[i].score;\n }\n for (let i = 0; i < player.length; i++) {\n if (player[i].value === \"A\" && playerScore >= 11) {\n playerScore += 1;\n } else if (player[i].value === \"A\" && playerScore < 11) {\n playerScore += 11;\n }\n }\n\n $(\"#player-score\").html(`<h1>${playerScore}</h1>`).css(\"font-size\", \"12px\");\n return playerScore;\n}", "title": "" }, { "docid": "faa4a73c7e493f3ff09f5a0161d97fec", "score": "0.69209766", "text": "function score(hand){\n var total = 0;\n var asValue = 20;\n for (var i = 0; i < hand.length; i++) {\n if (hand[i].value === 1) {\n total = total + asValue;\n } else if (hand[i].suit === \"c\" || hand[i].suit === \"d\") {\n total = total + (hand[i].value * 2);\n } else {\n total = total + hand[i].value;\n }\n }\n return total;\n}", "title": "" }, { "docid": "70b4c8b239ee91bcc62c51f103d97b28", "score": "0.69151765", "text": "function scoring(score, loss) {\n\tplayer.score = player.score + score;\n\tplayer.died = player.died + loss;\n\tsetHTMLscores();\n}", "title": "" }, { "docid": "0192dd336fed00e5b8a293abd4841641", "score": "0.6901169", "text": "function determineOutcome(player2hand,player1hand)\n{\n if(player2hand[0] == player1hand[0])\n {\n if(player1hand[1] > player2hand[1])\n {\n userStats[\"player0\"][\"score\"] = userStats[\"player0\"][\"score\"] + 2;\n }\n else\n {\n userStats[\"player1\"][\"score\"] = userStats[\"player1\"][\"score\"] + 2;\n }\n }\n else\n {\n if(player1hand[0] == 0)\n {\n if(player2hand[0] == 2)\n {\n userStats[\"player0\"][\"score\"] = userStats[\"player0\"][\"score\"] + 2;\n }\n else\n {\n userStats[\"player1\"][\"score\"] = userStats[\"player1\"][\"score\"] + 2;\n }\n }\n else if(player1hand[0] == 1)\n {\n if(player2hand[0] == 0)\n {\n userStats[\"player0\"][\"score\"] = userStats[\"player0\"][\"score\"] + 2;\n }\n else\n {\n userStats[\"player1\"][\"score\"] = userStats[\"player1\"][\"score\"] + 2;\n }\n }\n else if(player1hand[0]==2)\n {\n if(player2hand[0]==1)\n {\n userStats[\"player0\"][\"score\"] = userStats[\"player0\"][\"score\"] + 2;\n }\n else\n {\n userStats[\"player1\"][\"score\"] = userStats[\"player1\"][\"score\"] + 2;\n }\n }\n }\n userStats[\"player0\"][\"currentHand\"] = [null,null];\n userStats[\"player1\"][\"currentHand\"] = [null,null];\n updateCards();\n}", "title": "" }, { "docid": "7dbeb347dafa4d3b6ae7b9a22c8400a3", "score": "0.68839234", "text": "function score(){\n $('#scoring>.upper>.holding').each(function(){\n var sheet = 'upper', score = parseInt( $(this).text().split(' ')[1] );\n rolls = 0;\n $(this).attr('scored', 'true');\n $(this).addClass('scored');\n scorecard[sheet][$(this).attr('label')] = score;\n });\n $('#dice>.reporter').each(function(){\n $(this).removeClass('holding');\n $(this).attr('holding', 'false');\n });\n $('#dice>.reporter').each(function(){\n $(this).addClass('scored');\n });\n meta();\n}", "title": "" }, { "docid": "746e03c7d814228e4d576a68757f1a9b", "score": "0.68576056", "text": "function updateScores() {\n\tif (ingame == true){\n\t\t$('#dealerScoreText').html(\"Dealer's Hand: ??\");\n\t} else \t\t$('#dealerScoreText').html(\"Dealer's Hand: \" + handValue(dealercards));\n\t$('#playerScoreText').html(\"Player's Hand: \" + handValue(playercards));\n}", "title": "" }, { "docid": "7e2f17a120421a1edac89b660091b35e", "score": "0.6828063", "text": "calculateScore () {\n this._score = Math.floor(32 / this._numberOfClicks * 100)\n }", "title": "" }, { "docid": "abb1bb44dbf9a12037e75066128a6818", "score": "0.68241584", "text": "function changeScore(points) {\r\n player.score += points;\r\n}", "title": "" }, { "docid": "470f154c5cb322845cbc1c34fea7f1aa", "score": "0.677383", "text": "score(side) {\n this.scores[side] += 1;\n }", "title": "" }, { "docid": "c02ecc2ebb02ac2f45cdf6f36b6764a6", "score": "0.6761686", "text": "function updateScores() {\n\tlogger.log(\"Entering into updateScores\");\n\n\t// not a fan of delimeters in 'case' statements, so leaving it simple\n\tswitch (GAME_STATE.GAME_RESULT) {\n\t\tcase GAME_STATE.RESULTS.playerXWon:\n\t\t\tscore_human+=10;\n\t\t\tbreak;\n\n\t\tcase GAME_STATE.RESULTS.playerOWon:\n\t\t\tscore_robot+=10;\n\t\t\tbreak;\n\n\t\tcase GAME_STATE.RESULTS.tie:\n\t\t\tscore_robot+=5;\n\t\t\tscore_human+=5;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tlogger.log(\"Invalid Game result: \" + GAME_STATE.GAME_RESULT);\n\t}\n\n\tlogger.log(\"Human:\" + score_human + \" -- Robot:\" + score_robot);\n}", "title": "" }, { "docid": "fbb86f502624c08496a62cbff13bf639", "score": "0.67420113", "text": "function refreshScore () {\n\t\tstats.score = Math.floor((60 * (stats.right - stats.wrong))\n\t\t\t/ stats.time);\n\t}", "title": "" }, { "docid": "10fceec18b28d4391d005605d9918a39", "score": "0.67087245", "text": "function setScore(){\n if (g.player1phase == true) {\n g.player1Score = g.playerScore;\n g.player1phase = false;\n g.playerScore = 0;\n } else {\n g.player2Score = g.playerScore;\n }\n}", "title": "" }, { "docid": "322d3348ae27ab48b69009c00c051d89", "score": "0.6700551", "text": "function updateScore(player){\n\tplayer[\"score\"] = player[\"score\"] + 1;\n\tif(player[\"player\"] === 1){\n\t\t$(\".player1 span strong\").text(player[\"score\"]);\n\t}\n\telse{\n\t\t$(\".player2 span strong\").text(player[\"score\"]);\n\t}\n}", "title": "" }, { "docid": "7881b562e090ff0d951a518dd2d2bf85", "score": "0.66854715", "text": "function updateScore(){\n if(playerTurn === 1){\n playerOneScore++;\n $(\".p1Score\").text(playerOneScore);\n } else {\n playerTwoScore++;\n $(\".p2Score\").text(playerTwoScore);\n }\n }", "title": "" }, { "docid": "39a2a65a5b9ec3105b5b572637be017e", "score": "0.667737", "text": "function playerScore() {\n data.score++;\n setBigScore();\n}", "title": "" }, { "docid": "7aadab5e2b50e7e6a102f6756af1e1e9", "score": "0.66728383", "text": "function updatePlayerScore(){\n playerScore = getScore(playerCards);\n}", "title": "" }, { "docid": "d10196ca7265d2226502cc23a9387d58", "score": "0.6668508", "text": "function userScore() {\n const correct = isAnswerCorrect(STATE.questions[STATE.currentQuestion].correctAnswer) \n correct ? STATE.score++ : STATE.score;\n}", "title": "" }, { "docid": "8c2fc994867b5d0ab99d5cf7abeae67c", "score": "0.66674495", "text": "function updateScore(){\n\t$(\"#player-one-score\").html(players[0].pileValue());\n\t$(\"#player-two-score\").html(players[1].pileValue());\n}", "title": "" }, { "docid": "6e3764e8dcb854d6e60e633570cb31c7", "score": "0.6657212", "text": "function calcScore(hand) {\n let score = 0;\n for (let i = 0; i < hand.length; i += 1) {\n if (Number.isNaN(Number(hand[i][0])) === true) {\n const value = hand[i][0] === 'A' ? 11 : 10;\n score += value;\n } else {\n score += hand[i][0];\n }\n }\n if (score > 21) {\n const aces = aceCount(hand);\n for (let i = aces; i > 0; i -= 1) {\n if (score > 21) {\n score -= 10;\n }\n }\n }\n if (isBJ(hand, score)) {\n return 'blackjack';\n }\n if (isBust(score)) {\n return 'bust';\n }\n return score;\n }", "title": "" }, { "docid": "db201233961577062869a5513ec099a5", "score": "0.6652727", "text": "function setScore (){\n\t\tif (userScore == randomNumber){\n\t\t\twins++;\n\t\t\tinitializeGameStart();\n\t\t\n\t\t} else if (userScore > randomNumber){\n\t\t\tlosses++;\n\t\t\tinitializeGameStart();\n\t\t}\t\n\t}", "title": "" }, { "docid": "9ac55bb9d35f05b1adff72d0ab154b0d", "score": "0.6643379", "text": "function updateScore(){\n if (playerTurn === 0){\n playerTurn = 1\n playerOne++;\n document.getElementById('player-one-score').innerText = playerOne;\n } else {\n playerTurn = 0\n playerTwo++;\n document.getElementById('player-two-score').innerText = playerTwo;\n }\n }", "title": "" }, { "docid": "77a259373b5deba32b97119391e43b36", "score": "0.66354126", "text": "function getScore(hand) {\n const score = R.compose(\n R.reduce((a, v) => a + v, 0),\n R.map(codeToScore),\n R.map(R.prop(\"code\"))\n )(hand);\n const aces = aceCount(hand);\n \n if (score > 21) {\n if (aces > 1) {\n for (var i = 1; i <= aces; i++) {\n if (score - i * 10 <= 21) {\n return score - i * 10;\n }\n }\n }\n\n return score - aces * 10;\n }\n\n return (score === 0) ? null : score;\n}", "title": "" }, { "docid": "fe62f8b0e1a7cf9f76e768bb06b75163", "score": "0.66352844", "text": "function resolveRound(userHand, compHand) { \n console.log(\"UserHand:\" + userHand + \" and compHand:\" + compHand)\n\n if (userHand === compHand) {\n console.log(\"It's a draw!\");\n\n } else if (userHand === \"rock\" && compHand === \"paper\") {\n console.log(\"User loses\");\n computerScore++;\n\n } else if (userHand === \"paper\" && compHand === \"scissors\") {\n console.log(\"User loses\");\n computerScore++;\n\n } else if (userHand === \"scissors\" && compHand === \"rock\") {\n console.log(\"User loses\");\n computerScore++;\n\n } else {\n console.log(\"User wins\");\n userScore++;\n }\n\n console.log(`user score: ${userScore} : comp score: ${computerScore}`)\n}", "title": "" }, { "docid": "b789906e8d6dd2e89f4d283948224cea", "score": "0.66343355", "text": "function playerScore() {\n var playerSum = 0;\n for (var i = 0; i < playerHand.length; i++) {\n playerSum += playerHand[i].value;\n }\n if (playerSum > 21) {\n playerSum -= 10 * aceCounter();\n }\n playerCurrentscore = playerSum;\n\n $('#pScore').text(playerCurrentscore);\n\n if(playerCurrentscore >= 21 && playerSplitHand.length === 0) {\n result();\n } else if(playerCurrentscore >=21 && playerSplitHand.length > 0) {\n $('#hit').off();\n $('#stay').off();\n $('#hit').click(splitHit);\n $('#stay').click(resultSplit);\n if(playerCurrentscore === 21) {\n $('#results').hide().text('Hand 1 got Blackjack!').fadeIn('slow').fadeOut(800);\n } else if(playerCurrentscore > 21) {\n $('#results').hide().text('Hand 1 bust...').fadeIn('slow').fadeOut(800);\n }\n playerSplitScore();\n}\n}", "title": "" }, { "docid": "3723fb6041ad0e0223fa4cf95ad6310d", "score": "0.66310984", "text": "function updateScore() {\r\n if (winStatus === \"Player Wins !\") {\r\n plrPoints += 1;\r\n plrScore.innerText = `Score: ${plrPoints}`;\r\n }\r\n else if (winStatus === \"Computer Wins !\") {\r\n comPoints += 1;\r\n comScore.innerText = `Score: ${comPoints}`;\r\n }\r\n}", "title": "" }, { "docid": "b5727fc86c985ea63e83ba4f198ad7c2", "score": "0.66162544", "text": "function keepScore() {\n\n if (roundResult === 'You Won! Rock beats Scissors.' || roundResult === 'You Won! Scissors beats Paper.' || roundResult ===\n 'You Won! Paper beats Rock.') {\n\n playerScore++;\n\n } else if (roundResult === 'You Lose! Paper beats Rock.' || roundResult === 'You Lose! Scissors beats Paper.' || roundResult ===\n 'You Lose! Rock beat Scissors.') {\n\n computerScore++;\n\n }\n }", "title": "" }, { "docid": "6684c7fbebe4cf39f901f9a1b6dac606", "score": "0.6613841", "text": "function updateScore() {\n scoreboard.innerHTML = player.score();\n }", "title": "" }, { "docid": "1be85fdacdc4b5a5cb03213c1eae01b9", "score": "0.6601426", "text": "function checkScore() {\n if (goalScore === userScore) {\n wins++;\n $(\"#wins\").html(\"Wins: \" + wins);\n reset();\n }\n else if (goalScore < userScore) {\n losses++;\n $(\"#losses\").html(\"Losses: \" + losses);\n reset();\n }\n }", "title": "" }, { "docid": "edccbcdee1e4db288f7fe8ecc9823cdb", "score": "0.65878594", "text": "function updateScore() {\n player.setScore(getScore()); // Assigns a new score to player.score\n\n /**\n * If the players new score is greater than the players highscore,\n * the players highscore becomes the players new score.\n */\n if (player.getScore() > player.getHighScore()) {\n player.setHighScore(player.getScore());\n }\n\n /**\n * If an account is logged in, the accounts highscore and ranks HTML content is updated.\n */\n if (getItem(2, 'loggedIn') !== null) {\n updateAccount();\n getElementById('rank').innerHTML = \"\" + JSON.parse(getItem(1, getLoggedIn()))['rank'];\n }\n\n /**\n * The HTML content for score and highscore is updated.\n */\n getElementById('score').innerHTML = \"\" + player.getScore();\n getElementById('highscore').innerHTML = \"\" + player.getHighScore();\n}", "title": "" }, { "docid": "b9f7d121ebfbeca821d9597acac51b7a", "score": "0.6580248", "text": "function printScore() {\n str = \"__**Current Leaderboard**__\\n\";\n players[msg.guild.id].sort(function (a, b) {\n return b.score - a.score;\n });\n for (i = 0; i < players[msg.guild.id].length; i++) {\n str += `${players[msg.guild.id][i].name}: ${\n players[msg.guild.id][i].score\n } points \\n`;\n }\n msg.channel.send({\n embed: {\n color: 3447003,\n description: `${str}`,\n },\n });\n }", "title": "" }, { "docid": "172138cbc7321979ae4efb218adb03a0", "score": "0.65772057", "text": "function score(){\n\talert('You Won!');\n\t\twins++;\n\t\t$('#numWins').text(wins);\n\t\treset();\n\t}", "title": "" }, { "docid": "6099fb1a2b11c0c1b201abed2708a1e5", "score": "0.6576216", "text": "function playGame() {\n score = 0;\n for(var i = 0; i<questionsArray.length; i++) {\n var currentQuestion = questionsArray[i];\n play_quiz(currentQuestion.question, currentQuestion.answer);\n }\n console.log(chalk.yellow(\"Yay!! You SCORED: \") + chalk.blue(score));\n\n //Display High scores so far\n console.log(\"Check out the high scores:- \");\n for(var j = 0; j<highScore.length; j++) {\n console.log(chalk.yellow(highScore[j].name) + \" \" + \":\" + \" \" + chalk.red(highScore[j].score));\n }\n //check whether user has registered a high score or not\n check_highScore();\n}", "title": "" }, { "docid": "c923e69b14876e527c9327114c11ea61", "score": "0.6572277", "text": "function game(hand) {\n console.log(\"Computer Shoots: \",compShoot())\n console.log(\"Human Shoots: \", hand)\n if(hand == \"scissors\" && comp == \"paper\") {\n console.log(\"Scissors beats Paper! Point for Human!\");\n return human.score += 1;\n }\n else if (hand == \"paper\" && comp == \"rock\") {\n console.log(\"Paper beats Rock! Point for Human!\");\n return human.score += 1;\n }\n else if (hand == \"rock\" && comp == \"scissors\") {\n console.log(\"Rock beats Scissors! Point for Human!\");\n return human.score += 1;\n }\n else if (hand == \"paper\" && comp == \"scissors\") {\n console.log(\"Scissors beats Paper! Point for Machine!\");\n return computer.score += 1;\n }\n else if (hand == \"rock\" && comp == \"paper\") {\n console.log(\"Paper beats Rock! Point for Machine!\");\n return computer.score += 1;\n }\n else if (hand == \"scissors\" && comp == \"rock\") {\n console.log(\"Rock beats Scissors! Point for Machine!\");\n return computer.score += 1;\n }\n else if (hand == comp) {\n console.log(\"Tie game! Try again!\");\n }\n scoreboard();\n}", "title": "" }, { "docid": "bbe5309e3e5d1aa799604b40ee4572fa", "score": "0.65691465", "text": "winningScore() {\n if (this.score.added <= 0) return 100;\n return this.score.added * 2;\n }", "title": "" }, { "docid": "f7c9f74449993cb665ad6ef479fba3d4", "score": "0.6567573", "text": "getScore() {\n if (this.state.numGuesses <= 24) {\n return 100;\n } else {\n return 100 - (this.state.numGuesses - 24);\n }\n }", "title": "" }, { "docid": "ed3a93be0221a6112707d64bff00f4b6", "score": "0.65627456", "text": "static score(state) {\n if (state.result !== 'running') {\n if (state.result === 'X-wins') {\n // x player wins\n return 10 - state.aiMovesCount;\n } else if (state.result === 'O-wins') {\n // o player wins\n return -10 + state.aiMovesCount;\n } else {\n // draw\n return 0;\n }\n }\n }", "title": "" }, { "docid": "8f822b9adf975f7357315bad3a1f7b02", "score": "0.65528107", "text": "function updateScore(outcome) {\n\t// logic increase the score of whoever won and then update the DOM\n\tif (outcome === \"win\") {\n\t\thumanScore += 1\n\t}\n\telse if (outcome === \"lose\") {\n\t\tcomputerScore += 1\n\t}\n\n\tdocument.getElementById('humanScore').innerHTML = humanScore;\n\tdocument.getElementById('computerScore').innerHTML = computerScore;\n}", "title": "" }, { "docid": "7255e076ebb186220bbda2feb7ca7856", "score": "0.65457815", "text": "function selectedPlayerHand(e) {\n const result = playRound(e);\n reachedFivePoints();\n if (result === playerWin) {\n return document.querySelector('.player-score').textContent = playerWin;\n }\n else if (result === computerWin) {\n return document.querySelector('.computer-score').textContent = computerWin;\n }\n else return;\n}", "title": "" }, { "docid": "1bcd2961fe216a2d603ec38d3f3d257d", "score": "0.65452474", "text": "function scoring(k,wp,type) {\r\n if (wp==1) {\r\n // need to place a small star next to player 1 score\r\n if (type=='good') {\r\n starArray[k]._visible=false;\r\n p1Score= p1Score+2;\r\n }\r\n if (type=='bad') {\r\n badstarArray[k]._visible=false;\r\n p1Score= p1Score-2;\r\n }\r\n $(\"#p1ScoreDisp\").text(p1Score);\r\n if (p1Score > starCount/2) {\r\n gameOn=0;\r\n {ctx.drawImage(a,0,0,w,h);}\r\n }\r\n }\r\n else if (wp==2) {\r\n if (type=='good') {\r\n starArray[k]._visible=false;\r\n p2Score= p2Score+2;\r\n }\r\n if (type=='bad') {\r\n badstarArray[k]._visible=false;\r\n p2Score= p2Score-2;\r\n }\r\n $(\"#p2ScoreDisp\").text(p2Score);\r\n if (p2Score > starCount/2) {\r\n gameOn=0;\r\n {ctx.drawImage(a1,0,0,w,h);}\r\n }\r\n }\r\n } // end scoring function", "title": "" }, { "docid": "644cb57adc801754d8b7cc5175f910ba", "score": "0.6543115", "text": "score() {\n if (this.y < 0) {\n this.reset(); \n collectible.setPlacement(); // Reset collectible position\n score += 1000;\n $(\".score\").html(score);\n console.log(\"Player scores!\");\n }\n }", "title": "" }, { "docid": "2cda08ddc3cd6869afeeeaba2385e6f4", "score": "0.65404385", "text": "function updateScore() {\n player.incrementScore();\n document.getElementById(\"score\").innerHTML = \"<strong>Score:</strong> \" + player.getScore();\n }", "title": "" }, { "docid": "e794b007bad19829b290bf196f4c6dfd", "score": "0.6532321", "text": "function playerStand() {\n $playerButtons.css('visibility', 'hidden');\n const playerScore = calcScore(playerHand);\n const houseScore = houseDraw(calcScore(houseHand));\n return calcWinner(playerScore, houseScore);\n }", "title": "" }, { "docid": "ae5453772c52efc60c40aa27a8c1127a", "score": "0.6518169", "text": "function setScore(winner) {\n if(winner == \"Ai\"){\n aiPoint+=1;\n }\n else if(winner==\"User\"){\n userPoint+=1;\n }\n else{\n aiPoint+=0;\n userPoint+=0;\n }\n$(\"#aiPoint\").text(aiPoint);\n\n $(\"#userPoint\").text(userPoint);\n}", "title": "" }, { "docid": "907b53985f652b1334432a5634f420fc", "score": "0.65119535", "text": "function Hand(){\n var hand = [];\n this.getHand = function(){\n return hand;\n };\n // this gets the value of the Hand\n this.score = function(){\n var sum = 0;\n for (var i in hand){\n sum += hand[i].getValue();\n }\n var aces = 0;\n var evaluate = function(){\n if (sum > 21 && aces > 0){\n sum -= 10;\n aces--;\n evaluate();\n }\n };\n for (var a in hand){\n if (hand[a].getValue() === 11){\n aces++;\n }\n evaluate();\n }\n return sum;\n };\n\n\n this.printHand = function(){\n string = '';\n for(i=0;i<hand.length-1;i++){\n string+=(ranks[hand[i].getNumber()-1]+ suits[hand[i].getSuit()-1]+\", \");\n }\n {\n string+=(\"and \" + ranks[hand[i].getNumber()-1] + suits[hand[i].getSuit()-1]+\".\");\n }\n return(string)\n };\n this.hitMe = function() {\n hand.push(deal());\n }\n}", "title": "" }, { "docid": "570b77ea5bcc7f05f099f7b16d0868b3", "score": "0.6507789", "text": "function score(hand){\n var score = 0;\n var hands = hand.split(/[\\s,]+/)\n var number = [];\n var suit = [];\n for(i = 0; i < hands.length; i++){\n var card = hands[i].split(\"\");\n if(card[0] == 'J'){card[0] = 11;}\n else if(card[0] == 'Q'){card[0] = 12;}\n else if (card[0] == 'K'){card[0] = 13;}\n else if (card[0] == 'A'){card[0] = 14;}\n if (hands[i].includes(10)){\n number.push(10);\n }\n else{\n number.push(Number(card[0]));\n }\n suit.push(card[1]);\n }\n number = sortArray (number);\n numMap = uniqueNumbers(number);\n if(uniqueSuits(suit) === 1){\n // It will be a royal flush\n if (straight(number)&&number.includes(14)){score = 10;}\n //straight flush\n else if (straight(number)){score = 9;}\n //flush\n else {score = 6;}\n }\n else{\n //if four of a kind, call fourOfAKind\n if(fourOfAKind(numMap)){score = 8;}\n //if fullhouse: call threeOfAKind and pair\n else if(threeOfAKind(numMap) && pair(numMap)){score = 7;}\n //if straight: call straight\n else if (straight(number)){score = 5;}\n //if three of a kind: call threeOfAKind\n else if(threeOfAKind(numMap)){score = 4;}\n //if two pair: cal two pair\n else if (twoPais(numMap)){score = 3;}\n //if one pair: call pair\n else if (pair(numMap)){score = 2}\n //high card\n else{score = 1}\n }\n return score;\n}", "title": "" }, { "docid": "3663212d16935f4a75dac54b7c99ed1c", "score": "0.65035427", "text": "function updateScores() {\n updateQuestionCount();\n updateLifesCount();\n}", "title": "" }, { "docid": "c7e79aa580f554cbaa57e18d1685dcfa", "score": "0.6487753", "text": "function calculateScores (players) {\n return [\n players[0].followers * 5 + players[0].totalStars,\n players[1].followers * 5 + players[1].totalStars\n ]\n}", "title": "" }, { "docid": "787bff6bd16c40c3fdcdc26a7c3cfe71", "score": "0.64763105", "text": "function updateScore() {\n changeScore();\n changeScore();\n}", "title": "" }, { "docid": "0096cdf0336a1196c94b3b05135fb692", "score": "0.647581", "text": "function win() {\n wins++;\n audio.play();\n $(\"#scoreW\").text(wins);\n reset();\n }", "title": "" }, { "docid": "38042c8436e46776a307ff5a3a979b1f", "score": "0.64744204", "text": "gainScore() {\n this.score += 100;\n }", "title": "" }, { "docid": "ce2c7461d6e6efeb733462f42cf49ffa", "score": "0.6473155", "text": "updateScore() {\n let score = 5;\n this.doneChallenges.forEach(chall => {\n console.log('chall id: ' + chall + ' score: ' + this.getChall(chall).points);\n score += this.getChall(chall).points;\n });\n console.log('bar id: ' + this.barID + ' score: ' + score);\n this.score = score;\n return score;\n }", "title": "" }, { "docid": "0999b6ed83edeea3254b08f14bdae482", "score": "0.6470677", "text": "function printScore(player, quizSet){\n \n console.log(\"\\nLevel ended\\nScore: \"+player.score);\n \n\n if(player.score >= quizSet.length){\n console.log(\"Yay!! you have set a new high score!!!\\n\");\n // making current player highscorer if he beaten the existing one\n highScorer = player;\n player.score = 0;\n level++;\n console.log(chalk.bgYellow(\"Be ready for Next Level\"));\n if(level == 3){\n console.log(chalk.bgYellow(\"Ohh..that was the last level!!! \\nYOU MADE IT TO LAST LEVEL!!!\"));\n }\n else{\n play(player, level);}\n }\n}", "title": "" }, { "docid": "fd844ae6945e81a4478cbc073dedd64d", "score": "0.6469863", "text": "function incrementPlayerScore (player) {\n\t\tif (player === 1) {\n\t\t\tplayer1Score++;\n\t\t} else {\n\t\t\tplayer2Score++;\n\t\t};\n\t\tvar audio = new Audio('Sounds/Pickup_Coin26.wav');\n\t\taudio.play();\n\t\tupdateScoreBoards(player1Score, player2Score);\n\t}", "title": "" }, { "docid": "c4ab2c77972001af5fed214841e51468", "score": "0.64602077", "text": "calcScore(hand){\n let score = 0;\n\n for (const card of hand) {\n const value = card.value;\n\n if (isNaN(value)) {\n if (value===\"ACE\") {\n //check if score goes over 21 for every instance of ace in user's hand \n if (score + 11 > 21) {\n score += 1;\n } else { \n score += 11; }\n } else {\n score += 10;\n }\n } else {\n score += Number(value);\n }\n\n }\n\n //AUTOMATIC loss if score > 21 \n if (score > 21) { \n this.setState({gameOver: true})\n this.setState({result: \"You Lose 😔\"});\n }\n return score;\n }", "title": "" }, { "docid": "cb2df7eeb02d178d4490e9827631730f", "score": "0.64576495", "text": "function getStrikeScore(){\n return game.rolls[rollIndex] + game.rolls[rollIndex + 1] + game.rolls[rollIndex + 2];\n }", "title": "" }, { "docid": "954cca11cfb650a347d72c7f7b651dec", "score": "0.64497125", "text": "function checkScore() {\n\tif (userScore == compNumber) {\n\t\twins++\n\t\talert('You won!')\n\t\t// score = 0\n\t} else if (userScore > compNumber){\n\t\tlosses++\n\t\talert('You lost!')\n\t\t// score = 0\n\t}\n}", "title": "" }, { "docid": "eb981c16d8419f450be70d2655ba0bed", "score": "0.64428943", "text": "score() {\n\n const dist = window['p'].distance(this.x, this.y, window['walker'].x, window['walker'].y);\n\n if (!isNaN(dist) && dist < this.SCORE_RADIUS) {\n this.brain.score += this.SCORE_RADIUS - dist;\n }\n\n // Replace highest score to visualise\n window.highestScore = this.brain.score > window.highestScore ? this.brain.score : window.highestScore;\n }", "title": "" }, { "docid": "29a78afa36a96c670bec466073d01008", "score": "0.643471", "text": "function updatePlayerScore() {\n if (player === 1){\n playerScore[0]++;\n $('#player1').append('<img id=\"scoreFrog\" src=\"images/froggerHealthy.png\"/>');\n scoreOne.html(playerScore[0]);\n playThreeLives();\n gameOver();\n \n }else{\n playerScore[1]++;\n $('#player2').append('<img id=\"scoreFrog\" src=\"images/froggerHealthy.png\"/>');\n scoreTwo.html(playerScore[1]);\n playThreeLives();\n gameOver();\n }\n }", "title": "" }, { "docid": "8ee9165b90e52da95e0ab89ddab20737", "score": "0.64340484", "text": "function updateScore(card, activePlayer) {\n activePlayer[\"score\"] += blackjackGame[\"cardsMap\"][card];\n}", "title": "" }, { "docid": "78e6296549ebc74f5978b6e99aa11135", "score": "0.6433576", "text": "function calculateScore(user) {\n user.score = user.level * user.coins + user.time;\n}", "title": "" }, { "docid": "7fd064cfe80a5d4a4f7ad5366e683e86", "score": "0.6433253", "text": "setScores(hand, rules, scores, adjustments, resolve) {\n this.reveal()\n this.scores.show(hand, rules, scores, adjustments, resolve);\n }", "title": "" }, { "docid": "e84192086131e067b960edea68334eb4", "score": "0.6432564", "text": "function incrementScore() {\n\t\tscore++;\n\t\tdisplayScore();\n\t\tcheckWin();\n\t}", "title": "" }, { "docid": "38c75e0124b243cb16013e5ff5d68292", "score": "0.64325625", "text": "function checkscore() {\n crystalValue = parseInt(crystalValue);\n counter += crystalValue;\n $(\"#userGuess\").text(counter);\n if (counter === targetNumber) {\n wins++;\n $(\"#displaymsg\").css(\"color\", \"blue\");\n $(\"#displaymsg\").text(\"You won!\");\n showWins();\n reset();\n } else if (counter >= targetNumber) {\n losses++;\n $(\"#displaymsg\").css(\"color\", \"red\");\n $(\"#displaymsg\").text(\"You lost!\");\n showLosses();\n reset();\n }\n}", "title": "" }, { "docid": "7eed1b35dac52fecc68be4138c955aa3", "score": "0.64253885", "text": "function incrementScore() {\n updateScore(currentScore + 1);\n }", "title": "" }, { "docid": "008ff1cb2d53bed2f31c91b55a48b854", "score": "0.6412544", "text": "addScore() {\n //who's a good boy... girl... you can't really know in this day and age anymore\n this.brain.score++;\n }", "title": "" }, { "docid": "9f05f277597da4dea7c00f3974c286ed", "score": "0.6403506", "text": "function calculateScore() {\n score++;\n}", "title": "" }, { "docid": "4fb4a296bf2194bc664a28dac8412adf", "score": "0.6402986", "text": "function playHand(test) {\r\n let playerA = test.playerA;\r\n let playerB = test.playerB;\r\n\r\n let playerATotal = playerA.reduce((total, card) => {\r\n //get the total of the current card in the hand for player A\r\n return total + assingValueCards(card)\r\n }, 0)\r\n\r\n let playerBTotal = playerB.reduce((total, card) => {\r\n //get the total of the current card in the hand for player A\r\n return total + assingValueCards(card)\r\n\r\n }, 0)\r\n\r\n //Evaluate who worn\r\n if (playerATotal > 21 && playerBTotal < 21) {\r\n return 'playerBWins';\r\n } else if (playerBTotal > 21 && playerATotal < 21) {\r\n return 'playerAWins';\r\n } else {\r\n if (playerATotal > playerBTotal) {\r\n return 'playerAWins';\r\n } else if (playerATotal < playerBTotal) {\r\n return 'playerBWins';\r\n } else {\r\n\r\n return compareHighest(playerA, playerB)\r\n }\r\n }\r\n}", "title": "" }, { "docid": "cd8c3bebbaa8116fb3c52f787925b679", "score": "0.6402717", "text": "function scoreW() {\n w += 1;\n win.innerText = \"wins: \" + w;\n}", "title": "" }, { "docid": "5a668c925c356fc422773a8b2ecf00d0", "score": "0.6394044", "text": "function updateScore(newRoll) {\n p1Score = p1Score + newRoll;\n updateScoreDisplay(p1Score);\n}", "title": "" }, { "docid": "f8e6a856962ce31fdf97f1b6cf8bdeb2", "score": "0.63936853", "text": "function updateScore() {\r\n\t\t_score++;\r\n\t\tif (_score == _curr.highScore._score) {\r\n\t\t\t$(\"#score\").css(\"color\", \"gold\");\r\n\t\t\t$(\"#highScore\").css(\"color\", \"red\");\r\n\t\t}\r\n\r\n\t\t$(\"#score\").text(_score);\r\n\t}", "title": "" }, { "docid": "e8106817e4d294b3713668ff75767542", "score": "0.63925827", "text": "function updatePlayerState() {\n\tif (!gameOver) {\n\t\tdocument.getElementById(\"playerHand\").innerText = printHand(playerHand);\n\t\tplayerScore = calcScore(playerHand);\n\t\tdocument.getElementById(\"playerScore\").innerText = printScore(playerScore);\n\t}\n}", "title": "" }, { "docid": "b57e4266e0ed31785530a85e87d92d3f", "score": "0.6383721", "text": "function checkScore() {\n console.log(playerNumSum, magicNum);\n if (playerNumSum > magicNum) {\n // alert(\"You Lost!\");\n totalLoss++;\n $(\"#losses\").html(totalLoss);\n restartGame();\n } else if (playerNumSum === magicNum) {\n // alert(\"You WIn!\");\n totalWin++;\n $(\"#wins\").html(totalWin);\n restartGame();\n }\n}", "title": "" }, { "docid": "3cf7897259a150f7eaac593c99d174db", "score": "0.6383003", "text": "function roundScore() {\n if ($scope.currentPlayer.dartArray.length == 3) {\n $scope.currentPlayer.roundScore = $scope.currentPlayer.dartArray[0] + $scope.currentPlayer.dartArray[1] + $scope.currentPlayer.dartArray[2];\n }\n\n if ($scope.currentPlayer.dartArray.length == 2) {\n $scope.currentPlayer.roundScore = $scope.currentPlayer.dartArray[0] + $scope.currentPlayer.dartArray[1];\n }\n\n if ($scope.currentPlayer.dartArray.length == 1) {\n $scope.currentPlayer.roundScore = $scope.currentPlayer.dartArray[0];\n }\n }", "title": "" }, { "docid": "2c75731f1e23aee1ca6fc4bf659bb039", "score": "0.63449854", "text": "function holdScores() {\n if (playing) {\n //1. add current score to the active player's total score\n scores[activePlayer] += currentScore;\n //2. display the score\n document.getElementById(`score--${activePlayer}`).textContent =\n scores[activePlayer];\n //3. check if player's score >= 100\n if (scores[activePlayer] >= totalScore) {\n //finish the game\n //add a class which changes the background color of winner\n document\n .querySelector(`.player--${activePlayer}`)\n .classList.add('player--winner');\n // stop this player from being the active player\n document\n .querySelector(`.player--${activePlayer}`)\n .classList.remove('player--active');\n\n playing = false;\n diceEl.classList.add('hidden');\n } else {\n //switch player\n switchPlayer();\n }\n }\n }", "title": "" }, { "docid": "fc108eb991658b1010db5fa77c5d4f40", "score": "0.63423175", "text": "function score(playerIndex) {\n // This score function just returns input1 of this round\n // return calcWinner(playerIndex);\n return game.get(\"roundWinner\", game.getCurrentRound(), playerIndex);\n}", "title": "" }, { "docid": "3d65a224362ba39962cb7a8db1f5ac45", "score": "0.63336325", "text": "function scoring(i,k,wp) {\r\n deadStars++;\r\n //console.log(deadStars);\r\n starArray[k]._visible = false;\r\n starArray[k]._x =w+90;\r\n laserArray[i]._visible=false;\r\n laserArray[i]._x=w+90;\r\n if (wp==1) { \r\n p1Score++;\r\n $(\"#p1ScoreDisp\").text(p1Score);\r\n }\r\n else if (wp==2) {\r\n p2Score++;\r\n $(\"#p2ScoreDisp\").text(p2Score);\r\n }\r\n if (deadStars == sc) {\r\n sc = sc+5;\r\n createStars(sc);\r\n deadStars=0;\r\n ctx.fillStyle= \"rgba(250,0,0,.4)\";\r\n ctx.fillRect(50,50,w-100,h-100);\r\n ctx.fillStyle=\"black\";\r\n ctx.font=\"30px Sans-Serif\";\r\n ctx.fillText(\"Next Level\",w/4,h/2);\r\n gameOn = false;\r\n setTimeout(function() {gameOn=true; main();},3000);\r\n } \r\n \r\n } // end scoring", "title": "" }, { "docid": "f5c0e24cffd5ba52f99b5dba293b7ec9", "score": "0.63286114", "text": "incScore() {\n $('#score').text(this.score); //update score on screen\n //if you don't have enough cards in play to score a positive score, the game ends\n if (((this.score) + ((24 - ((this.matched) * 2)) * 5)) < 0) {\n this.endGame();\n }\n }", "title": "" }, { "docid": "fc38fe9d232269f371e1ab20415594a4", "score": "0.63282335", "text": "function getStrikeScore() {\n return game.rolls[rollIndex] + game.rolls[rollIndex + 1] + game.rolls[rollIndex + 2];\n }", "title": "" }, { "docid": "d3615308a1364e00ceda0dd4438ade25", "score": "0.63240325", "text": "updateVictoryScore() {\n document.getElementById(\"victory-score\").innerHTML = Number(g_game._player._kill_nb * 10 + g_game._player._coins * 10);\n }", "title": "" }, { "docid": "60f2588d10e7c4256349ca6315aa491b", "score": "0.63141537", "text": "function playerHit() {\n const score = dealCards(shuffledDeck, playerHand, 1, $playerDeal);\n if (score === 'bust') {\n return playerLoses('bust');\n }\n if (score === 21) {\n return playerStand();\n }\n return score;\n }", "title": "" }, { "docid": "7d387527be9d87c0291da82f2f5b662c", "score": "0.6304752", "text": "function calculatePlayerScores()\n{\n //================================================\n // Transfer and compile offensive statistics by\n // player in the offense array.\n //================================================\n buildOffense(\"passing\", passing);\n buildOffense(\"rushing\", rushing);\n buildOffense(\"receiving\", receiving);\n buildOffense(\"twoPoints\", twoPoints);\n buildOffense(\"fumbles\", fumbles);\n\n //================================================\n // Transfer and compile defensive statistics by\n // player in the defense array.\n //================================================\n buildDefense(\"tackles\", tackles);\n buildDefense(\"passD\", passD);\n buildDefense(\"fumbles\", fumbles);\n\n //================================================\n // Transfer and compile special teams statistics by\n // player in the specialTeams array.\n //================================================\n buildSpecialTeams(\"kicking\", kicking);\n buildSpecialTeams(\"punting\", punting);\n buildSpecialTeams(\"kick returns\", kReturns);\n buildSpecialTeams(\"punt returns\", pReturns);\n\n //================================================\n // Calculate offensive scores\n //================================================\n for (let i = 0; i < offense.length; i++)\n {\n let scoreBox = calculateOffensiveScore(offense[i]);\n offense[i].passingScore = scoreBox.pass;\n offense[i].rushingScore = scoreBox.rush;\n offense[i].receivingScore = scoreBox.receive;\n offense[i].dualScore = scoreBox.dual;\n offense[i].twoPointScore = scoreBox.two;\n offense[i].fumbleScore = scoreBox.fumble;\n }\n\n //================================================\n // Calculate defensive scores\n //================================================\n for (let i = 0; i < defense.length; i++)\n {\n defense[i].score = calculateDefensiveScore(defense[i]);\n }\n\n //================================================\n // Calculate special teams scores\n //================================================\n for (let i = 0; i < specialTeams.length; i++)\n {\n specialTeams[i].score = calculateSpecialTeamsScore(specialTeams[i]);\n }\n}", "title": "" }, { "docid": "c81331c70f847eab80e4546751dae593", "score": "0.6303832", "text": "function gamePlay(gamePieceScore) {\n \n playerScore += gamePieceScore;\n console.log(\"Score: \" + playerScore);\n if (playerScore == targetScore) {\n console.log(\"You won!\");\n wins++;\n newGame();\n }\n else if (playerScore > targetScore) {\n console.log(\"You lost!\");\n losses++;\n newGame();\n }\n else {\n $(\"#playerScoreNumber\").html(playerScore);\n }\n }", "title": "" }, { "docid": "2228012fd695b2fdfd81eb96290c4038", "score": "0.63029975", "text": "function setScore(player) {\n if (player === 1) {\n document.querySelector('#playerOneScore').innerHTML = winOneCount\n } else {\n document.querySelector('#playerTwoScore').innerHTML = winTwoCount\n }\n}", "title": "" }, { "docid": "5906b3b708c33097754d199cb6968e65", "score": "0.6298145", "text": "function ScoreKeeper(){\n\tthis.playerScore = 0;\n\tthis.enemyScore = 0;\n\tthis.finalPlayerScore = 0;\n\tthis.finalEnemyScore = 0;\n}", "title": "" }, { "docid": "788c1ca6a49a0775fa3eb5b409e71548", "score": "0.62859684", "text": "function holdPoints() {\n\tscores[activePlayerID] += roundScore;\n\tdocument.querySelector(`#score-${activePlayerID}`).textContent = scores[activePlayerID];\n}", "title": "" }, { "docid": "0985f04b116c8a9d8ef045b64c8b3479", "score": "0.6278452", "text": "function score (roundResult) {\n\n if (roundResult === 'You win that round, well done!') {\n playerScore++;\n let totalScore = playerScore + ' - ' + computerScore;\n return totalScore;\n }\n\n else if (roundResult === 'The computer wins that round, try again!') {\n computerScore++;\n let totalScore = playerScore + ' - ' + computerScore;\n return totalScore;\n }\n\n else {\n let totalScore = playerScore + ' - ' + computerScore;\n return totalScore;\n }\n}", "title": "" }, { "docid": "efb426cd6a85aae2ea6a593087179c64", "score": "0.6272755", "text": "finalizeStats() {\n\t\tif(this.score.playerScore >= this.score.computerScore) {\n\t\t\tthis.highScores.yards = this.boxScore.passing + this.boxScore.rushing;\n\t\t\tthis.highScores.passingYards = this.boxScore.passing;\n\t\t\t//Make sure the player actually tried to win the game and not just throw interceptions and incomplete passes\n\t\t\tthis.highScores.passAttempts = this.boxScore.passing > 100 ? this.boxScore.compAtt.atts : null;\n\t\t\t//Minimum of 10 attempts\n\t\t\tthis.highScores.completionPercentage = this.boxScore.compAtt.atts >= 10 ? ((this.boxScore.compAtt.comp / this.boxScore.compAtt.atts) * 100).toFixed(2) : null;\n\t\t\t//Minimum of 7 attempts\n\t\t\tthis.highScores.yardsPerPass = this.boxScore.compAtt.atts >= 7 ? (this.boxScore.passing / this.boxScore.compAtt.atts).toFixed(2) : null;\n\t\t\tthis.highScores.passingTDs = this.boxScore.passTds;\n\t\t\tthis.highScores.rushingTDs = this.boxScore.rushTds;\n\t\t\t//Minimum of 7 attempts\n\t\t\tthis.highScores.interceptions = this.boxScore.compAtt.atts >= 7 ? this.boxScore.interceptions : null;\n\t\t\tthis.highScores.sacks = this.boxScore.sacks;\n\t\t\tthis.highScores.rushingYards = this.boxScore.rushing;\n\t\t\t//Make sure they actually gained 20 rushing yards or more and were not just taking sacks\n\t\t\tthis.highScores.rushAttempts = this.boxScore.rushing > 20 ? this.boxScore.rushAtts : null;\n\t\t\t//Minimum of 4 attempts\n\t\t\tthis.highScores.yardsPerRush = this.boxScore.rushAtts >= 4 ? (this.boxScore.rushing / this.boxScore.rushAtts).toFixed(2) : null;\n\t\t\tthis.highScores.firstDowns = this.boxScore.firstDowns;\n\t\t\tthis.highScores.fourthDowns = this.boxScore.fourthDowns.convert;\n\t\t\tthis.highScores.longestRun = this.boxScore.longestRun;\n\t\t\tthis.highScores.longestPass = this.boxScore.longestPass;\n\t\t\tthis.highScores.completions = this.boxScore.compAtt.comp;\n\t\t\tthis.highScores.pointsAllowed = this.score.computerScore;\n\t\t\tthis.highScores.points = this.score.playerScore;\n\t\t\tthis.highScores.margin = this.score.playerScore - this.score.computerScore;\n\t\t\t//Make sure they were actually attempting makable field goals\n\t\t\tthis.highScores.fieldGoals = this.score.playerScore >= 3 ? this.boxScore.fieldGoals : null;\n\t\t\tthis.highScores.longestFieldGoal = this.boxScore.longestFieldGoal;\n\t\t\tthis.highScores.returnYards = this.boxScore.returnYards;\n\t\t\tthis.highScores.longestReturn = this.boxScore.longestReturn;\n\t\t\t//Minimum of 3 returns\n\t\t\tthis.highScores.yardsPerReturn = this.boxScore.returns >= 3 ? (this.boxScore.returnYards / this.boxScore.returns).toFixed(2) : null;\n\t\t\tthis.highScores.returnTDs = this.boxScore.returnTds;\n\t\t}\n\t}", "title": "" }, { "docid": "7ac74c9986e2d863c686d173e955bb3a", "score": "0.62705266", "text": "function compare(handA, handB){\n handAScore = score (handA);\n handBScore = score (handB);\n if (handAScore > handBScore){\n console.log('hand A wins');\n }\n else if (handBScore > handAScore){\n console.log('hand B wins');\n }\n else {\n console.log(\"tie\")\n }\n}", "title": "" }, { "docid": "d3625fa5139bfd8c12feb192c139fac7", "score": "0.62686324", "text": "function incrementScore() {\n score ++;\n}", "title": "" }, { "docid": "f7ec2debb511fb2e4f10966bc0bb9b64", "score": "0.62672573", "text": "function updateScore() {\n let score = computeScore(matches[currentMatchID].pointEvents);\n matches[currentMatchID].setScore = score[0];\n matches[currentMatchID].gameScore = score[1];\n\n updateScoreUI();\n }", "title": "" }, { "docid": "11bcb1c388ee148acb189f73d657ba92", "score": "0.6257405", "text": "function updateScore() {\n userScore.textContent = `${playerScore}`;\n botScore.textContent = `${computerScore}`;\n}", "title": "" }, { "docid": "900fa361643d529928ce515d3bdf6f35", "score": "0.6255602", "text": "increaseScore(player){\n player.scoresQueue.push(player.score);\n player.multiplier++;\n player.score += Server.baseScore + Server.multiplierScore * player.multiplier;\n }", "title": "" }, { "docid": "30184353ab0b7e7a0f8afc0f53f5ff79", "score": "0.62518394", "text": "function calculateScore(){\n var time = clock.getElapsedTime();\n\n var timescore = (Math.cos(1/time)*10);\n\n score -= timescore;\n //log(score);\n\n }", "title": "" }, { "docid": "793383c7381607992695b854cb50528e", "score": "0.62478685", "text": "function updateScore() {\n\n fill(255, 255, 255);\n textFont(myFont);\n textSize(20);\n text(\"PLAYER 1\", 40, 40);\n text(\"PLAYER 2\", 515, 40);\n push();\n fill(50, 50, 50);\n textSize(35);\n text(\"YOU ARE THE PING TO MY PONG\", 70, 460);\n pop();\n\n for (var i = 0; i < playerLeftScore; i++) {\n var scoreWidth = map(playerLeftScore, 0, 2, 0, 100);\n push();\n fill(255, 0, 0);\n rect(0, 0, scoreWidth, 20);\n pop();\n\n }\n\n if (playerLeftScore > 10) {\n gameOver = true;\n }\n\n for (var i = 0; i < playerRightScore; i++) {\n var scoreWidth = map(playerRightScore, 0, 2, 0, 100);\n push();\n fill(255, 0, 0);\n rect(width - 0, 0, scoreWidth, 20);\n pop();\n\n }\n if (playerRightScore > 10) {\n gameOver = true;\n }\n\n // To make the game more difficult, the player go to the next level\n // The ball is now more difficult to see with all the hearts going around\n var scoreTotal = playerRightScore + playerLeftScore;\n if (scoreTotal > 5) {\n image(heartTextureImage, random(0, 600), random(0, 600));\n push();\n textFont(myFont);\n textSize(20);\n fill(70);\n text(\"SO MUCH LOVE IN THE AIR\",205,380);\n pop();\n\n }\n\n}", "title": "" }, { "docid": "5cba8797ecd8071ca38801eb36e3d0e9", "score": "0.624632", "text": "function changeScore()\n{\n myScore = myScore + 100;\n console.log(\"Player score: \" + myScore);\n}", "title": "" } ]
8945badef9570c8d559563ea07dd9585
Loads the student's details and financial details
[ { "docid": "91d5e9c3d8c7089f033cbadac0f8e099", "score": "0.0", "text": "async function loadBilling() {\n\n try {\n\n // requests the user's details from Graph API\n var userDetails = await getUserBilling();\n\n // requests the user's details from Graph API\n var userFinances = await getUserFinances();\n\n // Construct HTML string\n var htmlString = '<div class=\"container\"> <div class=\"text-center\"> <div class=\"text-center\"><img src=\"../assets/images/middlesex-university-malta.jpg\" class=\"rounded\" alt=\"mdx-logo\"></div><h2>University Admin Information</h2><p>The university has the following details in its records</p></div><div class=\"row\"><div class=\"col-7 px-2\"><div class=\"card\"><div class=\"card-body\"><h5>Student Details</h5>';\n htmlString += '<ul class=\"list-group\"> <li class=\"list-group-item\"> <b>Full Name:</b> ' + userDetails.displayName + '</li> <li class=\"list-group-item\"> <b>E-mail:</b> ' + userDetails.userPrincipalName + '</li><li class=\"list-group-item\"> <b>Street Address:</b> <p>34, Serenity House <br>Merchant street </p> </li> <li class=\"list-group-item\"> <b>City:</b> Valletta </li> <li class=\"list-group-item\"> <b>PostCode:</b> VLT 1172 </li> <li class=\"list-group-item\"> <b>Country:</b> Malta </li> <li class=\"list-group-item\"> <b>Phone:</b> (+356) 8585 4785 </li> </ul> </div> </div> </div><div class=\"col-5 px-2\"> <div class=\"card\"> <div class=\"card-body\"><h5 class=\"card-title\">Financial Details 2020/21</h5> <ul class=\"list-group\">'\n for (const balances of userFinances.values) {\n htmlString += '<li class=\"list-group-item d-flex justify-content-between lh-sm\"> <b>' + balances[0] + ':</b> €' + balances[1] + '</li>';\n if (balances[0].includes(\"Pending\")) {\n remainingBalance = balances[1];\n }\n if (balances[0].includes(\"Paid\")) {\n paidBalance = balances[1];\n }\n }\n htmlString += '</ul></div></div></div></div></div>';\n\n // Display constructed string\n document.getElementById(\"display-panel\").innerHTML = htmlString;\n\n } catch {\n // Show error in console\n console.log(error);\n }\n}", "title": "" } ]
[ { "docid": "c65cd934f3ca5dfe6b9201a0f6caee4a", "score": "0.6177784", "text": "function getStudents() {\n var fileName = settings.studentCSV;\n fs.readFile(fileName, 'binary', (err, data) => {\n if (err) {\n finalCallback(err);\n return;\n }\n data = data.toString();\n var students = d3.csvParse(data);\n\n getCourseList(students);\n });\n }", "title": "" }, { "docid": "bc4b0a07f049de07a73af8f432102da4", "score": "0.6095926", "text": "function onLoadingPage() {\n setLocalStorage(defaultData);\n populatetoTable(getLocalStorage());\n studentData();\n\n }", "title": "" }, { "docid": "0d841c14b82fa2f164bf82463c0deafc", "score": "0.60927856", "text": "function onload() {\n \"use strict\";\n loadDoc('FullName', 'student', 'name');\n loadDoc('dob', 'student', 'dob');\n loadDoccc('dob', 'student', 'dob');\n loadDoc('mobile', 'student', 'mobile');\n loadDoc('address', 'student', 'address');\n loadDoc('nation', 'student', 'nationality');\n loadDoc('pan', 'student', 'panno');\n loadDoc('pass', 'student', 'passportno');\n loadDoc('from', 'student', 'EXPECTEDSALARYFROM');\n loadDoc('to', 'student', 'EXPECTEDSALARYto');\n loadDoc('will', 'student', 'WILLINGTORELOCATE');\n loadDocc('will', 'student', 'WILLINGTORELOCATE');\n loadDoc('10th', 'student', 'sslcpercent');\n loadDoccc('10th', 'student', 'sslcpercent');\n loadDoc('10yop', 'student', 'sslcyop');\n loadDocc('10yop', 'student', 'sslcyop');\n loadDoc('12th', 'student', 'twelthpercent');\n loadDoccc('12th', 'student', 'twelthpercent');\n loadDoc('12yop', 'student', 'twelthyop');\n loadDocc('12yop', 'student', 'twelthyop');\n loadDoc('branch', 'student', 'branch');\n loadDocc('branch', 'student', 'branch');\n loadDoc('degree', 'student', 'degree');\n loadDocc('degree', 'student', 'degree');\n loadDoccc('cgpa', 'student', 'cgpa');\n loadDoc('cgpa', 'student', 'cgpa');\n loadDoc('yop', 'student', 'yop');\n loadDocc('yop', 'student', 'yop');\n loadDoc('exp', 'student', 'EXPERIENCE');\n loadDoc('comp', 'student', 'company');\n loadDoc('key', 'student', 'KEYSKILLS');\n \n}", "title": "" }, { "docid": "90e33bbd1340f13503c0573c3a306e8f", "score": "0.6089372", "text": "function getStudents() {\n\n StudentFactory.getStudents()\n .then(function(response) {\n\n vm.students = response.data.students;\n },\n function(error) {\n if (typeof error === 'object') {\n toastr.error('There was an error: ' + error.data);\n } else {\n toastr.info(error);\n }\n })\n }", "title": "" }, { "docid": "acb83285ff59e84a27d9cd309dd1b827", "score": "0.6041817", "text": "function loadRecords() {\n var promiseGet = StudentService.getStudents(); //The MEthod Call from service\n promiseGet.then( function (pl) { $scope.Veiculos = pl.data },\n function (errorPl) {\n $log.error( 'Erro ao carregar veiculo Veiculo' , errorPl);\n });\n }", "title": "" }, { "docid": "ae2a62c38bd8e7a90cde69b99f3f027e", "score": "0.6009165", "text": "loadStudent() {\n API.getStudent(this.props.match.params.id)\n .then(studentResp => {\n this.setState({\n firstName: studentResp.data.firstName,\n lastName: studentResp.data.lastName,\n birthday: studentResp.data.birthday,\n age: studentResp.data.age,\n picture: studentResp.data.picture,\n parentFirstName: studentResp.data.parents[0].firstName,\n parentLastName: studentResp.data.parents[0].lastName,\n phone: studentResp.data.parents[0].phone,\n classesEnrolled: studentResp.data.classesEnrolled,\n id: studentResp.data._id\n })\n })\n }", "title": "" }, { "docid": "f7452b03ba77249d9e408366104741a8", "score": "0.5994427", "text": "function show_all_students(){\n\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX BEGIN show_all_students XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n\n var studentList = $('#student-list');\n var widget_quiz_reports = $('#widget-quiz-reports');\n var widget_quiz_reports_performance = $('#widget-quiz-reports-performance');\n studentList.hide();\n widget_quiz_reports.hide();\n widget_quiz_reports_performance.hide();\n $('#loading_gif').show();\n\n // POPULATE DATA to RESULTS TABLE\n var selected_course_id = checkLocalStorage('current_course');\n\n console.log('LOCAL STORAGE current_course ' +selected_course_id);\n \n // ajax URLs\n url_course_students = 'http://comstor.lumiousanalytics.com/api/lumiousreports/students/'+selected_course_id;\n url_student_data = 'http://comstor.lumiousanalytics.com/api/lumiousreports/studentdata/';\n\n // store results from these static URLs as objects to use with promises\n var students = $.getJSON(url_course_students);\n\n // declare variables for student object\n var student_id = null;\n var student_firstname = null;\n var student_lastname = null;\n var student_email = null;\n var student_username = null;\n var student_firstaccess = null;\n var student_lastaccess = null;\n\n // wait for student ajax request to complete before we proceed\n $.when(students).done(function(studentobject) {\n\n // dig down to the responseText object\n //var s = $.parseJSON(studentobject[1]);\n\n console.info(\"Student Data for Course \" + selected_course_id);\n console.info(studentobject);\n\n // reset the Results table\n dna.empty('results-body-access', { fade: true });\n\n // loop through the student object\n jQuery.each(studentobject, function(i, sdata) {\n \n student_id = sdata.id;\n student_firstname = sdata.firstname;\n student_lastname = sdata.lastname;\n student_email = sdata.email;\n student_username = sdata.username;\n student_firstaccess = sdata.firstaccess;\n student_lastaccess = sdata.lastaccess;\n\n console.log(\"Checking data for Student ID: \" + student_id);\n\n var student_stress = 'not_set';\n var student_instructor_comments = 'not_set';\n var student_instructor_comments_trimmed = 'not_set';\n var firstaccess_dateVal = student_firstaccess;\n\n // Format Date\n if (firstaccess_dateVal == 0) {\n var firstaccess_formatted_date = 'Never';\n }else{\n var firstaccess_formatted_date = moment.unix(firstaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n }; \n var lastaccess_dateVal = student_lastaccess;\n if (lastaccess_dateVal == 0) {\n var lastaccess_formatted_date = 'Never';\n }else{\n var lastaccess_formatted_date = moment.unix(lastaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n\n // ajax call to get student data details\n var studentdata = $.getJSON(url_student_data + student_id);\n // Store Details in DNA table values\n sdata['ID'] = student_id;\n sdata['FIRSTNAME'] = student_firstname;\n sdata['LASTNAME'] = student_lastname;\n sdata['EMAIL'] = student_email;\n sdata['USERNAME'] = student_username;\n sdata['FIRSTACCESS'] = student_firstaccess;\n sdata['FIRSTACCESSFORMATTEDDATE'] = firstaccess_formatted_date;\n sdata['LASTACCESS'] = student_lastaccess;\n sdata['LASTACCESSFORMATTEDDATE'] = lastaccess_formatted_date;\n\n // when ajax call is done\n $.when(studentdata).done(function(studentdataobject) {\n\n console.log(\"student data details: \");\n console.log(studentdataobject);\n\n // Student Notes Content - get array values, manipulate to clean up and use as comments and stress level\n var student_posts = studentdataobject.user[\"posts\"];\n \n console.log(student_posts);\n\n // ensure the posts object contains usable data\n if(student_posts != undefined){\n $.each(student_posts, function (index, x) {\n console.log('comment content: ' +x.content + ' publishstate: ' + x.publishstate );\n student_instructor_comments = x.content;\n student_instructor_comments_trimmed = student_instructor_comments.trim(); // remove whitespace\n student_instructor_comments_trimmed = student_instructor_comments.substr(2); // remove first 2 digits for stress level\n student_stress = student_instructor_comments.substring(0, 2); // take first 2 digits, use as stress setting\n console.log('Stress content: ' +student_stress + ' student_instructor_comments_trimmed: ' + student_instructor_comments_trimmed );\n \n // Add Labels to stress levels\n if ( student_stress == '20' || student_stress == 'Be' || student_stress == 'Jo' ) {\n // If entry is a default entry then update the text \n sdata['STUDENTSTRESS'] = '<span class=\"content_not_available\">N/A</span>';\n sdata['STUDENTINSTRUCTORCOMMENTS'] = '<span class=\"content_not_available\">No Comment</span>';\n \n }else{\n // Pass the stress levels html to the data object for dna with the correct label wrapping\n if (student_stress >= 7) {student_stress = '<span class=\"student-stress danger label\">'+student_stress+'</span>';};\n if (student_stress < 7) {student_stress = '<span class=\"student-stress warning label\">'+student_stress+'</span>';};\n if (student_stress < 4) {student_stress = '<span class=\"student-stress success label\">'+student_stress+'</span>';};\n sdata['STUDENTSTRESS'] = student_stress;\n sdata['STUDENTINSTRUCTORCOMMENTS'] = student_instructor_comments_trimmed;\n }\n console.log(student_stress);\n console.log(student_instructor_comments_trimmed);\n });\n }\n });\n \n\n // Bind data to table template\n dna.clone('results-body-access', sdata, {html: true, fade: true});\n\n \n // Update table so sorting works after ajax call\n $(\"#sortable\").trigger(\"update\"); \n studentList.fadeIn();\n \n \n // add listeners to modal links \n // $('#tbody_quiz_result').on('click', 'a.switch', function(e) {\n // e.preventDefault();\n // e.stopPropagation();\n // var triggered = $(this).attr('gumby-trigger');\n // console.log(triggered);\n // var student = $(this).parent().parent().find('.student').text();\n // var tofield = $(triggered).find('input[name=To]');\n // tofield.val(student);\n // $(triggered).addClass('active');\n // });\n });\n $('#loading_gif').hide();\n studentList.show();\n widget_quiz_reports.show();\n // widget_quiz_reports_performance.show();\n \n });\n\n //widget_quiz_reports.show();\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX END show_all_students XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n \n}", "title": "" }, { "docid": "89c6fb490598de9ecba71aca54a3f4fa", "score": "0.59847176", "text": "async function fetchDataStudents() {\n try {\n await this.fetchStudentsByClassroomAcademic(this.myclass.id)\n } catch (err) {\n if (typeof err.error_code != 'undefined' && err.error_code == 1201) {\n this.fetchDataStudents()\n return \n }\n this.showError(err)\n }\n}", "title": "" }, { "docid": "aed3bbf94b6c615fed42c119b3090aa8", "score": "0.59642863", "text": "function getStudentDetails() {\n $log.debug('getStudentDetails $scope.routeID ' + $scope.routeID);\n\n $indexedDB.openStore('student', function (studentStore) {\n $log.debug('studentStore opened');\n var find = studentStore.query();\n find = find.$eq($scope.routeID);\n find = find.$index(\"route_id\");\n\n studentStore.eachWhere(find).then(function (stuList) {\n $log.debug('studentStore eachwhere queried');\n $scope.existingStudentList = stuList;\n $log.debug('$scope.existingStudentList len = ' + $scope.existingStudentList.length);\n angular.forEach($scope.existingStudentList, function (studentObject) {\n $log.debug('studentObject.stop_id = ' + studentObject.stop_id);\n studentObject.stop_name = stopListHash[studentObject.stop_id].name;\n });\n // var temp = angular.fromJson($scope.existingStudentList[0].stop);\n //$log.debug('temp = ' + temp.name);\n });\n });\n }", "title": "" }, { "docid": "21e596d9695c233c1e83f8c79abdd148", "score": "0.58912486", "text": "function getStudentInfo() {\n fetch('/student-data').then(response => response.json()).then((info) => { \n var studentInfo = info['student'];\n // Display profile name with edit icon\n const pencilIcon = '<i id=\"pencil-name\" class=\"far fa-edit pencil-edit\"></i>';\n document.getElementById('edit-name').innerHTML = studentInfo['name'];\n document.getElementById('profile-heading').innerHTML += pencilIcon;\n document.getElementById('pencil-name').onclick= function() {sendEditAlert('name')};\n\n // Display profile club list\n displayElements(studentInfo['clubs'], '#club-list', 'club-content');\n\n // Add additional student information\n document.getElementById('email').innerHTML += studentInfo['email'];\n document.getElementById('edit-year').innerHTML += studentInfo['gradYear'];\n document.getElementById('edit-major').innerHTML += studentInfo['major'];\n\n // Add announcements to student's inbox\n displayElements(info['announcements'], '#inbox-list', 'inbox');\n\n // Upload profile picture\n if (studentInfo['profilePicture'] != '') {\n getImageUrl(studentInfo['profilePicture']);\n } else {\n document.getElementsByClassName('profile-pic')[0].src = 'images/profile.jpeg';\n }\n });\n getInterestedClubList();\n}", "title": "" }, { "docid": "ba7487688a8ff1d207f864a193b583a5", "score": "0.5880483", "text": "function StudentInfo(){\n\tstudentList(stud);\n}", "title": "" }, { "docid": "01458cf938b21ef4e1238aae2387b20e", "score": "0.5870991", "text": "function GetStudentList() {\n StudentService.getAllStudents().success(function (stu) {\n $scope.students = stu;\n }).error(function () {\n alert('Error in getting records');\n });\n }", "title": "" }, { "docid": "218e4fe5662856fec49fa8351e1e38b7", "score": "0.58588946", "text": "async function loadAllStudents() {\n\tvar students = await getAllStudents();\n\tvar newHTML = \"\";\n\tstudents = students.students;\n\n\t// for each student add a table row and 4 columns for each piece of information\n\tfor(var idx in students) {\n\t\tnewHTML += \"<tr id='row\" + idx + \"' ondblclick='loadStudentProfile(event)'>\";\n\t\tnewHTML += \"<td ondbclick='loadStudentProfile(event)'>\" + students[idx].first_name + \"</td>\";\n\t\tnewHTML += \"<td>\" + students[idx].last_name + \"</td>\";\n\t\tnewHTML += \"<td>\" + students[idx].school_email + \"</td>\";\n\t\tnewHTML += \"<td>\" + students[idx].major_name + \"</td>\";\n\t\tnewHTML += \"</tr>\"\n\t}\n\tvar element = document.getElementById(\"all_students_body\");\n\t// store the newly made html in the actuaal element on the page\n\telement.innerHTML = newHTML;\n\tswapStudentsHTML(\"all_students\");\n}", "title": "" }, { "docid": "7cc29b9c98612d27fde3000ec4aefc00", "score": "0.5850175", "text": "function onloadp() {\n \"use strict\";\n loadDocc('name', 'student', 'name');\n loadDocc('dob', 'student', 'dob');\n loadDocc('gender', 'student', 'gender');\n loadDocc('status', 'student', 'maritalstatus');\n loadDocc('abhi', 'student', 'MOBILE');\n loadDocc('add', 'student', 'address');\n loadDocc('nation', 'student', 'nationality');\n loadDocc('pan', 'student', 'panno');\n loadDocc('pass', 'student', 'passportno');\n \n \n \n //loadDoccc('from', 'student', 'EXPECTEDSALARYFROM');\n //loadDoccc('to', 'student', 'EXPECTEDSALARYto');\n //loadDocc('will', 'student', 'WILLINGTORELOCATE');// to display selected values\n loadDocc('10percent', 'student', 'sslcpercent');\n loadDocc('10yop', 'student', 'sslcyop');\n loadDocc('12percent', 'student', 'twelthpercent');\n loadDocc('12yop', 'student', 'twelthyop');\n loadDocc('branch', 'student', 'branch');\n loadDocc('degree', 'student', 'degree');\n loadDocc('cgpa', 'student', 'cgpa');\n loadDocc('yop', 'student', 'yop');\n loadDocc('exp', 'student', 'EXPERIENCE');\n loadDocc('comp', 'student', 'company');\n loadDocc('key', 'student', 'KEYSKILLS');\n \n}", "title": "" }, { "docid": "c649e925139b81450fe19403c3d9b2ed", "score": "0.5847087", "text": "function loadData() {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n console.log('readyState', this.readyState);\n if (this.readyState === 4 && this.status === 200) {\n const employees = JSON.parse(this.responseText);\n showData(employees);\n }\n };\n xhttp.open('GET', 'https://6057e432c3f49200173ad08d.mockapi.io/api/v1/employees/', true);\n //xhttp.open('GET', 'students.json', true);\n xhttp.send();\n}", "title": "" }, { "docid": "54b5c49423a9117865d194723a917f7d", "score": "0.5823534", "text": "async function getstudent(mentorname) {\n try {\n let rawdata = await fetch(`https://kavin-mentor.herokuapp.com/student/${mentorname}`);\n let studentdata = await rawdata.json();\n\n let ul = document.getElementById('students');\n ul.innerHTML = '';\n\n studentdata.forEach((student) => {\n let li = document.createElement('li');\n li.innerHTML = student.name;\n\n ul.append(li);\n });\n } catch (err) {\n console.log(`No student found`)\n }\n document.getElementById('studentdetailsdiv').style.display = (document.getElementById('studentdetailsdiv').style.display === 'block') ? 'none' : 'block';\n}", "title": "" }, { "docid": "960e493ab061f91d652a48128a1e386c", "score": "0.5781446", "text": "function findStudents() {\n\t\t$http.get(ApplicationStateService.serverUrl + \"/courses/\" + $scope.searchCourse._id)\n\t\t\t.success(function (response) {\n\t\t\t\t$scope.names = response.students;\n\t\t\t})\n\t\t\t.error(function (response) {\n\t\t\t\tconsole.log(response);\n\t\t\t});\n \t}", "title": "" }, { "docid": "aa4df442408a4976ff460a47553ac346", "score": "0.57151103", "text": "function addStudent(classId) {\r\n\t$(\"#schoolShow\").load(\"studentInfo.html?classId=\" + classId + getNoCache());\r\n}", "title": "" }, { "docid": "c827779d96b9bb38ac641f4578cba182", "score": "0.5714364", "text": "function loadData() {\n var studentJson = fs.readFileSync('./data.json', {encoding: 'utf8'});\n students = JSON.parse(studentJson);\n}", "title": "" }, { "docid": "c486302fe1c9b3584722469b964f3b13", "score": "0.5712108", "text": "function studentData() {\n $(document).ready(function () {\n $.getJSON(\"student.json\", function (data) {\n var student_data = '';\n $.each(data, function (key, value) {\n student_data += '<tr>';\n student_data += '<td>' + value.firstname + '</td>';\n student_data += '<td>' + value.lastname + '</td>';\n student_data += '<td>' + value.fathername + '</td>';\n student_data += '<td>' + value.gender + '</td>';\n student_data += '<td>' + value.course + '</td>';\n student_data += '<td>' + value.address + '</td>';\n student_data += '<td>' + value.city + '</td>';\n student_data += '<td>' + value.state + '</td>';\n student_data += '<td>' + value.pincode + '</td>';\n student_data += '<td>' + value.emailid + '</td>';\n student_data += '<td>' + value.password + '</td>';\n student_data += '<td>' + value.dob + '</td>';\n student_data += '<td>' + value.mobile_no + '</td>';\n student_data += '</tr>';\n });\n $('#studentData').append(student_data);\n });\n });\n }", "title": "" }, { "docid": "044eccecdef25f25ea59948c8444de92", "score": "0.571031", "text": "function getAllStudentContent() {\n getConfig().then(config => {\n document.getElementById(\"currentStudentLabel\").innerHTML = \"Current Student: \" + (config.nextStudentID - 1);\n loadSelectedMenu(config);\n });\n}", "title": "" }, { "docid": "445af45e97654d52126a545cf271865f", "score": "0.5695378", "text": "function getStudentDetails(canvasID, callback) {\n\n //api call path\n request({\n url: 'https://nwmissouridev.instructure.com//api/v1/users/' + canvasID + '/enrollments?access_token=' + access_token,\n encoding: null\n },\n //function to get the student deatils and store them in StudentRecords array\n function (error, response, body) {\n if (!error && response.statusCode == 200) {\n\n // variable to store the response body after parsing the respone body\n var reqBody = JSON.parse(body);\n for (var n = 0; n < reqBody.length; n++) {\n\n //checking for the enrolement if it is \"StudentEnrollment\" or not\n if (reqBody[n].role == 'StudentEnrollment') {\n var temp = {\n sis_user_id: reqBody[n].sis_user_id,\n name: reqBody[n].user.sortable_name,\n section_id: reqBody[n].sis_section_id,\n finalGrade: reqBody[n].grades.current_grade,\n finalScore: reqBody[n].grades.current_score,\n courseID: reqBody[n].course_id,\n userID: reqBody[n].user_id\n }\n\n //pushing the data to the array\n sis_user_id.push(reqBody[n].user_id);\n studentRecords.push(temp);\n }\n }\n\n //Functioanlity to get the unique advisees id's\n uniqueAdviseeID = sis_user_id.filter(function (elem, index, self) {\n return index == self.indexOf(elem);\n })\n callback(error, 'done');\n\n }\n });\n }", "title": "" }, { "docid": "fbed9a8aff2c21a38a3af1134c9b4acc", "score": "0.5689672", "text": "static async getStudentRecord(req, res) {\n const studentDomain = new StudentDomain();\n studentDomain.getStudentRecord(req, res);\n }", "title": "" }, { "docid": "4212e5baf12ba32ec4d75a748c115478", "score": "0.5667823", "text": "function loadData() {\n\ttoken=getToken();\n\tprojectId = getCurProject();\n userStoryId = isNull(readQueryString(\"uid\")) ? 0 : readQueryString(\"uid\");\n userStoryName = isNull(readQueryString(\"uname\")) ? '' : readQueryString(\"uname\");\n //loadDummyData();\n loadDataFromServices();\n}", "title": "" }, { "docid": "7932d7539f752032d1483d89a33690bc", "score": "0.5659079", "text": "function getStudent(studentId) {\n return fs.readJson('data/student.json').then(students => {\n return students.find(s => s.studentId === studentId);\n });\n}", "title": "" }, { "docid": "576722c302b693645424c2df6e6cca8a", "score": "0.56481296", "text": "function loadData() {\n apiService.get('/api/Orders/GetOrdersForEmployee/', null,\n ordersLoadCompleted,\n ordersLoadFailed)\n }", "title": "" }, { "docid": "1eae8a87aab4f3fdc7efa13b92be4248", "score": "0.56402755", "text": "function loadStudent(init) {\n\t$('#content').hide();\n\t$('#loading').show();\n\t$.ajax({\n\t\ttype : 'POST',\n\t\turl : SEARCH_PARTY_URL + \"/student_info\",\n\t\tdataType : \"json\",\n\t\tdata : {\n\t\t\ttask_idx : getStoredTask()\n\t\t},\n\t\tcache : false,\n\t\tsuccess : function(data) {\n\t\t\tg_studentInfo = data;\n\t\t\tchrome.extension.getBackgroundPage().g_studentInfo = g_studentInfo;\n\t\t\tupdateBadge(data.status);\n\t\t\t\n\t\t\tif (init) {\n\t\t\t\tinitUI(data);\n\t\t\t}\n\t\t\t\n\t\t\tif (data.status == 1) { // Check if student is logged in\n\t\t\t\tvar taskIndex = getSelectedTaskIndex();\n\t\t\t\tvar taskDesc = g_studentInfo.lesson.tasks[taskIndex][1];\n\t\t\t\t$('#task_desc').html(taskDesc);\n\t\t\t\t$('#task_history').html(getHistoryHtml());\n\n\t\t\t\tif (getStoredLink() != '') {\n\t\t\t\t\tvar ratingHtml = '<h2>Link Rating</h2>';\n\t\t\t\t\tif (getStoredLinkTitle() != '')\n\t\t\t\t\t\tratingHtml += getStoredLinkTitle() + '<br/>';\n\t\t\t\t\tratingHtml += getStoredLink() + '<br/>';\n\t\t\t\t\tratingHtml += getRatingSelector() + '<br/>';\n\t\t\t\t\tratingHtml += '<hr style=\"color:grey\"/>';\n\t\t\t\t\t$('#rating_area').html(ratingHtml);\n\t\t\t\t\tupdateLinkRating(getStoredLink());\n\t\t\t\t\t$('input[name=rating]').change(onRatingChanged);\n\t\t\t\t} else {\n\t\t\t\t\t$('#rating_area').html('');\n\t\t\t\t}\n\n\t\t\t\t// var responseStudentJSON = JSON.stringify(g_studentInfo, null, 2);\n\t\t\t\tvar responseHtml = '<h2>Response</h2>';\n\t\t\t\t// responseHtml += json_text + '<br /><br />';\n\t\t\t\tresponseHtml += getResponseControls() + '<br/>';\n\t\t\t\tresponseHtml += '<hr style=\"color:grey\"/>';\n\t\t\t\t$('#response_area').html(responseHtml);\n\t\t\t\tupdateResponse();\n\t\t\t\t$('#response').change(function() {\n\t\t\t\t\tonUnsavedResponse();\n\t\t\t\t});\n\t\t\t\t$('#explanation').change(function() {\n\t\t\t\t\tonUnsavedResponse();\n\t\t\t\t});\n\t\t\t\t$('#submit_response').click(function() {\n\t\t\t\t\tonResponseChanged();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tvar response = getMostRecentResponse();\n\n\t\t\t\t// Send message to content scripts requesting an update to the\n\t\t\t\t// in-browser SearchParty UI (sends to bannerUI.js).\n\t\t\t\t// chrome.extension.getBackgroundPage().updateState();\n\t\t\t\tchrome.extension.getBackgroundPage().refreshState();\n\t\t\t}\n\t\t\t$('#loading').hide();\n\t\t\t$('#content').show();\n\t\t},\n\t\terror : function() {\n\t\t\tg_studentInfo = null;\n\t\t\t$('#content').html('Error connecting to ' + SEARCH_PARTY_URL);\n\t\t\t$('#loading').hide();\n\t\t\t$('#content').show();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "267142a2df8aca1395747965fafa138d", "score": "0.5626692", "text": "async function loadStudentProfile(event) {\n\tvar student;\n\tvar searchBar = document.getElementById(\"userCard_ID\");\n\t// if there was no event then assume info wll be on main students page\n\t// otherwise info will be a row in all students table\n\tif(event == undefined) {\n\t\tstudent = searchBar.getAttribute(\"student_id\");\n\t\tsearchBar.setAttribute(\"student_id\", \"\")\t\n\t} else{\n\t\tstudent = searchBar.value;\n\t} \n\t\n\t// fill in student info\n\tresult = await getStudent(student);\n\tif(result == undefined) {\n\t\tsearchBar.value = \"\";\n\t\talert(\"There are no students of that name/id\");\n\t\treturn false;\n\t} else if(result.students.length > 1) {\n\t\tvar student_search = document.getElementById(\"student_search\")\n\t\tstudent_search.value = student;\n\t\t$(\"#searchStudentModal\").modal();\n\t\tdocument.getElementById(\"student_search\").focus();\n\t\tfillModalTable('student_search', foundStudent);\n\t\treturn;\n\t}\n\tfillStudentProfile(result);\n\treturn false;\n}", "title": "" }, { "docid": "f9291350fcee0c546f8125a17ce58f55", "score": "0.5626133", "text": "function loadStudent(data, i){\n $('#ajax-data').append('<div class=\"sigmanauts\"></div>');\n var $el = $('#ajax-data').children().last();\n $el.append('<h2><p>' + data.sigmanauts[i].name + '</p></h2>');\n $el.append('<p>'+ \"Git Username: \" + data.sigmanauts[i].git_username + '</p>');\n $el.append('<p>'+ \"Shoutout: \" + data.sigmanauts[i].shoutout + '</p>');\n\n }", "title": "" }, { "docid": "098850c6299a6535c3cdc82cb5dd2ae7", "score": "0.5622257", "text": "function initializeExamRecords() {\n studentRecords = openStudentExamRecords();\n}", "title": "" }, { "docid": "c1e7ca65fb6c01b4e15fe4140979f64e", "score": "0.5612577", "text": "function getAllStudents() {\n \n \tvar deferred = $q.defer();\n \n \t$http.get(REST_SERVICE_URI+'/students' )\n .then(\n function (response) {\n deferred.resolve(response.data);\n },\n function(errResponse){\n console.error('Error while fetching Students');\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "title": "" }, { "docid": "c4f37e81347378fe9235d19ab6d2f25a", "score": "0.561103", "text": "function showStudents()\n{\n var students = getAllStudents();\n students.forEach(function(student){\n console.log('Student: ' + student.fullname + ' (' + student.id + ')');\n });\n}", "title": "" }, { "docid": "179f0c9c78d572804f0effacde15c840", "score": "0.56103647", "text": "function loadDataTableDetail() {\n\t\t\tif (vm.itemID != null) {\n\t\t\t\tacceptanceBListService.getAccpetMerList(vm.itemID.bmaterialAcceptanceId).then(function (d) {\n\t\t\t\t\tfillDataTableDetail(d.plain());\n\t\t\t\t\trefreshGridDetail(d.plain());\n//\t\t\t\t\tinitdata();\n\t\t\t\t}, function (e) {\n\t\t\t\t});\n\t\t\t} else if (vm.itemID === undefined) {\n//\t\t\t\tinitdata();\n\t\t\t\tfillDataTableDetail([]);\n\t\t\t\trefreshGridDetail([]);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "35e48dbd26487f5b234361766e0376d4", "score": "0.5596214", "text": "function Student(data) {\r\n if (\"ctrl\" in data && data.ctrl) this.ctrl = data.ctrl;\r\n if (\"student_id\" in data && data.student_id) this.student_id = data.student_id;\r\n if (\"student_name\" in data && data.student_name) this.student_name = data.student_name;\r\n if (\"student_phone\" in data && data.student_phone) this.student_phone = data.student_phone;\r\n if (\"student_email\" in data && data.student_email) this.student_email = data.student_email;\r\n if (\"student_image\" in data && data.student_image) this.student_image = data.student_image;\r\n if (\"studentCourses\" in data && data.studentCourses) this.studentCourses = data.studentCourses;\r\n if (\"inner\" in data && data.inner) this.inner = data.inner;\r\n}", "title": "" }, { "docid": "6bca5a014614c7f7148b97b4ec8e40ae", "score": "0.55636907", "text": "function loadDetailData() {\n if (detailData[detailCountry] == undefined) {\n var detailJson = options.dataPath + detailCountry + \".json\";\n loadFile(detailJson, function(detailResponse) {\n detailData[detailCountry] = JSON.parse(detailResponse); \n updateDetails();\n });\n } else {\n updateDetails();\n }\n }", "title": "" }, { "docid": "7e760798e0c9dbdeb2a9e028ff093dbc", "score": "0.55246377", "text": "getStudentsData(ref) {\n this.students = this.Data.persons;\n this.students.forEach(i => {\n this.person = i['Students'];\n });\n return this.person.find(e => e.stdID === ref);\n }", "title": "" }, { "docid": "c959aa2de70041cca9ad7c08ee2170cb", "score": "0.5498842", "text": "function student_come(){\r\n\t\t// alert(current_batch_id+\" \"+current_group_id);\r\n\r\n\t\tvar token = 'Bearer '+localStorage.getItem(\"usertoken\");\r\n\r\n\t\t$.ajax({headers: {\r\n\t\t\t'Authorization': token },\r\n\t\t\ttype: 'get',\r\n\t\t\turl: 'http://www.coderstrust.com/api/batches/'+current_batch_id+'/groups/'+current_group_id+'/students.json',\r\n\t\t\terror: function (data) {console.log(data)},\r\n\t\t\tsuccess: function (data) {\r\n\r\n\t\t\t\tconsole.log(data);\r\n\t\t\t\tvar trHTML = '';\r\n\t\t\t\t$('#records_table').html(\"\");\r\n\t\t\t\t$.each(data, function() {\r\n\t\t\t\t\t// console.log(this.name+\" \"+this.hours_spent_today);\r\n\t\t\t\t\ttrHTML += '<tr><td><input class=\"form-control input-sm transparent\" readonly type=\"number\" name=\"s_id[]\" value=\"'+this.id+'\"></td><td><input class=\"form-control input-sm transparent\" readonly type=\"text\" name=\"name[]\" value=\"'+this.name+ '\"</td><td><input type=\"checkbox\" name=\"attendance[]\" value=\"1\" id=\"'+ this.id +'\"> Yes <input type=\"checkbox\" name=\"attendance[]\" value=\"0\"> No </td></tr>';\r\n\t\t\t\t\t//trHTML += '<tr><td>'+this.id+'</td><td>'+this.name+ '</td><td><input type=\"checkbox\" name=\"attendance[]\" value=\"1\" id=\"'+ this.id +'\"> Yes <input type=\"checkbox\" name=\"attendance[]\" value=\"0\"> No </td></tr>';\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\t$('#records_table').append('<tr><th>Student ID</th><th>Student Name</th><th>Attendance</th></tr>');\r\n\t\t\t\t$('#records_table').append(trHTML);\r\n\r\n\r\n\r\n\t\t\t\t//worksnap hours\r\n\r\n\t\t\t\tvar trHTML = '';\r\n\t\t\t\t$('#worktable').html(\"\");\r\n\t\t\t\t$.each(data, function() {\r\n\t\t\t\t\tconsole.log(this.name+\" \"+this.hours_spent_today);\r\n\t\t\t\t\ttrHTML += '<tr><td><input class=\"form-control input-sm transparent\" readonly type=\"number\" name=\"s_id[]\" value=\"'+this.id+'\"></td><td><input class=\"form-control input-sm transparent\" readonly type=\"text\" name=\"name[]\" value=\"'+this.name+ '\"</td><td><input class=\"form-control input-sm transparent\" readonly type=\"text\" name=\"hour[]\" value=\"'+this.hours_spent_today+ '\"</td></tr>';\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\t$(\"#link_loading\").hide();\r\n\t\t\t\t$('#worktable').append('<tr><th>Student ID</th><th>Student Name</th><th>Wroksnap Hours</th></tr>');\r\n\t\t\t\t$('#worktable').append(trHTML);\r\n\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t}", "title": "" }, { "docid": "d588c6e07c2f11c2198e0c6d59137213", "score": "0.54938793", "text": "function fetchUniInfo() {\n // delete old data to prevent duplications\n $('#uni_profile').empty();\n $('#uni_courses').empty();\n // clear unrelated info and selections\n $('#uni_province_abv').val('-');\n $('#uni_prov_table').hide();\n $('#unis_by_eq_table').hide();\n $('#uni_detailed_tables').show();\n $('#uni_offers_eq').prop('checked', false);\n // make GET request\n $.get('../controllers/search.php',\n {\n entity: 'university',\n uni_name: $( '#uni_name' ).val()\n },\n function(response) {\n $('#uni_profile').append(response);\n });\n // load the selected University's course\n fetchCourseInfo();\n}", "title": "" }, { "docid": "821c1562085f0939b4e66d141af5e2c1", "score": "0.5474937", "text": "getStudentByStudentId(studentId) {\r\n return axios.get(BaseUrl + \"/\" + studentId);\r\n }", "title": "" }, { "docid": "b8e2caba55415e35863d0c958f26f6e5", "score": "0.5460704", "text": "async function getJson() {\n let jsonData = await fetch(\"frontenders2018.json\");\n studentsJson = await jsonData.json();\n createStudents();\n currentStudents = students;\n displayList(currentStudents);\n}", "title": "" }, { "docid": "fa2e4206914a3744a7cdde06b995d122", "score": "0.54532146", "text": "function loadRecords() {\n var promiseGetUser = SinglePageCRUDService.getUser();\n\n promiseGetUser.then(function (pl) { $scope.User = pl.data },\n function (errorPl) {\n $scope.error = 'failure loading User', errorPl;\n });\n }", "title": "" }, { "docid": "bbd9eebe2e0224d56c9fac07add197a2", "score": "0.54365355", "text": "function retrieveStore() {\n studentData = JSON.parse(localStorage.getItem(STORE_NAME));\n }", "title": "" }, { "docid": "0aec1711dc2b3c7d493e67fdcc8c1fbc", "score": "0.5429096", "text": "load(){\n this.points = DB.getPoints(this.id);\n this.birthday = DB.getBirthday(this.id);\n return;\n }", "title": "" }, { "docid": "abad01ad47b056028f1c04979622bcf7", "score": "0.54240245", "text": "function loadData() {\n\t\tisLoading = true;\n\t\t$('#loaderCircle').show();\n\n\t\t$.ajax({\n\t\t\turl: apiURL,\n\t\t\tdata: {\n\t\t\t\tpage: page,\n\t\t\t\tschool: current_school\n\t\t\t}, // Page parameter to make sure we load new data\n\t\t\tsuccess: onLoadData\n\t\t});\n\t\tNProgress.start();\n\t}", "title": "" }, { "docid": "ebb5f8127cfec8b7210138bf9f6327be", "score": "0.5422798", "text": "function loadSprintDetails( sprint, callback)\n{\n\t$.getJSON( sprintDetailsUrl + '?action=get&sprint_id=' + sprint, callback);\n}", "title": "" }, { "docid": "19b6e197f7d549f5e689ceef267e8d7f", "score": "0.5421403", "text": "function loadData() {\n\t\t}", "title": "" }, { "docid": "bba4526837dbff3d0277897dcb515c97", "score": "0.54190296", "text": "getStudentById(studentId) {\n return axios.get(BASE_URL + '/' + studentId);\n }", "title": "" }, { "docid": "8d95f099da2f1403fb0fe87a226210e3", "score": "0.5419005", "text": "function show_students_that_have_not_logged_in(){\n\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX BEGIN show_students_that_have_not_logged_in XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n\n // Set Markup and Endpoint elements\n var studentList = $('#student-list');\n var widget_quiz_reports = $('#widget-quiz-reports');\n var widget_quiz_reports_performance = $('#widget-quiz-reports-performance');\n studentList.hide();\n widget_quiz_reports.hide();\n widget_quiz_reports_performance.hide();\n $('#loading_gif').show();\n\n // POPULATE DATA to RESULTS TABLE\n var selected_course_id = checkLocalStorage('current_course');\n console.log('LOCAL STORAGE current_course ' +selected_course_id);\n url_course_students = 'http://comstor.lumiousanalytics.com/api/lumiousreports/students/' +selected_course_id;\n\n // reset the Results table\n dna.empty('results-body-access', { fade: true });\n\n $.getJSON( url_course_students, function( json ) {\n\n // Reset Student Data Variables\n var student_id = null;\n var student_firstname = null;\n var student_lastname = null;\n var student_email = null;\n var student_username = null;\n var student_firstaccess = null;\n var student_lastaccess = null;\n\n \n jQuery.each(json, function(i, val) {\n \n student_id = val.id;\n student_firstname = val.firstname;\n student_lastname = val.lastname;\n student_email = val.email;\n student_username = val.username;\n student_firstaccess = val.firstaccess;\n student_lastaccess = val.lastaccess;\n console.log('Students who have NOT logged in: ('+student_id+') '+student_firstname +' '+student_lastname + ' Access: '+student_firstaccess);\n // Filter Results - only show students that have not logged in 2 days before start date\n\n // Format Date to be Readable\n if (student_firstaccess == 0 ) { \n\n var firstaccess_dateVal = student_firstaccess;\n if (firstaccess_dateVal == 0) {\n var firstaccess_formatted_date = 'Never';\n }else{\n var firstaccess_formatted_date = moment.unix(firstaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n \n var lastaccess_dateVal = student_lastaccess;\n if (lastaccess_dateVal == 0) {\n var lastaccess_formatted_date = 'Never';\n }else{\n var lastaccess_formatted_date = moment.unix(lastaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n \n // Store Details in DNA table values\n val['ID'] = student_id;\n val['FIRSTNAME'] = student_firstname;\n val['LASTNAME'] = student_lastname;\n val['EMAIL'] = student_email;\n val['USERNAME'] = student_username;\n val['FIRSTACCESS'] = student_firstaccess;\n val['FIRSTACCESSFORMATTEDDATE'] = firstaccess_formatted_date;\n val['LASTACCESS'] = student_lastaccess;\n val['LASTACCESSFORMATTEDDATE'] = lastaccess_formatted_date;\n console.log('Students who have logged in: ('+student_id+') '+student_firstname +' '+student_lastname);\n // Bind data to table template\n dna.clone('results-body-access', val, {html: true, fade: true});\n };\n\n\n // Update table so sorting works after ajax call\n $(\"#sortable\").trigger(\"update\"); \n studentList.fadeIn();\n \n // add listeners to modal links \n\n // $('#tbody_quiz_result').on('click', 'a.switch', function(e) {\n // e.preventDefault();\n // e.stopPropagation();\n // var triggered = $(this).attr('gumby-trigger');\n // console.log(triggered);\n // var student = $(this).prev().find('.student-firstname').text();\n // var tofield = $(triggered).find('input[name=To]');\n // tofield.val(student);\n // $(triggered).addClass('active');\n // });\n\n });\n });\n $('#loading_gif').hide();\n studentList.show();\n widget_quiz_reports.show();\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX END show_students_that_have_not_logged_in XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n}", "title": "" }, { "docid": "31d3ec2b85c3893e11541e26c9e98620", "score": "0.54165196", "text": "function initStudentHtml() {\n // Detach from the DOM to improve performance\n $tbody.detach();\n \n // Format student rows and retrieve data\n $row.each(function(i) {\n const row = new Row($(this), i);\n row.updateHTML();\n row.updateData();\n });\n\n // Restore previous sort order if store data exists\n if (localStorage[STORE_NAME]) {\n $row.detach()\n .sort((a,b) => {\n return $(a).data('index') - $(b).data('index')\n })\n .appendTo($tbody);\n }\n\n // Update data when editing\n $tbody.on('keyup', 'td.small-6 > small', function() {\n const id = $(this).data('id');\n studentData[id].subject = $(this).text();\n updateStore();\n });\n\n // Reattach to the DOM\n $students.append($tbody);\n }", "title": "" }, { "docid": "22421a3d0a41341daba27b603d940503", "score": "0.5396671", "text": "function consultarStudents() {\n $('#contenedorLista').load(\"./fStudent/frStudentConsultas.php\");\n}", "title": "" }, { "docid": "9d3d961b13c5c436694bb4b28e3c5b88", "score": "0.5384368", "text": "function getData(){\r\n\t\tif(auth.currentUser){\r\n\t\t\tdb.collection('Students').where('Graduate',\"==\",false).onSnapshot((snapshot)=>{\r\n\t\t\t\t\tlet changes = snapshot.docChanges();\r\n\t\t\t\t\tchanges.forEach(change =>{\r\n\t\t\t\t\t\tif(changes.type == 'Create'){\r\n\t\t\t\t\t\t\tDisplayStudent(change.doc);\r\n\t\t\t\t\t\t\trecordlist(change.doc);\r\n\t\t\t\t\t\t\talert('Account has been added.');\r\n\t\t\t\t\t\t}else if(changes.type=='Update'){\r\n\t\t\t\t\t\t\talert('Account has been update.');\r\n\t\t\t\t\t\t}else if(changes.type=='Remove'){\r\n\t\t\t\t\t\t\talert('Account has been remove.');\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tDisplayStudent(change.doc);\r\n\t\t\t\t\t\t\trecordlist(change.doc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t});\r\n\t\t}\r\n}", "title": "" }, { "docid": "2bf5b248a44f63e05ee016a72ac6f140", "score": "0.53789896", "text": "function show_students_that_have_logged_in(){\n\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX BEGIN show_students_that_have_logged_in XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n\n // Set Markup and Endpoint elements\n var studentList = $('#student-list');\n var widget_quiz_reports = $('#widget-quiz-reports');\n var widget_quiz_reports_performance = $('#widget-quiz-reports-performance');\n studentList.hide();\n widget_quiz_reports.hide();\n widget_quiz_reports_performance.hide();\n $('#loading_gif').show();\n // studentList.hide();\n // widget_quiz_reports.hide();\n\n // POPULATE DATA to RESULTS TABLE\n var selected_course_id = checkLocalStorage('current_course');\n console.log('LOCAL STORAGE current_course ' +selected_course_id);\n url_course_students = 'http://comstor.lumiousanalytics.com/api/lumiousreports/students/' +selected_course_id;\n\n // reset the Results table\n dna.empty('results-body-access', { fade: true });\n\n $.getJSON( url_course_students, function( json ) {\n \n // Reset Student Data Variables\n var student_id = null;\n var student_firstname = null;\n var student_lastname = null;\n var student_email = null;\n var student_username = null;\n var student_firstaccess = null;\n var student_lastaccess = null;\n\n\n jQuery.each(json, function(i, val) {\n \n student_id = val.id;\n student_firstname = val.firstname;\n student_lastname = val.lastname;\n student_email = val.email;\n student_username = val.username;\n student_firstaccess = val.firstaccess;\n student_lastaccess = val.lastaccess;\n \n // Filter Results - only show students that have logged in\n // Format Date to be Readable\n if (student_firstaccess != 0) {\n\n var firstaccess_dateVal = student_firstaccess;\n if (firstaccess_dateVal == 0) {\n var firstaccess_formatted_date = 'Never';\n }else{\n var firstaccess_formatted_date = moment.unix(firstaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n \n var lastaccess_dateVal = student_lastaccess;\n if (lastaccess_dateVal == 0) {\n var lastaccess_formatted_date = 'Never';\n }else{\n var lastaccess_formatted_date = moment.unix(lastaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n \n // Store Details in DNA table values\n val['ID'] = student_id;\n val['FIRSTNAME'] = student_firstname;\n val['LASTNAME'] = student_lastname;\n val['EMAIL'] = student_email;\n val['USERNAME'] = student_username;\n val['FIRSTACCESS'] = student_firstaccess;\n val['FIRSTACCESSFORMATTEDDATE'] = firstaccess_formatted_date;\n val['LASTACCESS'] = student_lastaccess;\n val['LASTACCESSFORMATTEDDATE'] = lastaccess_formatted_date;\n console.log('Students who have logged in: ('+student_id+') '+student_firstname +' '+student_lastname);\n // Bind data to table template\n dna.clone('results-body-access', val, {html: true, fade: true});\n };\n\n \n // Update table so sorting works after ajax call\n $(\"#sortable\").trigger(\"update\"); \n studentList.fadeIn();\n \n // add listeners to modal links \n\n // $('#tbody_quiz_result').on('click', 'a.switch', function(e) {\n // e.preventDefault();\n // e.stopPropagation();\n // var triggered = $(this).attr('gumby-trigger');\n // console.log(triggered);\n // var student = $(this).parent().parent().find('.student').text();\n // var tofield = $(triggered).find('input[name=To]');\n // tofield.val(student);\n // $(triggered).addClass('active');\n // });\n });\n });\n $('#loading_gif').hide();\n studentList.show();\n widget_quiz_reports.show();\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX END show_students_that_have_logged_in XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n}", "title": "" }, { "docid": "43a61ab9bcdf8bcae3e338aa1c59b72d", "score": "0.5369071", "text": "async show(req, res) {\n try {\n const { id } = req.params;\n\n if (!id) {\n return res.status(400).json({\n errors: [\"Error 400 - Missing ID\"],\n });\n }\n\n const student = await Student.findByPk(id, {\n attributes: [\n \"id\",\n \"name\",\n \"surname\",\n \"email\",\n \"age\",\n \"weight\",\n \"height\",\n ],\n order: [\n [\"id\", \"DESC\"],\n [Photo, \"id\", \"DESC\"],\n ],\n include: {\n model: Photo,\n attributes: [\"url\", \"filename\"],\n },\n });\n\n if (!student) {\n return res.status(400).json({\n errors: [\"Error 400 - Student does not exists\"],\n });\n }\n\n return res.json(student);\n } catch (error) {\n return res.status(400).json({\n errors: [\"Error 400 - Bad Request\"],\n });\n }\n }", "title": "" }, { "docid": "41b7f5fb6603de35448b7c6537eb0b03", "score": "0.5365026", "text": "function loadTable(students)\r\n{\r\n // Adding \"mapped\" variable to students\r\n let headers = [\"Email\", \"First Name\", \"Last Name\", \"Score\", \"Assigned?\"];\r\n let keys = [\"email\", \"firstname\", \"lastname\", \"score\", \"mapped\"];\r\n // Determining whether students are mapped\r\n if (!mappingData)\r\n {\r\n console.log(\"Cannot load table; mapping data not loaded first.\");\r\n return;\r\n }\r\n for (var i = 0; i < students.length; i++)\r\n {\r\n let studentid = students[i].id;\r\n // Getting map from student to exam\r\n var map = mappingData.find(function(element) {\r\n return (element.studentsid === studentid);\r\n });\r\n if (map === undefined)\r\n {\r\n // Student not mapped\r\n students[i].score = \"Unassigned\";\r\n students[i].mapped = false;\r\n }\r\n else\r\n {\r\n // Student mapped\r\n students[i].mapped = true;\r\n // Student mapped, has not taken exam\r\n if (map.taken == \"0\")\r\n students[i].score = \"Not Taken\";\r\n // Student mapped and has taken exam\r\n if (map.taken == \"1\")\r\n {\r\n students[i].score = Math.round(map.score * 100) + \"%\";\r\n }\r\n }\r\n }\r\n let table = makeTable(TABLE_CHECK, headers, keys, students);\r\n table.attr(\"id\", \"studentTable\");\r\n buildSearchAddBar();\r\n $(\"#openCreateModifyButton\").remove();\r\n $(tableDiv).append(table);\r\n // No entries to create\r\n let button = $(document.createElement(\"button\"));\r\n // Adding \"Save Changes\" button\r\n button.attr(\"onclick\", \"saveChanges()\");\r\n button.html(\"Save Changes\");\r\n button.attr(\"class\", \"btn btn-primary\");\r\n $(tableDiv).append(button);\r\n}", "title": "" }, { "docid": "34bc585e434079eed0f3ce3cef11a60d", "score": "0.53649235", "text": "function loadData() {\n\t\t\t\tvm.formDisabled = true;\n\t\t\t\tmainFactory.profile().then(function(data) {\n\t\t\t\t\tvm.user = data;\n\t\t\t\t\tvm.formDisabled = false;\n\t\t\t\t}, function(data) {\n\t\t\t\t\tvm.formDisabled = false;\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "8421e9d3045923424a01a8aa4320deba", "score": "0.53622234", "text": "function getStudents(done) {\n models.Students\n .findAll({\n include: [models.Users]\n })\n .then(function (data) {\n done(data);\n })\n .catch(function (err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "de3c9cfe82619d3cda03c7d32802e7c3", "score": "0.53532106", "text": "loadStations() {\n lib.cleanDivStations();\n lib.openLoader();\n const enabled = {\n state: true,\n action: 'admin'\n }\n this.getData(enabled, \"Habilitadas\"); // Get enabled stations\n const disabled = {\n state: false,\n action: 'admin'\n }\n this.getData(disabled, \"Deshabilitadas\"); // Get disabled stations\n lib.resetForm();\n }", "title": "" }, { "docid": "09419884d44ddabbed27d448aa682e6d", "score": "0.5334642", "text": "static async get(req, res) {\n const studentDomain = new StudentDomain();\n studentDomain.getAllStudents(req, res);\n }", "title": "" }, { "docid": "291d9969e7cd48f2ce73afdbdb7c39c3", "score": "0.5327066", "text": "function showDetails() {\n\t\tdocument.getElementById(\"search_result\").style.display = \"none\";\n\t\tdocument.getElementById(\"company_detail\").style.display = \"block\";\n\n\t\t// make previous data blank\n\t\tdocument.querySelector(\"#company_detail > h4\").innerHTML = \"\";\n\t\tdocument.getElementById(\"company_detail_info\").innerHTML = \"\";\n\t\tdocument.querySelector(\"#company_map img\").src = \"\";\n\t\tdocument.getElementById(\"contactee\").value = \"\";\n\t\tdocument.getElementById(\"email\").value = \"\";\n\t\tdocument.getElementById(\"phone\").value = \"\";\n\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.open(\"GET\", \"data/companies.php?mode=detailed&id=\" + this.id, true);\n\t\trequest.onload = details;\n\t\trequest.send();\n\t}", "title": "" }, { "docid": "a54c5094da3948a55f7ceb6e2fd67309", "score": "0.52967477", "text": "getAllStudentDetails(req,res)\n {\n let projection = {\n _id : 0 \n }\n return userService.AllStudents(projection)\n .then((result) => {\n res.status(200).json({\n status : 200 ,\n message : \"THE STUDENTS ARE\",\n data : result\n });\n })\n .catch((err) => {\n res.status(400).json({\n status : 400 ,\n message : \"UNABLE TO FETCH THE STUDENT DETAILS\",\n });\n });\n }", "title": "" }, { "docid": "88b160fe3226d3a50c8d4cb084eed3ec", "score": "0.52965975", "text": "function init(){\n getDetails()\n }", "title": "" }, { "docid": "a1cf4de1fe05fc38cf93892f28fe3ea3", "score": "0.52890015", "text": "function loadproductdetails() {\n var fileSystemHelper = new FileSystemHelper();\n var fileName = \"himalayaproductdetails.txt\";\n fileSystemHelper.readTextFromFile(fileName, app.productdetail._FileonSuccess,\n app.productdetail._FileonError);\n}", "title": "" }, { "docid": "d932063a7cb0339f3735ff7ab3b43da6", "score": "0.52886343", "text": "function loadData() {}", "title": "" }, { "docid": "288583eadc743bd1e267da69d00dad04", "score": "0.5272814", "text": "readStudent(id){\n\t\tif (id) {\n\t\t\tif (this.doesStudentExist(id)) {\n\t\t\t\treturn this.data[id];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn Object.values(this.data);\n\t\t}\n\t}", "title": "" }, { "docid": "ef263c97b5c62952411305cbd54ac7e1", "score": "0.52547", "text": "function loadDataDiagram() {\n var retorno = prepareSymptoms(scope[selectedClass.fullyQualifiedName]);\n\n csv = retorno[0];\n relations = retorno[1];\n symptoms = retorno[2];\n // console.log(symptoms)\n }", "title": "" }, { "docid": "f74b45c598c5763a3b2e545d2c748288", "score": "0.5239048", "text": "function getStudents(event) {\n\n var students = [];\n var myDiv = document.querySelector(\"#mydiv\");\n\n console.log(SelectProm.value)\n\n fetch(\"http://api-students.popschool-lens.fr/api/promotions/\" + SelectProm.value)\n .then(response => response.json())\n .then(promotion => {\n \n // We display it into the console (raw datas)\n console.log(students)\n // We give a value to the students table (the value of the table within the object)\n // students = myjson.students;\n \n // We start to browse and display the students\n promotion.students.forEach(function (studentURL) {\n fetch(\"http://api-students.popschool-lens.fr\" + studentURL)\n .then(r => r.json())\n .then(function(student) { \n\n console.log(student);\n myDiv.innerHTML += `<div class=\"card\" style=\"width: 18rem;\">\n <img class=\"card-img-top\" src=\".../100px180/\" alt=\"\">\n                 <div class=\"card-body\">\n                 <h5 class=\"card-title\"> ${student.firstname} ${student.lastname}</h5>\n                 </div>\n                 </div>`\n });\n });\n })\n}", "title": "" }, { "docid": "28d11bbc8aa2183d646b5232d3072eed", "score": "0.5236692", "text": "async function loadDetails(element){\n const data = await getExistingInfo(element);\n const {subject,isTest,text,dueDate,lastEditTime:editTime,lastEditPerson:editPerson} = data;\n $(\"#detailLastEdit\").text(Sugar.Date.format(new Date(editTime),\"{d}/{M}/{yyyy}\")+\" \"+Sugar.Date.format(new Date(editTime),\"%I:%M\")+Sugar.Date.format(new Date(editTime),\"%P\")+\" by \"+editPerson);\n $(\"#detailHomeworkName\").text(text);\n $(\"#detailSubject\").text(subject);\n if(isTest){\n $(\"#detailGraded\").text(\"Yes\");\n }else{\n $(\"#detailGraded\").text(\"No\");\n }\n $(\"#detailDue\").text(new Date(dueDate).getFullYear()===2099 ? \"Unknown\" : `${Sugar.Date.format(new Date(dueDate),\"%d/%m/%Y %H:%M\")}, ${dateParser.daysUntil(new Date(dueDate))} days left.`);\n detailsSheet.open();\n}", "title": "" }, { "docid": "05b5f7873883229756bacfdf4f20f6a3", "score": "0.52349997", "text": "displayAllStudents(){\n\t\t$('#displayArea').empty();\n\t\tvar idNumber;\n\t\tfor (idNumber in this.data) {\n\t\t\tvar renderedStudent = this.data[idNumber].render();\n\t\t\t$('#displayArea').append(renderedStudent);\n\t\t}\n\t\tthis.displayAverage();\n\t}", "title": "" }, { "docid": "ea3dd284f30e61a0109d5816a64c7552", "score": "0.523336", "text": "function disp_profile()\n{\n if (localStorage.stuid == \"null\") {\n alert(\"Please Login First...\");\n window.location.href = \"/Students/Signin\";\n\n }\n\n \n else {\n $('#loader').show();\n $.ajax({\n url: \"/Students/FindStudent/\" + parseInt(localStorage.stuid),\n type: \"GET\",\n contentType: \"application/json;charset=utf-8\",\n dataType: \"json\",\n success: function (result) {\n \n if (result != -2) {\n \n document.getElementById('stuid').innerHTML = \"Entry Id :\" + \"AdViK\" + result.stuid + \"TYa19\";\n document.getElementById('name').innerHTML = result.stuname;\n document.getElementById('fname').innerHTML = result.stufname;\n document.getElementById('email').innerHTML = result.stuemail;\n document.getElementById('pwd').innerHTML = \"***********\"; //result.stupwd\n\n $('#loader').hide();\n }\n else {\n alert(\"Something Went Wrong please try again\");\n }\n },\n error: function (errormessage) {\n alert(\"Something Went Wrong please try again\");\n }\n\n });\n }\n}", "title": "" }, { "docid": "a9e62d7b334c01a575a8f104d579d11e", "score": "0.5232989", "text": "function LoadGeneralData() {\n\t/**\n\t * I dati dal quale caricare il modello dei dati.\n\t * @type {Object}\n * @private\n\t */\n\tthis.datas = null;\n}", "title": "" }, { "docid": "5ecc0cc2aba2d9246769db26f8bae527", "score": "0.5231865", "text": "function load() {\n\t\t\tgetArticles();\n\t\t}", "title": "" }, { "docid": "830de9b55c3985c1888aec85627ede4c", "score": "0.5230878", "text": "async function loadData() {\n setLoading(true);\n const dataFromStore = await loadScheduleDataFromStore();\n const courseFromStore = dataFromStore.course;\n const lectureSectionsFromStore = dataFromStore.lectureSections;\n const lectureCalDataFromStore = dataFromStore.lectureCalData;\n navigation.setParams({ course: courseFromStore });\n setCourse(courseFromStore);\n setLectureSections(lectureSectionsFromStore);\n setLectureCalData(lectureCalDataFromStore);\n const fetchResult = await fetchLecturesFromWeb(courseFromStore);\n const newLectureSections = fetchResult.lectureSections;\n const newLectureCalData = fetchResult.lectureCalData;\n const fetchStatus = fetchResult.status;\n\n if (fetchStatus === 'ok') {\n // use new lecture data from server and store locally\n await saveLecturesToStore(\n newLectureSections,\n newLectureCalData\n );\n setLectureSections(newLectureSections);\n setLectureCalData(newLectureCalData);\n } else if (!Array.isArray(newLectureSections)) {\n // no lectures in cache and data fetch unsuccessful\n setStatus(fetchStatus);\n }\n setLoading(false);\n }", "title": "" }, { "docid": "bce046dcb3b094c8f20a5989527a2753", "score": "0.5228546", "text": "async student(courseId, studentId, queryParams) {\n // TODO\n const url = `${this.url}/${courseId}/students/${studentId}`;\n return await doGet(url, queryParams);\n }", "title": "" }, { "docid": "5df36c11b119647697a02c316480a8de", "score": "0.5224911", "text": "loadLabMembers() {\n getLabMembers(this.state.lab_id).then((resp) => {\n\n resp.data.faculty.map((person) => {\n // Render full-name (need to get from either 'name' field or first_name + last_name since inconsistent)\n let fullname = person.data.name || \"\"\n if (fullname == \"\") {\n if (person.data.first_name)\n fullname = person.data.first_name\n if (person.data.last_name)\n fullname += \" \" + person.data.last_name\n }\n\n getFacultyFromUser(person.data.id).then(r => {\n let newState = this.state;\n let link = r.data ? '/prof/' + r.data.id : \"\"\n if ((person.role === 1) || (person.role === 2)) {\n newState.lab_admins.push(<GroupPerson key={person.data.id} link={link} src={person.data.profilepic_path || 'https://catking.in/wp-content/uploads/2017/02/default-profile-1.png'}>{fullname}</GroupPerson>);\n newState.admins_raw.push([fullname, person.data.id]);\n }\n else {\n newState.lab_members.push(<GroupPerson key={person.data.id} link={link} src={person.data.profilepic_path || 'https://catking.in/wp-content/uploads/2017/02/default-profile-1.png'}>{fullname}</GroupPerson>);\n newState.members_raw.push([fullname, person.data.id]);\n }\n newState.admin_access = this.hasPermissions(newState.admins_raw);\n this.setState(newState);\n })\n })\n\n resp.data.students.map((person) => {\n if (person && person.data) {\n let fullname = person.data.name || \"\"\n if (fullname == \"\") {\n if (person.data.first_name)\n fullname = person.data.first_name\n if (person.data.last_name)\n fullname += \" \" + person.data.last_name\n }\n\n getStudentFromUser(person.data.id).then(r => {\n let newState = this.state;\n let link = r.data ? '/student-profile/' + r.data.id : \"\"\n if ((person.role === 1) || (person.role === 2)) {\n newState.lab_admins.push(<GroupPerson key={person.data.user_id} link={link} src={person.data.profilepic_path || 'https://catking.in/wp-content/uploads/2017/02/default-profile-1.png'}>{fullname}</GroupPerson>);\n newState.admins_raw.push([fullname, person.data.id]);\n }\n else {\n newState.lab_members.push(<GroupPerson key={person.data.user_id} link={link} src={person.data.profilepic_path || 'https://catking.in/wp-content/uploads/2017/02/default-profile-1.png'}>{fullname}</GroupPerson>);\n newState.members_raw.push([fullname, person.data.id]);\n }\n newState.admin_access = this.hasPermissions(newState.admins_raw);\n this.setState(newState);\n })\n }\n })\n })\n }", "title": "" }, { "docid": "428760eba219179160d39b5c9b261e26", "score": "0.5224442", "text": "function viewStudentProfile(callback, student) {\n const student_id = new mongoose.Types.ObjectId(student.id);\n StudentProfile.findOne({ student: student_id }, (err, profile) => {\n err ? callback(err, null) : callback(null, profile);\n });\n }", "title": "" }, { "docid": "035cd93b0d7485abffa05efa48aecfac", "score": "0.5222373", "text": "function Student()\n\t{\n\t\tthis.name = '';\n\t\tthis.number = '';\n\t\tthis.records = {};\n\t\tthis.grade = 0;\n\t}", "title": "" }, { "docid": "4b2e59f8f60abf176d536a82772c7e83", "score": "0.5216576", "text": "function loadAccountInfo()\n {\n userService.getAccountInfo({}).success(function (result) {\n vm.accountInfo.userName = result.userName;\n vm.accountInfo.name = result.name;\n vm.accountInfo.surName = result.surName;\n vm.accountInfo.emailAddress = result.emailAddress;\n });\n }", "title": "" }, { "docid": "43b244d6e6258b6bca2fc8082ef4b14c", "score": "0.52127224", "text": "function loadedStudents() {\r\n var feedbacksList = JSON.parse(xhttp.responseText);\r\n callback(feedbacksList);\r\n return feedbacksList;\r\n }", "title": "" }, { "docid": "d02cede31477b9a2a64dc653cb1bf7e3", "score": "0.52125174", "text": "function loadDataFromServices() {\n getStatuses();\n getUsersInProject();\n getTasks(userStoryId);\n}", "title": "" }, { "docid": "300daeb3222a354b6f4f55d423da7146", "score": "0.5199459", "text": "function schoolInfo(results) {\n var features = results;\n // console.log(features);\n\n var dataItem = {};\n $.each(features, function(index, item) {\n dataItem = item;\n });\n // console.log(dataItem);\n\n // school name & district name\n $(\".schoolName\").text(dataItem.sName);\n $(\".schoolID\").text(\" (\" + dataItem.entityID + \")\");\n $(\".districtName\").text(dataItem.dName);\n $(\".districtID\").text(\" (\" + dataItem.dID + \")\");\n\n dom.byId(\"info1\").innerHTML = dataItem.sClass + \" School&nbsp;&nbsp;|&nbsp;&nbsp;\" + dataItem.sType + \"&nbsp;&nbsp;|&nbsp;&nbsp;\" + dataItem.grades;\n dom.byId(\"info2\").innerHTML = dataItem.address + \" \" + dataItem.city + \", AZ \" + dataItem.zip;\n\n scatterChartVM.schoolSelected(dataItem);\n frlScatterChartVM.schoolSelected(dataItem);\n\n getSchoolLocation(dataItem);\n getSchoolScores(dataItem);\n getSchoolBreakDown(dataItem);\n getDistrictBreakDown(dataItem);\n getStateBreakDown();\n getChronicData(dataItem);\n getEnrollmentData(dataItem);\n getTestTrends(dataItem);\n getDistrictData(dataItem);\n getDistrictScores(dataItem);\n\n infoBadgesVM.adeGradeBadge(dataItem);\n infoBadgesVM.scoreBadge(dataItem);\n infoBadgesVM.titleIBadge(dataItem);\n infoBadgesVM.freeReducedBadge(dataItem);\n infoBadgesVM.chronicBadge(dataItem);\n infoBadgesVM.attendanceBadge(dataItem);\n }", "title": "" }, { "docid": "05d39b176b3a20cdbdf57d6a0f4376ee", "score": "0.5197979", "text": "function getStudents() {\n return $http({\n method: 'GET',\n url: Backand.getApiUrl() + '/1/objects/Student',\n params: {\n pageSize: 20,\n pageNumber: 1,\n filter: null,\n sort: ''\n }\n }); //pretty straightforward from the name. Use it to display a list of student entries.\n\n }", "title": "" }, { "docid": "02ad4ce88e728df060e98c626e377c40", "score": "0.51966554", "text": "getStudents() {\n axios.get(`api/student_edit/${this.props.match.params.id}/edit`).then(response =>\n this.setState({\n student: response.data.student,\n name: response.data.student.name,\n dob: response.data.student.dob,\n class: response.data.student.class,\n })\n );\n }", "title": "" }, { "docid": "9d538e029ab45bd991b8d1494986091d", "score": "0.5196625", "text": "function loadStudentInfo(element)//Find Code ---------- TM1007\r\n{\r\n\r\n teamN = element.value;\r\n\r\n if (teamN==\"\")//If no team is currently selected\r\n {\r\n document.getElementById(\"MTeamTitle\").innerHTML=\"<p>Please select a team name.</p>\";\r\n return;\r\n }\r\n else\r\n {\r\n document.getElementById(\"MTeamTitle\").innerHTML=\"Team \"+teamN;//Places the team name below the Team Information heading in Team Management\r\n }\r\n\r\n var getVars = \"q=\"+teamN;\r\n \r\n $.ajax({url: \"ManageContent/getStudentInfo.php\", data: getVars, success:function(result){\r\n if(result.length != 0)\r\n {\r\n var t = JSON.parse(result);\r\n var temp = t.length / 4;\r\n var i;\r\n for(i = 0; i < temp; i++)\r\n { \r\n document.getElementById('Name_S' + (i + 1)).value=t[i * 4];\r\n document.getElementById('Username_S' + (i + 1)).value=t[i * 4 + 1];\r\n document.getElementById('School_S' + (i + 1)).value=t[i * 4 + 2];\r\n document.getElementById('State_S' + (i + 1)).value=t[i * 4 + 3];\r\n }\r\n }\r\n }});\r\n}", "title": "" }, { "docid": "7f134d7c4974254384b975b44d36fd41", "score": "0.5192831", "text": "function getUerDetails() {\n\t $.ajax({\n\t type : 'GET',\n\t url: '/nameRecordingService/svc/student/userDetail',\n\t cache: false,\n\t success : function(data) {\n\t \t// console.log(data);\n\t \tUSER = data; // global\t\n\n \t\t$('p.student').html(data.firstName+' '+data.lastName+',');\n \t\t$('span.recDateTime').html(data.recordingLastModifiedDate);\n \t\t$('audio source').attr('src', data.nameRecordingUrl+'?'+(new Date).getTime())[0];\n \t\t$('audio').load();\n \t\t$('#classcards-link').attr('href', '/classcards/detail.do?prsnId='+data.personId)\n\n\t \tif(data.recordingAvailable && data.recordingAvailable == true) {\n\t \t\t$('.completed').show();\n\t \t} else {\n\t \t\t$('.incomplete').show()\n\t \t\tchooseRecordingMethod();\n\t \t} \n\n\t \t$('#rec-again').on('click', function(e){\n\t \t\te.preventDefault();\n\t \t\t$('.completed').hide();\n\t \t\tchooseRecordingMethod();\n\t \t}); \n\n\t },\n\t error: function(jqXHR, textStatus, errorThrown) {\n\n if(textStatus === 'parsererror'){\n \n var redrectUrl = '/nameRecordingService/svc/report/list';\n\n swal({\n title: \"Authentication Error\",\n html: \"You're not logged in or your session has expired.<br>Redirecting to the login page in 3 seconds...\",\n type: \"error\",\n timer: 3000,\n }).then(function() {\n // handles OK\n window.location = redrectUrl;\n }).catch(function(){\n // handles timer promise\n window.location = redrectUrl;\n });\n \n }\n\n\t }\n\t });\n\t}", "title": "" }, { "docid": "f9e58c918673143918fd752330d95f63", "score": "0.5191451", "text": "function show_students_who_are_doing_well_on_their_homework(){\n\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX BEGIN show_students_who_are_doing_well_on_their_homework XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n\n // POPULATE DATA to RESULTS TABLE\n var selected_course_id = checkLocalStorage('current_course');\n // Set Markup and Endpoint elements\n var studentList = $('#student-list');\n var widget_quiz_reports = $('#widget-quiz-reports');\n var widget_quiz_reports_performance = $('#widget-quiz-reports-performance');\n studentList.hide();\n widget_quiz_reports.hide();\n widget_quiz_reports_performance.hide();\n $('#loading_gif').show();\n\n console.log('LOCAL STORAGE current_course ' +selected_course_id);\n \n // ajax URLs\n url_course_quiz = 'http://comstor.lumiousanalytics.com/api/lumiousreports/quiz/' +selected_course_id;\n url_course_students = 'http://comstor.lumiousanalytics.com/api/lumiousreports/students/'+selected_course_id;\n url_quiz_attempts = 'http://comstor.lumiousanalytics.com/api/lumiousreports/quizattempts/'+selected_course_id;\n url_student_data = 'http://comstor.lumiousanalytics.com/api/lumiousreports/studentdata/';\n\n // store results from these static URLs as objects to use with promises\n var students = $.getJSON(url_course_students);\n var quizzes = $.getJSON(url_course_quiz);\n var attempts = $.getJSON(url_quiz_attempts);\n\n // declare variables for quiz object\n var quiz_id = null;\n var quiz_course = null;\n var quiz_name = null;\n var quiz_sumgrades = null;\n var quiz_grade = null;\n\n // declare variables for attempt object\n var attempt_quiz = null;\n var attempt_id = null;\n var attempt_user = null;\n var attempt_state = null;\n var attempt_sumgrades = null;\n var attempt_attempt = null;\n var attempt_percentage = null;\n\n // declare variables for student object\n var student_id = null;\n var student_firstname = null;\n var student_lastname = null;\n var student_email = null;\n var student_username = null;\n var student_firstaccess = null;\n var student_lastaccess = null;\n\n\n // wait for all three ajax requests to complete before we proceed\n $.when(students, quizzes, attempts).done(function(studentobject, quizobject, attemptobject) {\n\n // dig down to the responseText object\n var s = $.parseJSON(studentobject[2].responseText);\n var q = $.parseJSON(quizobject[2].responseText);\n var a = $.parseJSON(attemptobject[2].responseText);\n\n console.info(\"Student and Quiz Data for Course \" + selected_course_id);\n console.info(s, q, a);\n\n // reset the Results table\n dna.empty('results-body-performance', { fade: true });\n\n // loop through the quizzes object\n jQuery.each(q, function(i, qdata) {\n \n quiz_id = qdata.id;\n quiz_course = qdata.course;\n quiz_name = qdata.name;\n quiz_sumgrades = qdata.sumgrades;\n quiz_grade = qdata.grade;\n\n // var isprework = quiz_name.indexOf('(pre-work)');\n var ishomework = quiz_name.indexOf('(homework)');\n\n // console.log(\"Prework quiz? \" + isprework);\n console.log(\"Home quiz? \" + ishomework);\n\n // only continue if this is a prework quiz\n // if(isprework > -1){\n if(ishomework > -1){\n console.log(\"Looking for Quiz Attempts for Quiz #\" + quiz_id + \" (\" + quiz_name + \")\");\n\n // for each quiz, loop through the attempts to check if there are attempts for the current quiz\n jQuery.each(a, function(x, adata) {\n\n //console.log(\"Checking Attempt Data: \");\n //console.log(adata);\n\n attempt_quiz = adata.quiz;\n attempt_id = adata.id;\n attempt_user = adata.userid;\n attempt_state = adata.state;\n attempt_sumgrades = adata.sumgrades;\n attempt_attempt = adata.attempt;\n attempt_percentage = (attempt_sumgrades/quiz_sumgrades)*100;\n\n // if the current attempt matches the current quiz\n if(attempt_quiz === quiz_id && attempt_percentage >= 80 ){\n // if(attempt_quiz === quiz_id && attempt_percentage > 0){ // show users for which we have a result\n\n console.log(\"Attempt found for student user id \" + attempt_user + \" on quiz \" + quiz_id);\n var searchresult = findStudentByID(s,attempt_user);\n\n // find the student data in the preloaded data object\n if(searchresult){\n\n \n student_id = searchresult[0].id;\n student_firstname = searchresult[0].firstname;\n student_lastname = searchresult[0].lastname;\n student_email = searchresult[0].email;\n student_username = searchresult[0].username;\n student_firstaccess = searchresult[0].firstaccess;\n student_lastaccess = searchresult[0].lastaccess;\n\n console.log(\"Student Found for userid \" + attempt_user + \" with name of \" + student_firstname);\n console.log(\"============================= QUIZ ATTEMPT FOUND FOR QUIZ \"+quiz_id+\" ===============================\");\n console.log(\"Student Name: \" + student_firstname + \" \" + student_lastname);\n console.log(\"Quiz ID: \"+attempt_quiz);\n console.log(\"Attempt ID: \"+attempt_id);\n console.log(\"User ID: \"+attempt_user);\n console.log(\"Attempt: \"+attempt_attempt);\n console.log(\"State: \"+attempt_state);\n console.log(\"Quiz Sumgrades: \"+quiz_sumgrades);\n console.log(\"Student Sumgrades: \"+attempt_sumgrades);\n console.log(\"Actual Grade: \"+attempt_percentage+\"%\");\n console.log(\"================================ END QUIZ ATTEMPT ============================\");\n\n var firstaccess_dateVal = student_firstaccess;\n if (firstaccess_dateVal == 0) {\n var firstaccess_formatted_date = 'Never';\n }else{\n var firstaccess_formatted_date = moment.unix(firstaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n \n var lastaccess_dateVal = student_lastaccess;\n if (lastaccess_dateVal == 0) {\n var lastaccess_formatted_date = 'Never';\n }else{\n var lastaccess_formatted_date = moment.unix(lastaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n \n \n adata['ID'] = student_id;\n adata['FIRSTNAME'] = student_firstname;\n adata['LASTNAME'] = student_lastname;\n adata['EMAIL'] = student_email;\n adata['USERNAME'] = student_username;\n adata['FIRSTACCESS'] = student_firstaccess;\n adata['FIRSTACCESSFORMATTEDDATE'] = firstaccess_formatted_date;\n adata['LASTACCESS'] = student_lastaccess;\n adata['LASTACCESSFORMATTEDDATE'] = lastaccess_formatted_date;\n \n adata['QID'] = attempt_quiz;\n adata['QATTEMPT'] = attempt_attempt;\n \n attempt_percentage = Math.round(attempt_percentage);\n // Add appropriate labels to Stress levels\n if (attempt_percentage < 60) {attempt_percentage = '<span class=\"student-stress danger label\">'+attempt_percentage+'</span>';};\n if (attempt_percentage < 75) {attempt_percentage = '<span class=\"student-stress warning label\">'+attempt_percentage+'</span>';};\n if (attempt_percentage >= 75) {attempt_percentage = '<span class=\"student-stress success label\">'+attempt_percentage+'</span>';};\n \n adata['QPERCENTAGE'] = attempt_percentage;\n \n // Bind data to table template\n dna.clone('results-body-performance', adata, {html: true, fade: true});\n }\n }\n });\n }\n });\n // Update table so sorting works after ajax call\n $(\"#sortable\").trigger(\"update\"); \n $('#loading_gif').hide();\n studentList.show();\n widget_quiz_reports_performance.show();\n });\n\n //widget_quiz_reports.show();\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX END show_students_who_are_doing_well_on_their_homework XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n}", "title": "" }, { "docid": "fed1e100ef4b9f3aa1d2e0c366e7c617", "score": "0.51879215", "text": "function getSyllabiList ( student_id, username ) {\n // Create request to the families website\n $.get(\n 'https://families.motherofdivinegrace.org/students/' + student_id + \"/syllabi\",\n '',\n function (data){\n // If successfull, send the data to the list creator\n createSyllabiList( data, username, student_id );\n }\n ); \n}", "title": "" }, { "docid": "7beb4027e0eec6f30fa83d569760f562", "score": "0.5183998", "text": "get_students(course_id) {\n get_students_by_id(course_id).then(response => { this.setState({ courses: response.data, dataShown: 'student_list' }) });\n }", "title": "" }, { "docid": "87910b9fc7b57c8757d05e76791e0ddf", "score": "0.51825786", "text": "async function read(req, res) {\n res.status(200).json({ data: res.locals.student });\n}", "title": "" }, { "docid": "bf60224582ce5204cb5035fc25f5af01", "score": "0.5182069", "text": "getAllStudents() {\n return axios.get(BASE_URL);\n }", "title": "" }, { "docid": "169a77e8b58d99c61c51a909ba7f217e", "score": "0.5172238", "text": "function displayStudent(obj) {\n\treturn obj.name + \" \" + obj.DoB + \" \" + obj.gender + \" \" + obj.age ; \n}", "title": "" }, { "docid": "6225c3c819023014b244131729a15ee3", "score": "0.5169756", "text": "function getTeacherStudents(){\n students.getStudents().then(function(results) {\n console.log(\"Teacher students\");\n console.log(results);\n $scope.teacherStudents = results;\n }, function(error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "6225c3c819023014b244131729a15ee3", "score": "0.5169756", "text": "function getTeacherStudents(){\n students.getStudents().then(function(results) {\n console.log(\"Teacher students\");\n console.log(results);\n $scope.teacherStudents = results;\n }, function(error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "7d329a36920e3f0fbe1dfb66ec14af57", "score": "0.51665676", "text": "function getStudentsFromDb(){\n arrayOfData = [];\n //==>call data\n $.get(\"/api/app/allthestudents\", function(data){\n console.log(data);\n $(\"#evalTable\").empty();\n pickGroupMembers(data);\n });\n }", "title": "" }, { "docid": "c6618fca0f2071ddac5b7b82fc732bde", "score": "0.516626", "text": "function loadScholarHeader(){\n\tloadTemplate(\"scholarheader\", templates.scholarheader, {\n scholarName : scholar.personalData.name,\n schoolGrade : scholar.statusQualifications.schoolGrade,\n program : scholar.scholarship.programName,\n actLevel : scholar.statusQualifications.schoolLevels[scholar.statusQualifications.schoolLevels.length-1].scholarLevel\n });\n}", "title": "" }, { "docid": "5cfb5339f8d902599103a984e2f29fc2", "score": "0.5159593", "text": "function Student(d) {\n //sets all student variables to unknown.\n this.school = d.school;\n this.sex = d.sex;\n this.age = d.age;\n this.address = d.address;\n this.famsize = d.famsize;\n this.Pstatus = d.Pstatus;\n this.Medu = +d.Medu;\n this.Fedu = +d.Fedu;\n this.Mjob = d.Mjob;\n this.Fjob = d.Fjob;\n this.reason = d.reason;\n this.guardian = d.guardian;\n this.traveltime = +d.traveltime;\n this.studytime = +d.studytime;\n this.failure = +d.failure;\n this.schoolsup = yesNo(d.schoolsup);\n this.famsup = yesNo(d.famsup);\n this.paid = yesNo(d.paid);\n this.activities = yesNo(d.activities);\n this.nursery = yesNo(d.activities);\n this.higher = yesNo(d.higher);\n this.internet = yesNo(d.internet);\n this.romantic = yesNo(d.romantic);\n this.famrel = +d.famrel;\n this.freetime = +d.freetime;\n this.goout = +d.goout;\n this.Dalc = +d.Dalc;\n this.Walc = +d.Walc;\n this.health = +d.health;\n this.absences = +d.absences;\n this.G1 = +d.G1;\n this.G2 = +d.G2;\n this.G3 = +d.G3;\n}", "title": "" }, { "docid": "520a6d46dfa1afe5faafdea96a474922", "score": "0.5158273", "text": "function show_students_who_are_not_doing_well_on_their_homework(){\n\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX BEGIN show_students_who_are_not_doing_well_on_their_homework XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n\n // POPULATE DATA to RESULTS TABLE\n var selected_course_id = checkLocalStorage('current_course');\n // Set Markup and Endpoint elements\n var studentList = $('#student-list');\n var widget_quiz_reports = $('#widget-quiz-reports');\n var widget_quiz_reports_performance = $('#widget-quiz-reports-performance');\n studentList.hide();\n widget_quiz_reports.hide();\n widget_quiz_reports_performance.hide();\n $('#loading_gif').show();\n\n console.log('LOCAL STORAGE current_course ' +selected_course_id);\n \n // ajax URLs\n url_course_quiz = 'http://comstor.lumiousanalytics.com/api/lumiousreports/quiz/' +selected_course_id;\n url_course_students = 'http://comstor.lumiousanalytics.com/api/lumiousreports/students/'+selected_course_id;\n url_quiz_attempts = 'http://comstor.lumiousanalytics.com/api/lumiousreports/quizattempts/'+selected_course_id;\n url_student_data = 'http://comstor.lumiousanalytics.com/api/lumiousreports/studentdata/';\n\n // store results from these static URLs as objects to use with promises\n var students = $.getJSON(url_course_students);\n var quizzes = $.getJSON(url_course_quiz);\n var attempts = $.getJSON(url_quiz_attempts);\n\n // declare variables for quiz object\n var quiz_id = null;\n var quiz_course = null;\n var quiz_name = null;\n var quiz_sumgrades = null;\n var quiz_grade = null;\n\n // declare variables for attempt object\n var attempt_quiz = null;\n var attempt_id = null;\n var attempt_user = null;\n var attempt_state = null;\n var attempt_sumgrades = null;\n var attempt_attempt = null;\n var attempt_percentage = null;\n\n // declare variables for student object\n var student_id = null;\n var student_firstname = null;\n var student_lastname = null;\n var student_email = null;\n var student_username = null;\n var student_firstaccess = null;\n var student_lastaccess = null;\n\n\n // wait for all three ajax requests to complete before we proceed\n $.when(students, quizzes, attempts).done(function(studentobject, quizobject, attemptobject) {\n\n // dig down to the responseText object\n var s = $.parseJSON(studentobject[2].responseText);\n var q = $.parseJSON(quizobject[2].responseText);\n var a = $.parseJSON(attemptobject[2].responseText);\n\n console.info(\"Student and Quiz Data for Course \" + selected_course_id);\n console.info(s, q, a);\n\n // reset the Results table\n dna.empty('results-body-performance', { fade: true });\n\n // loop through the quizzes object\n jQuery.each(q, function(i, qdata) {\n \n quiz_id = qdata.id;\n quiz_course = qdata.course;\n quiz_name = qdata.name;\n quiz_sumgrades = qdata.sumgrades;\n quiz_grade = qdata.grade;\n\n // var isprework = quiz_name.indexOf('(pre-work)');\n var ishomework = quiz_name.indexOf('(homework)');\n\n // console.log(\"Prework quiz? \" + isprework);\n console.log(\"Home quiz? \" + ishomework);\n\n // only continue if this is a prework quiz\n // if(isprework > -1){\n if(ishomework > -1){\n console.log(\"Looking for Quiz Attempts for Quiz #\" + quiz_id + \" (\" + quiz_name + \")\");\n\n // for each quiz, loop through the attempts to check if there are attempts for the current quiz\n jQuery.each(a, function(x, adata) {\n\n //console.log(\"Checking Attempt Data: \");\n //console.log(adata);\n\n attempt_quiz = adata.quiz;\n attempt_id = adata.id;\n attempt_user = adata.userid;\n attempt_state = adata.state;\n attempt_sumgrades = adata.sumgrades;\n attempt_attempt = adata.attempt;\n attempt_percentage = (attempt_sumgrades/quiz_sumgrades)*100;\n\n // if the current attempt matches the current quiz\n if(attempt_quiz === quiz_id && attempt_percentage < 60){\n // if(attempt_quiz === quiz_id && attempt_percentage > 0){ // show users for which we have a result\n\n console.log(\"Attempt found for student user id \" + attempt_user + \" on quiz \" + quiz_id);\n var searchresult = findStudentByID(s,attempt_user);\n\n // find the student data in the preloaded data object\n if(searchresult){\n\n \n student_id = searchresult[0].id;\n student_firstname = searchresult[0].firstname;\n student_lastname = searchresult[0].lastname;\n student_email = searchresult[0].email;\n student_username = searchresult[0].username;\n student_firstaccess = searchresult[0].firstaccess;\n student_lastaccess = searchresult[0].lastaccess;\n\n console.log(\"Student Found for userid \" + attempt_user + \" with name of \" + student_firstname);\n console.log(\"============================= QUIZ ATTEMPT FOUND FOR QUIZ \"+quiz_id+\" ===============================\");\n console.log(\"Student Name: \" + student_firstname + \" \" + student_lastname);\n console.log(\"Quiz ID: \"+attempt_quiz);\n console.log(\"Attempt ID: \"+attempt_id);\n console.log(\"User ID: \"+attempt_user);\n console.log(\"Attempt: \"+attempt_attempt);\n console.log(\"State: \"+attempt_state);\n console.log(\"Quiz Sumgrades: \"+quiz_sumgrades);\n console.log(\"Student Sumgrades: \"+attempt_sumgrades);\n console.log(\"Actual Grade: \"+attempt_percentage+\"%\");\n console.log(\"================================ END QUIZ ATTEMPT ============================\");\n\n var firstaccess_dateVal = student_firstaccess;\n if (firstaccess_dateVal == 0) {\n var firstaccess_formatted_date = 'Never';\n }else{\n var firstaccess_formatted_date = moment.unix(firstaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n \n var lastaccess_dateVal = student_lastaccess;\n if (lastaccess_dateVal == 0) {\n var lastaccess_formatted_date = 'Never';\n }else{\n var lastaccess_formatted_date = moment.unix(lastaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n \n \n adata['ID'] = student_id;\n adata['FIRSTNAME'] = student_firstname;\n adata['LASTNAME'] = student_lastname;\n adata['EMAIL'] = student_email;\n adata['USERNAME'] = student_username;\n adata['FIRSTACCESS'] = student_firstaccess;\n adata['FIRSTACCESSFORMATTEDDATE'] = firstaccess_formatted_date;\n adata['LASTACCESS'] = student_lastaccess;\n adata['LASTACCESSFORMATTEDDATE'] = lastaccess_formatted_date;\n \n adata['QID'] = attempt_quiz;\n adata['QATTEMPT'] = attempt_attempt;\n \n attempt_percentage = Math.round(attempt_percentage);\n // Add appropriate labels to Stress levels\n if (attempt_percentage < 60) {attempt_percentage = '<span class=\"student-stress danger label\">'+attempt_percentage+'</span>';};\n if (attempt_percentage < 75) {attempt_percentage = '<span class=\"student-stress warning label\">'+attempt_percentage+'</span>';};\n if (attempt_percentage >= 75) {attempt_percentage = '<span class=\"student-stress success label\">'+attempt_percentage+'</span>';};\n \n adata['QPERCENTAGE'] = attempt_percentage;\n \n // Bind data to table template\n dna.clone('results-body-performance', adata, {html: true, fade: true});\n }\n }\n });\n }\n });\n // Update table so sorting works after ajax call\n $(\"#sortable\").trigger(\"update\"); \n $('#loading_gif').hide();\n studentList.show();\n widget_quiz_reports_performance.show();\n\n });\n\n //widget_quiz_reports.show();\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX END show_students_who_are_not_doing_well_on_their_homework XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n}", "title": "" }, { "docid": "f412078eff8506f233673d77c43dce61", "score": "0.5157304", "text": "async function getStudent(req, res, next) {\n let student;\n try {\n student = await Student.findById(req.params.id);\n if (student == null) {\n return res.status(404).json({ message: \"Cannot find student.\" });\n }\n } catch (err) {\n return res.status(500).json({ message: err.message });\n }\n\n res.student = student;\n next();\n}", "title": "" }, { "docid": "e6489f646bdde411f1d212ddf0413aaf", "score": "0.5157081", "text": "function bookDetail() {\n \n var bookTitle = this.id;\n \n $(\"singlebook\").classList.remove(\"hidden\");\n $(\"allbooks\").classList.add(\"hidden\");\n $(\"cover\").src = \"books/\" + bookTitle + \"/cover.jpg\";\n \n var requestDescr = new AjaxGetPromise(\"bestreads.php?mode=description\" + \"&title=\" + bookTitle);\n requestDescr\n .then(showDescr);\n \n var requestInfo = new AjaxGetPromise(\"bestreads.php?mode=info\" + \"&title=\" + bookTitle);\n requestInfo \n .then(JSON.parse)\n .then(showInfo);\n \n var requestReviews = new AjaxGetPromise(\"bestreads.php?mode=reviews\" + \"&title=\" + bookTitle);\n requestReviews\n .then(JSON.parse)\n .then(showReviews);\n }", "title": "" }, { "docid": "17e48f411c7a7b4fb5dedeae5567fb60", "score": "0.5139801", "text": "function DisplayStudent(doc){\r\n\t//Retrieve a record of student in the database and display in 'Student List'\r\n\t//Retrieve the holder of the list which is a element('ul') that has class name of 'list-of'\r\n\t//element can be found at list-Container -> list-content -> student-list -> records\r\n\tvar studentList = document.querySelector('.profile_record_list');\r\n\t\r\n\t//Create the needed element to append to list.\r\n\tlet li = document.createElement('li');\r\n\tlet img = document.createElement('img');\r\n\tlet name = document.createElement('h4');\r\n\tlet lrndata = document.createElement('span');\r\n\tlet mygradesData = document.createElement('span');\r\n\tlet edit = document.createElement('i');\r\n\r\n\t//Set the Appropriate Attributes for the element needed in the list\r\n\t//Some of the Attributes are unique, like Profile picture of the student, name of the student, Lrn and doc.id\r\n\t//doc.id is a Unique ID (' Primary key ') in the database that holds the data of the student \r\n\tli.setAttribute('data-id',doc.id);\r\n\timg.setAttribute('src',doc.data().MyPicture);\r\n\tname.textContent = doc.data().First + ' ' + doc.data().Middle + ' ' + doc.data().Last;\r\n\tlrndata.textContent = 'LRN : ' + doc.data().LRN;\r\n\tlrndata.setAttribute('id','span-lrn');\r\n\tmygradesData.textContent = 'My grades';\r\n\tmygradesData.setAttribute('id','span-grades')\r\n\tedit.setAttribute('class','fas fa-edit');\r\n\r\n\t//Append elements to list('li')\r\n\t//the ('li') has a horizontal display , append an element starting from left to right\r\n\t//the img or Profile picture of the student is in the left side of the list that's why the img is the first element to append to list('li')\r\n\tli.appendChild(img);\r\n\tli.appendChild(name);\r\n\tli.appendChild(lrndata);\r\n\tli.appendChild(mygradesData);\r\n\tli.appendChild(edit); \r\n\r\n\t//finnally append the list('li') to its holder('ul')\r\n\t//the design of the list has already been created, only the creation of the elements are needed\r\n\tstudentList.appendChild(li);\r\n\r\n\tedit.addEventListener('click', (e) => {\r\n\t\te.stopPropagation();\r\n\t\tlet id = e.target.parentElement.getAttribute('data-id');\r\n\t\tviewProfile(id);\r\n\t});\r\n\r\n\tmygradesData.addEventListener('click',(e) =>{\r\n\t\te.preventDefault();\r\n\t\talert('This feature is under progress');\r\n\t\t// $('.list-Container')[0].style.display = 'none';\r\n\t\t// $('.Overlay')[0].style.display = 'block';\r\n\t\t// $('.myGrades')[0].style.display = 'block';\r\n\t});\r\n}", "title": "" }, { "docid": "a184aa1a1bfd47e2285cc7b8d9ffd5be", "score": "0.5137005", "text": "loadStudentChart(){\n // let url = document.pageData.report.count_student_all_url;\n\n let url = document.pageData.report.count_card_user_all_url + '/' + \n document.pageData.report.group_students + '/' +\n document.pageData.report.cardtype_students;\n\n axios.get(url)\n .then(res => {\n let labels = res.data.labels;\n let series = res.data.series;\n\n let result = {\n labels: labels,\n series: series\n };\n this.chartData = result;\n this.loadDataStudent();\n })\n .catch(err => {\n MessageHelper.error(err.message);\n });\n }", "title": "" }, { "docid": "eb44db0dc80c5c3e70bec064b99fd075", "score": "0.51342577", "text": "function findById(_id){\n\treturn new Promise((resolve,reject)=>{\n\t\tStudent.findOne({'_id': _id },'name email mobile profilePic gender address profileUrls academicDetails',(err,data)=>{\n\t\t\tif(err){\n\t\t\t\tlogger.error(err.message)\n\t\t\t\treject({ msg:loggerConstants.INTERNAL_ERROR});\n\t\t\t}else if(!data){\n\t\t\t\treject({ success:false, msg: loggerConstants.WE_COULD_NOT_FOUND_AN_ACCOUNT_ASSOCIATED_WITH + _id})\n\t\t\t}else{\n\t\t\t\tresolve({success:true, msg:loggerConstants.DATA_GET_SUCCESSFULLY, data: data})\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" } ]
8446170252303602af7840a6bdeede0c
Lifecycle method to retrieve the names of all the rooms
[ { "docid": "46276fbb4cdd01f223888ab279fa57b2", "score": "0.0", "text": "componentDidMount() {\n axios.get('http://localhost:8080/api/rooms')\n .then(res => {\n const rooms = res.data.map(room => room);\n this.setState({ rooms });\n });\n }", "title": "" } ]
[ { "docid": "b118f418fcca0398fb30737896dd376a", "score": "0.8188753", "text": "all_room_names() {\n \treturn Rooms.find();\n }", "title": "" }, { "docid": "79d57a3b83c64f5e9d4d336e34c55ae7", "score": "0.7659654", "text": "Rooms () {\n return getRoomsByQuery( {} );\n }", "title": "" }, { "docid": "9d87426785e432fcc3c2ceb1564f285d", "score": "0.7500724", "text": "listRooms(){\n\t\tthis.roomsToShow = this.connection.listRooms()\n\t}", "title": "" }, { "docid": "5dd0e9879e51cee63df677ea25484e97", "score": "0.72338337", "text": "rooms() { return [] }", "title": "" }, { "docid": "0923545839a51d0034e140c125b40bf0", "score": "0.7029198", "text": "function listRooms() {\n debug(`requesting room list`);\n return new Promise(function(resolve, reject) {\n redisClient.smembers(ROOMKEY, function(err, data) {\n if (err) reject(err);\n debug('returning room list');\n resolve(data);\n });\n });\n}", "title": "" }, { "docid": "991c80d978728ff60928323927b8139b", "score": "0.68783146", "text": "function gettingRooms() {\n var room = Room.resource.query();\n\n room.$promise.then(function (data) {\n //Room.setRoom(data);\n\n return data;\n });\n\n return room;\n //$http\n // .get('/api/rooms')\n // .then(function (results) {\n // var msg = '', data = results.data;\n //\n // if (results.status === 200) {\n // msg = 'Rooms received successfully!';\n // logger.success(msg);\n // return data;\n // } else {\n // msg = 'Rooms getting failed. ' + data.message;\n // logger.error(msg);\n // }\n //\n // return data;\n // }).catch(function (reason) {\n // var msg = 'Rooms getting failed. ' + reason.data.description;\n // logger.error(msg);\n //\n // return reason;\n // });\n }", "title": "" }, { "docid": "409b73276dc513c1546b404920139f2f", "score": "0.6866944", "text": "static getAllRooms() {\n var roomIdArray = [];\n CARDOBJECTS.Rooms.forEach((element) => {\n roomIdArray.push(element.Id);\n });\n return roomIdArray;\n }", "title": "" }, { "docid": "0ee32d63552dba7ef6d591ab03c3789b", "score": "0.684401", "text": "function loadRooms() {\n $scope.rooms = FS20.rooms.query(); \n }", "title": "" }, { "docid": "0ff3ec77a2f0f907026ef1078311eda4", "score": "0.6843962", "text": "function getAllRoomMembers(room){\n var theRoom = io.sockets.adapter.rooms[room];\n return theRoom;\n}", "title": "" }, { "docid": "ef938c7b8c30d9c1d6a2afc7d5bd49d2", "score": "0.6835393", "text": "fetchRoomList(){\n this.send(ROOM_LIST);\n }", "title": "" }, { "docid": "9487610bc1eb8091bc0022107f2ad8ef", "score": "0.6654075", "text": "get roomName(){\n return this._room ? this._room.name : null;\n }", "title": "" }, { "docid": "7b287d0922544761d9be91229c0fe47e", "score": "0.66436887", "text": "function getRoomNames(roomID, callback){\n\t\tconsole.log(\"Finding roomid: \" + roomID);\n\t\tmongoFind(\"roomid\", \"roomID\", roomID.toString(), null, function(result, extra){\n\t\t\t//console.log(result.room_name);\n\t\t\tcallback(result);\n\t\t});\n\t\t\n\t\t/* conn.query('SELECT room_name FROM roomid WHERE roomID = ?', [roomID], function(err, result){\n\t\t\tif (err) throw err;\n\t\t\telse if (result.length > 0){\n\t\t\t\tcallback(result[0].room_name);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcallback(\"\");\n\t\t\t}\n\t\t}); */\n\t}", "title": "" }, { "docid": "399276fd58781b7d31723b0fe2b850cb", "score": "0.66010267", "text": "getRoom() {\n return [this.room_id, this.room_code, this.room_leader, this.is_room_leader];\n }", "title": "" }, { "docid": "81cd07c6fa83ff75e8b0a6c40030b086", "score": "0.65200627", "text": "async function getRoomList(){\n\tconsole.log(\"calling get room list in functions\")\n\treturn new Promise(function(fulfill, reject){\n\t\tvar output = {};\n\t\toutput.name = \"RoomList\";\n\t\toutput.values = [];\n\t\tvar sql = \"SELECT roomName FROM room\";\n\n\t\tcon.query(sql, async function (err, result, fields) {\n\t\t\tif (err) throw err;\n\t\t\tresult.forEach(element=>{\n\t\t\t\tvar field = {};\n\t\t\t\tfield.roomName = element.roomName;\n\t\t\t\toutput.values.push(field);\n\t\t\t})\n\t\t\tvar json = JSON.stringify(output, null, 2);\n\t\t\tfulfill(json);\n\t\t});\n\t})\n}", "title": "" }, { "docid": "776f1a05ab8a68101123567e69d083bf", "score": "0.6500839", "text": "function getRooms(roomEl, prefix) {\n\t\tprefix = prefix || '#room/';\n\t\troomEl = roomEl || roomList;\n\t\t$.ajax({\n\t\t\ttype: \"GET\",\n\t\t\turl: 'room/list'\n\t\t}).done(function( msg ) {\n\t\t\tmsg.forEach(function(room){\n\t\t\t\troomEl.append('<li><a href=\"'+prefix+room.id+'\" data-id=\"'+room.id+'\"><i class=\"icon-align-justify\"></i> '+room.name+'</a></li>');\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "5deeffe05b27327c997cd94436b982b0", "score": "0.64723027", "text": "function fetchRooms(){\r\n firebase.database().ref('Rooms/').once('value').then(function(snapshot) {\r\n rooms = Object.keys(snapshot.val());\r\n });\r\n }", "title": "" }, { "docid": "26c584a9aafb22440471c20e0ac51749", "score": "0.64494133", "text": "function getRooms(callback) {\n Room.find({}, function (error, rooms) {\n return callback(error, rooms);\n });\n}", "title": "" }, { "docid": "4e590757beb77021456055d032bc5e23", "score": "0.6440192", "text": "function listRooms(callback) {\n const LIST_PATH = \"/list\";\n \n ajaxGet(LIST_PATH, callback);\n}", "title": "" }, { "docid": "6f1559e3567cdcda465d1f7357e86e11", "score": "0.6425524", "text": "function get_all_users(room_name) {\n return users.filter(user => user.room === room_name);\n}", "title": "" }, { "docid": "de97fe52a4c7746ab3785ba60cb229ac", "score": "0.64141923", "text": "function getUserRooms(socket){\r\n //Convert rooms to iterable key values.\r\n return Object.entries(rooms).reduce((names, [name, room]) => {\r\n if(room.users[socket.id] != null)\r\n names.push(name);\r\n return names; //To use in the next iteration.\r\n }, []); //Default to empty array.\r\n}", "title": "" }, { "docid": "436f41d2eb02e81e189677c258e7920f", "score": "0.6332307", "text": "get numberOfRooms() {\n return this.roomList.length;\n }", "title": "" }, { "docid": "42bff6a09f0fd6f37bf0e9fe2caefabf", "score": "0.6299487", "text": "function updateRooms() {\n io.sockets.emit(\"get rooms\", rooms);\n}", "title": "" }, { "docid": "b23cfa9a9a4c1d9871f1df1037bc2b75", "score": "0.6296771", "text": "function getUserRooms(socket) {\n return Object.entries(rooms).reduce((names, [name, room]) => {\n if (room.users[socket.id] != null) names.push(name)\n return names\n }, [])\n}", "title": "" }, { "docid": "2837a8da68b292672efd2206d5c8ca35", "score": "0.6277887", "text": "buildRoomList(){\n\t\tvar rooms = []\n\t\tfor (var i = 0;i<this.structuredLevel.length;i++){\n\t\t\tvar level = this.structuredLevel[i];\n\t\t\tfor (var j = 0;j<level.structure.areas.length;j++){\n\t\t\t\tvar area = level.structure.areas[j];\n\t\t\trooms.push({\"id\" : area.id, \"geometry\" : area.geometry,\"properties\" : area.properties, \"tags\" : area.tags, \"hasdoor\" : this.checkForDoor(area), \"outsidereachable\" : this.isReachableRoom(area.id,level.level), \"level\": level.level});\n\t\t\t}\n\t\t}\n\t\tthis.roomlist = rooms;\n\t}", "title": "" }, { "docid": "f2c0cb03cb4d3166de0098bd8923ec05", "score": "0.6276854", "text": "async function listRoomId() {\n var roomIds = [];\n await axios.post(janusHost + '/' + sessionId + '/' + handlerId, {\n janus: \"message\",\n transaction: \"list room Ids\",\n apisecret: \"janusrocks\",\n body: {\n request: \"list\"\n }\n }).then(res => {\n roomList = res.data.plugindata.data.list\n for (var i in roomList) {\n roomIds.push(roomList[i].room)\n }\n })\n return roomIds;\n}", "title": "" }, { "docid": "38ffb4a172989524e98810fb13a45393", "score": "0.62634546", "text": "get room() {}", "title": "" }, { "docid": "27203986fe60a66cd09d3a43f81b7b47", "score": "0.6259597", "text": "getAllRooms (socket, rooms) {\n socket.on('getAllRooms', () => {\n individualEmit.sendAllRooms(socket, rooms)\n })\n }", "title": "" }, { "docid": "85452525e2637dad88b653d851123d34", "score": "0.62471944", "text": "function Room(name) {\n this.name = name;\n this.clients = [];\n this.objects = [];\n this.props = new Map();\n}", "title": "" }, { "docid": "7b746da7889e44d6a8be6e2af85f6de1", "score": "0.62470967", "text": "function getRoomNames(userID, roomID, callback){\r\n\t\tconn.query('SELECT room_name FROM roomid WHERE roomID = ?', [roomID], function(err, result){\r\n\t\t\tif (err){\r\n\t\t\t\tcallback(err,null);\r\n\t\t\t}\r\n\t\t\telse if (result.length > 0){\r\n\t\t\t\tcallback(null,result[0].room_name);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcallback(null,\"\");\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "69260cb0cdbcfcc6adae265ca95ab2ef", "score": "0.6231288", "text": "function handleList(fn) {\n fn({ ok: true, rooms: Room.ROOMS })\n }", "title": "" }, { "docid": "458e1707d8a51181471953bf16fc89b4", "score": "0.6132151", "text": "async function getAllRooms(req, res) {\n console.log('getAllRooms: Start')\n try {\n const allRooms = await prisma.csgi_room.findMany()\n\n res.send(JSON.stringify(allRooms));\n console.log('getAllRooms: success')\n } catch (err) {\n console.log('getAllRooms error:', err)\n res.send(JSON.stringify({ \"status\": 500, \"error\": err, \"response\": null }));\n }\n}", "title": "" }, { "docid": "ad4b282c3c220e63bb27792ed0e7929d", "score": "0.6108282", "text": "function getAllRooms(){\n localRoomsTable.queryFeatures(\"OBJECTID > 0\");\n}", "title": "" }, { "docid": "83b924b3fabda7e87ded4fbe6d7230ca", "score": "0.61005723", "text": "function _getRoomUDNs() {\r\n debug(\"entering _getRoomUDNS\");\r\n let zones = raumkernel.managerDisposer.zoneManager.zoneConfiguration.zoneConfig.zones[0]['zone'];\r\n debug(\"_getRoomUDNs zones: %o \", zones);\r\n zones.forEach(function (zone) {\r\n let rooms = zone['room'];\r\n debug(\"zone udn: \", zone['$'].udn);\r\n rooms.forEach(function (room) {\r\n let roomEntry = [{\r\n name: room['$'].name,\r\n udn: room['$'].udn\r\n }];\r\n roomEntries = roomEntries.concat(roomEntry);\r\n debug(\" room: \" + room['$'].name + \" powerState: \" + room['$'].powerState + \" udn: \" + room['$'].udn);\r\n let devices = room['renderer'];\r\n devices.forEach(function (device) {\r\n let deviceEntry = [{\r\n name: device['$'].name,\r\n udn: device['$'].udn\r\n }];\r\n deviceEntries = deviceEntries.concat(deviceEntry);\r\n debug(\" device: \" + device['$'].name + \" udn: \" + device['$'].udn);\r\n });\r\n });\r\n });\r\n}", "title": "" }, { "docid": "3947a676bf03c1ca051af3de6b9f6f4f", "score": "0.6088671", "text": "function InitGroupRooms(){\n \n for( var i = 0; i < groupRoomNames.length; i++)\n { \n GroupRooms.push({});\n initGroupRoom(i);\n }\n \n}", "title": "" }, { "docid": "b52e8ac8500c961d448db2535839469a", "score": "0.6086626", "text": "function checkRoomList() {\n socket.emit('get-rooms', \"\"); \n \n}", "title": "" }, { "docid": "1b33da8a72c819c5a17d7ac4829c8837", "score": "0.605113", "text": "allRooms() {\n return new Promise(async (resolve, reject) => {\n let requestoutid = setTimeout(_ => reject(\"Waiting for MQ to return [allRooms] message timed out\"), this.requestsTimeout);\n let requestid = uid2(6);\n let servercount = await this.allSurvivalCount();\n let result = [];\n let callback = function (rooms) {\n if (--servercount > 0) {\n result = result.concat(rooms);\n }\n else {\n this.requests.delete(requestid);\n clearInterval(requestoutid);\n result = result.concat(rooms);\n resolve([...new Set(result)]);\n }\n };\n let msg = msgpack.encode([RequestMethod.allRooms, this.uid, requestid]);\n this.publish(msg);\n this.requests.set(requestid, callback);\n });\n }", "title": "" }, { "docid": "d9842716843d7e9562ef8663169b80ce", "score": "0.5994644", "text": "function getRoomsForBuilding(value){\n\t\t\t$(\"#roomInput\").prop(\"disabled\", false);\n\t\t\t$(\"#roomList\").empty();\n\t\t\t$scope.rooms = $scope.location[\"rooms\"][value];\n\t\t\tfor(var i = 0; i < $scope.rooms.length; ++i){\n\t\t\t\t$(\"#roomList\").append(\"<option>\" + $scope.rooms[i] + \"</option>\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8045a3596bc310f606ba633dece96777", "score": "0.5970627", "text": "function getRoomByName(name) {\n\tvar i;\n\tfor (i = 0; i < roomlist.length; i++) {\n\t\tvar aRoom = roomlist[i];\n\t\tif (aRoom.name === name) {\n\t\t\treturn aRoom;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "426f726256e0ad693cdce719ad0a9267", "score": "0.59671575", "text": "rooms() {\n return this.hasMany('App/Models/Room')\n }", "title": "" }, { "docid": "750eacb224f2943f903d650c96216c00", "score": "0.5942463", "text": "function gettingRoomsStatus() {\n var rooms = $resource('/api/room-status').query();//$http.get('/api/room-status');\n\n rooms.$promise.then(function (data) {\n //Room.setRoom(data);\n\n return data;\n });\n\n return rooms;\n //$http\n // .get('/api/rooms')\n // .then(function (results) {\n // var msg = '', data = results.data;\n //\n // if (results.status === 200) {\n // msg = 'Rooms received successfully!';\n // logger.success(msg);\n // return data;\n // } else {\n // msg = 'Rooms getting failed. ' + data.message;\n // logger.error(msg);\n // }\n //\n // return data;\n // }).catch(function (reason) {\n // var msg = 'Rooms getting failed. ' + reason.data.description;\n // logger.error(msg);\n //\n // return reason;\n // });\n }", "title": "" }, { "docid": "97a3d4422551f0e4819b26c6fd966140", "score": "0.59136504", "text": "function refreshRooms() {\n $('#roomList').empty();\n\n kuzzle.search(CHAT_ROOM_COLLECTION, {}, function (error, rooms) {\n if (error) {\n throw new Error(error);\n }\n else {\n // create a default room if none exist\n if (rooms.hits.total === 0) {\n $('#switchRoom').text(GLOBAL_CHAT_ROOM);\n kuzzle.create(CHAT_ROOM_COLLECTION, {name: GLOBAL_CHAT_ROOM}, true);\n }\n else {\n rooms.hits.hits.forEach(function (room) {\n if (room._source.name === whoami.chatRoom) {\n $('#switchRoom').text(room._source.name);\n }\n\n if (room._source.name === GLOBAL_CHAT_ROOM) {\n GLOBAL_CHAT_ROOMID = room._id;\n }\n\n addRoomSwitch(room._id, room._source.name);\n });\n }\n }\n });\n}", "title": "" }, { "docid": "af414f1a6e8e25abc1892dc50af21b66", "score": "0.5896521", "text": "function populateRooms(data) {\n if(data.length == 0) {\n $('#empty-warning').show();\n return;\n }\n\n data.sort(function(a,b) {\n if(a.name < b.name) {\n return -1;\n }\n return 1;\n });\n for(let i = 0; i < data.length; i++) {\n let name = data[i].name;\n let description = data[i].description;\n let roomHTML = `<div class=\"chat-item\" onclick=\"enterRoom('`+chanIdEncode(name)+`')\"><span class=\"chat-name\">`+escapeHTML(name)+`</span><span class=\"chat-description\">`+escapeHTML(description)+`</span></div>`;\n $('#chat-list').append(roomHTML);\n }\n}", "title": "" }, { "docid": "bfce2b2d961147b541486acd6a1a82c2", "score": "0.5884004", "text": "async getAvaiableRooms(params) {\n const { id, from, to } = params;\n\n return await roomModel.find({ 'HotelId': id, 'date': { $gte: from, $lte: to }, 'Availability': true });\n }", "title": "" }, { "docid": "ee41f0472f80407e1aee0d8204367f38", "score": "0.58546823", "text": "get roomInfo() {\n return JSON.parse(JSON.stringify(this._roomInfo));\n }", "title": "" }, { "docid": "04c202eb74d5bcbb9efa39d79b711e48", "score": "0.58360773", "text": "function getRoomUsers(room) {\n return users.filter(user => user.room === room)\n}", "title": "" }, { "docid": "110e79fa71d2e85e9e54abe48aeb2cb1", "score": "0.582513", "text": "function listRoom()\n{\n if (currentSubscription) {\n currentSubscription.unsubscribe();\n\t\t//그 방의 사람수도 -1\n }\n currentSubscription = stompClient.subscribe(`/app/chat/rooms`, onListofRoom); //`/chatapp/chat/rooms`?????\n\n}", "title": "" }, { "docid": "e6f2d2c7993c7c23e41d2a3a2a000308", "score": "0.5821908", "text": "getUserList (room) {\n var users = this.users.filter((user) => user.room === room);\n // var users = this.users.filter((user) => { // filter() takes a function as argument, gets called with each user, return true to keep items in array\n // return user.room === room; // if equal is true, they will be added to the list\n // })\n // take array of objects and convert into array of strings - use map\n var namesArray = users.map((user) => user.name);\n return namesArray;\n }", "title": "" }, { "docid": "f91e9e247e9e3c40f5fc4eccea768433", "score": "0.5817171", "text": "function getRoomsByDate(date) {\n var timestamp = roomsService.filterDateToTimestamp(date, false);\n roomsService.getRoomsByDate(timestamp).then(function (rooms) {\n vm.rooms = rooms;\n console.log(rooms);\n }).finally(function (done) {\n console.log(done);\n vm.settings.loading = false;\n }).catch(function (reject) {\n console.log(reject);\n messageService.error(\"Please check your internet connection\" + reject);\n });\n }", "title": "" }, { "docid": "77c3322f4fbb4c2769d7ba046677d2b9", "score": "0.5807147", "text": "_onRoomChange() {\n this.emitChange(\"name\");\n }", "title": "" }, { "docid": "22709e9febe760d52e53873df58671b8", "score": "0.57895046", "text": "function getRoom(request, response){\n\n console.log(request.params.roomName)\n \n Room.find({name: request.params.roomName}).lean().then( data => {\n\n response.render('room', {title: 'chatroom',\n roomName: request.params.roomName,\n newRoomId: data[0].roomId,\n Messages: data[0].Messages});\n\n }).catch(error => (console.log(error)))\n}", "title": "" }, { "docid": "33456a221d2d508e2a7c7cc7b13882ad", "score": "0.57806623", "text": "constructor(rooms) {\r\n //Call super\r\n super(\"Initalize Rooms\");\r\n //Set localized counter part\r\n this.rooms = rooms;\r\n }", "title": "" }, { "docid": "68b04dab61180c03df5d4f832031cce6", "score": "0.5765544", "text": "function getRoomUsers(room){\n return users.filter(user => user.room === room);\n}", "title": "" }, { "docid": "e262324a5965584b48caa24fdf1e2339", "score": "0.5761056", "text": "function getRoomCount() {\n connection.invoke(\"RetrieveRoomCount\");\n }", "title": "" }, { "docid": "71d9b910c758807d89c89e95143b2526", "score": "0.5756223", "text": "getUsersInRoom(room){\n\n let filteredUsers = this.users.filter((user) => { // returns array\n\n return user.room === room;\n\n })\n .map((filteredUser) => {\n\n return filteredUser.name;\n\n });\n\n return filteredUsers;\n\n }", "title": "" }, { "docid": "36409259e006fcd5361d8a663b46322c", "score": "0.57509583", "text": "getRoomState() { return this.roomState; }", "title": "" }, { "docid": "e6e002882ded71c2f9b49830cb4ef6c1", "score": "0.57358044", "text": "getMentorList() {\n console.log(mentors.map(mentor=>mentor.name));\n }", "title": "" }, { "docid": "98111cf8b3f1a6dcbdea93c4ce7688a9", "score": "0.57340074", "text": "function getRoomByBuilding(name,callback){\n\t\tvar rooms = [];\n\t\tvar redisClient;\t\n\t\ttry{ \n\t\t\tredisClient = redis.createClient(redis_port,redis_ip);\n\t\t}\n\t\tcatch (error){\n\t\t\tconsole.log('get room by building error' + error);\n\t\t\tredisClient.quit();\n\t\t\treturn callback(error,null);\n\t\t}\t\t\n\t\tredisClient.keys(\"res:room:*\", function(err, keys) {\n\t\t\tconsole.log('res key room',keys.length);\n\t\t\t\n\t\t\tvar mul = redisClient.multi();\n\t\t\tkeys.forEach(function(key){\t\t\n\t\t\t mul.hmget( key , 'building','floor','site');\n\t\t\t})\t\t \t\t\n\t\t\tmul.exec(function (err, replies) {\n\t\t\t\tconsole.log(\"res:room Resource \".green + replies.length + \" replies\");\n\n\t\t\t if(err) { redisClient.quit(); return callback(err,null);}\t\t\t \n\t\t\t else if(!replies){ redisClient.quit(); return callback(null,null);}\t\t\t\t\t\n\t\t\t\telse{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfor(var i=0;i<keys.length;i++){\n if(replies[i][0] != null)\t\t\t\t\t\n\t\t\t\t\t\t rooms.push({'room':keys[i],'building':replies[i][0], 'floor':replies[i][1],'site':replies[i][2]}); \t\t\t\t\t\t \n\t\t\t\t\t}\n\n\t\t\t\t\tvar groups = _.groupBy(rooms,function(room){\n\t\t\t\t\t\treturn (room.site+\" \"+room.building+\" \"+room.floor);\t\t\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t_.map(groups,function(group){\n\t\t\t\t\t console.log(group.length);\n\t\t\t\t\t\tconsole.log('--------------------------------------------------------');\n\t\t\t\t\t\tvar array = _.map(group,function(room){\n\t\t\t\t\t\t delete room.building; delete room.floor;\n\t\t\t\t\t\t return room.room;\n\t\t\t\t\t\t})\n\t\t\t\t\t return [];\n\t\t\t\t\t})\n\t\t\t\t\tredisClient.quit();\n return callback(null,groups);\t\t\t\t\t\n }\t\t\t\t\t\t\t\t\t\n\t\t\t});\t\t\t\t\t\t\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "7353fc0654dfe47354b7d7e12388eb5e", "score": "0.57310563", "text": "getRoom(roomCode) {\n return this.rooms[roomCode];\n }", "title": "" }, { "docid": "49cea101cb0f9e1df2a10be17a65e8bf", "score": "0.57089305", "text": "function getRooms() {\n showLoadingIcon();\n disableSubmitButton();\n\n // Clean the contents of Rooms\n rooms.innerHTML = \"\";\n\n axios.get('/api/rooms/' + buildings.value)\n .then(function(res) {\n res.data.forEach(function(item) {\n console.log(item);\n\n var option = document.createElement('option');\n option.value = item.id;\n option.innerText = item.name;\n\n rooms.appendChild(option);\n });\n hideLoadingIcon();\n }).catch(function(err){\n console.log(err);\n alert(err);\n });\n\n }", "title": "" }, { "docid": "a66e68a20b70db2be3479efbc7b7f0df", "score": "0.5708842", "text": "get roles() {\n if (!this.usable) throw new UnusableError();\n if (!this.running) throw new RoomNotRunningError();\n return this._roles;\n }", "title": "" }, { "docid": "f060f54d8916ccb5415cd7e901fa2e3f", "score": "0.57037175", "text": "SET_ROOMS(state, rooms) {\n state.rooms = rooms\n }", "title": "" }, { "docid": "88fee647b97a4fdd6ecbf0552075c3f7", "score": "0.56880355", "text": "getRoomRefrence() { return this.roomRefrence; }", "title": "" }, { "docid": "8f76278af0ba4fa55d75003e8ca9fe96", "score": "0.5685221", "text": "function getrooms(socket) {\n const sql = 'SELECT * FROM rooms'\n\n conn.connect(function (err) {\n if (err) console.log(err)\n console.log(\"Connected\")\n console.log(\"getting rooms\")\n\n conn.query(sql, function (err, result, fields) {\n if (err) console.log(err)\n console.log(\"emit rooms\")\n socket.emit('getrooms', { result })\n })\n })\n}", "title": "" }, { "docid": "305174cefedae51ee08552dd9944df01", "score": "0.56722724", "text": "async function getRooms()\n{\n const SQL = \n `SELECT * FROM Rooms`;\n return await fw.db.execute('local',SQL);\n}", "title": "" }, { "docid": "c3908f6bee96ef5456a1f5dde703d81e", "score": "0.56692713", "text": "function RoomState() {\n\n \tthis.members = [];\n\n }", "title": "" }, { "docid": "f2c0a277decfe514eecabc05ae64e5d1", "score": "0.56646365", "text": "getRoomName(roomId) {\n\t\tconst roomsTags = this.props.rooms;\n\t\tconst room = roomsTags.find(room => room.id === roomId);\n\t\treturn room.label;\n\t}", "title": "" }, { "docid": "dc27d6fdf5d66553b2033fb6610e892b", "score": "0.56611955", "text": "constructor(rooms) {\r\n //Call super\r\n super(\"Update Rooms\");\r\n //Set localized counter part\r\n this.rooms = rooms;\r\n }", "title": "" }, { "docid": "23bfa6e9e54537a77038cc914e136871", "score": "0.565595", "text": "getRoomById(roomId) {\n return this.localRooms[roomId];\n }", "title": "" }, { "docid": "1d56d2619a66bef9574a6792253aa5ca", "score": "0.5638466", "text": "function getRoomData(roomId) {\n return rooms[roomId];\n}", "title": "" }, { "docid": "2e545c03bbfb6ce6d848629a201fa09e", "score": "0.56230694", "text": "function getRoom(roomNum) {\n \n console.log(\"In get rooms:\");\n for (var i = rooms.length - 1; i >= 0; i--) {\n console.log(rooms[i].roomNum + \" \" + roomNum);\n if(rooms[i].roomNum == roomNum) {\n return rooms[i];\n } \n } \n return null;\n}", "title": "" }, { "docid": "7a6bfbc2c7245e8ef657acce7bdf38a3", "score": "0.56126803", "text": "async function getAllActors() {\n const actors = await Actor.findAll()\n const actorNames = actors.map(actor => actor.get('name'));\n return actorNames\n\n}", "title": "" }, { "docid": "f8a1d6b63f64a96ab12dc79ecb20cda5", "score": "0.56027234", "text": "function room(name){\r\n\tthis.name = name;\r\n\tthis.descrip = \"\";\r\n\tthis.facing = \"NORTH\";\r\n\tthis.legal_directions = [\"EAST\",\"WEST\"];\r\n\tthis.coords = [0,0,0]; //x y z\r\n\tthis.players = [];\r\n}", "title": "" }, { "docid": "f41283c6c52270d5d49821bf927f6ac9", "score": "0.5594341", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n }", "title": "" }, { "docid": "6ff6c940a02334ba41738d7460bdb811", "score": "0.55904084", "text": "constructor() {\n this.rooms = {}; // Maps room IDs to their Room objects\n this.clientMappings = {}; // Maps individual client IDs with their room IDs\n }", "title": "" }, { "docid": "95a4e7f84f3f49046609dd75da1ec27a", "score": "0.55876917", "text": "RoomsByStation (root, {_stationId}) {\n return getRoomsByQuery( {_stationId: Number(_stationId) });\n }", "title": "" }, { "docid": "6aca52065eec4ddca6811424038d24ca", "score": "0.5578583", "text": "async getAllRoomTypes (req, res) {\n try {\n const type = await RoomType.findAll({\n })\n res.send(type)\n } catch (err) {\n res.status(500).send({\n error: 'An error has occured during fetch'\n })\n }\n }", "title": "" }, { "docid": "66044c526d85d96c640288d2abb02464", "score": "0.556749", "text": "function getRooms (data, func) {\n ajax({\n method: axios.get,\n url: `${baseUrl}/api/rooms/` + objectToQuery(data),\n func\n })\n}", "title": "" }, { "docid": "428f1a15d25267c81eebb5185fa99027", "score": "0.5556441", "text": "async function listReservations() {\n const [reservations] = await client.listReservations({\n parent: `projects/${project}/locations/${location}`,\n });\n\n console.info(`found ${reservations.length} reservations`);\n console.info(reservations);\n }", "title": "" }, { "docid": "5e8744846b1bb8fcc6f5afdeeb2428ee", "score": "0.5554875", "text": "function getRoomState() {\n if (inRoom) {\n var room = $roomContent.val().trim();\n connection.invoke(\"CheckRoomState\", room);\n }\n }", "title": "" }, { "docid": "b9b1ec08266af22bc73bc5ff8692c70e", "score": "0.55479395", "text": "function RoomState() {\n\n\tthis.members = [];\n\n}", "title": "" }, { "docid": "b8c348145d5f868888699b9470c5cca2", "score": "0.55477434", "text": "function displayRoomStats(room){\n $('#room').text(room.name())\n $('#description').text(room.description())\n $('#items').text(room.listOfItems())\n }", "title": "" }, { "docid": "7790ec2f8c6b73199a5cb3503c1c3f63", "score": "0.55289036", "text": "function getAllActors() {\n return Actor.findAll({ attributes: [\"name\"] }).then(actors => {\n return actors.map(arg => arg.name);\n });\n\n}", "title": "" }, { "docid": "6c8832cceb5c8f9819356398abeba58a", "score": "0.5528054", "text": "function salon(room){\r\n return message.guild.channels.find('name', room)\r\n }", "title": "" }, { "docid": "b916b3e9603aa5cf365f40eaf4342d97", "score": "0.5522566", "text": "function returnRoom(rooms, playerNumber) {\n for (var roomName in rooms) {\n if (rooms.hasOwnProperty(roomName)) {\n var players = rooms[roomName].players;\n if (_.size(players) < playerNumber && rooms[roomName].status == 0 && rooms[roomName].playerNumber == playerNumber) {\n return [roomName, players];\n }\n }\n }\n return [];\n }", "title": "" }, { "docid": "07919384dd379bb3a71827903f480ced", "score": "0.55223995", "text": "function listParticipants(roomIds) {\n return new Promise((resolve, reject) => {\n var rooms_participants = []\n requests = []\n\n for (var i in roomIds) {\n requests.push(\n axios.post(janusHost + '/' + sessionId + '/' + handlerId, {\n janus: \"message\",\n transaction: \"list room Ids\",\n apisecret: \"janusrocks\",\n body: {\n request: \"listparticipants\",\n room: roomIds[i]\n }\n }).then(res => {\n rooms_participants.push(parseRoomParticipants(res))\n })\n )\n }\n axios.all(requests).then(() => {\n resolve(rooms_participants)\n })\n\n })\n}", "title": "" }, { "docid": "920445293d43cb67c63b9fb6f84aff1f", "score": "0.55189687", "text": "function getFreeRooms(rooms) {\n \n // Define the array to be returned\n let freeRooms = [];\n // For each room determine its status and the next lecture\n for (let code in rooms) { \n let room = rooms[code];\n let occupied = false;\n let occupied_until = null;\n let next_lesson = null;\n // Here we assume that the events are given in chronological order\n // Cycle until we haven't found the next lesson or we have read all events\n for (let i = 0; (next_lesson == null) && (i < room.length); i++) {\n // Get the current lecture of index i\n let time = room[i];\n // Convert the strings hh:mm:ss to the integers hhmm\n let from = parseTime(time[0]);\n let to = parseTime(time[1]); \n // If the current time is past the start of the lecture but prior to its ending,\n // then the room is occupied\n if (current_time > from && current_time < to) { \n occupied = true;\n // Set occupied_until to the end of the lecture\n occupied_until = to;\n }\n // Otherwise, if the current time is \n else if (current_time < from) {\n // Next lesson for this room\n next_lesson = [from, to];\n }\n }\n // Create the object to be added to the returned array\n let output = {\n code: code,\n occupied: occupied,\n occupied_until: occupied_until,\n next_lesson: next_lesson\n }\n // Add the object to the array\n freeRooms.push(output);\n } \n return freeRooms;\n}", "title": "" }, { "docid": "76b63bfedaacf28989adebbb18e9b105", "score": "0.5514906", "text": "generateRooms(id, floor) {\n const rooms = [];\n for (let i = 1; i <= floor.rooms; i++) {\n rooms.push({\n floor: id,\n id: i,\n key: `dungeon-${id}-${i}`,\n music: floor.music,\n boss: i === floor.rooms,\n shop: false\n })\n }\n return rooms;\n }", "title": "" }, { "docid": "f6793112908cdf635917a3bbb502f661", "score": "0.5501087", "text": "addRoom(roomName) {\n if (this._rooms == null) this._rooms = [];\n const type = typeof roomName;\n if (type === 'string' || type === 'number') {\n this._rooms.push(roomName.toString());\n }\n return this;\n }", "title": "" }, { "docid": "4f8d44905c7bfc35281d98447a03021c", "score": "0.5482675", "text": "function GetRooms( ) {\n // remove all rooms from roomselect\n var select = document.getElementById(\"roomselect\");\n var slength = select.options.length;\n for (var i = 0; i < slength; i++) {\n select.options[i] = null;\n } // for\n\n ROOM_LIST = [ ];\n var _url = \"https://api.ciscospark.com/v1/rooms\";\n var _header = {\"Authorization\" : AUT, \"Content-type\" : CNT};\n var _params = {\"type\" : \"group\", \"sortBy\" : \"created\"};\n\n jQuery.ajax({\n url: _url,\n type: \"GET\",\n headers: _header,\n data: _params,\n success: function(result) {\n for (x in result[\"items\"]) {\n var roomId = result[\"items\"][x].id;\n var roomName = result[\"items\"][x].title;\n\n if (roomName.length > 30) {\n roomName = roomName.substring(0, 30);\n roomName += \"...\";\n } // if\n var temp = new Object( );\n temp.id = roomId;\n temp.name = roomName;\n ROOM_LIST[ROOM_LIST.length] = temp;\n //console.log(roomName);\n var option = document.createElement(\"option\");\n option.text = roomName;\n select.add(option);\n } // for\n } // function\n }); // jQuery.ajax\n} // GetRooms", "title": "" }, { "docid": "81e53548820d345751ce65ef03d58fcf", "score": "0.54745966", "text": "function findRoom(a) {\n var room = a.parents(\".roomGrid\").find(\".roomName h3\").html();\n\n console.log(currentHotel);\n\n var foundRoom = $.grep(currentHotel[0].rooms, function(v) {\n return v.name === room;\n });\n\n console.log(foundRoom);\n\n currentRoom = foundRoom;\n }", "title": "" }, { "docid": "d734bf46fc8cec8db36957f61bbad334", "score": "0.5471465", "text": "clearRooms() {\n this.#rooms = []\n this.setRoomIndex(-1)\n }", "title": "" }, { "docid": "44be08bd28e2051d20a6d390ab854fad", "score": "0.54647905", "text": "function get_fRooms(data) {\n adapt_fRooms();\n var fRooms = Session.get('fRooms');\n if (Session.get('filterList')[0] == 2 &&\n Session.get('filterList')[1] == 0 &&\n Session.get('filterList')[2] == 0)\n fRooms = Session.get('rooms'); //FilterListe noch initial\n if (fRooms.length == 0) {\n //keine den Kriterien entsprechenden Raeume\n var entry = $('<entry />');\n entry.append('<eintrag>Keine den Kriterien</eintrag><eintrag>entsprechenden R&auml;ume</eintrag><eintrag>gefunden</eintrag>');\n fRooms = $('<XMLDocument />').append(entry);\n fillList(fRooms, 'ort');\n }\n else {\n var roomsXml = $('<XMLDocument />');\n var ortT = $('<ort />'); \n for (var i = 0; i < fRooms.length; i++) {\n var entry = $('<entry />');\n $(data).find('entry').each(function () { //fuer jeden Entry\n var tempEnt = $('<text />');\n var heading = $(this).find('heading');\n $(this).find('eintrag').each(\n function () {\n if ($.trim(($(this).text())) == 'Raum ' + fRooms[i][0]) {\n tempEnt.append($(this));\n }\n });\n if ($(tempEnt).prop('children').length > 0) {\n entry.append(heading); //Ueberschrift\n entry.append(tempEnt); //Inhalt\n }\n \n });\n ortT.append(entry);\n }\n roomsXml.append(ortT);\n fillList(roomsXml, 'ort');\n }\n}", "title": "" }, { "docid": "a26dce1c2d49de232053f4b4e6c60195", "score": "0.5444303", "text": "function displayRooms(){\r\n if (rooms.length===0){\r\n closePopupRoom();\r\n }else{\r\n var option;\r\n console.log(rooms.length+\" rooms found: \"+rooms);\r\n for(var k=0;k<rooms.length;k++){\r\n option = document.createElement(\"option\");\r\n option.text = rooms[k];\r\n option.value = rooms[k];\r\n listOfRooms.add(option);\r\n }\r\n }\r\n \r\n }", "title": "" }, { "docid": "fca66577a38fb01ff5d24a414eb72218", "score": "0.54414415", "text": "BedsByRoom (root, {_roomId}) {\n return getRoomsByQuery( {_roomId: Number(_roomId) });\n }", "title": "" }, { "docid": "b21f633a186a87037191baf120dc1e3a", "score": "0.5420113", "text": "function displayResponseToView(rooms) {\r\n document.getElementById(\"rooms-container\").innerHTML = \"\"; // remove all children\r\n\r\n if (rooms){\r\n for (room of rooms) {\r\n displayRoom(room);\r\n } \r\n }\r\n displayAddRoomButton();\r\n\r\n document.getElementById(\"add-room-button\").addEventListener(\"click\", openForm);\r\n }", "title": "" }, { "docid": "4ec8e0ffa666fdc5caf685fd762c8ba6", "score": "0.5415462", "text": "async getNamesAll() {\n const departments = await this.getTable()\n return this.getSortedNames(departments)\n }", "title": "" }, { "docid": "d4bcc5a3d1890c1c6d4a26d270f7ec92", "score": "0.5407911", "text": "getRoom(id) {\n\t\treturn this.rooms.get(id);\n\t}", "title": "" }, { "docid": "6ca1f189a7d8193fb0732d863f5c6544", "score": "0.54070705", "text": "function updateRoomName(room) {\n roomName.textContent = room;\n}", "title": "" }, { "docid": "669fe45bf815a4ad4025a07f8e09f8ba", "score": "0.5401979", "text": "function getPlayersInRoom(room){\r\n\tvar pls = new Array();\r\n\tfor(var i = 0; i <players.length;i++){\r\n\t\tif(playerObjects[players[i]].location == room){\r\n\t\t\tpls.push(players[i]);\r\n\t\t}\r\n\t}\r\n\treturn pls;\r\n}", "title": "" }, { "docid": "16c84bf71cf32c714f884ea1723ccb8c", "score": "0.53952205", "text": "function getRoomName(id) {\n return cacheCall('getRoomNameById', id);\n}", "title": "" }, { "docid": "d1817dbe2c1520405523793a3df51d6b", "score": "0.5394798", "text": "constructor(){\r\n\t\tsuper();\r\n\t\tthis.state = { \r\n\t\t\trooms: []\r\n\t\t}\r\n\t\r\n\t}", "title": "" } ]
50b02cc510c6c1d74ed3038985f691a8
'normalize' a `[...]` set by inverting an inverted `[^...]` set:
[ { "docid": "dec879d00b9c030290270b785733127c", "score": "0.68480843", "text": "function normalizeSet(s, output_inverted_variant) {\n var orig = s;\n\n // propagate deferred exceptions = error reports.\n if (s instanceof Error) {\n return s;\n }\n\n if (s && s.length) {\n // // inverted set?\n // if (s[0] === '^') {\n // output_inverted_variant = !output_inverted_variant;\n // s = s.substr(1);\n // }\n\n var l = new Array(65536 + 3);\n set2bitarray(l, s);\n\n s = bitarray2set(l, output_inverted_variant);\n }\n\n return s;\n}", "title": "" } ]
[ { "docid": "7b5de2774f5f6fc1694d37767789cd1c", "score": "0.62537414", "text": "function bitarray2set(l, output_inverted_variant, output_minimized) {\n // construct the inverse(?) set from the mark-set:\n //\n // Before we do that, we inject a sentinel so that our inner loops\n // below can be simple and fast:\n l[UNICODE_BASE_PLANE_MAX_CP$1 + 1] = 1;\n // now reconstruct the regex set:\n var rv = [];\n var i, j, cnt, lut, tn, tspec, match, pcode, ba4pcode, l2;\n var bitarr_is_cloned = false;\n var l_orig = l;\n\n if (output_inverted_variant) {\n // generate the inverted set, hence all unmarked slots are part of the output range:\n cnt = 0;\n for (i = 0; i <= UNICODE_BASE_PLANE_MAX_CP$1; i++) {\n if (!l[i]) {\n cnt++;\n }\n }\n if (cnt === UNICODE_BASE_PLANE_MAX_CP$1 + 1) {\n // When there's nothing in the output we output a special 'match-nothing' regex: `[^\\S\\s]`.\n // BUT... since we output the INVERTED set, we output the match-all set instead:\n return '\\\\S\\\\s';\n } else if (cnt === 0) {\n // When we find the entire Unicode range is in the output match set, we replace this with\n // a shorthand regex: `[\\S\\s]`\n // BUT... since we output the INVERTED set, we output the match-nothing set instead:\n return '^\\\\S\\\\s';\n }\n\n // Now see if we can replace several bits by an escape / pcode:\n if (output_minimized) {\n lut = Pcodes_bitarray_cache_test_order;\n for (tn = 0; lut[tn]; tn++) {\n tspec = lut[tn];\n // check if the uniquely identifying char is in the inverted set:\n if (!l[tspec[0]]) {\n // check if the pcode is covered by the inverted set:\n pcode = tspec[1];\n ba4pcode = Pcodes_bitarray_cache[pcode];\n match = 0;\n for (j = 0; j <= UNICODE_BASE_PLANE_MAX_CP$1; j++) {\n if (ba4pcode[j]) {\n if (!l[j]) {\n // match in current inverted bitset, i.e. there's at\n // least one 'new' bit covered by this pcode/escape:\n match++;\n } else if (l_orig[j]) {\n // mismatch!\n match = false;\n break;\n }\n }\n }\n\n // We're only interested in matches which actually cover some \n // yet uncovered bits: `match !== 0 && match !== false`.\n // \n // Apply the heuristic that the pcode/escape is only going to be used\n // when it covers *more* characters than its own identifier's length:\n if (match && match > pcode.length) {\n rv.push(pcode);\n\n // and nuke the bits in the array which match the given pcode:\n // make sure these edits are visible outside this function as\n // `l` is an INPUT parameter (~ not modified)!\n if (!bitarr_is_cloned) {\n l2 = new Array(UNICODE_BASE_PLANE_MAX_CP$1 + 1);\n for (j = 0; j <= UNICODE_BASE_PLANE_MAX_CP$1; j++) {\n l2[j] = l[j] || ba4pcode[j]; // `!(!l[j] && !ba4pcode[j])`\n }\n // recreate sentinel\n l2[UNICODE_BASE_PLANE_MAX_CP$1 + 1] = 1;\n l = l2;\n bitarr_is_cloned = true;\n } else {\n for (j = 0; j <= UNICODE_BASE_PLANE_MAX_CP$1; j++) {\n l[j] = l[j] || ba4pcode[j];\n }\n }\n }\n }\n }\n }\n\n i = 0;\n while (i <= UNICODE_BASE_PLANE_MAX_CP$1) {\n // find first character not in original set:\n while (l[i]) {\n i++;\n }\n if (i >= UNICODE_BASE_PLANE_MAX_CP$1 + 1) {\n break;\n }\n // find next character not in original set:\n for (j = i + 1; !l[j]; j++) {} /* empty loop */\n // generate subset:\n rv.push(i2c(i));\n if (j - 1 > i) {\n rv.push((j - 2 > i ? '-' : '') + i2c(j - 1));\n }\n i = j;\n }\n } else {\n // generate the non-inverted set, hence all logic checks are inverted here...\n cnt = 0;\n for (i = 0; i <= UNICODE_BASE_PLANE_MAX_CP$1; i++) {\n if (l[i]) {\n cnt++;\n }\n }\n if (cnt === UNICODE_BASE_PLANE_MAX_CP$1 + 1) {\n // When we find the entire Unicode range is in the output match set, we replace this with\n // a shorthand regex: `[\\S\\s]`\n return '\\\\S\\\\s';\n } else if (cnt === 0) {\n // When there's nothing in the output we output a special 'match-nothing' regex: `[^\\S\\s]`.\n return '^\\\\S\\\\s';\n }\n\n // Now see if we can replace several bits by an escape / pcode:\n if (output_minimized) {\n lut = Pcodes_bitarray_cache_test_order;\n for (tn = 0; lut[tn]; tn++) {\n tspec = lut[tn];\n // check if the uniquely identifying char is in the set:\n if (l[tspec[0]]) {\n // check if the pcode is covered by the set:\n pcode = tspec[1];\n ba4pcode = Pcodes_bitarray_cache[pcode];\n match = 0;\n for (j = 0; j <= UNICODE_BASE_PLANE_MAX_CP$1; j++) {\n if (ba4pcode[j]) {\n if (l[j]) {\n // match in current bitset, i.e. there's at\n // least one 'new' bit covered by this pcode/escape:\n match++;\n } else if (!l_orig[j]) {\n // mismatch!\n match = false;\n break;\n }\n }\n }\n\n // We're only interested in matches which actually cover some \n // yet uncovered bits: `match !== 0 && match !== false`.\n // \n // Apply the heuristic that the pcode/escape is only going to be used\n // when it covers *more* characters than its own identifier's length:\n if (match && match > pcode.length) {\n rv.push(pcode);\n\n // and nuke the bits in the array which match the given pcode:\n // make sure these edits are visible outside this function as\n // `l` is an INPUT parameter (~ not modified)!\n if (!bitarr_is_cloned) {\n l2 = new Array(UNICODE_BASE_PLANE_MAX_CP$1 + 1);\n for (j = 0; j <= UNICODE_BASE_PLANE_MAX_CP$1; j++) {\n l2[j] = l[j] && !ba4pcode[j];\n }\n // recreate sentinel\n l2[UNICODE_BASE_PLANE_MAX_CP$1 + 1] = 1;\n l = l2;\n bitarr_is_cloned = true;\n } else {\n for (j = 0; j <= UNICODE_BASE_PLANE_MAX_CP$1; j++) {\n l[j] = l[j] && !ba4pcode[j];\n }\n }\n }\n }\n }\n }\n\n i = 0;\n while (i <= UNICODE_BASE_PLANE_MAX_CP$1) {\n // find first character not in original set:\n while (!l[i]) {\n i++;\n }\n if (i >= UNICODE_BASE_PLANE_MAX_CP$1 + 1) {\n break;\n }\n // find next character not in original set:\n for (j = i + 1; l[j]; j++) {} /* empty loop */\n if (j > UNICODE_BASE_PLANE_MAX_CP$1 + 1) {\n j = UNICODE_BASE_PLANE_MAX_CP$1 + 1;\n }\n // generate subset:\n rv.push(i2c(i));\n if (j - 1 > i) {\n rv.push((j - 2 > i ? '-' : '') + i2c(j - 1));\n }\n i = j;\n }\n }\n\n assert(rv.length);\n var s = rv.join('');\n assert(s);\n\n // Check if the set is better represented by one of the regex escapes:\n var esc4s = EscCode_bitarray_output_refs.set2esc[s];\n if (esc4s) {\n // When we hit a special case like this, it is always the shortest notation, hence wins on the spot!\n return '\\\\' + esc4s;\n }\n return s;\n}", "title": "" }, { "docid": "05a6177566a27a2bb1507e128124d052", "score": "0.6154163", "text": "function invertSet(set){\n\tvar arr = [];\n\tarr.push(['.']);\n\tvar i = 1;\n\tfor(i = 1; i<set.length; i++){\n\t\tvar y = 1;\n\t\tfor(y = 1; y<set.length; y++){\n\t\t\tif(i==set[y].charCodeAt(0)-64){ // found equal\n\t\t\t\t// append i to output\n\t\t\t\tarr.push(String.fromCharCode(y+64));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn arr;\n}", "title": "" }, { "docid": "84d8ba1aac1f8c99598cb89b1ceab6c0", "score": "0.597344", "text": "function transformFromSet(incoming) {\n const state = _objectSpread({}, incoming);\n\n for (const key in state) {\n if (state.hasOwnProperty(key)) {\n if (state[key] instanceof Set) {\n state[key] = Array.from([...state[key]]);\n }\n }\n }\n\n return state;\n}", "title": "" }, { "docid": "a32cb56f5e2a56132ecd9c5193dfb321", "score": "0.5624189", "text": "function parseSets(str) {\n // or \"[[1,2], [3,4]]\" -> [[1,2], [3,4]]\n var sets = str.match(/\\[[^\\[]+\\]/g) || [], i, j;\n\n for (i = 0; i < sets.length; i++) {\n sets[i] = sets[i].match(/[-\\d\\.]+/g);\n\n for (j = 0; j < sets[i].length; j++) {\n sets[i][j] = +sets[i][j];\n }\n }\n\n return sets;\n }", "title": "" }, { "docid": "756bd6a4eb50f33de0915aef1c10b8a0", "score": "0.5597259", "text": "removeFromSet(set) {\n for (let i = 0; i < set.length; i++)\n if (this.eq(set[i]))\n return set.slice(0, i).concat(set.slice(i + 1));\n return set;\n }", "title": "" }, { "docid": "4f11705e3442f9fce281a7d255060add", "score": "0.5511562", "text": "function removeDuplicates(arrOfStrings){\n //return all duplicate elements filtered out\n return [...new Set(arrOfStrings)]// SPECIAL OPERATION HERE\n} //(OPTION 1)", "title": "" }, { "docid": "02d5456993b8c81f2763f50fda39d3e6", "score": "0.5465007", "text": "removeFromSet(set) {\n for (var i = 0; i < set.length; i++)\n if (set[i].type == this) {\n set = set.slice(0, i).concat(set.slice(i + 1));\n i--;\n }\n return set;\n }", "title": "" }, { "docid": "63f9b17ab864e62909a65a413cbd4845", "score": "0.54383916", "text": "function removeusingSet(arr) {\n\tlet outputArray = Array.from(new Set(arr));\n\treturn outputArray;\n}", "title": "" }, { "docid": "3a5657caa1c005b7c6a6f4f59c9ba3cb", "score": "0.54183435", "text": "function edgeVisual_normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "7cec888d5bb94308f2684e0c3dbb4742", "score": "0.5385122", "text": "function removeDuplicateUsingSet1(a) {\n return Array.from(new Set(a));\n}", "title": "" }, { "docid": "043370a6b412abf59340908bd760883c", "score": "0.53414965", "text": "function normalizeInputs(inputs) {\n var rinputs = [];\n\n for (var i = 0; i < inputs.length; i++) {\n rinputs.push(inputs[i].normalize());\n }\n\n return rinputs;\n}", "title": "" }, { "docid": "869d28844a7f0a08817a3d6b7571eafc", "score": "0.5327577", "text": "function normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "869d28844a7f0a08817a3d6b7571eafc", "score": "0.5327577", "text": "function normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "869d28844a7f0a08817a3d6b7571eafc", "score": "0.5327577", "text": "function normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "869d28844a7f0a08817a3d6b7571eafc", "score": "0.5327577", "text": "function normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "869d28844a7f0a08817a3d6b7571eafc", "score": "0.5327577", "text": "function normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "869d28844a7f0a08817a3d6b7571eafc", "score": "0.5327577", "text": "function normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "11420331c63c7a931296e4481f3e9167", "score": "0.5324538", "text": "function undouble(graphemes) {\n\n var doubled_fricative = new Set(['ll', 'rr', 'gg', 'ghh', 'ghhw'])\n var doubled_nasal = new Set(['nn', 'mm', 'ngng', 'ngngw'])\n\n var doubleable_fricative = new Set(['l', 'r', 'g', 'gh', 'ghw'])\n\n var undoubleable_unvoiced_consonant = new Set(['p', 't', 'k', 'kw', 'q', 'qw', 'f', 's', 'wh'])\n\n var undouble={'ll' : 'l',\n 'rr' : 'r',\n 'gg' : 'g',\n 'ghh' : 'gh',\n 'ghhw': 'ghw',\n 'nn' : 'n',\n 'mm' : 'm',\n 'ngng' : 'ng',\n 'ngngw': 'ngw'}\n\n var result = graphemes.slice(0) // Copy the list of graphemes\n\n var i = 0\n\n while (i+1 < result.length) {\n var first = result[i]\n var second = result[i+1]\n\t\n // Rule 1a \n if (doubled_fricative.has(first) && undoubleable_unvoiced_consonant.has(second)) {\n result[i] = undouble[first]\n i += 2\n }\n // Rule 1b \n else if (undoubleable_unvoiced_consonant.has(first) && doubled_fricative.has(second)) {\n result[i+1] = undouble[second]\n i += 2\n }\n // Rule 2 \n else if (undoubleable_unvoiced_consonant.has(first) && doubled_nasal.has(second)) {\n result[i+1] = undouble[second]\n i += 2\n }\n // Rule 3a \n else if (doubled_fricative.has(first) && (doubled_fricative.has(second) || doubled_nasal.has(second))) {\n result[i+1] = undouble[second]\n i += 2\n }\n // Rule 3b \n else if ((doubled_fricative.has(first) || doubled_nasal.has(first)) && second=='ll') {\n result[i] = undouble[first]\n i += 2\n } \n else {\n i += 1\t\n }\n } // End 'while' Loop\n\t\n return result\n}", "title": "" }, { "docid": "e467b3bc5428022f1a7551d39ef0e529", "score": "0.53052986", "text": "function wordSet (str) {\n var strArray = [];\n for (var i = 0; i < str.length; i++) {\n strArray.push(str[i]);\n }\n for (var i = 0; i < str.length - 1; i--) {\n strArray.push(str[i]);\n }\n return strArray = [];\n}", "title": "" }, { "docid": "69b03ba8869d372d29624d06f954974b", "score": "0.52932405", "text": "function normalize(collection, excludeKeys = []) {\n const sample = collection[0];\n const maxSets = {};\n const minSets = {};\n\n // determine min and max values for each given property\n Object.keys(sample)\n .filter(key => !excludeKeys.includes(key))\n .forEach((key) => {\n maxSets[key] = Math.max(\n ...Array.from(collection, c => c[key]),\n );\n minSets[key] = Math.min(\n ...Array.from(collection, c => c[key]),\n );\n });\n\n // constrain each key's value to lie between the min and max\n // attach x0, x1, ... values for easier drawing\n const normalizedSet = collection.map((item) => {\n const newItem = {};\n\n Object.keys(item)\n .forEach((key, i) => {\n if (!excludeKeys.includes(key)) {\n const val = clamp(\n item[key], minSets[key], maxSets[key], 0, 1,\n );\n newItem[key] = val;\n newItem[`x${i}`] = val;\n } else {\n newItem[key] = item[key];\n }\n });\n\n return newItem;\n });\n\n return normalizedSet;\n}", "title": "" }, { "docid": "5cacf5057c919d65d20525ebef1fb6f6", "score": "0.5242501", "text": "setUnion(s, t) {\n if (!(t instanceof Set))\n t = new Set(t);\n\n const union = new Set(s);\n for (let item of t) {\n union.add(item);\n }\n\n return union;\n }", "title": "" }, { "docid": "c2f84265fd0c1ac0c7506aa6ee243da0", "score": "0.52032775", "text": "invert(doc) {\n let sections = this.sections.slice(), inserted = [];\n for (let i = 0, pos = 0; i < sections.length; i += 2) {\n let len = sections[i], ins = sections[i + 1];\n if (ins >= 0) {\n sections[i] = ins;\n sections[i + 1] = len;\n let index = i >> 1;\n while (inserted.length < index)\n inserted.push(Text.empty);\n inserted.push(len ? doc.slice(pos, pos + len) : Text.empty);\n }\n pos += len;\n }\n return new ChangeSet(sections, inserted);\n }", "title": "" }, { "docid": "8fd0639e9bfca4d69c8503d6cbbaeeda", "score": "0.5179495", "text": "function normalize$3(a) {\n\t if (!(a instanceof Array)) {\n\t a = [a, a];\n\t }\n\t\n\t return a;\n\t }", "title": "" }, { "docid": "a5492f68e7e9f31f01439bf4b550712c", "score": "0.51615894", "text": "set normalized(value) {}", "title": "" }, { "docid": "deda77f920f193548cb06836e2c4c864", "score": "0.5157", "text": "function prepare(string, characterSet) {\n var strippedCharacters = new Set(characterSet);\n var returnString = \"\";\n for (var character of string) {\n if (!strippedCharacters.has(character)) {\n returnString = returnString.concat(character);\n }\n }\n return returnString.toLowerCase();\n}", "title": "" }, { "docid": "87ac1f3ed03993dd7c77f130f3a53d29", "score": "0.5116951", "text": "function uniteUnique(arr) {\n\tconst args = [...arguments];\n\n\tconst unifiedArr = [].concat(...args);\n\n\t//for loop could work too\n\t//Sets can only contain one of each element\n\treturn [...new Set(unifiedArr)];\n}", "title": "" }, { "docid": "7d4783774a59bb6a7f397b6c2245af6c", "score": "0.5106365", "text": "function undoNormalize(g) {\n g.eachNode(function(u, a) {\n if (a.dummy) {\n if ('index' in a) {\n var edge = a.edge;\n if (!g.hasEdge(edge.id)) {\n g.addEdge(edge.id, edge.source, edge.target, edge.attrs);\n }\n var points = g.edge(edge.id).points;\n points[a.index] = { x: a.x, y: a.y, ul: a.ul, ur: a.ur, dl: a.dl, dr: a.dr };\n }\n g.delNode(u);\n }\n });\n }", "title": "" }, { "docid": "2596412daf7a3644b89ee86e33558665", "score": "0.51045257", "text": "function toSet(arr){\n if(typeof arr !== \"object\"){return arr;}\n //sorts the array, then filters out repeat occurrences by position\n return sortSet(arr).filter(function (item, pos, self) {\n return self.indexOf(item) == pos;\n });\n}", "title": "" }, { "docid": "bce34763a0e4890d912cc9acf7bb1802", "score": "0.5098195", "text": "function unBase(arr){\n var base = arr.reduce(commonBase, arr[0]);\n return arr.map(function(x){\n x = x.substr(base.length);\n x = x.charAt(0).toLowerCase() + x.substr(1);\n x = camelCase(x);\n return x;\n })\n}", "title": "" }, { "docid": "4ff2e0c1bc709d728154b8a170c9614a", "score": "0.50930685", "text": "function normalizeSourceSet(data) {\n\tvar sourceSet = data.srcSet || data.srcset;\n\n\tif (Array.isArray(sourceSet)) {\n\t\treturn sourceSet.join();\n\t}\n\n\treturn sourceSet;\n}", "title": "" }, { "docid": "4ff2e0c1bc709d728154b8a170c9614a", "score": "0.50930685", "text": "function normalizeSourceSet(data) {\n\tvar sourceSet = data.srcSet || data.srcset;\n\n\tif (Array.isArray(sourceSet)) {\n\t\treturn sourceSet.join();\n\t}\n\n\treturn sourceSet;\n}", "title": "" }, { "docid": "b58cdd75fbda8e69cfedd3087fb1c614", "score": "0.50887376", "text": "function addToSet(set, array) {\n var l = array.length;\n while (l--) {\n if (typeof array[l] === 'string') {\n array[l] = array[l].toLowerCase();\n }\n set[array[l]] = true;\n }\n return set;\n}", "title": "" }, { "docid": "6374d4554a756b2c96a86efc4ac626a6", "score": "0.50821006", "text": "function normalizeArray(parts,allowAboveRoot){var res=[];for(var i=0;i<parts.length;i++){var p=parts[i];// ignore empty parts\nif(!p||p===\".\")continue;if(p===\"..\"){if(res.length&&res[res.length-1]!==\"..\"){res.pop()}else if(allowAboveRoot){res.push(\"..\")}}else{res.push(p)}}return res}// returns an array with empty elements removed from either end of the input", "title": "" }, { "docid": "66ab8c0ffe19a457389b80b0779839e7", "score": "0.50514966", "text": "function linesVisual_normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "1fb436294abe172151658f881699738c", "score": "0.5040449", "text": "normalize(events) {\n if (events.length == 0) {\n return events;\n }\n\n return events.map((e) => e.split('.').shift());\n }", "title": "" }, { "docid": "0850a1758ddb4f71b61573637ab95797", "score": "0.5027665", "text": "function set(array) {\r\n var a = array.concat();\r\n for(var i=0; i<a.length; ++i) {\r\n for(var j=i+1; j<a.length; ++j) {\r\n if(a[i] === a[j])\r\n a.splice(j--, 1);\r\n }\r\n }\r\n return a;\r\n}", "title": "" }, { "docid": "51d23770e77826392fc84ceaa36d9736", "score": "0.500098", "text": "function solution(s) {\n return Array.from(new Set(s))\n}", "title": "" }, { "docid": "a43d9dbb18a4c0c1a743d3de58e873d7", "score": "0.49708462", "text": "setDifference(s, t) {\n if (!(s instanceof Set))\n s = new Set(s);\n if (!(t instanceof Set))\n t = new Set(t);\n\n const diff = new Set();\n for (let s_item of s) {\n if (!t.has(s_item)) {\n diff.add(s_item);\n }\n }\n\n return diff;\n }", "title": "" }, { "docid": "4b32c853e41408021fc5b066c3adf050", "score": "0.4943072", "text": "union(set) {\n const newSet = new Set();\n this.values().forEach(value => {\n newSet.add(value);\n })\n set.values().forEach(value => {\n newSet.add(value);\n })\n\n return newSet;\n }", "title": "" }, { "docid": "3a5fc3e40e6fdbd2c66608bcd23bc612", "score": "0.49071157", "text": "static normalize(input){\n // https://en.wikipedia.org/wiki/Unicode_equivalence#Normalization\n // http://www.unicode.org/reports/tr15/\n\n // normalize codepoints (split diacritics) and remove diacritics\n let value = input.normalize('NFKD').replace(/[\\u0300-\\u036f]/g, '')\n // remove/replace some special chars, just to be sure\n .replace(/['\"!?]/g, '')\n .replace(/[/\\\\]/g, '-')\n // replace a lot of special chars. Redondant with line above, but also handles non-diacritics special chars (e.g. ligatures)\n return undiacritics.removeAll(value)\n }", "title": "" }, { "docid": "cfc47d22f07b9d8e2d17f25198c2fb23", "score": "0.49034122", "text": "function getNormalizedVNodes (vnodes) {\n const children = new Set();\n\n vnodes.forEach(vnode => {\n fillNormalizedVNodes(children, vnode);\n });\n\n return Array.from(children)\n }", "title": "" }, { "docid": "1d52734cb20519d8431bb952ba15def4", "score": "0.49028137", "text": "function undoNormalize(g) {\n var visited = {};\n\n g.eachNode(function(u, a) {\n if (a.dummy && \"index\" in a) {\n var edge = a.edge;\n if (!g.hasEdge(edge.id)) {\n g.addEdge(edge.id, edge.source, edge.target, edge.attrs);\n }\n var points = g.edge(edge.id).points;\n points[a.index] = { x: a.x, y: a.y, ul: a.ul, ur: a.ur, dl: a.dl, dr: a.dr };\n g.delNode(u);\n }\n });\n }", "title": "" }, { "docid": "1d52734cb20519d8431bb952ba15def4", "score": "0.49028137", "text": "function undoNormalize(g) {\n var visited = {};\n\n g.eachNode(function(u, a) {\n if (a.dummy && \"index\" in a) {\n var edge = a.edge;\n if (!g.hasEdge(edge.id)) {\n g.addEdge(edge.id, edge.source, edge.target, edge.attrs);\n }\n var points = g.edge(edge.id).points;\n points[a.index] = { x: a.x, y: a.y, ul: a.ul, ur: a.ur, dl: a.dl, dr: a.dr };\n g.delNode(u);\n }\n });\n }", "title": "" }, { "docid": "60770d40c175adbea72263c4e74c20f4", "score": "0.48872447", "text": "function bitarray2set(l, output_inverted_variant) {\n function i2c(i) {\n var c;\n\n switch (i) {\n case 10:\n return '\\\\n';\n\n case 13:\n return '\\\\r';\n\n case 9:\n return '\\\\t';\n\n case 8:\n return '\\\\b';\n\n case 12:\n return '\\\\f';\n\n case 11:\n return '\\\\v';\n\n case 45: // ASCII/Unicode for '-' dash\n return '\\\\-';\n\n case 91: // '['\n return '\\\\[';\n\n case 92: // '\\\\'\n return '\\\\\\\\';\n\n case 93: // ']'\n return '\\\\]';\n\n case 94: // ']'\n return '\\\\^';\n }\n // Check and warn user about Unicode Supplementary Plane content as that will be FRIED!\n if (i >= 0xD800 && i < 0xDFFF) {\n throw new Error(\"You have Unicode Supplementary Plane content in a regex set: JavaScript has severe problems with Supplementary Plane content, particularly in regexes, so you are kindly required to get rid of this stuff. Sorry! (Offending UCS-2 code which triggered this: 0x\" + i.toString(16) + \")\");\n }\n if (i < 32\n || i > 0xFFF0 /* Unicode Specials, also in UTF16 */\n || (i >= 0xD800 && i < 0xDFFF) /* Unicode Supplementary Planes; we're TOAST in JavaScript as we're NOT UTF-16 but UCS-2! */\n || String.fromCharCode(i).match(/[\\u2028\\u2029]/) /* Code compilation via `new Function()` does not like to see these, or rather: treats them as just another form of CRLF, which breaks your generated regex code! */\n ) {\n // Detail about a detail:\n // U+2028 and U+2029 are part of the `\\s` regex escape code (`\\s` and `[\\s]` match either of these) and when placed in a JavaScript\n // source file verbatim (without escaping it as a `\\uNNNN` item) then JavaScript will interpret it as such and consequently report\n // a b0rked generated parser, as the generated code would include this regex right here.\n // Hence we MUST escape these buggers everywhere we go...\n c = '0000' + i.toString(16);\n return '\\\\u' + c.substr(c.length - 4);\n }\n return String.fromCharCode(i);\n }\n\n // construct the inverse(?) set from the mark-set:\n //\n // Before we do that, we inject a sentinel so that our inner loops\n // below can be simple and fast:\n l[65536] = 1;\n // now reconstruct the regex set:\n var rv = [];\n var i, j;\n var entire_range_is_marked = false;\n if (output_inverted_variant) {\n // generate the inverted set, hence all unmarked slots are part of the output range:\n i = 0;\n while (i <= 65535) {\n // find first character not in original set:\n while (l[i]) {\n i++;\n }\n if (i > 65535) {\n break;\n }\n // find next character not in original set:\n for (j = i + 1; !l[j]; j++) {} /* empty loop */\n // generate subset:\n rv.push(i2c(i));\n if (j - 1 > i) {\n entire_range_is_marked = (i === 0 && j === 65536);\n rv.push((j - 2 > i ? '-' : '') + i2c(j - 1));\n }\n i = j;\n }\n } else {\n // generate the non-inverted set, hence all logic checks are inverted here...\n i = 0;\n while (i <= 65535) {\n // find first character not in original set:\n while (!l[i]) {\n i++;\n }\n if (i > 65535) {\n break;\n }\n // find next character not in original set:\n for (j = i + 1; l[j]; j++) {} /* empty loop */\n if (j > 65536) {\n j = 65536;\n }\n // generate subset:\n rv.push(i2c(i));\n if (j - 1 > i) {\n entire_range_is_marked = (i === 0 && j === 65536);\n rv.push((j - 2 > i ? '-' : '') + i2c(j - 1));\n }\n i = j;\n }\n }\n\n // When there's nothing in the output we output a special 'match-nothing' regex: `[^\\S\\s]`.\n // When we find the entire Unicode range is in the output match set, we also replace this with\n // a shorthand regex: `[\\S\\s]` (thus replacing the `[\\u0000-\\uffff]` regex we generated here).\n var s;\n if (!rv.length) {\n // entire range turnes out to be EXCLUDED:\n s = '^\\\\S\\\\s';\n } else if (entire_range_is_marked) {\n // entire range turnes out to be INCLUDED:\n s = '\\\\S\\\\s';\n } else {\n s = rv.join('');\n }\n\n return s;\n}", "title": "" }, { "docid": "1fe9df7e8e9de9022d01bba1f916cb64", "score": "0.48866814", "text": "function uniteUnique(arr) {\r\n /* the arguments object, despite not being an array, is made to support iteration */\r\n return [...new Set(Array.prototype.concat.call(...arguments))]\r\n}", "title": "" }, { "docid": "1eb74de6630161ec7a689db4c77d09ee", "score": "0.48840567", "text": "purgeSets() {\n this.children.forEach((subTrie) => {\n subTrie.wordSet.clear();\n subTrie.purgeSets();\n });\n }", "title": "" }, { "docid": "753683e44c49728f614a3dd04a4e9a41", "score": "0.4876504", "text": "function dupIgnoreCase(arr) {\n if (!Array.isArray(arr)) {\n return [];\n }\n\n const isDup = (value, index, self) => self.indexOf(value) !== index;\n\n return [...new Set(arr.map((v) => canonical(v)).filter(isDup))];\n}", "title": "" }, { "docid": "78a204eafee0cbd4f92a5750d4271978", "score": "0.48560205", "text": "function insensitiveRemoveDupes(string) {\n var stringSet = new Set()\n var testSet = new Set();\n var testString = string.toUpperCase();\n for (var i = 0; i < testString.length; i++) {\n if (!testSet.has(testString[i])) {\n testSet.add(testString[i]);\n stringSet.add(string[i]);\n }\n }\n console.log(Array.from(stringSet).join(''));\n}", "title": "" }, { "docid": "7b9a2ffddfbccc3554928ec30d2cc4aa", "score": "0.48553306", "text": "function uniteUnique(arr) {\n\n //make an array out of arguments and flatten it (using the spread operator)\n const args = [].concat(...arguments);\n\n // create a Set\n return [...new Set(args)];\n}", "title": "" }, { "docid": "28521064e8b87eeac5a4100e5299717b", "score": "0.4852794", "text": "normalizeTransactions(transactions) {\n let formattedTransactions = [];\n formattedTransactions = _.map(transactions, mapTransactionKeysToLower);\n return formattedTransactions;\n }", "title": "" }, { "docid": "49609ef86d3b61ae82aae708226829a0", "score": "0.4848356", "text": "function normalizeSudoku(sudoku) {\n const normalizedSudoku = [...sudoku].map(val => {\n if (val === \".\") {\n return \"\";\n }\n\n return val;\n });\n\n return normalizedSudoku;\n}", "title": "" }, { "docid": "3f2d78f5771d4888764b9f594546f2e9", "score": "0.48335478", "text": "function uniteUnique(...arr) {\n const array = arr.flat();\n return [...new Set(array)];\n}", "title": "" }, { "docid": "c3b7b43458bf8ce5d76c9567159ce7bd", "score": "0.4830083", "text": "function normalizeSelection() {\n\t\t\t// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything\n\t\t\teditor.on('keyup focusin mouseup', function(e) {\n\t\t\t\tif (e.keyCode != 65 || !VK.metaKeyPressed(e)) {\n\t\t\t\t\tselection.normalize();\n\t\t\t\t}\n\t\t\t}, true);\n\t\t}", "title": "" }, { "docid": "c3b7b43458bf8ce5d76c9567159ce7bd", "score": "0.4830083", "text": "function normalizeSelection() {\n\t\t\t// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything\n\t\t\teditor.on('keyup focusin mouseup', function(e) {\n\t\t\t\tif (e.keyCode != 65 || !VK.metaKeyPressed(e)) {\n\t\t\t\t\tselection.normalize();\n\t\t\t\t}\n\t\t\t}, true);\n\t\t}", "title": "" }, { "docid": "c3b7b43458bf8ce5d76c9567159ce7bd", "score": "0.4830083", "text": "function normalizeSelection() {\n\t\t\t// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything\n\t\t\teditor.on('keyup focusin mouseup', function(e) {\n\t\t\t\tif (e.keyCode != 65 || !VK.metaKeyPressed(e)) {\n\t\t\t\t\tselection.normalize();\n\t\t\t\t}\n\t\t\t}, true);\n\t\t}", "title": "" }, { "docid": "d51c8b876558e9c5dcd510495c5e74ab", "score": "0.47965762", "text": "function restoreFilters(rawFilters) {\n var filters = new Array();\n var filtersHolder = new Array();\n filtersHolder = rawFilters.split(\"|\");\n for (i = 0; i < filtersHolder.length; i++) {\n filters[i] = new Array();\n if (filtersHolder[i] != \"\") {\n filters[i] = filtersHolder[i].split(\",\");\n }\n }\n return filters;\n}", "title": "" }, { "docid": "88e3c628abb8612429a3a9a077b1d46d", "score": "0.4783256", "text": "function normalize(value, patterns) {\n var index = -1\n\n while (++index < patterns.length) {\n value = value.replace(patterns[index][0], patterns[index][1])\n }\n\n return value\n}", "title": "" }, { "docid": "14391838d346ae41bae442edcce5df74", "score": "0.47472048", "text": "function uuclean(source) { // @param Array: source\r\n // @return Array: clean Array\r\n if (Array.isArray(source)) {\r\n var rv = [], i = 0, iz = source.length;\r\n\r\n for (; i < iz; ++i) {\r\n if (i in source) {\r\n if (source[i] != null) { // null and undefined\r\n rv.push(source[i]);\r\n }\r\n }\r\n }\r\n return rv;\r\n }\r\n return source;\r\n}", "title": "" }, { "docid": "858963ec98984e002387141835692621", "score": "0.47443995", "text": "function normalizeCharacters(characters) {\n return characters.map(function(character) {\n return normalizeCharacter(character);\n });\n}", "title": "" }, { "docid": "bb62b27c8e5dae5720da48c20d522193", "score": "0.47379118", "text": "function normalizeAll()\n {\n normalizeForms();\n normalizeControls();\n }", "title": "" }, { "docid": "3e76d7f3078afc8819b48f0697b7e9e4", "score": "0.47357023", "text": "function normalize(set, variable, modifier) {\n let max = 0\n set.forEach(element => {\n let value = element[variable]\n if (isNaN(value) || !value || value == Infinity) {\n value = 0\n }\n max = Math.max(max, value)\n })\n\n set.forEach(element => {\n let value = element[variable]\n if (isNaN(value) || !value || value == Infinity) {\n value = 0\n }\n\n value /= max\n\n if (modifier) {\n value *= modifier\n }\n\n element[variable] = value\n })\n debug('Variable max:', variable, max)\n}", "title": "" }, { "docid": "3950a2b5f8d3eb8322e0b49e893bd819", "score": "0.4734007", "text": "function removeDuplicates(array) {\n const deDupedArray = [];\n array.forEach(el => {\n const normalizedEl = (el + '').toLowerCase();\n if (deDupedArray.indexOf(normalizedEl) !== -1) {\n deDupedArray.push(normalizedEl)\n }\n })\n return deDupedArray;\n }", "title": "" }, { "docid": "67782b81696972ed76f2954a62b21f94", "score": "0.47199607", "text": "function normalize(term) {\n var arr = [];\n for(var i in term) {\n // normalize everything!\n var value = term[i];\n if(value instanceof Object) {\n // it's an object, loop through these values as well\n var a = normalize(value);\n a.forEach(function(el) {\n arr.push(el);\n });\n }\n value = \"\"+value; // JS string\n // ok for each value we must trim() it and lowercase() it\n value = value.trim().toLowerCase();\n // then we must split it by space, comma and other things\n var words = splitter(value);\n\n for(var x=0; x<words.length; x++) {\n // add each word to our main array\n arr.push(words[x]);\n }\n }\n return arr;\n }", "title": "" }, { "docid": "8e35a0a81f6b03bea8ebd8c02c46446e", "score": "0.47132215", "text": "function dedup(array) {\nvar special = [...new Set(array)]; //uses set and the spread operator to delete all duplicates of the array\n\n\nreturn special; //returns the special array of values\n}", "title": "" }, { "docid": "8a9d11a48995e26d81b755322cddd552", "score": "0.47066325", "text": "function clean(collection) {\n var ns = /\\S/;\n collection.each(function(el) {\n var d = el,\n n = d.firstChild,\n ni = -1,\n nx;\n while (n) {\n nx = n.nextSibling;\n if (n.nodeType == 3 && !ns.test(n.nodeValue)) {\n d.removeChild(n);\n } else {\n n.nodeIndex = ++ni; // FIXME not sure what this is for, and causes IE to bomb (the setter) - @rem\n }\n n = nx;\n }\n });\n}", "title": "" }, { "docid": "8a9d11a48995e26d81b755322cddd552", "score": "0.47066325", "text": "function clean(collection) {\n var ns = /\\S/;\n collection.each(function(el) {\n var d = el,\n n = d.firstChild,\n ni = -1,\n nx;\n while (n) {\n nx = n.nextSibling;\n if (n.nodeType == 3 && !ns.test(n.nodeValue)) {\n d.removeChild(n);\n } else {\n n.nodeIndex = ++ni; // FIXME not sure what this is for, and causes IE to bomb (the setter) - @rem\n }\n n = nx;\n }\n });\n}", "title": "" }, { "docid": "9e09a6b5ad911ad2dd93027a8cfb369d", "score": "0.4696707", "text": "function uniteUnique(arr) {\n\n\t// use a set as handily keeps insertion order, and unique elems only\n\tlet result = new Set();\n\tfor (let prop in arguments) {\n\t\t\n\t\targuments[prop].forEach( function(element, index) {\n\t\t\tresult.add(element);\n\t\t\t//console.log(result);\n\t\t});\n\t \n\t}\n return Array.from(result);\n}", "title": "" }, { "docid": "924af96a2383d4c9711b09d892a3c294", "score": "0.46821237", "text": "_normalizeLex(lex) {\n if (typeof lex !== 'string') {\n return lex;\n }\n\n let normalizedLex = {};\n\n this._toArray(lex).forEach(lexRule => {\n let [LHS, RHS] = this._splitLexParts(lexRule);\n normalizedLex[LHS] = RHS;\n });\n\n return normalizedLex;\n }", "title": "" }, { "docid": "a6d142846d8732518875ffccdad7db71", "score": "0.46785972", "text": "function unique2(arr) {\r\n return Array.from(new Set(arr));\r\n}", "title": "" }, { "docid": "3e8a066853884c849672910d378217fb", "score": "0.46639022", "text": "get normalized() {}", "title": "" }, { "docid": "07c15c69046f98ac8065bc4a8bfdb9d4", "score": "0.46637326", "text": "function removeDuplicateWordsFromTwo(sentence) {\n let wordsList = sentence.split(\" \");\n console.log(wordsList);\n let newSet = new Set(wordsList); // Set return unique only\n console.log(newSet);\n // let arrayFromSet = [...newSet];\n let arrayFromSet = Array.from(newSet);\n console.log(arrayFromSet);\n let joinWords = arrayFromSet.join(\" \");\n console.log(joinWords);\n return joinWords;\n }", "title": "" }, { "docid": "9305feaaf233971864dbe0801a4d6d2b", "score": "0.466299", "text": "function subsets(arr) {\n if (arr.length <= 1) {\n return [arr];\n } else {\n const prevSets = subsets(arr.slice(0, arr.length - 1));\n let newEl = arr[arr.length - 1];\n const newSets = prevSets.map( set => {\n let copy = set.slice();\n copy.push(newEl);\n return copy;\n });\n\n return prevSets.concat(newSets).concat([[newEl]]);\n }\n}", "title": "" }, { "docid": "b9e6efd9fdf2f1928732b4d3d691006b", "score": "0.46551505", "text": "function powerset(str) {\n let result = [];\n function powerSet(str) {\n if (str.length === 0) return [\"\"];\n\n let result = [];\n for (let i = 0; i < str.length; i++) {\n let ltr = str[i];\n let stuff = powerSet(str.slice(i + 1)); // ['']\n stuff.forEach(st => {\n if (!result.includes(ltr + str)) {\n result.push(ltr + st);\n }\n });\n result = result.concat(stuff);\n }\n console.log(result);\n return result;\n }\n powerSet(str);\n return result;\n}", "title": "" }, { "docid": "c2cbf2974c27eeaaebc5f393cf85f5cb", "score": "0.46493086", "text": "function removeAnagram(arr) {\n\t// sort every item in arr with map function\n\tconst sortedWords = arr.map((word) => word.split('').sort().join(''))\n\n\tfor (let i = 0; i < sortedWords.length; i++) {\n\t\tfor(let j = i + 1; j < sortedWords.length; j++){\n\t\t\tif (sortedWords[i] === sortedWords[j]){\n\t\t\t\tconst arrBeforeFirstAnagram = arr.slice(0, i);\n\t\t\t\tconst arrAfterFirstAnagram = arr.slice(i + 1);\n\t\t\t\tconst combined = [...arrBeforeFirstAnagram, ...arrAfterFirstAnagram];\n\t\t\t\treturn combined;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b40e476e1b7204d84f9118edb97c17be", "score": "0.464915", "text": "function toSet(values) {\n\n // create the set\n var ret = new Set(values);\n\n // if got starting values and yet the set is empty..\n if (values && values.length !== ret.size) {\n for (var i = 0; i < values.length; ++i){\n ret.add(values[i]);\n }\n }\n\n // return the new set\n return ret;\n}", "title": "" }, { "docid": "9c89de8b7af7c9f5d79896bdfdccb7d3", "score": "0.4648865", "text": "function deStupify(input)\n{\n input.forEach(function(record)\n {\n for (var field in record)\n {\n record[field] = record[field].S;\n }\n });\n return input;\n}", "title": "" }, { "docid": "e883f52799293b7f7079e67e0773aacc", "score": "0.46483544", "text": "function uniqueArray4(a) {\n return [...new Set(a)];\n}", "title": "" }, { "docid": "dd69b526bc545b88db2ad9b169eabebf", "score": "0.46455273", "text": "function distinct(a) {\n return [...new Set(a)];\n}", "title": "" }, { "docid": "888d3f9d25c7a8e82e30d51a318414aa", "score": "0.4640325", "text": "function normalize(word) {\n var result = \"\";\n for (var i = 0; i < word.length; i++) {\n var kana = word[i];\n var target = transform[kana];\n if (target === false) {\n continue;\n }\n if (target) {\n kana = target;\n }\n result += kana;\n }\n return result;\n }", "title": "" }, { "docid": "4785ea71dbc89cbf16f99797cec8915f", "score": "0.4640206", "text": "function removeDuplicates(){\n //passing our validEmails array to a Set method, so array converts to Set collection,\n var setColl = new Set(validEmails);\n emailsNoDuplicates = [...setColl]; //convert Set collection to an array with spread operator\n console.log(emailsNoDuplicates);\n showValidInvalidOutput();\n}", "title": "" }, { "docid": "63b702d9c0f6c055d40b5a38c91a3de1", "score": "0.46269247", "text": "function normalizer(toBeNormalized){\n return toBeNormalized.toLowerCase();\n}", "title": "" }, { "docid": "e8ce8550410122c12ac0a5a69f2596bd", "score": "0.4626235", "text": "function normalizeArguments(args) {\n args = args.slice();\n const result = [];\n for (const arg of Array.from(args)) {\n let match;\n if ((match = arg.match(MULTI_FLAG))) {\n for (const l of Array.from(match[1].split(''))) { result.push(`-${l}`); }\n } else {\n result.push(arg);\n }\n }\n return result;\n}", "title": "" }, { "docid": "ee771322527cfa7a888734594378703c", "score": "0.46165627", "text": "_normalizeIntralineHighlights(content, highlights) {\n let contentIndex = 0;\n let idx = 0;\n const normalized = [];\n for (const hl of highlights) {\n let line = content[contentIndex] + '\\n';\n let j = 0;\n while (j < hl[0]) {\n if (idx === line.length) {\n idx = 0;\n line = content[++contentIndex] + '\\n';\n continue;\n }\n idx++;\n j++;\n }\n let lineHighlight = {\n contentIndex,\n startIndex: idx,\n };\n\n j = 0;\n while (line && j < hl[1]) {\n if (idx === line.length) {\n idx = 0;\n line = content[++contentIndex] + '\\n';\n normalized.push(lineHighlight);\n lineHighlight = {\n contentIndex,\n startIndex: idx,\n };\n continue;\n }\n idx++;\n j++;\n }\n lineHighlight.endIndex = idx;\n normalized.push(lineHighlight);\n }\n return normalized;\n }", "title": "" }, { "docid": "cbd6ef1d5fe63aa440d47ee185b19867", "score": "0.46150362", "text": "function parseSetsWithStrings(str) {\n var sets = str.match(/\\[[^\\[]+\\]/g) || [], i, j;\n\n for (i = 0; i < sets.length; i++) {\n // Splitting apart numbers/strings from dataset string \n sets[i] = sets[i].match(/('(?:[^\\\\\"\\']+|\\\\.)*')|([-\\w\\.]+)/g);\n\n for (j = 0; j < sets[i].length; j++) {\n sets[i][j] = isNaN(sets[i][j]) ? stripSingleQuotes(sets[i][j]) : +sets[i][j];\n }\n }\n\n return sets;\n }", "title": "" }, { "docid": "472891046a2922e75e1560ea69373351", "score": "0.46114352", "text": "function _dashboarNormalizeFilter(userInputfilter) {\n return userInputfilter\n ? userInputfilter.split(',')\n .map(function(s){return s.trim();})\n .filter(function(s){return !!s;})\n .sort()\n .join(',')\n : ''\n ;\n }", "title": "" }, { "docid": "87c8f029d4aa8dd53a093d88a221a1ba", "score": "0.46041077", "text": "function subsets(arr) {\r\n var x = Math.pow(2, arr.length);\r\n var bs = bitstrings(x);\r\n addPadding(bs); //add leading padding to bitstrings\r\n var result = [];\r\n\r\n for (i = 0; i < bs.length; i++) {\r\n result.push(mask(bs[i], arr));\r\n\r\n }\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "e4984bc937db1810a416ad48f46580e6", "score": "0.4601357", "text": "function normalize(word) {\n return word.toLowerCase().replace(/[.!,//]/g, \"\");\n}", "title": "" }, { "docid": "85ce6b6888489ebbde0ffb5cfacf3d68", "score": "0.46003586", "text": "function removeSubsets$1(nodes) {\n var idx = nodes.length;\n /*\n * Check if each node (or one of its ancestors) is already contained in the\n * array.\n */\n while (--idx >= 0) {\n var node = nodes[idx];\n /*\n * Remove the node if it is not unique.\n * We are going through the array from the end, so we only\n * have to check nodes that preceed the node under consideration in the array.\n */\n if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {\n nodes.splice(idx, 1);\n continue;\n }\n for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) {\n if (nodes.includes(ancestor)) {\n nodes.splice(idx, 1);\n break;\n }\n }\n }\n return nodes;\n}", "title": "" }, { "docid": "1e281e53b34068ac3f6052b4136c064c", "score": "0.45989734", "text": "function uniteUnique(a,...arr) {\n const flattenArray = a.concat(arr.reduce((a, b) => a.concat(b)));\n return Array.from(new Set(flattenArray));\n}", "title": "" }, { "docid": "5704e38e7a7fbf920fe796a4324dc642", "score": "0.45973483", "text": "function normalize(x) {\n\t\tif (typeof x == 'string') {\n\t\t\tvar val = engine.componentTypes[x] ? engine.componentTypes[x].mask : engine.componentGroups[x];\n\t\t\tif (val == null) { raiseHell('no component or componentGroup named: ' + x); }\n\t\t\treturn val;\n\t\t}\n\t\tif (x instanceof Array) {\n\t\t\treturn ['and'].concat(x.map(normalize))\n\t\t}\n\t\tif (x instanceof Object) {\n\t\t\tvar key = Object.keys(x)[0];\n\t\t\tif (!['and', 'or', 'not'].indexOf(key) == -1) {\n\t\t\t\traiseHell('keys must be on of and, or, or not');\n\t\t\t}\n\t\t\treturn [key].concat(x[key].map(normalize));\n\t\t}\n\t}", "title": "" }, { "docid": "7f4d6434b1919c69617b1218eaf3e8f9", "score": "0.4591172", "text": "function normalizeArray(parts, allowAboveRoot){\n\t// if the path tries to go above the root, `up` ends up > 0\n\tvar up = 0;\n\tfor(var i = parts.length - 1; i >= 0; i--){\n\t\tvar last = parts[i];\n\t\tif(last === \".\")\n\t\t\tparts.splice(i, 1);\n\t\telse if(last === \"..\"){\n\t\t\tparts.splice(i, 1);\n\t\t\tup++;\n\t\t}\n\t\telse if(up){\n\t\t\tparts.splice(i, 1);\n\t\t\tup--;\n\t\t}\n\t}\n\n\t// if the path is allowed to go above the root, restore leading ..s\n\tif(allowAboveRoot)\n\t\tfor(; up--; up)\n\t\t\tparts.unshift(\"..\");\n\n\treturn parts;\n}", "title": "" }, { "docid": "2017c51c8bcc3ec4a3e83b85662c44da", "score": "0.4584705", "text": "function invertOptions(options) {\n return options.reduce(function (acc, opt) {\n return chainOption(function (arr) {\n return mapOption(function (value) {\n return [].concat(_toConsumableArray(arr), [value]);\n })(opt);\n })(acc);\n }, some([]));\n}", "title": "" }, { "docid": "a2fbfaab5ba174d9ea7d4255f3c2b274", "score": "0.45844585", "text": "function normalizeTokens (str) {\n return str\n .filter(Boolean)\n .map(_ => _.toLowerCase())\n .filter(_ => _.length >= MIN_SEARCH_TEXT_LENGTH)\n}", "title": "" }, { "docid": "850e48260fe76f2a193a5e49bd64a2c3", "score": "0.4580922", "text": "function uniqNoSet(arr) {\n var ret = [];\n\n for (var i = 0; i < arr.length; i++) {\n if (ret.indexOf(arr[i]) === -1) {\n ret.push(arr[i]);\n }\n }\n\n return ret;\n} // 2 - a simple Set type is defined", "title": "" }, { "docid": "aef16637a7a07d6b22b3db8ce7556a77", "score": "0.4572817", "text": "normalize(args) {\n let ret = [];\n let arg;\n let lastOpt;\n let index;\n\n for (let i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n\n if (i > 0) {\n lastOpt = this.optionFor(args[i - 1]);\n }\n\n if (arg === '--') {\n // Honor option terminator\n ret = ret.concat(args.slice(i));\n break;\n } else if (lastOpt && lastOpt.required) {\n ret.push(arg);\n } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') {\n arg.slice(1).split('').forEach(c => {\n ret.push(`-${c}`);\n });\n } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {\n ret.push(arg.slice(0, index), arg.slice(index + 1));\n } else {\n ret.push(arg);\n }\n }\n\n return ret;\n }", "title": "" }, { "docid": "f807f8c256854074275073c92e942a05", "score": "0.45655674", "text": "function uniqSetWithForEach(arr) {\n \tvar ret = [];\n \n \t(new Set(arr)).forEach(function (el) {\n \t\tret.push(el);\n \t});\n \n \treturn ret;\n }", "title": "" }, { "docid": "cfc00a806aac86295e2d1a012c73dabc", "score": "0.4560748", "text": "function normalizeArray(parts, allowAboveRoot) {\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = parts.length; i >= 0; i--) {\n\t var last = parts[i];\n\t if (last == '.') {\n\t parts.splice(i, 1);\n\t } else if (last === '..') {\n\t parts.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t parts.splice(i, 1);\n\t up--;\n\t }\n\t }\n\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (allowAboveRoot) {\n\t for (; up--; up) {\n\t parts.unshift('..');\n\t }\n\t }\n\n\t return parts;\n\t}", "title": "" }, { "docid": "cfc00a806aac86295e2d1a012c73dabc", "score": "0.4560748", "text": "function normalizeArray(parts, allowAboveRoot) {\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = parts.length; i >= 0; i--) {\n\t var last = parts[i];\n\t if (last == '.') {\n\t parts.splice(i, 1);\n\t } else if (last === '..') {\n\t parts.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t parts.splice(i, 1);\n\t up--;\n\t }\n\t }\n\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (allowAboveRoot) {\n\t for (; up--; up) {\n\t parts.unshift('..');\n\t }\n\t }\n\n\t return parts;\n\t}", "title": "" }, { "docid": "22e31219de9acb31d35d07448ab04f3f", "score": "0.455863", "text": "function normalizeArray(parts, allowAboveRoot) {\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = parts.length - 1; i >= 0; i--) {\n\t var last = parts[i];\n\t if (last === '.') {\n\t parts.splice(i, 1);\n\t } else if (last === '..') {\n\t parts.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t parts.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (allowAboveRoot) {\n\t for (; up--; up) {\n\t parts.unshift('..');\n\t }\n\t }\n\t\n\t return parts;\n\t}", "title": "" }, { "docid": "22e31219de9acb31d35d07448ab04f3f", "score": "0.455863", "text": "function normalizeArray(parts, allowAboveRoot) {\n\t // if the path tries to go above the root, `up` ends up > 0\n\t var up = 0;\n\t for (var i = parts.length - 1; i >= 0; i--) {\n\t var last = parts[i];\n\t if (last === '.') {\n\t parts.splice(i, 1);\n\t } else if (last === '..') {\n\t parts.splice(i, 1);\n\t up++;\n\t } else if (up) {\n\t parts.splice(i, 1);\n\t up--;\n\t }\n\t }\n\t\n\t // if the path is allowed to go above the root, restore leading ..s\n\t if (allowAboveRoot) {\n\t for (; up--; up) {\n\t parts.unshift('..');\n\t }\n\t }\n\t\n\t return parts;\n\t}", "title": "" } ]
88e65a50532c4c3528269b881edc123b
Declaring the main functions / Declaring a function posting the data to the API
[ { "docid": "2b843dfa775e23234fced1acf4e3c5ac", "score": "0.57546884", "text": "function on_Gen() {\n let data = {\n ZIP: get_ZIP.value,\n content: get_Feelings.value,\n date: new Date()\n };\n/* Declaring a function geting the ZIP code information from the API */\nasync function ZIP_Info(ZIP) {\n return await (await fetch(`http://api.openweathermap.org/data/2.5/forecast?zip=${ZIP}${API_KEY}`)).json()\n};\n\n/* Post Data To Api For Get Zip Code Information */\nZIP_Info(data.ZIP).then(zipInfo => {\n // If error\n if (zipInfo.cod != 200)\n return alert(zipInfo.message)\n // If Ok\n data.temp = zipInfo.list[0].main.temp;\n post_Data(data);\n}).catch(error_Catch);\n}", "title": "" } ]
[ { "docid": "6bd09cbb25b3ec42e995d8a94d4702f1", "score": "0.6708498", "text": "post(apiMethod, requestData, callback) {\n\n // TODO: implement later for LAN support...\n\n }", "title": "" }, { "docid": "20d9acfea8584f5cad2ea7f76bef7a83", "score": "0.66166526", "text": "function post_data(api, request, success, error, silenterror, checkdevice, ajaxoption)\n{\n post_data_url(API_URL+api, request, success, error, silenterror, checkdevice, ajaxoption);\n}", "title": "" }, { "docid": "8a638ce5d65d6265783a2294f092aae3", "score": "0.657492", "text": "function postData(){\n //aqui le ponemos al url y decimos que tipo de metodo vamos a estar haciendo post get etc.\n fetch(api,{\n method:'POST',\n //aqui estamos parciando el json a string para enviar se lo al body como key y value/.\n body:JSON.stringify(data)\n \n }).then(res=>res.json())\n //aqui capturamos y mostra mos por consola si hay error en el envio de los datos\n .catch(error=>console.error('error: ',error))\n //aqui capturamos y mostramos por consola si fue exitosa el envio de los datos\n .then(response =>console.log('success: ',response));\n alert(\"Se ha enviado los datos\");\n }", "title": "" }, { "docid": "37a3fbe1d1141c86c57b4ca17509282d", "score": "0.6291206", "text": "function HourliePost(){\n\t\n}", "title": "" }, { "docid": "da56e25251a509766518479f7523e7f3", "score": "0.6269851", "text": "function postToApi(api_endpoint, json_data, callback) {\n console.log(api_endpoint+': ', JSON.stringify(json_data));\n request.post({\n url: 'http://testnet.api.coloredcoins.org:80/v3/'+api_endpoint,\n headers: {'Content-Type': 'application/json'},\n form: json_data\n }, \n function (error, response, body) {\n if (error) return callback(error);\n if (typeof body === 'string') {\n body = JSON.parse(body)\n }\n console.log('Status: ', response.statusCode);\n console.log('Body: ', JSON.stringify(body));\n return callback(null, body);\n });\n}", "title": "" }, { "docid": "0fa5c51a97826f8eec98ba29fe30d59e", "score": "0.6188688", "text": "function actionPer(e) {\n \n const zip = document.getElementById('zip').value;\n const feeling = document.getElementById('feeling').value;\n \n getApiData (Url, zip, Key)\n\n .then(function(data) {\n // add data to POST request \n console.log(data) \n postRoute('/add', {date:d , temp:data.list[0].main.temp, content:feeling})\n UiUpdate();\n })\n \n \n}", "title": "" }, { "docid": "3419fff3baec69478a86905aed1184a8", "score": "0.61824775", "text": "function sendData(id, acctype, name, uname, Pword) {\n fetch('http://localhost:5000/register', {\n headers: {\n 'Content-type': 'application/json'\n },\n method: 'POST',\n body: JSON.stringify({\n id: arguments[0],\n Acctype: arguments[1],\n name: arguments[2],\n Uname: arguments[3],\n Pword: arguments[4]\n })\n })\n .then(response => response.json())\n}", "title": "" }, { "docid": "6485350102bb0a76314ac8154708efd8", "score": "0.6174524", "text": "function PerformSomeactions(e){\r\n // we will get the value of zip code that the user will enter it and store it in the variable called \"zipCode\"by using document.getElementById method \r\n const zipCode = document.getElementById('zip').value;\r\n// we will get the value of user's feeling and store it in the variable \"myFeelings\" by using document.getElementById method\r\n const myFeelings = document.getElementById('feelings').value;\r\n // here we put a condition that when the user doesn't enter the zip code the we will show alert or message to tell him to enter it \r\n if(zipCode ===\"\"){\r\n alert(\"enter zip code\")\r\n }else{// if the user enter the zip code and his feeling then we will excute the next lines of the code\r\n // her if the user enter the zip code then we will call the getOurData function that take 3 parameter Baseurl ,zipcode that the user will enter it and Myapikey\r\n getOurData(Baseurl,zipCode,Myapikey) \r\n // we make a chain by using .then to chain the promises that the data that we get(after posting it) and the updateUI(THE data that the user will enter in the feelings)i.e we make a post request \r\n .then(function(data){\r\n //we will console the data\r\n console.log(data)\r\n//here we will call our function called \"postData\" (the function that we use it to create a post request on the client side) and pass to it the path (or the url)of the post route \"/add\" and make an object that contain the information that will be posted which are the date\r\n// and the temperature that we will get it from the object \"data\" from the API AND THE feeling of the user and we will do these by using dot notation and then post that object\r\n//we make a chaining promise by making a GET request to the weather API and making POST request to store all the data we received locally in our app \r\n postOurData('/add',{date:newDate1,temp:data.main.temp,content:myFeelings});\r\n })//we will call the function updateUI after getting all data from other functions by using .then \r\n// .then(() => updateUI()) We call a function and inside this function we call the updateUI\r\n// we use .then() to chain actions\r\n .then(() =>updateUIData())\r\n } \r\n}", "title": "" }, { "docid": "e50cc0b278366c3c7b79a3b3c86322da", "score": "0.60954803", "text": "dataPost(params){\n params=params || {};\n params.requestType=\"POST\";\n this.dataTransport(params);\n }", "title": "" }, { "docid": "cfe24d151e23aff24f42e3607f83bbe8", "score": "0.6050702", "text": "function postData(err, data, response) {\n console.log(data);\n} // searchedData function is a callback function which ", "title": "" }, { "docid": "8b83295de6acc9d5abee9a0db23d9b6b", "score": "0.60354537", "text": "create(data, config, cb) {\n api.post(baseURL, data, config, cb);\n }", "title": "" }, { "docid": "4362f242e57556fee9cc18f21ac61b66", "score": "0.6018399", "text": "function DataApi() {}", "title": "" }, { "docid": "3454d80afe7e5e3c16248a38de884948", "score": "0.60115397", "text": "function Post() {\n return [\n checkParams,\n getUser,\n checkIfUserIsLocked,\n validatePassword,\n loginUser,\n populateResult\n ]\n}", "title": "" }, { "docid": "c806213d675a65bf31809c149cf70d4a", "score": "0.6010798", "text": "function postUser(data, callback){\n\n}", "title": "" }, { "docid": "747f175cf36a7401d3a7e3bf9816972c", "score": "0.6005175", "text": "function post(name, query, data, fn, msg) {\n\n //延迟显示。 避免数据很快回来造成的只显示瞬间\n SMS.Tips.loading({\n text: msg || '数据加载中,请稍后...',\n delay: 500\n });\n\n var obj = {\n 'data': data,\n 'query': query\n\n };\n\n //var api = new API(name, {\n\n // data: obj,\n\n // 'success': function (data, json) { //success\n // fn && fn(data, json);\n\n // },\n\n // 'fail': function (code, msg, json) {\n // SMS.Tips.error(msg, 2000);\n\n // },\n\n // 'error': function () {\n // SMS.Tips.error('网络错误,请稍候再试', 2000);\n // },\n\n //});\n //api.post();\n\n var api = new SMS.API(name, obj).post().success(function (data, json) { //请求成功时触发\n\n SMS.Tips.success('数据加载完成', 2000);\n fn && fn(data, json);\n\n }).fail(function (code, msg, json) { //请求失败时触发\n\n SMS.Tips.error(msg, 2000);\n\n }).error(function () { //请求错误时触发\n\n SMS.Tips.error('网络错误,请稍候再试', 2000);\n\n })\n\n }", "title": "" }, { "docid": "083eace32d145124fee1558cb0ad17a9", "score": "0.5981433", "text": "async function postToApi(api_endpoint, json_data, callback) {\r\n console.log(api_endpoint+': ', JSON.stringify(json_data));\r\n request.post({\r\n url: 'https://ntp1node.nebl.io/ntp1/'+api_endpoint,\r\n headers: {'Content-Type': 'application/json'},\r\n form: json_data\r\n },\r\n async function (error, response, body) {\r\n if (error) {\r\n return callback(error);\r\n } else if (response.statusCode != 200){\r\n await console.log(api_endpoint+' Failed with Status: ', response.statusCode);\r\n await waitFor(1000); //milliseconds, so 1000 = 1 second\r\n await postToApi(api_endpoint, json_data, async function(err, body){\r\n if (err) {\r\n console.log('error: ', err);\r\n };\r\n });\r\n } else if (typeof body === 'string') {\r\n body = JSON.parse(body);\r\n }\r\n await console.log(api_endpoint+': Status:', response.statusCode);\r\n return callback(null, body);\r\n });\r\n}", "title": "" }, { "docid": "eebeda372b00f32754e6341df8dff7bc", "score": "0.59729433", "text": "function performAction(e) {\n\n\n\n const newZip = document.getElementById('zip').value;\n const newFeeling = document.getElementById('feelings').value;\n\n\n\n /* Function to GET Web API Data*/\n const getTemp = async(baseURL, newZip, apiKey) => {\n\n const res = await fetch(baseURL + newZip + apiKey)\n const error = \"Couldn't connect the API\";\n try {\n\n const data = await res.json();\n return data;\n } catch (error) {\n console.log(\"error\", error);\n // appropriately handle the error\n }\n }\n\n\n /* Function to POST data */\n const postTemp = async(url = \"\", data = {}) => {\n\n const res = await fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(data),\n });\n try {\n\n const data = await res.json();\n console.log(data)\n return data;\n } catch (error) {\n console.log(\"error\", error);\n\n // appropriately handle the error\n }\n };\n getTemp(baseURL, newZip, apiKey)\n .then(function(data, newFeeling) {\n console.log(data);\n console.log(newFeeling);\n\n postTemp('/api', {\n temp: data,\n feeling: newFeeling\n });\n\n });\n\n /* Function to GET Project Data */\n}", "title": "" }, { "docid": "9eaf548e6c62ffee8c1a314825d03c19", "score": "0.5968818", "text": "async carPost({name, price, registrationDate, mileage, seats, doors, description, owners, manufactured, omv, arf, deregistrationValue, bhp, engineCapacity, roadTax, type, make, transmission, plateNumber, coe, coeExpiryDate, fuel, soldBy, mobileNumber, email, postImg, accessoriesImg, accessoriesDescriptions, accessoriesCategory}){\n try{\n var response = await httpModule.request({\n url: `${serverAddress}/api/car-post`,\n method: \"POST\",\n timeout: requestTimeout,\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n content: JSON.stringify({\n ['api_token']: datastore.apiToken,\n ['name']: name,\n ['price']: price,\n ['registration_date']: registrationDate,\n ['mileage']: mileage,\n ['seats']: seats,\n ['doors']: doors,\n ['description']: description,\n ['owners']: owners,\n ['manufactured']: manufactured,\n ['omv']: omv,\n ['arf']: arf,\n ['deregistration_val']: deregistrationValue,\n ['bhp']: bhp,\n ['engine_capacity']: engineCapacity,\n ['road_tax']: roadTax,\n ['type']: type,\n ['make']: make,\n ['transmission']: transmission,\n ['plate_number']: plateNumber,\n ['coe']: coe,\n ['coe_expiry_date']: coeExpiryDate,\n ['fuel']: fuel,\n ['sold_by']: soldBy,\n ['mobile_number']: mobileNumber,\n ['email']: email,\n ['postImg']: postImg,\n ['accessoriesImg']: accessoriesImg,\n ['accessoriesDescriptions']: accessoriesDescriptions,\n ['accessoriesCategory']: accessoriesCategory\n }),\n });\n return response.content.toJSON();\n } catch(error){\n console.log(error);\n }\n }", "title": "" }, { "docid": "1fd6e019b0d91258224bcc0375d44787", "score": "0.59641933", "text": "function genericPostRequest(apiName, apiPath, parameters, successCallback, errorCallback){\n\tvar apiUrl = getServer(apiName) + apiPath;\n\tparameters.KEY = getKey();\n\t//parameters.GUUID = userid;\t//<-- DONT USE THAT IF ITS NOT ABSOLUTELY NECESSARY (its bad practice and a much heavier load for the server!)\n\t//parameters.PWD = pwd;\n\tparameters.client = getClient();\n\tconsole.log('POST request to: ' + apiUrl);\n\t//console.log(parameters);\n\tshowMessage(\"Loading ...\");\n\t$.ajax({\n\t\turl: apiUrl,\n\t\ttimeout: 12500,\n\t\ttype: \"POST\",\n\t\tdata: JSON.stringify(parameters),\n\t\theaders: {\n\t\t\t//\"content-type\": \"application/x-www-form-urlencoded\"\n\t\t\t//\"content-type\": \"text/plain\"\n\t\t\t\"Content-Type\": \"application/json\"\n\t\t},\n\t\tsuccess: function(data) {\n\t\t\t//console.log(data);\n\t\t\tcloseMessage();\n\t\t\tpostSuccess(data, successCallback, errorCallback);\n\t\t},\n\t\terror: function(data) {\n\t\t\tconsole.log(data);\n\t\t\tshowMessage(\"ERROR in HTTP POST request.\");\n\t\t\tpostError(data, errorCallback);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8a87dbbb69d070fa64d44d809cbbc1ff", "score": "0.5951747", "text": "function postToAPI () {\n\n fs.createReadStream('static/json/data.json').pipe(request.post({url:fullAPIPath}, function(err,httpResponse,body){\n //console.log(\"body::: \" + body);\n var jsonObject = JSON.parse(body);\n\n if (jsonObject.responses[0].labelAnnotations) {\n for (var i = 0; i < jsonObject.responses[0].labelAnnotations.length; i++) {\n console.log(\"LABEL:: \" + jsonObject.responses[0].labelAnnotations[i].description + \" //// with score \" + jsonObject.responses[0].labelAnnotations[i].score);\n }\n }\n\n // save the result\n var resultFileName = \"static/json/result.json\";\n jsonfile.writeFile(resultFileName, jsonObject, function (err) {\n console.log(\"resultfile saved::: \" + resultFileName);\n\n io.emit('api', { message: \"image processed\" });\n });\n\n }));\n\n}", "title": "" }, { "docid": "49788eb9ae5ee91d12e34bcdef3672d5", "score": "0.5949049", "text": "function correlateAPI() {\n}", "title": "" }, { "docid": "88f08d8ae9a6c94a20fc4aa85c58f3b9", "score": "0.59458035", "text": "function ListenerFunc(){\n \n const Weather=GetApiData(`${baseurl}${zip.value}&units=metric&appid=${key}`);\n const res=Weather.then(function(PromiseResult)\n {\n postData('/',{\n temp:PromiseResult.main.temp,\n date:newDate,\n feelings:feelings.value,\n });\n UpdateUIDynamically();\n \n }\n );\n\n}", "title": "" }, { "docid": "f4fff90a7125fd0973738607af7f62bb", "score": "0.590619", "text": "function postData(values) {\n\n var prop;\n\n // Construct the HTTP request string\n var req = \"https://data.sparkfun.com/input/\" + phant.publicKey +\n \"?private_key=\" + phant.privateKey;\n for (prop in values) {\n req += \"&\" + prop + \"=\" + values[prop].toString().replace(/ /g, \"%20\");\n }\n\n // Make a request and notify the console of its success\n request(req, {timeout: reqTimeout}, function(error, response, body) {\n\n // Exit if we failed to post\n if (error) {\n console.log(\"Post failed. \" + error);\n\n // If HTTP responded with 200, we know we successfully posted the data\n } else if (response.statusCode === 200) {\n var posted = \"Posted successfully with: \";\n for (prop in values) {\n posted += prop + \"=\" + values[prop] + \" \";\n }\n console.log(posted);\n } else {\n console.log(\"Problem posting. Response: \" + response.statusCode);\n }\n });\n}", "title": "" }, { "docid": "0f3b41dcc8d4e062c7fd01713ef03c88", "score": "0.59053344", "text": "AddFertilizerData (args) {\n // console.log(\"Args:\",args)\n const API_URL = `http://localhost:8000/addfertilizer`\n return ezFetch.post(API_URL,args)\n }", "title": "" }, { "docid": "d9bf9341a9490530c2b29f74d88974d1", "score": "0.5879536", "text": "function apiRequest(name, payload, errorField, reaction)\n{\n\tvar apiExtension = \".php\";\n\t// Starting post request\n\tvar url = urlBase + 'api/' + name + apiExtension;\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"POST\", url, true);\n\txhr.setRequestHeader(\"Content-type\", \"application/json; charset=UTF-8\");\n\t\n\t// Defining reaction function\n\txhr.onreadystatechange = function()\n\t{\n\t\t// If the returned JSON has an error, it will be displayed in errorField\n\t\ttry\n\t\t{\n\t\t\t// Only runs reaction after receiving the JSON\n\t\t\tif (this.readyState == 4 && this.status == 200) \n\t\t\t{\n\t\t\t\t// Checking received JSON for a non-null error field\n\t\t\t\tconsole.log(\"Received from \"+url+\":\\n\"+this.responseText);\n\t\t\t\tvar parsedJSON = JSON.parse(this.responseText);\n\t\t\t\tconsole.log(\"Parsed JSON successfully\");\n\t\t\t\tif (parsedJSON.error == \"\" || parsedJSON.error === undefined)\n\t\t\t\t{\n\t\t\t\t\tconsole.log(\"JSON does not contain error\");\n\t\t\t\t\treaction(parsedJSON);\n\t\t\t\t\tconsole.log(\"Function completed successfully.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Error(parsedJSON.error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(err)\n\t\t{\n\t\t\t// Displays error from JSON in the error field\n\t\t\terrorField.innerHTML = err.message;\n\t\t}\n\t}\n\t// Echoing JSON to console\n\tconsole.log(\"Sending to \"+url+\": \\n\"+JSON.stringify(payload));\n\t\n\t// Sending JSON\n\ttry\n\t{\n\t\txhr.send(JSON.stringify(payload));\n\t}\n\tcatch(err)\n\t{\n\t\terrorField.innerHTML = err.message;\n\t}\n}", "title": "" }, { "docid": "dae5bb21ff381b1da9342cc3439fc3c6", "score": "0.5867191", "text": "async function latestDeviceHandler(event){ \n event.preventDefault(); \n\n //Adding the values that are needed for the form add-post \n\n const title = document.querySelector('input[name=\"titleAdd\"]').value \n const fufilled = document.querySelector('textArea[name=\"fufilled\"]').value \n\n //Adding string data to the post-routes \n\n const reply = await fetch(`/api/post`,{ \n method:\"POST\", \n body: JSON.stringify({ \n title,fufilled\n }), \n headers:{ \n 'Content-Type':'application/json'\n }\n }); \n\n //If everything is received correctly it will return you to the dashboard \n\n if(reply.ok){ \n document.location.replace('/dashboard'); \n\n }else{ \n alert(reply.statusText);\n }\n}", "title": "" }, { "docid": "615e4f748a29d7e1c8df6e7f1a69c92d", "score": "0.5866569", "text": "function postQA() { \n var o = {\n question: document.getElementById('qtext').value,\n answer: document.getElementById('atext').value,\n category: document.getElementById('input-cat').value\n }; \n qaApi.createQuestion(o, function (){\n console.log(\"your questions are posted\");\n // change view\n toggleHidden(document.querySelector(\"#qa-section\"), false);\n toggleHidden(document.querySelector(\"#question-form-box\"), true);\n //get data in \n qaApi.getAll(displayQuestions);\n }); \n}", "title": "" }, { "docid": "f950037f32a38c3c6cf8284b739e7ebc", "score": "0.5856834", "text": "function performAction(e){\n\n const CityName = document.getElementById('place_name').value; //taking the value of zip code from the user input\n const departDate = document.getElementById('start').value; //taking the value of country code from the user input\n const leaveDate = document.getElementById('end').value; //taking the value of country code from the user input\n\n let URL = `http://api.geonames.org/searchJSON?name_equals=${CityName}&maxRows=1&username=ksuhiyp`;\n\n // get the information about the place (using the getApi Function to get the information from the API)\n Client.getApi(URL)\n\n .then((data)=> {\n console.log(data)\n \n Client.postData('http://localhost:3000/post', data)\n .then((data1)=> {\n latt = data1.latitude;\n long = data1.longitude;\n console.log('data: '+latt+' type of data: '+typeof(latt)) // to be removed\n console.log('value of latt: '+latt+'value of long: '+long) // to be removed\n URL2 = `https://api.weatherbit.io/v2.0/forecast/daily?lat=${latt}&lon=${long}&key=e43e5eafdeba4fe28856146576ddda80`;\n })\n })\n \n// get the information about the place Weather (using the getApi Function to get the information from the API)\n// making the function in the timeout so that it will wait for the previous api information (GeoNames API) before it runs\n setTimeout(function(){\n \n Client.getApi(URL2) \n\n .then((data)=> {\n console.log(data)\n Client.postData('http://localhost:3000/weather', data)\n })\n \n }, 400);\n\n\n var API_KEY = '18102870-ee1e47d498220adcfcfa7009d';\n var URL3 = \"https://pixabay.com/api/?key=\"+API_KEY+\"&q=\"+encodeURIComponent(CityName);\n \n // pixabay API\n // get a picture related to the user input for the place name (using the getWeather Function to get the photo from the API)\n Client.getApi(URL3) \n \n .then((data) => {\n console.log(data)\n \n if (parseInt(data.totalHits) > 0) {\n imgSrc = data.hits[0].webformatURL\n console.log(imgSrc) \n }\n else \n console.log('No hits')\n })\n // get the information stored in the server then update the information at the website \n .then(setTimeout(function(){\n // get the information from the server by UI function\n UI(departDate)\n // Calculate the difference between the depart date and the leaving date then show it\n daysDifference(departDate, leaveDate)\n // change the img tag src to be the picture recieved from the pixabay API \n let img2 = document.getElementById(\"pic2\")\n img2.src = imgSrc\n img2.alt = CityName\n }, 410))\n}", "title": "" }, { "docid": "50750f880aff745b5540649b23c23d0b", "score": "0.5850106", "text": "submit() {\n // TODO: maybe a new data type? or submit remotely?\n }", "title": "" }, { "docid": "1750c4b674850d4b5485b80a1549ba97", "score": "0.5821118", "text": "function Flutterer() {\n let req = AsyncRequest(\"/api/floots\");\n req.setSuccessHandler(function(response){\n let floots = JSON.parse(response.getPayload());\n let actions = {\n switchUser : function(user_switched_to) {\n GetApiFlootsAndReRender(user_switched_to, actions, null);\n },\n createFloot : function(message, username) {\n let reqpost1 = AsyncRequest(\"/api/floots\");\n reqpost1.setMethod(\"POST\");\n reqpost1.setPayload(JSON.stringify({\n username : username,\n message : message,\n }));\n reqpost1.setSuccessHandler(function(){\n GetApiFlootsAndReRender(username, actions, null);\n });\n reqpost1.send();\n },\n deleteFloot : function(floot_id, username){\n let reqpost2 = AsyncRequest(\"/api/floots/\" + floot_id + \"/delete\");\n reqpost2.setMethod(\"POST\");\n reqpost2.setPayload(JSON.stringify({\n username : username,\n }));\n reqpost2.setSuccessHandler(function(){\n GetApiFlootsAndReRender(username, actions, null);\n });\n reqpost2.send();\n },\n openFlootInModal : function(username, actions, flootObject){\n GetApiFlootsAndReRender(username, actions, flootObject);\n },\n closeModal : function(username, actions){\n GetApiFlootsAndReRender(username, actions, null);\n },\n createComment : function(floot_id, message, username, actions){\n let reqpost3 = AsyncRequest(\"/api/floots/\" + floot_id + \"/comments\");\n reqpost3.setMethod(\"POST\");\n reqpost3.setPayload(JSON.stringify({\n username : username,\n message : message,\n }));\n reqpost3.setSuccessHandler(function(){\n let reqget = AsyncRequest(\"/api/floots/\" + floot_id);\n reqget.setSuccessHandler(function(response){\n let flootPayload = JSON.parse(response.getPayload());\n actions.openFlootInModal(username, actions, flootPayload);\n });\n reqget.send();\n });\n reqpost3.send();\n },\n deleteComment : function(floot_id, comment_id, username, actions){\n let reqpost4 = AsyncRequest(\"/api/floots/\" + floot_id + \"/comments/\" + comment_id + \"/delete\");\n reqpost4.setMethod(\"POST\");\n reqpost4.setPayload(JSON.stringify({\n username : username,\n }));\n reqpost4.setSuccessHandler(function(){\n let reqget = AsyncRequest(\"/api/floots/\" + floot_id);\n reqget.setSuccessHandler(function(response){\n let flootPayload = JSON.parse(response.getPayload());\n actions.openFlootInModal(username, actions, flootPayload);\n });\n reqget.send();\n });\n reqpost4.send();\n },\n };\n document.body.appendChild(MainComponent(USERS[0], floots, actions, null));\n });\n req.send();\n\n function reRenderMainComponent(user, response, actions, selectedFloot){\n let floots = JSON.parse(response.getPayload());\n while (document.body.lastChild !== null){\n document.body.removeChild(document.body.lastChild);\n }\n document.body.appendChild(MainComponent(user, floots, actions, selectedFloot));\n }\n function GetApiFlootsAndReRender(user, actions, selectedFloot){\n let request = AsyncRequest(\"/api/floots\");\n request.setSuccessHandler(function(response){\n reRenderMainComponent(user, response, actions, selectedFloot);\n })\n request.send();\n }\n // TODO: Implement this function, starting in Milestone 2\n}", "title": "" }, { "docid": "74e1ad4981dc59fa1f12b426316efc4f", "score": "0.58064634", "text": "function APIHandler(req, res){\n // call request module;\n res.writeHead(200, {'content-type': 'application/json'});\n\n async.parallel([\n ourrequest.weatherRequest,\n ourrequest.roadRequest,\n ourrequest.newsRequest\n ], function(err, results){\n var data = {\n weather: results[0],\n road: results[1],\n news: results[2]\n }\n res.end(JSON.stringify(data));\n })\n}", "title": "" }, { "docid": "6b39928a56965c2130a41fe5e1f01298", "score": "0.5795594", "text": "function main(params) {\n var name = params.name || params.payload || 'stranger';\n // openwhisk's api-gateway may populate context.identity\n // based on the info coming from an OAuth Token\n if( params.context !== null && typeof(params.context) !== \"undefined\"\n && params.context.identity !== null ) {\n name = params.context.identity.user_id;\n }\n\n var place = params.place || 'Sandeep-1';\n \n var options = {\n host: 'action.webscript.io',\n path: '/ping'\n };\n\n callback = function(response) {\n response.on('data', function (chunk) {\n });\n\n response.on('end', function () {\n console.log(\"done\");\n });\n}\n\nhttp.request(options, callback).end();\n \n return {\n payload: 'Hello, ' + name + ' from ' + place + ' !',\n event: params\n };\n}", "title": "" }, { "docid": "516577eefadb29029e3ca2cfa204a7d9", "score": "0.5795208", "text": "function resultGenerator() {\n const ZipCode = document.getElementById(\"zip\").value;\n const feeling = document.getElementById(\"feelings\").value;\n contactAPI(url, ZipCode, APIKey).then(function (data) {\n console.log(data);\n postData(\"/add\", {\n name: data.name,\n date: newDate,\n temp: data.main.temp,\n content: feeling,\n });\n updateUI();\n });\n}", "title": "" }, { "docid": "a829a89a7a618962b656dc44edb5279b", "score": "0.5791228", "text": "function marantzAPI(commands, apiCallback) {\n var postData = {};\n \n // always add this guy\n commands.push('aspMainZone_WebUpdateStatus/');\n \n // format commands for the Marantz POST (cmd0: cmd1: etc)\n // note: may need to send commands one at a time??\n for (var i=0; i<commands.length; i++) {\n postData['cmd' + i] = commands[i];\n }\n \n log('DEBUG', `MarantzAPI Called w Data: ` + qs.stringify(postData));\n \n var serverError = function (e) {\n log('Error', e.message);\n apiCallback(false, e.message);\n }; \n \n var apiRequest = http.request({\n hostname: process.env.receiverIp,\n path: '/MainZone/index.put.asp',\n port: process.env.receiverPort,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': Buffer.byteLength(qs.stringify(postData))\n },\n }, function(response) {\n \n response.setEncoding('utf8');\n response.on('data', function (chunk) {\n //log('DEBUG', 'CHUNK RECEIVED');\n });\n \n response.on('end', function () {\n log('DEBUG', `API Request Complete`);\n apiCallback(true, '');\n }); \n\n response.on('error', serverError); \n });\n\n apiRequest.on('error', serverError);\n apiRequest.write(qs.stringify(postData));\n apiRequest.end(); \n}", "title": "" }, { "docid": "79fea4b9664d2f984d317170d8a6fa7a", "score": "0.57825786", "text": "function mapi(classname,methodname,data,callback) {\n data = typeof data !== 'undefined' ? data : {}; // default\n \n console.debug('[mapi]',classname,methodname);\n \n // We need to set some POST data, otherwise routing will fail.\n data._moxycart = Math.random()*10000000000000000;\n // Ajax post\n var url = controller_url(classname,methodname); \n jQuery.post(url, data, function( response ) {\n console.debug(response);\n if(response.status == 'fail') {\n console.log(response.data.errors);\n var msg = 'Error:<br/>';\n for(var fieldname in response.data.errors) {\n msg = msg + response.data.errors[fieldname] + '<br/>';\n }\n return show_error(msg); \n }\n else if (response.status == 'success') {\n show_success(response.data.msg);\n if (callback != void 0) {\n callback(response);\n }\n }\n },'json')\n .fail(function() {\n console.error('[mapi] post to %s failed', url);\n return show_error('Request failed.');\n });\n}", "title": "" }, { "docid": "f87acec69e7b77ff2f093fabc3ce3756", "score": "0.57704043", "text": "function postDataToMatch(key, data, allowedReaders, successCallback, errorCallback)\n{\n //create the json object that represents this request\n var request = {\n \"FunctionName\": \"PostDataToMatch\",\n \"Username\":username,\n \"Password\":password,\n \"SessionKey\": sessionKey,\n \"AppName\": appName,\n \"MatchKey\": matchKey,\n \"AllowedReaders\": allowedReaders,\n \"Key\": key,\n \"Data\": data\n };\n sendAjaxRequest(\"POST\", JSON.stringify(request), buildDefaultCallback(successCallback, errorCallback), false);\n}", "title": "" }, { "docid": "e9a45ce09740386b59c6af3ed9c4b53f", "score": "0.57686186", "text": "function postDataToAPI(apiString, data, params) {\n //$log.logDebug(serviceId + ' postDataToAPI', 'Executing [apiString: %s, data: %s, params: %s ]', [apiString, JSON.stringify(data), JSON.stringify(params)]);\n debugger;\n \n vm.apiString = apiString;\n return $http.post(apiString, data, params)\n .then(onAPIDataFetchComplete)\n .catch(onAPIDataFetchFailed);\n\n // success\n function onAPIDataFetchComplete(response) {\n //$log.logDebug(serviceId + ' postDataToAPI', 'Received response from API [response: %s ]', [JSON.stringify(response)]);\n\n return response;\n }\n\n // fail\n function onAPIDataFetchFailed(error) {\n //$log.logError(serviceId + ' postDataToAPI', 'XHR Failed for api call %s %s', [vm.apiString, error]);\n return error;\n }\n }", "title": "" }, { "docid": "e5e4f97b8262c225de969777b136aa21", "score": "0.57674164", "text": "async postFields(values) {\n var data = \"api_key=\" + this.writeKey + values;\n\n const response = await fetch(this.url, {\n method: 'POST',\n mode: 'cors',\n cache: 'no-cache',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: data\n });\n return await response.json();\n }", "title": "" }, { "docid": "4d67b87e855de032c5937a79f504163f", "score": "0.57612634", "text": "function submitFeedBack()\r\n {\r\n\r\n var obj = Array.from(document.querySelectorAll('.form-group input')).reduce((acc,input)=>({...acc,[input.name]:input.value}),{});\r\n var autho = localStorage.getItem(\"auth\");\r\n if(autho==null)\r\n {\r\n alert(\"You are not logged in\");\r\n }\r\n else{\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.open(\"POST\", \"http://35.184.138.248.xip.io:8000/api/testimonial/\", true); \r\n xhttp.setRequestHeader(\"Content-Type\", \"application/json\");\r\n xhttp.setRequestHeader(\"Authorization\", \"Token \"+autho);\r\n xhttp.onload = function(){\r\n console.log(xhttp);\r\n if(xhttp.status>=200 && xhttp.status<400)\r\n {\r\n alert(\" Congratulations!! Verification mail has been sent to your registered mail-id.\");\r\n window.location.href= \"events.html\";\r\n // alert(obj2.detail); \r\n }\r\n else{\r\n console.log(\"We connected to the server, but it returned an error.\");\r\n console.log(xhttp);\r\n var msg=\"\";\r\n var obj2 = JSON.parse(xhttp.responseText);\r\n if('client_name' in obj2)\r\n msg+=\"Name may not be blank.\"+\"\\n\";\r\n if('rating' in obj2)\r\n msg+=\"A valid Integer is required in Rating Field\"+\"\\n\";\r\n if('organisereventid' in obj2)\r\n msg+=\"Id may not be blank\"+\"\\n\";\r\n if('description' in obj2)\r\n msg+=\"Desfription may not be blank\"+\"\\n\";\r\n alert(msg);\r\n }\r\n };//onload ends\r\n xhttp.send(JSON.stringify(obj));\r\n }// else ends\r\n }// fun ends", "title": "" }, { "docid": "7f0da1f0af466bf13b1f6fa6eda83a3d", "score": "0.5755333", "text": "submit(data) {\n return this.context.getTokens().then(tokens => {\n if (tokens.username && tokens.username !== \"guest\") {\n let apiService = new ApiService(\n \"https://vgzft54oy9.execute-api.us-west-2.amazonaws.com\",\n tokens\n );\n var myInit = {\n body: {\n data: data\n }\n };\n return apiService\n .post(\"/prod/feedback\", myInit.body)\n .then(response => {\n return response;\n })\n .catch(error => {\n throw error;\n });\n }\n });\n }", "title": "" }, { "docid": "3352b6dc2feeb9583371b1d261507a87", "score": "0.575476", "text": "async function main (params) {\n // create a Logger\n const logger = Core.Logger('main', { level: params.LOG_LEVEL || 'info' })\n\n try {\n // 'info' is the default level if not set\n logger.info('Calling the main action')\n\n // log parameters, only if params.LOG_LEVEL === 'debug'\n logger.debug(stringParameters(params))\n\n if (params.challenge) {\n return { body: { challenge: params.challenge } }\n }\n\n // check for missing request input parameters and headers\n const requiredParams = ['event']\n const requiredHeaders = []\n const errorMessage = checkMissingRequestInputs(params, requiredParams, requiredHeaders)\n if (errorMessage) {\n // return and log client errors\n return errorResponse(400, errorMessage, logger)\n }\n\n // NOTE: please customize the following lines based on the event object data type you receive from I/O Events\n const eventDetail = params.event['activitystreams:object']\n \n const slackMessage = params.event['@type'] + \" Event for: \" + eventDetail['xdmAsset:asset_name'] + \" at \" + eventDetail['xdmAsset:path']\n \n const payload = {\n channel: slackChannel,\n username: 'incoming-webhook',\n text: slackMessage,\n mrkdwn: true\n }\n \n var slackOpts = {\n method: 'POST',\n headers: {\n 'Cache-Control': 'no-cache',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }\n\n await fetch(slackWebhook, slackOpts)\n\n const response = {\n statusCode: 200,\n body: { message: 'posted to slack' }\n }\n\n // log the response status code\n logger.info(`${response.statusCode}: successful request`)\n return response\n } catch (error) {\n // log any server errors\n logger.error(error)\n // return with 500\n return errorResponse(500, 'server error', logger)\n }\n}", "title": "" }, { "docid": "684ccb0066fb0bf92343b914a28090d3", "score": "0.57440156", "text": "function performAction(event) {\r\n //Select user feelings value of an input by user to include in POST\r\n const userFeelings = document.querySelector('#feelings').value;\r\n // zip code element value by user\r\n const userZip = document.querySelector('#zip').value;\r\n\r\n // Errors checks on user input\r\n // to check if the length entered by user equal to 5 digits as the default response from openweather API for USA countries\r\n if (!Number.isInteger(Number(userZip)) || userZip.length != 5) {\r\n alert('Zip Code Error: it is empty or incorect. Please Check the code!\\nCode Consists of 5 digits');\r\n return;\r\n }\r\n // to check the user input field feelings if least than 3 letters\r\n if (userFeelings.length < 3) {\r\n alert('Please, add some description! \\natleast 3 letters');\r\n return;\r\n }\r\n // API CALL \r\n getWeatherApi(apiUrl, userZip, myApiKey)\r\n .then((data) => {\r\n console.log(data);\r\n // as mentioned in the API Documentaion to extract temp data it's inside main list and use it's Property accessors to get data list main.temp\r\n // Add data to POST request\r\n postData('/add', { date: currentDate, temp: data.list[0].main.temp, content: userFeelings })\r\n // just to call updateUI in the .then() method not out of it, and to be invoked after the postData() returns.\r\n updateUI();\r\n })\r\n}", "title": "" }, { "docid": "a31f93865ef4424d610a68c37b567852", "score": "0.57433337", "text": "function main(){\n\tDBUtils.getPosts()\n .then(function(postList){\n\t\t\n\t\tpostList.forEach(function(element) {\n\t\t\tGoogl.shorten(element.link)\n\t\t\t\t.then(function(shortLink){\n\t\t\t\t\tvar msg = element.content + \" \" + shortLink;\n\t\t\t\t\tpost(msg, function(data){\n\t\t\t\t\t\ttwitterPoster.post(data);\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.catch(function(error){\n\t\t\t\t\tconsole.log(error.message);\n\t\t\t\t});//end of: Googl\n\t\t\tDBUtils.updatePost(element.link);\t\t\n\t\t}, this);//end of: forEach postList\n })\n .catch(function(error){\n console.log(error);\n });//end of: getPosts\n}", "title": "" }, { "docid": "ffed3a40e56c55545e49dbf16c062ee5", "score": "0.5739553", "text": "function newCommentFunc(a,b,c) { // newCommentFunc(commentid,newCommentData.value,data)\r\n //console.log('a: ' + a);\r\n //console.log('b: ' + b);\r\n //console.log(c);\r\n fetch('/commentsubmit', { // app.js has app.post('/commentsubmit', (request, response)\r\n method: 'POST',\r\n headers: {\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json'\r\n },\r\n //body: JSON.stringify({ hi: 'hello' }), // stringify JSON\r\n //make sure to serialize your JSON body\r\n body: JSON.stringify({\r\n id: a,\r\n comments: b\r\n })\r\n });\r\n \r\n }", "title": "" }, { "docid": "778159b5da39e9e2cd943b4a3c07ba3f", "score": "0.5719041", "text": "function post(user_information) {\n\n\t}", "title": "" }, { "docid": "1ffe7bbb3dae89e8e1c7c67fe24fe4eb", "score": "0.57156414", "text": "function postFactory ({path: resPath, domain, token, data, funcMode, headers}) {\n function post({state, resolve, path, websocket}) {\n return Promise.resolve().then(() => {\n //Remove the path if we are running in function mode, so paths in original action work\n let _path = (funcMode) ? null : path;\n //Resolve path, domain, and token values if they are tags\n let _resPath = resolve.value(resPath);\n let _domain = resolve.value(domain) || state.get('Connections.oada_domain');\n let _token = resolve.value(token) || state.get('Connections.oada_token')\n //Resolve data value or values if they are tags\n let _data = (resolve.isTag(data)) ? resolve.value(data) : data;\n if (_.isObject(_data)) _data = _.mapValues(_data, (value) => {return resolve.value(value)});\n //Resolve headers value or values if they are tags\n let _headers = resolve.isTag(headers) ? resolve.value(headers) : headers;\n if (_.isObject(_headers)) _headers = _.mapValues(_headers, (value) => {return resolve.value(value)});\n /*\n - Execute post -\n Use axios if our websocket isn't configured, or isn't configured for the\n correct domain\n */\n if (_resPath == null) throw new Error('`path` is required to post.');\n if (_data == null) throw new Error('`data` is required to post.');\n let url = _domain+_resPath;\n let request = (websocket === null || websocket.url() !== _domain) ? axios : websocket.http;\n return request({\n method: 'POST',\n url: url,\n headers: _.merge({Authorization: 'Bearer '+_token}, _headers),\n data: _data\n\t\t\t}).then((response) => {\n\t\t\t\tconsole.log(response)\n\t\t\t\treturn db.put(_resPath+response.headers.location.replace(/^\\/resources\\//, ''), _data).then((response) => {\n \t\t\t\tconsole.log(response)\n if (_path) return _path.success({response});\n\t\t\t\t\treturn {response};\n\t\t\t\t})\n }).catch((error) => {\n console.log('err', error);\n if (_path) return _path.error({error});\n throw error;\n });\n });\n }\n return post\n}", "title": "" }, { "docid": "63508eeae3392766a7127edb23aca594", "score": "0.571388", "text": "function submitHandler() {\n // prevent sending invalid images to the api\n if (!dropZone.getAttribute('data-valid')) {\n io3d.utils.ui.message('image is not valid')\n return false;\n }\n // start API request\n apiInfoEl.innerHTML = 'Sending API request...<br>'\n convertFloorPlanTo3d(floorPlanEl.value, addressEl.value, emailEl.value).then(function onSuccess(res) {\n apiInfoEl.innerHTML += 'Sending request success. conversionId: ' + res.result.conversionId + '<br>'\n }).catch(function onError(error) {\n apiInfoEl.innerHTML += 'Sending request failed:' + JSON.stringify(error, null, 2)\n apiInfoEl.innerHTML += '<br>Check your email for details'\n })\n return false;\n}", "title": "" }, { "docid": "d216e906c5d4bd38351a5f8e011277e8", "score": "0.57120854", "text": "request(data) {\n try {\n switch(data.dataType.trim()) {\n case \"authentication\" :\n this.authentication(data);\n break;\n case \"command\" :\n this.command(data);\n break;\n case \"acknowledge\" :\n this.acknowledgement(data);\n break;\n case \"result\" :\n this.result(data);\n break;\n }\n } catch (err) {\n console.error(\"Error processing request\");\n console.error(err);\n }\n }", "title": "" }, { "docid": "d4c0eda7405d856789f744f2232da274", "score": "0.57017106", "text": "async function postData(data) {\n //http:3004/postInfo\n let response = await fetch(`${apiUrl}/postInfo`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(data)\n });\n}", "title": "" }, { "docid": "863b79b86043cf42118c5041d5ddf916", "score": "0.5701369", "text": "_parseRequest() {\n let request = this.result.request;\n let response = this.result.response;\n let content = this.result.content;\n\n this.path = this._getApiPath();\n this.event = this._getGameEvent();\n\n this.method = {\n POST: T.Map(qs.parse((request.postData ? request.postData.text : '')) || {})\n .filterNot((v, k) => (k.includes('api_token') || k.includes('api_verno'))).toJS(),\n GET: this._parseDataBody(content)\n };\n }", "title": "" }, { "docid": "c041cd5d5e6a889f192d727effb5ea68", "score": "0.5698601", "text": "function ApiConnector(){\n\n}", "title": "" }, { "docid": "5ad6fb7d6f8be9359dfad97efb587197", "score": "0.56971484", "text": "async function postData(url = '', data = {}) {\n// Default options are marked with *\nconst response = await fetch(url, {\nmethod: 'POST', \nmode: 'cors', \ncache: 'no-cache', \ncredentials: 'same-origin', \nheaders: {\n 'Content-Type': 'application/json',\n \"Authorization\" : 'Bearer '+ getLocalToken()\n},\nbody: JSON.stringify(data)\n});\nreturn await response.json(); \n}", "title": "" }, { "docid": "e2dcf8fa3b9d6a46088a4d4114adfbea", "score": "0.56865233", "text": "function post_request( url, data, post_response_function ) {\n fetch( url, { body: JSON.stringify( data ),\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" } \n } )\n .then( post_response_function );\n}", "title": "" }, { "docid": "6ec7c31194c496fb80d54cff10720491", "score": "0.5686319", "text": "function futapi() {\n }", "title": "" }, { "docid": "415e0a14e0d3af0c0d08e3004d7de98e", "score": "0.5675884", "text": "function doApiCall(callback, level=\"list\", idInk=0, prefix=\"\"){\n console.log(\"doApiCall\");\n var APIFunk = {\n headerParam:\"application/x-www-form-urlencoded\",\n holdOrderForLater:\"\",\n phpProg:\"\",\n parms:\"\",\n\n xhttp:\"\",\n returnVal:\"\",\n outData:\"\",\n idIn:idInk,\n prefx:prefix,\n setupCall: function(){\n switch(level){\n case \"list\": APIFunk.setParms(\"apiProductList\", \"\");\n break;\n case \"product\": APIFunk.setParms(\"apiProduct\", \"ID=\" + this.idIn);\n break;\n case \"variant\": APIFunk.setParms(\"apiVariant\", \"ID=\" + this.idIn);\n break;\n case \"files\": APIFunk.setParms(\"apiETC\", \"path=files&ID=\" + this.idIn);\n break;\n case \"estimate\": APIFunk.setParms(\"apiOrderEstimate\", JSON.stringify(this.idIn).replace(/{/g, \"[~\").replace(/}/g,\"~]\"));\n this.holdOrderForLater = this.parms;\n break;\n case \"order\": APIFunk.setParms(\"apiOrder\", this.holdOrderForLater);\n this.holdOrderForLater = \"\";\n break;\n case \"countries\": APIFunk.setParms(\"apiCountries\", \"\");\n break;\n };\n },\n setParms:function(phpP, parmsIN){\n if(this.prefx) phpP = this.prefx + phpP.substring(0,1).toUpperCase() + phpP.substring(1);\n this.phpProg = \"cgi-bin/\" + phpP + \".php\";\n console.log(this.phpProg);\n this.parms = parmsIN;\n console.log(this.parms);\n },\n xhttpSend:function(){\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200){\n this.outData = this.responseText;\n if (this.outData.indexOf(\"Exception\") < 0)\n if(typeof(callback) == 'function'){ callback(this.outData); }\n returnVal = 0;\n }\n else\n returnVal = this.status;\n };\n xhttp.open(\"POST\", this.phpProg, true);\n xhttp.setRequestHeader(\"Content-Type\", this.headerParam);\n xhttp.send(this.parms);\n }\n };\n return APIFunk;\n}", "title": "" }, { "docid": "29902604eff067ae917b02d47a292f8e", "score": "0.5662741", "text": "function Action(event){\n //using text box to extract input...\n //and the weather api to extract the tempreatures (in kelvin)...\n\n const location = document.getElementById('zip').value; //if zipcode is not valid console would output it that 404 city not found...\n const feelings= document.getElementById('feelings').value;\n weather(API, location , APIKey)\n .then(function(data){\n console.log(data); //just making sure that data contains all the json data we got from the API...\n\n postData('/addData',{date:newDate, tempreature:data.main.temp ,feelings})\n })\n .then(function(){\n UIupdate();\n\n })\n }", "title": "" }, { "docid": "0112d336c12edf7830c78afbb6d89e55", "score": "0.5647068", "text": "function tweetit(){\n//create a random number \nvar r = Math.floor(Math.random()*99)\nvar tweet = { status: \"Hello , I am a bot!!\" + r +\"i am posting status for testing!!\" };\n\n// a simple post request\nT.post('statuses/update',tweet, gotData );\n\n//a function\nfunction gotData(err, data, response){\n // console.log(data);\n if(err){\n \tconsole.log(err);\n }\n\n console.log(\"It worked!!\");\n }\n}", "title": "" }, { "docid": "2a3347f0f580c27b24c3ab797431e54b", "score": "0.5642408", "text": "async function submit(event) {\n event.preventDefault();\n let item = { user: { username, password, email } }; //Storing value of username,password and email in item\n // eslint-disable-next-line no-console\n console.warn(item);\n\n // Fetching the api\n try {\n let result = await fetch('https://conduit.productionready.io/api/users', {\n method: 'POST', //Using post method\n\n body: JSON.stringify(item),\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n },\n });\n console.warn('result', result);\n } catch (err) {\n console.log(err);\n alert(err);\n }\n }", "title": "" }, { "docid": "0fbcf4535c2686aee0b313463dbe3f21", "score": "0.5638641", "text": "async function main(params) {\n // create a Logger\n const logger = Core.Logger('main', { level: params.LOG_LEVEL || 'info' });\n\n try {\n // 'info' is the default level if not set\n logger.info('Calling the main action');\n\n // log parameters, only if params.LOG_LEVEL === 'debug'\n logger.debug(stringParameters(params));\n\n // check for missing request input parameters and headers\n const requiredParams = ['apiKey', 'providerId', 'eventCode', 'payload'];\n const requiredHeaders = ['Authorization', 'x-gw-ims-org-id'];\n const errorMessage = checkMissingRequestInputs(params, requiredParams, requiredHeaders);\n if (errorMessage) {\n // return and log client errors\n return errorResponse(400, errorMessage, logger);\n }\n\n // extract the user Bearer token from the Authorization header\n const token = getBearerToken(params);\n\n // initialize the client\n const orgId = params.__ow_headers['x-gw-ims-org-id'];\n const eventsClient = await Events.init(orgId, params.apiKey, token);\n\n // Create cloud event for the given payload\n const cloudEvent = createCloudEvent(params.providerId, params.eventCode, params.payload);\n\n // Publish to I/O Events\n const published = await eventsClient.publishEvent(cloudEvent);\n let statusCode = 200;\n if (published === 'OK') {\n logger.info('Published successfully to I/O Events');\n } else if (published === undefined) {\n logger.info('Published to I/O Events but there were not interested registrations');\n statusCode = 204;\n }\n const response = {\n statusCode: statusCode\n };\n\n // log the response status code\n logger.info(`${response.statusCode}: successful request`);\n return response;\n } catch (error) {\n // log any server errors\n logger.error(error);\n // return with 500\n return errorResponse(500, 'server error', logger);\n }\n}", "title": "" }, { "docid": "609efa70f99b322514e7e9f690ef9180", "score": "0.5636463", "text": "function handlePost() {\n\t\n\t\n\tvar bodyStr = $.request.body ? $.request.body.asString() : undefined;\n\tif ( bodyStr === undefined ){\n\t\t $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n\t\t return {\"myResult\":\"Missing BODY\"};\n\t}\n\t// Extract body insert data to DB and return results in JSON/other format\n\t$.response.status = $.net.http.CREATED;\n return {\"myResult\":\"POST success\"};\n\t\n\t\n}", "title": "" }, { "docid": "3809c7cc0f07dd901c315c092c38f546", "score": "0.5636229", "text": "function SendToParse(callback){\n console.log(\"POST Method for SendToParse Triggering\");\n var options = { method: 'POST',\n url: 'https://api.infermedica.com/v2/parse',\n headers:\n { 'postman-token': '785d8d42-c9fd-b137-d1da-e44cfa4d64f1',\n 'cache-control': 'no-cache',\n 'app-id': 'd4f32ee4',\n 'app-key': '78a4f3c44ee2ba85ca74c6fdee95828d',\n 'content-type': 'application/json' },\n body: { text: global.symptomString, include_tokens: false },\n json: true };\n\n request(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n //console.log(body);\n console.log(body);\n global.parsedBody=body;\n callback(global.parsedBody);\n });\n}//GET DISEASE ID", "title": "" }, { "docid": "010e35a0e6cd87fb0dfe96b76a4e8e2b", "score": "0.56333894", "text": "function postData(data){\n var req = new XMLHttpRequest();\n //step 1: create a new document\n req.open('POST', spi, true);\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('Authorization', 'Basic aWxpZmU6aWxpZmU=');\n req.setRequestHeader('Api-Key', 'foobar');\n req.onreadystatechange = function() {\n if (req.readyState === 4) {\n if (req.status >= 200 && req.status < 400) {\n if(debug)console.log(JSON.parse(req.responseText));\n } else {\n // Handle error case\n }\n if(itemCollected >= itemCount){//判定是否已采集完成,如果已完成则进入下一页\n var delayMills = 1000+Math.floor(Math.random() * 3000);//注意:需要控制采集频率\n //if(!debug)setTimeout(goNextPage,delayMills);\n }\n }\n };\n data._key = hex_md5(data.url);\n try{\n req.send(JSON.stringify(data));//post data\n }catch(e){\n if(debug)console.log(\"Error while post data to create new document.\"+e);\n }\n}", "title": "" }, { "docid": "60f0ff544d229e831029a2f959a1da29", "score": "0.5632226", "text": "function BasePostAction(postName){\n console.log(\"Got a post request!\")\n\n if(postName == \"PizzaTime\")\n PizzaTime()\n}", "title": "" }, { "docid": "155bc51d135c1df2197ac4472c19556c", "score": "0.56315446", "text": "async post(url, data) {\n const response = await fetch(url, {\n method: 'POST',\n headers: ({\n 'Authorization': 'Bearer xoxb-1636459842405-1639851457203-VrgV4WRG7itjOl1d2AzKaEUP',\n \n 'Content-Type': 'application/json'\n \n }),\n \n body: JSON.stringify({channel:\"C01KHBU4UJU\", text:`${this.postcode}\\n ${this.city}`})\n });\n const resData = await response.json();\n return resData;\n }", "title": "" }, { "docid": "b98b6206c3ec44bf5dab4371ab771b03", "score": "0.5630421", "text": "function doPost(purl, pdata, callback, errCallback)\n{ \n doChangeReq(purl, pdata, callback, errCallback,'POST');\n}", "title": "" }, { "docid": "39d8a11f0453c94382a2df38b3c0cbb9", "score": "0.56259906", "text": "function main() {\n \n // Set access token and user id for example calls\n var accessToken = '';\n\n // Template callback\n var callback = function(message) {\n if (message) console.log(message);\n }\n \n /*\n * Example usage of registerUser \n *\n * registerUser(accessToken).then(callback, callback);\n */\n\n /* Example usage of getInitialJukeboxState\n *\n * getInitialJukeboxState(accessToken).then(callback, callback);\n */\n}", "title": "" }, { "docid": "803b2ce40dc0a80f9bb42303f17c9991", "score": "0.56242347", "text": "async function dataAggregator (event) {\n \n // Get input from the form field and save into variables & save to local storage\n const destination = document.getElementById('destination').value;\n localStorage.setItem('dest_server', destination); \n\n const traveldate_string = document.getElementById('traveldate').value;\n travelData.traveldate_string = traveldate_string\n const traveldate_split = traveldate_string.split('/');\n const traveldate_st = traveldate_split[2] + '-' + traveldate_split[1] + '-' + traveldate_split[0]; \n const traveldate = new Date(traveldate_st); \n localStorage.setItem('date_server', traveldate_string); \n\n // Assign Values to JS Object\n travelData.destination = destination; \n travelData.traveldate = traveldate;\n \n // Get Countdown\n const countdown = counter(traveldate); \n \n travelData.countdown = countdown + 1; \n\n // Get lat & long\n const geoApiRes = await geoApi(destination);\n\n travelData.lat = geoApiRes.lat; \n console.log(travelData.lat); \n\n travelData.long = geoApiRes.long; \n console.log(travelData.long); \n\n travelData.ctry = geoApiRes.ctry; \n \n // Get Image\n const pixabayApiRes = await pixabayApi (destination); \n console.log(pixabayApiRes); \n travelData.img = pixabayApiRes.webformatURL; \n\n // Get weather\n const weatherbitApiRes = await weatherbitApi(travelData.lat, travelData.long, travelData.countdown); \n\n travelData.weather = weatherbitApiRes; \n travelData.temp = JSON.stringify(weatherbitApiRes.temp); \n travelData.description = weatherbitApiRes.weather.description; \n \n async function postData (list = {destination: travelData.destination, traveldate: travelData.traveldate, countdown: travelData.countdown,\n description: travelData.description, temperature: travelData.temp, img: travelData.img}) {\n const postDataRes = await fetch('http://localhost:8081/save'); \n const newTravel = await postDataRes.json();\n return newTravel; \n }; \n\n uiUpdater(travelData); \n}", "title": "" }, { "docid": "ca26880cc37ded1471030382d6d062dd", "score": "0.5622782", "text": "function scheduleCreateUtil(){\n\n\n\n /**\n * Sends the schedule create request to REST\n * @param {number} selected_vehicle Id of vehicle\n * @param {number} selected_user Id of user\n * @author Dennis Sakaki Fujiki\n */\n function postSchedule(selected_user, selected_vehicle){\n\n // *Retrieving the values of the all fields:\n let text_reason = $('#schedule-create-reason').val();\n let date_startdate = $('#schedule-create-start-date').val();\n let time_starttime = $('#schedule-create-start-time').val();\n let date_enddate = $('#schedule-create-end-date').val();\n let time_endtime = $('#schedule-create-end-time').val();\n\n // *Joining date and time:\n let start_date_time = date_startdate + ' ' + time_starttime;\n let end_date_time = date_enddate + ' ' + time_endtime;\n\n // *Saving all values in a object_data:\n let object_data = {\n id_vehicle_fk: selected_vehicle,\n id_user_fk: selected_user,\n reason: text_reason,\n start_date: start_date_time,\n end_date: end_date_time\n };\n\n // *Sending a request to book this schedule:\n request.postSchedule(object_data)\n .done(data => {\n // *Showing the snack with the message:\n snack.open(srm.get('schedule-create-successful-snack'), snack.TIME_SHORT);\n // *Sending the user to the booking page with the schedule info:\n spa.navigateTo('schedules', {id: selected_vehicle, date: date_startdate});\n })\n .fail(xhr => {\n // *Checking if the request's status is 401, sending the user to the login page if it is:\n if(xhr.status === 401){\n spa.navigateTo('login');\n return;\n }\n let text = {title: '', message: ''};\n\n // *Checking the error code:\n switch(xhr.responseJSON.err_code){\n // *Case when the user or the vehicle referenced doesn't exist:\n case 'ERR_REF_NOT_FOUND':\n text.title = srm.get('schedule-create-dialog-error-ref-title');\n text.message = srm.get('schedule-create-dialog-error-ref-message');\n break;\n\n // *Case there is some required field not filled:\n case 'ERR_MISSING_FIELD':\n text.title = srm.get('schedule-create-dialog-error-missing-field-title');\n text.message = srm.get('schedule-create-dialog-error-missing-field-message');\n break;\n\n // *Case the informed schedule period isn't avaible:\n case 'ERR_INVALID_TIMESPAN':\n text.title = srm.get('schedule-create-dialog-error-timespan-title');\n text.message = srm.get('schedule-create-dialog-error-timespan-message');\n break;\n\n // *Case the vehicle isn't avaible in the specified period:\n case 'ERR_RES_UNAVAILABLE':\n text.title = srm.get('schedule-create-dialog-error-unavailable-title');\n text.message = srm.get('schedule-create-dialog-error-unavailable-message');\n break;\n\n // *Case the vehicle isn't active:\n case 'ERR_VEHICLE_NOT_ACTIVE':\n text.title = srm.get('schedule-create-dialog-error-vehicle-not-active-title');\n text.message = srm.get('schedule-create-dialog-error-vehicle-not-active-message');\n break;\n\n // *Case the user isn't active:\n case 'ERR_USER_NOT_ACTIVE':\n text.title = srm.get('schedule-create-dialog-error-user-not-active-title');\n text.message = srm.get('schedule-create-dialog-error-user-not-active-message');\n break;\n\n // *Case the user isn't authorized:\n case 'ERR_NOT_AUTHORIZED':\n text.title = srm.get('schedule-create-dialog-error-not-authorized-title');\n text.message = srm.get('schedule-create-dialog-error-not-authorized-message');\n break;\n\n default:\n text.title = srm.get('schedule-create-dialog-error-default-title');\n text.message = srm.get('schedule-create-dialog-error-default-message');\n break;\n }\n\n // *Open a dialog notice for the user:\n dialogger.open('default-notice', text);\n });\n }\n\n\n\n /**\n * Update the vehicle info\n * @param {number} vehicle_id id the vehicle\n * @author Ralf Pablo Braga Soares\n */\n function updateVehicleInfo(vehicle_id){\n\n // *Replacing the vehicle in app bar:\n request.getVehicle(vehicle_id)\n .done(data => {\n\n // *Setting the vehicle's photo:\n $('#schedule-create-vehicle-photo').css('background-image', data.photo?'url(' + rest_url + '/media/v/p/' + data.photo + ')':'');\n\n // *Setting the vehicle's title and plate:\n $('#schedule-create-vehicle-title').text(data.title + \" - \" + data.plate);\n\n // *Setting the vehicle's year and manufacturer:\n $('#schedule-create-vehicle-description').text(data.year + \" - \" + data.manufacturer);\n })\n .fail(xhr => {\n // *Checking if the request's status is 401, sending the user to the login page if it is:\n if(xhr.status === 401){\n spa.navigateTo('login');\n return;\n }\n console.log(xhr.responseJSON);\n });\n }\n\n\n\n /**\n * Update the user info\n * @param {number} user_id id the user\n * @author Ralf Pablo Braga Soares\n */\n function updateUserInfo(user_id){\n\n // *Replacing the user in app bar:\n request.getUser(user_id)\n .done(data => {\n\n // *Setting the user's photo:\n $('#schedule-create-user-photo').css('background-image', data.photo?'url(' + rest_url + '/media/u/p/' + data.photo + ')':'');\n\n // *Setting the User name:\n $('#schedule-create-user-name').text(data.name);\n\n // *Setting the user's login:\n $('#schedule-create-user-login').text(data.login);\n })\n .fail(xhr => {\n // *Checking if the request's status is 401, sending the user to the login page if it is:\n if(xhr.status === 401){\n spa.navigateTo('login');\n return;\n }\n console.log(xhr.responseJSON);\n });\n }\n\n // *Exporting this module:\n return {\n postSchedule: postSchedule,\n updateVehicleInfo: updateVehicleInfo,\n updateUserInfo: updateUserInfo\n };\n}", "title": "" }, { "docid": "ec6d9a92f77c566581603b33b762950a", "score": "0.56213295", "text": "function makeAPICall() {\n //need a url -- done\n //make the call -- done\n //save it in something \n //function to create our URL for the api callß\n // createUrl(queryString);\n movieAndDinnerObject.queryURL = createUrl();\n $.ajax({\n url: movieAndDinnerObject.queryURL,\n method: \"GET\"\n }).then(function (response) {\n displayMovieTimes(response);\n });\n }", "title": "" }, { "docid": "d7e3d643a8c19dedea09b2f934d63a78", "score": "0.5614417", "text": "function postData() {\n\t\t/*This function should create a post request using jquery. When posted it should:\n\t\t\t1) Add tweets to the 'database' -- messages.txt\n\t\t\t2) After posted prepend message to list of messages and clear input box */\n $(\"submit_btn\").on('click', function(e){\n e.preventDefault();\n console.log(\"test return\");\n $.post(\"/messages\", {text: \"testing\", userName: \"Brian\"});\n }); \n\t}", "title": "" }, { "docid": "cdd75e7f298a4ef18a77bab8c7bce55d", "score": "0.5603568", "text": "function main(data) {\n\t\tvar action = data.result.action;\n\t\tvar speech = data.result.fulfillment.speech;\n\t\t// use incomplete if u use required in api.ai questions in intent\n\t\t// check if actionIncomplete = false\n\t\tvar incomplete = data.result.actionIncomplete;\n\t\tif(data.result.fulfillment.messages) { // check if messages are there\n\t\t\tif(data.result.fulfillment.messages.length > 0) { //check if quick replies are there\n\t\t\t\tvar suggestions = data.result.fulfillment.messages[1];\n\t\t\t}\n\t\t}\n\t\tswitch(action) {\n\t\t\t// case 'your.action': // set in api.ai\n\t\t\t// Perform operation/json api call based on action\n\t\t\t// Also check if (incomplete = false) if there are many required parameters in an intent\n\t\t\t// if(suggestions) { // check if quick replies are there in api.ai\n\t\t\t// addSuggestion(suggestions);\n\t\t\t// }\n\t\t\t// break;\n\t\t\tdefault:\n\t\t\t\tsetBotResponse(speech);\n\t\t\t\tif(suggestions) { // check if quick replies are there in api.ai\n\t\t\t\t\taddSuggestion(suggestions);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "bf05ca70e86b773d6eb4b7b66fbf7e14", "score": "0.56026983", "text": "function submitRequest(){\n meth = \"POST\";\n const req = { method: meth, headers: { 'Content-Type': 'application/json' } }\n req[\"body\"] = JSON.stringify(data);\n console.log(\"FETCHING POST to REST API...\");\n fetch(apiPath, req)\n .then(res => {res.json();})\n .then(mess=> {\n console.log(mess);\n if(mess.mess){\n alert(mess.mess);\n window.location.replace(\"/Restaurant\");\n } else window.location.replace(\"/\");\n }) //Redirect\n .catch(error => console.log(error));\n }", "title": "" }, { "docid": "f24e6cb84582c0e14c58ee0aa237bce8", "score": "0.56004936", "text": "function SubmitRequest(request, entry, cbl) {\n var verifyErr = VerifyRequestInput(request, entry);\n\n if (verifyErr) {\n exports.NextCallback(verifyErr, entry, cbl);\n return;\n }\n\n var typeId = entry[request.type].id; // id of board, list, or card\n var typeApiName = request.type + 's';\n // If an id was given in the request - override the default\n if (request.id) {\n typeId = request.id;\n }\n\n request.endpoint = ('/1/' + typeApiName + '/' + typeId + '/' + request.endpoint).replace(/\\/\\//g, '/');\n\n if (request.method === 'GET') {\n trello.get(request.endpoint, request.arguments, function (err, tdata) {\n if (err) {\n entry.requests.push({request: request, response: err});\n exports.NextCallback(err, entry, cbl);\n return;\n }\n StoreResponse(request, entry, tdata);\n exports.NextCallback(err, entry, cbl);\n })\n }\n else if (request.method === 'PUT') {\n trello.put(request.endpoint, request.arguments, function (err, tdata) {\n if (err) {\n entry.requests.push({request: request, response: err});\n exports.NextCallback(err, entry, cbl);\n return;\n }\n StoreResponse(request, entry, tdata);\n exports.NextCallback(err, entry, cbl);\n })\n }\n else if (request.method === 'POST') {\n trello.post(request.endpoint, request.arguments, function (err, tdata) {\n if (err) {\n entry.requests.push({request: request, response: err});\n exports.NextCallback(err, entry, cbl);\n return;\n }\n StoreResponse(request, entry, tdata);\n exports.NextCallback(err, entry, cbl);\n })\n }\n else if (request.method === 'DELETE') {\n trello.del(request.endpoint, request.arguments, function (err, tdata) {\n if (err) {\n entry.requests.push({request: request, response: err});\n exports.NextCallback(err, entry, cbl);\n return;\n }\n StoreResponse(request, entry, tdata);\n exports.NextCallback(err, entry, cbl);\n })\n\n }\n\n }", "title": "" }, { "docid": "f04ebcbe4573049cdadc9ae2ba5372a2", "score": "0.56003034", "text": "handleArticleSubmit(data) {\n new CallAPI().addArticle(data, (err) => {\n if(err) {\n alert(\"Error submitting article. Please try again.\");\n return;\n }\n this.showHome();\n alert(\"Submitted for verification.\")\n });\n }", "title": "" }, { "docid": "2802d764869d6c8557e31e2c5cc47a23", "score": "0.5598976", "text": "function postALift\n(\n)\n{\n var startAddress = $('#startLocationFrom').css('display') != 'none' ? \n $('option:selected','#fromLocationRequestRide').val() : \n $('#fromLocation').val();\n var toAddress = $('#toLocationFrom').is(':visible')? \n $('#toLocation').val() : \n $('option:selected','#toLocationRequestRide').val(); \n var startType = $('#startLocationFrom').css('display') != 'none' ? \n AIRPORT_START : ADDRESS_START; \n \n var customerId = sessionManager('getSession','customerId');\n if(customerId)\n {\n var date = $.getDateTime.date($('#requestRideDateTime').val());\n var time = $.getDateTime.time($('#requestRideDateTime').val()); \n time = $.getDateTime.time(time,true);\n var liftData = \n {\n 'customerId' : customerId,\n 'date' : date,\n 'time' : time,\n 'start' : startAddress,\n 'to' : toAddress,\n 'startType' : startType,\n 'via' : '',\n 'maxMiles' : '',\n 'seats' : $('#seatsRequestRide option:selected').val(),\n 'smoker' : $('#smoker').is(':checked'),\n 'bags' : $('#bagRequestRide').val(),\n 'bagSize' : $('#requestRideBagSizeSelect option:selected').val(),\n 'note' : $('#liftNote').val()\n } \n var dataToSend =\n {\n 'action' : POST_A_LIFT,\n 'lift' : JSON.stringify(liftData) \n }\n $.ajax({\n type : \"POST\",\n url : CUSTOM_API_URL,\n data : dataToSend, \t \n dataType : \"json\",\n headers : HEADER,\n async : false,\n error : function (e) \n { \n showAlertBox('Error',ERROR_MSG);\n },\n success : function(jsonResult)\n {\n if(jsonResult.retCode)\n { \n var msg ='Your request for a ride';\n msg +=' has been registered successfully.'\n showAlertBox('Successful',msg,SITE_URL + \n 'requestRide.php');\n }\n }\n });\n }\n moveTotop();\n}", "title": "" }, { "docid": "9eb79557d4ceb98105020ebd8284720f", "score": "0.55975175", "text": "function mainBody(){\n fs.readFile('data.txt', (err, data) => {\n if (err) throw err;\n // file openning\n data = data.toString()\n let res = data.split('\\r\\n')\n let pk = res[0]\n let user = res[1]\n let did = res[2]\n let date = res[3]\n let time = res[4]\n let claimam = res[5]\n let delph = res[6]\n pk = pk.split(\" :\")\n user = user.split(\" :\")\n did = did.split(\" :\")\n date = date.split(\" :\")\n time = time.split(\" :\")\n claimam = claimam.split(\" :\")\n delph = delph.split(\" :\")\n userPrivateKey = pk[1]\n userClaimAccount = user[1]\n userClaimDropId = parseInt(did[1])\n date = date[1].split('/')\n let year = parseInt(date[2])\n let month = parseInt(date[1]) - 1\n let day = parseInt(date[0])\n time = time[1].split(\":\")\n let hour = parseInt(time[0])\n let minute = parseInt(time[1])\n userClaimAmount = parseInt(claimam[1])\n respond = delph[1]\n\n // Api\n const privateKeys = [userPrivateKey];\n const signatureProvider = new JsSignatureProvider(privateKeys);\n const rpc = new JsonRpc('https://chain.wax.io', { fetch }); //required to read blockchain state\n const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() }); //required to submit transactions\n \n //Get Intended dewlphi Median\n const getIntMedian = () => rpc.get_table_rows({\n json: true, // Get the response as json\n code: 'delphioracle', // Contract that we target\n scope: 'waxpusd', // Account that owns the data\n table: 'datapoints', // Table name\n limit: 1, // Maximum number of rows that we want to get\n reverse: false, // Optional: Get reversed data\n show_payer: false // Optional: Show ram payer\n })\n\n // Reccurtion Claim Ith no Intended Delphi Median\n let Claim = () => {\n api.transact({\n actions: [{\n account: userReferAccount,\n name: userAction,\n authorization: [{\n actor: userClaimAccount,\n permission: 'active',\n }],\n data: {\n claim_amount: userClaimAmount,\n claimer: userClaimAccount,\n country: userCountry,\n drop_id: userClaimDropId,\n intended_delphi_median: userIntendedDelphiMedian,\n referrer:userReferrer,\n },\n }]\n }, {\n blocksBehind: 3,\n expireSeconds: 30,\n }).then((res) =>{\n console.log(res)\n console.log('-----------------Sucess----------------------')\n }).catch((err) =>{ \n console.log(err)\n console.log('-----------------Fail----------------------')\n Claim()\n })\n }\n\n // Reccurtion Claim With Intended Delphi Median\n let ClaimWithInt = () =>{\n getIntMedian().then((data) =>{\n userIntendedDelphiMedian = data['rows'][0]['median']\n api.transact({\n actions: [{\n account: userReferAccount,\n name: userAction,\n authorization: [{\n actor: userClaimAccount,\n permission: 'active',\n }],\n data: {\n claim_amount: userClaimAmount,\n claimer: userClaimAccount,\n country: userCountry,\n drop_id: userClaimDropId,\n intended_delphi_median: userIntendedDelphiMedian,\n referrer:userReferrer,\n },\n }]\n }, {\n blocksBehind: 3,\n expireSeconds: 30,\n }).then((res) =>{\n console.log(res)\n console.log('-----------------Sucess----------------------')\n }).catch((err) =>{ \n console.log(err)\n console.log('-----------------Fail----------------------')\n ClaimWithInt()\n })\n })\n }\n \n //Timer\n // 13 second delay if Intended delphi median is needed\n var buy_time = new Date(year,month,day,hour,minute,0,0);\n if(respond=='Y'){\n // 8.1 second delay\n buy_time = buy_time - 8100\n buy_time = new Date(buy_time)\n }\n else if(respond=='N'){\n // 6 second delay \n userIntendedDelphiMedian = 0\n buy_time = buy_time - 6000\n buy_time = new Date(buy_time)\n }\n\n console.log('Pending for Claim Drop ID: ' + userClaimDropId)\n\n while (true){\n var time_now = new Date();\n //exit()\n if (time_now.getTime() >= buy_time.getTime()){\n break\n }\n }\n\n if(respond=='Y'){\n ClaimWithInt()\n }\n else if(respond=='N'){\n // claimdrop\n Claim()\n }\n })\n}", "title": "" }, { "docid": "88a959852195185559e613fe78cbda68", "score": "0.5594107", "text": "static async apiPostReview (req, res, next) {\n try {\n // Access request body data\n const restaurantId = req.body.restaurant_id\n const review = req.body.review\n const userInfo = {\n name: req.body.name,\n _id: req.body.user_id\n }\n const date = new Date()\n\n await ReviewsDAO.addReview(\n restaurantId,\n userInfo,\n review,\n date\n )\n\n res.json({ status: 'success' })\n } catch (e) {\n res.status(500).json({ error: e.message })\n }\n }", "title": "" }, { "docid": "562c02e974a0ca0c037d169da3641018", "score": "0.558649", "text": "function responseHandler (api_app) {\n // Complete your fulfillment logic and send a response\n console.log('ARGUMENTS CHECKING: '+api_app.getArgument(\"movie\")+\"------\"+api_app.getArgument(\"attributes\"));\n // api_app.ask('The answer is '+api_app.getArgument(\"movie\")+\"------\"+api_app.getArgument(\"attributes\"));\n\n // client.get(\"http://www.omdbapi.com/?t=\"+api_app.getArgument(\"movie\").replace(\" \",\"+\")+\"&apikey=c22bc403\",\n // function (data, response) {\n // // parsed response body as js object\n // console.log(\"DATA --- \" + JSON.stringify(title));\n // api_app.ask(\"TESTING THIS STUFF\");\n // }\n // ).on('error', function(err){\n // console.log(\"something went wrong...\", err);\n // });\n var movieId;\n var data;\n mdb.searchMovie({ query: 'Iron+man' }, (err, res) => {\n // console.log(res)\n movieId = res.results[0].id;\n //console.log(err);\n }).movieCredits({ id: movieId }, (err, res) => {\n data = res;\n //get director\n var director = data.crew.filter(function(item){ return item.job == 'Director';})[0];\n\n api_app.ask(director.name);\n\n });\n\n\n }", "title": "" }, { "docid": "b8650e32d309ca6a57a6b02f201aaf92", "score": "0.5582711", "text": "function submitData(){\r\n // getting word and desc value\r\n var word = document.querySelector('#word').value;\r\n var desc = document.querySelector('#desc').value;\r\n\r\n // create json format data\r\n let data = {\r\n 'word': word,\r\n 'description': desc\r\n };\r\n\r\n // POST request using fetch()\r\n fetch(`${uri}/api/words`, {\r\n method: 'POST',\r\n mode: 'cors',\r\n headers: {\r\n 'Content-type': 'application/json'\r\n },\r\n body: JSON.stringify(data)\r\n })\r\n .catch(err => console.log(err));\r\n\r\n // alert and blank the value\r\n alert(\"Adding word succeded! Click 'OK' to continue.\");\r\n location.href = `/dashboard`;\r\n}", "title": "" }, { "docid": "c6424297c7c1270df9fb0b13154cc496", "score": "0.55820274", "text": "changeData() {\n console.log('POST REQUEST');\n }", "title": "" }, { "docid": "39fd710ad5cb2a178b62975a08be03e2", "score": "0.55774313", "text": "function createApi() {\n \n rest.use(bodyParser.urlencoded({\n extended: true\n }));\n rest.use(bodyParser.json());\n\n rest.put('/ring/on', function (req, res) {\n console.log(\"turn ON\");\n $('#myLamp').css('background-color', 'rgb(255, 250, 165)');\n res.sendStatus(200)\n });\n\n rest.put('/ring/off', function (req, res) {\n console.log(\"turn off\");\n $('#myLamp').css('background-color', 'rgb(172, 172, 172)');\n res.sendStatus(200)\n })\n\n rest.put('/ring/color', function (req, res) {\n var color = req.body;\n console.log(\"turn off\");\n $('#myLamp').css('background-color', 'rgb(' + color.r + ', ' + color.g + ', ' + color.b + ')');\n res.sendStatus(200)\n })\n\n rest.listen(3000);\n }", "title": "" }, { "docid": "ece4bb155b722acffe1b0df5d8df8575", "score": "0.5569511", "text": "function EntryPoint(uri){\n this.uri = uri;\n\n this.headers = {\n \"Accept\" : \"\",\n \"Content-Type\" : \"application/xml\" \n }; \n\n // Default accepts should add all known media types\n for (var format in Converters.mediaTypes){\n if (\"register getMediaType\".indexOf(format)==-1)\n this.headers[\"Accept\"] += (this.headers[\"Accept\"]=='' ? '':', ') +format;\n }\n\n // configure accept\n this.accepts = function(accept){\n \t\tthis.headers[\"Accept\"] = accept;\n \t\treturn this;\n \t}\n \t// configure content-Type \n \tthis.as = function(contentType){\n \t\tthis.headers[\"Content-Type\"] = contentType;\n \t\treturn this;\n \t}\n \n // send request get\n this.requestAjax = function(method) {\n var xhr = AjaxRequest.ajax(method,this.uri,'',this.headers);\n return SerializeXHR.serialize(xhr);\n }\n \n // send request get\n this.get = function(){\n return this.requestAjax(\"GET\");\n \t}\n \n // send request trace\n this.trace = function(){\n return this.requestAjax(\"TRACE\");\n \t}\n \n // send request head\n this.head = function(){\n return this.requestAjax(\"HEAD\");\n \t}\n\n // send request delete\n this._delete = function(){\n return this.requestAjax(\"DELETE\");\n }\n \n // send request options\n this.options = function(){\n return this.requestAjax(\"OPTIONS\");\n \t}\n\n this.requestWithPayload = function(method, representation) {\n var backup;\n var content;\n var xhr; \n backup = representation.response;\n delete representation.response; \n if((typeof representation) == \"string\") {\n content = representation;\n } else {\n var mediaType = Converters.getMediaType(this.headers['Content-Type']);\n content = mediaType.marshal(representation);\n }\n representation.response = backup;\n xhr = AjaxRequest.ajax(method,this.uri,content,this.headers);\n return SerializeXHR.serialize(xhr,this);\n }\n \n //send request post\n this.post = function(representation){\n return this.requestWithPayload(\"POST\", representation);\n }\n\n //send request patch\n this.patch = function(representation){\n return this.requestWithPayload(\"PATCH\", representation);\n }\n\n //send request put\n this.put = function(representation){\n return this.requestWithPayload(\"PUT\", representation);\n }\n\n }", "title": "" }, { "docid": "7c587711d15f5ff1cff7e292119a9c17", "score": "0.55628186", "text": "function newEntry() {\r\n\r\n var apigClient = apigClientFactory.newClient({\r\n apiKey: ''\r\n });\r\n\r\n console.log(document.getElementById(\"chatbot\").value)\r\n //if the message from the user isn't empty then run\r\n var user_message;\r\n var api = \"\"\r\n\r\n if (document.getElementById(\"chatbot\").value != \"\") {\r\n user_message = document.getElementById(\"chatbot\").value;\r\n document.getElementById(\"cnt1\").value += user_message+'\\n';\r\n document.getElementById(\"chatbot\").value = \"\";\r\n }\r\n\r\n var params = {};\r\n var additionalParams = {};\r\n\r\n var body = {\r\n\r\n \"message\" : user_message\r\n };\r\n\r\n\r\n apigClient.chatbotPost(params,body,additionalParams)\r\n .then(function(result){\r\n // document.getElementById('out').innerHtml = result.data;\r\n document.getElementById(\"cnt1\").value += result.data+'\\n'+'\\n';\r\n // document.getElementById('out').innerHtml.append(result.data);\r\n console.log(result.data)\r\n }).catch( function(result){\r\n \r\n });\r\n\r\n // $.ajax({\r\n // type: \"POST\",\r\n // data :JSON.stringify(u_message),\r\n // url: api,\r\n // headers: {\r\n // 'x-api-key' : ''\r\n // },\r\n \r\n // contentType: \"application/json\"\r\n // }).done(function (res) {\r\n // console.log('res', res);\r\n // var mainDiv = document.getElementById(\"chatbot\")\r\n // var div1 = document.createElement(\"div\")\r\n // mainDiv.appendChild(div1)\r\n // div1.innerHtml = res['message']\r\n // });\r\n}", "title": "" }, { "docid": "59d711e2c6282be0983d3503dfed95bb", "score": "0.5561646", "text": "createPost() {}", "title": "" }, { "docid": "18093dc40381293b0a3fe88406aad910", "score": "0.55597085", "text": "function sendRequest() {\r\n // User's parameters for URL\r\n const params = {\r\n method: \"pet.find\",\r\n key: \"add4fdca944ac818ef1bee3a08e0602b\",\r\n format: \"json\",\r\n output: \"full\",\r\n animal: \"cat\",\r\n count: document.getElementById(\"catNum\").value,\r\n myLocation: document.getElementById(\"myLocation\").value.replace(/ +/g, \"\")\r\n };\r\n\r\n // Eventually I might want to allow users to build more complex queries, so I'm creating a URL class that will take an array of user supplied parameters\r\n class BuildURL {\r\n\r\n constructor(params) {\r\n this.method = params.method;\r\n this.key = params.key;\r\n this.format = params.format;\r\n this.output = params.output;\r\n this.animal = params.animal;\r\n this.count = params.count;\r\n this.myLocation = params.myLocation;\r\n }\r\n \r\n build() {\r\n return encodeURI(\r\n `https://api.petfinder.com/${this.method}?key=${this.key}&format=${\r\n this.format}&location=${this.myLocation}&count=${this.count}&animal=${this.animal}`\r\n );\r\n }\r\n }\r\n\r\n // The Fetch API does not provide support for JSONP. fetchJsonp is part of the fetch-jsonp library which provides support for JSONP.\r\n fetchJsonp(new BuildURL(params).build(), {\r\n jsonpCallback: \"callback\",\r\n timeout: 10000\r\n })\r\n .then(function(response) {\r\n return response.json();\r\n })\r\n .then(function(myJson) {\r\n myData = myJson.petfinder.pets.pet;\r\n console.log(myData);\r\n return appendCatNode(myJson.petfinder.pets.pet);\r\n })\r\n .catch(function(response) {\r\n console.log(\"Something went wrong: \", response);\r\n });\r\n}", "title": "" }, { "docid": "0de16bdc7cb01fa5d7a69c56580c41fb", "score": "0.55556375", "text": "post (data) {\n return rest.post(this.endpoint, data).then(res => {\n return res.data\n })\n }", "title": "" }, { "docid": "3a0843cbde5f18b141afe0ec83ff817a", "score": "0.5554467", "text": "function doLogin() \n{\n\tlet username = $('#textusername').val();\n\tlet password = $('#textpassword').val();\n\t\n\tlet jsondata = {\n\t\t \"serviceName\": \"generateToken\",\n\t\t \"param\": {\n\t\t \"email\": username,\n\t\t \"password\": password\n\t\t }\t\n\t};\n\tpostToApi(jsondata);\n} //end doLogin", "title": "" }, { "docid": "298d38608b337db0431f5c9c2a5fb365", "score": "0.55502915", "text": "function julieAlgoPostReq(arrayOfImportantEls){\n console.log(`DID JULIES ALGO RANKING REQ GET ACTIVIATED?`, arrayOfImportantEls)\n fetch('http://localhost:3333/rankings/new', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n newElements: arrayOfImportantEls,\n })\n })\n .then(res => res.json())\n .then((data)=> {\n console.log('amazon data ',data)\n // should be returning julie talking about this data\n julieSaysRankings(data)\n keyPressInjection();\n\n });\n}", "title": "" }, { "docid": "3feb818ad7f7b0f374208de8e5ca13ba", "score": "0.5542667", "text": "function postAPIData(token, uri, body, callback) {\n\tif(typeof(token) !== 'string') callback(new Error(\"typeof(token) !== 'string'\"));\n\tif(typeof(uri) !== 'string') callback(new Error(\"typeof(uri) !== 'string'\"));\n\tvar options = {\n\t\tmethod: 'POST',\n\t\tforever: true,\n\t\turl: SpeedTestBaseURL+uri,\n\t\tencoding: null,\n\t\theaders: Object.assign({}, commandheaders),\n\t\tbody: body\n\t};\n\t//add headers for posting data by SpeedTest API\n\tfor (var key in postAPIDataHEaders) {\n\t\toptions.headers[key] = postAPIDataHEaders[key];\n\t}\n\n\toptions.headers['X-Droi-Session-Token'] = token;\n\n\tREQUEST(options, function (error, response, body) {\n\t\tvar data = null;\n\t\ttry {\n\t\t\tif (!error) {\n\t\t\t\tdata = JSON.parse(body);\n\t\t\t\tif(data.Code == undefined || data.Code != 0) {\n\t\t\t\t\terror = new Error(\"ERROR: data.Code=\"+data.Code);\n\t\t\t\t} else if(data.Result == undefined) {\n\t\t\t\t\terror = new Error(\"ERROR: data.Result=\"+data.Result);\n\t\t\t\t} else {\n\t\t\t\t}\n\t\t\t}\n\t\t} catch(e) {\n\t\t\terror = e;\n\t\t} finally {\n\t\t\tcallback(error,options, response, data);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "eaeeef44086ffe92fbdb5aad057ba63b", "score": "0.5540777", "text": "async function postData(zipCode, temp, feelings, townName) {\n const response = await fetch('http://localhost:7600/', {\n method: 'POST',\n credentials: 'same-origin',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ zipCode, temp, feelings, newDate, townName }),\n\n });\n return await response.text()\n}", "title": "" }, { "docid": "a095f7fb59dfb45b49d5700032a1e273", "score": "0.55395794", "text": "function api_test() {\n var parameters = {};\n parameters['version'] = 'v1';\n parameters['api_name'] = 'user';\n parameters['api_method'] = 'create';\n parameters['p1'] = '[email protected]';\n parameters['p2'] = 'Christopher';\n parameters['p3'] = 'Wood';\n\n api_request(parameters, function(response){\n if(response['success'] == true) {\n alert(response);\n }\n else {\n alert('api called failed');\n }\n });\n}", "title": "" }, { "docid": "3df58102f855acf319461359d97ede52", "score": "0.5539271", "text": "function postexample(req, res) {\n var data1 = req.body.data1 == undefined ? null :req.body.data1;\n var data2 = req.body.data2 == undefined ? null :req.body.data2;\n\n sample_db.postexample(data1,data2, function (err,data) {\n res.json(data)\n });\n}", "title": "" }, { "docid": "81ec2f6abe1ff2297f7c49f4568f9490", "score": "0.5538326", "text": "function postProcess (temDegree, fellingInfo){\n return fetch('/gatheringData', {\n method: 'POST',\n mode: 'cors',\n cache: 'no-cache',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n date: newDate,\n temp: temDegree,\n feelings: fellingInfo\n })\n });\n}", "title": "" }, { "docid": "0141bbd7be87460e0523a1b69124b744", "score": "0.5535854", "text": "static post(controller, action, version, data = {}) {\n return Observable_1.Observable.create((observable) => {\n let url = this.getUrl(controller, action, version);\n data['token'] = index_1.Config.getApiToken();\n data['serviceId'] = index_1.Config.getServiceId();\n let jsonData = JSON.stringify(data);\n request.post({\n url: url,\n headers: { 'Content-Type': 'application/json' },\n body: jsonData,\n }, (error, response, body) => {\n if (error) {\n observable.error(error);\n return;\n }\n try {\n body = JSON.parse(body);\n }\n catch (e) {\n observable.error(body);\n return;\n }\n if (response.statusCode !== 200) {\n if (this.isError(body) !== false) {\n observable.error(this.isError(body));\n return;\n } else {\n observable.error(response.statusCode + ' ' + response.statusMessage);\n return;\n }\n }\n\n if (this.isError(body) !== false) {\n observable.error(this.isError(body));\n return;\n }\n observable.next(body);\n observable.complete();\n });\n });\n }", "title": "" }, { "docid": "971b6f4cda8113a4ac42c200bdfb5804", "score": "0.55318266", "text": "function makerequest(e) {\r\n e.preventDefault()\r\n let name = document.getElementById(\"name\").value\r\n let job = document.getElementById(\"job\").value\r\n console.log(\"Button Clicked\")\r\n const myInit = {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify({ name: name, job: job })\r\n }\r\n console.log(\"Body:\", myInit.body)\r\n fetch('https://reqres.in/api/users', myInit)\r\n .then((res) => {\r\n if (!res.ok) {\r\n throw Error(res.statusText)\r\n }\r\n return res.json()\r\n }).then((data) => {\r\n console.log(data)\r\n }).catch((error) => console.log(error))\r\n }", "title": "" }, { "docid": "329b6e56e246ec8846b725759d8737e3", "score": "0.5529134", "text": "function addAPICalls() {\n const methodBase = 'https://api.stackexchange.com/2.2/posts/',\n paramBaseA = '?pagesize=100&order=desc&key=V8Sw6puqD0eUqphKLGadPw((&min=',\n paramBaseB = '&sort=activity&filter=!)4k-FmSEkrkChRkSHXPXHE2SxOhY&site=',\n sitePattern = /(?:meta\\.)?(?:[^\\.\\/]+(?=\\.stackexchange)|stackoverflow|stackapps|askubuntu|serverfault|superuser)/;\n var siteMatch = sitePattern.exec(document.location.hostname), siteParam;\n state = \"API-calling\";\n handler = apiHandler;\n if (siteMatch) {\n siteParam = siteMatch[0];\n }\n else {\n alert(\"Show Edited Votes: Couldn't find site abbreviation in URL! ('\" + document.location.hostname + \"')\");\n return;\n }\n while (ids.length > 0) {\n let paramIDs = ids.slice(0, 100), idParam = paramIDs.join(';');\n let minParam = paramIDs.map(function (e) {\n return new Number(lastVoted[e]);\n }).reduce(function (a, b) {\n return Math.min(a, b);\n }, Date.now() / 1000);\n let url = methodBase + idParam + paramBaseA + minParam + paramBaseB + siteParam;\n tasks.push(url);\n ids = ids.slice(100);\n }\n }", "title": "" }, { "docid": "2dcb7d46ffcba8821beb14f291afb0e5", "score": "0.55212545", "text": "function postData(whodat, secret, t, date) {\n\n // parse the date from yyyy mm dd format\n var splitted = date.split(' ');\n if (splitted.length < 3) {\n alert('you didnt enter a complete date pussy');\n return;\n }\n\n var http = new XMLHttpRequest();\n var url = serverUrl + 'post';\n http.onreadystatechange = function() {\n console.log(\"send\");\n if (http.readyState === 4 && http.status === 200) {\n var msg = JSON.parse(http.response);\n alert(msg.message);\n }\n }\n\n http.open('POST', url, true);\n\n // TODO: this should be application/x-www-form-urlencoded ?\n http.setRequestHeader('Content-Type', 'application/json');\n var data = {\n title: t,\n blog: pad.value,\n year: splitted[0],\n month: splitted[1],\n day: splitted[2],\n name: whodat,\n pass: secret\n }\n\n http.send(JSON.stringify(data));\n}", "title": "" }, { "docid": "185eadfbbf97c5213129e41022aa24cc", "score": "0.5516234", "text": "function apiFact ($http){\n\n function getHeroes () {\n return $http.get('/api/heroes')\n }\n function createHero (heroData) {\n return $http.post('/api/heroes', heroData)\n }\n function getCall () {\n return $http.get('/api/calls')\n }\n function createCall (callData) {\n console.log(callData);\n return $http.post('/api/calls', callData)\n }\n\n\n return {\n getHeroes : getHeroes,\n createHero: createHero,\n getCall : getCall,\n createCall: createCall,\n }\n }", "title": "" }, { "docid": "00af608b09be5a5e4806e02f5d14370b", "score": "0.551187", "text": "function testResults(form) {\n var fullName = form.fullname.value;\n var companyName = form.companyname.value;\n\n let i = {\n method: 'POST',\n uri: 'http://localhost:8080/api/worker/',\n body: {\n \"name\": fullName,\n \"company\": companyName,\n \"cardid\": cardId,\n \"checkedIn\": false\n },\n json: true\n }\n\n request(i, function(error, resp, body) {\n console.log(error);\n console.log(resp);\n console.log(body);\n })\n /*var xhr = new XMLHttpRequest();\n xhr.open('POST', \"http://localhost:8080/api/worker/\", true);\n xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8');\n xhr.send(JSON.stringify({\n \"name\": fullName,\n \"company\": companyName,\n \"cardid\": cardId,\n \"checkedIn\": false\n }));*/\n alert(fullName + \"\\n\" + companyName + \"\\n\" + cardId);\n window.location.replace(\"file:///D:/Innsjekk ID/index\");\n}", "title": "" }, { "docid": "391299d7fc53cc7ec199401668316cfc", "score": "0.5511536", "text": "function postService(url, sqlQuery, data){ \napp.post(url, function(request, response, next){\n try{\n var reqObj=request.body;\n request.getConnection(function(error, conn){\n if(error) {\n console.log(\"SQL connection error:\", error);\n return next(error);\n }\n else\n {\n var insertSql=sqlQuery;\n var insertValues={};\n for(var i=0; i<data.length; i++){\n insertValues[data[i]]=reqObj[data[i]]; \n }\n \n var query = conn.query(insertSql, insertValues, function(error, result){\n if(error){\n console.log(\"SQL error\", error);\n return next(error);\n } \n console.log(result);\n var name_id = result.insertId;\n response.json({\"name\": name_id});\n \n });\n }\n });\n }\n catch (ex){\n console.log(\"Internal Error:\"+ex);\n return next(ex);\n }\n \n \n});\n}", "title": "" } ]
1d1d8938dc79ec73fe0329ae38d973f2
update My Tasks list
[ { "docid": "f9828e53f66397f7f44b300521de0a71", "score": "0.0", "text": "function updateTasksList(view_task) {\n $('#my-tasks .task-selector select option').remove();\n $('#my-tasks .selectpicker').selectpicker('refresh');\n last_id = 0;\n\n $.ajax({\n type: \"POST\",\n url: '/get-task-list',\n success: function(data)\n {\n if(data['status'] == 'success') {\n is_empty = true;\n\n $.each( data['data'], function( index, value ){\n element = '<option name=\"my_tasks['+value['id']+']\" value=\"'+value['id']+'\">'+value['name']+'</option>';\n\n $('#my-tasks .task-selector select').append(element);\n $('#my-tasks .selectpicker').selectpicker('refresh');\n is_empty = false;\n last_id = value['id'];\n });\n\n if (is_empty === true) {\n $('#my-tasks .nothing').show();\n }\n else {\n $('#my-tasks .nothing').hide();\n }\n\n $('#my-tasks .selectpicker').selectpicker('render');\n $('#my-tasks .selectpicker').selectpicker('val', last_id);\n\n if(view_task == 'id' && last_id > 0) {\n viewTask(last_id);\n }\n }\n else if(data['status'] == 'danger') {\n $('#my-tasks .task-selector').after('<div class=\"col-lg-12\"><p>You don\\'t have any tasks.</p></div>');\n }\n },\n error: function(data)\n {\n $('#my-tasks .task-selector').after('<div class=\"col-lg-12\"><p>Error occured, please reload the page.</p></div>');\n }\n });\n}", "title": "" } ]
[ { "docid": "1fb3b2c1f401c85d870fcf86d42edc0b", "score": "0.77657616", "text": "updateTaskList() {\n if (this.taskList.selectedTask) {\n this.taskList.updateSelectedTaskSessionCount();\n this.taskList.updateStorage();\n }\n }", "title": "" }, { "docid": "4d245f7a09975135b411d89140a36e00", "score": "0.72723496", "text": "function updateTasks() {\n $currentArea.find('.input-group').each(function () {\n var value = $(this).find('input').val();\n var id = $(this).find('button').data('id');\n\n tasks[id].text = value;\n });\n\n localStorage.setItem(\"todo-local\", JSON.stringify(tasks));\n }", "title": "" }, { "docid": "4ec322a741ee22310850bc509eaa5254", "score": "0.7150132", "text": "function updateListItem(task) {\n\n var dbRef = firebase.database()\n .ref()\n .child('taskdb')\n .child($scope.user.uid)\n .child(task.key)\n .set({\n date: task.date,\n title: task.title,\n scrum: task.scrum,\n folder: task.folder,\n is_complete: task.is_complete,\n priority: task.priority\n });\n }", "title": "" }, { "docid": "6e29d23c1deba623c3305e17556533b5", "score": "0.69684637", "text": "function setTasks(){\n makesTasks();\n console.log(tasks);\n}", "title": "" }, { "docid": "0cb077dc5bd62441ff7eb4b37f1834f8", "score": "0.6889783", "text": "function updateTask(){\n task.value = document.getElementById('new-task-name').value;\n if(task.value) {\n array = getArray();\n if (array.length) {\n array.forEach(function (item, idx) {\n if (item.id == task.id) {\n index = idx;\n }\n });\n if (index !== -1) {\n array.splice(index, 1, task);\n document.getElementById(task.id).classList.remove('hidden');\n isEdit = false; \n setArray(array);\n loadAllTasks();\n }\n }\n else {\n alert('Task List not exists \\n create first..')\n }\n }\n else {\n alert('field must be fill..');\n }\n}", "title": "" }, { "docid": "d3b259360e6b3122d991b7cf68036723", "score": "0.6876365", "text": "function updateTasks(tasks) {\n var promises = [];\n _.forEach(tasks, function (task) {\n // get a promise for persistance\n var promise = Task.findByIdQ(task._id)\n .then(function (taskDB) {\n if (taskDB === null) {\n throw new Error(\"Cannot find task with ID: '\"+task._id+\"'\");\n }\n taskDB.partial_result = task.partial_result;\n taskDB.status = \"completed\";\n return taskDB.saveQ();\n }).fail(function(task){\n// console.log(\"Error\");\n });\n\n promises.push(promise);\n });\n\n return Q.all(promises);\n }", "title": "" }, { "docid": "0e8ca56fd5e71235d7e6cff399b9cddd", "score": "0.6841181", "text": "function updateTaskList(taskList) {\n\tlet parent = document.getElementById(\"task-table\");\n\tif (taskList.length == 0) {\n\t\tparent.innerHTML = \n\t\t`\n\t\t<div class=\"container text-center\"><p>Click the &nbsp;<i class=\"bi bi-plus-square dark-icon\"></i>&nbsp; button to create a new task</p></div>`;\n\t}\n\telse {\n\t\tparent.innerHTML = \"\";\n\t\tfor (let i = 0; i < taskList.length; i++) {\n\t\t\tlet task = taskList[i];\n\t\t\tlet d = new Date(task.deadline);\n\t\t\tlet date = (d.getMonth() + 1) + \"/\" + d.getDate() + \"/\" + d.getFullYear();\n\t\t\tlet time = (d.getHours() % 12) + \":\" + (d.getMinutes() < 10 ? \"0\" : \"\") + \n\t\t\t\td.getMinutes() + \" \" + (d.getHours() / 12 == 0 ? \"A\" : \"P\" ) + \"M\";\n\t\t\tlet current = fillTemplate(i, task.name, date, time, task.description, task.reward, task.taskID, task.complete)\n\t\t\tparent.innerHTML += current;\n\t\t}\n\t}\n\n\t// Button handlers for complete task buttons\n\tlet completes = document.getElementsByClassName(\"complete-task\");\n\tfor(let i = 0; i < completes.length; i++) {\n\t\tcompletes[i].addEventListener(\"click\", handleTaskComplete);\n\t}\n\n\t// Button handlers for remove task buttons\n\tlet deletes = document.getElementsByClassName(\"delete-task\");\n\tfor(let i = 0; i < deletes.length; i++) {\n\t\tdeletes[i].addEventListener(\"click\", handleTaskRemove);\n\t}\n}", "title": "" }, { "docid": "1f57ca7f29a602a822335a04f80f3bbd", "score": "0.6837316", "text": "uploadTasksFromArr( tasks = [] ) {\n \n tasks.forEach( task => {\n // console.log( task.id );\n this._list[task.id] = task;\n })\n }", "title": "" }, { "docid": "0c426098b63eae7d293dfb928cc6e26d", "score": "0.6818008", "text": "setTasks (state, { tasks, today }) {\n state.tasks = {}\n state.taskOrder = []\n\n tasks.forEach(task => {\n Vue.set(state.tasks, task.id, task)\n })\n // we need to iterate over the tasks a second time to ensure that the index\n // is fully populated\n tasks.forEach(task => {\n state.taskOrder.splice(\n insertIndex(state.taskOrder, task, state.tasks, today),\n 0,\n task.id\n )\n })\n\n state.ready = true\n }", "title": "" }, { "docid": "1c97486e6d9b2027221d0a9ca66b2cef", "score": "0.6805428", "text": "addTaskToTaskList(task) {\n const lastID =\n this.list.length === 0 ? 0 : this.list[this.list.length - 1].id;\n task.id = lastID + 1;\n this.list.push(task);\n window.localStorage.setItem(\"task\" + task.id, JSON.stringify(task));\n }", "title": "" }, { "docid": "154c813099265cf4eb197caba34f4e93", "score": "0.67075646", "text": "function TaskList() {\n this.tasks = {}\n this.currentId = 0\n}", "title": "" }, { "docid": "4bc592b541f6b4f9e56a5456bc79ff1a", "score": "0.6691969", "text": "function save() {\n if(signedIn){\n tasks.forEach((list) => {\n list.forEach((task) => {\n updateTask(task);\n })\n })\n }\n}", "title": "" }, { "docid": "ebb59d3212db093f6bb537f3946711d5", "score": "0.6683076", "text": "refreshList() {\n\t\taxios.get('http://localhost:8080/').then(res => {\n\n\t\t\tlet doneArray = [];\n\n\t\t\tfor(let n=0; n<res.data.length; n++) {\n\t\t\t\tif(res.data[n].done === true) {\n\t\t\t\t\tdoneArray.push(res.data[n].short);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tdoneArray: doneArray,\n\t\t\t\tnewTask: '',\n\t\t\t\ttasks: res.data\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "58de54b09fe0377738243ac2ca28cc60", "score": "0.6632023", "text": "onTaskUpdated(task, updatedData) {\n const tasks = this.tasks.slice();\n tasks.splice(tasks.indexOf(task), 1, Object.assign({}, task, updatedData));\n this.tasksUpdated.next(tasks);\n }", "title": "" }, { "docid": "97840368f1d05ecd7860b7d70b9ee33b", "score": "0.66316104", "text": "function refresh() {\n let taskList = document.getElementById(\"task-list\");\n taskList.innerHTML = '';\n for (i in taskArray) {\n createUiTask(taskArray[i], i)\n }\n updateCounter();\n}", "title": "" }, { "docid": "ff0ee0c2319a57e335c7e48b57827d6b", "score": "0.66258097", "text": "function saveTaskChanges() {\n allTasksArray[editedTaskIndex] = document.querySelector('#edit-modal-input').value;\n loadTaskList();\n}", "title": "" }, { "docid": "28e677800f02284d6d31f20bfeb6ffe9", "score": "0.65652555", "text": "function updateTask(taskId, title, listId){\n endPoint = '/tasks/' + taskId;\n revision = WunderTask.getRevision(taskId);\n data = {\n \"title\": title,\n \"revision\": revision\n }\n if(listId != undefined){\n data.list_id = listId\n }\n makeRequest(endPoint, 'PATCH', data);\n\n}", "title": "" }, { "docid": "d23248986a85af65e34008ea33379535", "score": "0.6559953", "text": "async updateTask(task) {\n let taskToUpdate = await this.getTask(task);\n // @ts-ignore\n taskToUpdate.listId = task.listId;\n let updatedTask = await dbContext.Tasks.findByIdAndUpdate(task.id, taskToUpdate, { new: true });\n\n return updatedTask;\n }", "title": "" }, { "docid": "1095608dc7f57aa1c2560b86ff7f5e45", "score": "0.6552164", "text": "function updateTask(e) {\n var id = $(\"#task_id\").val();\n var task = $(\"#task\").val();\n var task_priority = $(\"#priority\").val();\n var task_date = $(\"#date\").val();\n var task_time = $(\"#time\").val();\n\n taskList = JSON.parse(localStorage.getItem(\"tasks\"));\n\n for (var i = 0; i < taskList.length; i++) {\n if (taskList[i].id == id) {\n taskList.splice(i, 1);\n }\n localStorage.setItem(\"tasks\", JSON.stringify(taskList));\n }\n if (task == \"\") {\n alert(\"task boş olamaz\");\n e.preventDefault();\n } else if (task_priority == \"\") {\n alert(\"task_priority boş olamaz\");\n e.preventDefault();\n } else if (task_date == \"\") {\n alert(\"task date boş olamaz\");\n e.preventDefault();\n } else if (task_time == \"\") {\n alert(\"task time boş olamaz\");\n e.preventDefault();\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n\n //check tasks\n if (tasks == null) {\n tasks = [];\n }\n var taskList = JSON.parse(localStorage.getItem(\"tasks\"));\n\n //new object\n var new_task = {\n id: id,\n task: task,\n task_priority: task_priority,\n task_date: task_date,\n task_time: task_time\n };\n tasks.push(new_task);\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n }\n }", "title": "" }, { "docid": "fcf1e318a7ec6571208431ef0a1979e6", "score": "0.6549323", "text": "function updateTask() {\n $.ajax({\n type: 'PUT',\n url: '/tasks',\n success: getData\n });\n}", "title": "" }, { "docid": "15ba70206ad61ca78c31215516093c0b", "score": "0.6521113", "text": "function updateTask(e)\n {\n \n //fetch all the values to be updated\n var id = $('#task-id').val();\n var task = $('#task').val();\n var task_priority = $('#priority').val();\n var task_date = $('#date').val();\n var task_time = $('#time').val();\n \n //fetch all the tasks\n taskList = JSON.parse(localStorage.getItem('tasks'));\n \n //find the task to edit using its ID\n for (var i=0;i<taskList.length;i++)\n {\n if (taskList[i].id == id)\n {\n taskList.splice(i,1);\n }\n localStorage.setItem('tasks',JSON.stringify(taskList));\n }\n \n \n //Adding Simple Validation\n if(task == '')\n {\n alert(\"Task field is required\")\n e.preventDefault();\n }\n else if(task_date == '')\n {\n alert(\"Please Select Date\")\n e.preventDefault();\n }\n else if(task_time == '')\n {\n alert(\"Please select Time\")\n e.preventDefault();\n }\n else\n {\n //get the tasks\n tasks = JSON.parse(localStorage.getItem('tasks'));\n \n //check if null\n if (tasks == null){\n tasks = [];\n }\n \n //Create a task list\n //var taskList = JSON.parse(localStorage.getItem('tasks'));\n \n //New Task Object creation\n var newTask = {\n \"id\": id,\n \"task\": task,\n \"task_priority\": task_priority,\n \"task_date\": task_date,\n \"task_time\": task_time\n }\n \n //push the task into tasks array\n tasks.push(newTask);\n \n //store it onto localstorage\n localStorage.setItem('tasks',JSON.stringify(tasks));\n }\n \n }// function update task ends", "title": "" }, { "docid": "ce6c142460fbda2efe756d6d49cac2a3", "score": "0.65205663", "text": "updateData(newData) {\n let tasks = JSON.parse(localStorage.getItem('taskItems'));\n // Find task item and update data\n tasks.forEach(function(task) {\n if (task.id === newData.id) {\n task.name = newData.name;\n task.project = newData.project;\n task.priority = newData.priority;\n task.description = newData.description;\n }\n });\n // Update LS data array\n localStorage.setItem('taskItems', JSON.stringify(tasks));\n }", "title": "" }, { "docid": "d75bcea7dca6cc357a0118913cc1463f", "score": "0.649674", "text": "updateTask(task, taskListId) {\n return fetch(`${baseUrl}${taskListId}/tasks/${task.taskName}`, {\n method: 'PUT',\n body: JSON.stringify(task),\n headers: {\n 'Accept' : 'application/json',\n 'Content-Type': 'application/json'\n }\n })\n .then(res => res.json());\n }", "title": "" }, { "docid": "9cd7e8bbc1699dc5566a014a2f7cdd92", "score": "0.64667577", "text": "function setStatusClosed (id) { //pass the current task id as a parameter\n var tasks = JSON.parse(localStorage.getItem('tasks')); //retrive the task items in JSON format and passing the result to JSON.parse() method\n\n for (var i; i < tasks.length; i++) {\n if (tasks[i].id == id) {\n tasks[i].status = \"Closed\";\n }\n }\n localStorage.setItem('tasks', JSON.stringify(tasks)); //store the tasks items in tasks\n\n fetchTasks(); //Update the list output\n}", "title": "" }, { "docid": "607d64d7563216d6e5baf447aefe545a", "score": "0.6459929", "text": "function completeTask(taskId){\n $.ajax({\n method: 'PUT',\n url: `/tasks/${taskId}`,\n data: taskId\n })\n .then(response => {\n console.log(response);\n //updates task list on the DOM after deleting a task\n getTasks();\n })\n .catch(error => {\n console.log('Error updating tasks', error);\n });\n}//end completeTask", "title": "" }, { "docid": "3b641fe17ebef0ee11676e1c0cf01699", "score": "0.6446894", "text": "fixtasksIds() {\r\n let counter = 1;\r\n const tasksCopy = Object.values(this.tasks);\r\n let updgradedTasks = new Object();\r\n\r\n for ( let value of tasksCopy ) {\r\n updgradedTasks[counter++] = value;\r\n }\r\n\r\n this.tasks = updgradedTasks;\r\n this.taskId = counter;\r\n }", "title": "" }, { "docid": "badce31529e0caeb0615a3cf78c415ac", "score": "0.6446387", "text": "[REPLACE_TASKS] (state, payload) {\n state.tasks = payload.tasks;\n }", "title": "" }, { "docid": "ec756c2c08bbcc614909edbce882fc26", "score": "0.64346474", "text": "function update_task(task_text, task_prio, task_deadline, task_id) {\r\n let data = {\r\n 'action': 'todolist_update_task',\r\n 'task_text': task_text,\r\n 'task_prio': task_prio,\r\n 'task_deadline': task_deadline,\r\n 'task_id': task_id,\r\n }\r\n\r\n jQuery.post(ajaxurl, data, function (response) {\r\n const response_decoded = JSON.parse(response);\r\n // Append the list with the new task after it has been successfully added\r\n if (response_decoded.result === 'success') {\r\n const prio_class = get_prio_class(task_prio);\r\n\r\n let list_item = jQuery('.to-do-list__item[data-task-id=' + task_id + ']');\r\n list_item.removeClass();\r\n list_item.addClass('to-do-list__item');\r\n list_item.addClass(prio_class);\r\n jQuery(list_item).find('.to-do-list__item-title').html(task_text);\r\n jQuery(list_item).find('.to-do-list__priority').html(task_prio);\r\n jQuery(list_item).find('.to-do-list__deadline').html(response_decoded.date);\r\n jQuery(list_item).find('.to-do-list__deadline').attr('data-date', task_deadline);\r\n jQuery('.todolist-modal_edit input[type=text]').val('');\r\n jQuery('.todolist-modal_edit').hide();\r\n }\r\n }\r\n );\r\n }", "title": "" }, { "docid": "04de27909e8f4cad695b481e2fad53da", "score": "0.6407027", "text": "function listTasks(){\n}", "title": "" }, { "docid": "5d34a80171aa21f413a12e3710641783", "score": "0.64066035", "text": "async completeTask(t){\n await this.getTodo();\n t.completed = !t.completed;\n await fetch(`http://127.0.0.1:8000/api/todo/${t.id}/update`,{\n method: 'PUT',\n headers:{\n 'Content-Type': 'application/json',\n 'X-CSRFToken': csrftoken,\n },\n body: JSON.stringify(t)\n });\n\n await this.getTodo();\n }", "title": "" }, { "docid": "d0519a9baf79453937985462adf3ae3a", "score": "0.6383004", "text": "async updateTasks({ commit }, tasks) {\n for(const task of tasks){\n const response = await TasksService.updateTask(task).then((res) => {\n if(res != 404){\n commit('UPDATE_TASK', task)\n }\n return res\n })\n if (response == 404) {\n await TasksService.postTask(task).then(() => {\n commit('ADD_TASK', task)\n })\n }\n }\n }", "title": "" }, { "docid": "497257b5286bd7fb813efa24b9517e3f", "score": "0.6372253", "text": "editTask(state, { newTask, oldTask }) {\n state.tasks = state.tasks.filter((task) => task.id !== oldTask.id)\n state.tasks = state.tasks.concat(newTask)\n if (process.browser) {\n localStorage.setItem('tasks', JSON.stringify(state.tasks))\n }\n }", "title": "" }, { "docid": "32733a74680cfdd6d9b579dd1ed9ba01", "score": "0.63690865", "text": "async function updateTaskToInProgress(body) {\n body.status = 'inProgress';\n delete body.createdAt;\n delete body.updatedAt;\n\n await fetch(`${dbHost}/${body.objectId}`, {\n method: 'put',\n headers,\n body: JSON.stringify(body),\n });\n\n await loadTasks(startArticle, deleteArticle, finishArticle);\n}", "title": "" }, { "docid": "18114d87088e4ccff109f2c1c63fbf63", "score": "0.6357359", "text": "updateLocalStorage(){\n localStorage.setItem(\"taskList\",JSON.stringify(this.tasks))\n location.reload()\n }", "title": "" }, { "docid": "f1666136ee8863d59d877e9d2d5c315d", "score": "0.6357072", "text": "function update() {\n // Retrieve latest todo list\n $.getJSON( \"/todo/getList\", function(data) {\n var items = [];\n $.each( data, function( key, val ) {\n if (val['isComplete']) {\n items.push( \"<li id='\" + val['id'] + \"'>+ \" + val['name'] + \"</li>\" );\n } else {\n items.push( \"<li id='\" + val['id'] + \"'>x \" + val['name'] + \"</li>\" );\n }\n });\n\n // Clear the old\n $('ul').empty();\n\n // Put in list\n $( \"<ul/>\", {\n html: items.join( \"\" )\n }).appendTo( \"body\" );\n });\n\n setTimeout(update, 1000);\n }", "title": "" }, { "docid": "4de2309bdafc23997ab871593ad4b017", "score": "0.6347384", "text": "function completeTask() {\n var id = $(this).parent().data('id');\n console.log('this task id ', id);\n\n $.ajax({\n type: 'PUT',\n url: '/tasks/' + id,\n data: {taskID: id},\n success: getTasks,\n error: function() {\n console.log(\"unable to complete task\");\n }\n });\n}", "title": "" }, { "docid": "95b30dc890dc1b73bc4ce5f1abf7b46d", "score": "0.6328015", "text": "_stateChanged(state) {\n this._tasks = state.tasks.items;\n }", "title": "" }, { "docid": "542f39e0238f9128397bff70badcda2c", "score": "0.6326307", "text": "function sendTasksUpdate() {\n log('Sending device update')\n scheduled_task_update = null\n outbox.enqueueFile(PERSISTANCE_PATH, 'device_state')\n\n}", "title": "" }, { "docid": "22728156db8c2463d1e9bc9ae0a6f205", "score": "0.6325765", "text": "editTask(){\n\t\tthis.task.editItems(this.el.form.dataset.id, this.el.taskTitle.value, this.el.taskProject.value, this.el.taskTime.value );\n\t}", "title": "" }, { "docid": "bfaca85648435af2a06c3a016feaac21", "score": "0.63257116", "text": "addTaskActiveClick() {\n let array_size = this.tasks.length;\n for (let i = 0; i < array_size; i++) {\n if (!this.tasks[i].isComplete) {\n this.loadToDoList3();\n // alert(this.tasks[i].task);\n\n\n }\n }\n }", "title": "" }, { "docid": "7b08fb1288b5ab1d08f02241b7e188ce", "score": "0.6325528", "text": "addTask(title) {\n const tasks = this.tasks.slice();\n tasks.push({\n created: +new Date(),\n title,\n done: null\n });\n this.tasksUpdated.next(tasks);\n }", "title": "" }, { "docid": "73c72527276ddfd3d12c476792ab1aa2", "score": "0.6320121", "text": "async function queryListTasks() {\n await api.get('/api/task/', {\n }).then(function (response) {\n setTasks(response.data)\n setLoadingList(false)\n }).catch(function (error) {\n if (error) {\n alert('Ocorreu um erro por favor entre em contato com desenvolvedor.')\n }\n });\n }", "title": "" }, { "docid": "a3956470402272bc1b629c185e20fa39", "score": "0.6314009", "text": "function changeTaskCountInList(task, newTask) {\n if (task.listId !== newTask.listId) {\n // change first list\n ModelList.findByIdAndUpdate(task.listId, {\n $inc: { taskCount: -1 } },\n { new: true },\n (error, list) => {\n io.emit('lists_changed', { obj: list, key: 'taskCount' });\n });\n // change second list\n ModelList.findByIdAndUpdate(newTask.listId, {\n $inc: { taskCount: 1 } },\n { new: true },\n (error, list) => {\n io.emit('lists_changed', { obj: list, key: 'taskCount' });\n });\n }\n }", "title": "" }, { "docid": "8556a16658783eddc34dc3e058afe4a7", "score": "0.63139296", "text": "function update_task(task_id,task_status)\n{\n var task = JSON.parse(localStorage.getItem(task_id));\n task.done = task_status;\n localStorage.setItem(task_id,JSON.stringify(task));\n\n}", "title": "" }, { "docid": "f18a72f0552a6a92efac87c3afb786e5", "score": "0.63133997", "text": "async updateTask() {\n // Add an if statement here that checks if an object has been marked complete?\n // A button will then change the status with this function? \n try {\n const response = await db.any(\n `UPDATE tasks \n SET completion_status = true\n WHERE user_id = '${this.user_id}';`\n )\n return response;\n\n } catch(error) {\n console.error('ERROR: ', error);\n return error\n }\n }", "title": "" }, { "docid": "ec3c7a678da22029127436cfc711960a", "score": "0.63033134", "text": "editTask(state, payload) {\n state.todos[payload.todoIndex].tasks = payload.tasks;\n }", "title": "" }, { "docid": "d6d30b1449fc851a8df953f945fc594a", "score": "0.62955844", "text": "function _tasksUpdateCallback(err) {\n count++;\n if ( !returned ) {\n if ( err ) {\n returned = true;\n return callback(err);\n }\n else if ( count === calls ) {\n returned = true;\n _parseTasks();\n return callback(null, TASKS);\n }\n }\n }", "title": "" }, { "docid": "f266da0d1acde219fdbcbfaa023d9c62", "score": "0.629473", "text": "handleTaskStatusChange(taskId) {\r\n const tasks = this.state.tasks.map(task => {\r\n if (task.id === taskId) {\r\n task.done = !task.done;\r\n }\r\n return task;\r\n });\r\n this.setState({\r\n tasks: tasks\r\n });\r\n }", "title": "" }, { "docid": "51892fe69ff6290148fded6c8a298bcc", "score": "0.6292789", "text": "function loadTasks(data) {\n\t_tasks = data;\n}", "title": "" }, { "docid": "312510e08ed90f7241ecbce92e695864", "score": "0.6290304", "text": "function updateData() {\n if (!vm.enableDeadline) {\n vm.task.deadline = null;\n }\n TodoLists.saveData();\n }", "title": "" }, { "docid": "3c37cf58800fb00447fae52d4a8d6d74", "score": "0.62879217", "text": "function updateCompleted () {\n let id = $(this).parent().data('id');\n $.ajax({\n method: \"PUT\",\n url: '/tasks/' + id,\n data: {taskFinished: checked},\n success: function (response) {\n console.log('successful PUT', response);\n completed;\n }\n })\n}", "title": "" }, { "docid": "a9eb95019d2285c7a814da7f991183a7", "score": "0.62763786", "text": "addToList() {\r\n if (this.newTask == '') {\r\n }\r\n else {\r\n this.items.push(this.newTask);\r\n this.newTask = '';\r\n }\r\n }", "title": "" }, { "docid": "4ef5aff5ab3910ccbc11b5006143d0ba", "score": "0.6271075", "text": "function updateDatasetTaskList() {\n var taskList = $('#dataset-task-list');\n if (taskList.length === 0)\n return;\n\n var ajax_url = taskList.attr('data-fetch-url');\n\n taskList.load(ajax_url,\n function() {\n $(this).data('timeout', window.setTimeout(updateDatasetTaskList, 4000));\n });\n}", "title": "" }, { "docid": "16c46f8ea3c031b2f59a7a210daec84b", "score": "0.6268511", "text": "function changeStatus(taskId) {\n $.ajax({\n method: \"PUT\",\n url: `/tasks/${taskId}`,\n })\n .then((response) => {\n console.log(\"Task status change:\", response);\n getTasks(); //update display\n })\n .catch((error) => {\n alert(\"Something went wrong\", error);\n });\n}", "title": "" }, { "docid": "914245ac4b18b0e03bfde2d19c6928f0", "score": "0.6260752", "text": "function initializeTasks() {\n $scope.tasks = TaskService.all();\n $scope.newTask = {id: $scope.tasks.length, name: \"\", type: 0, duration: 0, from: \"\", to: \"\"};\n }", "title": "" }, { "docid": "a696fa4a898065b4292e2a1a7d2c2fd4", "score": "0.6255926", "text": "_saveTasks()\n {\n console.log('saving');\n console.log(this.state.dateNewTasks);\n this.state.tasks = this.state.tasks.map(\n e=>\n {\n if (e.order==0)\n {\n e.actif= true;\n }\n\n return e;\n }\n )\n\n h.addTasks(this.state.tasks,this.state.dateNewTasks).then(\n data =>\n Alert.alert(\"Success\",\"Tasks for \"+ h.formatDate(this.state.dateNewTasks)+ \" is added succesflulu!!! \",[ {text: 'Ok', onPress: () => this._finish()},]),\n ).catch(\n err =>\n\n { \n console.warn(err); \n Alert.alert(\"Failure\",\"Failed to save datas!!\",[{text: 'Cancel'}, {text: 'Retry', onPress: () => this._saveTasks()}],{cancelable: true})\n\n } \n);\n\n\n \n \n }", "title": "" }, { "docid": "c3b4875a56054b5bd7ea26b4bc11fe42", "score": "0.62549704", "text": "function completeTask (){\n \n console.log('in complete task', $( this ).data( 'id' ) )\n let id= $( this ).data( 'id' )\n $.ajax({\n type: 'PUT',\n url: '/todo/' + id,\n }).then( function( response ){\n console.log( 'back from PUT with:', response );\n refreshTaskList();\n }).catch( function( err ){\n console.log( err );\n alert( 'nope...' );\n })\n}", "title": "" }, { "docid": "ea89156a45ba6bd663152acc92899e52", "score": "0.62481236", "text": "updateTaskList(empId, todo, done) {\n this.taskService.updateTask(this.empId, this.todo, this.done).subscribe(res => {\n this.employee = res.data;\n }, err => {\n console.log(err);\n }, () => {\n this.todo = this.employee.todo;\n this.done = this.employee.done;\n console.log('This ' + this.employee.todo + this.employee.done + ' have been updated.');\n });\n }", "title": "" }, { "docid": "30bbe668871c90feafa9d3bfd870f12a", "score": "0.62417775", "text": "function ToDoList() {\n this.tasks = [],\n this.currentId = 0\n}", "title": "" }, { "docid": "b287c1cdaa38c480d8b3c7c7e7afbd16", "score": "0.6241037", "text": "function addStoredTasksToUI() {\n if (taskArr.active.length > 0) {\n for (item of taskArr.active) {\n addTaskToUI(item, \"active\");\n }\n }\n if (taskArr.completed.length > 0) {\n for (item of taskArr.completed) {\n addTaskToUI(item, \"completed\");\n }\n }\n}", "title": "" }, { "docid": "7116e9ca28958d1e61d62d00f580b2a8", "score": "0.6228751", "text": "setTasks(state, { tasks, statusId }) {\n state.tasks = state.tasks.filter((task) => task.statusId !== statusId)\n const newTask = tasks.map((task) => {\n return {\n ...task,\n statusId,\n }\n })\n state.tasks = state.tasks.concat(newTask)\n if (process.browser) {\n localStorage.setItem('tasks', JSON.stringify(state.tasks))\n }\n }", "title": "" }, { "docid": "82b4e3f25e705fc984cafa1cf514d344", "score": "0.6221753", "text": "completeTask(id) {\n let newTasks = this.state.tasks.filter(task => {\n if (task.id === id) {\n task.completed = 1 - task.completed;\n return task;\n }\n\n return task;\n });\n\n this.setState({ tasks: newTasks }, () => {\n localStorage.setItem(\"tasks\", JSON.stringify(this.state.tasks));\n });\n }", "title": "" }, { "docid": "cad8d5beb42ae5356a3512e6785b2c5b", "score": "0.6220472", "text": "function updateTask(task, callback) {\n var url = getBaseUrl();\n $.post(url, JSON.stringify(task), function(res) {\n handleSuccess('Task updated.');\n var taskIndex = tasks.indexOf(task);\n tasks[taskIndex] = res.obj;\n var taskItem = findTaskItem(task.id);\n addTask(res.obj, taskItem);\n if (callback) {\n callback(res.obj);\n }\n }).fail(function(error){\n handleError(error);\n });\n}", "title": "" }, { "docid": "b18d9177221d384a16abaa876c028782", "score": "0.62198806", "text": "function _parseTasks() {\n for ( let i = 0; i < TASKS.length; i++ ) {\n let list = LISTS[TASKS[i].list_id];\n if ( list === undefined ) {\n list = {\n id: TASKS[i].list_id,\n name: \"List #\" + TASKS[i].list_id\n }\n }\n TASKS[i]._list = list;\n }\n }", "title": "" }, { "docid": "95157993191266e638a3b2894ed7b47c", "score": "0.6215911", "text": "updateTodo(data){\n // get a reference to the current todos list\n let todos = this.state.todos;\n // Find the updated todo in our todos list, by it's provide id\n let todoIndex = _.findIndex(todos, {_id: data._id});\n\n // Update the task's completd status, based on the updated task's completed status.\n todos[todoIndex].completed = data.completed;\n\n // Update the state so that the todo's list will re-render and be to date.\n this.setState({\n todos: todos\n });\n }", "title": "" }, { "docid": "390f61b566df0e4da8774bfec7c3000e", "score": "0.6212917", "text": "updateTask(empId, todo, done) {\n return this.http.put('/api/employees/' + empId + '/tasks', {\n todo,\n done\n });\n }", "title": "" }, { "docid": "9156584dd5fb05aaa43815ac89d35f29", "score": "0.6211607", "text": "function updateStorage() {\n localStorage.setItem('tasks', JSON.stringify(taskManager.taskList));\n}", "title": "" }, { "docid": "74fcd5cfc7d740523faaaa824c807842", "score": "0.620833", "text": "patch(tasksId) {\n return fetch(`http://localhost:5002/tasks/${tasksId}`, { method: \"PATCH\", headers: { \"Content-Type\": \"application/json\" }, body: JSON.stringify({ \"complete\": true }) })\n }", "title": "" }, { "docid": "4f49fea3a4e15f481e41def47d60cc8d", "score": "0.62025464", "text": "addTask(task) {\n this.taskList[task.id] = task;\n }", "title": "" }, { "docid": "6dcc270c610bb88f2915e8e3c6959bf1", "score": "0.61829597", "text": "function assignActiveList() {\n\tassignTasksToList(tasks.active, activeList, appendToActiveList);\n\thideClearBtns();\n}", "title": "" }, { "docid": "cdc085c4a2018ac25ec512d027333bd8", "score": "0.61744887", "text": "saveTask(oldTask, newTask) {\n fetch('/tasks/edit/' + oldTask + '/' + newTask, {method: 'PUT'})\n .then((response) => response.json())\n .then((responseData) => {\n console.log(\"UPDATE COMPLETION\", responseData);\n this.fetchTasks();\n })\n .catch((err) => {\n throw new Error(err);\n });\n }", "title": "" }, { "docid": "24422828b2a5a54fefab100948780a0f", "score": "0.6174198", "text": "async function statchangecall(){\n \n\n await fetch(\"/statusupdate\", {\n method: \"put\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"iCareerD \" + localStorage.getItem(\"jwt\")\n },\n body: JSON.stringify({\n status: selectedValue,\n taskid: movetask,\n }),\n })\n .then((res) => res.json())\n .then((data) => {\n if (data.error) {\n // M.toast({html: data.error,classes:\"#c62828 red darken-3\"})\n console.log(data.error);\n } else {\n\n let newtaskData=taskData.map(item=>{\n if(item._id===movetask){\n item.status=selectedValue;\n }\n return item;\n })\n \n // console.log(newtaskData);\n settaskData(newtaskData)\n \n // console.log(\"----------------------\");\n \n }\n })\n .catch((err) => {\n console.log(err);\n });\n\n \n }", "title": "" }, { "docid": "c307f9659c88e7fb4fb1b6cd0a2a3f8d", "score": "0.61740786", "text": "addSubtask(arr, currTask, newTaskName) {\n var newSubtask = {\n name: newTaskName,\n id: Object(uuid__WEBPACK_IMPORTED_MODULE_6__[\"v4\"])(),\n inUser1List: false,\n inUser2List: false,\n done: false\n };\n currTask.subtasks.push(newSubtask);\n this.updateFirestore(arr);\n this.newTaskName = '';\n }", "title": "" }, { "docid": "8a1d0fe094eecc12e60725de02ac3942", "score": "0.61672145", "text": "function updateBoard() {\n\n ClearBoard();\n for (let i = 0; i < alltasks.length; i++) {\n\n let currentid = alltasks[i].taskid; //current id = id of element no. 'i' in array, changes each iteration\n let currenttask = alltasks[currentid]; //currenttask = task-element with id 'currentid' in array, changes each iteration\n let taskauthorposition = currenttask.taskauthorid;\n let taskauthor = users[taskauthorposition];\n if (currenttask.taskstatus == 'todo') { //status todo\n UpdateTodo(currenttask, currentid, taskauthor);\n }\n else if (currenttask.taskstatus == 'inprogress') { //status inprogress\n UpdateInprogress(currenttask, currentid, taskauthor);\n }\n else if (currenttask.taskstatus == 'testing') { //status testing\n UpdateTesting(currenttask, currentid, taskauthor);\n }\n else if (currenttask.taskstatus == 'done') { //status done\n UpdateDone(currenttask, currentid, taskauthor);\n }\n }\n}", "title": "" }, { "docid": "ede225bd8eab8b31dd5b741ba5ffbc9b", "score": "0.6161049", "text": "function updateTask(task, callback) {\n database.serialize(function() {\n var expiry_time = getExpiryTime(task);\n var update_task = \"UPDATE \"+table_name+\" SET task = ?, \"\n +\"at = datetime(\"+expiry_time+\") WHERE \"+table_name+\".id = ?\";\n\n log.debug('sqlite-adapter','Running query:',update_task);\n database.run(update_task, JSON.stringify(task), task.id, function(error) {\n if (error) {\n callback(error);\n }\n callback(error, this.changes);\n });\n });\n }", "title": "" }, { "docid": "2c1e686216be0011e6161c03e2e72620", "score": "0.6157832", "text": "function success(json_obj) {\n //so now update the task object in the array we already have with the update, then tell the UI to update that task\n self.tasks[task_id].task = data_to_send_obj.task_name;\n self.tasks[task_id].SetEndDateTimeFromMySQL(data_to_send_obj.date_time_end);\n //then tell main this task needs to be updated in the UI\n self.SetTaskUIFromTask($(\"#task-\" + task_id), self.tasks[task_id]);\n }", "title": "" }, { "docid": "d58435f0cfb0bde930ce71e9d58d7f80", "score": "0.61525893", "text": "function toggleStatus(index){\n\t\tvar item = taskList[index];\n\t\titem[\"isDone\"] = !item[\"isDone\"];\t\t\n\t\ttaskList[index] = item;\n\t\t\n\t\tlocalStorage.setItem(\"MyTaskList\", JSON.stringify(taskList));\t\t\n\t\tgetTaskList(false);\n\t}", "title": "" }, { "docid": "a98a1c0c8b27bb86e02bd62b177aeb52", "score": "0.6152072", "text": "function updateTaskCall(task, callback) {\n let jwt = localStorage.getItem('authToken')\n var tokens = jwt.split('.')\n\n const query =\n {\n id: JSON.parse(atob(tokens[1])).user.id,\n date: localStorage.getItem('dateOfBtn'),\n description: task,\n }\n\n localStorage.removeItem('dateOfBtn');\n\n const settings =\n {\n url: '/put/tasks',\n data: JSON.stringify(query),\n contentType: 'application/json',\n dataType: 'json',\n type: 'PUT',\n success: callback,\n error: function (e) {\n window.alert('FAILED TO UPDATE TASK! PLEASE TRY AGAIN OR CONTACT DEVELOPER IF PROBLEM PERSISTS!')\n }\n }\n\n $.ajax(settings)\n }", "title": "" }, { "docid": "579013b39a7a36206498fc8e34992daf", "score": "0.6151984", "text": "function resetCurrentQuantities() {\n\n tasks.map(task => {\n const path = `${accessUrl}/${task[0]}`;\n firebase.database().ref(path).set({\n ...task[1],\n currentQuantity: 0,\n })\n .then(() => window.location.reload(false))\n })\n }", "title": "" }, { "docid": "2b0c13ac960375618c7d8e2937a215df", "score": "0.61474377", "text": "function assignCompletedList() {\n\tassignTasksToList(tasks.completed, completedList, appendToCompletedList);\n\thideClearBtns();\n}", "title": "" }, { "docid": "1027b1aa3dfd95f3bc9fe5eb1adfc7bd", "score": "0.6141741", "text": "function refreshDailyTasks(){\n for (let i = 0; i < calendarTasks.length; i++) {\n calendarEntry = calendarTasks[i];\n var entryId = \"#\" + calendarEntry.id;\n var entryTasks = calendarEntry.tasks;\n\n // put the tasks into the textarea with matching id\n // console.log(entryId + \" - \" + entryTasks);\n $(entryId).text(entryTasks);\n }\n}", "title": "" }, { "docid": "8749737db6e051799ba5da30e3d54099", "score": "0.61338466", "text": "function markComplete(e) {\n var id = e.target.parentElement.id;\n task_array = task_array.map(x => {\n if (x.title === id) x.status = \"completed\";\n return x;\n })\n create_list();\n}", "title": "" }, { "docid": "fdff44d096685cdf9f4822ba16869b48", "score": "0.61313623", "text": "updateTask() {\n \tAxios.put(document.pageUrls.tasks_update + '/' + this.task.id, this.task)\n\t \t.then(res => {\n\t \t\talert('Updated');\n\t \t})\n\t \t.catch(err => {\n\t \t\talert(err.message);\n\t \t});\n\n \tthis.formMode = 0;\n }", "title": "" }, { "docid": "4cd51586bc5a90774e222ea4d19c821e", "score": "0.6129576", "text": "function loadTasks() {\n var tempTasks = null;\n\n localStorage.getItem(\"storedTasks\", tempTasks);\n\n if (tempTasks != null) {\n updateTasks(JSON.parse(tempTasks));\n } else {\n console.log(\"No tasks yet\");\n }\n }", "title": "" }, { "docid": "01b9b2fd24cadd28dccab344897dc289", "score": "0.61242765", "text": "REORDER_TASKLIST_ITEMS(state, payload) {\n const board = state.boards.find(b => b.id == payload.boardId)\n const listIdx = board.lists.findIndex(l => l.id == payload.listId)\n Vue.set(board.lists[listIdx], \"items\", payload.items)\n }", "title": "" }, { "docid": "27db5e4845881bbb631ec62c312ba158", "score": "0.6123889", "text": "function updateNumbers() {\n\tvar tasks = JSON.parse(localStorage.getItem('todoList')) || [];\n\ttasks = revive(tasks);\n\tvar countToComplete = 0;\n\tvar countCompleted = 0;\n\ttasks.forEach(function(task) {\n\t\tif (task.isNew()) {\n\t\t\tcountToComplete++;\n\t\t} else if (task.isComplete()) {\n\t\t\tcountCompleted++;\n\t\t}\n\t});\n\tdocument.getElementById('completed-heading').innerHTML = countCompleted + ' task(s) completed in all.';\n\tdocument.getElementById('tocomplete-heading').innerHTML = countToComplete + ' task(s) remaining.';\n}", "title": "" }, { "docid": "22cd9b335c2c8b4eb6761f2451fd4fa7", "score": "0.6123129", "text": "addUpdateTaskChunks (state, { taskChunks }) {\n taskChunks.forEach(taskChunk => {\n let oldTaskChunk = state.taskChunks[taskChunk.id]\n\n if (oldTaskChunk !== undefined) {\n let oldDay = formatDayString(oldTaskChunk.day)\n Vue.delete(\n state.dayOrders[oldDay],\n state.dayOrders[oldDay].indexOf(oldTaskChunk.id))\n }\n\n Vue.set(\n state.taskChunks,\n taskChunk.id,\n taskChunk)\n\n let day = formatDayString(taskChunk.day)\n if (state.dayOrders[day] === undefined) {\n Vue.set(state.dayOrders, day, [])\n }\n state.dayOrders[day].splice(\n insertIndex(state.dayOrders[day], taskChunk, state.taskChunks),\n 0,\n taskChunk.id\n )\n })\n\n state.ready = true\n }", "title": "" }, { "docid": "e4e1aa90698b7366c3992e5d9e3d3488", "score": "0.6121801", "text": "function editTask(id, newName) {\n const editedTaskList = tasks.map(task => {\n // if this task has the same ID as the edited task\n if (id === task.id) {\n //\n return {...task, name: newName}\n }\n return task;\n });\n setTasks(editedTaskList);\n }", "title": "" }, { "docid": "e4e1aa90698b7366c3992e5d9e3d3488", "score": "0.6121801", "text": "function editTask(id, newName) {\n const editedTaskList = tasks.map(task => {\n // if this task has the same ID as the edited task\n if (id === task.id) {\n //\n return {...task, name: newName}\n }\n return task;\n });\n setTasks(editedTaskList);\n }", "title": "" }, { "docid": "22e9069f342772cd0967b268e106232d", "score": "0.6119877", "text": "function addToActiveTaskList(task) {\n if (task !== \"\") {\n if (taskBeingEdited === null) {\n let newTask = new Task(task);\n taskListActive.push(newTask);\n localStorage.setItem(\"activeTasks\", JSON.stringify(taskListActive));\n } else {\n taskBeingEdited.task = task;\n taskListActive.push(taskBeingEdited);\n taskBeingEdited = null;\n localStorage.setItem(\"activeTasks\", JSON.stringify(taskListActive));\n } \n } else {\n alert('Enter the task please!');\n }\n return;\n}", "title": "" }, { "docid": "c0abc5d12970d5e06ad80688551481fb", "score": "0.61125267", "text": "function fetchTasks() {\n $scope.model.haveFetchedTasks = true;\n\n return spUserTask.getPendingTasksForRecord($scope.model.id)\n .then(function (tasks) {\n if (tasks && tasks.length) {\n $scope.model.taskInfo.taskList = tasks;\n }\n });\n }", "title": "" }, { "docid": "b35126e501b7fe937a621135797322fc", "score": "0.61095107", "text": "function completeTask() {\n var listItem = this.parentNode;\n completeTasks.appendChild(listItem);\n bindTasksEvents(listItem, incompleteTask);\n save();\n }", "title": "" }, { "docid": "1e5e7d0f3d27670bb0691a20ca867d6f", "score": "0.61067456", "text": "function loadTasks() {\n API.getTasks()\n .then(res => \n setTasks(res.data)\n )\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "c20978fde1fa1d28190f881c4b8f0a4c", "score": "0.61000234", "text": "constructor( list = {}){ \n list.forEach( task => {\n this.#list[task.id] = task;\n }); \n }", "title": "" }, { "docid": "fa05544e22a461a2832c1da9b1b73e28", "score": "0.6087445", "text": "function updateTask(task) {\n if (task.deletedFromDom && !task.deletedFromDb\n && task.inDb) {\n // if task is marked as deleted but not yet \n // deleted from the database, delete from the database\n task.documentRef.delete()\n .then(() => { task.deletedFromDb = true; });\n } else if (task.addedToDom && !task.inDb \n && !task.deletedFromDom) {\n // If task is new, add to the database\n db.collection(\"users\").doc(userId)\n .collection(\"tasks\").add({\n dateOfTask: task.date,\n description: task.listElement.value,\n status: \"incomplete\"\n })\n .then((docRef) => {\n task.documentRef = docRef;\n task.inDb = true;\n });\n } else if (!task.deletedFromDom && !task.deletedFromDb\n && task.inDb) {\n // If task not deleted from the database or dom, update\n // to match the text currently on the page\n task.documentRef.update({\n description: task.listElement.value\n }).catch(error => console.log(error));\n }\n}", "title": "" }, { "docid": "eb253ec81a4928ad4ce719efa1b4e7fa", "score": "0.60837346", "text": "function updateTaskTable() {\n $.ajax({\n url: \"rest/tasks/\"+localStorage.getItem(\"currentUserName\"),\n cache: false,\n success: function(data) {\n $('#members').empty().append(buildTaskRows(data));\n },\n error: function(error) {\n //console.log(\"error updating table -\" + error.status);\n }\n });\n}", "title": "" }, { "docid": "943fcb9c7d92645cad9ac631fc21dc85", "score": "0.6083121", "text": "async store() {\n const tasks = JSON.stringify(this.tasks);\n await game.user.setFlag(\"fvtt-keikaku\", \"tasks\", tasks);\n }", "title": "" }, { "docid": "49ec3f006ed40822c9f38b5d122142d2", "score": "0.6079867", "text": "function addToTaskList() {\n console.log('submit triggers addtoTaskList');\n let taskName = taskForm.querySelectorAll('[name=\"name\"]')[0].value.toLowerCase();\n let taskDesc = taskForm.querySelectorAll('[name=\"description\"]')[0].value.toLowerCase();\n let taskDue = taskForm.querySelectorAll('[name=\"dueDate\"]')[0].value.toLowerCase();\n let taskProj = taskForm.querySelectorAll('[name=\"project\"]')[0].value.toLowerCase();\n\n let newTask = taskFactory(taskName, taskDesc, taskDue, 'incomplete', taskProj);\n taskList.push(newTask);\n localStorage.setItem('taskList', JSON.stringify(taskList));\n}", "title": "" }, { "docid": "693f8ab2a6b6c086ef2ba60b93534884", "score": "0.6076409", "text": "function updateTask(){\r\n\tif(deactive && \r\n\t\tactiveInc++%32){\r\n\t\treturn;\r\n\t}\r\n\tinc++\r\n\tvar i = elementList.length;\r\n\tvar cont = true;\r\n\t//try{\r\n\t//var t = new Date();\r\n\twhile(i--){\r\n\t\tvar el = elementList[i];\r\n\t\tel && updateElement(el,configList[i]);\r\n\t}\r\n//\tswitch(CS.ieVersion){\r\n//\t\tcase '7':\r\n//\t\tcase '8':\r\n//\t\t//attribute NOTIFY\r\n//\t\tif(attrFixInc++ % 8 ==0)\r\n//\t\tdocument.documentElement.className+=''\r\n//\t\t//document.documentElement.offsetTop\r\n//\t}\r\n\t//t = new Date() -t;\r\n\t\r\n\t//}catch(e){cont = cont && confirm(e.message);}\r\n\tforceUpdate = false;\r\n}", "title": "" }, { "docid": "1a08aac7540edbc836632b2f93e5f332", "score": "0.6064974", "text": "function updateTask() {\n if (finishedTasks.length == Configuration.tasks) return false;\n\n if (startTask > 0) {\n newTask = startTask;\n } else {\n var newTask = Math.floor(Math.random() * Configuration.tasks + 1);\n while (finishedTasks.indexOf(newTask) >= 0) {\n newTask = Math.floor(Math.random() * Configuration.tasks + 1);\n }\n }\n task = newTask;\n finishedTasks.push(task);\n\n return true;\n }", "title": "" }, { "docid": "e9677c32f6ec98c0a89e6149a2f2d445", "score": "0.6064791", "text": "function onTasksChange() {\n\n setTitle(\n persistance.active_section.name,\n persistance.active_section.color,\n )\n\n view_tasks = []\n persistance.tasks.forEach((task) => {\n if (task.section != persistance.active_section.id) {\n return\n }\n view_tasks.push(task)\n })\n\n view_tasks.sort((a, b) => {\n if (a.done > b.done) return 1\n if (a.done < b.done) return -1\n\n if (a.order > b.order) return 1\n if (a.order < b.order) return -1\n return 0\n })\n\n // The virtual tile view is moved down to not overlap with the header\n // so in order to compensate bottom scroll we add a footer\n task_list.length = view_tasks.length + 1;\n persistanceSave()\n}", "title": "" } ]
e46cb0a5081f000e94919be6e285d3d7
I choose this to center the content in a terminal resolution width of 80 character
[ { "docid": "b9e97dfa1f05611bd0b2f020b4dfaa0d", "score": "0.0", "text": "function printProgress(ratio) {\n\n var position = Math.floor(SCREEN_WIDTH * ratio);\n\n var past = '';\n var remaining = '';\n\n for (var i = 0; i < position; i++)\n past += '-';\n\n if (position < SCREEN_WIDTH - 1 && position != 0) {\n past += 'o';\n for (var i = position + 1; i < SCREEN_WIDTH; i++) // I use position + 1 so not to exceed 68 characters (SCREEN_WIDTH)\n remaining += '-';\n } else {\n for (var i = position; i < SCREEN_WIDTH; i++)\n remaining += '-';\n }\n\n console.log(whitespace + past.green.bold + remaining.bold);\n}", "title": "" } ]
[ { "docid": "2f68cce397a40f8e65ead73e93b5f8da", "score": "0.7355841", "text": "function console_center(text)\n{\n\tconsole.right((console.screen_columns - console.strlen(text)) / 2);\n\tconsole.print(text);\n\tconsole.crlf();\n}", "title": "" }, { "docid": "682019c0f5484f8bbde0f6676ceee7ab", "score": "0.66600555", "text": "function center(str) {\n var padding = 0;\n\n padding = Math.floor((totCols - stringDisplayLength(str)) / 2);\n if (padding > 0) {\n colOffset = padding;\n }\n return str;\n }", "title": "" }, { "docid": "687790b06c261eba6ef12a70e4dec1d0", "score": "0.6480993", "text": "centerText() {\n const width = this.text.width / 2; // get the half width\n const height = this.text.height / 2; // get the half height\n\n this.text.setPosition(this.x - width, this.y - height); // set the position from the center of the image minus the half width & height\n }", "title": "" }, { "docid": "2834a55655cdbb161616ad10de877e86", "score": "0.6407174", "text": "function drawCenterText(text, x, y, width) {\n var textdim = context.measureText(text);\n context.fillText(text, x + (width - textdim.width) / 2, y);\n }", "title": "" }, { "docid": "bc915b9ad1e81f22dfefb11e081bcc7c", "score": "0.637247", "text": "function drawCenterText(text, x, y, width) {\n var textdim = context.measureText(text);\n context.fillText(text, x + (width - textdim.width) / 2, y);\n }", "title": "" }, { "docid": "39c57bf8c5f9db7f336b1dcccda23f23", "score": "0.63351476", "text": "function drawCenterText(text, x, y, width) {\n var textdim = context.measureText(text);\n context.fillText(text, x + (width-textdim.width)/2, y);\n\n }", "title": "" }, { "docid": "c578e68cea71a4dcdc71d814141a750f", "score": "0.6240523", "text": "set Center(value) {}", "title": "" }, { "docid": "f08303267163a06f6670f0c704203a29", "score": "0.6228246", "text": "function drawCenterText(text, x, y, width) {\n var textdim = context.measureText(text);\n context.fillText(text, x + (width - textdim.width) / 2, y);\n}", "title": "" }, { "docid": "8b0fc5a7bf0bbf8d0beebff78b4edee5", "score": "0.61946994", "text": "function center(x) { \n currentAlignment = alignCenter \n}", "title": "" }, { "docid": "8ec6bc343c1c3af7523689fd74ca4e13", "score": "0.61507624", "text": "centerLetter() {\n this.g.position.x = calligraphyContainerEl.offsetWidth / 2;\n }", "title": "" }, { "docid": "9f7e68c2c201e5a825cc68173306181b", "score": "0.60470957", "text": "function alignCenterSel() {\n\trichTextBox.document.execCommand('justifyCenter',false,null);\n}", "title": "" }, { "docid": "066af15a53fe600c1a518a28f9b251ce", "score": "0.60378426", "text": "function CENTER$static_(){TextAlign.CENTER=( new TextAlign(\"center\"));}", "title": "" }, { "docid": "d4925d730c788947cdab03adcbc6dfd1", "score": "0.6036384", "text": "set center(value) {}", "title": "" }, { "docid": "3ac918bfd988bdebc4380e7e5b0c8b38", "score": "0.59697384", "text": "function centerText(ctx, text, y) {\n \tvar measurement = ctx.measureText(text);\n \tvar x = (ctx.canvas.width - measurement.width) / 2;\n \tctx.fillText(text, x, y);\n }", "title": "" }, { "docid": "be315a05227b561421622692970c5de9", "score": "0.5948898", "text": "function get_char_width(){var $prompt=self.find('.cmd-prompt');var html=$prompt.html();$prompt.html('<span>&nbsp;</span>');var width=$prompt.find('span')[0].getBoundingClientRect().width;$prompt.html(html);return width;}// ---------------------------------------------------------------------", "title": "" }, { "docid": "5af176e5da2698989a7367fbfd455079", "score": "0.5694861", "text": "function center (row, fg, bg, text) {\n const x = (WIDTH >> 1) - (text.length >> 1);\n for (let i = 0 ; i < text.length ; i++) {\n buffer[row][x+i] = {\n character: text[i],\n foreground: fg,\n background: bg\n };\n }\n}", "title": "" }, { "docid": "e676c2a36d241aba5a4a9e841b89fcbd", "score": "0.5667528", "text": "textW() {\n return textWidth(this.displayTxt);\n }", "title": "" }, { "docid": "e68cfc9fe7eee13ca41861894aba1aa8", "score": "0.5638684", "text": "function get_char_size(term){var rect;if(terminal_ready(term)){var $prompt=term.find('.cmd-prompt').clone().css({visiblity:'hidden',position:'absolute'});$prompt.appendTo(term.find('.cmd')).html('&nbsp;');rect=$prompt[0].getBoundingClientRect();$prompt.remove();}else{var temp=$('<div class=\"terminal terminal-temp\"><div class=\"terminal-'+'wrapper\"><div class=\"terminal-output\"><div><div class=\"te'+'rminal-line\" style=\"float: left\"><span>&nbsp;</span></div'+'></div></div></div>').appendTo('body');temp.addClass(term.attr('class')).attr('id',term.attr('id'));if(term){var style=term.attr('style');if(style){style=style.split(/\\s*;\\s*/).filter(function(s){return!s.match(/display\\s*:\\s*none/i);}).join(';');temp.attr('style',style);}}rect=temp.find('.terminal-line')[0].getBoundingClientRect();}var result={width:rect.width,height:rect.height};if(temp){temp.remove();}return result;}// -----------------------------------------------------------------------", "title": "" }, { "docid": "7b7c2c1049c030f5312e3f24ee9682f0", "score": "0.5623408", "text": "function calculateDisplayTitle(text,charwidth,barWidth){\n\n var textWidth = Math.ceil(text.length * charwidth);\n var display_title = \"\";\n\n if(textWidth < barWidth){ display_title = text;}\n\n else{\n display_title = text.substring(0,(barWidth/charwidth - 2)) //Space for \"...\"\n if(display_title.length > 0) display_title += \"...\"\n }\n return display_title;\n }", "title": "" }, { "docid": "e116744c79fc70c00a3a697e0ce22bf7", "score": "0.5616234", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "e116744c79fc70c00a3a697e0ce22bf7", "score": "0.5616234", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "e116744c79fc70c00a3a697e0ce22bf7", "score": "0.5616234", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "e116744c79fc70c00a3a697e0ce22bf7", "score": "0.5616234", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "e116744c79fc70c00a3a697e0ce22bf7", "score": "0.5616234", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "e116744c79fc70c00a3a697e0ce22bf7", "score": "0.5616234", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "e116744c79fc70c00a3a697e0ce22bf7", "score": "0.5616234", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "492c26b463fdf054d670bbf9802c9b8d", "score": "0.5614164", "text": "get Center() {}", "title": "" }, { "docid": "29a90a25367fa4b878da8f4e4e01c4cd", "score": "0.55848306", "text": "function centerText() {\n return function() {\n var svg = d3v3.select(\"#nvd3_svg_new_4\");\n var donut = svg.selectAll(\"g.nv-slice\").filter(\n function (d, i) {\n return i == 0;\n }\n );\n //Insert text inside donut\n donut.insert(\"text\", \"g\")\n .text(\"Bytes\")\n .attr(\"class\", \"middle\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"dy\", \"-.55em\")\n .style(\"fill\", \"#000\");\n\n donut.insert(\"text\", \"g\")\n .text(\"Transferred\")\n .attr(\"class\", \"middle\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"dy\", \".85em\")\n .style(\"fill\", \"#000\");\n }\n }", "title": "" }, { "docid": "774a463fa2c5c568704d5a5234d88cce", "score": "0.55278105", "text": "function n() {\n var e = Math.min(d.getBoundingClientRect().width, 768);\n t.payuiWidth = e,\n d.style.fontSize = e / 7.5 + \"px\"\n }", "title": "" }, { "docid": "506f9fa498fd5675de900fc319d99826", "score": "0.5527593", "text": "function textAdjust(el) {\n\tif (el.text.length > 64 && el.text.length < 70) {\n\t\tel.width = \"28px\";\n\t} else if (el.text.length > 70) {\n\t\tel.width = \"20px\";\n\t}}", "title": "" }, { "docid": "47709fd690568343d424df4dfa8c1b6c", "score": "0.54872197", "text": "function centerOf(str) {\n return str.slice(Math.ceil(str.length / 2) - 1, str.length / 2 + 1);\n}", "title": "" }, { "docid": "964efee6eddbc8128aea1254ef68a71d", "score": "0.5478807", "text": "static get HIDE_CENTER() {return 0x10}", "title": "" }, { "docid": "351ba5884eb03cb4217f46f4d58ab9de", "score": "0.5475941", "text": "static get HIDE_CENTER() {return 0x40}", "title": "" }, { "docid": "5dfebb07e63a0caf5680ef53993c1bee", "score": "0.5466415", "text": "render() {\n return (\n <div>\n <h1 style={{textAlign: \"center\"}} styles=\"font-family: 'Lucida Console', Courier, monospace;\">JJWD Portal</h1>\n </div>\n\n )\n }", "title": "" }, { "docid": "60284e9ecc422b7035d7532d30ca7f5a", "score": "0.5455471", "text": "function get_char_width() {\n var $prompt = self.find('.prompt');\n var html = $prompt.html();\n $prompt.html('<span>&nbsp;</span>');\n var width = $prompt.find('span')[0].getBoundingClientRect().width;\n $prompt.html(html);\n return width;\n }", "title": "" }, { "docid": "917d60a9e9914e26cb75dc2701f98ea2", "score": "0.5454613", "text": "static get DEFAULT_WIDTH(){\n\t\treturn 1095;\n\t}", "title": "" }, { "docid": "3d29c1e982e2aea349ad2b22ad27cb3b", "score": "0.5454418", "text": "function center() {\n return {\n left: '50%',\n top: '50%',\n transform: 'translate(-50%, -50%)'\n }\n}", "title": "" }, { "docid": "3805d1224e3a18986507937490ac9dbb", "score": "0.5439351", "text": "function centeringJpgsFiles(){\n\n imgTitle.x = width/2;\n imgTitle.y = height/2;\n\n imgKittens.x = width/2;\n imgKittens.y = height/2;\n\n imgPetShop.x = width/2;\n imgPetShop.y = height/2;\n\n imgStreetEnding.x = width/2;\n imgStreetEnding.y = height/2;\n\n imgHappyEnding.x = width/2;\n imgHappyEnding.y = height/2;\n\n}", "title": "" }, { "docid": "e5000c4a2c9a5d8a10e658111a46370d", "score": "0.54357165", "text": "function styleTerminal() {\n terminal.setHeight('calc(100vh - 3em)');\n\n terminal.setBackgroundColor('#002b36');\n terminal.setTextColor('#93a1a1');\n terminal.setTextSize('14px');\n}", "title": "" }, { "docid": "be2e624e66f046f72dbacc2949d86cc1", "score": "0.54256165", "text": "measure(){\n\t\t// this.rectWidth = textWidth(this.word);\n\t}", "title": "" }, { "docid": "de27cfbc8550b1dacfe52d2904a8f580", "score": "0.54099363", "text": "function set_terminal_width() {\n // set the width of the terminal\n var new_terminal_width = Math.max($(window).width()-229, 200);\n $(\"div#right-column\").width(new_terminal_width);\n\n // resize the page container as well\n $(\"div#main\").width($(\"div#left-column\").outerWidth(true)+$(\"div#right-column\").outerWidth(true));\n\n // reset the width of the terminal input\n set_input_width();\n}", "title": "" }, { "docid": "944bb99b330bb1e38745e94691dc776a", "score": "0.5400691", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n }", "title": "" }, { "docid": "de36533a0b03167dcff379e444a53699", "score": "0.53973573", "text": "function mmFontWidth(t){\n var e = document.createElement(\"div\");\n e.setAttribute(\"style\", \"position: absolute; top: -999;\");\n e.innerHTML = t ;\n document.body.appendChild(e);\n var ew = e.clientWidth;\n e.parentNode.removeChild(e);\n return ew;\n}", "title": "" }, { "docid": "c58d2390306407231b0aa0521d012d3a", "score": "0.53947514", "text": "centerLetter() {\n // Position parent `g` object at center of window\n this.g.position.set( window.innerWidth / 2, window.innerHeight / 2 );\n // Center each letter object horizontally\n this.letters.forEach( letter => letter.centerLetter() );\n // If window's innerHeight hasn't change from last scale, return\n if ( window.innerHeight / 1000 == this.scaleFactor ) return;\n // Calculate new factor of how much to scale by dividing the window height by the original\n // font size: 1000 pixels\n var newScaleFactor = window.innerHeight / 1000;\n // Change scaling by dividing new factor with previous `scaleFactor`\n this.g.scaling.set( newScaleFactor / this.scaleFactor, newScaleFactor / this.scaleFactor );\n // Update `scaleFactor` property with new value\n this.scaleFactor = newScaleFactor;\n // Recalculate path lengths\n this.letters.forEach( letter => letter.calculateLength() );\n }", "title": "" }, { "docid": "20bb1d90b490e92183212ff49b5dcd35", "score": "0.53938985", "text": "function init() {\n let output = `\n████████╗ █████╗ ██╗ ███████╗███╗ ██╗████████╗ ████████╗██████╗ █████╗ ██████╗██╗ ██╗ \n╚══██╔══╝██╔══██╗██║ ██╔════╝████╗ ██║╚══██╔══╝ ╚══██╔══╝██╔══██╗██╔══██╗██╔════╝██║ ██╔╝ \n ██║ ███████║██║ █████╗ ██╔██╗ ██║ ██║ ██║ ██████╔╝███████║██║ █████╔╝ \n ██║ ██╔══██║██║ ██╔══╝ ██║╚██╗██║ ██║ ██║ ██╔══██╗██╔══██║██║ ██╔═██╗ \n ██║ ██║ ██║███████╗███████╗██║ ╚████║ ██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██╗ \n ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ \n \n \n \n█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗\n╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝\n`\n console.log(chalk.cyan(output));\n start();\n}", "title": "" }, { "docid": "80e3179985705f7a7108fc97a7100f62", "score": "0.5369697", "text": "function charWidth(display) { // 2042\n if (display.cachedCharWidth != null) return display.cachedCharWidth; // 2043\n var anchor = elt(\"span\", \"xxxxxxxxxx\"); // 2044\n var pre = elt(\"pre\", [anchor]); // 2045\n removeChildrenAndAdd(display.measure, pre); // 2046\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; // 2047\n if (width > 2) display.cachedCharWidth = width; // 2048\n return width || 10; // 2049\n } // 2050", "title": "" }, { "docid": "6ee930772cdef1e4817656b5a5cfd5e0", "score": "0.5367135", "text": "function displayStart() {\n push();\n fill(start.fill.r, start.fill.g, start.fill.b);\n textSize(start.size);\n textAlign(CENTER, CENTER);\n\n start.x = windowWidth*1/5;\n start.y = windowHeight*4/5;\n\n textFont(start.font);\n text(start.text, start.x, start.y);\n pop();\n}", "title": "" }, { "docid": "973251bd39c0cce1acaf7aaadacfd662", "score": "0.53586984", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "6d1f5f71ed879a152dd7be0221e654fa", "score": "0.53474516", "text": "function charWidth(display) {\n\t if (display.cachedCharWidth != null) return display.cachedCharWidth;\n\t var anchor = elt(\"span\", \"xxxxxxxxxx\");\n\t var pre = elt(\"pre\", [anchor]);\n\t removeChildrenAndAdd(display.measure, pre);\n\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n\t if (width > 2) display.cachedCharWidth = width;\n\t return width || 10;\n\t }", "title": "" }, { "docid": "6d1f5f71ed879a152dd7be0221e654fa", "score": "0.53474516", "text": "function charWidth(display) {\n\t if (display.cachedCharWidth != null) return display.cachedCharWidth;\n\t var anchor = elt(\"span\", \"xxxxxxxxxx\");\n\t var pre = elt(\"pre\", [anchor]);\n\t removeChildrenAndAdd(display.measure, pre);\n\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n\t if (width > 2) display.cachedCharWidth = width;\n\t return width || 10;\n\t }", "title": "" }, { "docid": "6d1f5f71ed879a152dd7be0221e654fa", "score": "0.53474516", "text": "function charWidth(display) {\n\t if (display.cachedCharWidth != null) return display.cachedCharWidth;\n\t var anchor = elt(\"span\", \"xxxxxxxxxx\");\n\t var pre = elt(\"pre\", [anchor]);\n\t removeChildrenAndAdd(display.measure, pre);\n\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n\t if (width > 2) display.cachedCharWidth = width;\n\t return width || 10;\n\t }", "title": "" }, { "docid": "98e484e3c558fee5a3e6d5bcf1b26112", "score": "0.53465205", "text": "function getScotusCenter() {\n return {x:width/2, y:height/2};\n }", "title": "" }, { "docid": "bebaa14cda5fbe81be0f2f107d71f2b1", "score": "0.53448915", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "bebaa14cda5fbe81be0f2f107d71f2b1", "score": "0.53448915", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "bebaa14cda5fbe81be0f2f107d71f2b1", "score": "0.53448915", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "bebaa14cda5fbe81be0f2f107d71f2b1", "score": "0.53448915", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "bebaa14cda5fbe81be0f2f107d71f2b1", "score": "0.53448915", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "bebaa14cda5fbe81be0f2f107d71f2b1", "score": "0.53448915", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "bebaa14cda5fbe81be0f2f107d71f2b1", "score": "0.53448915", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "bebaa14cda5fbe81be0f2f107d71f2b1", "score": "0.53448915", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "title": "" }, { "docid": "3f5daf22547cc0dba891a303529afa1a", "score": "0.5342741", "text": "get center() {}", "title": "" }, { "docid": "f6178a241ac5b49b89244b4ac1de9273", "score": "0.53362054", "text": "function displayStart() {\n push();\n fill(start.fill.r, start.fill.g, start.fill.b);\n textSize(start.size);\n textAlign(CENTER, CENTER);\n\n start.x = width*1/5;\n start.y = height*4/5;\n\n textFont(bodyTextFont);\n text(start.text, start.x, start.y);\n pop();\n}", "title": "" }, { "docid": "e49d417e439c79473544459e00a343b8", "score": "0.53297406", "text": "getTitleAlignment() {\n if (this.luxTitleLineBreak && this.showIcon) {\n return 'left top';\n }\n return 'left center';\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "813f8f555059cd0c7bb05732995297a5", "score": "0.5318796", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "title": "" }, { "docid": "9f74207460ce9313e0f82d6051c16bd4", "score": "0.5311967", "text": "updateWidth() {\n this.glyphs = [];\n this.width = 0;\n for (let i = 0; i < this.positions.length; ++i) {\n let fret = this.positions[i].fret;\n if (this.ghost) fret = '(' + fret + ')';\n const glyph = Flow.tabToGlyph(fret, this.render_options.scale);\n this.glyphs.push(glyph);\n this.width = Math.max(glyph.getWidth(), this.width);\n }\n // For some reason we associate a notehead glyph with a TabNote, and this\n // glyph is used for certain width calculations. Of course, this is totally\n // incorrect since a notehead is a poor approximation for the dimensions of\n // a fret number which can have multiple digits. As a result, we must\n // overwrite getWidth() to return the correct width\n this.glyph.getWidth = () => this.width;\n }", "title": "" }, { "docid": "773d050203ea0bd8905934c18bbfd3ab", "score": "0.53047264", "text": "function ptCentered(S,I) {\r\n\t\tvar p = pattern(S,I);\r\n\t\t\r\n\t\tp.f = \"steelblue\";\r\n\t\tp.hx = true;\r\n\t\tp.sp = 2;\r\n\t\t\r\n\t\tp.fill = function(_) \t{ if(!arguments.length) return p.f; p.f = _; return p; };\r\n\t\tp.hex = function(_) \t{ if(!arguments.length) return p.hx; p.hx = _; return p; };\r\n\t\tp.spacing = function(_) { if(!arguments.length) return p.sp; p.sp = _; return p; };\r\n\t\t\r\n\t\treturn p;\r\n\t}", "title": "" }, { "docid": "56c69af60d2edce3679625bf8559b113", "score": "0.53000176", "text": "function charWidth(display) {\n\t\t if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n\t\t var anchor = elt(\"span\", \"xxxxxxxxxx\")\n\t\t var pre = elt(\"pre\", [anchor])\n\t\t removeChildrenAndAdd(display.measure, pre)\n\t\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n\t\t if (width > 2) { display.cachedCharWidth = width }\n\t\t return width || 10\n\t\t}", "title": "" }, { "docid": "18b6b386db9b18d772ce67f54ddbe59c", "score": "0.5277488", "text": "function centerColors() {\n\t\tvar colorWidth = $('.pat-hex-color').outerWidth(true) * 4;\n\t\tvar containerWidth = $('.country-text').width();\n\t\tvar padding = (containerWidth - colorWidth) / 2;\n\t\t$('.pat-hex-container').css({'width':containerWidth + 'px', 'padding-left': padding + 'px', 'padding-right':padding + 'px'});\n\t}", "title": "" }, { "docid": "f76fa6570575f63131771f8c29c500da", "score": "0.52613604", "text": "function displayTitle() {\n textFont(titleFont);\n textAlign(CENTER, CENTER);\n textSize(50);\n fill(255, 255, 255);\n text(`SPACE SWEEPERS`, width / 2, height / 2 - 150);\n}", "title": "" }, { "docid": "ca6eff88e660b36e96ea49c816265d1b", "score": "0.5259565", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n}", "title": "" }, { "docid": "ca6eff88e660b36e96ea49c816265d1b", "score": "0.5259565", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n}", "title": "" }, { "docid": "ca6eff88e660b36e96ea49c816265d1b", "score": "0.5259565", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n}", "title": "" }, { "docid": "b380a02f675e7eedaf12ebee309b88c2", "score": "0.5252238", "text": "function computeLineWidth(str) {\n const CHAR_WIDTH = 5;\n let val = str.length * CHAR_WIDTH + 20;\n return val;\n }", "title": "" }, { "docid": "2f203efa64c78d7319fc77a3b1fa396e", "score": "0.5249683", "text": "function charWidth(display) {\n\t if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n\t var anchor = elt(\"span\", \"xxxxxxxxxx\")\n\t var pre = elt(\"pre\", [anchor])\n\t removeChildrenAndAdd(display.measure, pre)\n\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n\t if (width > 2) { display.cachedCharWidth = width }\n\t return width || 10\n\t}", "title": "" }, { "docid": "2f203efa64c78d7319fc77a3b1fa396e", "score": "0.5249683", "text": "function charWidth(display) {\n\t if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n\t var anchor = elt(\"span\", \"xxxxxxxxxx\")\n\t var pre = elt(\"pre\", [anchor])\n\t removeChildrenAndAdd(display.measure, pre)\n\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n\t if (width > 2) { display.cachedCharWidth = width }\n\t return width || 10\n\t}", "title": "" }, { "docid": "50456a0e59e2c3d1dfbda45b6a3c3630", "score": "0.524694", "text": "function terminalWidth() {\n return typeof process.stdout.columns !== \"undefined\" ? process.stdout.columns : null;\n}", "title": "" }, { "docid": "a856322e7beb3922c3d4ac891c1cb790", "score": "0.5245864", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) {\n return display.cachedCharWidth;\n }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(),\n width = (rect.right - rect.left) / 10;\n if (width > 2) {\n display.cachedCharWidth = width;\n }\n return width || 10;\n }", "title": "" }, { "docid": "1158e328ae28aebb5835f730d59d5b06", "score": "0.5236866", "text": "function printBanner (text) {\n let width = '';\n for (let start = 0; start < text.length + 4; start++) {\n width += (\"*\");\n }\n console.log(width);\n console.log(`* ${text} *`);\n console.log(width);\n}", "title": "" }, { "docid": "83a0cbb901268ee27bb4a8ec60f0cb30", "score": "0.52153313", "text": "function Article() {\n \n return (\n <Fragment>\n <h2 style={{textAlign:'center'}}>flex 布局下多行对齐方式,让最后对出的一样实现左对齐</h2>\n <Monaco code={code} />\n </Fragment>\n )\n}", "title": "" }, { "docid": "92dcce74c4a48e48e03aebc9d3ea0fb2", "score": "0.52047527", "text": "function initAsciiSize() {\n\t\tiWidth = Math.round(width * fResolution);\n\t\tiHeight = Math.round(height * fResolution);\n\n\t\toCanvas.width = iWidth;\n\t\toCanvas.height = iHeight;\n\t\t// oCanvas.style.display = \"none\";\n\t\t// oCanvas.style.width = iWidth;\n\t\t// oCanvas.style.height = iHeight;\n\n\t\toImg = canvasRenderer.domElement;\n\t\tif (oImg.style.backgroundColor) {\n\t\t\toAscii.rows[0].cells[0].style.backgroundColor = oImg.style.backgroundColor;\n\t\t\toAscii.rows[0].cells[0].style.color = oImg.style.color;\n\t\t}\n\n\t\toAscii.cellSpacing = 0;\n\t\toAscii.cellPadding = 0;\n\n\t\tvar oStyle = oAscii.style;\n\t\toStyle.display = \"inline\";\n\t\toStyle.width = Math.round(iWidth/fResolution*iScale) + \"px\";\n\t\toStyle.height = Math.round(iHeight/fResolution*iScale) + \"px\";\n\t\toStyle.whiteSpace = \"pre\";\n\t\toStyle.margin = \"0px\";\n\t\toStyle.padding = \"0px\";\n\t\toStyle.letterSpacing = fLetterSpacing + \"px\";\n\t\toStyle.fontFamily = strFont;\n\t\toStyle.fontSize = fFontSize + \"px\";\n\t\toStyle.lineHeight = fLineHeight + \"px\";\n\t\toStyle.textAlign = \"left\";\n\t\toStyle.textDecoration = \"none\";\n\t}", "title": "" }, { "docid": "bcbb324303933bbf8ab5114a39cb2226", "score": "0.52017915", "text": "function printJustify(context, text, x, y, lineHeight, fitWidth) { fitWidth = fitWidth || 0; lineHeight = lineHeight || 20; var outLines=[]; var currentLine = 0;\nvar lines = text.split(/\\r\\n|\\r|\\n/); for (var line = 0; line < lines.length; line++) { if (fitWidth <= 0) { context.fillText(lines[line], x, y + (lineHeight * currentLine));\n} else { var words = lines[line].split(\" \"); var idx = 1; while (words.length > 0 && idx <= words.length) { var str = words.slice(0, idx).join(\" \");\nvar w = context.measureText(str).width; if (w > fitWidth) { if (idx == 1) { idx = 2;} outLines.push(words.slice(0, idx - 1).join(\" \"));\ncurrentLine++; words = words.splice(idx - 1); idx = 1;} else { idx++; }} if (idx > 0){ outLines.push(words.join(\" \"));}} currentLine++;}\nvar maxW=0; for (i=0; i<outLines.length; i++){ if (context.measureText(outLines[i]).width>maxW){maxW=context.measureText(outLines[i]).width}}\nfor (i=0; i<outLines.length-1; i++){ var wordsLine = outLines[i].split(\" \"); var indexB=1; var space=\" \"; while (context.measureText(outLines[i]).width<maxW){ var newLine=\"\"; for (j=0; j<wordsLine.length; j++){ if (j<indexB){\nnewLine=newLine+wordsLine[j]+space;} else{ newLine=newLine+wordsLine[j]+\" \";}} outLines[i]=$.trim(newLine);indexB+=1;if (indexB>wordsLine.length){\nindexB=1; space=space+\" \"}}} return outLines;}", "title": "" }, { "docid": "47db2d2b0a2b67be2df7e803d239c5af", "score": "0.5194793", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "title": "" }, { "docid": "47db2d2b0a2b67be2df7e803d239c5af", "score": "0.5194793", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "title": "" }, { "docid": "47db2d2b0a2b67be2df7e803d239c5af", "score": "0.5194793", "text": "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "title": "" } ]
d1b70e5c4240cb7cda9d872d5e590c46
will contain server request
[ { "docid": "66197a3d2a02e8f82a24337e9d9ef538", "score": "0.0", "text": "async componentDidMount() {\n const config = {\n headers: {\n 'Authorization': `Token token=${this.props.user.token}`\n }\n }\n const response = await axios.get(apiUrl + '/ships', config)\n this.setState({ships: response.data.ships})\n }", "title": "" } ]
[ { "docid": "1e8d86333fa871df161ab990f814f3df", "score": "0.6863897", "text": "function requestHandler(request, response) {\n console.log(request); \n}", "title": "" }, { "docid": "fc89cc254be0bb744129b66565ea70a0", "score": "0.6773123", "text": "function lrequest() {}", "title": "" }, { "docid": "395f180633d24aff4a8851e73f9ab65d", "score": "0.6761742", "text": "get request() {\n return this._internals.request;\n }", "title": "" }, { "docid": "31a8498886ef283f06c848a3e7fcd28e", "score": "0.6708021", "text": "get request() {\n\t\treturn this.__request;\n\t}", "title": "" }, { "docid": "1978ba3331aca5db2c56c57abb7af1bf", "score": "0.6591555", "text": "function onRequest() {\n\tlog(\"New request\")\n}", "title": "" }, { "docid": "27340ae5cc29a99b70bca39c55c0e446", "score": "0.65869147", "text": "function onRequest(req, res) {\n console.log(req.method + ' ' + req.url);\n}", "title": "" }, { "docid": "003718de8f6c099dfedcd382a1fc0795", "score": "0.65806395", "text": "get request() {\n\t\t\t\tthrow new Error('request in handle has been replaced with event' + details);\n\t\t\t}", "title": "" }, { "docid": "961f67800001989c261bd0eaf7119294", "score": "0.6548326", "text": "function RequestHandler() {}", "title": "" }, { "docid": "1dd252ab518b286f8cb2eec8f101181f", "score": "0.64918786", "text": "get request(){\n\treturn `${this._protocol}://${this.link}/${this._target}.xml?${this.params}`;\n }", "title": "" }, { "docid": "701f6bf7d43c52b7108d8ad881d1c609", "score": "0.6459516", "text": "function onRequest(request, response) {\n\tO.t(\"HTTPVersion: '\" + request.httpVersion + \"'\");\n\tvar requestUrl = request.url;\n\tO.d(\"Responding to '\" + requestUrl + \"'\");\n\tO.d(\" pathname '\" + url.parse(requestUrl).pathname + \"'\");\n\tO.d(\" query '\" + url.parse(requestUrl).query + \"'\");\n\n\tif (requestUrl.startsWith('/Diffusion')) {\n\t\tO.d('Found Diffusion request: ' + requestUrl);\n\t\tdiffusionRequest(request, response);\n\t} else if (requestUrl.startsWith('/var')) {\n\t\tO.d('Found variation request: ' + requestUrl);\n\t\tvariationRequest(request, response);\n\t} else {\n\t\tO.d('Simple file based request: ' + requestUrl);\n\t\tsimpleFileBasedWebServer(request, response);\n\t}\n}", "title": "" }, { "docid": "c20079256594aaae2c7aab8f69c46d86", "score": "0.6456318", "text": "function getRequests(request, response) {\n // Parse the incoming request for the requested filename.\n var pathname = url.parse(request.url).pathname;\n\n if (pathname == \"/\") {\n file_server.serveFile(\"./views/home.html\", 200, {}, request, response);\n }\n\n request.addListener('end', function () {\n file_server.serve(request, response, function (error, result) {\n if (error) {\n console.log(\"Error Occurred!!!\");\n }\n });\n\n }).resume();\n}", "title": "" }, { "docid": "79f2e8991aa2c5fd34eebe6dd967b2a3", "score": "0.64450544", "text": "function getRequests() {\n return requests;\n }", "title": "" }, { "docid": "802b3a6193ca5a01ea5893028aeb86ae", "score": "0.64127064", "text": "function onRequest(request, response)\n\t{\n\t\tvar postData = \"\";\n\t\tconnection.connect();\n\t\tvar pathname = url.parse(request.url).pathname;\n\t\trequest.addListener(\"data\", function(postDataChunk){\n\t\t\tpostData+=postDataChunk;\n\t\t});\n\t\trequest.addListener(\"end\", function()\n\t\t{\n\t\t\troute(handle ,connection, pathname, postData, response);\n\t\t});\n\n\t}", "title": "" }, { "docid": "c285590ff1ede0ed8dfb77541bf679ee", "score": "0.63993454", "text": "processRequest() {\n this.processedRequest = Object.assign({}, this.event.display.requestObj);\n return this.processedRequest;\n }", "title": "" }, { "docid": "7f38f8bf2fc76ba5100dc425a515b2c6", "score": "0.63914317", "text": "function handdleRequest(request,response){\n \n response.end('it works !! ' + request.url);\n}", "title": "" }, { "docid": "4a829d1cff1907d559399bd73f7a2d1c", "score": "0.6390373", "text": "handleRequest(request) {\n }", "title": "" }, { "docid": "c6a2260d937dc8b9228bc9089814be8d", "score": "0.6378178", "text": "function onRequest(request, response) { //request and response are two objects we use in our code.\n\n let pathname = url.parse(request.url).pathname;\n console.log(`Request for ${pathname} recieved.`);\n route(handle, pathname, response, request);\n }", "title": "" }, { "docid": "31d7e2c9a9a65e25d293f4db3f566d26", "score": "0.6375448", "text": "function handleRequest(request) {\n\n}", "title": "" }, { "docid": "79232773292260dc8629588c0741a026", "score": "0.63162595", "text": "function on_request(request,callback) {\n\t\tconsole.log ('REQUEST:::: '+request.service+' '+request.command);\n\t\t\n\t\trequest.auth_info={};\n\t\tif (request.browser_code) {\n\t\t\trequire('./authentication').authentication({\n\t\t\t\tservice:'authentication',\n\t\t\t\tcommand:'getAuthInfo',\n\t\t\t\tbrowser_code:request.browser_code\n\t\t\t},function(tmp1) {\n\t\t\t\tif (tmp1.success) {\n\t\t\t\t\trequest.auth_info=tmp1;\n\t\t\t\t}\n\t\t\t\ton_request_part2();\n\t\t\t});\n\t\t}\n\t\telse on_request_part2();\n\t\t\n\t\t\n\t\tfunction on_request_part2() {\n\t\t\t\n\t\t\tvar user_id=(request.auth_info||{}).user_id;\n\t\t\t/*WISDMUSAGE.addRecord({\n\t\t\t\tuser_id:user_id||'unknown.'+request.remoteAddress,\n\t\t\t\tusage_type:'request_bytes',\n\t\t\t\tamount:JSON.stringify(request).length,\n\t\t\t\tname:request.command||''\n\t\t\t});*/\n\t\t\t\n\t\t\t\n\t\t\tvar service=request.service||'';\n\t\t\tif (service=='appadmin') {\n\t\t\t\trequire('./appadmin').appadmin(request,finalize);\n\t\t\t}\n\t\t\telse if (service=='config') {\n\t\t\t\tif (request.command=='getConfig') {\n\t\t\t\t\tfinalize({success:true,processingwebserver_url:wisdmconfig.wisdm_server.processingwebserver_url});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfinalize({success:false,error:'Unknown command *: '+request.command});\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (service=='serveradmin') {\n\t\t\t\trequire('./serveradmin').serveradmin(request,finalize);\n\t\t\t}\n\t\t\telse if (service=='temporarycloud') {\n\t\t\t\trequire('./temporarycloud').temporarycloud(request,finalize);\n\t\t\t}\n\t\t\telse if (service=='maps') {\n\t\t\t\trequire('./maps').maps(request,finalize);\n\t\t\t}\n\t\t\telse if (service=='authentication') {\n\t\t\t\trequire('./authentication').authentication(request,finalize);\n\t\t\t}\n\t\t\telse if (service=='processing') {\n\t\t\t\tfinalize({success:false,error:'This web server can no longer handle processing requests'});\n\t\t\t\t//processing(request,finalize);\n\t\t\t}\n\t\t\telse if (service=='localfilesystem') {\n\t\t\t\trequire('./localfilesystem').localfilesystem(request,finalize);\n\t\t\t}\n\t\t\telse if (service=='usage') {\n\t\t\t\trequire('./usage').usage(request,finalize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfinalize({success:false,error:'Unknown service: '+service});\n\t\t\t}\n\t\t\t\n\t\t\tfunction finalize(tmp) {\n\t\t\t\t/*WISDMUSAGE.addRecord({\n\t\t\t\t\tuser_id:user_id||'unknown.'+request.remoteAddress,\n\t\t\t\t\tusage_type:'response_bytes',\n\t\t\t\t\tamount:JSON.stringify(tmp).length,\n\t\t\t\t\tname:request.command||''\n\t\t\t\t});*/\n\t\t\t\tif (callback) callback(tmp);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "fec9365b31c17ff6e8dd3993fb929572", "score": "0.6270619", "text": "function reqListener() {\n console.log(this.responseText);\n }", "title": "" }, { "docid": "72ca27e9979cb823f0844e1f8f1fe247", "score": "0.62426966", "text": "static get lastRequest() {\n\t\treturn {\n\t\t\thttpMethod: this.httpMethod,\n\t\t\tendpoint: this.endpoint,\n\t\t\theaders: this.headers,\n\t\t\tbody: this.body\n\t\t};\n\t}", "title": "" }, { "docid": "634e640960b6da3d0ae930f2e6c16c1d", "score": "0.61710316", "text": "startRequest (req, res) {\n debug('startRequest', req.url)\n let rmd = new RequestMetaData(req, res, { logger: this.logger, emd: this })\n this.running_requests[rmd.request_id] = { rmd: rmd }\n rmd.start()\n rmd.logStart()\n return rmd\n }", "title": "" }, { "docid": "dbe45662a6e33bd4dc96f4b4cae134fd", "score": "0.616654", "text": "function reqListener(e){\n \tconsole.log(e, this.resposeText);\n }", "title": "" }, { "docid": "ff60c2278bf723aaa75401068393050a", "score": "0.61465347", "text": "function Requester() {\n\n}", "title": "" }, { "docid": "ee0717830b2ad4b361bd6671f050f3e3", "score": "0.61226326", "text": "function handleRequest(request, response) {}", "title": "" }, { "docid": "cf5614e7287f9a52496ef92f8fb3a508", "score": "0.6121798", "text": "function reqListener(){\n console.log(this.responseText);\n}", "title": "" }, { "docid": "cee852152d5042b864355aa11c7cf1a0", "score": "0.611147", "text": "function onRequest(request, response) {\n\tconsole.log(\"A user made a rquest \" + request.url);\n\n\tresponse.writeHead(200, {\"Context-Type\": \"text/plain\"})\n\t// 1. status code ie. 404 [request can't be found], 200 [everything went ok] etc.\n\t// 2. header info ie. what type of data is being sent back, files etc\n\n\tresponse.write(\"Here is some data\"); // what you will show them\n\n\tresponse.end();\n\n}", "title": "" }, { "docid": "3f203b8298060ac9206261dc78fbb78f", "score": "0.6093289", "text": "Request() {\n console.log(\"RealSubject handles request\");\n }", "title": "" }, { "docid": "0d32b7857278715ecbc2f37e271c2a65", "score": "0.60906124", "text": "function request() {\n return { type: chairConstants.GET_CHAIR_POSTS_REQUEST };\n }", "title": "" }, { "docid": "8cce967c2e7482454b1ba9f0bb8c2478", "score": "0.60773855", "text": "function reqListener() {\n\tconsole.log(this.responseText);\n}", "title": "" }, { "docid": "0781cbfa9c793219f8efed09dc467bc8", "score": "0.6041499", "text": "sendRequest(request, response) {\n this.executeHook('request', request, response);\n }", "title": "" }, { "docid": "51b80b239b691c03e8215fb41fcba1c8", "score": "0.6038763", "text": "function onRequest(request, response) {\n\t\tvar parsedURL = url.parse(request.url,true);\n\t\tvar pathname = parsedURL.pathname;\n\t\tvar query = parsedURL.query;\n\t\troute(handle, pathname, query, response); //The route() function comes from router.js.\n\t}", "title": "" }, { "docid": "2a0e419c7cd84e869253d2bc1f213b8f", "score": "0.60384756", "text": "function reqListener () {\n // this request returns JSON = which is not quite the same as Javascript, we need to convert it to a JS object\n // look into JSON.parse https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse\n console.log(request.responseText);\n}", "title": "" }, { "docid": "6da5138af866387f2dbc0d1c70df9616", "score": "0.60357654", "text": "function onRequest(request, response) {\n var beat = request.path.slice(1)\n log(\"beat \" + beat)\n\n response.send(\"beat queued\")\n\n Request('https://www.ibm.com/' + beat, function (error, response, body) {\n // log(error, response, body)\n log(\"forwarded status: \" + response.statusCode)\n })\n\n}", "title": "" }, { "docid": "53eb00a9fca12b8d79de6cc1099bbad2", "score": "0.60321563", "text": "function handleRequests(request, response) {\n\tconsole.log('Got a ' + request.method + ' request');\n console.log('client address: ' + request.connection.remoteAddress);\n // print all the headers:\n console.log(request.rawHeaders);\n\n\t// send the response:\n\tresponse.write('what I know about your client: ');\n response.write('\\nclient address: ' + request.connection.remoteAddress);\n response.write('\\nrequest headers: ' + request.rawHeaders);\n\tresponse.end();\n}", "title": "" }, { "docid": "d153c731631d7bde543fa6a17f5ed390", "score": "0.6025798", "text": "function reqListener() {\n console.log(this.responseText);\n}", "title": "" }, { "docid": "25cd94bd50ee75e67cae5db3ad8c8f4e", "score": "0.60252416", "text": "function handler3(request,response){\n let {url} = request; \n let postfix = getPostfix(url);\n console.log(' request:',request)\n console.warn(' response:',response);\n global.req = request;\n global.response = response;\n \n if(filter(postfix)){\n // console.info(request.headers['content-length'],request.headers['connection'],'浏览器发出的请求 request:',request,\n // ' request.statusCode:',request.statusCode,\n // ' response:',response);\n route(request,response,postfix);\n\n }\n}", "title": "" }, { "docid": "b17e05b24a0bb62dcf2b632729fd102e", "score": "0.6020903", "text": "function onRequest(request, response) {\n\t//let check what kind of response the client is giving\n\tswitch (request.method) {\n\t\t//if client is requesting for file\n\t\tcase \"GET\":\n\t\t\t//we shall respond with home page\n\t\t\tresponse.writeHead(200, {\n\t\t\t\t'Content-Type': \"text/html\"\n\t\t\t});\n\t\t\tresponse.write(homepage);\n\t\t\tbreak;\n\t\t\t//if client is sending data\n\t\tcase \"POST\":\n\t\t\tconsole.log(request)\n\t\t\t//we shall respond with download if url is correct\n\t\t\tvar body = '';\n\t\t\trequest.on('data', function (data) {\n\t\t\t\t//start receiving data from client in chunks\n\t\t\t\tbody += data;\n\t\t\t});\n\t\t\trequest.on('end', function (data) {\n\t\t\t\t//after all data is sent to server\n\t\t\t\tvar obj = qs.parse(body);\n\t\t\t\tvar url = obj.url2;\n\t\t\t\tif (url.includes('youtube') && url.includes('http')) {\n\t\t\t\t\tstream.download(response, req, qs, url);\n\t\t\t\t} else {\n\t\t\t\t\t//we shall respond with home page\n\t\t\t\t\tresponse.writeHead(200, {\n\t\t\t\t\t\t'Content-Type': \"text/html\"\n\t\t\t\t\t});\n\t\t\t\t\tresponse.write(homepage);\n\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\t//we shall respond with home page\n\t\t\tresponse.write(200, {\n\t\t\t\t'Content-Type': \"text/html\"\n\t\t\t});\n\t\t\tresponse.write(homepage);\n\n\t}\n\n\n}", "title": "" }, { "docid": "1fc5cabc0545da1990b276f6d69a6963", "score": "0.6019569", "text": "__setRequest(req){\n\t\tthis.req=req;\n\t}", "title": "" }, { "docid": "92f83bd99f123f7870c8c2fedb274c2a", "score": "0.6003913", "text": "function _xhrRequest(){\n\t\t\tconsole.log('[ network_module.js ] : ' + 'creating XHR request ..');\n\t\t}", "title": "" }, { "docid": "4901b6b867fa740ba3795f23aa8d2219", "score": "0.5993103", "text": "function BufferRequest(){}", "title": "" }, { "docid": "fa64b4c90eb68448a9fcca05c7e23b74", "score": "0.5966676", "text": "startRequestLog(req, res) {\n map.set(req, date.now());\n const finish = () => {\n const ip = req.headers['x-real-ip'];\n const apiKey = req.query.api_key || '';\n const tsp = map.get(req);\n const len = tsp\n ? date.now() - tsp\n : '';\n logger.log(`${ip} ${apiKey} ${req.method} ${req.url} ${res.statusCode} ${len}`);\n };\n res._oldEnd = res.end;\n res._oldSend = res.send;\n res.end = function () {\n res._oldEnd();\n finish();\n };\n res.send = function (...args) {\n res.end = res._oldEnd;\n res._oldSend(...args);\n finish();\n };\n }", "title": "" }, { "docid": "e99a7ea501f4b7f4cb23cfaa87ea5b42", "score": "0.5965283", "text": "function onRequest(request, response) {\n\t\tvar postData = \"\";\n\t\tvar pathname = url.parse(request.url).pathname;\n\t\tconsole.log(\"Request for \" + pathname + \" received\");\n\t\t\n\t\trequest.setEncoding(\"utf8\");\n\t\t\n\t\t// Data listener\n\t\trequest.addListener(\"data\", function(postDataChunk) {\n\t\t\tpostData += postDataChunk;\n\t\t\tconsole.log(\"Received POST data chunk '\" + postDataChunk + \"'.\");\n\t\t});\n\n\t\t// End listener\n\t\trequest.addListener(\"end\", function() {\n\t\t\tvar authToken = request.headers[\"authorization\"];\n\t\t\tif (request.method == \"GET\") {\n\t\t\t\troute(handle, pathname, response, request);\n\t\t\t} else {\n\t\t\t\troute(handle, pathname, response, postData, authToken);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f2443d3a3166fdf4737cffec18060ea7", "score": "0.5950406", "text": "function onRequest(request, response){\n console.log('A user made a request' + request.url);\n response.writeHead(200, {\"Context-Type\":\"text/plain\"});\n response.write(\"Here is the response data\");\n response.end();\n}", "title": "" }, { "docid": "2826373f9f9c6ea90b7d79ebcce0cd5d", "score": "0.594126", "text": "function requestHandler(req,res){\n\tif(req.method == 'POST'){\n\t\tvar pathname = url.parse(req.url).pathname;\t\t\t\n\t\n\t\tif(pathname == '/'){\n\t\t\tflag = 'FLOW';\n\t\t\treq.on('data',function(str){\n\t\t\t\t++order;\n\t\t\t\tbuf1 += str;\n\t\t\t});\n\t\t\t\n\t\t\treq.on('end',function(){\n\t\t\t\tbuf2 = buf1;\n\t\t\t\tbuf1 = '';\n\t\t\t\tif(order == 2){\n\t\t\t\t\twrite_File(buf2,socket,flag);\t\n\t\t\t\t\tbuf2 = '';\n\t\t\t\t\torder = 0;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\t\t\n\t\t}else if(pathname == '/user'){\n\t\t\tflag = 'USER';\n\t\t\treq.on('data',function(str){\n\t\t\t\tbuf1 += str;\n\t\t\t});\n\t\t\treq.on('end',function(){\n\t\t\t\tbuf2 = buf1;\n\t\t\t\tbuf1 = '';\n\t\t\t\twirte_File(buf2,socket,flag);\n\t\t\t\tbuf2 = '';\n\t\t\t});\n\t\n\t\t}else if(pathname == '/start'){\n\t\t\tflag = 'START';\n\t\t\treq.on('data',function(str){\n buf1 += str;\n });\n\t\t\treq.on('end',function(){\n\t\t\t\tbuf2 = buf1;\n\t\t\t\twrite_File(buf2,socket,flag);\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\n\t}else if(req.method == 'GET'){\n\t\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "f587f3987d7fce963913a1042fb39ca6", "score": "0.59407353", "text": "logRequests() {\n this.app.use('/', (req, res, next) => {\n this.debug(`Request: ${req.protocol}://${req.get('host')}${req.originalUrl}`);\n next();\n });\n }", "title": "" }, { "docid": "8f955f643c37d56d6d4415ee036f7b71", "score": "0.59400964", "text": "function check_requests (buf) {\n output = parse_messages('request', buf)\n\n// TODO: check number / ordering of requests\n// TODO: check for request modification\n \n}", "title": "" }, { "docid": "38137cfa659e09d61ef746c2344e57dc", "score": "0.5938373", "text": "function get_request_data(req, on_complete) {\n var body = '';\n req.on('data', function(chunk) {\n body += chunk;\n if (body.length > 1e6) request.connection.destroy();\n });\n req.on('end', function() {\n var post = qs.parse(body);\n on_complete(post);\n });\n}", "title": "" }, { "docid": "e8f5a8368cc4f5b656d415fa6efb4e6b", "score": "0.59370744", "text": "request(req, event, context) {\n req.event = event;\n req.context = context;\n }", "title": "" }, { "docid": "a227d90eadec058b27d110afbf744ecf", "score": "0.59362996", "text": "function request() {\n return { type: chairConstants.GET_CHAIRS_REQUEST };\n }", "title": "" }, { "docid": "afc48132862fe4f39490826d7b1258c2", "score": "0.5931854", "text": "get requestServedFromCache() {\n return this._requestServedFromCache;\n }", "title": "" }, { "docid": "09d077f119afe89b15ca7e47bc55d787", "score": "0.59168106", "text": "get requestor() {\n\t\treturn this.__requestor;\n\t}", "title": "" }, { "docid": "bf9aa2c4d3e40e77bb6c46e8edf10644", "score": "0.59139925", "text": "getReq() {\n return this.req;\n }", "title": "" }, { "docid": "62b80f3b0b264a884ef0d4eeaa5c816c", "score": "0.5913364", "text": "get request() {\n return this._goalRequest;\n }", "title": "" }, { "docid": "eddce6b7c8603d4ed5f7d90e8426bbaa", "score": "0.59124875", "text": "function processRequestUrl(request) {\n\n if (compiling) {\n log.debug('Currently compiling, delaying', request.filePath);\n\n onCompilation.push(function () {\n log.debug('Post compilation, now serving', request.filePath);\n\n if (memFS.existsSync(request.filePath)) {\n sendBackFile(memFS.readFileSync(request.filePath), request.port);\n } else {\n log.warn('Even after compilation, file not found in memfs', request.filePath);\n sendBackFile(null, request.port);\n }\n });\n } else {\n if (memFS.existsSync(request.filePath)) {\n sendBackFile(memFS.readFileSync(request.filePath), request.port);\n } else {\n log.warn('File not found in memfs', request.filePath);\n sendBackFile(null, request.port);\n }\n }\n}", "title": "" }, { "docid": "b5d3021911ef7f914e4961c65e532e8f", "score": "0.5894046", "text": "function logRequest(request, response, next) {\n\tconsole.log(\"Received a request for: \" + request.url);\n\n\t// don't forget to call next() to allow the next parts of the pipeline to function\n\tnext();\n}", "title": "" }, { "docid": "b5d3021911ef7f914e4961c65e532e8f", "score": "0.5894046", "text": "function logRequest(request, response, next) {\n\tconsole.log(\"Received a request for: \" + request.url);\n\n\t// don't forget to call next() to allow the next parts of the pipeline to function\n\tnext();\n}", "title": "" }, { "docid": "8b35d7251e24f75b2ff86b00f906a57d", "score": "0.58885026", "text": "function isRequest(e){return\"object\"==typeof e&&\"object\"==typeof e[INTERNALS$2]}", "title": "" }, { "docid": "64d955f6bd5a99bf920c6a8a486e9744", "score": "0.5887642", "text": "function onRequest(req, res) {\n var parsedUrl = url.parse(req.url);\n var params = query.parse(parsedUrl.query);\n\n if (parsedUrl.pathname === '/routeSearch') {\n routeStart = null;\n routeEnd = null;\n locationsFound = 0;\n convertLocs(params, res);\n } else if (parsedUrl.pathname === '/stationSearch') {\n stationSearch(res, params);\n } else if (parsedUrl.pathname === '/js/roadsign.js') {\n res.writeHead(200, { \"Content-Type\" : \"text/javascript\"});\n res.write(mainscript);\n res.end();\n } else if (parsedUrl.pathname === '/js/roadsignGlobals.js') {\n res.writeHead(200, { \"Content-Type\" : \"text/javascript\"});\n res.write(supportscript);\n res.end();\n } else if (parsedUrl.pathname === '/css/roadsign.css') {\n res.writeHead(200, { \"Content-Type\" : \"text/css\"});\n res.write(mainstyle);\n res.end();\n } else if (parsedUrl.pathname === '/images/roadsign.png') {\n res.writeHead(200, { \"Content-Type\" : \"image/png\"});\n res.write(logo);\n res.end();\n } else {\n res.writeHead(200, { \"Content-Type\" : \"text/html\"} );\n res.write(index);\n res.end();\n }\n}", "title": "" }, { "docid": "d985d892f378920a8b7c13200f8d6697", "score": "0.58875227", "text": "function onRequest (req, resp) {\n console.log(req.headers);\n}", "title": "" }, { "docid": "ed65162ba6f54d00cc7c680133cb918f", "score": "0.5862967", "text": "function handleRequest(request, response) { \n try {\n //log the request on console\n console.log(request.url);\n //Disptach\n dispatcher.dispatch(request, response);\n } catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "d0daefb13678df0b6c5800d79a670910", "score": "0.5849071", "text": "function request() {\n return { type: chairConstants.GET_CHAIR_REQUEST };\n }", "title": "" }, { "docid": "bcf62be0a4ac611ba9b4a352641ff749", "score": "0.58461946", "text": "function handleRequest(request, response){\n try {\n //log the request on console\n console.log(request.url);\n //Disptach\n dispatcher.dispatch(request, response);\n } catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "dba308008786f329c172825afbde36a7", "score": "0.5844004", "text": "static req() {\n if (this.isCloudRunning()) {\n return req;\n }\n return null;\n }", "title": "" }, { "docid": "6bab0a8a4371fa84c0e6a51db3a391d8", "score": "0.5829542", "text": "function onRequest(request, response) {\n //Split after the ? mark to get the query string (key=value pairs)\n var query = request.url.split('?')[1];\n\n //Parse the querystring into a JS object of variables and values\n //PARAMS MUST BE ENCODED WITH encodeURIComponent\n var params = queryString.parse(query);\n \n //check if params does not have a url field (meaning no url came in request)\n if(!params.url) {\n //write a 400 error code out\n response.writeHead(400, responseHeaders);\n \n //json error message to respond with\n var responseMessage = {\n message: \"Missing url parameter in request\"\n };\n \n //stringify JSON message and write it to response\n response.write(JSON.stringify(responseMessage));\n \n //send response\n response.end();\n \n //end this request by returning from this function\n return;\n }\n \n //try in case URL is invalid or fails\n try{\n //write a 200 okay status code and send CORS headers to allow client to access this\n response.writeHead(200, responseHeaders);\n \n //make a request to the url and pipe (feed) the returned ajax call to our client response\n //Here we are connecting the next servers response back to our page. \n requestHandler(params.url).pipe(response);\n }\n catch(exception) {\n console.dir(exception);\n //write a 500 error out\n response.writeHead(500, responseHeaders);\n \n //json error message to respond with\n var responseMessage = {\n message: \"Error connecting to server. Check url and arguments for proper formatting\"\n }\n \n //stringify JSON message and write it to response\n response.write(JSON.stringify(responseMessage));\n \n //send response\n response.end();\n }\n}", "title": "" }, { "docid": "a3ff46abc3fb7094a1351a17a9db2186", "score": "0.58262086", "text": "function onRequest(req, sender, sendResponse) {\n if (req.deb) {\n // debug\n console.log(req.deb);\n sendResponse({});\n } else if (req.savedlist) {\n // send list of saved files\n sendResponse(savedList);\n } else if (req.save) {\n // manual save\n // find from cache\n var obj = _findFile(req.url);\n if (obj) {\n saveFile(obj.url, obj.type, obj.body, true);\n// markFileSaved(obj.url);\n }\n sendResponse({});\n } else if (req.last) {\n // ask last url\n sendResponse(lastUrlNoMapping);\n/* } else if (req.load) {\n // page reload: clear\n chrome.tabs.getSelected(null, function(tab) {\n console.debug(\"load, tab:\", tab.id);\n// console.debug(\"d1\", chrome.experimental.devtools.panels.elements);\n });\n sendResponse({});*/\n } else {\n // CSS or JS was modified\n saveFile(req.url, req.type, req.body);\n sendResponse({});\n }\n}", "title": "" }, { "docid": "25bf157afb3b50c27fa66cf3cf9e250b", "score": "0.5823483", "text": "function server_request(request_dict, path, callback) {\n var url = server + \"/\" + path\n var xmlhttp = new XMLHttpRequest();\n if(request_dict != \"\") {\n method = \"POST\"\n } else {\n method = \"GET\"\n }\n xmlhttp.open(method, url, true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xmlhttp.onerror = function(e) {\n error_box(tr(\"tr-server-down\"))\n };\n xmlhttp.onload = function () {\n callback(xmlhttp)\n };\n xmlhttp.send(JSON.stringify(request_dict));\n}", "title": "" }, { "docid": "5cf6846ccd4402eff41e61780126fa00", "score": "0.58205813", "text": "function handleRequestONE(request, response){\n response.end('Thanks for stopping by. I will give you a 30 second head start before releasing a hound. ' + request.url);\n}", "title": "" }, { "docid": "e7e57d669475a226574fe2e0340a0d60", "score": "0.5812134", "text": "function echoreq(req) {\n var r = {\n reqcnt: reqcnt,\n method: req.method,\n url: req.originalUrl,\n headers: req.headers,\n query: req.query,\n params: req.params,\n body: req.body,\n cookies: req.cookies,\n sessionID: req.sessionID,\n user: req.user,\n session: req.session\n };\n return r;\n}", "title": "" }, { "docid": "6c33935602872ab1674df9c071d9419a", "score": "0.58061856", "text": "get remotelyCallable() { return [\"clientRequestForServer\"] }", "title": "" }, { "docid": "71604ffb982cb20f8c4a560f6e17ae67", "score": "0.5805885", "text": "function onRequest(request, response){\n\tconsole.log(\"A user has made a request..\"+request.url);\n\t// response.writeHead(200,{\"Context-Type \": \"text/plain\"});\n\t// response.write(\"Here is your response\");\n\t// response.end(); \n\t//200- everything went okay, 404:shit went wrong\n\n\t//sending back html file\n\tif(request.method == 'GET' && request.url== '/'){\n\t\tresponse.writeHead(200,{\"Content-Type\":\"text/html\"});\n\t\tfs.createReadStream(\"./index.html\").pipe(response);\n\n\t}\n\telse {\n\t\tSend404(response);\n\t}\n\n\n}", "title": "" }, { "docid": "cc609251ba06d512f3c1811a14e5deb9", "score": "0.57970196", "text": "function onRequest(request,response) {\n var uriPath = url.parse(request.url).pathname;\n //if (DEBUG) console.log(uriPath);\n\n // /log/2016-02-12\n var re = new RegExp('^\\/log\\/\\\\d{4}-\\\\d{1,2}-\\\\d{1,2}$');\n\n // Dispatcher\n if (uriPath == '/logs') {\n var result = [];\n fs.readdir(logDirectory, function(err, files){\n if (err) {\n //return null;\n }\n files.filter(function(file){\n return fs.statSync(logDirectory+file).isFile() && path.extname(file) == '.log';\n }).forEach(function(file){\n result[result.length] = path.basename(file,'.log');\n });\n if(DEBUG) console.log(JSON.stringify(result));\n\n response.writeHead(200, {'Content-Type': 'application/json', 'Access-Control-Allow-Origin':'*'});\n response.write(JSON.stringify(result));\n response.end();\n });\n\n // /log/2016-02-12\n } else if (uriPath.match(re) != null) {\n\t\tvar filename = uriPath.substring(5,uriPath.length);\n var logfile = logDirectory + filename + '.log';\n try{\n fs.readFile(logfile, function(err, data){\n if (err) {\n response.writeHead(200, {'Content-Type': 'text/html', 'Access-Control-Allow-Origin':'*'});\n response.write('error');\n response.end();\n }\n else {\n response.writeHead(200, {'Content-Type': 'text/html', 'Access-Control-Allow-Origin':'*'});\n var htmlData = (data+'').replace(/\\n/g,'<br/>');\n response.write(htmlData);\n response.end();\n }\n });\n } catch(e) {\n console.log(e.message);\n response.end();\n }\n\n } else {\n response.end();\n }\n }", "title": "" }, { "docid": "353bc1194c31a175a62cea16179d7387", "score": "0.5788622", "text": "onRequestStarted() {\n this.startedRequestCount++;\n\n const activeCount = this.activeRequestCount();\n log.verbose('NetworkRecorder', `Request started. ${activeCount} requests in progress` +\n ` (${this.startedRequestCount} started and ${this.finishedRequestCount} finished).`);\n\n // If only one request in progress, emit event that we've transitioned from\n // idle to busy.\n if (activeCount === 1) {\n this.emit('networkbusy');\n }\n }", "title": "" }, { "docid": "b3eb724e795d39919bbdb98f81934009", "score": "0.57866657", "text": "_makeRequest (request) {\n // The `.handleRequest()` function just\n // so happens to do everything we need.\n return this._runner.handleRequest(request)\n }", "title": "" }, { "docid": "74faab286d97f84325e3a161711c43c5", "score": "0.5780798", "text": "async function handleRequest(_request, _response) {\n let url = Url.parse(_request.url, true);\n let task = url.pathname.slice(1, url.pathname.length);\n console.log(\"I hear voices!\");\n /*definiert aufmachung der response*/\n _response.setHeader(\"content-type\", \"text/html; charset=utf-8\");\n /*definiert wer auf den server zugreifen darf*/\n _response.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n console.log(task);\n if (task == \"submit\") {\n storeSubmit(url.query);\n _response.write(\"Session Submitted\");\n }\n if (task == \"show\") {\n let cursor = submits.find();\n let result = await cursor.toArray();\n console.log(result);\n _response.write(JSON.stringify(result));\n }\n _response.end();\n }", "title": "" }, { "docid": "7f73b254db80ae96e9bad0e32ab8a6d5", "score": "0.57806474", "text": "function onRequest(request, response) {\n\ttry {\n\t\tvar pathname = url.parse(request.url).pathname;\n\t\tvar pathpcs = pathname.split('/');\n\n\t\t// TODO: Check if /p/ or /u/ requests come from this domain.\n\t\tif (pathpcs[1] == 'p') {\n\t\t\troutePlaylist(request, response);\n\t\t} else if (pathpcs[1] == 'u') {\n\t\t\trouteUnshorten(request, response);\n\t\t} else {\n\t\t\troute(request, response);\n\t\t}\n\t} catch (err) {\n\t\tltLog.error(err);\n\t}\n}", "title": "" }, { "docid": "2962b33f31817e68477b9421e82798c3", "score": "0.57782155", "text": "function getPost(request,response){\n\trequest.setEncoding(\"utf8\");\n\trequest.content = '';\n\trequest.addListener(\"data\", function(chunk) {\n\t\trequest.content += chunk;\n\t});\n \n\trequest.addListener(\"end\", function() {\n\t\tvar qs = require('querystring');\n\t\tPOST=qs.parse(request.content);\n\t\tpostInterest(POST,response);\n\t}); \n}", "title": "" }, { "docid": "41b1dd73a204d06204aac473290d7ed3", "score": "0.5777665", "text": "function respond(request, response) {\n console.log(request.headers);\n console.log(\"server hostname: \" + request.hostname);\n console.log(\"client IP address: \" + request.ip);\n response.end(\"hello client!\");\n}", "title": "" }, { "docid": "4bdc56a038eb0c6923066e5164bd2b2f", "score": "0.57559484", "text": "onRequestWillBeSent(data) {\n // NOTE: data.timestamp -> time, data.type -> resourceType\n this.networkManager._dispatcher.requestWillBeSent(data.requestId,\n data.frameId, data.loaderId, data.documentURL, data.request,\n data.timestamp, data.wallTime, data.initiator, data.redirectResponse,\n data.type);\n }", "title": "" }, { "docid": "950e7e5c69d8b0760801bab0057e40c4", "score": "0.57554024", "text": "function onRequest(request, response) {\n\tvar pathname = url.parse(request.url).pathname;\n\tconsole.log(\"Request for \" + pathname + \" received.\");\n\tswitch(pathname) {\n\t\tcase '/':\n\t\t\tindex(request, response);\n\t\t\tbreak;\n\t\tcase '/radio':\n\t\t\tradio(request, response);\n\t\t\tbreak;\n\t\tcase '/demod':\n\t\t\tdemod(request, response);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(\"No request handler found for \" + pathname);\n\t\t\tresponse.writeHead(404, {\"Content-Type\": \"text/html\"});\n\t\t\tresponse.write(\"404 Not found\");\n\t\t\tresponse.end();\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "188e184bbe68a68c4925236b945bb22d", "score": "0.5753021", "text": "function handleRequest(request, response){\n response.end('Building: ' + request.url);\n}", "title": "" }, { "docid": "d6db2e882bbcb12dcd619b15d338d558", "score": "0.5752081", "text": "function WbBackGround_request(elm)\n {\n logDebug(\"WbBackGround_request: \", elm.source) ;\n if ( elm.source )\n {\n var def = doTimedXMLHttpRequest(elm.source, pollerTimeout);\n def.addBoth(WbBackGround_receive, elm) ;\n }\n else\n {\n logError(\"WbBackGround_request (no source)\") ;\n }\n return;\n }", "title": "" }, { "docid": "c417fef0e8c060d90ea7542973347d2c", "score": "0.5747666", "text": "function routeRequests(req, res){\n console.log(\"req.url: \" + req.url);\n\n //Default Form\n if(req.url == '/'){\n res.writeHead(200, {'Content-Type': 'text/html'})\n fs.createReadStream('./view/index.html').pipe(res)\n }\n else if(req.url=='/crawler'){\n console.log(\"crawler request init\")\n let body = ''\n var queryReq\n req.on('data', chunk => {\n body += chunk.toString()\n })\n req.on('end', () => {\n queryReq=parse(body)\n console.log(\"Query request:\")\n console.log(queryReq)\n //res.end('Getting files . . .')\n startCrawling(req, res, queryReq)\n })\n }\n else{\n console.log(\"No valid option\")\n default_error(res)\n }\n}", "title": "" }, { "docid": "99d1ef06158c7538dd0dc3224025e401", "score": "0.5745982", "text": "function onRequest(request, response) {\n\ttry {\n\t\tvar pathname = url.parse(request.url).pathname;\n\t\tvar pathpcs = pathname.split('/');\n\n\t\t// TODO: Check if /p/ or /u/ or /c/ requests come from this domain.\n\t\tif (pathpcs[1] == 'p') {\n\t\t\troutePlaylist(request, response);\n\t\t} else if (pathpcs[1] == 'u') {\n\t\t\trouteUnshorten(request, response);\n\t\t} else if (pathpcs[1] == 'c') {\n\t\t\trouteClone(request, response);\n\t\t} else {\n\t\t\troute(request, response);\n\t\t}\n\t} catch (err) {\n\t\tltLog.error(err);\n\t\tthrow err;\n\t}\n}", "title": "" }, { "docid": "1c0825db44b8722aae4ded6c95361d8f", "score": "0.57418436", "text": "getRequestBody() {}", "title": "" }, { "docid": "22529cc7fa44703afb8fc8cf24fad79e", "score": "0.57360125", "text": "function logRequest(req, res, next) { // HL\n var num = reqs++\n next() // HL\n setImmediate(function () {\n console.log('got request', num, req.url)\n })\n}", "title": "" }, { "docid": "6372307eb6b529258f2816a7b3081dce", "score": "0.57184494", "text": "getRequestObject() {\n return this.requestObject;\n }", "title": "" }, { "docid": "95b2862cceddc7037fb3fbcaa4f7ffa2", "score": "0.571766", "text": "function handleRequest(request, response){\n response.end('It Works!! Path Hit: ' + request.url);\n}", "title": "" }, { "docid": "95b2862cceddc7037fb3fbcaa4f7ffa2", "score": "0.571766", "text": "function handleRequest(request, response){\n response.end('It Works!! Path Hit: ' + request.url);\n}", "title": "" }, { "docid": "95b2862cceddc7037fb3fbcaa4f7ffa2", "score": "0.571766", "text": "function handleRequest(request, response){\n response.end('It Works!! Path Hit: ' + request.url);\n}", "title": "" }, { "docid": "95b2862cceddc7037fb3fbcaa4f7ffa2", "score": "0.571766", "text": "function handleRequest(request, response){\n response.end('It Works!! Path Hit: ' + request.url);\n}", "title": "" }, { "docid": "7e45c00e2c16a1347db2e5f02afbe6bd", "score": "0.5710895", "text": "function start() {\n function onRequest(request, response) {\n var pathname = url.parse(request.url).pathname;\n var query = url.parse(request.url).query;\n response.writeHead(200, {\"Content-Type\": \"text/plain\"});\n response.write(\"Hola mundo de Alex!\");\n response.write(pathname);\n response.write(query);\n response.write(qs.parse(query)[\"surname\"]); //Tiene que exisir y llamarse asi, sino tira excep..\n response.end();\n\n router.route(pathname);\n }\n\n http.createServer(onRequest).listen('8888');\n console.log(\"Servidor inicializado...\");\n}", "title": "" }, { "docid": "4f505a964e4be845127fd32e8daf15de", "score": "0.57101065", "text": "function handleRequest(request, response) {\n response.end(\"Does this work?\" + request.url);\n\n}", "title": "" }, { "docid": "c1318c5b92ec02de92790a0829497ca9", "score": "0.5709218", "text": "onRequestWillBeSent(data) {\n this._rawEvents.push({method: 'Network.requestWillBeSent', params: data});\n // NOTE: data.timestamp -> time, data.type -> resourceType\n this.networkManager._dispatcher.requestWillBeSent(data.requestId,\n data.frameId, data.loaderId, data.documentURL, data.request,\n data.timestamp, data.wallTime, data.initiator, data.redirectResponse,\n data.type);\n }", "title": "" }, { "docid": "32b3bf76980e062ce368746ee42bd083", "score": "0.5705501", "text": "function onRequest(request, response) \n\t{\n\t\thttpRoute(request, response);\n\t}", "title": "" }, { "docid": "8249ed3e3ada16f84534eb90f7408da6", "score": "0.5704496", "text": "function process_request(req, res) {\n var body = 'Thanks for calling!\\n';\n var content_length = body.length;\n /* The '200 OK' response passed to the 'ServerResponse #writeHead function is returned\n in the HTTP response headers, and you see the content-length and types are both shown.\n */\n res.writeHead(200, {\n 'Content-Length': content_length,\n 'Content-Type': 'text/plain'\n });\n res.end(body);\n}", "title": "" }, { "docid": "794f932dec06a6b044d5b41b6678d9cb", "score": "0.56999165", "text": "get currReqs() {\r\n\t\t\t\treturn $g(\"count(.//iframe)\", {\r\n\t\t\t\t\t\tnode : $(\"silent_req_holder\"),\r\n\t\t\t\t\t\ttype : 1\r\n\t\t\t\t\t});\r\n\t\t\t}", "title": "" }, { "docid": "f962aec581f79fb5cb366869c89b92bf", "score": "0.56975234", "text": "function requestHandler(request, response) {\n response.send(200,\"Agent responding to web request\");\n agentlog(true,\"Request came from web\");\n}", "title": "" }, { "docid": "1a72104bffbc421effd2bfaf1233724d", "score": "0.5696672", "text": "function onRequest(request,response){\n\tif(request.method==\"GET\" && request.url == \"/\"){\n\t\tresponse.writeHead(200,{\"Content-Type\":\"text/html\"});\n\t\tfs.createReadStream(\"./index.html\").pipe(response);\t\t\n\t}\n\telse{\n\t\tsend404Reqeust(response);\n\t}\n\t// sendTextResp();\n\n}", "title": "" }, { "docid": "c0c1412acc160cf4960a71f77d6e24b6", "score": "0.5696027", "text": "function fetch_request_cnt(callback) {\n User.ajax({\n url: '/api/service/request',\n type: 'POST',\n data: {},\n error: callback.onError,\n success: callback.onSuccess,\n });\n }", "title": "" }, { "docid": "c60ce5d3e9c389abad9a9bbdba188dee", "score": "0.5694047", "text": "function handleRequest(request, response){\n console.log(\"============== handleRequest\")\n response.end('It Works!! Path Hit: ' + request.url);\n }", "title": "" } ]
ef8ebe99c1189c5be8c3e5dd319aa775
For the given forecastHour, places all utilized GFS data into this.data[forecastHour].
[ { "docid": "9157b8e8adae99ff908d6a0e9f8fafdc", "score": "0.6652348", "text": "async parseData(forecastHour, filePath) {\n this.data[forecastHour] = {};\n\n const capeData = await DataSource.parseGribFile(filePath, {\n category: 7, // Grib2 category number, equals to --fc 1\n parameter: 6, // Grib2 parameter number, equals to --fp 7\n surfaceType: 1, // Grib2 surface type, equals to --fs 103\n //surfaceValue: 10, // Grib2 surface value, equals to --fv 10\n }, GfsDataSource.parseGfsBody);\n\n const windUData = await DataSource.parseGribFile(filePath, {\n category: 2, // Grib2 category number, equals to --fc 1\n parameter: 2, // 2 U-wind, 3 V-wind, 192 Vert speed sheer\n surfaceType: 100, // Isobar surface\n surfaceValue: 100000,\n }, GfsDataSource.parseGfsBody);\n\n const windVData = await DataSource.parseGribFile(filePath, {\n category: 2, // Grib2 category number, equals to --fc 1\n parameter: 3, // 2 U-wind, 3 V-wind, 192 Vert speed sheer\n surfaceType: 100, // Isobar surface\n surfaceValue: 100000,\n }, GfsDataSource.parseGfsBody);\n\n const tempData = await DataSource.parseGribFile(filePath, {\n category: 0,\n parameter: 0,\n }, GfsDataSource.parseGfsBody);\n\n const vortexData = await DataSource.parseGribFile(filePath, {\n category: 2,\n parameter: 10,\n surfaceType: 100,\n surfaceValue: 10000,\n }, GfsDataSource.parseGfsBody);\n\n this.data[forecastHour] = {\n cape: capeData[0],\n windU: windUData[0],\n windV: windVData[0],\n temperature: tempData[0],\n vorticity: vortexData[0],\n };\n }", "title": "" } ]
[ { "docid": "d8d1c56a2e7731f0450869f2ef283b0c", "score": "0.55913657", "text": "function getHourly(locData) {\n const API_KEY = 'WZvTdK3lWnFfx2XJNtJCbcPzebd1h19y';\n const CITY_CODE = locData['key'];\n const URL = \"https://dataservice.accuweather.com/forecasts/v1/hourly/12hour/\" + CITY_CODE + \"?apikey=\" + API_KEY;\n fetch(URL)\n .then(response => response.json())\n .then(function (data) {\n console.log('Json object from getHourly function:');\n console.log(data); // See what we got back\n // Get the first hour in the returned data\n let date_obj = new Date(data[0].DateTime);\n let nextHour = date_obj.getHours(); // returns 0 to 23\n // Store into the object\n locData[\"nextHour\"] = nextHour;\n // Counter for the forecast hourly temps\n var i = 1;\n // Get the temps for the next 12 hours\n data.forEach(function (element) {\n let temp = element.Temperature.Value;\n let hour = 'hourTemp' + i;\n locData[hour] = temp; // Store hour and temp to object\n // New hiTemp variable, assign value from previous 12 hours\n let hiTemp = locData.pastHigh;\n // New lowTemp variable, assign value from previous 12 hours\n let lowTemp = locData.pastLow;\n // Check current forecast temp to see if it is \n // higher or lower than previous hi or low\n if (temp > hiTemp) {\n hiTemp = temp;\n } else if (temp < lowTemp) {\n lowTemp = temp;\n }\n // Replace stored low hi and low temps if they changed\n if (hiTemp != locData.pastHigh) {\n locData[\"pastHigh\"] = hiTemp; // When done, this is today's high temp\n }\n if (lowTemp != locData.pastLow) {\n locData[\"pastLow\"] = lowTemp; // When done, this is today's low temp\n }\n i++; // Increase the counter by 1\n }); // ends the foreach method\n console.log('Finished locData object and data:');\n console.log(locData);\n buildPage(locData); // Send data to buildPage function\n })\n .catch(error => console.log('There was an error: ', error))\n} // end getHourly function", "title": "" }, { "docid": "8ecbb3eff062dbebbebfd15c1ef4ff5f", "score": "0.5548305", "text": "function fetchTempFahrenheit(forecast) {\n let i = 0;\n forecast.forEach((day) => {\n Object.entries(day.temp).forEach(([key, value]) => {\n const temp = convertUnitTo.fahrenheit(value);\n forecastedTemp[i] = `${temp}° F`;\n forecastCollection.temp = forecastedTemp;\n });\n i++;\n });\n }", "title": "" }, { "docid": "6d8075e1a116aa6e23736f368acbaf38", "score": "0.53593874", "text": "function pastHourFilter(){\n //find ms from epoch for six hours from right now \n var d = new Date();\n d.setHours(d.getHours()-1);\n var pastHour = d.getTime();\n //console.log(d.getTime());\n \n for (var i =0;i<userData.length;i++)\n { var dataDateTime= parseInt(userData[i].Timekey);\n //check if HR selected\n if (dataDateTime>=pastHour){\n filteredData.push({\n \"Date\": getDateText(userData[i].Timekey),\n \"Time\": getTimeText(userData[i].Timekey),\n \"HR\":userData[i].HR,\n \"BR\":userData[i].BR,\n \"HRV\":userData[i].HRV\n });\n }\n } \n}", "title": "" }, { "docid": "551ab8be2fb49c94544721d30c6a3321", "score": "0.5352718", "text": "function setUpDailyHourlyTemp(data,datasetVal = \"daily\") {\n const contentWrapper = document.querySelector('#tabs_content_' + datasetVal);\n const dataset = forecast[datasetVal].data;\n let strToPrnt = '';\n \n if (!forecast) forecast = data.forecast;\n \n if (!contentWrapper) console.error('datasetVal not set correctly for setUpDailyHourlyTemp()');\n\n strToPrnt += '<p style=\"margin-top: 0\"><strong>Summary</strong><br>' + forecast[datasetVal].summary + '</p>';\n\n for (let i = 0; i < dataset.length; i++) {\n let date = new Date(dataset[i].time*1000);\n let dayOfWeek = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][date.getDay()].toUpperCase();\n // let month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'][date.getMonth()];\n let dayOfMonth = date.getDate();\n let nthOfMo = nth(dayOfMonth);\n let timeOfDay = date.getHours()%12 !== 0 ? date.getHours()%12 : 12 ;\n let ampm = date.getHours() < 12 ? 'AM' : 'PM' ;\n let precipChance = Math.round(dataset[i].precipProbability*100);\n let precipType = dataset[i].precipType || 'precip';\n\n strToPrnt+= '<div class=\"future-forecast\">';\n\n strToPrnt+= '<div class=\"future-forecast-time-date\"><div>';\n strToPrnt+= dayOfWeek + '<br>';\n if (datasetVal === \"daily\") strToPrnt += dayOfMonth + '<sup>' + nthOfMo + '</sup>';\n if (datasetVal === \"hourly\") strToPrnt += timeOfDay + ' <small>' + ampm + '</small>';\n strToPrnt+= '</div></div><!-- end .future-forecast-time-date -->';\n \n strToPrnt += '<div class=\"future-forecast-temps-precip\">';\n if (datasetVal === \"daily\") {\n let dayTempHigh = Math.round(dataset[i].temperatureHigh);\n let dayTempHighTime = unixConv(dataset[i].temperatureHighTime, 'timeShort');\n let dayTempLow = Math.round(dataset[i].temperatureLow);\n let dayTempLowTime = unixConv(dataset[i].temperatureLowTime, 'timeShort');\n\n strToPrnt += '<div class=\"future-forecast-temps-item\">';\n strToPrnt += '<div class=\"future-forecast-temps-item-top\">';\n strToPrnt += '<div class=\"temp-low\">' + dayTempLow + '&#176;</div>'\n strToPrnt += '</div><!-- end .future-forecast-temps-item-top -->';\n strToPrnt += '<div class=\"future-forecast-temps-item-bottom\">';\n strToPrnt += dayTempLowTime;\n strToPrnt += '</div><!-- end .future-forecast-temps-item-bottom -->';\n strToPrnt += '</div><!-- end .future-forecast-temps-item -->';\n\n strToPrnt += '<div class=\"future-forecast-temps-item\">';\n strToPrnt += '<div class=\"future-forecast-temps-item-top\">';\n strToPrnt += '<div class=\"temp-high\">' + dayTempHigh + '&#176;</div>'\n strToPrnt += '</div><!-- end .future-forecast-temps-item-top -->';\n strToPrnt += '<div class=\"future-forecast-temps-item-bottom\">';\n strToPrnt += dayTempHighTime;\n strToPrnt += '</div><!-- end .future-forecast-temps-item-bottom -->';\n strToPrnt += '</div><!-- end .future-forecast-temps-item -->';\n } else if (datasetVal === \"hourly\") {\n let hourTempActual = Math.round(dataset[i].temperature);\n let hourTempFeels = Math.round(dataset[i].apparentTemperature);\n\n strToPrnt += '<div class=\"future-forecast-temps-item\">';\n strToPrnt += '<div class=\"future-forecast-temps-item-top\">';\n strToPrnt += '<div class=\"temp-actual-feels\">' + hourTempActual + '&#176;</div>'\n strToPrnt += '</div><!-- end .future-forecast-temps-item-top -->';\n strToPrnt += '<div class=\"future-forecast-temps-item-bottom\">';\n strToPrnt += 'Actual';\n strToPrnt += '</div><!-- end .future-forecast-temps-item-bottom -->';\n strToPrnt += '</div><!-- end .future-forecast-temps-item -->';\n\n strToPrnt += '<div class=\"future-forecast-temps-item\">';\n strToPrnt += '<div class=\"future-forecast-temps-item-top\">';\n strToPrnt += '<div class=\"temp-actual-feels\">' + hourTempFeels + '&#176;</div>'\n strToPrnt += '</div><!-- end .future-forecast-temps-item-top -->';\n strToPrnt += '<div class=\"future-forecast-temps-item-bottom\">';\n strToPrnt += 'Feels Like';\n strToPrnt += '</div><!-- end .future-forecast-temps-item-bottom -->';\n strToPrnt += '</div><!-- end .future-forecast-temps-item -->';\n }\n \n strToPrnt += '<div class=\"future-forecast-temps-item\">';\n strToPrnt += '<div class=\"future-forecast-temps-item-top\">';\n strToPrnt += '<div class=\"precip-chance\">' + precipChance + '%</div>'\n strToPrnt += '</div><!-- end .future-forecast-temps-item-top -->';\n strToPrnt += '<div class=\"future-forecast-temps-item-bottom\">';\n strToPrnt += precipType;\n strToPrnt += '</div><!-- end .future-forecast-temps-item-bottom -->';\n strToPrnt += '</div><!-- end .future-forecast-temps-item -->';\n\n let canvasID = 'forecast-icon-' + datasetVal + i;\n strToPrnt += '<div class=\"future-forecast-temps-item\">';\n strToPrnt += '<canvas id=\"' + canvasID + '\" width=\"49\" height=\"49\"></canvas>';\n strToPrnt += '</div><!-- end .future-forecast-temps-item -->';\n if (datasetVal === \"daily\") {\n setTimeout(()=> {\n mainIcon.add(canvasID, Skycons[dataset[i].icon.toUpperCase().replace(/-/g, \"_\")]);\n },250)\n } else {\n setTimeout(()=> {\n skycons.add(canvasID, Skycons[dataset[i].icon.toUpperCase().replace(/-/g, \"_\")]);\n },250)\n }\n \n\n strToPrnt += '<div class=\"future-forecast-temps-item fullWidth\">';\n strToPrnt += dataset[i].summary;\n strToPrnt += '</div><!-- end .future-forecast-temps-item.fullWidth -->';\n\n strToPrnt += '</div><!-- end .future-forecast-temps-precip -->';\n\n \n\n strToPrnt+= '</div><!-- end .future-forecast -->';\n }\n\n contentWrapper.innerHTML = strToPrnt;\n\n}", "title": "" }, { "docid": "cc91a6185902ccc08a6ce24466d087b3", "score": "0.5205553", "text": "function addForecastHours(hours, sheet) {\n hours.map(function(hour){ \n sheet.appendRow([\n hour.time,\n hour.temperature,\n hour.dewPoint,\n hour.humidity\n ]);\n });\n}", "title": "" }, { "docid": "09c4e59adf882df9da09e2ec64a10dac", "score": "0.517421", "text": "function getHourly(hourlyForecastURL) {\n // NWS User-Agent header (built above) will be the second parameter \n fetch(hourlyForecastURL, idHeader) \n .then(function(response){\n if(response.ok){ \n return response.json(); \n } \n throw new ERROR('Response not OK.');\n })\n .then(function (data) { \n // Let's see what we got back\n console.log('From hourlyForecastURL function:'); \n console.log(data);\n\n // Set the hourly temperature information\n // Variables for hourlyTemp functions\n // Get the next hour based on the current time\n let date = data.properties.periods[0].startTime; \n let nextHour = parseInt(date.substr(11, 2));\n let numberOfHours = 13;\n let hourlyTemps = [];\n\n for (let i = 0; i < numberOfHours; i++) {\n\n hourlyTemps[i] = data.properties.periods[i].temperature;\n \n }\n \n console.log(\"hourly temps are \"+ hourlyTemps);\n let contentHourlyTemps = document.getElementById('hourly-temps');\n console.log(\"date and next hour are \"+date+\" \"+nextHour);\n contentHourlyTemps.innerHTML = buildHourlyData(nextHour, hourlyTemps);\n\n // Store station ID and elevation (in meters - will need to be converted to feet) \n let windSpeedId = data.properties.periods[0].windSpeed.substr(0, 2);\n let windDirectionId = data.properties.periods[0].windDirection; \n \n console.log('Wind speed and wind direction are: ' + windSpeedId, windDirectionId); \n \n // Store weather information to localStorage \n storage.setItem(\"windSpeedId\", windSpeedId);\n storage.setItem(\"windDirectionId\", windDirectionId);\n \n\n\n }) \n .catch(error => console.log('There was a getStationId error: ', error)) \n}", "title": "" }, { "docid": "c77e4af6ec234e5b80326dd2851bcc9f", "score": "0.5163953", "text": "async hourly(column) { await this.forecast(column, true) }", "title": "" }, { "docid": "19055741a91cfea5111cd17c3cf4359b", "score": "0.5158001", "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": "fc01710aebb0b5881e336c080bf13721", "score": "0.50890344", "text": "function setWeatherData(data, place){\n //get time and date info\n const now = new Date();\n var currentHour = now.getHours();\n var currentDay = now.getDay();\n hours = getForecastHours(currentHour);\n days = getForecastDays(currentDay);\n\n //-------Current Conditions//-------\n icon.set('currentConditionsIcon', data.currently.icon)\n currentConditionsTempVal.textContent = data.currently.temperature.toFixed(0)\n currentConditionsWindVal.textContent = data.currently.windSpeed.toFixed(0)\n currentConditionsRainVal.textContent = data.currently.precipProbability.toFixed(0)\n\n //-------Hourly Forecast//-------\n //Times\n hour1.textContent = hours[0];\n hour2.textContent = hours[1];\n hour3.textContent = hours[2];\n hour4.textContent = hours[3];\n hour5.textContent = hours[4];\n hour6.textContent = hours[5];\n hour7.textContent = hours[6];\n //Temps\n hour1VAL.textContent = data.hourly.data[0].apparentTemperature.toFixed(0)\n hour2VAL.textContent = data.hourly.data[1].apparentTemperature.toFixed(0)\n hour3VAL.textContent = data.hourly.data[2].apparentTemperature.toFixed(0)\n hour4VAL.textContent = data.hourly.data[3].apparentTemperature.toFixed(0)\n hour5VAL.textContent = data.hourly.data[4].apparentTemperature.toFixed(0)\n hour6VAL.textContent = data.hourly.data[5].apparentTemperature.toFixed(0)\n hour7VAL.textContent = data.hourly.data[6].apparentTemperature.toFixed(0)\n //Rain\n hour1RainVal.textContent = data.hourly.data[0].precipProbability.toFixed(0)\n hour2RainVal.textContent = data.hourly.data[1].precipProbability.toFixed(0)\n hour3RainVal.textContent = data.hourly.data[2].precipProbability.toFixed(0)\n hour4RainVal.textContent = data.hourly.data[3].precipProbability.toFixed(0)\n hour5RainVal.textContent = data.hourly.data[4].precipProbability.toFixed(0)\n hour6RainVal.textContent = data.hourly.data[5].precipProbability.toFixed(0)\n hour7RainVal.textContent = data.hourly.data[6].precipProbability.toFixed(0)\n //Icons\n icon.set('hour1Icon', data.hourly.data[0].icon)\n icon.set('hour2Icon', data.hourly.data[1].icon)\n icon.set('hour3Icon', data.hourly.data[2].icon)\n icon.set('hour4Icon', data.hourly.data[3].icon)\n icon.set('hour5Icon', data.hourly.data[4].icon)\n icon.set('hour6Icon', data.hourly.data[5].icon)\n icon.set('hour7Icon', data.hourly.data[6].icon)\n\n //-------Weekly Forecast//-------\n console.log(days)\n //Days\n document.querySelector('[dayName1]').textContent = days[0];\n document.querySelector('[dayName2]').textContent = days[1];\n document.querySelector('[dayName3]').textContent = days[2];\n document.querySelector('[dayName4]').textContent = days[3];\n document.querySelector('[dayName5]').textContent = days[4];\n document.querySelector('[dayName6]').textContent = days[5];\n document.querySelector('[dayName7]').textContent = days[6];\n\n //Highs\n day1High.textContent = data.daily.data[1].temperatureHigh.toFixed(0);\n day2High.textContent = data.daily.data[2].temperatureHigh.toFixed(0);\n day3High.textContent = data.daily.data[3].temperatureHigh.toFixed(0);\n day4High.textContent = data.daily.data[4].temperatureHigh.toFixed(0);\n day5High.textContent = data.daily.data[5].temperatureHigh.toFixed(0);\n day6High.textContent = data.daily.data[6].temperatureHigh.toFixed(0);\n day7High.textContent = data.daily.data[7].temperatureHigh.toFixed(0);\n //Lows\n day1Low.textContent = data.daily.data[1].temperatureLow.toFixed(0);\n day2Low.textContent = data.daily.data[2].temperatureLow.toFixed(0);\n day3Low.textContent = data.daily.data[3].temperatureLow.toFixed(0);\n day4Low.textContent = data.daily.data[4].temperatureLow.toFixed(0);\n day5Low.textContent = data.daily.data[5].temperatureLow.toFixed(0);\n day6Low.textContent = data.daily.data[6].temperatureLow.toFixed(0);\n day7Low.textContent = data.daily.data[7].temperatureLow.toFixed(0);\n //Rain\n day1RainVal.textContent = data.daily.data[1].precipProbability.toFixed(0);\n day2RainVal.textContent = data.daily.data[2].precipProbability.toFixed(0);\n day3RainVal.textContent = data.daily.data[3].precipProbability.toFixed(0);\n day4RainVal.textContent = data.daily.data[4].precipProbability.toFixed(0);\n day5RainVal.textContent = data.daily.data[5].precipProbability.toFixed(0);\n day6RainVal.textContent = data.daily.data[6].precipProbability.toFixed(0);\n day7RainVal.textContent = data.daily.data[7].precipProbability.toFixed(0);\n //Icons\n icon.set('day1Icon', data.daily.data[1].icon)\n icon.set('day2Icon', data.daily.data[2].icon)\n icon.set('day3Icon', data.daily.data[3].icon)\n icon.set('day4Icon', data.daily.data[4].icon)\n icon.set('day5Icon', data.daily.data[5].icon)\n icon.set('day6Icon', data.daily.data[6].icon)\n icon.set('day7Icon', data.daily.data[7].icon)\n\n icon.play();\n // setTimeout(showHourlyWeather, 2500);\n // setTimeout(showWeeklyWeather, 5000);\n // setTimeout(showCurrentWeather, 7500);\n}", "title": "" }, { "docid": "92311df68bffdc9786760b878cf3450a", "score": "0.501021", "text": "function populate_data(){\r\n // =====================================================\r\n // Erase any data of the heatmap, marker or cluster map\r\n // =====================================================\r\n while(heatmap_data.length > 0){ // Loop to erase data from the heatmap vector\r\n heatmap_data.pop();\r\n }\r\n pointArray = new google.maps.MVCArray(heatmap_data);\r\n heatmap.setData(pointArray);\r\n for(var j = 0; j < markers.length; j++){ // Loop to erase markers vector\r\n markers[j].setMap(null);\r\n }\r\n markerCluster.clearMarkers();\r\n markers = [];\r\n infowindows = [];\r\n // =====================================================\r\n\r\n\r\n // =====================================================\r\n // Create markers with the current data for the markers map\r\n // =====================================================\r\n if(map_type == 0){\r\n for(var i = 0; i < data_static.length; i++){\r\n var latLng = new google.maps.LatLng(data_static[i].lat, data_static[i].lon);\r\n markers[i] = new google.maps.Marker({\r\n position: latLng,\r\n map: map,\r\n icon: marker_color,\r\n title: \"Name: \" + data_static[i].name + \"\\nLat: \" + data_static[i].lat + \"\\nLon: \" + data_static[i].lon + \"\\nDate: \" + data_static[i].date +\r\n \"\\nTime: \" + data_static[i].time + \"\\n\" + \"Load: \" + data_static[i].num,\r\n index: i\r\n });\r\n\r\n infowindows[i] = new google.maps.InfoWindow({\r\n content: \"Name: \" + data_static[i].name + \"<br/>Lat: \" + data_static[i].lat + \"<br/>Lon: \" + data_static[i].lon + \"<br/>Date: \" + data_static[i].date +\r\n \"<br/>Time: \" + data_static[i].time + \"<br/>\" + \"Load: \" + data_static[i].num\r\n });\r\n\r\n\r\n google.maps.event.addListener(markers[i],'click', function(){\r\n infowindows[this.index].open(map, markers[this.index]);\r\n });\r\n\r\n }\r\n }\r\n\r\n // =====================================================\r\n // Create markers with the current data for the cluster map\r\n // =====================================================\r\n else if(map_type == 1) {\r\n for (var i = 0; i < data_static.length; i++) {\r\n var latLng = new google.maps.LatLng(data_static[i].lat, data_static[i].lon);\r\n for( var j = 0; j < data_static[i].num; j++ ){\r\n var marker = new google.maps.Marker({\r\n position: latLng,\r\n map: map,\r\n icon: marker_color,\r\n title: \"Name: \" + data_static[i].name + \" \\nLat: \" + data_static[i].lat + \" \\nLon: \" + data_static[i].lon + \" \\nDate: \" + data_static[i].date +\r\n \" \\nTime: \" + data_static[i].time + \" \\nLoad: \" + data_static[i].num\r\n });\r\n\r\n marker.info = new google.maps.InfoWindow({\r\n content: \"Name: \" + data_static[i].name + \"<br/>Lat: \" + data_static[i].lat + \"<br/>Lon: \" + data_static[i].lon + \"<br/>Date: \" + data_static[i].date +\r\n \"<br/>Time: \" + data_static[i].time + \"<br/>\" + \"Load: \" + data_static[i].num\r\n });\r\n\r\n google.maps.event.addListener(marker, 'click', function(){\r\n marker.info.open(map, this);\r\n });\r\n\r\n markerCluster.addMarker(marker);\r\n }\r\n\r\n }\r\n google.maps.event.removeListener(clustListener);\r\n clustListener = google.maps.event.addListener( markerCluster, 'clusterclick', function(cluster){\r\n var markersOnCluster = cluster.getMarkers();\r\n var content = \"\";\r\n var str_title = [];\r\n var name_marker = \"\";\r\n content+=(\"Markers / Loads\");\r\n content+=(\"<br>\");\r\n for (var i=0; i < markersOnCluster.length; i++){\r\n var mark_pos = markersOnCluster[i];\r\n str_title = mark_pos.title.toString().split(\" \");\r\n if(name_marker != str_title[1] ){\r\n name_marker = str_title[1];\r\n content+=(name_marker + \" = \" + str_title[11]);\r\n content+=(\"<br>\");\r\n }\r\n }\r\n var infowindow = new google.maps.InfoWindow();\r\n infowindow.setPosition(cluster.getCenter());\r\n infowindow.close();\r\n infowindow.setContent(content);\r\n infowindow.open(map);\r\n\r\n google.maps.event.addListener(map, 'zoom_changed', function() {\r\n infowindow.close();\r\n });\r\n\r\n })\r\n\r\n }\r\n\r\n // =====================================================\r\n // Create the heatmap with the current data\r\n // =====================================================\r\n else if(map_type == 2) {\r\n for (var i = 0; i < data_static.length; i++) {\r\n for(var j = 0; j < data_static[i].num; j++ ) heatmap_data.push( new google.maps.LatLng(data_static[i].lat,data_static[i].lon) );\r\n }\r\n pointArray = new google.maps.MVCArray(heatmap_data);\r\n heatmap.setData(pointArray);\r\n }\r\n }", "title": "" }, { "docid": "4c4017bb5eb49b25ddb8a2ea86e31f8e", "score": "0.4972515", "text": "function hourlyGraph(weather) {\n if (isObjectEmpty(weather)) {\n console.log('no data yet for hourlyGraph!');\n return;\n } else {\n var tempValues = [];\n console.log(weather);\n\n\n for (var i = 0; i < weather.hourly.data.length; i += 1) {\n var fixed = weather.hourly.data[i].temperature.toFixed();\n tempValues.push({ x: i, y: fixed });\n }\n\n console.log(tempValues);\n return [{\n key: 'Temp',\n values: tempValues\n }];\n }\n\n\n }", "title": "" }, { "docid": "f7cf2c859ea6a37f9711a060e2e420ca", "score": "0.4971206", "text": "function getHourly(URL) {\n fetch(URL)\n .then(function (response) {\n if (response.ok) {\n return response.json();\n }\n throw new ERROR('Response not OK.');\n })\n .then(function (data) {\n // log result of fetch to console\n console.log('Data from getHourly function:');\n console.log(data); \n \n // Store 12 hours of data to session storage \n var hourData = [];\n let todayDate = new Date();\n var nowHour = todayDate.getHours();\n console.log(`nowHour is ${nowHour}`);\n for (let i = 0, x = 11; i <= x; i++) {\n // if time from nowHour < 24, store in the array at [i], otherwise, subtract 12 (hours) and then add to the array\n if (nowHour < 24) {\n hourData[nowHour] = data.properties.periods[i].temperature + \",\" + data.properties.periods[i].windSpeed + \",\" + data.properties.periods[i].icon;\n sesStor.setItem(`hour${nowHour}`, hourData[nowHour]);\n nowHour++;\n } else {\n nowHour = nowHour - 12;\n hourData[nowHour] = data.properties.periods[i].temperature + \",\" + data.properties.periods[i].windSpeed + \",\" + data.properties.periods[i].icon;\n sesStor.setItem(`hour${nowHour}`, hourData[nowHour]);\n nowHour = 1;\n }\n }\n \n // Get the shortForecast value from the first hour (the current hour)\n // This will be the condition keyword for setting the background image\n sesStor.setItem('shortForecast', data.properties.periods[0].shortForecast);\n \n // Call the buildPage function\n buildPage();\n })\n .catch(error => console.log('There was a getHourly error: ', error))\n}", "title": "" }, { "docid": "5f2ed301e8fbd91b4b7c95b868bd0bcd", "score": "0.49671152", "text": "function getHourlyForecast(){\n $.getJSON(\"http://api.openweathermap.org/data/2.5/forecast?id=\"+cityId+\"&APPID=\"+OWMAppId+\"&units=metric&lang=\"+language,function(data){\n console.log(data);\n $('#hourly-forecast').empty();\n for (i = 1; i <= 5; i++) {\n var hour = moment(data.list[i].dt_txt).format('HH');\n var hourTemp = Math.round(data.list[i].main.temp);\n var iconClassName = getIcon(data.list[i].weather[0].id);\n $('#hourly-forecast').append('<tr><td class=\"next-3h\">'+hour+'h</td>'+\n '<td><span class=\"next-3h-temp\">'+hourTemp+'</span>ºC</td>'+\n '<td class=\"forecast-icon '+iconClassName+'\"></td>'+\n '</tr>');\n }\n });\n setTimeout(getHourlyForecast, 60000 * 5);\n}", "title": "" }, { "docid": "30c0d64d3f942a4f8b190120b46a003d", "score": "0.4946218", "text": "function initGraph() {\n\n google.charts.load('current', {\n 'packages': ['corechart']\n });\n google.charts.setOnLoadCallback(drawChart);\n\n function drawChart() {\n // Create and populate the data table taking time (hours) and temperature from the globData object.\n var hourlyDataPoints = globData.hourly.data.length;\n console.log(\"Hourly array length = \" + hourlyDataPoints);\n\n var graphDataHour = [hourlyDataPoints];\n var graphDataTemp = [hourlyDataPoints];\n\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Hour');\n data.addColumn('number', 'Temperature');\n\n var i = 0;\n for (i = 0; i < hourlyDataPoints; i++) {\n var time = new Date(globData.hourly.data[i].time * 1000);\n graphDataHour[i] = formatAMPM(time);\n graphDataTemp[i] = globData.hourly.data[i].temperature;\n data.addRow([graphDataHour[i], graphDataTemp[i]]);\n console.log(\"Time: \" + graphDataHour[i] + \" Temp: \" + graphDataTemp[i]);\n }\n\n var options = {\n title: 'Temperature for next 48 hours:',\n curveType: 'function',\n legend: {\n position: 'bottom'\n },\n height: 300,\n width: 600\n };\n\n // Create and draw the visualization.\n var chart = new google.visualization.LineChart(mapInfoWindowContent);\n chart.draw(data, options);\n infowindow.setContent(mapInfoWindowContent);\n\n };\n\n} // END FUNCTION", "title": "" }, { "docid": "38263cf00f6499bdeb3491265c547c44", "score": "0.49340367", "text": "function forEachLocation() {\n createHeaderForHours();\n for (var i = 0; i < allLocations.length; i++){\n console.log(allLocations[i]);\n allLocations[i].randomCookieSalesPerHour();\n allLocations[i].forEachHour();\n };\n}", "title": "" }, { "docid": "a5e9ddec66f24d33c3ad9ab3d224b09c", "score": "0.49303073", "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": "4490fe80f95273aed6a079f181f9b954", "score": "0.49221414", "text": "function fillData(){\n var y = setData[selected_user]; \n //print instances of time data \n var timekeys = Object.keys(y);\n\n var x;\n userData= [];\n for (var i = 0; i < timekeys.length; i++) { \n x = y[timekeys[i]];\n //console.log(x);\n userData.push({\n \"Timekey\":timekeys[i],\n \"HR\":x.HR,\n \"BR\":x.BR,\n \"HRV\":x.HRV\n });\n }\n}", "title": "" }, { "docid": "9c18f091808458ab64f80b0021076de1", "score": "0.48831525", "text": "function kakekomiMap(data, hour, minute) {\n var time = parseInt(hour, 10) * 60 + parseInt(minute, 10);\n\n d3.csv(data, function(error, data){\n\n // Renew google map\n map = new google.maps.Map(document.getElementById('map'), {\n center: { lat: map.getCenter().lat(), lng: map.getCenter().lng() },\n zoom: map.getZoom()\n });\n\n // Initialize heatmap data\n var pos, heatmapData = [];\n for (var i = 0; i < data.length; i++) {\n if (time2minute(data[i].open) <= time && time <= time2minute(data[i].close)) {\n heatmapData.push({\n location : new google.maps.LatLng(data[i].lat, data[i].lng),\n weight : 10\n });\n }\n }\n\n // Initialize heatmap layer\n var heatmap = new google.maps.visualization.HeatmapLayer({\n radius: 100,\n opacity: 0.75\n });\n\n // Set the heatmap data to the heatmap layer\n heatmap.setData(heatmapData);\n\n // Overlay the heatmap\n heatmap.setMap(map);\n\n });\n}", "title": "" }, { "docid": "f1d1f51e1049c7c74ce591d781956078", "score": "0.48718083", "text": "function renderStoredData(block, eventHour) {\n var event = JSON.parse(localStorage.getItem(timeBlock[eventHour]))\n \n if (!event) {\n return\n }\n block.attr(\"placeholder\", event)\n }", "title": "" }, { "docid": "1333487fb321b3e4897e525bd3b6a025", "score": "0.4843705", "text": "function updateData() {\n Object.keys(weatherApp.selectedLocations).forEach((key) => {\n const location = weatherApp.selectedLocations[key];\n const card = getForecastCard(location);\n // CODELAB: Add code to call getForecastFromCache\n getForecastFromCache(location.geo)\n .then((forecast) => {\n renderForecast(card, forecast);\n });\n // Get the forecast data from the network.\n getForecastFromNetwork(location.geo)\n .then((forecast) => {\n renderForecast(card, forecast);\n });\n });\n}", "title": "" }, { "docid": "3a4de4eb158da86b45e008c3892f1d25", "score": "0.4816545", "text": "function previousSixHoursFilter(){\n //find ms from epoch for six hours from right now \n var d = new Date();\n d.setHours(d.getHours()-6);\n var sixHoursBefore = d.getTime();\n console.log(d.getTime());\n\n for (var i =0;i<userData.length;i++)\n { var dataDateTime= parseInt(userData[i].Timekey);\n //check if HR selected\n if (dataDateTime>=sixHoursBefore){\n filteredData.push({\n \"Date\": getDateText(userData[i].Timekey),\n \"Time\": getTimeText(userData[i].Timekey),\n \"HR\":userData[i].HR,\n \"BR\":userData[i].BR,\n \"HRV\":userData[i].HRV\n });\n }\n } \n}", "title": "" }, { "docid": "42808ab035effbfea3f42aada8dc68ad", "score": "0.48117188", "text": "function getHourly(hourlyURL) { \n fetch(hourlyURL, idHeader) \n .then(function(response){\n if(response.ok){ \n return response.json(); \n } \n throw new ERROR('Response not OK.');\n })\n //assigns API info to variable data\n .then(function (data) { \n console.log('From getHourly function:');\n console.log(data);\n //store hourly data\n let date = data.properties.periods[0].startTime;\n let nextHour = parseInt(date.substr(11, 2));\n let i;\n let hourlyTempData = [];\n for (i = 0; i < 13; i++){\n hourlyTempData[i] = data.properties.periods[i].temperature\n }\n storage.setItem(\"hourlyTempData\", hourlyTempData)\n \n })\n .catch(error => console.log('There was a getHourly error: ', error))\n } //end getHourly", "title": "" }, { "docid": "417a60ecb1ccf2e9f291adfb4c4b03a3", "score": "0.48064235", "text": "function buildSFData() {\r\n // console.log(sfStateData , sfCountyData, sfCityData);\r\n // console.log(outageReports);\r\n \r\n sfLocationData.forEach(location => {\r\n // adds state power outage data to SF location\r\n location.powerOutageData.state = sfStateData.find(stateData => {\r\n return stateData.StateName === location.state;\r\n });\r\n \r\n // adds county power outage data to SF loaction\r\n location.powerOutageData.county = sfCountyData[location.state].find(countyData => {\r\n return countyData.CountyName === location.county;\r\n });\r\n \r\n // adds city power outage data to SF loaction\r\n location.powerOutageData.city = sfCityData[location.county].find(cityData => {\r\n return cityData.CityName === location.apiCity;\r\n });\r\n\r\n location.reports = outageReports.filter(report => {\r\n return report.location.S === location.locationName;\r\n });\r\n \r\n let lastUpdated = location.powerOutageData.city.LastUpdatedDateTime;\r\n let GMTtime = +lastUpdated.substring(lastUpdated.lastIndexOf(\"(\") + 1, lastUpdated.lastIndexOf(\")\"));\r\n location.lastUpdated = new Date(GMTtime).toLocaleTimeString();\r\n \r\n // set size to tracked city count (used for D3 bubble sizing)\r\n location.size = location.powerOutageData.city.TrackedCount;\r\n \r\n determineRisk(location);\r\n });\r\n \r\n function determineRisk(location) {\r\n let cityOutageCount = location.powerOutageData.city.OutageCount;\r\n let cityTrackedCount = location.powerOutageData.city.TrackedCount;\r\n let percentWithoutPower = cityOutageCount / cityTrackedCount * 100;\r\n // minimum percentage of people without power in city to be considered a medium risk\r\n const CITY_OUTAGE_COUNT_THRESHOLD = 0.1;\r\n \r\n if (location.reports.length === 0 && percentWithoutPower <= CITY_OUTAGE_COUNT_THRESHOLD) {\r\n location.risk = 'None';\r\n location.status = 'Good';\r\n } else if (location.reports.length > 0 && percentWithoutPower <= CITY_OUTAGE_COUNT_THRESHOLD) {\r\n location.risk = 'Low';\r\n location.status = 'Reported Down';\r\n } else if (location.reports.length === 0 && percentWithoutPower > CITY_OUTAGE_COUNT_THRESHOLD) {\r\n location.risk = 'Medium';\r\n location.status = 'Potentially Down';\r\n } else if (location.reports.length > 0 && percentWithoutPower > CITY_OUTAGE_COUNT_THRESHOLD) {\r\n location.risk = 'High';\r\n location.status = 'Likely Down';\r\n } else if (location.reports.length > 2 && percentWithoutPower > 75) {\r\n location.risk = 'Very High';\r\n location.status = 'Confirmed Down';\r\n }\r\n }\r\n\r\n // creates a power outage for Marina Heights\r\n function forceOutage() {\r\n sfLocationData[0].powerOutageData.city.OutageCount = 9500;\r\n determineRisk(sfLocationData[0]);\r\n }\r\n // forceOutage();\r\n\r\n\r\n // console.log(\"SF Location Data\", sfLocationData);\r\n resolve(sfLocationData);\r\n }", "title": "" }, { "docid": "56f25619f393e7bdde69c49cccc65a2f", "score": "0.48021013", "text": "addPricesFiat(historyTimePeriod, priceHistories, fiat) {\n for (const stack of this.stacks) {\n let priceHistory = priceHistories.findHistory({base: stack.coin, quote: fiat});\n if (priceHistory !== false) {\n if (priceHistory.moments !== false) {\n let historyName = Stack.historyNames(historyTimePeriod);\n stack[historyName].addNewDataRanges(priceHistory.moments, ['price']);\n } else {\n //console.log(stack.coin + \" - no Fiat prices - false\")\n }\n } else {\n //console.log(\"no price history\")\n }\n }\n }", "title": "" }, { "docid": "7e5587793f7b80c83008eb0f0c559994", "score": "0.47966987", "text": "function addEvent(hour) {\n var description = document.getElementById(`data-hour-${hour}`).value;\n\n var event = description;\n\n savedEvents.push(event);\n\n localStorage.setItem('savedEvents', savedEvents);\n}", "title": "" }, { "docid": "8af19645143d1c17b48fccef4b1e42e3", "score": "0.47749972", "text": "_handleHourlySearch( hourlyHeight, callback) {\n\n\t\tif ( hourlyHeight === 0) {\n\t\t\tthis._showSpinner();\n\t\t\tthis._handleHourlySearchAsync().then( ( result) => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowSpinner : result.showSpinner,\n\t\t\t\t\t\t hourly : result.hourly\n\t\t\t\t});\n\t\t\t\tif ( callback) callback();\n\t\t\t},( error) => {\n\t\t\t\tthis._initState();\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tshowSpinner : false,\n\t\t\t\t\t hourly : []\n\t\t\t});\n\t\t\tif ( callback) callback();\n\t\t}\n\t}", "title": "" }, { "docid": "08de8541c80b420f2bedb750ed4fff44", "score": "0.47526", "text": "function printHourlyData(hourIndex, hourElement) {\n\n // Fetch the data from API JSON\n let time = new Date(data.hourly[hourIndex].dt * 1000).toISOString().substr(11, 5);\n let iconCode = data.hourly[hourIndex].weather[0].icon;\n let description = data.hourly[hourIndex].weather[0].description;\n let temperature = parseInt(data.hourly[hourIndex].temp);\n let realFeel = parseInt(data.hourly[hourIndex].feels_like);\n let clouds = data.hourly[hourIndex].clouds;\n let humidity = data.hourly[hourIndex].humidity;\n let uvi = data.hourly[hourIndex].uvi;\n let visibility = data.hourly[hourIndex].visibility;\n let windDirection = data.hourly[hourIndex].wind_deg;\n let windSpeed = data.hourly[hourIndex].wind_speed;\n\n // Fetch the weather icon from API JSON\n let iconPng = `https://openweathermap.org/img/wn/${iconCode}@2x.png`;\n let iconHTML = `<img src=\"${iconPng}\" alt=\"weather status icon\">`;\n\n // Target the elements which will receive the data\n let hourTime = hourElement.find('.hourlyTime');\n let hourIcon = hourElement.find('.hourIcon');\n let hourDescription = hourElement.find('.hourDesc').children();\n let hourTemp = hourElement.find('.tempValHour');\n let hourRealfeel = hourElement.find('.feLikeValHour');\n let hourClouds = hourElement.find('.cloudValHour');\n let hourHumidity = hourElement.find('.humidityHourVal');\n let hourUVI = hourElement.find('.uviHourVal');\n let hourVisibility = hourElement.find('.visibilityHourVal');\n let hourWindDir = hourElement.find('.windDirHourVal');\n let hourWindSp = hourElement.find('.windSpeedHourVal');\n\n // Apply the data to the elements\n hourTime.text(time);\n hourIcon.html(iconHTML);\n hourDescription.text(description);\n hourTemp.text(temperature);\n hourRealfeel.text(realFeel);\n hourClouds.text(clouds);\n hourHumidity.text(humidity);\n hourUVI.text(uvi);\n hourVisibility.text(visibility);\n hourWindDir.text(windDirection);\n hourWindSp.text(windSpeed);\n\n // Set the date in dd/mm format\n currentDate();\n\n // Define the UVI status and the wind direction\n uviStatus(hourUVI);\n windDirectionStatus(hourElement);\n }", "title": "" }, { "docid": "6fd728d1f12cd541faf090a3649fcdd4", "score": "0.4736278", "text": "function getData(lat, long) {\n $.ajax({\n url: \"https://api.wunderground.com/api/77e496e9205dcce0/forecast/hourly/geolookup/conditions/q/\" + lat + \",\" + long + \".json\",\n dataType: \"jsonp\",\n success: function (data) {\n var cityName = data[\"location\"][\"city\"];\n var cityState = data[\"location\"][\"state\"];\n var temp_f = data['current_observation']['temp_f'];\n var temp_high = data.forecast.simpleforecast.forecastday[0].high.fahrenheit;\n var temp_low = data.forecast.simpleforecast.forecastday[0].low.fahrenheit;\n var windMph = data['current_observation']['wind_mph'];\n var windDir = data['current_observation']['wind_dir'];\n var percip = data.forecast.simpleforecast.forecastday[1].pop;\n var summary_w = data['current_observation']['weather'];\n var image = data.current_observation.icon_url;\n\n for (var i = 0; i < 4 ; i++) {\n var hour = data.hourly_forecast[i].FCTTIME.civil;\n };\n for (var i = 0; i < 4; i++) {\n var tempHour = data.hourly_forecast[i].temp.english\n }\n\n console.log(\" city: \" + cityName + \", temp: \" + temp_f + \", temp high: \" + temp_high + \", temp low: \" + temp_low + \", windmph: \" + windMph + \", wind direction: \" + windDir + \", percipitation: \" + percip + \", summary: \" + summary_w);\n\n console.log(data);\n\n var orgTitle = document.getElementById(\"title\").innerHTML;\n var newTitle = document.getElementById(\"title\");\n var city = document.getElementById(\"where\");\n var temp = document.getElementById(\"currentTemp\");\n var highlow = document.getElementById(\"temp\");\n var areaMph = document.getElementById(\"wind\");\n var percipers = document.getElementById(\"precipitation\");\n var weatherSum = document.getElementById(\"summary\");\n var fhour = document.getElementById('future');\n\n newTitle.innerHTML = cityName + \", \" + cityState + \" | \" + orgTitle;\n city.innerHTML = cityName + \", \" + cityState;\n temp.innerHTML = Math.round(temp_f) + (\"&#176\") + \"F\";\n highlow.innerHTML = temp_high + (\"&#176\") + \"F\" + \" / \" + temp_low + (\"&#176\") + \"F\";\n areaMph.innerHTML = \"<b> Wind: </b>\" + windDir + \" \" + windMph + \" mph\";\n percipers.innerHTML = \"<b> Precipitation: </b>\" + percip + \"%\";\n weatherSum.innerHTML = \"<p id='condition'> <b> <span id = 'image'> <img src = \" + image + \"></span>\" + summary_w + \"</b></p>\";\n fhour.innerHTML = hour + \" \" + tempHour + (\"&#176\") + \"F\";\n\n $(\"#cover\").fadeOut(250);\n\n }\n });\n\n }", "title": "" }, { "docid": "be3298c28fbfcdafd172a59650b18c6d", "score": "0.4732709", "text": "function getHourly(URL) {\n fetch(URL)\n .then(function (response) {\n if (response.ok) {\n return response.json();\n }\n throw new ERROR('Response not OK.');\n })\n .then(function (data) {\n console.log('Data from getHourly function:');\n console.log(data); // Let's see what we got back\n\n // Store 12 hours of data to session storage \n var hourData = [];\n let todayDate = new Date();\n var nowHour = todayDate.getHours();\n console.log(`nowHour is ${nowHour}`);\n for (let i = 0, x = 11; i <= x; i++) {\n if (nowHour < 24) {\n hourData[nowHour] = data.properties.periods[i].temperature + \",\" + data.properties.periods[i].windSpeed + \",\" + data.properties.periods[i].icon;\n sessStore.setItem(`hour${nowHour}`, hourData[nowHour]);\n nowHour++;\n } else {\n nowHour = nowHour - 12;\n hourData[nowHour] = data.properties.periods[i].temperature + \",\" + data.properties.periods[i].windSpeed + \",\" + data.properties.periods[i].icon;\n sessStore.setItem(`hour${nowHour}`, hourData[nowHour]);\n nowHour = 1;\n }\n }\n\n // Get the shortForecast value from the first hour (the current hour)\n // This will be the condition keyword for setting the background image\n sessStore.setItem('shortForecast', data.properties.periods[0].shortForecast);\n \n // Call the buildPage function\n buildPage();\n })\n .catch(error => console.log('There was a getHourly error: ', error));\n}", "title": "" }, { "docid": "7df29ceea494f9d0e74e760980778acd", "score": "0.4731218", "text": "function generateChartData() {\n\t\t\t$.each($('.weather__info-table-js tbody tr .weather__grades-max'), function (index, value) {\n\t\t\t\tchartData.push({\n\t\t\t\t\tgrades: parseFloat($(value).attr('data-temp-grades')),\n\t\t\t\t\thours: $(value).attr('data-hour')\n\t\t\t\t});\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "c18f857458f6c8d9859dd77f1ffc95e4", "score": "0.47300783", "text": "async function showData(place = DEFAULT_PLACE, name = DEFAULT_PLACE) {\n const data = await getData(place);\n const headerCity = document.querySelector('.city');\n headerCity.textContent = name.toUpperCase();\n\n //initial date\n let initialTime = new Date(data['forecastTimestamps'][0]['forecastTimeUtc']);\n let year = initialTime.getFullYear();\n let month = initialTime.getMonth();\n let day = initialTime.getDate();\n let firstHour = initialTime.getHours();\n let absoluteTemperatures = {};\n absoluteTemperatures.max = await getMaxTemp(data['forecastTimestamps']);\n absoluteTemperatures.min = await getMinTemp(data['forecastTimestamps']);\n\n let minMaxTempByDate = {};\n let dayData = null;\n let dayTime = null;\n let firstDay = true;\n for (let hour of data['forecastTimestamps']) {\n if (!dayTime) {\n let hourTime = new Date(hour['forecastTimeUtc']);\n dayTime = hourTime.getDate();\n dayData = await filterDataByDate(data, dayTime);\n\n minMaxTempByDate.date = dayTime;\n minMaxTempByDate.minTemperature = await getMinTemp(dayData);\n minMaxTempByDate.maxTemperature = await getMaxTemp(dayData);\n let conditionCode = hour['conditionCode'];\n\n await createHtmlWeekdays(minMaxTempByDate, conditionCode, hourTime, firstDay);\n firstDay = false;\n }\n if (new Date(hour['forecastTimeUtc']).getHours() === firstHour) {\n await createHtmlHourly(hour, absoluteTemperatures, true);\n firstHour = null;\n } else {\n await createHtmlHourly(hour, absoluteTemperatures);\n }\n\n //check if next day\n dayTime = new Date(hour['forecastTimeUtc']).getDate();\n if (year + month + dayTime > year + month + day) {\n day = dayTime;\n dayTime = null;\n dayData = null;\n }\n }\n addWeekdayEventListeners();\n }", "title": "" }, { "docid": "424cbaf6dc1a1ab00759c6c72fb42c7f", "score": "0.47162297", "text": "function sumSalesHourly(){\r\n hourlyTotals = [];\r\n for(let j = 0; j < openHours.length; j++){\r\n let sum = 0;\r\n for(let i = 0; i < everyLocation.length; i++){\r\n sum += everyLocation[i].cookieArray[j];\r\n }\r\n hourlyTotals.push(sum);\r\n }\r\n let sumTotal = 0;\r\n for(let i = 0; i < hourlyTotals.length; i++){\r\n sumTotal += hourlyTotals[i];\r\n }\r\n hourlyTotals.push(sumTotal);\r\n}", "title": "" }, { "docid": "fc924bf6984f15c3171f622a84089e25", "score": "0.47138923", "text": "function tempHourly(){\n for(i=1; i<=5; i++){\n if(far.checked == true){\n tempDailyMin[i-1].textContent = Math.floor(datas.daily.data[i].temperatureLow) + \"°F\"\n tempDailyMax[i-1].textContent = Math.floor(datas.daily.data[i].temperatureHigh) + \"°F\"\n temperature.textContent = Math.floor(datas.currently.temperature) + \"°F\"\n } else if(cel.checked == true){\n tempDailyMin[i-1].textContent = Math.floor((datas.daily.data[i].temperatureLow - 32)/1.8) + \"°C\"\n tempDailyMax[i-1].textContent = Math.floor((datas.daily.data[i].temperatureHigh - 32)/1.8) + \"°C\"\n temperature.textContent = Math.floor((datas.currently.temperature - 32)/1.8) + \"°C\"\n }\n }\n // temp12 and hours12 push\n hours12= [];\n for(i=1; i<=12; i++){\n let date = new Date(datas.hourly.data[i].time*1000);\n let hours = date.getHours();\n let minutes = \"0\" + date.getMinutes();\n let formattedTime = hours + ':' + minutes.substr(-2);\n hours12.push(formattedTime);\n }\n temp12 = [];\n for(i=1; i<=12; i++){\n if(far.checked == true){\n temp12.push(Math.floor(datas.hourly.data[i].temperature))\n } else if(cel.checked == true){\n temp12.push(Math.floor((datas.hourly.data[i].temperature - 32)/1.8))\n }\n }\n // new Data in chart.js\n WeatherChart.data.datasets[0].data = temp12;\n WeatherChart.data.labels = hours12;\n WeatherChart.update();\n \n }", "title": "" }, { "docid": "256b0f8ef8a0091bd5c07da9147f0b00", "score": "0.4685254", "text": "function render(byHour){\n\n var row = document.createElement('tr');\n var header = document.createElement('td');\n header.textContent = byHour.header;\n row.appendChild(header);\n\n for (var i = 0; i < byHour.cookiesByHour.length; i++) {\n \n var data = document.createElement('th');\n data.textContent = byHour.hours[i];\n row.appendChild(data);\n }\n tableHeader.appendChild(row);\n }///////end of render hour//////", "title": "" }, { "docid": "b748304c089d583ea56cacae9e0d0c83", "score": "0.4675427", "text": "function getWeather(locData) {\n const API_KEY = 'WZvTdK3lWnFfx2XJNtJCbcPzebd1h19y';\n const CITY_CODE = locData['key']; // We're getting data out of the object\n const URL = \"https://dataservice.accuweather.com/currentconditions/v1/\" + CITY_CODE + \"?apikey=\" + API_KEY + \"&details=true\";\n fetch(URL)\n .then(response => response.json())\n .then(function (data) {\n console.log('Json object from getWeather function:');\n console.log(data); // Let's see what we got back\n // Start collecting data and storing it\n locData['currentTemp'] = data[0].Temperature.Imperial.Value;\n locData['summary'] = data[0].WeatherText;\n locData['windSpeed'] = data[0].Wind.Speed.Imperial.Value;\n locData['windUnit'] = data[0].Wind.Speed.Imperial.Unit;\n locData['windDirection'] = data[0].Wind.Direction.Localized;\n locData['windGust'] = data[0].WindGust.Speed.Imperial.Value;\n locData['pastLow'] = data[0].TemperatureSummary.Past12HourRange.Minimum.Imperial.Value;\n locData['pastHigh'] = data[0].TemperatureSummary.Past12HourRange.Maximum.Imperial.Value;\n getHourly(locData); // Send data to getHourly function\n })\n .catch(error => console.log('There was an error: ', error))\n} // end getWeather function", "title": "" }, { "docid": "ae4db7c64978872fbbd86b76f361f697", "score": "0.4642688", "text": "function getForecastHours(currentHour){\n hours = []\n numHours = [\"12 AM\", \"1 AM\", \"2 AM\", \"3 AM\", \"4 AM\", \"5 AM\", \"6 AM\", \"7 AM\", \"8 AM\", \"9 AM\", \"10 AM\", \"11 AM\",\n \"12 PM\", \"1 PM\", \"2 PM\", \"3 PM\", \"4 PM\", \"5 PM\", \"6 PM\", \"7 PM\", \"8 PM\", \"9 PM\", \"10 PM\", \"11 PM\", \n \"12 AM\", \"A AM\", \"2 AM\", \"3 AM\", \"4 AM\", \"5 AM\", \"6 AM\", \"7 AM\"]\n\n for(var i = 0; i < 8; i++){\n hours[i] = numHours[currentHour + i + 1]\n }\n return hours;\n}", "title": "" }, { "docid": "ba56078f42cc4ef8120c1ae7cdba6790", "score": "0.463734", "text": "function hourlyTotal() {\r\n for (var i = 0; i < OPERATION_HOURS_ARR.length; i++) {\r\n var totalCookiesPerHour = 0;\r\n var totalTossersPerHour = 0;\r\n dailyLocationCookiesTotal = 0;\r\n dailyLocationTossersTotal = 0;\r\n for (var k = 0; k < storesArr.length; k++) {\r\n totalCookiesPerHour += storesArr[k].cookiesSoldPerHourArr[i];\r\n totalTossersPerHour += storesArr[k].tossersPerHourArr[i];\r\n dailyLocationCookiesTotal += storesArr[k].totalPerLocation;\r\n dailyLocationTossersTotal += storesArr[k].maxTossers;\r\n }\r\n totalCookiesPerHourArr[i] = totalCookiesPerHour;\r\n totalTossersPerHourArr[i] = totalTossersPerHour;\r\n }\r\n}", "title": "" }, { "docid": "151535bc19ff973b96130bafd1cb9b37", "score": "0.46321306", "text": "function searchHourlyData () {\n const darkskyData = require('./data/darksky.json');\n let results = [];\n console.log(darkskyData.daily.data);\n for (let i = 0; i < darkskyData.daily.data.length; i++){\n const weather = {\n forecast: darkskyData.daily.data[0].summary,\n time: darkskyData.daily.data[0].time,\n }\n results.push(weather);\n }\n \n return results;\n\n \n}", "title": "" }, { "docid": "78ff77b0a8e7823ae0dd44a9f9c32338", "score": "0.4623156", "text": "addValuesFiat(historyTimePeriod, fiat) {\n for (const stack of this.stacks) {\n let historyName = Stack.historyNames(historyTimePeriod);\n //console.log(stack[historyName])\n stack[historyName].addValuesFiat(fiat);\n }\n }", "title": "" }, { "docid": "51e662f407ba24a87b6c6ffd90407b8e", "score": "0.4614693", "text": "function filterTrends(data) {\n\t\n\t// Save the data for global use\n\tGLOB.gHotTrendsCache = data;\n\tgHotTrends = data;\n\t\n\tvar HEAT = [];\n\t\n\t// Extract the largest search from each place\n\t// This could be improved by using the related search terms\n\t// to add the search volume for similar search terms in different areas\n\t// right now, for example, \"iphone 6s\" will fill the global trends as different items\n\tfor(x in gHotTrends) {\n\t\tvar biggest = null;\n\t\tfor (y in gHotTrends[x]) {\n\t\t\tif (biggest == null) {\n\t\t\t\tbiggest = gHotTrends[x][y];\n\t\t\t} else {\n\t\t\t\tif (biggest.trafficLowerBound < gHotTrends[x][y].trafficLowerBound) {\n\t\t\t\t\tbiggest = gHotTrends[x][y];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tHEAT.push(biggest);\n\t}\n\t\n\t// Sort the results \n\tHEAT.sort(function(a, b) {\n\t\tif (a.trafficLowerBound > b.trafficLowerBound) {\n\t\t\treturn -1;\n\t\t} else if (b.trafficLowerBound > a.trafficLowerBound) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t});\n\t\n\t// get the top 15 trends\n\tHEAT.splice(15);\n\t\n\t// Sort the country trends\n\tfor(y in GLOB.gHotTrendsCache) {\n\t\tGLOB.gHotTrendsCache[y].sort(function(a, b) {\n\t\t\tif (a.trafficLowerBound > b.trafficLowerBound) {\n\t\t\treturn -1;\n\t\t\t} else if (b.trafficLowerBound > a.trafficLowerBound) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t});\n\t}\n\t\n\t// cache it\n\tGLOB.HEAT = HEAT;\n\tconsole.log(\"Trends ready!\");\n}", "title": "" }, { "docid": "f289b135b05f076d1d3ed74ca98006ec", "score": "0.46116105", "text": "function getSensorByDateByHour(position, datetime, callback) {\n var sampleCollection = database.collection(databaseSensor + position);\n\n getDBQueriesByDateQuery(sampleCollection, datetime, function(results) {\n console.log('getSensorByDateByHour', position, datetime);\n var resultsByHour = Array.prototype.reduce.call(results, function(collection, item) {\n var hour = item.datetime.getHours();\n var side = item.distance < sideThreshold;\n if (collection[hour]) {\n collection[hour].count++;\n } else {\n collection[hour] = {\n count: 1,\n left: 0,\n right: 0\n };\n }\n if (side) {\n collection[hour].right++\n } else {\n collection[hour].left++\n }\n return collection;\n }, {});\n\n // Send synco sensor by position\n callback(position, datetime, resultsByHour);\n });\n}", "title": "" }, { "docid": "328891395c0cf940858ffcd6ab769258", "score": "0.46114242", "text": "function calcHourlyTotal(){\n for (var i = 0; i < hours.length; i++){\n var hourlyTotal = 0;\n\n for (var x = 0; x < locations.length; x++){\n hourlyTotal += locations[x].sales[i];\n }\n\n hourlyTotalArray.push(hourlyTotal);\n }\n\n calcGrandTotal();\n}", "title": "" }, { "docid": "318c1000c4993337180d099199ba1922", "score": "0.46080106", "text": "function onWeatherHistoryComplete(items, request) {\n\n // Extract the Station from the fetch query parameters\n var myQuery = request.query;\n var myStation = myQuery.Station;\n \n\n // Get the array of history data for this station\n // This array was\n var myWeatherHistoryData = weatherHistoryData[myStation];\n \n // Get the station definition, if one exists already\n var myStationDefinition = stationDefinitions[myStation];\n \n var numberOfRecords = items.length;\n logToConsole(1, \"onWeatherHistoryComplete - Number of weather history records for station \" + myStation + \": \" + numberOfRecords);\n for (var i = 0; i < numberOfRecords; i++){\n var item = items[i];\n\n if (myStationDefinition == null) {\n myStationDefinition = createStationDefinitionRecord(item, weather_history);\n stationDefinitions[myStation] = myStationDefinition;\n }\n\n var aRecord = createWeatherHistoryRecord(item, weather_history);\n setWeatherHistoryLimits(aRecord);\n myWeatherHistoryData.push(aRecord);\n }\n\n // Sort the array of history records for this Station\n // They should already be in order by timestamp, but this will ensure it\n myWeatherHistoryData.sort(sortTimestamps);\n \n \n // Calculate overall limits for graph (x-axis start and end values)\n var stationLimits = weatherHistoryLimits[myStation];\n if (stationLimits.minTempInC < graphingLimits.minTempInC) graphingLimits.minTempInC = stationLimits.minTempInC;\n if (stationLimits.maxTempInC > graphingLimits.maxTempInC) graphingLimits.maxTempInC = stationLimits.maxTempInC;\n if (stationLimits.minTemperature < graphingLimits.minTemperature) graphingLimits.minTemperature = stationLimits.minTemperature;\n if (stationLimits.maxTemperature > graphingLimits.maxTemperature) graphingLimits.maxTemperature = stationLimits.maxTemperature;\n if (stationLimits.minRelativeHumidity < graphingLimits.minRelativeHumidity) graphingLimits.minRelativeHumidity = stationLimits.minRelativeHumidity;\n if (stationLimits.maxRelativeHumidity > graphingLimits.maxRelativeHumidity) graphingLimits.maxRelativeHumidity = stationLimits.maxRelativeHumidity;\n if (stationLimits.minDewpoint < graphingLimits.minDewpoint) graphingLimits.minDewpoint = stationLimits.minDewpoint;\n if (stationLimits.maxDewpoint > graphingLimits.maxDewpoint) graphingLimits.maxDewpoint = stationLimits.maxDewpoint;\n if (stationLimits.minWindHeadingDegrees < graphingLimits.minWindHeadingDegrees) graphingLimits.minWindHeadingDegrees = stationLimits.minWindHeadingDegrees;\n if (stationLimits.maxWindHeadingDegrees > graphingLimits.maxWindHeadingDegrees) graphingLimits.maxWindHeadingDegrees = stationLimits.maxWindHeadingDegrees;\n if (stationLimits.minWindSpeedKnots < graphingLimits.minWindSpeedKnots) graphingLimits.minWindSpeedKnots = stationLimits.minWindSpeedKnots;\n if (stationLimits.maxWindSpeedKnots > graphingLimits.maxWindSpeedKnots) graphingLimits.maxWindSpeedKnots = stationLimits.maxWindSpeedKnots;\n if (stationLimits.minWindGustKnots < graphingLimits.minWindGustKnots) graphingLimits.minWindGustKnots = stationLimits.minWindGustKnots;\n if (stationLimits.maxWindGustKnots > graphingLimits.maxWindGustKnots) graphingLimits.maxWindGustKnots = stationLimits.maxWindGustKnots;\n\n }", "title": "" }, { "docid": "f3e85b47b85fdb11183bb4ece9214b39", "score": "0.46079347", "text": "function fetchTempCelcius(forecast) {\n let i = 0;\n forecast.forEach((day) => {\n Object.entries(day.temp).forEach(([key, value]) => {\n const temp = convertUnitTo.celcius(value);\n forecastedTemp[i] = `${temp}° C`;\n forecastCollection.temp = forecastedTemp;\n });\n i++;\n });\n }", "title": "" }, { "docid": "032defd0b526dbdcd98a61cabdbf83a2", "score": "0.46045575", "text": "function updateData() {\n Object.keys(weatherApp.selectedLocations).forEach((key) => {\n const location = weatherApp.selectedLocations[key];\n const card = getForecastCard(location);\n\n // CODELAB: Add code to call getForecastFromCache\n getForecastFromCache(location.geo)\n .then( (forecast) => {\n console.log(\"ok from cache ..\")\n renderForecast(card, forecast);\n });\n\n // Get the forecast data from the network.\n getForecastFromNetwork(location.geo)\n .then( (forecast) => {\n console.log(\"ok from network ..\")\n renderForecast(card, forecast);\n //\n getForecast7FromNetwork(location.geo)\n .then( (forecast) => {\n renderForecast7(card, forecast);\n });\n });\n })\n}", "title": "" }, { "docid": "8b30ef914472c9374406df64088584a2", "score": "0.46020865", "text": "function updateHeatmap(event) {\n var map = event.chart;\n if (map.dataGenerated)\n return;\n\t\t\n if (map.dataProvider.areas.length === 0) {\n setTimeout(updateHeatmap, 100);\n return;\n }\n\t\n for (var i = 0; i < map.dataProvider.areas.length; i++)\n map.dataProvider.areas[i].value = getAlcoholConsumption(map.dataProvider.areas[i].title)[2];\n \n map.dataGenerated = true;\n map.validateNow();\n}", "title": "" }, { "docid": "eb2b661a5043150dde8771e9bcadf09d", "score": "0.45917752", "text": "function hourlySales(){\r\n for(let i = 0; i < Locations.array.length; i++){\r\n let currentCity = Locations.array[i];\r\n for(let j = 0; j < 14; j++){\r\n let customerAmount = randomNumberOfCustomers(currentCity.minCustomer, currentCity.maxCustomer);\r\n let cookiesAmount = currentCity.avgCookieSale;\r\n let hourlyCookies = Math.ceil(customerAmount * cookiesAmount);\r\n currentCity.cookiesSoldPerHour.push(hourlyCookies);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "c35f8d2c9f7c78f85528248f3e618502", "score": "0.45855457", "text": "function displayWeatherData(response){\n var calls=localStorage.getItem(\"APICalls\");\n calls++;\n localStorage.setItem(\"APICalls\", calls);\n if(calls>=MAX_API_CALLS) DISABLE_API=true;\n _rep=response;\n console.log(_rep);\n hourlyForecast=_rep.hourly.data;\n\n\n for(var i=startTime-1;i<endTime;i++){\n switch(hourlyForecast[i].icon){\n case \"clear-day\":{\n fontAwesomeTxt=\"fas fa-sun\";\n break;\n }\n case \"partly-cloudy-day\":{\n fontAwesomeTxt=\"fas fa-cloud-sun\";\n break;\n }\n case \"cloudy\":{\n fontAwesomeTxt=\"fas fa-cloud\";\n break;\n }\n case \"rain\":{\n fontAwesomeTxt=\"fas fa-umbrella\";\n break;\n }\n case \"sleet\":{\n fontAwesomeTxt=\"fas fa-cloud-hail\";\n break;\n }\n case \"snow\":{\n fontAwesomeTxt=\"fas fa-snowflake\";\n break;\n }\n case \"wind\":{\n fontAwesomeTxt=\"fas fa-wind\";\n break;\n }\n case \"fog\":{\n fontAwesomeTxt=\"fas fa-fog\";\n break;\n }\n default:{\n fontAwesomeTxt=\"fas fa-question-circle\";\n break;\n }\n } \n var icon=$(\"<div>\").html('<i class=\"'+fontAwesomeTxt+'\"></i>');\n icon.addClass(\"weather-icon \"+hourlyForecast[i].icon);\n $(\"#\"+(i+1)+\"-column\").append(icon);\n \n }\n}", "title": "" }, { "docid": "1ca965993764034197704529b497f3b0", "score": "0.4583223", "text": "function displayHourlyTable() {\n var tblHourlySales = document.getElementById('tblGlobalHourlySales') || null;\n\n if (!tblHourlySales) return;\n\n // update the title\n var h3Title = document.getElementById('h3GlobalHourlySales');\n h3Title.textContent = 'Global Sales by Hour';\n\n // delete all table nodes, so we can genereate the new table\n var child = tblHourlySales.lastChild;\n while (child) {\n tblHourlySales.removeChild(child);\n child = tblHourlySales.lastChild;\n }\n\n // create header and foother\n var trEl = document.createElement('tr');\n tblHourlySales.appendChild(trEl);\n\n var thHeader = document.createElement('th'); // this will be the 0,0. must be empty\n\n var trFooter = document.createElement('tr');\n var tdFooter = document.createElement('td');\n tdFooter.textContent = 'Totals';\n trFooter.appendChild(tdFooter);\n\n tblHourlySales.appendChild(thHeader);\n for (var i = 0; i < corporate.globalHourlySales.length; i++) {\n thHeader = document.createElement('th');\n thHeader.textContent = fortatTo12Hrs(corporate.globalHourlySales[i][0]);\n tblHourlySales.appendChild(thHeader);\n //CREATE FOOTER\n tdFooter = document.createElement('td');\n tdFooter.textContent = corporate.globalHourlySales[i][1]; // // 0:hour | 1:globalCookiesSales\n // tdTotals test\n tdFooter.className='tdTotals';\n trFooter.appendChild(tdFooter);\n }\n\n // create a row for each store. The stores are stored in MainOffice.storesObjectsArray\n for (var i = 0; i < corporate.storesObjectsArray.length; i++) {\n //console.log(corporate.storesObjectsArray[i].location);\n tblHourlySales.appendChild(corporate.storesObjectsArray[i].getStoreRenderRowByHour());\n }\n\n tblHourlySales.appendChild(trFooter);\n} // displayHourlyTable", "title": "" }, { "docid": "87769a3c8bf8919019b7d7476dcafd45", "score": "0.45825386", "text": "function updateHeatMapData(heatLoc){\n // Push to page\n\tGLB.heatmap.setData(heatLoc);\n\tconsole.log('Updated Heat Map Layer');\n}", "title": "" }, { "docid": "abf93a1baf65b8a80c34c5341224fe50", "score": "0.4574976", "text": "function orderData(dataView) {\n\n const scheduled = [];\n\n for (let i = 0; i < data.entries.length; i++) {\n const dayOfWeekSelected = data.entries[i].dayOfWeek;\n if (dayOfWeekSelected === dataView) {\n scheduled.push(data.entries[i]);\n }\n }\n\n if (scheduled.length === 0) {\n $table.className = 'hidden';\n } else {\n $table.className = '';\n const scheduleTime = [];\n for (let j = 0; j < scheduled.length; j++) {\n scheduleTime.push(scheduled[j].time);\n }\n\n const orderedScheduledTime = scheduleTime.sort();\n for (let i = 0; i < orderedScheduledTime.length; i++) {\n newTableDom(orderedScheduledTime[i], dataView);\n }\n }\n}", "title": "" }, { "docid": "358ef9377f65d0b47c4ed7734ac91e25", "score": "0.456762", "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": "5129f9cfa95e64a1942c62b515430221", "score": "0.4566425", "text": "function loadWorkingHours() {\n var dataLoaded = JSON.parse(localStorage.getItem(\"workingHours\"));\n\n if (dataLoaded) {\n workingHours = dataLoaded;\n }\n\n saveWorkingHours()\n displayWorkingHours()\n}", "title": "" }, { "docid": "def684d52447009c207e72d61bdd41f7", "score": "0.4562871", "text": "function sumEmployeeHourly(){\r\n hourlyEmployeeTotals = [];\r\n for(let j = 0; j < openHours.length; j++){\r\n let sum = 0;\r\n for(let i = 0; i < everyLocation.length; i++){\r\n sum += everyLocation[i].employeeArray[j];\r\n }\r\n hourlyEmployeeTotals.push(sum);\r\n }\r\n}", "title": "" }, { "docid": "a83b365638463ef3794d240ee98be2ae", "score": "0.45151946", "text": "handleGetForecastData() {\n axios.get(`http://api.openweathermap.org/data/2.5/forecast?lat=39.2746&lon=-120.1211&APPID=cecb63c29bf8faa4dc6c39fe1c560182&units=imperial`)\n .then(res => {\n let forecastArray = [];\n // This conditional ensures that the weather forecast always gets data from the same time of day\n // The data is given in three hour chunks over 5 days, so the index corresponding to time of day\n // is always changing\n for (let i = 0; i < 40; i++) {\n if (res.data.list[i].dt_txt.includes('18:00:00')) {\n forecastArray.push(res.data.list[i])\n }\n }\n this.setState({\n forecastData: forecastArray,\n })\n })\n .catch(err =>{\n console.log('ERROR', err)\n })\n }", "title": "" }, { "docid": "a99f0704ff2882e8adad07ecb58e144a", "score": "0.45133626", "text": "function fetchData(){\n\t\tconsole.log('loading spreadsheet data.')\n\n\t\tvar myData;\n\t\tfunction onLoad(data, tabletop) {\n\t\t\tconsole.log(\"loading, updating and saving data from spreadsheet\");\n\n\t\t\t//Write updated data to .JSON files and update global variables.\n\t\t\tvar currentNumber=0;\n\t\t\tfunction writeJSON(){\n\t\t\t\tif(currentNumber<sections.length){\n\t\t\t\t\tvar filename = '../data/' + sections[currentNumber] + '.json'\n\t\t\t\t\t\n\t\t\t\t\tjf.writeFile(filename, data[sections[currentNumber]].elements, function(err) {\n\t\t\t\t\t\tglobal[sections[currentNumber]].sitewide = readJSONFile(filename);\n\n\t\t\t\t\t\tcurrentNumber++;\n\t\t\t\t\t\twriteJSON();\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\twriteJSON();\n\t\t};\n\n\t\tvar options = {\n\t\t\tkey: spreadsheet_URL,\n\t\t\tpostProcess: function(element) {\n\t\t\t\telement[\"timestamp\"] = Date.parse( element[\"date\"] );\n\t\t\t},\n\t\t\tcallback: onLoad\n\t\t};\n\n\t\tTabletop.init(options);\n}", "title": "" }, { "docid": "7b52c7e869e8da83e171bf3accd9cf85", "score": "0.45037895", "text": "function fillForecast(day, forecast) {\n\t\t// Choose one of the five forecast cells to fill\n\t\tvar forecastCell = '#forecast' + day + ' ';\n\t\tvar dayDiv = $(forecastCell + '.day');\n\t\tvar desc = $(forecastCell + '.desc');\n\t\tvar high = $(forecastCell + '.high');\n\t\tvar low = $(forecastCell + '.low');\n \n var cell = $(forecastCell);\n var color = \"rgb({color}, {color}, {color})\";\n var colorVal = Math.round(lerp(forecast.temp.max, tempRangeMin, tempRangeMax, 20, 100));// Math.round(getTempPercentage(forecast.temp.max) * 0.55);\n color = replaceAll(color, \"{color}\", colorVal);\n\t\tvar forecastTime = new Date(0);\n // console.log(\"forecast: \", forecast)\n\t\tforecastTime.setUTCSeconds(forecast.dt);\n\t\tvar gradient = getGradient(forecast.temp.min, forecast.temp.max, color, isWeekend(forecastTime.getDay()));\n cell.css(\"background\", gradient);\n //cell.css(\"border-color\", isWeekend(forecast.day) ? \"white\" : \"#222222\");\n //cell.css(\"border-width\", isWeekend(forecast.day) ? \"2px\" : \"1px\");\n \n // If this is the first cell, call it \"Today\" instead of the day of the week\n if (dayDiv.length)\n {\n let inner = shortWeekday[forecastTime.getDay()];\n dayIcons.forEach(icon => {\n if (icon.day == forecastTime.getDate() && icon.month == forecastTime.getMonth() + 1 && (!icon.year || icon.year == (forecastTime.getYear() + 1900)))\n inner = icon.icon + \" \" + inner;\n });\n dayDiv.html(inner);\n if (isWeekend(forecastTime.getDay()))\n dayDiv.addClass(\"weekend\");\n else\n dayDiv.removeClass(\"weekend\");\n }\n\n\t\t// Insert the forecast details. Icons may be changed by editing the icons array.\n\t\tskycons.set(iconCanvases[day], getSkyconForWeatherApiIcon(forecast.weather[0].icon));\n\t\t\n\t\t//desc.html(forecast.summary);\n\t\t\n\t\tif (high.length) {\n\t\t\thigh.html(Math.round(forecast.temp.max) + \"°\");\n\t\t}\n\t\tif (low.length) {\n\t\t\tlow.html(Math.round(forecast.temp.min) + \"°\");\n\t\t}\n }", "title": "" }, { "docid": "ea0e3d154bcc26aa42d140a88215daba", "score": "0.44593027", "text": "function adddataFirest(station){\r\n\tvar aux = [\r\n\t\tparseFloat(station.latitude),\r\n\t\tparseFloat(station.longitude),\r\n\t\tstation.nta,\r\n\t\tstation.borough\r\n\t];\r\n\tFIRESTDATA.push(aux);\r\n}", "title": "" }, { "docid": "b908cbf9a00392b16dff801007f6103d", "score": "0.44586986", "text": "function drawUserSelectedRouteTTCDataOnMap(data)\n {\n console.log(\"At drawUserSelectedRouteTTCDataOnMap, route is: \", data);\n var routeClickedOn = idToRoutename[data]; //actal name of route to draw ttcHeatmap of\n console.log(\"routeClickedOn: \", routeClickedOn);\n\n //Get vehicles on this route\n var ttcDataLength = ttcData.length;\n var ttcRouteVehicleLocations = []; //keep track of vehicles on this route thats clicked on\n for(i=0;i<ttcDataLength;i++)\n {\n if(ttcData[i][\"route_name\"] == routeClickedOn)\n {\n var latitude = ttcData[i][\"coordinates\"][1];\n var longitude = ttcData[i][\"coordinates\"][0];\n var entry = new google.maps.LatLng(latitude, longitude);\n ttcRouteVehicleLocations.push(entry);\n }\n }\n console.log(\"ttcRouteVehicleLocations is: \", ttcRouteVehicleLocations);\n console.log(\"ttcRouteVehicleLocations.length is: \", ttcRouteVehicleLocations.length);\n\n //Remove old heat map data and add in new data for only this route\n ttcHeatmap.setMap(null)\n ttcHeatmap = new google.maps.visualization.HeatmapLayer({\n data: ttcRouteVehicleLocations,\n map: ttcMap\n });\n }", "title": "" }, { "docid": "4001045da05bf679ce44e17e889bb95a", "score": "0.44496056", "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": "a89023ec2f3039b803658a20af548782", "score": "0.4447902", "text": "function homey_hourly_availability_calendar_dash(){\n var today = new Date();\n var listing_booked_dates=[];\n var listing_pending_dates=[];\n\n for (var key in booked_hours_array) {\n if (booked_hours_array.hasOwnProperty(key) && key!=='') { \n var temp_book=[];\n temp_book['title'] = Homey_Listing.hc_reserved_label,\n temp_book ['start'] = moment.unix(key).utc().format(),\n temp_book ['end'] = moment.unix( booked_hours_array[key]).utc().format(),\n temp_book ['editable'] = false;\n temp_book ['color'] = '#fdd2d2';\n temp_book ['textColor'] = '#444444';\n listing_booked_dates.push(temp_book);\n }\n }\n\n for (var key_pending in pending_hours_array) {\n if (pending_hours_array.hasOwnProperty(key_pending) && key_pending!=='') { \n var temp_pending=[];\n temp_pending['title'] = Homey_Listing.hc_pending_label,\n temp_pending ['start'] = moment.unix(key_pending).utc().format(),\n temp_pending ['end'] = moment.unix( pending_hours_array[key_pending]).utc().format(),\n temp_pending ['editable'] = false;\n temp_pending ['color'] = '#ffeedb';\n temp_pending ['textColor'] = '#333333';\n listing_pending_dates.push(temp_pending);\n }\n }\n\n var hours_slot = $.merge(listing_booked_dates, listing_pending_dates);\n var calendarEl = document.getElementById('homey_hourly_calendar_edit_listing');\n\n var calendar = new FullCalendar.Calendar(calendarEl, {\n locale: Homey_Listing.homey_current_lang,\n timeZone: Homey_Listing.homey_timezone,\n plugins: [ 'timeGrid' ],\n defaultView: 'timeGridWeek',\n slotDuration:'00:30:00',\n minTime: booking_start_hour,\n maxTime: booking_end_hour,\n events: hours_slot,\n defaultDate: today, \n selectHelper: true,\n selectOverlap : false,\n footer: false,\n nowIndicator: true,\n allDayText: Homey_Listing.hc_hours_label,\n weekNumbers: false,\n weekNumbersWithinDays: true,\n weekNumberCalculation: 'ISO',\n editable: false,\n eventLimit: true,\n unselectAuto: false,\n isRTL: homey_is_rtl,\n buttonText: {\n today: Homey_Listing.hc_today_label\n }\n });\n\n calendar.render();\n }", "title": "" }, { "docid": "2b8dc129faeba311df3867d3d5d2b4e7", "score": "0.44433102", "text": "function populateForecast () {\n var queryURL3 = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + city + \"&appid=9bcf5e17bdf9a0b802d15f96847a6ef0\";\n $.ajax({\n url: queryURL3,\n method: \"GET\"\n }).then(function(forecast) {\n\n $(\"#forecast-weather\").show();\n\n var nowMoment = moment();\n\n for (var i = 6; i < forecast.list.length; i += 8) {\n\n var forecastDate = $(\"<h4>\");\n\n var forecastPosition = (i + 2) / 8;\n\n $(\"#forecast-date\" + forecastPosition).empty();\n $(\"#forecast-date\" + forecastPosition).append(\n forecastDate.text(nowMoment.add(1, \"days\").format(\"M/D/YYYY\"))\n );\n\n var forecastIcon = $(\"<img>\");\n forecastIcon.attr(\n \"src\",\n \"https://openweathermap.org/img/w/\" +\n forecast.list[i].weather[0].icon +\n \".png\"\n );\n\n $(\"#forecast-icon\" + forecastPosition).empty();\n $(\"#forecast-icon\" + forecastPosition).append(forecastIcon);\n\n var fahrenheit = (parseInt((forecast.list[i].main.temp - 273.15) * 9/5 + 32));\n\n $(\"#forecast-temp\" + forecastPosition).text(\n \"Temp: \" + fahrenheit + \" °F\"\n );\n $(\"#forecast-humidity\" + forecastPosition).text(\n \"Humidity: \" + forecast.list[i].main.humidity + \"%\"\n );\n }\n });\n}", "title": "" }, { "docid": "e5b449a8c878abb0f05f583b8df6b2bf", "score": "0.4441875", "text": "function getHourlyData(cb_args) {\n\tvar url = \"http://data.nrcc.rcc-acis.org/StnData\",\n\t\trinput = cb_args.input_params,\n\t\tstation_type = rinput.sids.split(\" \")[1],\n\t\tinput_params = {\n\t\t\tsid: rinput.sids,\n\t\t\tsdate: rinput.sdate,\n\t\t\tedate: rinput.edate,\n\t\t\telems: [],\n\t\t\tmeta: \"tzo\"\n\t\t},\n\t\ttempAndWspd = [23, 126, 28, 128];\n\trinput.elems.forEach(function(elem) {\n\t\tvar addElem = typeof elem === 'number' ? {vX: elem} : elem;\n\t\tif (tempAndWspd.indexOf(elem) >= 0) {\n\t\t\t$.extend(addElem, {\"prec\":1});\n\t\t}\n\t\tinput_params.elems.push(addElem);\n\t});\n\t$(\"#newaListerResults\").append(\"<br/>&nbsp;&nbsp;&nbsp;... Obtaining station data\");\n\t$.ajax(url, {\n\t\ttype: 'POST',\n\t\tdata: JSON.stringify({params:input_params}),\n\t\tdataType: 'json',\n\t\tcontentType: 'application/json',\n\t\tcrossDamain: true,\n\t\tsuccess: function (results) { postSuccess(results, doEstimation, $.extend(cb_args, {\"input_params\": input_params})); },\n\t\terror: postError\n\t});\n}", "title": "" }, { "docid": "8834e50577208bc0befc71b4d26374f3", "score": "0.44390973", "text": "function fnClear(hour) {\n events[`appt-${hour}`] = '';\n events[`appt-notes-${hour}`] = ''\n $(`#appt-${hour}`).text('')\n $(`#appt-notes-${hour}`).text('')\n localStorage.setItem(\"dayPlan\", JSON.stringify(events));\n}", "title": "" }, { "docid": "84bb8221b5765e90c0cde23f6724b1e0", "score": "0.44315866", "text": "function fnSave(hour) {\n events[`appt-${hour}`] = $(`#appt-${hour}`).val();\n events[`appt-notes-${hour}`] = $(`#appt-notes-${hour}`).val();\n console.log(events);\n localStorage.setItem(\"dayPlan\", JSON.stringify(events));\n}", "title": "" }, { "docid": "7b9e1a9ab43b9cf778ea63dad0fd0af0", "score": "0.44268247", "text": "function saveData (blockHour, saveHour, eventHour) {\n saveHour.on(\"click\", function() {\n var data = blockHour.val().trim()\n console.log(data)\n localStorage.setItem(timeBlock[eventHour],JSON.stringify(data))\n console.log(timeBlock[eventHour])\n })\n }", "title": "" }, { "docid": "6ab35b1ea8f64e5234c63ca11bd8779f", "score": "0.44203222", "text": "function displayFiveDayForecast (data){\n if(data instanceof Event){\n var text = data.target.innerHTML;\n // This is getting the data stored on line 31.\n var data = JSON.parse(localStorage.getItem(text));\n // Get the latitude and longitude for the UV search from Open Weather Maps API\n var latitude = data.latitude;\n var longitude = data.longitude;\n } else {\n // Get the latitude and longitude for the UV search from Open Weather Maps API\n var latitude = data.coord.lat;\n var longitude = data.coord.lon;\n }\n\n var cardDate1 = document.querySelector('.day-1-date');\n var cardIcon1 = document.querySelector('.day-1-icon');\n var cardTemp1 = document.querySelector('.day-1-temp');\n var cardHum1 = document.querySelector('.day-1-humidity');\n\n var cardDate2 = document.querySelector('.day-2-date');\n var cardIcon2 = document.querySelector('.day-2-icon');\n var cardTemp2 = document.querySelector('.day-2-temp');\n var cardHum2 = document.querySelector('.day-2-humidity');\n\n var cardDate3 = document.querySelector('.day-3-date');\n var cardIcon3 = document.querySelector('.day-3-icon');\n var cardTemp3 = document.querySelector('.day-3-temp');\n var cardHum3 = document.querySelector('.day-3-humidity');\n\n var cardDate4 = document.querySelector('.day-4-date');\n var cardIcon4 = document.querySelector('.day-4-icon');\n var cardTemp4 = document.querySelector('.day-4-temp');\n var cardHum4 = document.querySelector('.day-4-humidity');\n\n var cardDate5 = document.querySelector('.day-5-date');\n var cardIcon5 = document.querySelector('.day-5-icon');\n var cardTemp5 = document.querySelector('.day-5-temp');\n var cardHum5 = document.querySelector('.day-5-humidity');\n\n // Fetches the 7-Day forecast and populates the HTML to the cooresponding cards\n fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${latitude}&lon=${longitude}&exclude=current,hourly,minutely,alerts&units=imperial&appid=${apiKey}`)\n .then(response => response.json())\n .then(data => {\n \n //Day One\n var tempValue1 = data.daily[1].temp.day;\n var humidValue1 = data.daily[1].humidity;\n cardDate1.innerHTML = moment.unix(data.daily[1].dt).format(\"M/DD/YYYY\");\n cardIcon1.innerHTML = `<img src=\"https://openweathermap.org/img/wn/${data.daily[1].weather[0].icon}@2x.png\">`;\n cardTemp1.innerHTML = `Temperature: ${tempValue1} °F`;\n cardHum1.innerHTML = `Humidity: ${humidValue1}%`;\n\n //Day Two\n var tempValue2 = data.daily[2].temp.day;\n var humidValue2 = data.daily[2].humidity;\n cardDate2.innerHTML = moment.unix(data.daily[2].dt).format(\"M/DD/YYYY\");\n cardIcon2.innerHTML = `<img src=\"https://openweathermap.org/img/wn/${data.daily[2].weather[0].icon}@2x.png\">`;\n cardTemp2.innerHTML = `Temperature: ${tempValue2} °F`;\n cardHum2.innerHTML = `Humidity: ${humidValue2}%`;\n\n //Day Three\n var tempValue3 = data.daily[3].temp.day;\n var humidValue3 = data.daily[3].humidity;\n cardDate3.innerHTML = moment.unix(data.daily[3].dt).format(\"M/DD/YYYY\");\n cardIcon3.innerHTML = `<img src=\"https://openweathermap.org/img/wn/${data.daily[3].weather[0].icon}@2x.png\">`;\n cardTemp3.innerHTML = `Temperature: ${tempValue3} °F`;\n cardHum3.innerHTML = `Humidity: ${humidValue3}%`;\n\n //Day Four\n var tempValue4 = data.daily[4].temp.day;\n var humidValue4 = data.daily[4].humidity;\n cardDate4.innerHTML = moment.unix(data.daily[4].dt).format(\"M/DD/YYYY\");\n cardIcon4.innerHTML = `<img src=\"https://openweathermap.org/img/wn/${data.daily[4].weather[0].icon}@2x.png\">`;\n cardTemp4.innerHTML = `Temperature: ${tempValue4} °F`;\n cardHum4.innerHTML = `Humidity: ${humidValue4}%`;\n\n //Day Five\n var tempValue5 = data.daily[5].temp.day;\n var humidValue5 = data.daily[5].humidity;\n cardDate5.innerHTML = moment.unix(data.daily[5].dt).format(\"M/DD/YYYY\");\n cardIcon5.innerHTML = `<img src=\"https://openweathermap.org/img/wn/${data.daily[5].weather[0].icon}@2x.png\">`;\n cardTemp5.innerHTML = `Temperature: ${tempValue5} °F`;\n cardHum5.innerHTML = `Humidity: ${humidValue5}%`;\n });\n}", "title": "" }, { "docid": "f9179adb3c8e364a31562b81d7026f95", "score": "0.44176605", "text": "function evalForecastGovData(data){\n // console.log(data.currentobservation.Weather);\n\n let cloudCoverTotal = 0;\n for (var i = 0; i < data.data.weather.length; i++) {\n if (data.data.weather[i].toLowerCase() === \"mostly sunny\") {\n cloudCoverTotal += 1;\n } else if (data.data.weather[i].toLowerCase() === \"partly sunny\") {\n cloudCoverTotal += 2;\n } else if (data.data.weather[i].toLowerCase() === \"partly cloudy\") {\n cloudCoverTotal += 3;\n } else if (data.data.weather[i].toLowerCase() === \"mostly cloudy\") {\n cloudCoverTotal += 4;\n } else if (data.data.weather[i].toLowerCase() === \"cloudy\") {\n cloudCoverTotal += 5;\n };\n cloudCoverTotal = cloudCoverTotal / data.data.weather.length;\n };\n let weightedVal = {value : cloudCoverTotal * 100, weight : 4};\n weightedData.fg = weightedVal;\n }", "title": "" }, { "docid": "27c380727713e98b233b8ae983635b46", "score": "0.44052488", "text": "function getWeekSensorData() {\n var sensorData7d, sensorData14d,\n time7dago = new window.moment().subtract('days', 7),\n time14dago = new window.moment().subtract('days', 14);\n\n console.log('get weekly sensor data');\n $.getJSON('./temperature_long.json', function(data) {\n if (data && data.length > 0) {\n // remove data outside min/max range\n data = _.filter(data, function(val) { return (val.value > MIN_RANGE && val.value < MAX_RANGE); });\n\n // setup data for 7d graph\n sensorData7d = _.filter(data, function(val, index) {\n return (time7dago.isBefore(val.time));\n });\n sensorData7d = _.pluck(sensorData7d, 'value').reverse();\n $('.graph-7d').sparkline(sensorData7d, sparkFormat);\n\n // setup data for 14d graph\n sensorData14d = _.filter(data, function(val, index) {\n return (time14dago.isBefore(val.time) && index % 2 === 0);\n });\n sensorData14d = _.pluck(sensorData14d, 'value').reverse();\n $('.graph-14d').sparkline(sensorData14d, sparkFormat);\n\n }\n\n });\n\n }", "title": "" }, { "docid": "cbe10515fed6e90c01651f52c3345a62", "score": "0.44038415", "text": "function Forecast() {\n var city = $(\"#search-city\").val();\n var state = $(\"#search-state\").val();\n var queryVal = `https://api.weatherbit.io/v2.0/forecast/daily?city=${city},${state}&key=${apiKey}`;\n $.ajax({\n type: \"GET\",\n url: queryVal,\n }).then(function (apiFunction) {\n console.log(apiFunction);\n $(\"#five-day-forecast\").empty();\n for (let i = 2; i < apiFunction.data.length; i++) {\n var highTemp = apiFunction.data[i].high_temp;\n var highTempInFahrenheit = (highTemp * 9) / 5 + 32;\n var lowTemp = apiFunction.data[i].min_temp;\n var lowTempInFahrenheit = (lowTemp * 9) / 5 + 32;\n var kphConvertGusts = apiFunction.data[i].wind_gust_spd / 1.609344;\n\n if (i === 2) {\n $(\"#five-day-forecast\")\n .append(`<div class=\"card small-6 large-2 columns\" id=\"weather-card\">\n <h5 class=\"fdf\" style=\"padding-top: 10px;\">Today In: ${apiFunction.city_name} </h5>\n <img class=\"images\" id=\"image-hover-effect\" src=\"https://www.weatherbit.io/static/img/icons/${apiFunction.data[i].weather.icon}.png\">\n <p class=\"fdf\">High Temp: ${Math.round(highTempInFahrenheit)}</p>\n <p class=\"fdf\">Low Temp: ${Math.round(lowTempInFahrenheit)}</p>\n <p class=\"fdf\">Current Condition: ${apiFunction.data[i].weather.description}\n <p class=\"fdf\">Wind-Direction: ${apiFunction.data[i].wind_cdir_full}\n <p class=\"fdf\" style=\"padding-bottom: 4px;\">Gusts up to: ${Math.round(kphConvertGusts)} MPH</div>`\n );\n } else if (i >= 7) {\n break;\n }\n\n const myDate = new Date(\n apiFunction.data[i].valid_date).toLocaleDateString();\n $(\"#five-day-forecast\").append(`<div class=\"card small-6 large-2 columns\" id=\"weather-card\">\n <h5 class=\"fdf\" style=\"padding-top: 12px;\">${myDate}</h5>\n <img class=\"images tooltiptext\" id=\"image-hover-effect\" src=\"https://www.weatherbit.io/static/img/icons/${apiFunction.data[i].weather.icon}.png\">\n <p class=\"fdf\">High Temp: ${Math.round(highTempInFahrenheit)}</p>\n <p class=\"fdf\">LowTemp: ${Math.round(lowTempInFahrenheit)}</p>\n <p class=\"fdf\">Current Condition: ${apiFunction.data[i].weather.description}\n <p class=\"fdf\">Wind-Direction: ${apiFunction.data[i].wind_cdir_full}\n <p class=\"fdf\" style=\"padding-bottom: 10px;\">Gusts up to: ${Math.round(kphConvertGusts)} MPH</div>`\n );\n }\n });\n }", "title": "" }, { "docid": "7909d63fd179794af8bdc328deada891", "score": "0.44020626", "text": "function addWeather(date, htmlGameRow, gameObject) {\n\n var cityData = gameObject.city;\n var stateData = gameObject.state;\n var wthrImgURL = 'http://openweathermap.org/img/w/';\n var wthrDescription = '';\n var cityTemp = '';\n var wthrImgTag = htmlGameRow.find('img.wthr-img');\n var wthrImgParent = htmlGameRow.find('div.wthr-row');\n var cityTempTag = htmlGameRow.find('span.city-temp');\n var DaysFuture3 = moment().zone(7).add(3, 'days');\n var Gametime = moment(date + ' ' + gameObject.time).zone(7);\n\n if (moment(date).zone(7).isBefore(DaysFuture3) && Gametime.isAfter(moment().zone(7).add(3, 'hours'))) {\n\n var forecastURL = 'http://api.openweathermap.org/data/2.5/forecast?q=' + cityData + ',' + stateData;\n var forecast = [];\n\n $.getJSON(forecastURL, function(data) {\n forecast = data.list;\n })\n .done(function(){\n var bestWthr = returnClosestTime(forecast, gameObject.time, date);\n wthrDescription = bestWthr.weather[0].description;\n wthrImgURL += bestWthr.weather[0].icon + '.png';\n cityTemp = fahrenheit(bestWthr.main.temp);\n\n wthrImgTag.attr({\n 'src': wthrImgURL,\n 'alt': cityData + ' ' + moment(bestWthr.dt, 'X').format('MM/DD/YYYY h:mm A'),\n 'title': wthrDescription\n });\n\n cityTempTag.html(cityTemp + ' &#176;' + 'F');\n\n wthrImgParent.fadeIn('slow');\n\n wthrImgParent.tooltip({\n 'placement': 'top',\n 'selector': '[rel=\"popover\"]'\n });\n });\n } else if (moment().zone(7).isAfter(Gametime.subtract(3, 'hours')) && moment().zone(7).isBefore(Gametime.add(6,'hours'))) {\n \n var forecastURL = 'http://api.openweathermap.org/data/2.5/weather?q=' + cityData + ',' + stateData;\n var currentWeather;\n\n $.getJSON(forecastURL, function(data) {\n currentWeather = data;\n })\n .done(function(){\n wthrDescription = currentWeather.weather[0].description;\n wthrImgURL += currentWeather.weather[0].icon + '.png';\n cityTemp = fahrenheit(currentWeather.main.temp);\n\n wthrImgTag.attr({\n 'src': wthrImgURL,\n 'alt': cityData + ' ' + moment(currentWeather.dt, 'X').format('MM/DD/YYYY h:mm A'),\n 'title': wthrDescription\n });\n\n cityTempTag.html(cityTemp + ' &#176;' + 'F');\n\n wthrImgParent.fadeIn('slow');\n\n wthrImgParent.tooltip({\n 'placement': 'top',\n 'selector': '[rel=\"popover\"]'\n });\n });\n } else {\n console.log('didn\\'t qualify');\n return 0;\n }\n }", "title": "" }, { "docid": "dc4aa4f50bd5b851b938f4f0d94eb50d", "score": "0.4400275", "text": "function setteamStats(data){\n\tfor (var i =0; i < data.length; i++){\n\t\tif(data[i][\"FTR\"] == \"H\"){\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"HomeTeam\"], data[i][\"Matchday\"], [3, data[i][\"FTHG\"], data[i][\"FTAG\"], [data[i][\"B365H\"],data[i][\"BWH\"],data[i][\"GBH\"],data[i][\"IWH\"],data[i][\"LBH\"]], [0,0,0,0,0], [0,0,0,0,0]]);\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"AwayTeam\"], data[i][\"Matchday\"], [0, data[i][\"FTAG\"], data[i][\"FTHG\"], [0,0,0,0,0], [0,0,0,0,0], [data[i][\"B365H\"],data[i][\"BWH\"],data[i][\"GBH\"],data[i][\"IWH\"],data[i][\"LBH\"]]]);\n\t\t}\n\t\tif(data[i][\"FTR\"] == \"D\"){\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"HomeTeam\"], data[i][\"Matchday\"], [1, data[i][\"FTHG\"], data[i][\"FTAG\"], [0,0,0,0,0], [data[i][\"B365D\"],data[i][\"BWD\"],data[i][\"GBD\"],data[i][\"IWD\"],data[i][\"LBD\"]], [0,0,0,0,0]]);\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"AwayTeam\"], data[i][\"Matchday\"], [1, data[i][\"FTAG\"], data[i][\"FTHG\"], [0,0,0,0,0], [data[i][\"B365D\"],data[i][\"BWD\"],data[i][\"GBD\"],data[i][\"IWD\"],data[i][\"LBD\"]], [0,0,0,0,0]]);\n\t\t}\n\t\tif(data[i][\"FTR\"] == \"A\"){\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"HomeTeam\"], data[i][\"Matchday\"], [0, data[i][\"FTHG\"], data[i][\"FTAG\"], [0,0,0,0,0], [0,0,0,0,0], [data[i][\"B365A\"],data[i][\"BWA\"],data[i][\"GBA\"],data[i][\"IWA\"],data[i][\"LBA\"]]]);\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"AwayTeam\"], data[i][\"Matchday\"], [3, data[i][\"FTAG\"], data[i][\"FTHG\"], [data[i][\"B365A\"],data[i][\"BWA\"],data[i][\"GBA\"],data[i][\"IWA\"],data[i][\"LBA\"]], [0,0,0,0,0], [0,0,0,0,0]]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "017a5b0fdab92c8ff2c441a5535c1407", "score": "0.43949622", "text": "function prepData(){\n\n temp = Math.round(weather.currently.temperature);\n summary = weather.currently.summary;\n cloudCover = Math.round(weather.currently.cloudCover*100);\n cloudIcon = weather.currently.icon;\n precip = weather.currently.precipIntensity;\n if (precip > 0){\n precipType = weather.currently.precipType;\n } else {\n precipType = \"none\";\n }\n humidity = Math.round( (weather.currently.humidity * 100));\n pressure = Math.round( weather.currently.pressure);\n wind = Math.round(weather.currently.windSpeed);\n setBeaufort(wind);\n\n // not currently used\n // could add wind direction icon\n windDir = weather.currently.windBearing;\n\n if( weather.hasOwnProperty(\"alerts\")){\n conditions = weather.alerts.length;\n getConditionsURL();\n } else {\n conditions = 0;\n }\n\n // set default F/C values\n units = weather.flags.units;\n if (units !== \"us\"){\n $(\"#c\").addClass(\"highlight-on\");\n $(\"#f\").addClass(\"highlight-off\");\n $(\"#c\").removeClass(\"highlight-off\");\n $(\"#f\").removeClass(\"highlight-on\");\n }\n\n getFiveDayForecast();\n}", "title": "" }, { "docid": "3e2b75a9d58ad7567e031a7de11d875b", "score": "0.43866786", "text": "function forcastioCallback ( data ) {\n fioLow = +data.daily.data[0].temperatureMin;\n fioHigh = +data.daily.data[0].temperatureMax;\n fioJSON = +data.currently.temperature;\n document.getElementById( 'fioLow' ).innerHTML = fioLow;\n document.getElementById( 'fioHigh' ).innerHTML = fioHigh;\n document.getElementById( 'fioDiv' ).innerHTML = fioJSON + '&ordm';\n document.getElementById( 'fioLink' ).setAttribute( 'href', \"http://forecast.io/#/f/\" + lat + \",\" + lng );\n averageArray.push(fioJSON);\n getAverage();\n}", "title": "" }, { "docid": "4a5e2dc95afbd838ed7ee645d8f5e55e", "score": "0.43820798", "text": "function fiveDay(lat1, lon1) {\n\n fetch(\n 'https://api.openweathermap.org/data/2.5/onecall?lat=' + lat1 + '&lon=' + lon1 + '&units=imperial&exclude=minutely,hourly&appid=8f4b5fb79bf55ca4186b297ac79fb394'\n )\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data)\n\n // loop through the 5 arrays of the 7 day forecast to display only 5 day forecast\n for (var i = 0; i < 5; i++) {\n\n var call = document.querySelector(\"#column-\" + i);\n $(\"#column-\" + i).empty();\n // forecast time\n var t = data.daily[i].dt\n var forTime = moment.unix(t).format(\"MM/DD/YYYY\");\n var displayTime = document.createElement(\"div\");\n displayTime.innerHTML = forTime;\n\n // forecast weather icon\n var forIcon = data.daily[i].weather[0].icon;\n var forIconEl = document.createElement(\"img\");\n forIconEl.setAttribute(\"id\", \"forcon\")\n var forIconLink = \"http://openweathermap.org/img/wn/\" + forIcon + \".png\";\n $(forIconEl).attr('src', forIconLink);\n\n // temperature forecast\n var forTemp = data.daily[i].temp.max;\n var displayTemp = document.createElement(\"div\");\n displayTemp.innerHTML = \"Temp: \" + forTemp + \"&#176;\" + \" F\";\n\n // windspeed forecast\n var forWind = data.daily[i].wind_speed;\n var displayWind = document.createElement(\"div\");\n displayWind.innerHTML = \"Wind: \" + forWind + \" MPH\";\n\n // humidity forecast\n var forHumid = data.daily[i].humidity;\n var displayHumid = document.createElement(\"div\");\n displayHumid.innerHTML = \"Humidity: \" + forHumid + \" %\";\n\n //append each variable \n call.appendChild(displayTime);\n call.appendChild(forIconEl);\n call.appendChild(displayTemp);\n call.appendChild(displayWind);\n call.appendChild(displayHumid);\n }\n })\n}", "title": "" }, { "docid": "6fd1cab3a07dbeff5c6b170cbf814de9", "score": "0.4374057", "text": "function fiveDayForecast() {\n //reset the array that's used to store the days and forecast.\n var fiveDayArray = []\n\n // empty five day section\n $(\"div\").remove('.forecastDiv');\n\n\n //Build queryURL for 5 day forecast\n var fiveDayUrl = 'https://api.openweathermap.org/data/2.5/forecast?q=' + selectedCity + '&units=imperial&appid=' + apiKey\n\n\n $.ajax({\n url: fiveDayUrl,\n method: \"GET\"\n\n }).then(function (response) {\n\n for (i = 0; i < response.list.length; i++) {\n\n var fiveDayObject\n\n // if the substring at position 11 up to but not including position 19 === Noon, build out 5 day forecast\n // SIDE NOTE FOR GRADER: I learned this concept as slice with a start,stop,step argument in Python before taking this class\n if (response.list[i].dt_txt.substring(11, 19) === '12:00:00') {\n\n fiveDayObject = {\n icon: response.list[i].weather[0].icon,\n temp: response.list[i].main.temp,\n humidity: response.list[i].main.humidity,\n date: response.list[i].dt_txt.substring(0, 11)\n }\n\n fiveDayArray.push(fiveDayObject)\n\n }\n\n\n }// closes for loop in 5-day forecast\n\n\n //use array of 5 day forecast to populate html elements in 5 day forecast section\n for (i = 0; i < fiveDayArray.length; i++) {\n\n var forecastDiv = $('<div>').addClass(\"col-sm forecastDiv\")\n var forecastCard = $(\"<div>\").addClass(\"card text-white bg-primary mb-3 forecastCard\")\n forecastCard.attr(\"style\", \"max-width: 18rem;\")\n forecastDiv.append(forecastCard)\n\n\n var forecastCardBody = $('<div>').addClass(\"card-body forecastCardBody\")\n forecastCard.append(forecastCardBody)\n\n var forecastCardTitle = $(\"<h5>\").addClass(\"card-title forecastCardTitle forecastCardTime\")\n var forecastCardTemp = $(\"<p>\").addClass(\"card-text forecastCardTemp\")\n var forecastCardIcon = $(\"<img>\").addClass(\"card-text forecastCardIcon\")\n var forecastCardHumidity = $(\"<p>\").addClass(\"card-text forecastCardHumidity\")\n var forecastCardIconURL = 'https://openweathermap.org/img/wn/' + fiveDayArray[i].icon + '@2x.png'\n forecastCardBody.append(forecastCardTitle)\n forecastCardBody.append(forecastCardIcon)\n forecastCardBody.append(forecastCardTemp)\n forecastCardBody.append(forecastCardHumidity)\n\n var tempCounter = i + 1\n var tempDateThing = moment().add(tempCounter, 'days')\n tempDateThing = tempDateThing.format(\"MM[/]DD[/]YYYY\")\n\n forecastCardTitle.text(tempDateThing)\n /\n forecastCardIcon.attr(\"src\", forecastCardIconURL)\n forecastCardTemp.text(\"Temp: \" + fiveDayArray[i].temp + '\\xB0F')\n forecastCardHumidity.text(\"Humidity: \" + fiveDayArray[i].humidity + \"%\")\n\n\n $(\"#fiveDayContainer\").append(forecastDiv)\n\n\n }//closes array for building out 5dayForecast\n\n\n }); // closes ajax for 5 day forecast\n\n\n }", "title": "" }, { "docid": "1d41d24759f6146920d93d4b33b88f9d", "score": "0.4372476", "text": "function displayForecast(currentCity) {\n // fetch forecast data\n fetch('https://api.openweathermap.org/data/2.5/forecast?q='\n + currentCity\n + '&appid='\n + apiKey\n + '&units=imperial'\n )\n .then(function (forecastResponse) {\n if (forecastResponse.ok) {\n forecastResponse.json().then(function (forecastResponse) {\n // initialize an array to save the data we need\n var dates = [];\n // itterate thru weather api data and choose what we need\n for (let i = 0; i < forecastResponse.list.length; i++) {\n // create a var to use ONLY the data as of 3:00 PM, \n var highTemp = forecastResponse.list[i][\"dt_txt\"].split(\" \")[1].split(\":\")[0] == 15;\n if (highTemp) {\n // populate with weather data from this object\n dates.push(forecastResponse.list[i]);\n }\n };\n // console.log(dates);\n\n // itterate thru newly created array of data as of 3pm, and render the inforamtion in our forecast cards\n // high temp\n for (let i = 0; i < dates.length; i++) {\n var cardTemp = document.getElementsByClassName(\"forecast-temp\");\n cardTemp[i].innerHTML = Math.round(dates[i].main.temp) + \"&#8457;\";\n // humidity\n var cardHumidity = document.getElementsByClassName(\"forecast-humidity\");\n cardHumidity[i].innerHTML = dates[i].main.humidity + \"%\";\n // icons\n var cardIcon = document.getElementsByClassName(\"forecast-icon\");\n var cardIconId = dates[i].weather[0].icon\n var cardIconUrl = \"http://openweathermap.org/img/w/\"\n + cardIconId\n + \".png\";\n cardIcon[i].setAttribute(\"src\", cardIconUrl);\n }\n })\n } else {\n return;\n }\n })\n}", "title": "" }, { "docid": "a66bcc764c17fbd7cee7aea43a161106", "score": "0.43630195", "text": "function sortWeather() {\n\n props.weather.timeseries.forEach((timestamp) => {\n const convertedDate = new Date(timestamp.time);\n if (convertedDate.getHours() >= new Date().getHours()) {\n if (timestamp.time.includes(getCurrentDate(new Date()))) {\n if (convertedDate.getDate() === new Date().getDate()) {\n timestamp.localTime = convertedDate.getHours();\n if (todaysWeather.length < 14) {\n todaysWeather.push(timestamp);\n }\n }\n }\n }\n if (convertedDate.getDate() === new Date().getDate() + 1) {\n timestamp.localTime = convertedDate.getHours();\n tomorrowsWeather.push(timestamp);\n }\n });\n }", "title": "" }, { "docid": "b6990e3a3e6e85f02d4611a86bf47e4e", "score": "0.43591005", "text": "function loadForecast() {\n trackPromise(\n insightAPI.getForecast().then((res) => {\n const forecastData = Object.entries(res.data);\n setForecast(forecastData);\n // console.log(res.data);\n })\n ).catch((err) => console.log(err));\n }", "title": "" }, { "docid": "4537e6b1d977fae6f4dccf3d83bbda63", "score": "0.4347896", "text": "function graph_store_statistics() {\r\n Graphs.DPP.push(DPP);\r\n Graphs.SICP.push(SICP);\r\n Graphs.PitVa.push(s.PitVa);\r\n Graphs.ChPos.push(s.ChPos);\r\n Graphs.FP.push(FP);\r\n Graphs.spm.push(obs.spm);\r\n Graphs.BHPd.push(s.BHPd);\r\n Graphs.CSHP.push((Math.random() * 100) + 1); // cassing shoe pressure not calculated\r\n // share with instructor as connection established, every second send val\r\n transfer[0] = DPP; transfer[1] = SICP; transfer[2] = s.PitVa; transfer[3] = s.ChPos;\r\n transfer[4] = FP; transfer[5] = obs.spm; transfer[6] = s.BHPd; transfer[7] = (Math.random() * 100) + 1;\r\n socket.server.shareStatistics(transfer, roomName);\r\n console.log(DPP + \" \" + SICP + \" \" + s.PitVa + \" \" + s.ChPos + \" \" + FP + \" \" + obs.spm + \" \" + s.BHPd);\r\n}", "title": "" }, { "docid": "5e8b87f8ca74d2502c9c37e60752fe28", "score": "0.4346683", "text": "function displayForecast(response) {\n //sunday\n setForecast({\n ready: true,\n\n //sunday\n sunHi: Math.round(response.data.data[0].app_max_temp),\n sunLo: Math.round(response.data.data[0].app_min_temp),\n sunIcon: response.data.data[0].weather.icon,\n //monday\n monHi: Math.round(response.data.data[1].app_max_temp),\n monLo: Math.round(response.data.data[1].app_min_temp),\n monIcon: response.data.data[1].weather.icon,\n //tuesday\n tueHi: Math.round(response.data.data[2].app_max_temp),\n tueLo: Math.round(response.data.data[2].app_min_temp),\n tueIcon: response.data.data[2].weather.icon,\n //wednesday\n wedHi: Math.round(response.data.data[3].app_max_temp),\n wedLo: Math.round(response.data.data[3].app_min_temp),\n wedIcon: response.data.data[3].weather.icon,\n //thursday\n thurHi: Math.round(response.data.data[4].app_max_temp),\n thurLo: Math.round(response.data.data[4].app_min_temp),\n thurIcon: response.data.data[4].weather.icon,\n //friday\n friHi: Math.round(response.data.data[5].app_max_temp),\n friLo: Math.round(response.data.data[5].app_min_temp),\n friIcon: response.data.data[5].weather.icon,\n //saturday\n satHi: Math.round(response.data.data[6].app_max_temp),\n satLo: Math.round(response.data.data[6].app_min_temp),\n satIcon: response.data.data[6].weather.icon,\n \n });\n setCity(props.city);\n }", "title": "" }, { "docid": "eaa63a2c58d52d4c4eef8480d8f30d81", "score": "0.43254772", "text": "function startup()\n{\n if (localStorage.getItem(\"homework\") == null)\n {\n document.getElementById(\"arrayOutput\").innerHTML = \"<p><br />No information saved on local machine</p>\";\n }\n else\n {\n // Convert localStorage variable from JSON string to object\n jsonText = JSON.parse(localStorage.homework);\n homeworkArray = jsonText;\n // Populate dateArray with dates from saved objects\n for (var i = 0; i < homeworkArray.length; i++)\n {\n var dateToPush = homeworkArray[i].date;\n var hourToPush = homeworkArray[i].hour;\n createNewDate(dateToPush, hourToPush);\n }\n display();\n }\n}", "title": "" }, { "docid": "8edb17d1aae2e00d56b8e6083c2d6623", "score": "0.43241033", "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": "880e0d7c7d858c9283ae66aad1ce359b", "score": "0.43233386", "text": "function Location(Location, minCust , maxCust, avgCookieSales){\n this.storeName = Location;\n this.minCust = minCust;\n this.maxCust = maxCust;\n this.avgCookieSales = avgCookieSales;\n this.dailyCookieSalesPerHour = [];\n this.randomCustPerHour = function() {\n return Math.floor(Math.random() * (this.maxCust - this.minCust) + this.minCust);\n };\n //build table within this function\n // table.appendChild(thead);\n // console.log('tr: ', tr);\n // creates the table header with the hours row at top\n\n // create table body to house the tr that the store names live in\n\n // create the td cells that hold the daily cookies sales results\n\n this.forEachHour = function forEachHour (){\n var trBlankLocation = document.createElement('tr');//this builds the tr (blank) that will house the tds for shopname and numb of cookies\n var attachTrToTable = document.getElementById('table');\n trBlankLocation.textContent = '';\n table.appendChild(trBlankLocation);\n var tdFirst = document.createElement('td');\n // trBlankLocation = document.getElementById('trBlankLocation');\n tdFirst.textContent = this.storeName;\n trBlankLocation.appendChild(tdFirst);\n for (var i = 0; i < hours.length; i++) {\n var tdDailySalesPerHour = document.createElement('td');\n // trBlankLocation = document.getElementById('trBlankLocation');\n console.log('this.dailyCookieSalesPerHour: ', this.dailyCookieSalesPerHour);\n tdDailySalesPerHour.textContent = this.dailyCookieSalesPerHour[i];\n trBlankLocation.appendChild(tdDailySalesPerHour);\n };\n\n // var li = document.createElement('li');\n // li.innerText = 'Total Sales: ' + totalSales + ' cookies';\n // ul.appendChild(li);\n };\n//generate randomCookiesSalesPerHour, needs to be entered in td\n this.randomCookieSalesPerHour = function (){\n for (var i = 0; i < hours.length; i++){\n this.dailyCookieSalesPerHour.push(Math.floor(this.randomCustPerHour() * this.avgCookieSales));\n // console.log(hours[i] + this.dailyCookieSalesPerHour[i]);\n }\n };\n}", "title": "" }, { "docid": "af2e5c62bf0f319599aab96a142ffe1f", "score": "0.4321285", "text": "function setMemory(hour, item) {\n localStorage.setItem(now.format(\"MMMM Do YYYY\") + hour, item);\n}", "title": "" }, { "docid": "3f90111ffc6bb85d3d455845f283c681", "score": "0.43209463", "text": "function resizeHeatmap() {\n\n // Layout\n // -------------------------\n\n // Width\n width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right,\n\n // Grid size\n gridSize = width / new Date(data[data.length - 1].date).getHours(),\n\n // Height\n height = (rowGap + gridSize) * (d3.max(nest, function(d,i) {return i+1})) - margin.top,\n\n // Main svg width\n container.attr(\"width\", width + margin.left + margin.right).attr(\"height\", height + margin.bottom);\n\n // Width of appended group\n svg.attr(\"width\", width + margin.left + margin.right).attr(\"height\", height + margin.bottom);\n\n // Horizontal range\n x.range([0, width]);\n\n\n // Chart elements\n // -------------------------\n\n // Groups for each app\n svg.selectAll('.hour-group')\n .attr(\"transform\", function(d, i) { return \"translate(0, \" + ((gridSize + rowGap) * i) +\")\"; });\n\n // Map squares\n svg.selectAll(\".heatmap-hour\")\n .attr(\"width\", gridSize)\n .attr(\"height\", gridSize)\n .attr(\"x\", function(d,i) { return x(d.date); });\n\n // Legend group\n svg.selectAll('.legend-group')\n .attr(\"transform\", \"translate(\" + ((width/2) - ((buckets * gridSize))/2) + \",\" + (height + margin.bottom - margin.top) + \")\");\n\n // Sales count text\n svg.selectAll('.sales-count')\n .attr(\"x\", width);\n\n // Legend item\n svg.selectAll('.heatmap-legend-item')\n .attr(\"width\", gridSize)\n .attr(\"x\", function(d, i) { return gridSize * i; });\n\n // Max value text label\n svg.selectAll('.max-legend-value')\n .attr(\"x\", (buckets * gridSize) + 10);\n }", "title": "" }, { "docid": "9262e1c09a95eb3333ba60d449d502d5", "score": "0.43127698", "text": "function getHours(result){\n return result.hourly_forecast.map(function(data) {\n return data.FCTTIME.hour\n })\n // Your code goes here\n}", "title": "" }, { "docid": "3bdf941c870ae0cf174003ff636649ce", "score": "0.4310834", "text": "function tallyAllStoreSalesPerHour() {\n hourlyTotal = [];\n for (var i = 0; i < hours.length; i++) {\n var totalSalesPerHour = 0;\n for (var j = 0; j < allStores.length; j++) {\n totalSalesPerHour += allStores[j].cookiesSoldPerHourArray[i];\n }\n hourlyTotal.push(totalSalesPerHour);\n }\n}", "title": "" }, { "docid": "32833f8e00df5688cd01e3573cabfa68", "score": "0.4309041", "text": "function loadSingleNeighborhoodView(neighborhood) {\n selectedNeighborhood = neighborhood;\n\n var filteredMetroData = {\n \"type\": \"FeatureCollection\",\n \"features\": metroLayerData.features.filter(function(data) {\n return data.properties.NEIGHBORHOOD == selectedNeighborhood;\n })\n };\n metroLayer.setGeoJSON(filteredMetroData);\n\n // Try to get deal data for markers from cache\n var timeValue = timeFilterActive ? selectedTime : \"none\";\n if (markersByNeighborhood[neighborhood] &&\n markersByNeighborhood[neighborhood][selectedDay] &&\n markersByNeighborhood[neighborhood][selectedDay][timeValue]) {\n\n var markers = markersByNeighborhood[neighborhood][selectedDay][timeValue];\n markerLayer.setGeoJSON(markers);\n return;\n }\n\n $(\".loading-indicator-container\").show();\n \n var filteredData = filterHappyHourData(selectedDay, timeValue);\n var neighborhoodData = _.filter(filteredData, function(data) {\n return data.neighborhood === neighborhood;\n });\n\n var geoJsonData = {\n type: \"FeatureCollection\",\n features: neighborhoodData.map(function(data) {\n return {\n type: \"Feature\",\n geometry: {\n type: \"Point\",\n coordinates: [data.longitude, data.latitude]\n },\n properties: {\n id: data.name,\n name: data.name,\n address: data.address,\n latitude: data.latitude,\n longitude: data.longitude,\n website: data.website,\n happyHourWebsite: data.happyHourWebsite,\n phoneNumber: data.phoneNumber,\n superCategory: \"Bar\",\n subCategories: data.locationCategories,\n deals: data.deals.map(function(deal) {\n return {\n start: deal.startTime,\n end: deal.endTime,\n day: deal.day,\n dealDetails: deal.details.map(function(detail) {\n return {\n drinkName: detail.drinkName,\n drinkCategory: detail.drinkCategory,\n detailType: detail.dealType,\n value: detail.dealValue\n };\n })\n };\n })\n }\n };\n })\n };\n\n markerLayer.setGeoJSON(geoJsonData);\n markersByNeighborhood[neighborhood] = markersByNeighborhood[neighborhood] || {};\n markersByNeighborhood[neighborhood][selectedDay] = \n markersByNeighborhood[neighborhood][selectedDay] || {};\n markersByNeighborhood[neighborhood][selectedDay][timeValue] = geoJsonData;\n \n $(\".loading-indicator-container\").hide();\n}", "title": "" }, { "docid": "73c1b6273a94c4104658478bd8a2e319", "score": "0.43024153", "text": "function clearEquakedrawingData(o){\n\tvar mapUsed = o.mapUsed;\n\tvar placeholder = $(\"#equakeGraphs\" + mapUsed);\n\tvar tmp = $(\"#twoDEquakeFlotGraph\" + mapUsed,placeholder)\n\ttmp.hide();\n\t$(\"#FlotDisplayLat\" + mapUsed).html('');\n\t$(\"#FlotDisplayLon\" + mapUsed).html('');\n\t$(\"#FlotDisplayTime\" + mapUsed).html('');\n\ttmp = $(\"#2DGMTEquakeGraph\" + mapUsed,placeholder);\n\ttmp.hide()\n\t$(\"#imageLink\",tmp).attr('href','');\n\t$(\"#image\",tmp).attr('src','');\n\t$(\"#gifImage\",tmp).attr('href','');\n\t$(\"#gmtScriptFile\",tmp).attr('href','');\n\ttmp = $(\"#3DGMTEquakeGraph\" + mapUsed,placeholder);\n\ttmp.hide()\n\t$(\"#imageLink\",tmp).attr('href','');\n\t$(\"#image\",tmp).attr('src','');\n\t$(\"#gifImage\",tmp).attr('href','');\n\t$(\"#gmtScriptFile\",tmp).attr('href','');\n}", "title": "" }, { "docid": "70d7e6fed780e99c177ced3e3d55714d", "score": "0.43011552", "text": "function onDataReceived(series) {\r\n // append to the existing data\r\n for(var i = 0; i < series.length; i++){\r\n if(alreadyFetched[series[i].FileName] == null){\r\n alreadyFetched[series[i].FileName] = {\r\n FileName: series[i].FileName,\r\n values: [{\r\n Minute: series[i].Minute,\r\n Total: series[i].Total\r\n }]\r\n };\r\n } else {\r\n alreadyFetched[series[i].FileName].values.push({\r\n Minute: series[i].Minute,\r\n Total: series[i].Total\r\n });\r\n if(alreadyFetched[series[i].FileName].values.length > 30){\r\n alreadyFetched[series[i].FileName].values.pop();\r\n }\r\n }\r\n }\r\n\r\n //update the graph\r\n d3.select('#chart svg')\r\n .datum(getdata())\r\n .transition().duration(500)\r\n .call(chart);\r\n }", "title": "" }, { "docid": "1d8f53078ef23df8f7ed3c8b29fdd55c", "score": "0.42920867", "text": "function buildHourlyData(nextHour,hourlyTemps) {\n // Data comes from a JavaScript object of hourly temp name - value pairs\n // Next hour should have a value between 0-23\n // The hourlyTemps variable holds an array of temperatures\n // Line 8 builds a list item showing the time for the next hour \n // and then the first element (value in index 0) from the hourly temps array\n var hourlyListItems = '<li class=\"hourDataPoints\">' + format_time(nextHour) + ': ' + hourlyTemps[0] + '&deg;F | </li>';\n // Build the remaining list items using a for loop\n for (let i = 1, x = hourlyTemps.length/1.0525; i < x; i++) {\n hourlyListItems += '<li class=\"hourDataPoints\">' + format_time(nextHour+i) + ': ' + hourlyTemps[i] + '&deg;F | </li>';\n }\n console.log('HourlyList is: ' +hourlyListItems);\n return hourlyListItems;\n }", "title": "" }, { "docid": "b3d8b66db3e510c3701cdcde3c561df0", "score": "0.42794648", "text": "function updateStatistics(jsonData) {\n //console.log('cleanUpData');\n for (var row in jsonData) {\n\n //If title is blank - remove row\n if (jsonData[row].itemtitle == 'undefined' || !jsonData[row].itemtitle || !jsonData[row].itemtype.includes('bk')) {\n delete jsonData[row];\n continue;\n }\n \n \n var decomposedDate = getDecomposedDate(jsonData[row].checkoutdatetime);\n let key = decomposedDate.weekInYear + '-' + jsonData[row].checkoutyear;\n\n /*\n let checkoutdate = new Date(jsonData[row].checkoutdatetime);\n let firstDayWeek = checkoutdate;\n let checkoutdateFormatted = dateFormat(checkoutdate, \"mm/dd\");\n\n //Verify comparison\n if(checkoutdateFormatted !== '01/01'){ \n firstDayWeek = getMonday(checkoutdate); \n }\n\n let formattedFirstDayWeek = dateFormat(firstDayWeek, \"mm/dd/yyyy\");\n */\n\n //Update map\n if (!mapDataPerWeek[key]) {\n //mapDataPerWeek[key] = { 'week': decomposedDate.weekInYear, 'numbookscheckout': 1, 'firstdayofweek': formattedFirstDayWeek, 'year': jsonData[row].checkoutyear };\n mapDataPerWeek[key] = { 'week': decomposedDate.weekInYear, 'numbookscheckout': 1, 'firstdayofweek': dateFormat(getMonday(new Date(jsonData[row].checkoutdatetime)), \"mm/dd/yyyy\"), 'year': jsonData[row].checkoutyear };\n } else {\n mapDataPerWeek[key].numbookscheckout += 1;\n }\n\n }\n\n //console.log('EndcleanUpData');\n}", "title": "" }, { "docid": "229af756328ecd3e5975bab3e8fdd031", "score": "0.427908", "text": "function generateHeatSheets(){\n\n //Read data for swim Events, Swimmers and Swims\n var swimEvents = getSwimEvents();\n var swimmers = getSwimmers();\n var swims = getRegoSwims(swimEvents);\n var heats = new objHeats;\n addStoredBaseTimesToSwimmers(swimmers, swimEvents);\n\n\n // Add rego swims to swimmers\n swims.arrayOfSwims.map(function(value){\n swimmers.getSwimmer(value.surnameFirstName).addRegoSwim(value);\n });\n\n heats.swimmers = swimmers;\n heats.swimEvents = swimEvents;\n \n heats.organiseSwimmersIntoHeats();\n deleteHeatSheets();\n \n //Write heats to seperate tab for each category\n writeHeatsToSheet(heats);\n \n //Write all heats to a single tab\n writeHeatsToSheet(heats, true);\n\n\n}", "title": "" }, { "docid": "0fbc454f1091760acaac1b2affe17c11", "score": "0.42754394", "text": "function sortOpenWeatherData(weather, dataObject) {\n var i = 0;\n\n for (i = 0; i < weather.length; i++) {\n if (weather[i].hasOwnProperty('rain') == true) {\n dataObject.add(weather[i].valueOf().dt_txt.split(\" \")[0], weather[i].valueOf().dt_txt.split(\" \")[1].split(\":\")[0], Math.round(weather[i].valueOf().main.temp - 273),\n weather[i].valueOf().weather[0].description, weather[i].rain[\"3h\"], weather[i].valueOf().wind.speed, weather[i].wind.valueOf().deg,\n \"no data\", \"no data\", \"no data\", \"https://openweathermap.org/img/wn/\" + weather[i].weather[0].icon + \"@2x.png\");\n\n } else if (weather[i].hasOwnProperty('snow') == true) {\n dataObject.add(weather[i].valueOf().dt_txt.split(\" \")[0], weather[i].valueOf().dt_txt.split(\" \")[1].split(\":\")[0], Math.round(weather[i].valueOf().main.temp - 273),\n weather[i].valueOf().weather[0].description, weather[i].snow[\"3h\"], weather[i].valueOf().wind.speed, weather[i].wind.valueOf().deg,\n \"no data\", \"no data\", \"no data\", \"https://openweathermap.org/img/wn/\" + weather[i].weather[0].icon + \"@2x.png\");\n\n } else {\n dataObject.add(weather[i].valueOf().dt_txt.split(\" \")[0], weather[i].valueOf().dt_txt.split(\" \")[1].split(\":\")[0], Math.round(weather[i].valueOf().main.temp - 273),\n weather[0].valueOf().weather[0].description, \"0\", weather[i].valueOf().wind.speed, weather[i].valueOf().wind.deg,\n \"no data\", \"no data\", \"no data\", \"https://openweathermap.org/img/wn/\" + weather[i].weather[0].icon + \"@2x.png\");\n }\n }\n}", "title": "" }, { "docid": "233b9b72080b2ef2e1d075b0d2fa3403", "score": "0.42686328", "text": "function getForeCast(city){\n \n var forecast1 = new XMLHttpRequest();\n\n forecast1.open(\"GET\", \"http://api.apixu.com/v1/forecast.json?key=b3fcf49b74b9482da4d204738161911&q=\"+city+\"&days=2\", false);\n forecast1.send(null);\n\n\n var f=JSON.parse(forecast1.response);\n \n ////Update to Make change changeCityValues(city, cityValues)\n var tempAve = f.current.temp_f;\n var humidity = f.current.humidity;\n var wind = f.current.wind_mph;\n var deltaTime= f.current.last_updated_epoch;\n \n var cityValues=[tempAve, humidity, wind, deltaTime];\n \n ///Changes City values when forecast is made\n changeCityValues(city, cityValues);\n \n ////Updates for Forecast below Table\n var timeString=f.forecast.forecastday[1].hour[8].time;\n var day=timeString.substring(0,timeString.length-6);\n var milTime=timeString.substring(timeString.length-6,timeString.length);\n\n var foreCastDay1=\"The forecast for tomorrow \" + day + \" at\" + milTime +\" is:\"; \n\n var foreCastDay2=\"It will be \" + f.forecast.forecastday[1].hour[8].condition.text + \". The temperature will be: \" + f.forecast.forecastday[1].hour[8].temp_f + \" f\";\n\n var foreCastDay3=\"The wind will be: \" + f.forecast.forecastday[1].hour[8].wind_mph + \" mph. In the direction of: \" + f.forecast.forecastday[1].hour[8].wind_dir;\n\n var foreCastDay4=\"The pressure will be: \" + f.forecast.forecastday[1].hour[8].pressure_in + \" in., The precipitation will be: \" + f.forecast.forecastday[1].hour[8].precip_in + \" in., And the humidity will be: \" + f.forecast.forecastday[1].hour[8].humidity + \"%\";\n\n var foreCastDay5=((f.forecast.forecastday[1].hour[8].will_it_rain == 0) ? \"No expected rain. \" : \"It will rain. \") + ((f.forecast.forecastday[1].hour[8].will_it_snow == 0) ? \"No expected snow. \" : \" It will snow.\") + \" The cloud percentage will be: \" + f.forecast.forecastday[1].hour[8].cloud + \"%\";\n\n var foreCastDay6=\"The temperature will feel like: \" + f.forecast.forecastday[1].hour[8].feelslike_f + \" f, With a windchill of: \" + f.forecast.forecastday[1].hour[8].windchill_f + \" f, With a heatindex of: \" + f.forecast.forecastday[1].hour[8].heatindex_f + \" f, and a dewpoint of \" + f.forecast.forecastday[1].hour[8].dewpoint_f + \" f.\";\n\n var timeString2=f.forecast.forecastday[1].hour[20].time;\n var day2=timeString2.substring(0,timeString2.length-6);\n var milTime2=timeString2.substring(timeString2.length-6,timeString2.length);\n\n var foreCastNight1=\"The forecast for tomorrow \" + day2 + \" at\" + milTime2 +\" is:\"; \n\n var foreCastNight2=\"It will be \" + f.forecast.forecastday[1].hour[20].condition.text + \". The temperature will be: \" + f.forecast.forecastday[1].hour[20].temp_f + \" f\";\n\n var foreCastNight3=\"The wind will be: \" + f.forecast.forecastday[1].hour[20].wind_mph + \" mph. In the direction of: \" + f.forecast.forecastday[1].hour[20].wind_dir;\n\n var foreCastNight4=\"The pressure will be: \" + f.forecast.forecastday[1].hour[20].pressure_in + \" in., The precipitation will be: \" + f.forecast.forecastday[1].hour[20].precip_in + \" in., And the humidity will be: \" + f.forecast.forecastday[1].hour[20].humidity + \"%\";\n\n var foreCastNight5=((f.forecast.forecastday[1].hour[8].will_it_rain == 0) ? \"No expected rain. \" : \"It will rain. \") + ((f.forecast.forecastday[1].hour[8].will_it_snow == 0) ? \"No expected snow. \" : \"It will snow.\") + \" The cloud percentage will be: \" + f.forecast.forecastday[1].hour[8].cloud + \"%\";\n\n var foreCastNight6=\"The temperature will feel like: \" + f.forecast.forecastday[1].hour[20].feelslike_f + \" f, With a windchill of: \" + f.forecast.forecastday[1].hour[20].windchill_f + \" f, With a heatindex of: \" + f.forecast.forecastday[1].hour[20].heatindex_f + \" f, and a dewpoint of \" + f.forecast.forecastday[1].hour[20].dewpoint_f + \" f.\";\n\n\n var dayArray = [foreCastDay1, foreCastDay2, foreCastDay3, foreCastDay4, foreCastDay5, foreCastDay6, foreCastNight1, foreCastNight2, foreCastNight3, foreCastNight4, foreCastNight5, foreCastNight6];\n\n var foreCastText=\"<h3>Day Time Forecast for \" + city + \" is: </h3>\"; \n\n for(var i=0; i < dayArray.length; i++){\n if(i==6){\n foreCastText=foreCastText.concat(\"<br><h3>Night Time Forecast for \" + city + \" is: </h3>\");\n }\n foreCastText=foreCastText.concat(\"<p>\" + dayArray[i] + \"</p>\");\n }\n \n document.getElementById(\"foreCastText\").innerHTML = foreCastText + \"<br>\";\n \n ////Gathers data for the Chart\n var hourlyTempValues=[];\n \n for(var i=0; i < 24; i++){\n hourlyTempValues.push([i,f.forecast.forecastday[1].hour[i].temp_f]);\n }\n \n return hourlyTempValues;\n}", "title": "" }, { "docid": "a2cefd359f445697c1b2aabc4be44b98", "score": "0.4264814", "text": "function handleFoodQueryResult(data) {\n var data = JSON.parse(data);\n\n // Clear prior information\n $('.restaurant-list-container').empty();\n $.each(data, function(r, rData) {\n\n // API sometimes returns no data for the day\n if (rData.menus.length > 0) {\n var today = new Date();\n var i = today.getDay(); // getDay() returns the day of the week (from Sunday 0 to Monday 6) for the specified date\n i = i == 0 ? 6 : i-1; // Convert Sunday to 6 and other dates to correct indices\n\n var rContainer = '<div class=\"restaurant-container-' + r + ' grid-item grid-restaurant\"\"></div>';\n var rHeader = '<div class=\"restaurant-header-' + r + '\"><h2>' + r + '</h2></div>';\n var rBody = '<div class=\"restaurant-body-' + r + '\"></div>';\n var hoursOpen = '<span class=\"bold r-hours-open\">' + rData.openingHours[i] + '</span>';\n\n $('.restaurant-list-container').append(rContainer);\n $('.restaurant-container-' + r).append(rHeader)\n .append(rBody);\n $('.restaurant-header-' + r).append(hoursOpen);\n\n // Array to hold unique courseGroupNames\n var arr = [];\n\n $.each(rData.menus['0'].courses, function(key, value) {\n /**\n * Do some string manipulation to extract the menu items group\n * example title field in the JSON: 'KASVISLOUNAS: Kasvisnuudeleita'\n * we wish to extract the 'KASVISLOUNAS' part from this string and store\n * it in an array.\n */\n var courseGroupName = value.title.substr(0, value.title.indexOf(':'));\n arr.push(courseGroupName);\n });\n // Get unique courseGroupNames\n var courseGroupNames = unique(arr);\n console.log(courseGroupNames)\n\n // Append courseGroupName to restaurant-body\n $.each(courseGroupNames, function(index, name) {\n // Generate a positive integer hash from the groupname\n var courseGroup = '<div class=\"courselist-coursegroup-' + name.toLowerCase().hashCodePositive() + '\" ><p>' + capitalizeFirstLetter(name) + '</p></div>';\n console.log(name)\n if(!(EXCLUDED_COURSE_GROUPNAMES.indexOf(name) >= 0)) {\n $('.restaurant-body-' + r).append(courseGroup);\n }\n });\n\n // Append courseText to corresponding group\n $.each(rData.menus['0'].courses, function(key, value) {\n var courseGroupName = value.title.substr(0, value.title.indexOf(':'));\n var courseText = value.title.substr(value.title.indexOf(':') + 1, value.title.length);\n var courseGroupText = '<span>' + courseText + '</span>';\n\n /**\n * Again generate the hash but this time match to the class\n * created above and append the corresponding courseText\n */\n if(!(EXCLUDED_COURSE_GROUPNAMES.indexOf(courseGroupName) >= 0)) {\n $('.courselist-coursegroup-' + courseGroupName.toLowerCase().hashCodePositive()).append(courseGroupText);\n }\n });\n }\n });\n }", "title": "" }, { "docid": "16d97e26f32e5e1b5e26f914d723cb7f", "score": "0.4264486", "text": "function getChartData(day_num) {\r\n\t/*jshint validthis: true*/\r\n\r\n\tvar self = this;\r\n\t\r\n\tvar day_forecast = self.forecast_model.getDayForecast(day_num);\r\n\r\n\tvar processLastDay = function() {\r\n\r\n\t\t// When Sunday get Saturday\r\n\t\tvar prev_day_num = day_num === 0 ? 6 : day_num - 1;\r\n\t\tvar prev_day_forecast = self.forecast_model.getDayForecast(prev_day_num);\r\n\t\t\r\n\t\t//Adding previous day latest data as current days earliest data\r\n\t\tfor (var i = 0; i < missing_hours; i++) {\r\n\t\t\tday_forecast.unshift(prev_day_forecast.pop());\r\n\t\t}\r\n\t};\r\n\r\n\tvar processFirstDay = function() {\r\n\t\tvar next_day_num = (day_num + 1) % 7;\r\n\t\tvar next_day_forecast = self.forecast_model.getDayForecast(next_day_num);\r\n\r\n\t\t//Adding next day earlient data as current days latest\r\n\t\tfor (var i = 0; i < missing_hours ; i++) {\r\n\t\t\tday_forecast.push(next_day_forecast.shift());\r\n\t\t}\r\n\t};\r\n\t\r\n\tif (day_forecast.length < 8) {\r\n\r\n\t\tvar missing_hours = 8 - day_forecast.length;\r\n\t\tif (self.forecast_model.isLastDay(day_num)) {\r\n\t\t\tprocessLastDay();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tprocessFirstDay();\r\n\t\t}\r\n\t}\r\n\r\n\tself.day_forecast = day_forecast;\r\n\r\n\treturn day_forecast;\r\n}", "title": "" }, { "docid": "4e9433ffd1ce25bd907cd262999c3739", "score": "0.42622086", "text": "function updateHeatMap() {\n if (mapControls.heatMap && mapControls.heatMap.getMap()) {\n\n let latLng = mapControls.visibleMarkers.map(m => {\n return m.position;\n });\n mapControls.heatMap.setData(latLng);\n }\n }", "title": "" }, { "docid": "c610a6464a62a80c8053d0c0fa14cb9e", "score": "0.42587504", "text": "function populate() {\n\t\tclearMap();\n\t\tsetMarkers();\n\n\t\t// clear the venues that have been searched\n\t\t$(\"#venues\").html(\"\");\n\n\t\tvar first = document.createElement(\"tr\");\n\t\tvar second = document.createElement(\"td\");\n\t\tsecond.innerHTML = \"name\";\n\t\t$(first).append(second);\n\t\t$(\"#venues\").append(first);\n\n\t\tfor(var i = 0; i < places.length; i++) {\n\t\t\tvar tr = document.createElement(\"tr\");\n\t\t\tvar td = document.createElement(\"td\");\n\t\t\ttd.className = \"data-on-store\";\n\t\t\ttd.innerHTML = places[i].name;\n\n\t\t\t// GET DATA ON PLACE THAT IS HOVERED OVER\n\t\t\t$(td).mouseover(function() {\t\n\t\t\t\tcallback_type = \"ID\";\t\t\n\t\t\t\tvar target = places[findVenue($(this).html())];\t\t\t\t\n\t\t\t\tservices.getDetails({placeId: target.place_id}, callback);\t\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$(\"#store-data\").html(fillInformation(target));\n\t\t\t\t}, 1000);\n\t\t\t});\n\t\t\t$(tr).append(td);\n\t\t\t$(\"#venues\").append(tr);\n\t\t}\n\t}", "title": "" } ]
bbe677c290ad3446058e28b39d0705a7
Generate parameters to create a standard animation
[ { "docid": "a3bb63fc1d67f7b5fee0eb8e9b3f6c47", "score": "0.0", "text": "function genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4 ; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}", "title": "" } ]
[ { "docid": "39dea0d8ab012e75104d8d02eb3a6f29", "score": "0.65055543", "text": "get fluidAnimationParams() {\n let degs = this.getAllAngles();\n const stages = degs.map((deg, i) => {\n return this.getAllFluidShapeByRad(\n deg,\n this.fluidMaxLevel - i\n ).map((shape) => parseInt(shape.fluidHeight));\n });\n degs = degs.map((rad) => parseInt(this.radToDeg(rad)));\n degs.push(90);\n degs.unshift(0);\n let stageLast = [...stages[0]].map((height) => 0);\n let stage0 = [...stages[0]].map((height) => this.fluidHeight);\n stages.push(stageLast);\n stages.unshift(stage0);\n return { degs: degs, stages: stages };\n }", "title": "" }, { "docid": "d763684dd4cd593247fd607a0c0ece66", "score": "0.6344317", "text": "update_parameters(segmento) {\n\n // Test if the animation is done or not\n if (this.animationDone == false) {\n\n // Updates the parameters for the translation\n let tx0 = segmento.keyframe_anterior.translate_vec[0]\n let ty0 = segmento.keyframe_anterior.translate_vec[1]\n let tz0 = segmento.keyframe_anterior.translate_vec[2]\n\n let tx1 = segmento.keyframe_posterior.translate_vec[0]\n let ty1 = segmento.keyframe_posterior.translate_vec[1]\n let tz1 = segmento.keyframe_posterior.translate_vec[2]\n\n let txfinal = tx1 - tx0\n let tyfinal = ty1 - ty0\n let tzfinal = tz1 - tz0\n\n // Updates the parameters for the rotation\n let rx0 = segmento.keyframe_anterior.rotate_vec[0]\n let ry0 = segmento.keyframe_anterior.rotate_vec[1]\n let rz0 = segmento.keyframe_anterior.rotate_vec[2]\n\n let rx1 = segmento.keyframe_posterior.rotate_vec[0]\n let ry1 = segmento.keyframe_posterior.rotate_vec[1]\n let rz1 = segmento.keyframe_posterior.rotate_vec[2]\n\n let rxfinal = rx1 - rx0\n let ryfinal = ry1 - ry0\n let rzfinal = rz1 - rz0\n\n // Updates the parameters for the escalation\n let sx = Math.pow((segmento.keyframe_posterior.scale_vec[0] / segmento.keyframe_anterior.scale_vec[0]), 1 / segmento.duracao)\n let sy = Math.pow((segmento.keyframe_posterior.scale_vec[1] / segmento.keyframe_anterior.scale_vec[1]), 1 / segmento.duracao)\n let sz = Math.pow((segmento.keyframe_posterior.scale_vec[2] / segmento.keyframe_anterior.scale_vec[2]), 1 / segmento.duracao)\n\n this.translate_parameters = [txfinal, tyfinal, tzfinal]\n this.rotate_parameters = [rxfinal, ryfinal, rzfinal]\n\n this.scaleParameters = [sx, sy, sz]\n }\n }", "title": "" }, { "docid": "1596170354c0bd25b2c2d2188d57d061", "score": "0.6266624", "text": "function init_animation(p_start,p_end,t_length){\n p0 = p_start;\n p1 = p_end;\n time_length = t_length;\n time_start = clock.getElapsedTime();\n time_end = time_start + time_length;\n animate = true; // flag for animation\n return;\n}", "title": "" }, { "docid": "72c987361a07d1eb279e39089b2f8368", "score": "0.6252222", "text": "function createAnimation(){\r\n\t\tvar key = oEffect.key.slice(0);\r\n\t\tif(key.length){\r\n\t\t\tkey.sort(function(a, b){\r\n\t\t\t\treturn a.frame - b.frame;\r\n\t\t\t});\r\n\t\t};\r\n\t\tvar totalF\t\t= key[key.length - 1].frame;\r\n\t\t\r\n\t\tif(totalF){\r\n\t\t\tvar s = '.sprite{animation-name: anim;animation-duration: '+Math.ceil(totalF /fps) +'s;}';\r\n\t\t\tvar style = '@keyframes anim {';\r\n\t\t\tfor (var i=0; i < key.length; i++) {\n\t\t\t var frame = key[i].frame,\r\n\t\t\t css\t\t= key[i].css,\r\n\t\t\t per\t\t= Math.round((frame/totalF)* 100);\r\n\t\t\t style\t\t= style+' '+per+'% {';\r\n\t\t\t \tfor (var prop in css) {\r\n\t\t\t\t\tstyle = style+ prop+':'+ css[prop]+';';\n\t\t\t\t };\n\t\t\t style\t\t= style + '}';\n\t\t\t};\r\n\t\t\t style\t\t= style + '}';\r\n\t\t\t\r\n\t\t\t$('.anim-style').empty().append('<style>'+s+' '+style+'</style>');\t\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "361a26967b15918730508cb47843a83b", "score": "0.6239411", "text": "_getAnimationText() {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }", "title": "" }, { "docid": "3ef559f3b33aef9240c6b8559caafc50", "score": "0.6204997", "text": "function SequenceBuilder(params) {\n var baseSequence = 'BaseSequence'; // I have to use a var or ESLint will be mad.\n\n this.timeline = defs.animations[baseSequence](params ? Object.assign({}, params) : {});\n }", "title": "" }, { "docid": "daaeaa84b58708ad030e547483008eea", "score": "0.617421", "text": "function init_animation(p_start,p_end,t_length){\n\tp0 = p_start;\n\tp1 = p_end;\n\ttime_length = t_length;\n\ttime_start = clock.getElapsedTime();\n\ttime_end = time_start + time_length;\n\tanimate = true; // flag for animation\n\treturn;\n}", "title": "" }, { "docid": "defd215eeb98e39d05463a975841e45d", "score": "0.6162655", "text": "function init_animation(p_start, p_end, t_length) {\n p0 = p_start;\n p1 = p_end;\n time_length = t_length;\n time_start = clock.getElapsedTime();\n time_end = time_start + time_length;\n animate = true; // flag for animation\n return;\n}", "title": "" }, { "docid": "a41ba54ccc95f2700a58b553119c2632", "score": "0.61548704", "text": "function AnimationStaggerMetadata(){}", "title": "" }, { "docid": "db31779e7f03216ef96e5cb67ae2eb0a", "score": "0.6112111", "text": "function AnimationStaggerMetadata() {}", "title": "" }, { "docid": "6513dc1622fdd85a044a399478fb567f", "score": "0.5981136", "text": "function setupAnimation(){\n animations[0] = getBasicPose();//pose the robot will start from\n sorted_keys = Object.keys(animations).sort(function(a,b){return a-b});\n start_time = Date.now();\n frameOneSeconds = sorted_keys[0];\n frameTwoSeconds = sorted_keys[1];\n isAnimating = true;\n counter = 2;\n}", "title": "" }, { "docid": "c685ba193963a1a00c8c849b1db74505", "score": "0.59733784", "text": "function build(){\n\n\t\t\t\tif ( parseInt( cfg.move ) !== 0 ){\n\t\t\t\t\tinitial += ' translate' + cfg.axis + '(' + cfg.move + ')';\n\t\t\t\t\ttarget += ' translate' + cfg.axis + '(0)';\n\t\t\t\t}\n\n\t\t\t\tif ( parseInt( cfg.scale.power ) !== 0 ){\n\n\t\t\t\t\tif ( cfg.scale.direction === 'up' ){\n\t\t\t\t\t\tcfg.scale.value = 1 - ( parseFloat( cfg.scale.power ) * 0.01 );\n\t\t\t\t\t} else if ( cfg.scale.direction === 'down' ){\n\t\t\t\t\t\tcfg.scale.value = 1 + ( parseFloat( cfg.scale.power ) * 0.01 );\n\t\t\t\t\t}\n\n\t\t\t\t\tinitial += ' scale(' + cfg.scale.value + ')';\n\t\t\t\t\ttarget += ' scale(1)';\n\t\t\t\t}\n\n\t\t\t\tif ( cfg.rotate.x ){\n\t\t\t\t\tinitial += ' rotateX(' + cfg.rotate.x + ')';\n\t\t\t\t\ttarget += ' rotateX(0)';\n\t\t\t\t}\n\n\t\t\t\tif ( cfg.rotate.y ){\n\t\t\t\t\tinitial += ' rotateY(' + cfg.rotate.y + ')';\n\t\t\t\t\ttarget += ' rotateY(0)';\n\t\t\t\t}\n\n\t\t\t\tif ( cfg.rotate.z ){\n\t\t\t\t\tinitial += ' rotateZ(' + cfg.rotate.z + ')';\n\t\t\t\t\ttarget += ' rotateZ(0)';\n\t\t\t\t}\n\n\t\t\t\tinitial += '; opacity: ' + cfg.opacity + '; ';\n\t\t\t\ttarget += '; opacity: 1; ';\n\t\t\t}", "title": "" }, { "docid": "b941385fc19dc770163572b326f75158", "score": "0.594838", "text": "function AnimationParser() {}", "title": "" }, { "docid": "f65309ed86c1ec965f63c8a616cf3b5b", "score": "0.5944353", "text": "function setupAnimVar() {\n animStage = stage;\n animTikis = tikis;\n animTikiWidth = tikiWidth;\n animTikiHeight = tikiHeight;\n}", "title": "" }, { "docid": "864866be3f88fa2373d3b0dcd667017a", "score": "0.59414375", "text": "style() {\n let string = `top: ${this.position[0]}px; left: ${\n this.position[1]\n }px; background-color: ${this.color}; width: ${this.size}px; height: ${\n this.size\n }px; ${\n this.blinking ? 'animation: blink 2s infinite ease-in-out' : ''\n }; animation-delay: ${random(0, 4)}s;`\n return string\n }", "title": "" }, { "docid": "056062740a42d710806afe7489a69411", "score": "0.5940393", "text": "function AnimationStaggerMetadata() { }", "title": "" }, { "docid": "056062740a42d710806afe7489a69411", "score": "0.5940393", "text": "function AnimationStaggerMetadata() { }", "title": "" }, { "docid": "056062740a42d710806afe7489a69411", "score": "0.5940393", "text": "function AnimationStaggerMetadata() { }", "title": "" }, { "docid": "056062740a42d710806afe7489a69411", "score": "0.5940393", "text": "function AnimationStaggerMetadata() { }", "title": "" }, { "docid": "056062740a42d710806afe7489a69411", "score": "0.5940393", "text": "function AnimationStaggerMetadata() { }", "title": "" }, { "docid": "6c7d1be21484a023e577d2da4212f97d", "score": "0.59229034", "text": "function animation_properties(distance) {\n var vectors = [0,0,0];\n if (options.threeD) {\n var delta = (-current_slide * alpha) - (revolution * 360) + (alpha * (distance/container_dimension()));\n vectors[options.vertical ? 0 : 1] = 1;\n return { translate3d: '0,0,'+ -radius + 'px', rotate3d: vectors.join(',') +','+ delta + 'deg' }\n } else {\n var position = -current_slide * (container_dimension() / options.visible_slides) + distance;\n vectors[options.vertical ? 1 : 0] = position + 'px';\n return { translate3d: vectors.join(',') }\n }\n }", "title": "" }, { "docid": "75deacc15982cbed940c74438c151796", "score": "0.59194833", "text": "function AnimationMetadata() {}", "title": "" }, { "docid": "75963980885fd16fa0677661fc68d26f", "score": "0.5902264", "text": "function animationConfig() {\n var config = {\n \"duration\": 2.0,\n \"iterationCount\": 1,\n \"delay\": 0,\n \"fillMode\": kony.anim.FILL_MODE_FORWARDS\n };\n return config;\n}", "title": "" }, { "docid": "8769cc2dae72cea08c0f3df3ef09b8ae", "score": "0.5891921", "text": "function initAnimation() {\n render();\n for(var i in points) {\n shiftPoint(points[i]);\n }\n }", "title": "" }, { "docid": "c0f880ce7c7510e94799de99d66d4da7", "score": "0.58775747", "text": "function AnimationMetadata(){}", "title": "" }, { "docid": "673ca39c95b9d24c3e02ae1b95f91f08", "score": "0.58385986", "text": "initAnimation() {\n // animation\n this.startQ = new QuaternionAngle(0, 0, 0, 0);\n this.interpolationPathLines = [];\n this.resetAnimation();\n }", "title": "" }, { "docid": "74efae570857359681d7491e0f479991", "score": "0.5832534", "text": "function AnimationSequenceMetadata(){}", "title": "" }, { "docid": "eb9d9de51d40f5b31efa8cb896920773", "score": "0.5822048", "text": "draw() {\n switch(this.animation.name) {\n\n case \"triangle\":\n generateTriangle(this.scene);\n break;\n case \"rectangle\":\n generateRectangle(this.scene);\n break;\n case \"cube\":\n generateCube(this.scene);\n break;\n case \"circle\":\n generateCircle(this.scene, 1, 5);\n break;\n case \"clam\":\n generateClam(this.scene, 200, 1);\n break;\n case \"pearl\":\n generatePearl(this.scene, 200, 1);\n break;\n case \"polystarter\":\n generatePolygon(this.scene);\n break;\n case \"sacred circles\":\n generateSacredCircles(this.scene, 16, 1, colorNodes(0));\n break;\n case \"star\":\n generateOffsetStar(this.scene, 10, 1, 2, colorNodes(0));\n break;\n case \"collide\":\n generateCollide0scope(this.scene, 20);\n break;\n case \"gyro\":\n generateGyr0scope(this.scene, 20);\n break;\n case \"sine wave\":\n generateSineWave(this.scene, 1500);\n break;\n case \"concentric polygons\":\n generateConcentricPolygons(this.scene, 10, 5);\n break;\n case \"concentric polygons 2\":\n generateConcentricPolygons2(this.scene, 20, 5);\n break;\n case \"blanket\":\n generateBlanket(this.scene, 10, 4);\n break;\n case \"bounce ripple\":\n generateBounceRipple(this.scene, 10, 3);\n break;\n case \"slosh ripple\":\n generateSloshRipple(this.scene, 200, 3);\n break;\n case \"wriggling donut\":\n generateWrigglingDonut(this.scene, 40, 20, 1);\n break;\n default:\n alert(\"Please enter a valid animation\");\n return;\n break;\n\n }\n }", "title": "" }, { "docid": "3b1542a901eb7765fa009d7f0649f320", "score": "0.5820797", "text": "function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return fxNow=jQuery.now();}// Generate parameters to create a standard animation", "title": "" }, { "docid": "3b1542a901eb7765fa009d7f0649f320", "score": "0.5820797", "text": "function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return fxNow=jQuery.now();}// Generate parameters to create a standard animation", "title": "" }, { "docid": "bfd6267e1dc3e02e5d48dcde1170fad8", "score": "0.5813165", "text": "function AnimationSequenceMetadata() {}", "title": "" }, { "docid": "b5234777dd868956b374989b1642497d", "score": "0.58055073", "text": "function colorAnimationGenerator(args) {\n let from = args[0];\n let to = args[1];\n let time = args[2];\n let scope = int(time * 0.05);\n let array = [];\n let timeouts = [];\n for (let i = 0; i < scope; i++) {\n array.push(lerpColor(from, to, (i + 1) / scope));\n timeouts.push(scope);\n }\n return {\n array: array,\n timeouts: timeouts\n };\n}", "title": "" }, { "docid": "86b91fcde547ae4345082062b21f251a", "score": "0.58038753", "text": "constructor() {\n //random x position\n this.x = (Math.random() - 0.5) * width;\n //random y position\n this.y = (Math.random() - 0.5) * height;\n //random z position\n this.z = Math.random() * width;\n //size in 3D world\n this.radius = 10;\n\n //2D x coordinate\n this.xProjected = 0;\n //2D y coordinate\n this.yProjected = 0;\n //scale element in 2D(further=smaller)\n this.scaleProjected = 0;\n //3rd Party Plugin for Animation\n gsap.to(this, (Math.random() * 10 + 15), {\n z: width,\n //number of repeats (-1 for infinite)\n repeat: -1,\n //if true > A-B-B-A, if false > A-B-A-B\n yoyo: true,\n ease: \"power2\",\n //or ease like \"power2\"\n yoyoEase: true,\n //random delay time\n delay: Math.random() * -25\n });\n }", "title": "" }, { "docid": "923f713616dc2fcbd00606087cd0d2bf", "score": "0.57759327", "text": "startAnimation(t){\n \tthis.doGenerate();\n \tthis.depth = 0;\n \tthis.time = t; //stores the time at which the animation started\n }", "title": "" }, { "docid": "c4a4f8a93b216b4917ecb0653068dd28", "score": "0.5756548", "text": "function AnimationAnimateMetadata(){}", "title": "" }, { "docid": "4336f83705788d8579608c6677cbea13", "score": "0.5744776", "text": "function AnimationMetadata() { }", "title": "" }, { "docid": "4336f83705788d8579608c6677cbea13", "score": "0.5744776", "text": "function AnimationMetadata() { }", "title": "" }, { "docid": "4336f83705788d8579608c6677cbea13", "score": "0.5744776", "text": "function AnimationMetadata() { }", "title": "" }, { "docid": "4336f83705788d8579608c6677cbea13", "score": "0.5744776", "text": "function AnimationMetadata() { }", "title": "" }, { "docid": "4336f83705788d8579608c6677cbea13", "score": "0.5744776", "text": "function AnimationMetadata() { }", "title": "" }, { "docid": "43a94c558c65e6e37f30f034d318f14a", "score": "0.573408", "text": "function AnimationAnimateMetadata() {}", "title": "" }, { "docid": "e368483d65e4d10f3accf48dcfedce3f", "score": "0.5722966", "text": "constructor() {\n\n this.background = [244, 244, 244];\n this.Color_Indcator_S = [255, 100, 150];\n this.Color_Indcator_M = [150, 100, 255];\n this.Color_Indcator_H = [0, 153, 153];\n this.Transparency_S = this.background;\n this.Transparency_M = this.background;\n this.Transparency_H = this.background;\n this.text_color = [0, 0, 102];\n this.color_theta = this.background;\n this.text = \"to show the angles change rate\";\n }", "title": "" }, { "docid": "986b251583f4bcd6a483a7f2de79e907", "score": "0.5705808", "text": "constructor() {\n\n this.background = [244, 244, 244];\n this.Color_Indcator_S = [255, 100, 150];\n this.Color_Indcator_M = [150, 100, 255];\n this.Color_Indcator_H = [0, 153, 153];\n this.Transparency_S = [255, 255, 255];\n this.Transparency_M = [255, 255, 255];\n this.Transparency_H = [255, 255, 255];\n this.text_color = [0, 0, 102];\n this.color_theta = this.background;\n this.text = \"to show the angles change rate\";\n }", "title": "" }, { "docid": "d994f2c6240fb9a00ee8daf071f24308", "score": "0.56677496", "text": "function createParticle(i) {\r\n\tthis.id = i;\r\n\tthis.width = rand(1, 20) + 'px';\r\n\tthis.height = this.width;\r\n\tthis.x = rand(10, 90) + '%';\r\n\tthis.delay = rand(1, 60) + 's';\r\n\tthis.duration = rand(10, 60) + 's';\r\n\tthis.html = '<span style=\" width: ' + this.width + '; height: ' + this.height + '; left: ' + this.x + '; animation-delay: ' + this.duration + '; animation-duration: ' + this.duration + '; \"></span>';\r\n}", "title": "" }, { "docid": "bf1c80e77123537af7ea9d6d299293d6", "score": "0.56673366", "text": "setup_animations(scene){\n scene.anims.create({\n key: 'idle',\n frames: scene.anims.generateFrameNumbers('player', {start:0,end:1}),\n frameRate: 3\n });\n scene.anims.create({\n key: 'down',\n frames: scene.anims.generateFrameNumbers('player', {start:2,end:3}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'up',\n frames: scene.anims.generateFrameNumbers('player', {start:4,end:5}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'right',\n frames: scene.anims.generateFrameNumbers('player', {start:6,end:7}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'left',\n frames: scene.anims.generateFrameNumbers('player', {start:8,end:9}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'idleSword',\n frames: scene.anims.generateFrameNumbers('player', {start:10,end:11}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'downSword',\n frames: scene.anims.generateFrameNumbers('player', {start:12,end:13}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'upSword',\n frames: scene.anims.generateFrameNumbers('player', {start:14,end:15}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'rightSword',\n frames: scene.anims.generateFrameNumbers('player', {start:16,end:17}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'leftSword',\n frames: scene.anims.generateFrameNumbers('player', {start:18,end:19}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'idleAxe',\n frames: scene.anims.generateFrameNumbers('player', {start:20,end:21}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'downAxe',\n frames: scene.anims.generateFrameNumbers('player', {start:22,end:23}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'upAxe',\n frames: scene.anims.generateFrameNumbers('player', {start:24,end:25}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'rightAxe',\n frames: scene.anims.generateFrameNumbers('player', {start:26,end:27}),\n frameRate: 6\n });\n scene.anims.create({\n key: 'leftAxe',\n frames: scene.anims.generateFrameNumbers('player', {start:28,end:29}),\n frameRate: 6\n });\n }", "title": "" }, { "docid": "effafd1d8368ae200cbbece420db4579", "score": "0.5659812", "text": "_initialise_animations() {\n this.game.anims.create({\n key: 'down',\n frames: game.anims.generateFrameNumbers('assets', { start: 0, end: 3 }),\n frameRate: 8,\n repeat: -1\n });\n this.game.anims.create({\n key: 'downStop',\n frames: [ { key: 'assets', frame: 0 } ],\n frameRate: 8\n });\n this.game.anims.create({\n key: 'right',\n frames: game.anims.generateFrameNumbers('assets', { start: 4, end: 7 }),\n frameRate: 8,\n repeat: -1\n });\n this.game.anims.create({\n key: 'rightStop',\n frames: [ { key: 'assets', frame: 4 } ],\n frameRate: 8\n });\n this.game.anims.create({\n key: 'up',\n frames: game.anims.generateFrameNumbers('assets', { start: 9, end: 12 }),\n frameRate: 8,\n repeat: -1\n });\n this.game.anims.create({\n key: 'upStop',\n frames: [ { key: 'assets', frame: 9 } ],\n frameRate: 8\n });\n this.game.anims.create({\n key: 'left',\n frames: game.anims.generateFrameNumbers('assets', { start: 13, end: 16 }),\n frameRate: 8,\n repeat: -1\n });\n this.game.anims.create({\n key: 'leftStop',\n frames: [ { key: 'assets', frame: 13 } ],\n frameRate: 8\n });\n }", "title": "" }, { "docid": "34dd70babc95e40687e8cf3694a1fc7d", "score": "0.56417084", "text": "function AnimationSequenceMetadata() { }", "title": "" }, { "docid": "34dd70babc95e40687e8cf3694a1fc7d", "score": "0.56417084", "text": "function AnimationSequenceMetadata() { }", "title": "" }, { "docid": "34dd70babc95e40687e8cf3694a1fc7d", "score": "0.56417084", "text": "function AnimationSequenceMetadata() { }", "title": "" }, { "docid": "34dd70babc95e40687e8cf3694a1fc7d", "score": "0.56417084", "text": "function AnimationSequenceMetadata() { }", "title": "" }, { "docid": "34dd70babc95e40687e8cf3694a1fc7d", "score": "0.56417084", "text": "function AnimationSequenceMetadata() { }", "title": "" }, { "docid": "63ae53ea79a01b0f7f0cf4d358a008cb", "score": "0.5640979", "text": "createAnimations() {\n\n //spriteSheet, startX, startY, frameWidth, frameHeight, frameDuration, frames, loop, reverse\n this.idleAnimationDown = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.5, 1, true, false);\n this.idleAnimationUp = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.5, 1, true, false);\n this.idleAnimationRight = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.5, 1, true, false);\n this.idleAnimationLeft = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.5, 1, true, false);\n\n this.walkAnimationUp = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.175, 3, true, false);\n this.walkAnimationDown = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.175, 3, true, false);\n this.walkAnimationDownAgro = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.175, 3, true, false);\n this.walkAnimationLeft = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.175, 3, true, false);\n this.walkAnimationLeftAgro = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.175, 3, true, false);\n this.walkAnimationRight = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.175, 3, true, false);\n this.walkAnimationRightAgro = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1280, 64, 64, 0.175, 3, true, false);\n\n this.attackAnimationDown = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 384, 64, 64, 0.15, 8, true, false);\n this.attackAnimationUp = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 256, 64, 64, 0.15, 6, true, false);\n this.attackAnimationLeft = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 512, 64, 64, 0.15, 8, true, false);\n this.attackAnimationRight = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 640, 64, 64, 0.15, 8, true, false);\n\n this.emergeAnimationDown = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 128, 64, 64, 0.1, 7, false, false);\n this.retractAnimationDown = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1152, 64, 64, 0.2, 7, false, false);\n this.emergeAnimationUp = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 0, 64, 64, 0.1, 7, false, false);\n this.retractAnimationUp = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 1024, 64, 64, 0.2, 7, false, false);\n\n this.deathAnimationDown = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 896, 64, 64, 0.2, 7, false, false);\n this.deathAnimationUp = new Animation(ASSET_MANAGER.getAsset(\"../img/Crypt_Worm_SpriteSheet.png\"), 0, 768, 64, 64, 0.2, 7, false, false);\n }", "title": "" }, { "docid": "24d4a6a97334f0c6cdef9b34d6b64f81", "score": "0.5636643", "text": "function getAnimationDefinitionValues(animation) {\r\n\t\r\n\tanimation = animation.substr(1, animation.length -2);\r\n\tvar animation_parameters = animation.split(\",\");\t\t\r\n\treturn { \r\n\t\t \"cssProperty\": animation_parameters[0], \r\n\t\t \"percentageValue\": parseInt(animation_parameters[1]), \r\n\t\t \"startInstant\" : parseInt(animation_parameters[2]), \r\n\t\t \"endInstant\" : parseInt(animation_parameters[3]),\r\n\t\t \"reference\" : animation_parameters[4]\r\n\t}; \r\n\t\r\n}", "title": "" }, { "docid": "9b07407fcee0d89f33b071e0dfa434f6", "score": "0.5626506", "text": "function loadAnimation() {\r\n background(theme === 2 ? 0 : 255);\r\n fill(theme === 2 ? 255 : 0);\r\n push();\r\n translate(width / 2, height / 2);\r\n ellipse(0, map(sin(frameCount / 10 % TWO_PI), -1, 1, 100, -100), 50);\r\n textSize(32);\r\n text(\"Prepare to be amazed\", -150, 180);\r\n}", "title": "" }, { "docid": "bc951922ba2fd19cdccaef81dfd13381", "score": "0.5624172", "text": "constructor() {\n ////////////////////////////////////\n // Check jQuery\n if (typeof $ !== \"function\") {\n console.error(\"[LoadingAnimation] Error: jQuery is required.\");\n return;\n }\n\n ////////////////////////////////////\n // Variables, do not change this by hand. As long as you dont want to chane the animation\n this.is_initialized = false;\n this.play_animation = false;\n this.element = undefined;\n this.size_default = undefined;\n this.mode = undefined;\n this.handle = undefined;\n this.ctx = undefined;\n this.size = undefined;\n\n this.STAGES = {\n FIRST_SQUARE: 0,\n SECOND_SQUARE: 1\n };\n this.timer = {\n counter: 0,\n stage: this.STAGES.FIRST_SQUARE\n };\n this.SQUARES = [\n [\n [-0.48, 0.0],\n [0.0, 0.48],\n [0.48, 0.0],\n [0.0, -0.48]\n ],\n [\n [-0.24, 0.24],\n [0.24, 0.24],\n [0.24, -0.24],\n [-0.24, -0.24]\n ]\n ];\n }", "title": "" }, { "docid": "5faef3c0f6017701cc55203b1fb007ed", "score": "0.5616495", "text": "constructor() {\n /**\n * True when an animation is in effect\n * @type {boolean}\n */\n this._transitioning = false;\n /**\n * The name of the beginning animation\n * @type {string}\n */\n this._begin = null;\n /**\n * The name of the ending animation\n * @type {string}\n */\n this._end = null;\n }", "title": "" }, { "docid": "45351bf9a511c1ae15808591da64597f", "score": "0.56096154", "text": "function AnimationStyleMetadata(){}", "title": "" }, { "docid": "689326d9e9e024ee68d2e4204b35343b", "score": "0.56021315", "text": "function AnimationAnimateMetadata() { }", "title": "" }, { "docid": "689326d9e9e024ee68d2e4204b35343b", "score": "0.56021315", "text": "function AnimationAnimateMetadata() { }", "title": "" }, { "docid": "689326d9e9e024ee68d2e4204b35343b", "score": "0.56021315", "text": "function AnimationAnimateMetadata() { }", "title": "" }, { "docid": "689326d9e9e024ee68d2e4204b35343b", "score": "0.56021315", "text": "function AnimationAnimateMetadata() { }", "title": "" }, { "docid": "689326d9e9e024ee68d2e4204b35343b", "score": "0.56021315", "text": "function AnimationAnimateMetadata() { }", "title": "" }, { "docid": "9b532f708b95e358a0d423973c5a18ab", "score": "0.559741", "text": "function AnimationKeyframesSequenceMetadata(){}", "title": "" }, { "docid": "e3e806554120aa24b38f20943945fbaf", "score": "0.5594625", "text": "createAnimations() {\n var scene = this.scene;\n\n // Create the animatino\n scene.anims.create({\n key: 'skeleton-run',\n frames: scene.anims.generateFrameNumbers('skeleton', {\n start: 0,\n end: 3\n }),\n frameRate: 10,\n repeat: -1\n });\n }", "title": "" }, { "docid": "8d39ed2306d425d296ed92eef5f1d92b", "score": "0.55929255", "text": "function initAnimation() {\n TweenLite.set(\"#features-animation h1\", {autoAlpha:1, text:headlines[0]});\n TweenLite.set(\"#features-animation h2\", {autoAlpha:1, text:subheadlines[0]});\n TweenLite.set($(\"#features-animation .hypervisor.one .devices\").children(), {autoAlpha:0});\n TweenLite.set($(\"#features-animation .hypervisor.two .devices\").children(), {autoAlpha:0});\n TweenLite.set(\"#features-animation .hypervisor.one\", {autoAlpha:1});\n TweenLite.set(\"#features-animation .hypervisor.two\", {autoAlpha:1});\n TweenLite.set(\"#features-animation .db\", {autoAlpha:1});\n}", "title": "" }, { "docid": "8881566f6b5ba52321610c330a594214", "score": "0.5580846", "text": "function genFx(type,includeWidth){var which,attrs={height:type},i=0; // if we include width, step value is 1 to do all cssExpand values,\n// if we don't include width, step value is 2 to skip over Left and Right\nincludeWidth = includeWidth?1:0;for(;i < 4;i += 2 - includeWidth) {which = cssExpand[i];attrs[\"margin\" + which] = attrs[\"padding\" + which] = type;}if(includeWidth){attrs.opacity = attrs.width = type;}return attrs;} // Generate shortcuts for custom animations", "title": "" }, { "docid": "c8d3ba1ca0ba57aee4d134b0ea3c420b", "score": "0.5578224", "text": "function genFx(type,includeWidth){var which,attrs={height:type},i=0;// if we include width, step value is 1 to do all cssExpand values,\n\t// if we don't include width, step value is 2 to skip over Left and Right\n\tincludeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs[\"margin\"+which]=attrs[\"padding\"+which]=type;}if(includeWidth){attrs.opacity=attrs.width=type;}return attrs;}// Generate shortcuts for custom animations", "title": "" }, { "docid": "49ab98a113c3ae0991c2e0237faf81bb", "score": "0.55776024", "text": "static renderAnimation() {\n let that = this;\n this.allMarkAni.forEach(function (value, markId) {\n //record the end time of the entire animation, and record the init status of each mark\n if (that.wholeEndTime < value.startTime + value.totalDuration) {\n that.wholeEndTime = value.startTime + value.totalDuration;\n }\n\n //categorize the actions according to the attribute name in order to insert place holder actions\n let maskActionByAttr = new Map(), markActionByAttr = new Map();\n for (let i = 0, item; i < value.actionAttrs.length | (item = value.actionAttrs[i]); i++) {\n if (item.type === ActionSpec.actionTargets.mark) {\n if (typeof markActionByAttr.get(item.attribute.attrName) === 'undefined') {\n markActionByAttr.set(item.attribute.attrName, [item]);\n } else {\n markActionByAttr.get(item.attribute.attrName).push(item);\n }\n } else if (item.type === ActionSpec.actionTargets.mask) {\n if (typeof maskActionByAttr.get(item.attribute.attrName) === 'undefined') {\n maskActionByAttr.set(item.attribute.attrName, [item]);\n } else {\n maskActionByAttr.get(item.attribute.attrName).push(item);\n }\n } else {\n console.log('we have some action with no type !!!!!');\n }\n }\n\n //add extra action to fill the timeline for both mark and mask\n maskActionByAttr.forEach(function (actionList, attrName) {\n //put an start action\n let tmpAction0 = new ActionSpec();\n tmpAction0.type = ActionSpec.actionTargets.mask;\n tmpAction0.chartIdx = actionList[0].chartIdx;\n tmpAction0.animationType = actionList[0].animationType;\n tmpAction0.startTime = 0;\n tmpAction0.duration = actionList[0].startTime;\n tmpAction0.attribute = {\n 'attrName': actionList[0].attribute.attrName,\n 'from': actionList[0].attribute.from,\n 'to': actionList[0].attribute.from\n }\n value.actionAttrs.push(tmpAction0);\n for (let i = 0; i < actionList.length; i++) {\n let tmpAction = new ActionSpec();\n tmpAction.type = ActionSpec.actionTargets.mask;\n tmpAction.chartIdx = actionList[i].chartIdx;\n tmpAction.animationType = actionList[i].animationType;\n tmpAction.startTime = actionList[i].startTime + actionList[i].duration;\n if (i === actionList.length - 1) {\n tmpAction.duration = 'wholeEnd';\n } else {\n tmpAction.duration = actionList[i + 1].startTime - actionList[i].startTime - actionList[i].duration;\n }\n\n tmpAction.attribute = {\n 'attrName': actionList[i].attribute.attrName,\n 'from': actionList[i].attribute.to,\n 'to': actionList[i].attribute.to\n }\n value.actionAttrs.push(tmpAction);\n }\n })\n markActionByAttr.forEach(function (actionList, attrName) {\n //put an start action\n let tmpAction0 = new ActionSpec();\n tmpAction0.type = ActionSpec.actionTargets.mark;\n tmpAction0.animationType = actionList[0].animationType;\n tmpAction0.startTime = 0;\n tmpAction0.duration = actionList[0].startTime;\n tmpAction0.attribute = {\n 'attrName': actionList[0].attribute.attrName,\n 'from': actionList[0].attribute.from,\n 'to': actionList[0].attribute.from\n }\n value.actionAttrs.push(tmpAction0);\n for (let i = 0; i < actionList.length; i++) {\n let tmpAction = new ActionSpec();\n tmpAction.type = ActionSpec.actionTargets.mark;\n tmpAction.animationType = actionList[i].animationType;\n tmpAction.startTime = actionList[i].startTime + actionList[i].duration;\n if (i === actionList.length - 1) {\n tmpAction.duration = 'wholeEnd';\n } else {\n tmpAction.duration = actionList[i + 1].startTime - actionList[i].startTime - actionList[i].duration;\n }\n\n tmpAction.attribute = {\n 'attrName': actionList[i].attribute.attrName,\n 'from': actionList[i].attribute.to,\n 'to': actionList[i].attribute.to\n }\n value.actionAttrs.push(tmpAction);\n }\n })\n })\n console.log('The duration of the generated animation is: ' + this.wholeEndTime + 'ms');\n\n //replace the 'wholeEnd' place holder in duration\n this.allMarkAni.forEach(function (value, a) {\n for (let i = 0, item; i < value.actionAttrs.length | (item = value.actionAttrs[i]); i++) {\n if (item.duration === 'wholeEnd') {\n item.duration = that.wholeEndTime - item.startTime;\n }\n }\n })\n }", "title": "" }, { "docid": "73afa0acd9ceea4de226542b7082da9f", "score": "0.557751", "text": "initAnims() {\n this.anims.create({\n key: \"dino-run\",\n frames: this.anims.generateFrameNumbers(\"dino\", { start: 2, end: 3 }),\n frameRate: 10,\n repeat: -1,\n });\n\n this.anims.create({\n key: \"dino-down\",\n frames: this.anims.generateFrameNumbers(\"dino-down\", {\n start: 0,\n end: 1,\n }),\n frameRate: 10,\n repeat: -1,\n });\n\n this.anims.create({\n key: \"enemy-bird\",\n frames: this.anims.generateFrameNumbers(\"enemy-bird\", {\n start: 0,\n end: 1,\n }),\n frameRate: 6,\n repeat: -1,\n });\n }", "title": "" }, { "docid": "1fe41cb6f7f514ab162e2338d4b0c41c", "score": "0.5576398", "text": "constructor(name,pdg,cEff,minPdg){\n this.name = name //nom de l'attaque, argument\n this.pdg = pdg //Points De Dégats\n this.minPdg = minPdg || 5 ;\n this.msg = 0;\n this.cEff = cEff || 1 //coefficient d'efficacité : chaque tour, l'argument diminue si réutilisé.\n //les attaques peuvent foirer mais ça n'a rien à avoir avec le coefficient\n this.animation = \"\" //truc à faire pour faire une impression :D\n}", "title": "" }, { "docid": "08a825a16c0b32a2e77e4e4e7990d1d9", "score": "0.55743635", "text": "function AnimationStyleMetadata() {}", "title": "" }, { "docid": "6b34a07e56ba0cee750603519d5da54b", "score": "0.55669963", "text": "function createFxNow(){setTimeout(function(){fxNow = undefined;});return fxNow = jQuery.now();} // Generate parameters to create a standard animation", "title": "" }, { "docid": "5f78d79a8c6045b90aefbdd3cd701547", "score": "0.55662036", "text": "function MakingAnimation() {\n\n\t//Rest group_block to zero\n\tantHelper.createAnimation({\n\t\tanimId: \"Group_blockRest\",\n\t\tnodeId: \"Group_block\",\n\t\tpropertyId: AR.animation.ANIMATE_TRANSLATE_Y,\n\t\tkeyCount: 2,\n\t\tkeyTimes: [0, 1],\n\t\tkeyValues: [1, 0],\n\t\ttype: AR.animation.CURVE_LINEAR\n\t});\n\n\t//Rest hint to zero\n\tantHelper.createAnimation({\n\t\tanimId: \"Guangquan_0010Rest\",\n\t\tnodeId: \"Guangquan_0010\",\n\t\tpropertyId: AR.animation.ANIMATE_TRANSLATE_Y,\n\t\tkeyCount: 2,\n\t\tkeyTimes: [0, 1],\n\t\tkeyValues: [1, 0],\n\t\ttype: AR.animation.CURVE_LINEAR\n\t});\n\n\tfor (var eIndex in StepGroupsNodeName) {\n\n\t\t//Scaling to 1.2,1,1.2\n\t\tantHelper.createAnimation({\n\t\t\tanimId: StepGroupsNodeName[eIndex] + \"Scale\",\n\t\t\tnodeId: StepGroupsNodeName[eIndex],\n\t\t\tpropertyId: AR.animation.ANIMATE_SCALE,\n\t\t\tkeyCount: 2,\n\t\t\tkeyTimes: [0, 2000],\n\t\t\tkeyValues: [0, 1, 0, 1.2, 1, 1.2, ],\n\t\t\ttype: AR.animation.CURVE_LINEAR\n\t\t});\n\n\n\t\t//Rest scale and position to 0,0,0\n\t\tantHelper.createAnimation({\n\t\t\tanimId: StepGroupsNodeName[eIndex] + \"RestToZero\",\n\t\t\tnodeId: StepGroupsNodeName[eIndex],\n\t\t\tpropertyId: AR.animation.ANIMATE_SCALE_TRANSLATE,\n\t\t\tkeyCount: 2,\n\t\t\tkeyTimes: [0, 1],\n\t\t\tkeyValues: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t\ttype: AR.animation.CURVE_LINEAR\n\t\t});\n\n\n\t\t//Rest scale to 1,1,1\n\t\tantHelper.createAnimation({\n\t\t\tanimId: StepGroupsNodeName[eIndex] + \"RestToOne\",\n\t\t\tnodeId: StepGroupsNodeName[eIndex],\n\t\t\tpropertyId: AR.animation.ANIMATE_SCALE,\n\t\t\tkeyCount: 2,\n\t\t\tkeyTimes: [0, 1],\n\t\t\tkeyValues: [0, 0, 0, 1, 1, 1],\n\t\t\ttype: AR.animation.CURVE_LINEAR\n\t\t});\n\t}\n\n\n\tfor (var eIndex in StepHintsNodeName)\n\t\tantHelper.createAnimation({\n\t\t\tanimId: StepHintsNodeName[eIndex] + \"Scale\",\n\t\t\tnodeId: StepHintsNodeName[eIndex],\n\t\t\tpropertyId: AR.animation.ANIMATE_SCALE,\n\t\t\tkeyCount: 2,\n\t\t\tkeyTimes: [0, 128],\n\t\t\tkeyValues: [0, 1, 0, 1.2, 1, 1.2, ],\n\t\t\ttype: AR.animation.CURVE_LINEAR\n\t\t});\n}", "title": "" }, { "docid": "ac4a8155a9ac3c34a600d6e990fbf9e7", "score": "0.5558748", "text": "function startupAnimation(){\n tl = gsap.timeline({defaults: {ease: \"sine\"}});\n\n tl.to(\".animation2\", {opacity:0, duration: 2, delay: 1});\n tl.to(\".animation2\", {display:\"none\", duration: 0.1,});\n\n tl.to(\".animation1\", {width: \"0%\", duration: 4});\n tl.to(\".animation3\", {width: \"0%\", duration: 4}, \"-=4\");\n \n tl.to(\".animation1\", {display:\"none\", duration: 0.1});\n tl.to(\".animation3\", {display:\"none\", duration: 0.1}, \"-=0.1\");\n}", "title": "" }, { "docid": "574fa7aea5d1061b123a128033e31a30", "score": "0.5553131", "text": "function ill_prepareInput(astyle,nameinput,ascale=12){\n var q = stage.animationControls.controls.rotation;\n var rotation = new NGL.Euler().setFromQuaternion( q);\n var position = new NGL.Vector3(0,0,0);\n var sao = true;\n var astr=\"read\\n\"\n astr+=nameinput+\".pdb\\n\"\n astr+=ill_prepareWildCard(astyle);\n astr+=\"center\\n\"\n astr+=\"auto\\n\"\n astr+=\"trans\\n\"\n astr+= position.x.toString()+\",\"+position.y.toString()+\",\"+position.z.toString()+\"\\n\"\n astr+=\"scale\\n\"\n astr+=ascale+\"\\n\"\n astr+=\"zrot\\n\"\n astr+=\"90.0\\n\"\n astr+=\"yrot\\n\"\n astr+=\"-180.0\\n\"\n astr+=\"xrot\\n\"\n astr+=(rotation.x * 180 / Math.PI).toString()+\"\\n\"\n astr+=\"yrot\\n\"\n astr+=(rotation.y * 180 / Math.PI).toString()+\"\\n\"\n astr+=\"zrot\\n\"\n astr+=(rotation.z * 180 / Math.PI).toString()+\"\\n\"\n astr+=\"wor\\n\"\n //astr+=\"0.99607843137,0.99607843137,0.99607843137,1.,1.,1.,1.,1.\\n\"\n astr+=\"0.,0.,0.,0.,0.,0.,1.,1.\\n\"\n astr+=((sao)?\"1\":\"0\")+\",\"+ ao_params.join()+\"\\n\";\n astr+=\"-30,-30 # image size in pixels, negative numbers pad the molecule by that amount\\n\"\n astr+=\"illustrate\\n\"\n astr+=atomic_outlines_params.join()+\" # parameters for outlines, atomic\\n\"\n astr+=subunit_outlines_params.join()+\" # subunits\\n\"\n astr+=chain_outlines_params.join()+\" # outlines defining regions of the chain\\n\"\n astr+=\"calculate\\n\"\n astr+=nameinput+\".pnm\\n\"\n return astr;\n}", "title": "" }, { "docid": "9291fc221f6e8a98e75396a317b6f2e2", "score": "0.55514824", "text": "function animation(){\n \n t=t+ 0.01 * Math.PI;\n if(t>2*Math.PI) t=0;\n if(t<Math.PI) up=1; else up=0;\n tmatrix[0] = Math.cos(t);\n tmatrix[1] = -1*Math.sin(t);\n tmatrix[2] = 1*Math.sin(t);\n tmatrix[3] = Math.cos(t);\n tmatrixString = \"matrix(\" + tmatrix.toString().replace(/,/g,\" \") + \")\";\n arrows.setAttribute(\"transform\", tmatrixString);\n \n cx = 500*Math.cos(t);\n cy = 500*Math.sin(t); \n circle.setAttribute(\"cy\", cy.toString());\n circle.setAttribute(\"cx\", cx.toString());\n if(up==1) c2.setAttribute(\"r\", (t*radscale).toString());\n else c2.setAttribute(\"r\", radscale*(2*Math.PI-t));\n window.requestAnimationFrame(animation);\n \n \n \n}", "title": "" }, { "docid": "deb6802af029435ec7b3c66012e36792", "score": "0.55432624", "text": "function generate(){\n var x = Math.random() * width;\n var y = Math.random() * height;\n if($(\"#x\")[0].value > 0 || $(\"#x\")[0].value < width){\n x = parseInt($(\"#x\")[0].value);\n }\n \n if($(\"#y\")[0].value > 0 || $(\"#y\")[0].value < height){\n y = parseInt($(\"#y\")[0].value);\n }\n var cmut = getColorMutator();\n var r1 = cmut.r1;\n var g1 = cmut.g1;\n var b1 =cmut.b1;\n var r2 = cmut.r2;\n var g2 = cmut.g2;\n var b2 = cmut.b2;\n var scale = 1.0;\n var rotation = 0;\n var stroke = \"#000\";\n var path = getShape().path;\n var pmut = getPositionMutator();\n var smut = getScaleMutator();\n var rmut = getRotationMutator();\n var number = $(\"#number\")[0].value;\n var tmp_object = new TemplateObject(path, x, y,height,width, \"\", stroke, scale, rotation, number, null);\n \n tmp_object.setColors(r1,g1,b1,r2,g2,b2);\n tmp_object.setPositionMutator(pmut);\n tmp_object.setColorMutator(cmut);\n tmp_object.setScaleMutator(smut);\n tmp_object.setRotationMutator(rmut);\n \n //set animations before sprite (setting sprite calls any applicable animations)\n var animation_path = getAnimationShape().path;\n var animation_speed = parseInt($(\"#speed\")[0].value);\n var shape = $(\"#shape_animation\")[0].checked;\n var position = $(\"#position_animation\")[0].checked;\n var scale = $(\"#scale_animation\")[0].checked;\n var rotation = $(\"#rotation_animation\")[0].checked;\n var color = $(\"#color_animation\")[0].checked;\n tmp_object.setAnimationParams(shape, position, scale, rotation, color, animation_path, animation_speed);\n \n var tmp_sprite = paper.path(tmp_object.path);\n tmp_object.setSprite(tmp_sprite);\n \n\n}", "title": "" }, { "docid": "66c821bf1d6903b8fdf78d9e72bb8b8f", "score": "0.55388325", "text": "getAnimationCLass() {\r\n if (this.state.isGoBack) {\r\n return \"w3-animate-top\";\r\n } else {\r\n return \"w3-animate-bottom\";\r\n }\r\n }", "title": "" }, { "docid": "b226d77309efccd6c5cf15c8d52443c6", "score": "0.55329746", "text": "function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return fxNow=jQuery.now();} // Generate parameters to create a standard animation", "title": "" }, { "docid": "e21603bb532041e46abe4ac19c4982e8", "score": "0.5531857", "text": "function initStage012(stage){\n\nvar item;\n\n// Percent of one unit. if you want to change unit size, change this.\nvar u=10;\n\n/////Animation Parameter/////\n//\n//dsp :display (true/false) startIndex.... display or hide\n//x : position x (percent)\n//y : position y (percent)\n//w : width (percent)\n//h : height (percent)\n//bgc : background-color\n//bdc : border-color\n//img : background-image (filename)\n//opc : opacity (0.0....1.0) default=1.0\n//z : z-index (default=2)\n//wd : character of word\n\n//Answer String\n//helper original string=lGllggllGllggl\nstage.setAnsStr(\"lGllggllGllggl\");\nitem=stage.createNewItem();\n\n//class name\nitem.setName(\"vimrio\");\n\n//frame offset. default startindex=0\nitem.setFrameStartIndex(0);\nstage.addItem(item);\n\n//first frame\n//1 start\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":2*u,\"w\":u,\"h\":u,\"bgc\":\"transparent\",\"bdc\":\"blue\",\"img\":\"vimrio01.png\",\"z\":5,\"opc\":1.0,\"wd\":\"\"});\n//following next frames\n\n//2 l\nitem.addAnimation({\"x\":1*u});\n//3 G\nitem.addAnimation({\"y\":9*u});\n//3 l\nitem.addAnimation({\"x\":2*u});\n//4 l\nitem.addAnimation({\"x\":3*u});\n//5 gg\nitem.addAnimation({\"y\":0});\n//5 l\nitem.addAnimation({\"x\":4*u});\n//6 l\nitem.addAnimation({\"x\":5*u});\n//7 G\nitem.addAnimation({\"y\":9*u});\n//7 l\nitem.addAnimation({\"x\":6*u});\n//8 l\nitem.addAnimation({\"x\":7*u});\n//9 gg\nitem.addAnimation({\"y\":0});\n//9 l\nitem.addAnimation({\"x\":8*u});\n\n//1 goal\nitem=stage.createNewItem();\nitem.setName(\"goal\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"goal01.png\",\"bgc\":\"yellow\",\"bdc\":\"yellow\"});\nstage.addItem(item);\n\n\n//door 1\nitem=stage.createNewItem();\nitem.setName(\"door\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"door03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"z\":\"3\"});\nstage.addItem(item);\n\n//door 2\nitem=stage.createNewItem();\nitem.setName(\"door\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"door01.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"z\":\"3\"});\nstage.addItem(item);\n\n//door 3\nitem=stage.createNewItem();\nitem.setName(\"door\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"door02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"z\":\"3\"});\nstage.addItem(item);\n\n//door 4\nitem=stage.createNewItem();\nitem.setName(\"door\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"door01.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"z\":\"3\"});\nstage.addItem(item);\n\n//door 5\nitem=stage.createNewItem();\nitem.setName(\"door\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"door03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"z\":\"3\"});\nstage.addItem(item);\n\n//door 6\nitem=stage.createNewItem();\nitem.setName(\"door\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"door01.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"z\":\"3\"});\nstage.addItem(item);\n\n//door 7\nitem=stage.createNewItem();\nitem.setName(\"door\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"door02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"z\":\"3\"});\nstage.addItem(item);\n\n//door 8\nitem=stage.createNewItem();\nitem.setName(\"door\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"door01.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"z\":\"3\"});\nstage.addItem(item);\n\n\n//wall 1\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 2\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 3\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 4\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 5\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 6\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 7\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 8\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 9\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 10\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 11\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 12\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 13\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 14\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 15\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 16\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 17\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 18\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 19\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 20\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 21\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 22\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 23\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 24\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 25\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 26\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 27\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 28\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 29\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n\n}", "title": "" }, { "docid": "fcf4c3d3e7a3a6eff8dac3ae91712797", "score": "0.5525111", "text": "setupAnimations () {\n // Basic movement animations\n this.animations.add('stop', [32], 1, false)\n this.animations.add('walk', [0, 1, 2, 3, 4, 5, 6, 7], 10, true)\n\n // Different parts of the idle animation\n this.animations.add('idle', sequentialNumArray(32, 55), 4, true)\n this.animations.add('jump', [24, 25], 4, false)\n this.animations.add('fall', [26], 4, true)\n this.animations.add('winding', sequentialNumArray(8, 19), 10, true)\n }", "title": "" }, { "docid": "141283f80d00118e9c2e994f7b437a8d", "score": "0.552379", "text": "updateAnimation() { }", "title": "" }, { "docid": "fb8b899bc740e3430b888ef28912e118", "score": "0.55160224", "text": "function svgAnimator(config) {\n init();\n\n function init() {\n $(config.selector).each(function() {\n var delay,\n length,\n path,\n paths,\n previousStrokeLength,\n speed,\n _i,\n _len,\n _results;\n\n paths = $('path, circle, rect', this);\n delay = 0;\n _results = [];\n for (_i = 0, _len = paths.length; _i < _len; _i++) {\n path = paths[_i];\n length = path.getTotalLength();\n previousStrokeLength = speed || 0;\n speed = 120;\n delay += previousStrokeLength + 20;\n _results.push($(path)\n .css('transition', 'none')\n .attr('data-length', length)\n .attr('data-speed', speed)\n .attr('data-delay', delay)\n .attr('stroke-dashoffset', length)\n .attr('stroke-dasharray', length + ',' + length)\n );\n }\n return _results;\n\n });\n }\n\n function animate() {\n $(config.selector).each(function() {\n var delay,\n length,\n path,\n paths,\n speed,\n _i,\n _len,\n _results;\n\n paths = $('path, circle, rect', this);\n _results = [];\n for (_i = 0, _len = paths.length; _i < _len; _i++) {\n path = paths[_i];\n length = $(path).attr('data-length');\n speed = $(path).attr('data-speed');\n delay = $(path).attr('data-delay');\n _results.push($(path)\n .css('transition', 'stroke-dashoffset ' + speed + 'ms ' + delay + 'ms linear')\n .attr('stroke-dashoffset', '0')\n );\n }\n return _results;\n });\n }\n\n return {\n animate: animate,\n init: init\n }\n}", "title": "" }, { "docid": "05401872691deae3f472c85d99327899", "score": "0.5506378", "text": "function setup() {\n // pa=60;\n // ia=60;\n // mu=2;\n \n\n }", "title": "" }, { "docid": "440dc799f8fc3f44bd1e997eb8d67d39", "score": "0.5499499", "text": "function initialisationOfVariables() { \n color_slit=[\"yellow_first_order_L\",\"yellow_light_first_order_L\",\"green_first_order_L\",\"blue_green_first_order_L\",\"pink_first_order_L\",\"violet_light_first_order_L\",\"violet_first_order_L\",\"yellow_first_order_R\",\"yellow_light_first_order_R\",\"green_first_order_R\",\"blue_green_first_order_R\",\"pink_first_order_R\",\"violet_light_first_order_R\",\"violet_first_order_R\",\"yellow_second_order_L\",\"yellow_light_second_order_L\",\"green_second_order_L\",\"blue_green_second_order_L\",\"pink_second_order_L\",\"violet_light_second_order_L\",\"violet_second_order_L\",\"yellow_second_order_R\",\"yellow_light_second_order_R\",\"green_second_order_R\",\"blue_green_second_order_R\",\"pink_second_order_R\",\"violet_light_second_order_R\",\"violet_second_order_R\"];/** All slit */\n diffraction_angle=[20.33078935,20.25359971,19.12586237,17.15539066,15.15907359,14.16232078,14.05147975,-20.33078935,-20.25359971,-19.12586237,-17.15539066,-15.15907359,-14.16232078,-14.05147975,44.01759179,43.81657963,40.94155193,36.15192741,31.53367467,29.29718464,29.05095132,-44.01759179,-43.81657963,-40.94155193,-36.15192741,-31.53367467,-29.29718464,-29.05095132]\n spectrometer_top_view_container.rotation=-45;/** Container rotate to 45 degree*/ \n spectrometer_top_view_container.y=230;/** Container y position change */ \n spectrometer_top_view_container.x=-150;/** Container x position change */ \n blur_filter = new createjs.BlurFilter(15, 15, 15); /** Blur value */ \n slit_blur_filter = new createjs.BlurFilter(1, 1, 1);/** Blur value */ \n scope.telescope_model=90; /** Initial value of telescope rotate slider */ \n scope.vernier_model=0; /** Initial value of vernier rotate slider */ \n scope.telescope_fine_model=0;/** Initial value of fine telescope rotate slider */ \n scope.grating_model=0/** Initial value of grating rotate slider */ \n scope.slit_focus_model=1;/** Initial slit focus */ \n focus_telescope_container.visible=true;/** Container visiblity set to true */\n grating_spectrometer_container.visible=false; /** Container visiblity set to false */ \n spectrometer_top_view_container.visible=false;/** Container visiblity set to false */\n zoom_container.visible=false;/** Container visiblity set to false */\n hit_flag=false;/** Hit telescope */\n slit_center_x=97; /** Slit center position */\n telescope_fine_angle=0;/** Telescope fine angle */\n vernier_fine_angle=0; /** Vernier fine angle */\n \n }", "title": "" }, { "docid": "175d2689661af657d6707183ea3bdfe8", "score": "0.54959536", "text": "constructor(){\n this.x = p.random(0,p.width);\n this.y = p.random(0,p.height);\n this.r = p.random(1,3);\n this.outerDiam = 0;\n this.xSpeed = 0;\n this.ySpeed = p.random(0,0.2);\n this.rSpeed = 1;\n this.colorSpeed = 0.2;\n this.color = 100\n }", "title": "" }, { "docid": "74d9593fee8dbe1f13216f2db83e2244", "score": "0.5491787", "text": "animate() {\n var tl = new TimelineMax({\n delay: 0.42,\n repeat: -1,\n repeatDelay: 2,\n yoyo: true\n });\n\n tl.to(\"#shadow\", 2, {\n scale:this.state.progress\n }, 0).to(\"#tree\", 2, {\n scale:this.state.progress\n }, 0).to(\"#leaf-rb\", 2, {\n scale:this.state.progress,\n rotation:'0cw',\n y: 0,\n delay: 0.35\n }, 0).to(\"#leaf-rm\", 2, {\n scale:this.state.progress,\n rotation:'0cw',\n y: 0,\n delay: 0.35\n }, 0).to(\"#leaf-lb\", 2, {\n scale:this.state.progress,\n rotation:'0cw',\n y: 0,\n delay: 0.35\n }, 0).to(\"#leaf-lm\", 2, {\n scale:this.state.progress,\n rotation:'0cw',\n y: 0,\n delay: 0.35\n }, 0).to(\"#leaf-top\", 2.5, {\n scale:this.state.progress,\n delay: 0.35\n }, 0).to(\"#leaf-lb g\", 2.25, {\n scale:this.state.progress,\n delay: 0.5\n }, 0).to(\"#leaf-lm g\", 2.25, {\n scale:this.state.progress,\n delay: 0.6\n }, 0).to(\"#leaf-rb g\", 2.25, {\n scale:this.state.progress,\n delay: 0.5\n }, 0).to(\"#leaf-rm g\", 2.25, {\n scale:this.state.progress,\n delay: 0.6\n }, 0);\n\n return tl;\n }", "title": "" }, { "docid": "4710a6dc83a6d20df34607b3df0443dc", "score": "0.54802734", "text": "function PenParameters(obj) {\n this.color = 'rgba(255, 0, 0, 255)';//modify by ljm\n this.rectColor = 'rgba(0, 0, 0, 0.2)';\n this.font = 'Times New Roman';\n this.decoration = 'normal';\n this.width = 3;\n this.pressureType = 'SIMULATED';\n this.alpha = '1.0';\n if (obj) {\n this.color = obj.color;\n this.rectColor = obj.rectColor;\n this.font = obj.font;\n this.decoration = obj.decoration;\n this.width = obj.width;\n this.pressureType = obj.pressureType;\n this.alpha = obj.alpha;\n }\n }", "title": "" }, { "docid": "ca1b9f4cc0cf18acd1e83cd6ce60da25", "score": "0.5477523", "text": "setParams() {\r\n \tfor(Entry<String,Double> e : body.metabolicParameters.get(body.bodyState.state).get(BodyOrgan.HEART.value).entrySet()) {\r\n \t\tswitch (e.getKey()) {\r\n \t\t\tcase \"lactateOxidized_\" : { lactateOxidized_ = e.getValue(); break; }\r\n \t\t\tcase \"basalGlucoseAbsorbed_\" : { basalGlucoseAbsorbed_ = e.getValue(); break; }\r\n \t\t\tcase \"Glut4Km_\" : { Glut4Km_ = e.getValue(); break; }\r\n \t\t\tcase \"Glut4VMAX_\" : { Glut4VMAX_ = e.getValue(); break; }\r\n \t\t}\r\n \t}\r\n }", "title": "" }, { "docid": "125f5c8c3b5f286f14aa822e06300a32", "score": "0.5473283", "text": "initAnimation(){\n this.initTimes = [];\n for (let i = 0; i < this.animationsList.length; i++){\n this.initTimes.push(this.duration);\n this.duration += this.animationsList[i].duration;\n }\n }", "title": "" }, { "docid": "09eaae42bd81bdaa07b60ed266f9da05", "score": "0.54601765", "text": "function AnimationKeyframesSequenceMetadata() {}", "title": "" }, { "docid": "46216320e038a424a099d36bd529d85c", "score": "0.54600734", "text": "static SetAnimationClips() {}", "title": "" }, { "docid": "75c8c80ccd7b450a89ea294fb0d38748", "score": "0.5452173", "text": "constructor(){\n this.x = p.random(100,p.width - 100);\n this.y = p.random(300,p.height * 2);\n this.r = p.random(1,8);\n this.outerDiam = 0;\n this.xSpeed = p.random(-0.2,0.2);\n this.ySpeed = p.random(-0.2,0.2);\n this.rSpeed = 1;\n this.colorSpeed = 0.2;\n this.color = 100\n }", "title": "" }, { "docid": "1a5810353238e90d10b2e2458e7f6043", "score": "0.54481834", "text": "animate(lerpPos, n){\n let currentArray = [];\n let firstCurve = this.dotSys[n];\n let secondCurve = this.dotSys[n+1];\n let prams = [];\n\n let c;\n\n for(var p = 0; p < firstCurve[0].params.length; p++){\n //calculate new equation parameters based on place in animation\n prams.push(lerp(firstCurve[0].params[p], secondCurve[0].params[p], lerpPos))\n //calculate color based on place in animation\n c = lerpColor(firstCurve[0].color, secondCurve[0].color, lerpPos);\n }\n currentArray = this.generateCurve(c, prams);\n this.drawCurve(null, currentArray);\n lerpPos+=this.speed;\n return lerpPos;\n }", "title": "" }, { "docid": "1ac172e32e71fefd5a0b4e57bcddf9ca", "score": "0.5442694", "text": "function onFrame(event) {\n // Run through the active layer's children list and change\n // the position of the placed symbols:\n\n var val = $('#angriness_slider').slider(\"option\", \"value\");\n // console.log(val);\n\n // scalePulse += 0.5 * scaleDir;\n\n // if (scalePulse > 10) {\n // scaleDir *= -1;\n // } else if (scalePulse < -10 ) {\n // scaleDir *= -1;\n // }\n\n\n // console.log(scalePulse);\n\n for (var i = 0; i < pointArray.length; i++) {\n\n var item = project.activeLayer.children[i];\n\n\n // item.scaling = 1.1;\n // console.litem.curves;\n\n // item.scaling = .5;\n\n\n var itScale = scaler[i].scScale;\n var itSpeed = scaler[i].scSpeed;\n var itDir = scaler[i].scDir;\n\n if (itScale >= 1.4) {\n scaler[i].scDir *= -1;\n } else if (itScale <= 0.8 ) {\n scaler[i].scDir *= -1;\n }\n\n itScale += itSpeed * scaler[i].scDir;\n scaleVar = itScale;\n\n scaler[i].scScale = itScale;\n\n // var scaleVar = val * scaler[i].scSpeed;\n\n item.scaling = scaleVar;\n\n\n item = path.smooth();\n\n\n\n // item.rotate(20-getRandomInt(0,40));\n\n\n // item.scaling = val;\n // item.radius =\n\n // if (scalePulse >= 2) {\n // scaleDir *= -1;\n // } else if (scalePulse < 0.1 ) {\n // scaleDir *= -1;\n // }\n\n // scalePulse += scaler[i] * scaleDir;\n\n // item.scaling = scalePulse;\n // console.log(scaler[i]);\n\n\n }\n}", "title": "" }, { "docid": "81fa6b78940174bffcb82161f5eef5a0", "score": "0.5439219", "text": "function altAnimationInit(totAttkTime, spritesheet, type) {\n let animations = [];\n\n //Universal FX\n /* none yet */\n\n switch(type) {\n case 'slice':\n animations['sliceRight'] = new Animation(spritesheet, 0, 646, 75, 28, 450, totAttkTime, 6, true, 1.75);\n animations['sliceLeft'] = new Animation(spritesheet, 0, 675, 75, 28, 450, totAttkTime, 6, true, 1.75);\n animations['sliceUp'] = new Animation(spritesheet, 0, 704, 62, 42, 310, totAttkTime, 5, true, 2);\n animations['sliceDown'] = new Animation(spritesheet, 0, 747, 62, 42, 310, totAttkTime, 5, true, 2);\n break;\n case 'slash':\n animations['slashRight'] = new Animation(spritesheet, 0, 0, 165, 68, 660, totAttkTime, 4, true, 0.7);\n animations['slashLeft'] = new Animation(spritesheet, 0, 70, 165, 68, 660, totAttkTime, 4, true, 0.7);\n animations['slashUp'] = new Animation(spritesheet, 0, 139, 176, 49, 704, totAttkTime, 4, true, 1);\n animations['slashDown'] = new Animation(spritesheet, 0, 189, 176, 49, 704, totAttkTime, 4, true, 1);\n break;\n case 'thrust':\n let speed = totAttkTime - (totAttkTime / ANIMATION_DELAY_FACTOR);\n animations['thrustRight'] = new Animation(spritesheet, 0, 240, 152, 48, 1216, speed, 8, true, 0.85);\n animations['thrustLeft'] = new Animation(spritesheet, 0, 288, 152, 48, 1216, speed, 8, true, 0.85);\n animations['thrustUp'] = new Animation(spritesheet, 0, 336, 48, 152, 384, speed, 8, true, 0.6);\n animations['thrustDown'] = new Animation(spritesheet, 0, 490, 48, 152, 384, speed, 8, true, 0.6);\n break;\n }\n\n return animations;\n}", "title": "" }, { "docid": "e7b9b7306d482dfbbf83c782fb0d48ff", "score": "0.54388154", "text": "function animate() {\n\n requestAnimationFrame( animate );\n// console.log(\"properties.rebirrth: \" + properties.rebirrth);\n render();\n\n}", "title": "" }, { "docid": "9a4301cdff03bc045e8a85ed921a26d1", "score": "0.54348063", "text": "constructor() {\n\n this.background = [0, 0, 0];\n this.Color_Indcator_S = [255, 100, 150];\n this.Color_Indcator_M = [150, 100, 255];\n this.Color_Indcator_H = [0, 153, 153];\n this.Transparency_S = this.Color_Indcator_S;\n this.Transparency_M = this.Color_Indcator_M;\n this.Transparency_H = this.Color_Indcator_H;\n this.text_color = [255, 255, 204];\n this.color_theta = [255, 255, 204];\n this.text = \"to show Original Clock\";\n }", "title": "" }, { "docid": "5845ced8283a373f75380c22c750099b", "score": "0.5427768", "text": "function setUpMultipleStimuli(){\r\n\t\t \r\n\t\t lineWidth_array = setParameter(lineWidth);\r\n\t\t lineHeight_array = setParameter(lineHeight);\r\n\t\t stimuliCenterX_array = setParameter(stimuliCenterX);\r\n\t\t stimuliCenterY_array = setParameter(stimuliCenterY);\r\n\t\t coherenceAngle_array = setParameter(coherenceAngle);\r\n\t\t coherence_array = setParameter(coherence);\r\n\t\t angleBuffer_array = setParameter(angleBuffer);\r\n\t\t lineSpaceX_array = setParameter(lineSpaceX);\r\n\t\t lineSpaceY_array = setParameter(lineSpaceY);\r\n\t\t lineColor_array = setParameter(lineColor);\r\n\t\t border_array = setParameter(border);\r\n\t\t\tborderRadius_array = setParameter(borderRadius);\r\n\t\t\tborderColor_array = setParameter(borderColor);\r\n\t\t\tborderThickness_array = setParameter(borderThickness);\r\n\t\t \r\n\t\t //linesPerRowArray is an array anyways, so we will have to check it separately\r\n\t\t linesPerRowArray_array = setParameterArray(linesPerRowArray);\r\n\t\t \r\n\t\t}//End of setUpMultipleStimuli function", "title": "" }, { "docid": "7e7d18b8d511b13d6a3ba4a7b9ceeb39", "score": "0.5426536", "text": "animate() {\n if (!this.playing) {\n return;\n }\n\n this.points.forEach((point) => {\n if (!point.animated) {\n return;\n }\n\n let noisePoint = {\n x: this.simplex.noise2D(point.noiseOffset.x, point.noiseOffset.x),\n y: this.simplex.noise2D(point.noiseOffset.y, point.noiseOffset.y),\n };\n let x = this.scale(\n noisePoint.x,\n -1,\n 1,\n point.origin.x - this.variance.x,\n point.origin.x + this.variance.x\n );\n let y = this.scale(\n noisePoint.y,\n -1,\n 1,\n point.origin.y - this.variance.y,\n point.origin.y + this.variance.y\n );\n\n if (point.animated == true || point.animated.x) {\n point.x = x;\n point.noiseOffset.x += this.speed;\n }\n\n if (point.animated == true || point.animated.y) {\n point.y = y;\n point.noiseOffset.y += this.speed;\n }\n });\n\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.context.restore();\n this.context.save();\n\n this.beforePaint?.(this);\n\n this.path = spline(this.points, 1, true);\n\n this.applyGradient();\n this.context.fill(new Path2D(this.path));\n\n this.afterPaint?.(this);\n\n requestAnimationFrame(this.animate.bind(this));\n }", "title": "" }, { "docid": "41f515acbeadd2736698b7281d9eb8b5", "score": "0.54220986", "text": "function maraca () {\n $('.splatter').each(function () {\n $(this).css({\n top: (Math.random() * 1040) + 'px',\n left: (Math.random() * 1900) + 'px'\n });\n });\n animate({ el: '.splatter', prop: 'background-color', on: '#fff', off: '#000' });\n animate({ el: '.splatter', prop: 'opacity', on: '1.0', off: '0' });\n }", "title": "" } ]
feacae4ecb8b18b3d8d11aa13d8f23a7
Label with requierd feld display, htmlFor, and block styling
[ { "docid": "b8c045a97cd2567669de0adaaddcd65f", "score": "0.6519753", "text": "function Label({ htmlFor, label, required }) {\n return (\n <label style={{ display: \"block\" }} htmlFor={htmlFor}>\n {label} {required && <span style={{ color: \"red\" }}> *</span>}\n </label>\n );\n}", "title": "" } ]
[ { "docid": "d6eb2b21e19fedad06cc0558a0c34759", "score": "0.72817844", "text": "get labelTemplate() {\n return !this.hasLabel\n ? \"\"\n : html`<span\n id=\"label\"\n class=\"${this.labelVisible ? \"\" : \"offscreen\"}\"\n part=\"label\"\n >${this.currentLabel}</span\n >`;\n }", "title": "" }, { "docid": "a9977ea7bff40c68ed1d15fac7fa427d", "score": "0.67165196", "text": "_renderLabel () {\n // Set the for attribute for the label to this input. We need to store the\n // label just in case it is updated, and we need to update our label.\n let label = this.get ('label');\n let $label = $(this.$()[0].labels);\n\n if (Ember.isEmpty (label)) {\n // We do not have a label. We need to remove the label element.\n if ($label.length !== 0) {\n $label.remove ();\n }\n }\n else {\n if ($label.length !== 0) {\n let oldLabel = this.get ('_oldLabel');\n\n // We already have a label and the label is different from the old\n // label. So, we just need to update the label text.\n if (label !== oldLabel) {\n $label.text (label);\n }\n }\n else {\n // There is no label element, and we need to add one.\n $label = $(`<label for=\"${this.elementId}\" class=\"${this.get ('labelClass')}\">${label}</label>`).insertAfter (this.$());\n }\n\n // Update the state of the label.\n let val = this.$().val ();\n let placeholder = this.get ('placeholder');\n\n let showActive = !(Ember.isEmpty (val) && Ember.isEmpty (placeholder));\n $label.toggleClass ('active', showActive);\n }\n\n this.set ('_oldLabel', label);\n }", "title": "" }, { "docid": "5282c7dd0de4866d93c6b36707d2ff88", "score": "0.6385823", "text": "setupLabel() {\n\t\tthis.labelText = this.el.getAttribute('+label')\n\t\tif (!this.labelText) this.labelText = 'Default Label'\n\t\t// return `<label for=\"${this.el.field.getAttribute('id')}\">${this.labelText}</label>`\n\t\tlet labelEl = document.createElement('label')\n\t\tlabelEl.setAttribute('for', this.el.field.getAttribute('id'))\n\t\tlabelEl.innerText = this.labelText\n\t\treturn labelEl\n\t}", "title": "" }, { "docid": "fd8fe5823d501e1f0a56d3856aafdfbe", "score": "0.61882865", "text": "getLabel(eventItem) {\n let\n hourDisplay = eventItem.hourBlockDisplay,\n \n div = $(\"<div>\").addClass(\"col my-auto py-auto text-center\"),\n label = $(\"<label>\")\n .addClass(\"col-form-label\")\n .attr(\"for\", `input-${hourDisplay}`)\n .text(hourDisplay);\n\n return div.append(label);\n }", "title": "" }, { "docid": "d497ce1199a63c48bc4d09efd34c4d0b", "score": "0.5979609", "text": "#syncLabel() {\n let labelElement = typeof this.getLabel === 'function' ? this.getLabel() : null;\n if (labelElement) {\n labelElement.setAttribute('for', this.getId());\n }\n }", "title": "" }, { "docid": "81ac5521f57030992ca99a5e6f0f92d2", "score": "0.5952795", "text": "function displayRender(label) {\n return label[label.length - 1];\n}", "title": "" }, { "docid": "81ac5521f57030992ca99a5e6f0f92d2", "score": "0.5952795", "text": "function displayRender(label) {\n return label[label.length - 1];\n}", "title": "" }, { "docid": "24ce5aacd5e16aaa589773d24f8ad26c", "score": "0.58622974", "text": "function labelFormatter(label, series) {\n return '<div style=\"font-size:13px; text-align:center; padding:2px; color: #fff; font-weight: 600;\">'\n + label + '<br>' + series.data[0][1] + '</div>';\n }", "title": "" }, { "docid": "514aceddde682d6c55d72d210121ce69", "score": "0.58392835", "text": "render() {\n return (\n <label className={this.props.className} htmlFor={this.props.htmlFor}>\n {this.props.value}\n </label>\n );\n }", "title": "" }, { "docid": "7d1088e1e597180a26cd3ad07e3054e8", "score": "0.58048683", "text": "function label(label) {\n if (label || false) return e('label', {className: 'label'}, label);\n return null;\n}", "title": "" }, { "docid": "ca98cf382de06db75db09e153835405a", "score": "0.5770477", "text": "function createLabel(htmlFor, text){\n\tconst label = document.createElement(\"label\");\n\tlabel.htmlFor = htmlFor;\n\tconst b = document.createElement(\"b\");\n\tb.textContent = text;\n\tlabel.appendChild(b);\n\treturn label;\n}", "title": "" }, { "docid": "e556adb0d604897de01e31ff90f9992f", "score": "0.5747813", "text": "get labelFormat() {\n return this._label;\n }", "title": "" }, { "docid": "4f1e4240bf21becef7b1f82af3bc1821", "score": "0.57469064", "text": "function\nmake_label_link(label, bold)\n{\n\tif (bold) {\n\t\tlabel = '<b>' + label + '</b>';\n\t}\n\treturn '<a href=\"/bugview/label/' + label + '\">' + label + '</a>';\n}", "title": "" }, { "docid": "0e29703bec7767325d6615e8a4d8f2f0", "score": "0.5742486", "text": "function formatMoneyLabel() {\n $('label.lbl-money, label.money').each(function () {\n var data = convertMoneyToInt($(this).text(), true);\n var money = convertIntToMoney(data);\n\n $(this).text(money);\n });\n }", "title": "" }, { "docid": "fbcfdb5cd06938317b52d003b51dda2c", "score": "0.5712331", "text": "resetLabel() {\n const nodes = Array.prototype.concat(\n SafeHtml.create(TagName.SPAN, this.getClassMap_(),\n this.getModel().getEnUsName()),\n this.badges_);\n this.setSafeHtml(SafeHtml.create(TagName.SPAN, {}, nodes));\n }", "title": "" }, { "docid": "25d146be5548488bb88d3735281ca6d1", "score": "0.5684833", "text": "function get_label(obj) {\n var el = document.getElementsByTagName(\"label\");\n for (var i = 0; i < el.length; i++) {\n if (el[i].htmlFor != obj.id) continue;\n return el[i];\n }\n return false;\n}", "title": "" }, { "docid": "63592f68a02a480d8f417fae1a2fcd14", "score": "0.5680531", "text": "convenienceLabel() {\n this.getRootInputElements()\n .forEach((el) => {\n const label = document.createElement('label');\n this.shadowRoot.replaceChild(label, el);\n\n const span = document.createElement('span');\n span.classList.add('label');\n\n // password visibility\n if (el.getAttribute('type') === 'password') {\n const passwordWrapper = document.createElement('div');\n passwordWrapper.classList.add('password-wrapper');\n passwordWrapper.appendChild(el);\n\n const toggle = passwordWrapper.appendChild(document.createElement('div'));\n toggle.classList.add('password-toggle');\n toggle.onclick = () => {\n const currentType = el.getAttribute('type');\n if (currentType === 'password') {\n el.setAttribute('type', 'text');\n } else {\n el.setAttribute('type', 'password');\n }\n };\n\n label.appendChild(passwordWrapper);\n } else {\n label.appendChild(el);\n }\n\n label.appendChild(span);\n\n const dataOutputValue = el.getAttribute('data-output-value') || el.getAttribute('data-outputvalue');\n if (this.vault && dataOutputValue && this.vault.includes(dataOutputValue)) {\n label.classList.add('vault');\n }\n\n // set the required attribute\n // because the :has() pseudo selector is not available (yet)\n if (el.required) {\n label.classList.add('required');\n } else {\n label.classList.add('optional');\n }\n\n // copy the description to the label\n const description = el.getAttribute('data-description');\n if (description) {\n label.setAttribute('data-description', description);\n }\n\n // add the label\n const placeholder = el.getAttribute('placeholder') || dataOutputValue;\n if (!placeholder) {\n span.classList.add('unknown');\n }\n span.appendChild(document.createTextNode(placeholder || 'unknown'));\n\n // ensure hideif attached is hooked properly\n const hideIfAttached = el.getAttribute('data-hide-if-attached') || el.getAttribute('data-hideifattached');\n if (hideIfAttached) {\n label.setAttribute('data-hide-if-attached', hideIfAttached);\n }\n });\n }", "title": "" }, { "docid": "bc1eca03e2b9db5923143d32ee39f7ba", "score": "0.5665902", "text": "function addBlockedLabel() {\n $('.issue-list-item[data-blocked=\"true\"]').each(function() {\n var label = '<span class=\"label label-danger\">BLOCKED</span>'\n $(this).find('.issue-text').append(\" \" + label);\n });\n}", "title": "" }, { "docid": "387897797ede13b734ecf70e00ae86f2", "score": "0.5660852", "text": "label() {\r\n return this.render\r\n // render(value, row)\r\n // can get more component instance data from `this`\r\n ? this.render.call(this, this.value, this.row.value)\r\n // origin value\r\n : this.value;\r\n }", "title": "" }, { "docid": "95b054214afdff96855b16723188727a", "score": "0.56531817", "text": "function WFF_label_render(label_name, label_id, node, field) {\r\n var hasConstraints = (field.specialType != WFE_special_type.TEXT && field.specialType != WFE_special_type.HTMLCODE && field.specialType != WFE_special_type.IMAGE);\r\n var ondblclick = hasConstraints ? \"$(this).blur();WFF_openPropertyPanelOnDoubleClick('\" + field.id + \"')\" : \"\";\n \n return \"<div class=\\\"WFF_added_element\\\">\" +\n\t\t\t\t\"<input type=\\\"text\\\" onDblClick=\\\"\"+ondblclick+\"\\\" onClick=\\\"$(this).focus();\\\" onkeyup=\\\"WFF_expandLabelOnChange('#WFF_label\" + label_id+\"');\\\" onBlur=\\\"WFF_onChangeFieldLabel('\" + node.getId() + \"','\" + field.id + \"',this.value,'\" + label_name +\"','\"+ label_id + \"')\\\" id=\\\"WFF_label\" + label_id + \"\\\" class=\\\"WFF_label_box\\\" value=\\\"\" + field.name + \"\\\" size=\\\"\"+(4+field.name.length)+\"\\\"/><script type=\\\"text/javascript\\\">$(\\\"#WFF_label\" + label_id + \"\\\").focus();</script>\" +\n\t\t\t\"</div>\";\n\n}", "title": "" }, { "docid": "dcffc7d6b183ddfd80de30d7cf1240d7", "score": "0.56528527", "text": "function createLabel() {\n if (elLabel) {\n xmlWriter.writeStartElement('label');\n if (elLabel.ref) {\n xmlWriter.writeAttributeString('ref',elLabel.ref);\n }\n if (elLabel.defText) {\n xmlWriter.writeString(elLabel.defText);\n }\n xmlWriter.writeEndElement(); //close Label tag;\n }\n }", "title": "" }, { "docid": "de01929dd97f1a7d8ff3c330295f415d", "score": "0.5635494", "text": "function labelFormatter(label, series) {\n\treturn \"<div style='font-size:8pt; text-align:center; padding:2px; color:white;'>\" + label + \"<br/>\" + Math.round(series.percent) + \"%</div>\";\n}", "title": "" }, { "docid": "2b20c971430663108b8815e46307b6bf", "score": "0.5604023", "text": "function SmartLabel() {}", "title": "" }, { "docid": "aa07222c5cc1e3208de53c59d626dd1a", "score": "0.55630726", "text": "function ctlLabel(node, forControl) {\n this.Text = '';\n this.Tag = \"Label\";\n this.For = forControl;\n this.CssClass = null;\n this.GetDesignerHtml = function () {\n var props = new Array;\n var classes = new Array;\n var sProps = '';\n if (this.For) props.push('for=\"' + this.For + '\"');\n classes.push(style_Label);\n if (this.CssClass) classes.push(this.CssClass);\n props.push('class=\"' + classes.join(' ') + '\"');\n if (props.length) sProps = ' ' + props.join(' ');\n return '<label' + sProps + '>' + this.Text + '</label>';\n };\n this.ParseXml = function (node) {\n var $ctl = jQuery(node);\n if ($ctl.attr(\"CssClass\")) this.CssClass = $ctl.attr(\"CssClass\");\n if ($ctl.attr(\"For\")) this.For = $ctl.attr(\"For\");\n // if there's a text attribute get it's value. Otherwise, get the inner text \n if ($ctl.attr(\"Text\")) {\n this.Text = $ctl.attr(\"Text\");\n } else {\n this.Text = $ctl.text();\n }\n };\n // generate the XML that defines this control for use in re-creating the form later\n this.GetXml = function (indent) {\n var sOut = '';\n if (indent === 0) {\n indent = '';\n sOut = '<' + this.Tag;\n }\n else {\n if (!indent) { indent = ' '; }\n sOut = \"\\n\" + indent + \" <\" + this.Tag;\n }\n if (this.For) sOut += ' For=\"' + this.For + '\"';\n if (this.CssClass) sOut += ' CssClass=\"' + this.CssClass + '\"';\n sOut += '>' + this.Text + '</' + this.Tag + '>\\n';\n return sOut;\n };\n this.PropertySheet = function () {\n return ctlUtils.CreateTextInput(\"Text\", \"designer-label-text\") +\n ctlUtils.CreateTextInput(\"For\", \"designer-label-for\");\n }\n // Only called outside of FormBuilder.\n this.LoadDesigner = function (designer, data) {\n designer.find('.designer-label-text').val(this.Text);\n designer.find('.designer-label-for').val(this.For);\n designer.find('.designer-label-cssclass').val(this.CssClass);\n }\n // Only called outside of FormBuilder\n this.LoadFromDesigner = function (designer) {\n this.Text = designer.find('.designer-label-text').val();\n this.For = designer.find('.designer-label-for').val();\n this.CssClass = designer.find('.designer-label-cssclass').val();\n }\n if (node) { this.ParseXml(node) };\n}", "title": "" }, { "docid": "325581984038ea96ef7ad9ad20a03239", "score": "0.55594873", "text": "function Label(opt_options) {\n // Initialization\n this.setValues(opt_options);\nvar span = this.span_ = document.createElement('span');\n span.style.cssText = 'position: relative; left: -50%; top: -8px; ' +\n 'white-space: nowrap; border: none; ' +\n 'padding: 2px; background-color: transparent; color:blue;';\n\n var div = this.div_ = document.createElement('div');\n div.appendChild(span);\n div.style.cssText = 'position: absolute; display: none';\n}", "title": "" }, { "docid": "b30cfb62b77a2037ead10f604caa2228", "score": "0.55404127", "text": "function label() {\r\n let sizeLabel = createDiv('Vector Spacing');\r\n sizeLabel.position(10, 10);\r\n sizeLabel.style('font-family', 'Helvetica');\r\n sizeLabel.style('font-weight', 'bold');\r\n sizeLabel.style('font-size', '14px');\r\n\r\n let radiusLabel = createDiv('Wave Amplitude');\r\n radiusLabel.position(10, 50);\r\n radiusLabel.style('font-family', 'Helvetica');\r\n radiusLabel.style('font-weight', 'bold');\r\n radiusLabel.style('font-size', '14px');\r\n\r\n\r\n let speedLabel = createDiv('Step Speed');\r\n speedLabel.position(10, 100);\r\n speedLabel.style('font-family', 'Helvetica');\r\n speedLabel.style('font-weight', 'bold');\r\n speedLabel.style('font-size', '14px');\r\n\r\n let colorLabel = createDiv('Colors');\r\n colorLabel.position(10, 150);\r\n colorLabel.style('font-family', 'Helvetica');\r\n colorLabel.style('font-weight', 'bold');\r\n colorLabel.style('font-size', '14px');\r\n}", "title": "" }, { "docid": "ac04db4de0ec018e9afe3f1ae12ceb47", "score": "0.5535197", "text": "function labelTemplate(fileName, id) {\n\treturn $(\n\t\t'<form class=\"form-horizontal well form-inline\">\\\n\t\t\t<div class=\"control-group\">\\\n\t\t\t\t<label class=\"control-label\" for=\"fileName\">File Name:</label>\\\n\t\t\t\t<div class=\"controls\">\\\n\t\t\t\t\t<p>'+ fileName +'</p>\\\n\t\t\t\t</div>\\\n\t\t\t</div>\\\n\t\t\t<div class=\"control-group\">\\\n\t\t\t\t<label class=\"control-label\" for=\"floorLabel\">Floor Number:</label>\\\n\t\t\t\t<div class=\"controls\">\\\n\t\t\t\t\t<input class=\"span1 ' + id + '\" type=\"text\">\\\n\t\t\t\t</div>\\\n\t\t\t</div>\\\n\t\t</form>');\n}", "title": "" }, { "docid": "140af7ceaa4551c7dca63cc31b3c31a7", "score": "0.55288583", "text": "function setupLabel() {\n // Checkbox\n var checkBox = \".checkbox\";\n var checkBoxInput = checkBox + \" input[type='checkbox']\";\n var checkBoxChecked = \"checked\";\n var checkBoxDisabled = \"disabled\";\n\n // Radio\n var radio = \".radio\";\n var radioInput = radio + \" input[type='radio']\";\n var radioOn = \"checked\";\n var radioDisabled = \"disabled\";\n\n // Checkboxes\n if ($(checkBoxInput).length) {\n $(checkBox).each(function(){\n $(this).removeClass(checkBoxChecked);\n });\n $(checkBoxInput + \":checked\").each(function(){\n $(this).parent(checkBox).addClass(checkBoxChecked);\n });\n $(checkBoxInput + \":disabled\").each(function(){\n $(this).parent(checkBox).addClass(checkBoxDisabled);\n });\n };\n\n // Radios\n if ($(radioInput).length) {\n $(radio).each(function(){\n $(this).removeClass(radioOn);\n });\n $(radioInput + \":checked\").each(function(){\n $(this).parent(radio).addClass(radioOn);\n });\n $(radioInput + \":disabled\").each(function(){\n $(this).parent(radio).addClass(radioDisabled);\n });\n };\n}", "title": "" }, { "docid": "7fa056d79882e6fcb721a286013b72a5", "score": "0.5514559", "text": "renderLabel(data) {\n const e = document.createElement('div');\n e.className = 'jp-Dialog-buttonLabel';\n e.title = data.caption;\n e.appendChild(document.createTextNode(data.label));\n return e;\n }", "title": "" }, { "docid": "53ec77a0d716274cf735004c0b4f9365", "score": "0.55134684", "text": "getLabel() {\r\n if (!this.hasProceduralParameter) {\r\n return this.name();\r\n } else if (this.bodyOrHelper() == \"helper\") {\r\n return `${this.name()} (${this.helperName()})`;\r\n } else {\r\n return `${this.name()} (${this.body()})`;\r\n }\r\n }", "title": "" }, { "docid": "90c1fb7e7558e2ba7e58fa1ef114b02f", "score": "0.55105", "text": "function LabelField(value, displayValue, config) {\n this.register();\n this.setValue(value, displayValue);\n\n if (config) {\n this._config = config;\n\n if (config.link)\n \t this._link = true;\n }\n}", "title": "" }, { "docid": "acbbd26c03990157be59935585d3f35d", "score": "0.55081326", "text": "set _label(value) {\n Helper.UpdateInputAttribute(this, \"label\", value);\n }", "title": "" }, { "docid": "3bba044125aa4c366a8d3336585e4f33", "score": "0.55017394", "text": "_convertLabel() {\n\n if (this.isTypeahead || this.el.nodeName.toLowerCase() !== 'label') {\n return;\n }\n\n let newEl = document.createElement('fieldset');\n\n copyAttributes(this.el, newEl);\n appendChildren(newEl, this.el.children);\n\n if (this.el.parentNode) {\n this.el.parentNode.replaceChild(newEl, this.el);\n }\n\n this.el = newEl;\n }", "title": "" }, { "docid": "9b423636956865e5c7f780501496d315", "score": "0.5486436", "text": "function addLabelAlignment(_this) {\n\t//Defaults to left due to IBM BPM bug and backward compatibility for Brazos\n\tvar alignment = _this.context.options.formAlignment ? _this.context.options.formAlignment.get(\"value\") : \"inherit\";\n\tif(alignment == \"inherit\"){\n\t\talignment = getInheritedProperty(_this,\"formAlignment\") ? getInheritedProperty(_this,\"formAlignment\") : \"left\";\n\t}\n\t\n\t// Align labels to the left of input fields?\n\tif(alignment != \"above\") {\n\t\t$('.form-group',_this.context.element).removeClass(\"form-vertical\");\n\t\t$('.form-group div',_this.context.element).removeClass(\"form-vertical\");\n\t\t$('.form-group input',_this.context.element).removeClass(\"form-vertical\");\n\t\t$('.form-group label',_this.context.element).removeClass(\"form-vertical\");\n\t\t$(_this.context.element).addClass(\"form-horizontal\");\n\n\t\tvar labelSize = _this.context.options.labelSize ? _this.context.options.labelSize.get(\"value\") : null;\n\t\tif(!labelSize){\n\t\t\tlabelSize = getInheritedProperty(_this,\"labelSize\") ? getInheritedProperty(_this,\"labelSize\") : null;\n\t\t}\n\t\tif(labelSize) {\n\t\t\tvar size = labelSize;\n\t\t\tvar elementID = _this.context.element.id;\n\t\t\t$(\"#\" + elementID + \">*>.CoachView>*> .col-xs-3:not(.custom-width), #\" + elementID + \">*>.panel-group>*>*>*>*>*>*>*>.CoachView>*> .col-xs-3:not(.custom-width),#\" + elementID + \">*>.CoachView>.CoachView>*> .col-xs-3:not(.custom-width), #\" + elementID + \">*>.panel-group>*>*>*>*>*>*>*>.CoachView>.CoachView>*> .col-xs-3:not(.custom-width)\").addClass(\"col-xs-3-retro custom-width\").css(\"width\",size+\"px\");\n\t\t\t$(\"#\" + elementID + \">*>.CoachView>*> .col-xs-9:not(.custom-width), #\" + elementID + \">*>.panel-group>*>*>*>*>*>*>*>.CoachView>*> .col-xs-9:not(.custom-width),#\" + elementID + \">*>.CoachView>.CoachView>*> .col-xs-9:not(.custom-width), #\" + elementID + \">*>.panel-group>*>*>*>*>*>*>*>.CoachView>.CoachView>*> .col-xs-9:not(.custom-width)\").addClass(\"control-retro custom-width\").css(\"margin-left\",(20+Number(size))+\"px\").removeClass(\"col-xs-9\");\n\t\t\t$(\"#\" + elementID + \">*>.CoachView> .form-group:not(.custom-width), #\" + elementID + \">*>.panel-group>*>*>*>*>*>*>*>.CoachView> .form-group:not(.custom-width),#\" + elementID + \">*>.CoachView>.CoachView> .form-group:not(.custom-width), #\" + elementID + \">*>.panel-group>*>*>*>*>*>*>*>.CoachView>.CoachView> .form-group:not(.custom-width)\").addClass(\"form-group-retro custom-width\").removeClass(\"form-group\");\n\t\t}\n\t} else{\n\t\t$(_this.context.element).removeClass(\"form-horizontal\");\n\t\t$(_this.context.element).addClass(\"form-vertical\");\n\t}\n}", "title": "" }, { "docid": "c02a79d02cb8cbe14df3a35856807cf4", "score": "0.5481854", "text": "function labelFormatter(label, series) {\n\treturn \"<div style='font-size:8pt; text-align:center; padding:2px; color:white;'>\" + label + \"<br/>\" + (series.percentage).toFixed(2) + \"%</div>\";\n}", "title": "" }, { "docid": "41ab6295bf6dd498536125e385f0a396", "score": "0.5477702", "text": "set label(value) {\n this._label = value || this._label;\n this._renderer.setAttribute(this.nativeElement, 'aria-label', this._label);\n }", "title": "" }, { "docid": "1d5ed41fa08a1162ea9ea3329b312c5e", "score": "0.54755205", "text": "get labelText () {\n let t = \"?\";\n let c = this;\n // one of: null, value, multivalue, subclass, lookup, list, range, loop\n if (this.ctype === \"subclass\"){\n t = \"ISA \" + (this.type || \"?\");\n }\n else if (this.ctype === \"list\" || this.ctype === \"value\") {\n t = this.op + \" \" + this.value;\n }\n else if (this.ctype === \"lookup\") {\n t = this.op + \" \" + this.value;\n if (this.extraValue) t = t + \" IN \" + this.extraValue;\n }\n else if (this.ctype === \"multivalue\" || this.ctype === \"range\") {\n t = this.op + \" \" + this.values;\n }\n else if (this.ctype === \"null\") {\n t = this.op;\n }\n\n return (this.ctype !== \"subclass\" ? \"(\"+this.code+\") \" : \"\") + t;\n }", "title": "" }, { "docid": "7c9cfae1a0deb0b62aaa047cebe4b112", "score": "0.54751134", "text": "function getLabel(field) {\n\t\tvar labelEl = getParent(field,'label');\n\t\tvar id = field.id || field.name;\n\t\tif (!labelEl) {\n\t\t\tvar labels = gebtn('label');\n\t\t\tfor (var i=0;i<labels.length;i++){\n\t\t\t\tif (labels[i].htmlFor===id) {\n\t\t\t\t\tlabelEl = labels[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (labelEl) ? elemText(labelEl) : id;\n\t}", "title": "" }, { "docid": "781fde8df5a13c8b67d3b96e35dafb73", "score": "0.5469975", "text": "function getLabel(id) {\r\n var label = jQuery(\"[data-label_for='\" + id + \"']\");\r\n if (label) {\r\n return label.text();\r\n }\r\n else {\r\n return \"\";\r\n }\r\n}", "title": "" }, { "docid": "3af47b6e112faaf2c11a5394567cde57", "score": "0.5469168", "text": "function initLabel() {\n this.label = new Surface({\n size: this.options.itemSize, \n content: this.labelTemplate(this.options.items[this.options.defaultSelected].name)\n });\n this.label.setProperties( this.options.labelProperties );\n this.labelTransform = new Modifier();\n this.node.add(this.labelTransform).link(this.label);\n this.label.on('click', this.toggleMenu.bind(this) ); \n }", "title": "" }, { "docid": "d116bf515dd8d3b60fee68b59be395c1", "score": "0.54603", "text": "function createLabel(id,value) {\n\tvar label = document.createElement(\"label\");\n\tlabel.innerHTML = value;\n\tlabel.htmlFor = \"cb\"+id;\n\treturn label;\n}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "761cd1f1f2953dda7ab261f139c6412c", "score": "0.5448291", "text": "set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}", "title": "" }, { "docid": "acecf3b4d46faacddf23068a5e62fab6", "score": "0.54281956", "text": "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null)\n label.visible = e.subject.fromNode.data.category === \"Conditional\";\n }", "title": "" }, { "docid": "f019e0e42e75d9d81566faa395ac20b9", "score": "0.54271734", "text": "function label_to_textbox(){\n\t $( \".edit-label\" ).replaceWith( function() {\n\t \t$('.edit-btns').show();\n\t return \"<input type=\\\"text\\\" class=\\\"form-control edit-text\\\" value=\\\"\" + $( this ).html() + \"\\\" />\";\n\t });\n}", "title": "" }, { "docid": "1ec2d1ff08ce561efe2ceedf322cab4d", "score": "0.53978574", "text": "renderLabel(element) {\n if (element.label && (element.children !== null)) {\n return <Text style={styles.labelText}>{element.label}</Text>\n } else {\n return null\n }\n }", "title": "" }, { "docid": "1002e6d6170a9e60f13790f7604f7278", "score": "0.53964365", "text": "function Label(props) {\n const classNames = (props.class || []);\n return (React.createElement(\"label\", { htmlFor: props.for, className: classNames.join(\" \") },\n _(props.text),\n props.tooltip != null && React.createElement(tooltip_1.Tooltip, { text: props.tooltip })));\n}", "title": "" }, { "docid": "4da4beec34818c6aa79cac382391d491", "score": "0.5388447", "text": "DOM_add1 () {\r\n // zobrazení label\r\n this.DOM_Block= this.DOM_Input= jQuery('<div>')\r\n .appendTo(this.owner.DOM_Block ? this.owner.DOM_Block : this.owner.value.DOM_Block)\r\n .css(this.coord({textAlign: this._fc('c') ? 'center' : this._fc('r') ? 'right' : ''}))\r\n .html(this.options.title||'')\r\n .data('ezer',this)\r\n .addClass('Label3')\r\n .attr('title',this._fc('t')?(this.options.title||''):(this.options.help||''));\r\n // [0];\r\n this.DOM_optStyle(this.DOM_Block);\r\n }", "title": "" }, { "docid": "f243948185e9425b8ca0f73f0e28e109", "score": "0.5372754", "text": "function Label(props) {\n const { label, value, led = false } = props;\n return (\n <div className=\"pt-2 pb-2 container\">\n <div className=\"row\">\n <div className=\"col-sm\">\n <small className=\"font-weight-light text-secondary\">{label}</small>\n </div>\n </div>\n <div className=\"row\">\n <div className=\"col-sm\">\n <span>\n {typeof value === \"boolean\" && led ? (\n <span className={`mr-2 ${value ? \"dotTrue\" : \"dotFalse\"}`} />\n ) : (\n \"\"\n )}\n\n {renderValue(value)}\n </span>\n </div>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "5e5e8a240339a788e7d63197edbe3f1a", "score": "0.5372438", "text": "getLabel() {\n let labelStyle = \"default\";\n switch (this.state.request.status) {\n case RequestStatus.ACCEPTED:\n labelStyle = \"success\";\n break;\n case RequestStatus.CANCELLED:\n labelStyle = \"warning\";\n break;\n case RequestStatus.REJECTED:\n labelStyle = \"danger\";\n break;\n default:\n break;\n }\n return (\n <Label bsStyle={labelStyle} className=\"pull-right\">\n {getStatusString(this.state.request.status)}\n </Label>\n );\n }", "title": "" }, { "docid": "a1879bb1c7ba0b1c52073a82ea521bcf", "score": "0.5356239", "text": "function labelUpdate() {\n var current_state = node.select(\"text\").attr(\"display\");\n node.select(\"text\")\n .transition()\n .attr(\"display\",\n function () {\n if (current_state == 'block') {\n return \"none\"\n } else {\n return \"block\"\n }\n })\n }", "title": "" }, { "docid": "63d3a0f62601e840fe2625eb5b83bfd7", "score": "0.5348807", "text": "get label() {\n return this.getLabel();\n }", "title": "" }, { "docid": "2d64df68723d7efffcac03a211f48c45", "score": "0.53428453", "text": "function showSliderLabel(){\n $(function(){\n $('.slider').on('input change', function(){\n $(this).next($('.slider_label')).html(this.value);\n });\n $('.slider_label').each(function(){\n var value = $(this).prev().attr('value');\n $(this).html(value);\n });\n });\n }", "title": "" }, { "docid": "e51ed5f369152665daf367146ec3c45b", "score": "0.5341178", "text": "function Label (props) {\n return <_bs_Label id={props.id}>{renderString(props.children, props.options && props.options.lang)}</_bs_Label>\n}", "title": "" }, { "docid": "08bc6c46de65d2d658a6c4be81858b96", "score": "0.53365046", "text": "getLabel() {\n let labelStyle = \"default\";\n switch (this.state.request.status) {\n case RequestStatus_String.ACCEPTED:\n labelStyle = \"success\";\n break;\n case RequestStatus_String.CANCELLED:\n labelStyle = \"warning\";\n break;\n case RequestStatus_String.REJECTED:\n labelStyle = \"danger\";\n break;\n default:\n break;\n }\n return <Label bsStyle={labelStyle} className=\"pull-right\">{this.state.request.status}</Label>\n }", "title": "" }, { "docid": "b3a7b7b1a806126c7e50068e0b0ea551", "score": "0.5318347", "text": "function labelForElement(el) {\n let label = el.localName;\n if (el.id) {\n label = label + '#' + el.id;\n }\n return label;\n}", "title": "" }, { "docid": "68f9101b9f6bf3db6fbbc46bf240dfce", "score": "0.531181", "text": "function toggleLabelVisibility(displayAs){\n var labelFieldIsVisible = !( TF_LABEL.disabled == \"true\");\n \n if (displayAs != HIDDENFIELD && !labelFieldIsVisible) { // if non-hidden field & non-visible label field\n TF_LABEL.removeAttribute(\"disabled\") // then make label field visible\n TF_LABEL.setAttribute(\"value\",GRID_COLS.getRowValue().label); // and set value of it \n \n } else if (displayAs == HIDDENFIELD && labelFieldIsVisible) { // if hidden field\n TF_LABEL.setAttribute(\"value\",\"\"); // then set value field to empty string\n TF_LABEL.setAttribute(\"disabled\",\"true\"); // and make it non-editable\n }\n}", "title": "" }, { "docid": "5b578de35dca3733ac6a76f2af84882c", "score": "0.5297582", "text": "function _labelClick() {\n var $this = $(this);\n\n if ($this.find('.custom-checkbox')) {\n _toggleCheckbox($this.find('.custom-checkbox'));\n } else if ($this.find('.custom-radio')) {\n _toggleRadio($this.find('.custom-radio'));\n }\n }", "title": "" }, { "docid": "535f27c2cc8f2af2267a66e4187c158e", "score": "0.5282253", "text": "function change_label() {\n var counter = 0;\n for (i = 0; i < student_list.length; i++) {\n if (student_list[i] == 1) {\n counter = counter + 1;\n var idx = i + 1;\n var id = \"student_label_\" + idx;\n var str = \"Student \" + counter;\n change_inner_html(id, str);\n }\n }\n }", "title": "" }, { "docid": "6bea5d67145cbddbe70157ab451bc29c", "score": "0.5278504", "text": "function set_shortcode_label(name) {\n shortcode_label.innerText = \":\" + name + \":\";\n}", "title": "" }, { "docid": "8929d97772077f3296a979f27ed169dd", "score": "0.5275437", "text": "_hideLabelIfEmpty() {\n const label = this._elements.label;\n\n // If it's empty and has no non-textnode children, hide the label\n const hiddenValue = !(label.children.length === 0 && label.textContent.replace(/\\s*/g, '') === '');\n\n // Toggle the screen reader text\n this._elements.labelWrapper.style.margin = !hiddenValue ? '0' : '';\n this._elements.screenReaderOnly.hidden = hiddenValue || this.labelled;\n }", "title": "" }, { "docid": "129d90a2b7d8ed730463feca5826ed2c", "score": "0.52749926", "text": "function showLabel(ele) {\n\tdocument.getElementById(ele).innerHTML = 'Collapse';\n}", "title": "" }, { "docid": "1a4a6179a62b360b6c99d200748122b8", "score": "0.5274645", "text": "function Label(props) {\n return <span className=\"label\">{props.label}</span>;\n}", "title": "" }, { "docid": "8343211e674946e274416b8d21bc793a", "score": "0.52718484", "text": "function createMarkerLabelHTML( that, marker ) {\n\n var primaryPosition,\n secondaryPosition;\n\n if (that.isXAxis) {\n // if x axis, add half of label length as text is anchored from bottom\n primaryPosition = marker.pixel - that.MAX_LABEL_UNROTATED_WIDTH*0.5;\n secondaryPosition = that.LARGE_MARKER_LENGTH\n + SPACING_BETWEEN_MARKER_AND_LABEL;\n } else {\n primaryPosition = marker.pixel - that.MAX_LABEL_HEIGHT*0.5;\n secondaryPosition = that.LARGE_MARKER_LENGTH\n + SPACING_BETWEEN_MARKER_AND_LABEL;\n }\n\n return '<div class=\"' + AXIS_LABEL_CLASS + ' '\n + that.horizontalOrVertical + AXIS_POSITIONED_LABEL_CLASS_SUFFIX + '\"'\n + 'style=\"position:absolute;'\n + 'text-align: center; ' // center text horizontally\n + 'width: ' + that.MAX_LABEL_WIDTH + 'px;'\n + 'height: ' + that.MAX_LABEL_HEIGHT + 'px;'\n + 'line-height: ' + that.MAX_LABEL_HEIGHT + 'px;' // center text vertically\n + that.leftOrTop + \":\" + primaryPosition + 'px;'\n + that.oppositePosition + \":\" + secondaryPosition + 'px;\">'\n + AxisUtil.formatText( marker.label, that.unitSpec )\n +'</div>';\n }", "title": "" }, { "docid": "1096b35e1592cb9c820a1d72122e678b", "score": "0.52641517", "text": "getLabel() {\n return this.viewValue;\n }", "title": "" }, { "docid": "1096b35e1592cb9c820a1d72122e678b", "score": "0.52641517", "text": "getLabel() {\n return this.viewValue;\n }", "title": "" }, { "docid": "23e347622fdc01c5d648481f4161171f", "score": "0.52602667", "text": "function Label(opt_options){\n\t\t// Initialization\n\t\tthis.setValues(opt_options);\n\n\t\t// Label specific\n\t\tvar span = this.span_ = document.createElement('span');\n\t\t$(span).addClass(\"poi_label\");\n\t\t// span.id = \"testingLabels\";\n\n\t\tvar div = this.div_ = document.createElement('div');\n\t\t$(div).addClass(\"poi_label_container\");\n\t\tdiv.appendChild(span);\n\t}", "title": "" }, { "docid": "061b15a9b907c18e1049d834189e5bb4", "score": "0.52581656", "text": "lableOnFocus(){\n\n \treturn \"cp-floating-label\"+((this.state.selected===\"true\") ?' cp-label-blue':'');\n\n }", "title": "" }, { "docid": "fa88b51ac23b91d0b459ef9fcd902faf", "score": "0.5256901", "text": "function lockShowLabelTag () {\n lock.showLabelTag = true;\n return this;\n }", "title": "" }, { "docid": "9dd90172c4a33861f90b4cdaf0449032", "score": "0.52564967", "text": "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null)\n label.visible = e.subject.fromNode.data.figure === \"Diamond\";\n }", "title": "" }, { "docid": "9e351e26579f045649d8cd01cef50579", "score": "0.5254969", "text": "labelClass () {\n let klass = ''\n\n if (this.state.error) {\n klass += ' usa-input-error-label'\n }\n\n if (this.state.checked) {\n klass += ' checked'\n }\n\n if (this.props.toggle === 'false') {\n klass += ' no-toggle'\n }\n\n return klass.trim()\n }", "title": "" }, { "docid": "62138161e354e128dccc9871100de106", "score": "0.52518636", "text": "function CreateLabel(myJson) {\n var result = '';\n\n if (myJson.TableName != null) {\n\n var tableName = myJson.TableName;\n\n //If there are multiple table names then split them by comma\n if (Array.isArray(tableName)) {\n\n result = '<b>' + myJson.BlockType + '</b>';\n tableName = tableName[0].split(',');\n\n tableName.forEach(function(el, index) {\n\n result = result + '\\n<i>' + el + '</i>';\n });\n\n\n\n } else {\n result = '<b>' + myJson.BlockType + '</b>\\n<i>' + myJson.TableName + '</i>';\n }\n\n } else {\n result = '<b>' + myJson.BlockType + '</b>';\n }\n\n return result;\n\n }", "title": "" }, { "docid": "63389b7020cb26ef8b99e506dc4d944e", "score": "0.5243699", "text": "get text(){ return this.__label.text; }", "title": "" }, { "docid": "a5c3626793aea3458a3d6cae15ff438b", "score": "0.5241919", "text": "get label() {\n var of;\n var v = this._label;\n return v !== undefined || !(of = this.of) ? v : of.label;\n }", "title": "" }, { "docid": "b7520ad72345efe86ab751c94cd92435", "score": "0.5238596", "text": "render(){\n\t\treturn <>\n\t\t\t<div className=\"floating-label\">\n\t\t\t\t<input\n\t\t\t\t\tclassName={`pb-1 pt-3 ${this.props.className}`}\n\t\t\t\t\ttype={this.props.type}\n\t\t\t\t\tid={this.props.id ? this.props.id : `floating-label${parseInt(Math.random()*1000)}`}\n\t\t\t\t\tvalue={this.state.text}\n\t\t\t\t\tonChange={event => {\n\t\t\t\t\t\tthis.handleTextChange(event);\n\t\t\t\t\t\tif(this.props.onChange){\n\t\t\t\t\t\t\tthis.props.onChange(event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}} />\n\n\t\t\t\t<label className={`pl-3 ${this.state.isActive ? \"floating-label-active\" : \"\"}`}>\n\t\t\t\t\t{this.props.label}\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t</>;\n\t}", "title": "" }, { "docid": "40150c48bf2d425ae83f3902abdc1271", "score": "0.5236188", "text": "getLabel() {\n if (this.schema.title) {\n return this.schema.title;\n }\n if (this.label) {\n return this.label;\n }\n return \"\";\n }", "title": "" }, { "docid": "1ef9f84f21a3e9c5091d63448137904e", "score": "0.5230164", "text": "get label(){ return this.__label; }", "title": "" }, { "docid": "5d9f6f2d57e0406a235f0846e3feedd8", "score": "0.52251554", "text": "function showLabelInfo()\n{\n\t$(\"#infoGame\").append(\"<p> <label id='infoGameLabelGrap'> <strong> Info: </strong></label></p>\")\n}", "title": "" }, { "docid": "1f87c9ca65edebe0637b89c6ce737e92", "score": "0.5224102", "text": "get label() {\n return this.node.querySelector('label span').textContent;\n }", "title": "" }, { "docid": "4ddc5bd0e4610e145743c72f601d4b6b", "score": "0.52178925", "text": "function findLabel (element) \n\t{\t\t\n\t\t// search for \"wrap\" labels\n\t\tvar label = \"-\";\t\n\t\tif (element.closest) { // IE does not implements closest method :(\n\t\t\tlabel = element.closest(\"label\");\n\t\t}\t\n\t\t\n\t\t// if not found search for \"for\" labels\t\n\t\tif (!label && element.id) {\n\t\t\tvar selector = \"label[for=\\\"\" + element.id + \"\\\"]\";\n\t\t\tlabel = document.querySelector(selector);\t\t\t\n\t\t}\n\t\t\n\t\t// try with placeholder\n\t\t/*if (!label && element.placeholder) {\n\t\t\tlabel = element.placeholder;\n\t\t}*/\n\t\t\n\t\tif (label===undefined) {\n\t\t\tlabel = \"-\";\n\t\t}\n\t\t\n\t\treturn label;\n\t}", "title": "" }, { "docid": "f11fafb0936c8da6f9fe336edfc87d1f", "score": "0.52168536", "text": "function designElementProperty_LABEL(selectedElement) {\n \n // if there are no children: TEXT CONTENT\n addProp('Text', true, '<gs-text class=\"target\" value=\"' + (selectedElement.textContent || '') + '\" mini></gs-text>', function () {\n selectedElement.textContent = this.value;\n \n return selectedElement;\n });\n \n // TITLE attribute\n addProp('Title', true, '<gs-text class=\"target\" value=\"' + (selectedElement.getAttribute('title') || '') + '\" mini></gs-text>', function () {\n return setOrRemoveTextAttribute(selectedElement, 'title', this.value);\n });\n\n addFlexContainerProps(selectedElement);\n addFlexProps(selectedElement);\n \n addProp('For', true, '<gs-text class=\"target\" value=\"' + (selectedElement.getAttribute('for') || '') + '\" mini></gs-text>', function () {\n return setOrRemoveTextAttribute(selectedElement, 'for', this.value);\n });\n \n addProp('Mini', true, '<gs-checkbox class=\"target\" value=\"' + (selectedElement.hasAttribute('mini')) + '\" mini></gs-checkbox>', function () {\n return setOrRemoveBooleanAttribute(selectedElement, 'mini', (this.value === 'true'), true);\n });\n}", "title": "" }, { "docid": "1cf49c99fc05defda64c24b3ffeba956", "score": "0.52161777", "text": "__updateLabel() {\n var listItem = this.getChildControl(\"list\").getSelection()[0];\n var atom = this.getChildControl(\"atom\");\n var label = listItem ? listItem.getLabel() : \"\";\n var format = this.getFormat();\n if (format != null && listItem) {\n label = format.call(this, listItem);\n }\n\n // check for translation\n if (label && label.translate) {\n label = label.translate();\n }\n label == null ? atom.resetLabel() : atom.setLabel(label);\n }", "title": "" }, { "docid": "b13a38dc47e87f17f9279fc43dd8f807", "score": "0.52142125", "text": "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure == \"Diamond\");\n }", "title": "" }, { "docid": "c7039e9c97e7f55fc1ea12bc736571da", "score": "0.5213121", "text": "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "title": "" }, { "docid": "bcf7c2ef14248c079891d0b8edbf96d1", "score": "0.5208682", "text": "function refreshLabel () {\n let htmlString = `<img src=\"assets/javascripts/SVValidate/img/HideLabel.svg\" class=\"upper-menu-button-icon\" alt=\"Hide Label\">\n <br /><u>H</u>ide Label</button>`;\n labelVisibilityControlButton.html(htmlString);\n labelVisibilityControlButton.css({\n \"background\": \"\"\n });\n }", "title": "" }, { "docid": "d9c9a875af0acbb72da068c182b7e6bc", "score": "0.5204821", "text": "function _layout_initLabelTextControls() {\n var data = getDataDictionaryData();\n //debugger;\n if (data) {\n $.each(data, function (index) {\n var fieldName = data[index].FieldName;\n var fieldDisplayText = data[index].FieldDisplayText;\n var labelElement;\n labelElement = \"label[for='\" + fieldName.toString() + \"']\";\n //labelElement = \".editor-label label[for='\" + fieldName.toString() + \"']\";\n $(labelElement).text(fieldDisplayText);\n }); \n }\n}", "title": "" }, { "docid": "2e8731abbd4c714ecbbd1b01df90cfc8", "score": "0.5203238", "text": "getLabelTitle() {\n return \"Others\";\n }", "title": "" }, { "docid": "d776899c6f6df5c356e10b191666f891", "score": "0.5199515", "text": "function getNeighborhoodLabelHTML(neighborhoodId, neighborhoodName) {\n\tvar displayName;\n\n\tswitch(parseInt(neighborhoodId)) {\n\t\tcase 4:\n\t\t\tdisplayName = \"Adams<br/>Morgan\";\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tdisplayName = \"Columbia<br/>Heights\";\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tdisplayName = \"Dupont<br/>Circle\";\n\t\t\tbreak;\n\t\tcase 13:\n\t\t\tdisplayName = \"Logan<br/>Circle\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tdisplayName = neighborhoodName;\n\t}\n\n\treturn \"<div class='neighborhood-label' data-neighborhood-name='\" + neighborhoodName + \n\t\t\"' data-neighborhood-id=\" + neighborhoodId + \" style='font-size: 0.85rem;'>\" + \n\t\t\"<div class='name-label'>\" + displayName + \"</div>\" +\n\t\t\"<div class='location-count-label'></div></div>\";\n}", "title": "" } ]
ccf0fcccc5f1f0e46cb5a79e4c1acfec
Pulls function status. Periodically sends request to get function's state, until state will not be 'ready' or 'error'
[ { "docid": "a7b75e0620b9aaacafa746ff83d17ce0", "score": "0.76016587", "text": "function pullFunctionState() {\n ctrl.isDeployResultShown = true;\n lodash.set(ctrl.version, 'status.logs', []);\n setDeployResult('building');\n\n interval = $interval(function () {\n ctrl.getFunction({ metadata: ctrl.version.metadata, projectID: lodash.get(ctrl.project, 'metadata.name') })\n .then(function (response) {\n ctrl.version.status = response.status;\n\n if (response.status.state === 'ready' || response.status.state === 'error') {\n terminateInterval();\n\n ctrl.versionDeployed = true;\n\n ctrl.version = response;\n ctrl.version.ui = {\n deployedVersion: getVersionCopy(),\n versionChanged: false\n };\n\n setInvocationUrl();\n setIngressHost();\n\n ctrl.isFunctionDeployed = true;\n }\n\n $rootScope.$broadcast('deploy-result-changed');\n\n lodash.set(lodash.find(ctrl.navigationTabsConfig, 'status'), 'status', response.status.state);\n\n $timeout(function () {\n angular.element('.log-panel').mCustomScrollbar('scrollTo', 'bottom');\n });\n })\n .catch(function (error) {\n if (error.status !== 404) {\n ctrl.isSplashShowed.value = false;\n }\n });\n }, 2000);\n }", "title": "" } ]
[ { "docid": "e9068eaa89600c0643a5ec145be4b790", "score": "0.7620748", "text": "function pullFunctionState() {\n lodash.set(lodash.find(ctrl.navigationTabsConfig, 'status'), 'status', 'building');\n\n interval = $interval(function () {\n ctrl.getFunction({metadata: ctrl.version.metadata, projectID: ctrl.project.metadata.name})\n .then(function (response) {\n if (response.status.state === 'ready' || response.status.state === 'error') {\n if (!lodash.isNil(interval)) {\n $interval.cancel(interval);\n interval = null;\n }\n\n ctrl.versionDeployed = true;\n\n if (lodash.isNil(ctrl.version.status)) {\n ctrl.version.status = response.status;\n }\n ctrl.version.ui = {\n deployedVersion: getVersionCopy(),\n versionChanged: false\n };\n\n ctrl.getExternalIpAddresses()\n .then(setInvocationUrl)\n .catch(function () {\n ctrl.version.ui.invocationURL = '';\n });\n\n ctrl.isFunctionDeployed = true;\n }\n\n ctrl.version.ui.deployResult = response;\n\n ctrl.deployResult = response;\n\n lodash.set(lodash.find(ctrl.navigationTabsConfig, 'status'), 'status', response.status.state);\n\n $timeout(function () {\n angular.element('.log-panel').mCustomScrollbar('scrollTo', 'bottom');\n });\n })\n .catch(function (error) {\n if (error.status !== 404) {\n if (!lodash.isNil(interval)) {\n $interval.cancel(interval);\n interval = null;\n }\n\n ctrl.isSplashShowed.value = false;\n }\n });\n }, 2000);\n }", "title": "" }, { "docid": "03d318654d3928218f06cd6883d32cdc", "score": "0.75840026", "text": "function pullFunctionState() {\n lodash.set(lodash.find(ctrl.navigationTabsConfig, 'status'), 'status', 'building');\n\n interval = $interval(function () {\n ctrl.getFunction({ metadata: ctrl.version.metadata, projectID: ctrl.project.metadata.name }).then(function (response) {\n if (response.status.state === 'ready' || response.status.state === 'error') {\n if (!lodash.isNil(interval)) {\n $interval.cancel(interval);\n interval = null;\n }\n\n ctrl.versionDeployed = true;\n\n if (lodash.isNil(ctrl.version.status)) {\n ctrl.version.status = response.status;\n }\n ctrl.version.ui = {\n deployedVersion: getVersionCopy(),\n versionChanged: false\n };\n\n ctrl.getExternalIpAddresses().then(setInvocationUrl).catch(function () {\n ctrl.version.ui.invocationURL = '';\n });\n\n ctrl.isFunctionDeployed = true;\n }\n\n ctrl.version.ui.deployResult = response;\n\n ctrl.deployResult = response;\n\n lodash.set(lodash.find(ctrl.navigationTabsConfig, 'status'), 'status', response.status.state);\n\n $timeout(function () {\n angular.element('.log-panel').mCustomScrollbar('scrollTo', 'bottom');\n });\n }).catch(function (error) {\n if (error.status !== 404) {\n if (!lodash.isNil(interval)) {\n $interval.cancel(interval);\n interval = null;\n }\n\n ctrl.isSplashShowed.value = false;\n }\n });\n }, 2000);\n }", "title": "" }, { "docid": "dad291ef648fd513c07b9facaa821b0c", "score": "0.6710769", "text": "getPowerState(callback) {\n var that = this;\n var onError = function (err) {\n if (that.debug)\n that.log('Error: ', err);\n if (!isNull(callback))\n callback(null, false);\n that.updatePowerState(false);\n };\n var onSucces = function (chunk) {\n var _json = null;\n try {\n _json = JSON.parse(chunk);\n if (!isNull(_json) && !isNull(_json.result[0]) && _json.result[0].status === 'active') {\n that.updatePowerState(true);\n if (!isNull(callback))\n callback(null, true);\n } else {\n that.updatePowerState(false);\n if (!isNull(callback))\n callback(null, false);\n }\n } catch (e) {\n if (that.debug)\n console.log(e);\n that.updatePowerState(false);\n if (!isNull(callback))\n callback(null, false);\n }\n };\n try {\n var post_data = '{\"id\":2,\"method\":\"getPowerStatus\",\"version\":\"1.0\",\"params\":[]}';\n that.makeHttpRequest(onError, onSucces, '/sony/system/', post_data, false);\n } catch (globalExcp) {\n if (that.debug)\n console.log(globalExcp);\n that.updatePowerState(false);\n if (!isNull(callback))\n callback(null, false);\n }\n }", "title": "" }, { "docid": "82d8df95559e367693ae81d23e36e97e", "score": "0.63695943", "text": "function initial_status() {\n\t\n\t// Heartbeat status checks for all WPS nodes\n\tconfig.wps.nodes.forEach(function(host) {\n\t\tlet port = config.wps.port;\n\t\tlet url = \"/wps/heartbeat\";\n\t\tlet type = \"wps\";\n\t\t\n\t\tget_request(host, url, port, function(data) {\n\t\t\tif(data.success) {\n\t\t\t\treturn update_status(host, type, data.status, data.ready);\n\t\t\t}\n\t\t});\n\t});\n\t\n\t// Heartbeat status checks for all WRF nodes\n\tconfig.wrf.nodes.forEach(function(host) {\n\t\tlet port = config.wrf.port;\n\t\tlet url = \"/wrf/heartbeat\";\n\t\tlet type = \"wrf\";\n\t\t\n\t\tget_request(host, url, port, function(data) {\n\t\t\tif(data.success) {\n\t\t\t\treturn update_status(host, type, data.status, data.ready);\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "f2378cc048a8cb1759fc920f371dcc1f", "score": "0.6346974", "text": "function refreshServiceStatus() {\n sendWithPromise('getServiceStatus').then(onGetServiceStatus);\n}", "title": "" }, { "docid": "834e177d29fa03342cd2c4e88d78c4d5", "score": "0.6297526", "text": "function getStatus(){\n\t$.get('/commands/', { command : \"getStatus\"}, function(res, status, statusName){\n\t\tif(status != 'success'){\n\t\t\tconsole.log(\"Call didn't work...\", res,status, statusName);\n\t\t\treturn ;\n\t\t}\n\t\tres = jQuery.parseJSON(res);\n\t\tupdateInterfaceWithStatusObject(res);\n\t});\n}", "title": "" }, { "docid": "f2f784531ca30836685f866b835621b0", "score": "0.6228267", "text": "function checkStatus() {\n if ( typeof checkStatus.uptime == 'undefined' ) {\n // It has not... perform the initialization\n checkStatus.uptime = 0;\n }\n sendMessage(\"agent/ping\", \"\", \"post\",\n function(data, status, xhr) {\n $(\"#agent_status\").html(\"Connected <br>to Agent\");\n $(\"#agent_status\").css({\n \"background\": 'linear-gradient(to bottom, #89c403 5%, #77a809 100%)',\n \"background-color\": '#89c403',\n \"border\": '1px solid #74b807',\n \"text-shadow\": '0px 1px 0px #528009',\n 'left': '-150px'\n })\n last_ts = parseInt(data)\n if (checkStatus.uptime > last_ts) {\n $(\"#restart_status\").hide()\n }\n checkStatus.uptime = last_ts \n },function() {\n $(\"#agent_status\").html(\"Not connected<br> to Agent\");\n $(\"#agent_status\").css({\n \"background\": 'linear-gradient(to bottom, #c62d1f 5%, #f24437 100%)',\n \"background-color\": '#c62d1f',\n \"border\": '1px solid #d02718',\n \"text-shadow\": '0px 1px 0px #810e05',\n 'left': '-180px'\n })\n });\n}", "title": "" }, { "docid": "a4cc8380b33e00e869284190bb92795e", "score": "0.62233734", "text": "function onStatusRequest() {\n var request = new XMLHttpRequest();\n request.open(\"GET\", `${urlHostAPI}?cmd=status&name=${username}`, true);\n request.timeout = 2000;\n request.onload = onStatusResponse;\n request.send();\n}", "title": "" }, { "docid": "f374a08e223eb8508571a00ea1d56961", "score": "0.6202988", "text": "function pollStatus() {\n // check if UploadisInProgress in case the user is uploading a large file or has a slow connection.\n if (errorCnt >= 5 && !Upload.isUploadInProgress()) {\n return stopPolling();\n }\n ResultsDataFactory.showStatus = true;\n $http.get(REST_ROOT + 'validate/status').then(\n function (response) {\n if (response.data.error && errorCnt >= 4 && !ResultsDataFactory.validationMessages) {\n ResultsDataFactory.error = response.data.error;\n errorCnt++;\n ResultsDataFactory.showOkButton = true;\n } else if (response.data.error) {\n errorCnt++;\n } else {\n ResultsDataFactory.status = response.data.status;\n ResultsDataFactory.error = null;\n errorCnt = 0;\n }\n\n // wait 1 second before polling again\n if (poll) {\n polling = $timeout(pollStatus, 1000);\n }\n }\n )\n }", "title": "" }, { "docid": "1a3a07544105401f9c387e25bfcda84c", "score": "0.61824054", "text": "function getStatus() {\n var url = field(\"restUrl\") + \"/getStatus\";\n var currentCallId = { callId: callId };\n $(\"#callTrace\").text(callId + \" >>> \" + field(\"rtmpUrl\"));\n var data = JSON.stringify(currentCallId);\n sendREST(url, data);\n}", "title": "" }, { "docid": "679b7d19ceef4fcf9ecd4b52df9f490a", "score": "0.60521394", "text": "function updateStatus() {\n $.getJSON( config.api + \"/v1/status\", function( data ) {\n var formattedDate = new Date(data.date*1000).toLocaleTimeString(config.time.locale, config.time.options);\n\n updatePing(data.comm*1000)\n\n if (data.status === 'closed') {\n updateDisplay('jsUnavailable', 'Unavailable', formattedDate);\n changeFavicon('assets/img/closedsign.gif');\n }else {\n updateDisplay('jsAvailable', 'Available', formattedDate);\n if (alertRequested()) {\n postNotification();\n }\n alertRequested(false);\n changeFavicon('assets/img/opensign.gif');\n }\n });\n}", "title": "" }, { "docid": "23e0471526de230e80424ce6b13b5263", "score": "0.601414", "text": "function checkStatus() {\n return new Promise((resolve, reject) => {\n getStatusFromCache()\n .then(function(data) {\n resolve(data);\n })\n .catch(function(err) {\n resolve(scrapeStatus());\n });\n });\n}", "title": "" }, { "docid": "ecfdf3cb8a4abdaed3797a5d86ac59ed", "score": "0.60044676", "text": "function GetStatus(){\n\tSendCommand(\"status\");\n}", "title": "" }, { "docid": "b66f00e87ba513e4dbcc460919fac219", "score": "0.59911764", "text": "function queryStatus()\n{\n sendHtmlJsonRequest(\"get_status.php\", { type : 5 }, processQueryStatus, queryStatusError);\n}", "title": "" }, { "docid": "b99502601878d1d5a0a99b360b845c6c", "score": "0.5948211", "text": "function update_status () {\n $timeout(function () {\n var system_status = system_service.get_system_status_by_type(\"flow_tjl\"); /* Must use flow_tjl value*/\n console.log('hv tgc flowtjl controller: query system status FlowOut[%s]', system_status);\n\n if (system_status == \"start\") {\n $scope.tgc_lock_state = true;\n $scope.hv_lock_state = true;\n }\n else if (system_status == \"stop\") {\n $scope.hv_lock_state = hv_tgc_service.get_lock_state(\"flow_tjl\", \"hv\");\n $scope.tgc_lock_state = hv_tgc_service.get_lock_state(\"flow_tjl\", \"tgc\");\n }\n else {\n console.log('hv tgc flowtjl controller: received invalid system status - '+system_status);\n }\n }, 0);\n }", "title": "" }, { "docid": "62bec1d1ee66cbab91d26459e9f44d22", "score": "0.59119326", "text": "async function Status(){\n\t\n\tvar data = String(PayloadUUID);\n\n\tvar options = {\n\t method: 'GET',\n\t url: 'https://xumm.app/api/v1/platform/payload/' + data,\n\t headers: {\n\t 'x-api-key': apikey,\n\t 'x-api-secret': apisecret,\n\t 'content-type': 'application/json'\n\t \n\t },\n\t};\n\n\trequest(options, function (error, response, body) {\n\t if (error) throw new Error(error);\n\n\t var jsonBody = JSON.parse(body)\n\t console.log(\"I Am Status Body: \" + jsonBody)\n\t\n\t});\n\t\n}", "title": "" }, { "docid": "6d39640931e912cf9e5b6af9a375aafa", "score": "0.58988506", "text": "function poll_state() {\n $.ajax({\n url: ROOT_URL + '/state',\n type: 'GET',\n dataType: 'JSON',\n success: function(data) { \n state_data = data;\n update_cells();\n update_list();\n }\n });\n}", "title": "" }, { "docid": "74203e77ea74182df92ec73cf1a1951b", "score": "0.58755106", "text": "status() {\n const options = utils.buildOptions(this.apiUrl, `${this.path}/status`, 'get');\n return this.apiCall(options);\n }", "title": "" }, { "docid": "abfe8fd2af64b454f8b54da09f1b8562", "score": "0.5871833", "text": "function current_status(host, type) {\n\tlet stats = all_stats();\n\treturn stats[host][type].ready;\n}", "title": "" }, { "docid": "f34669e98f47b794c218b809dca198a9", "score": "0.58676416", "text": "function getStatus () {\n $.get('http://localhost:5001/api/v1/status/',\n function (data, status) {\n if (data.status === 'OK') {\n $('DIV#api_status').addClass('available');\n getPlaces();\n } else {\n $('DIV#api_status').removeClass('available');\n }\n }\n );\n}", "title": "" }, { "docid": "b452c737c1a65e636b62423ccd6aeb65", "score": "0.5862414", "text": "pollStatus() {\n // check if UploadisInProgress in case the user is uploading a large file or has a slow connection.\n // TODO fix this\n if (this.errorCnt >= 5) {\n // && !Upload.isUploadInProgress()) {\n this.stopPolling();\n return;\n }\n\n this.$http.get(`${this.restRoot}data/status`).then(({ data }) => {\n // TODO fix this\n if (data.error && this.errorCnt >= 4) {\n // && !ResultsDataFactory.validationMessages) {\n this.emit('error', data.error);\n this.errorCnt++;\n } else if (data.error) {\n this.errorCnt++;\n } else {\n this.emit('status', data.status);\n this.errorCnt = 0;\n }\n\n // wait 1 second before polling again\n if (this.poll) {\n this.pollingTimeoutId = setTimeout(this.pollStatus, 1000);\n }\n });\n }", "title": "" }, { "docid": "fae0ef76a6ef839a230fcd0404a71b5e", "score": "0.5840748", "text": "function getStatus() {\n\tSiad.apiCall('/wallet', updateStatus);\n}", "title": "" }, { "docid": "bc0a948c40aafd47f5c89670c6be5bc1", "score": "0.5817489", "text": "function _getStatus(url, callback) {\n\n let here = this;\n request = Soup.Message.new('GET', url);\n _httpSession.queue_message(request, function(_httpSession, request) {\n\tif (request.status_code !== 200) {\n callback(request.status_code, null);\n return;\n\t}\n\tlet jsondata = JSON.parse(request.response_body.data);\n\tcallback.call(here, jsondata);\n });\n}", "title": "" }, { "docid": "bb1bf2ee6647bcaf68974dd2f9ef9715", "score": "0.58057624", "text": "getUserStatus() {\n for (var _len8 = arguments.length, args = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n args[_key8] = arguments[_key8];\n }\n\n return _bluebird2.default.try(() => {\n var _source13 = source.apply(undefined, args),\n _source14 = _slicedToArray(_source13, 2),\n _source14$ = _slicedToArray(_source14[0], 2),\n _source14$$ = _source14$[0];\n\n _source14$$ = _source14$$ === undefined ? {} : _source14$$;\n const authyId = _source14$$.authyId;\n var _source14$$2 = _source14$[1];\n _source14$$2 = _source14$$2 === undefined ? {} : _source14$$2;\n const ip = _source14$$2.ip,\n callback = _source14[1];\n\n\n log.debug({ authyId: authyId }, `Retrieving user ${authyId} status`);\n\n (0, _validator.validate)({ authyId: authyId, ip: ip }, {\n authyId: [_validator.Assert.required(), _validator.Assert.authyId()],\n ip: _validator.Assert.Ip()\n });\n\n return this.rpc.getAsync({\n body: _lodash2.default.pickBy({\n user_ip: ip\n }, _lodash2.default.identity),\n uri: _urlEscapeTag2.default`users/${authyId}/status`\n }).bind(this).then(_responseParser2.default).tap(response => {\n (0, _validator.assert)(response, {\n message: [_validator.Assert.required(), _validator.Assert.equalTo('User status.')],\n status: {\n authy_id: [_validator.Assert.required(), _validator.Assert.authyId()],\n confirmed: [_validator.Assert.required(), _validator.Assert.boolean()],\n country_code: [_validator.Assert.required(), _validator.Assert.countryOrCallingCode()],\n devices: _validator.Assert.required(),\n has_hard_token: [_validator.Assert.required(), _validator.Assert.boolean()],\n phone_number: [_validator.Assert.required(), _validator.Assert.string()],\n registered: [_validator.Assert.required(), _validator.Assert.boolean()]\n }\n });\n }).asCallback(callback);\n });\n }", "title": "" }, { "docid": "11adcf6719995963c7ab22fdf58c5b50", "score": "0.580311", "text": "function refresh() {\n $.get(\"/api?drone_uid=\" + droneUID + \"&subset=state\")\n .done(function(result) {\n // Available: result.command, result.voltage, result.status, result.error\n $(\"#current-command\").text(result.command);\n var status = result.status;\n if (status == \"disarmed\") {\n switchOff(\"#arm-switch\");\n switchOff(\"#motor-switch\");\n } else if (status == \"armed\") {\n switchOn(\"#arm-switch\");\n switchOff(\"#motor-switch\");\n } else if (status == \"throttled\") {\n switchOn(\"#arm-switch\");\n enableSwitch(\"#motor-switch\");\n switchOn(\"#motor-switch\");\n }\n });\n}", "title": "" }, { "docid": "3246d8542d7e1bcecfe10069efaf3494", "score": "0.5785326", "text": "function status(){\n sendMessage(stat, \"Status\");\n setTimeout(status, 10000);\n}", "title": "" }, { "docid": "ecdd739efe694ec6a174581583470d42", "score": "0.57845014", "text": "queryPlugStatus() {\n if (this.device && this.token) {\n let req = new XMLHttpRequest();\n let self = this;\n req.open('POST', 'https://wap.tplinkcloud.com?token=' + this.token);\n req.setRequestHeader('Content-type', 'application/json');\n \n req.onreadystatechange = function() {\n if(req.readyState == 4 && req.status == 200) {\n let response = JSON.parse(req.responseText);\n if (response && response.result && response.result.responseData) {\n let responseData = JSON.parse(response.result.responseData);\n if (responseData && responseData.system && responseData.system.get_sysinfo) {\n let sysInfo = responseData.system.get_sysinfo;\n self.status = sysInfo.relay_state ? true : false;\n self.onTime = sysInfo.on_time;\n }\n }\n }\n }\n \n statusMessage.params.deviceId = this.device;\n req.send(JSON.stringify(statusMessage));\n }\n\n setTimeout(this.queryPlugStatus.bind(this), 1000);\n }", "title": "" }, { "docid": "33c5d38a207710ecf085da620ed59ab3", "score": "0.5781826", "text": "getCurrentFanState(callback) {\n if (this.mqttClient.connected) {\n this.mqttEvent.once(this.STATE_EVENT, () => {\n this.log.info(this.displayName + \" - Current Fan State: \" + this.fanState.fanOn);\n callback(null, this.fanState.fanOn ? 2 : 0);\n });\n // Request for update\n this.requestForCurrentUpdate();\n } else {\n callback(null, 0);\n }\n }", "title": "" }, { "docid": "ed8bd6d90e81e1de0b17f3ddf2f3ac9b", "score": "0.57646435", "text": "function streamStatus(){\n //console.log(\"checking stream status\");\n https.get(url+currentlyStreaming.urldata, function(res){\n \n var body = '';\n\n res.on('data', function(chunk){\n body += chunk;\n });\n\n res.on('error', function(err) {\n console.log(err);\n });\n\n res.on('end',function(){\n if(res.statusCode === 503 ){\n console.log(\"error occoured trying again main\");\n streamStatus();\n }\n var response = JSON.parse(body);\n //console.log(response);\n if(response.stream === null){\n voteswitch=0;\n switchingStream();\n populateLive();\n apierror =1;\n }\n else{\n if(response.stream.game !='Dota 2'){\n switchingStream();\n populateLive();\n }\n var tempStreaming = currentlyStreaming;\n currentlyStreaming.desc = response.stream.channel.status;\n if(tempStreaming.desc!= currentlyStreaming.desc){\n changeBroadcastTitle();\n }\n //checkIfStreamOpen();\n }\n }); \n }); \n\n}", "title": "" }, { "docid": "62243cd86c482c196d5ebe87d25209cb", "score": "0.57631546", "text": "function getStatus(cb) {\n chrome.runtime.sendMessage(\n chrome.runtime.id,\n {\n request: RequestMessage.STATUS\n },\n (response) => {\n cb(response);\n }\n );\n }", "title": "" }, { "docid": "94c8ee4fca9d1501d5ff48aa658aaf0f", "score": "0.57579666", "text": "function get_status() {\n\n var config = {\n url: \"http://\"+serverip+\":8040/request\",\n data: JSON.stringify({\"Command\": \"REQ\", \"Data\": {\"CmdType\":\"GETSTATUS\"}}),\n type: \"POST\",\n contentType: \"application/json\", // Request\n dataType: \"json\" // Response\n };\n\n var done_fct = function(json) {\n set_client_status(json);\n }\n\n $.ajax(config).done(done_fct).fail(fail_fct);\n}", "title": "" }, { "docid": "58f0e75acd721dbd247a4cc10192e05f", "score": "0.5754207", "text": "function checkClassStatus()\n{\n\tvar userID = getSessionStorageItem(\"userID\");\n\tvar classID = getSessionStorageItem(\"classID\");\n\tvar postObj = {\n\t\t\t\t\tTokenID: TOKENID,\n\t\t\t\t\tDeviceTimeStamp: getCurrentTimestamp(),\n\t\t\t\t\tCallerUserID: userID,\n\t\t\t\t\tCallerClassID: classID\n\t\t\t\t};\n\tvar url = SERVICEBASEURL + \"GetClassStatus\";\n\tAjaxCall(url, \"POST\", postObj, checkClassStatusCallBack, \"GetClassStatus\"); checkInternetConnection(); // 1st call\n\twindow.clearInterval(STATUSINTERVALOBJ);\n}", "title": "" }, { "docid": "eca0b1230ee975c16a88ad130c6d1e28", "score": "0.57403594", "text": "static get STATUS_RUNNING () {\n return 0;\n }", "title": "" }, { "docid": "f5dde6fca6e020a7d1d2303f497922bb", "score": "0.5731314", "text": "queryStatus() {\n this._cancelPreviousPoll();\n this._clearQueryTimeout();\n var clearState = (() => {\n this._retryCount++;\n if (this._retryCount >= this._maxRetryCount) {\n this._spotifyStatus.state = {\n state: { position: 0, volume: 0, state: 'paused' },\n track: { album: '', artist: '', name: '' },\n isRepeating: false,\n isShuffling: false,\n isRunning: false\n };\n this._retryCount = 0;\n }\n this.scheduleQueryStatus();\n });\n const { promise, cancel } = SpotifyClient_1.SpoifyClientSingleton.getSpotifyClient(this._spotifyStatus, this).pollStatus(status => {\n this._spotifyStatus.state = status;\n this._retryCount = 0;\n }, SpotifyConfig_1.getStatusCheckInterval);\n this._cancelCb = cancel;\n promise.catch(clearState);\n }", "title": "" }, { "docid": "6d44f7b24147f39ade6a711aaf13a93c", "score": "0.57214373", "text": "function reportStatus() {\r\n console.log(\"functions.js is active\");\r\n}", "title": "" }, { "docid": "64c0fc2433fda0ae23126e397faafa67", "score": "0.5719116", "text": "function status() {\n console.log('ok');\n \n}", "title": "" }, { "docid": "25830e8e9e646c3d910e926008510034", "score": "0.5717927", "text": "function getStatus(firstTime) {\n local(\"/action?a=current\")\n .then(res => {\n get(\"version\").innerText = res.data.version;\n if (res.data.status == \"Not logged in\") {\n get(\"status\").innerText = \"NOT LOGGED IN\";\n return\n } else {\n get(\"status\").innerText = \"LOGGED IN\";\n get(\"name\").innerText = res.data.name;\n get(\"activity\").innerText = res.data.status;\n get(\"debug\").innerText = res.data.debug;\n \n if (firstTime) {\n get(\"orbit-text\").value = res.data.orbitText;\n get(\"auto-update\").checked = res.data.autoUpdate;\n }\n }\n })\n .catch(err => get(\"controls\").innerHTML = err + \"<br/>Couldn't reach rich-destiny anymore. Try refreshing the page.\")\n}", "title": "" }, { "docid": "92efe0f4dcf7d05f495f55fcd9d9249e", "score": "0.57086766", "text": "_updateStatus() {\n fetch('/_/status').then(jsonOrThrow).then(json => {\n this._state.status = json;\n this._render();\n window.setTimeout(() => this._updateStatus(), UPDATE_MS);\n }).catch(err => {\n errorMessage(err)\n window.setTimeout(() => this._updateStatus(), UPDATE_MS);\n });\n }", "title": "" }, { "docid": "a18edacbf0aa7f1ba0ff63e380e571dd", "score": "0.5708545", "text": "function getOnlineStatus() {\n\treturn new Promise(function (resolve) {\n\t\tlet p2pDone = false;\n\t\tlet udpDone = false;\n\n\t\t//Get online status for P2P\n\t\tcheckOnlineStatus(P2P_URL, \"p2p\").then(function (status) {\n\t\t\t//Set online status\n\t\t\tp2pIsOnline = status;\n\t\t\tif (status) chooseP2P();\n\t\t\telse useP2P = false;\n\n\t\t\t//Resolve promise\n\t\t\tif (udpDone) resolve();\n\t\t\tp2pDone = true;\n\t\t}, function () {\n\t\t\t//Set online status\n\t\t\tp2pIsOnline = false;\n\t\t\tuseP2P = false;\n\n\t\t\t//Resolve promise\n\t\t\tif (udpDone) resolve();\n\t\t\tp2pDone = true;\n\t\t});\n\n\t\t//Get online status for UDP\n\t\tcheckOnlineStatus(UDP_URL, \"udp\").then(function (status) {\n\t\t\t//Set online status\n\t\t\tudpIsOnline = status;\n\t\t\tif (status) chooseUDP();\n\t\t\telse useUDP = false;\n\n\t\t\t//Resolve promise\n\t\t\tif (p2pDone) resolve();\n\t\t\tudpDone = true;\n\t\t}, function () {\n\t\t\t//Set online status\n\t\t\tudpIsOnline = false;\n\t\t\tuseUDP = false;\n\n\t\t\t//Resolve promise\n\t\t\tif (p2pDone) resolve();\n\t\t\tudpDone = true;\n\t\t});\n\t});\n}", "title": "" }, { "docid": "68ae4e9b31ded2208b650170225de201", "score": "0.5689641", "text": "static getStatus() {\n return HttpClient.get(`${ENDPOINT}status`)\n .map(toStatusModel);\n }", "title": "" }, { "docid": "1d677812f4a9d51c216392ec31738dea", "score": "0.5685204", "text": "function checkStatus(status) {\n\t$('#pull').removeClass('disabled');\n\t$('#alert-error').hide();\n\tswitch (status) {\n\t\tcase 200:\n\t\t\t$('#alert-loading').hide();\n\t\t\t// All good\n\t\t\treturn true;\n\t\tcase 400:\n\t\t\t// Request error\n\t\t\t$('#alert-error').html('😕 Something went wrong with your request. Please, try refreshing the page.').show();\n\t\t\treturn false;\n\t\tcase 401:\n\t\t\t// Authentication error\n\t\t\twindow.location.replace('../login/#wp');\n\t\t\treturn false;\n\t\tcase 403:\n\t\t\t// Brute Force error\n\t\t\twindow.location.replace('../login/#bf');\n\t\t\treturn false;\n\t\tcase 500:\n\t\t\t// Server error\n\t\t\t$('#alert-error').html('😞 Server error... Please, try again in a minute.').show();\n\t\t\treturn false;\n\t\tcase 0:\n\t\t\t// Offline\n\t\t\tlet dt = new Date();\n\t\t\tlet timestamp = (dt.getHours() % 12) + \":\" + ((dt.getMinutes() < 10) ? '0' + dt.getMinutes() : dt.getMinutes()) + ((dt.getHours() > 12) ? 'pm' : 'am');\n\t\t\t$('#offline-lastcheck').html(timestamp);\n\t\t\t$('#alert-offline').show();\n\t\t\treturn false;\n\t\tdefault:\n\t\t\t// Unknown error\n\t\t\t$('#alert-error').html('🤔 Something went wrong with your request. Please, try again later.').show();\n\t\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "f78beb9a893bb79bf3e33eca918365ae", "score": "0.56788087", "text": "function checkApiStatus()\n {\n Auth.checkApi().done((token) => {\n updateApiStatus(token);\n });\n }", "title": "" }, { "docid": "83e5ea016a945f8ca89c2a904b74bf4f", "score": "0.5643982", "text": "function checkStatus(systemState){\n\t$(\"#runningState\").css(\"color\", \"red\");\n\tswitch(systemState) {\n\t\tcase 5:\n\t\t\t$(\"#runningState\").css(\"color\", \"brown\");\n\t\t\treturn \"Waiting For Wind\";\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\t$(\"#runningState\").css(\"color\", \"green\");\n\t\t\treturn \"Running\";\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\treturn \"INIT_PROCESSOR\";\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\treturn \"INIT_PARAMS\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\treturn \"RESET\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\treturn \"WAITING INITIALIZING (STARTING COUNTDOWN)\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\treturn \"WAITING INITIALIZING (COUNTDOWN DELAY)\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\treturn \"AC_RUN_INIT\";\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\treturn \"AC_RUNNING\";\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\treturn \"DC_RUN_INIT\";\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\treturn \"FAULT_INIT\";\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\treturn \"FAULT\";\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\treturn \"MANUAL STOP (PRESS RESET)\";\n\t\t\tbreak;\n\t\tcase 13:\n\t\t\treturn \"MANRESET\";\n\t\t\tbreak;\t\n\t\tcase 14:\n\t\t\treturn \"FAULT LIMIT (PRESS RESET)\";\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "6f208cf84d47081a673784fccfcbdc52", "score": "0.5635459", "text": "function callRequestStatus() {\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: 'enrollment/phoneverify.json/status',\n\t\tsuccess: function(data) {\n\t\t\t$('#callstatus').html(data);\n\t\t\t$('#makecallbtn').attr(\"disabled\", true);\n\n\t\t\tif (data === 'Call completed.' && verifying === 'N') {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\thideShowToggle(\"CALLCOMPLETE\");\n\t\t\t}\n\n\t\t\tif (data === 'Call has been answered.') {\n\t\t\t\thideShowToggle(\"ANSWERED\");\n\t\t\t\t$(\"#verifytxtbox\").focus();\n\t\t\t}\n\t\t},\n\t\terror: function() {\n\t\t\tclearTimeout(timer);\n\t\t\t$('#callstatus').html(\"Unable to Check Call Status!\");\n\t\t\thideShowToggle(\"RESET\");\n\t\t},\n\t\tstatusCode: {\n\t\t\t500: function() {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\thideShowToggle(\"RESET\");\n\t\t\t}\n\t\t}\n\t});\n\t//Create Looping using SetTimeOut\n\tif (verifying === 'N') {\n\t\ttimer = setTimeout('callRequestStatus()', 2000);\n\t} else {\n\t\tclearTimeout(timer);\n\t}\n}", "title": "" }, { "docid": "24d1fb02ff59ea933141090675efd680", "score": "0.5609657", "text": "async function status() {\n data.status = {\n loc: data.loc && data.loc.country !== null,\n world: data.world && data.world.totalCases > 0,\n countries: data.countries && data.countries.length > 0,\n usa: data.usa && data.usa.totalTestResults > 0,\n usaHistory: data.usaHistory && data.usaHistory.length > 0,\n states: data.states && data.states.length > 0,\n statesHistory: data.statesHistory && data.statesHistory.length > 0,\n statesInfo: data.statesInfo && data.statesInfo.length > 0,\n jhuLatest: data.jhulatest && data.jhulatest.length > 0,\n jhuHistory: data.jhuhistory && data.jhuhistory.length > 0,\n florida: data.florida && data.florida.length > 0,\n news: data.news && data.news.length > 0,\n };\n // console.log(data.status);\n document.getElementById('div-status').innerHTML = `<b>Data Sources Status:</b> \n ${color.ok('World Latest', data.status.world)} | \n ${color.ok('Countries', data.status.countries)} | \n ${color.ok('USA Current', data.status.usa)} | \n ${color.ok('USA History', data.status.usaHistory)} | \n ${color.ok('USA States', data.status.statesHistory)} | \n ${color.ok('JHU Latest', data.status.jhuLatest)} | \n ${color.ok('JHU Series', data.status.jhuHistory)} | \n ${color.ok('Florida', data.status.florida)}\n `;\n // ${color.ok('News', data.status.news)}\n setTimeout(status, 100);\n}", "title": "" }, { "docid": "12c5ebf7c03347c91c54a4e6903ed55d", "score": "0.5599538", "text": "status () {\n const response = this._receiveMessage((data) => {\n if (data.length > 9) {\n if (data[2] === 0x23) { console.log('lights are on') }\n if (data[2] === 0x24) { console.log('lights are off') }\n console.log('program number', data[3])\n console.log('speed', data[4])\n console.log('red', data[6], 'green', data[7], 'blue', data[8], 'white', data[9])\n }\n })\n\n this._sendMessage([0xef, 0x01, 0x77])\n\n return response\n }", "title": "" }, { "docid": "f94aa45d117b1046e10bb2c96e9a8e96", "score": "0.55902815", "text": "function checkState() {\n \n \n if(currentState.running == false) {\n return;\n }\n \n // get request of the job information\n $.ajax({\n url: \"job?id=\" + currentState.currentId\n , type: \"GET\"\n\n , success: function (data) {\n \n currentState.running = data.finished !== true;\n currentState.ready = data.finished;\n currentState.status = data.status;\n currentState.fileName = data.fileName;\n if (currentState.running) {\n setTimeout(checkState, 1000);\n }\n updateView();\n } \n });\n}", "title": "" }, { "docid": "424a6025849cd3b2089804dae54fbe35", "score": "0.55823296", "text": "function getStatus() {\n return status;\n }", "title": "" }, { "docid": "cea60bb006acc4cae2b2dfe72b90533c", "score": "0.5578371", "text": "refreshTPMFirmwareUpdateStatus() {}", "title": "" }, { "docid": "95305e69d6d0f1689e15deeafa69a7c8", "score": "0.557192", "text": "static getStatus() {\n return HttpClient.get(`${ENDPOINT}status`)\n .map(toSimulationStatusModel);\n }", "title": "" }, { "docid": "5517d0ed44d2677be2f405b8a82b3f7b", "score": "0.5570021", "text": "async getRequestStatus(requestID) {\n if (process.env.DEBUG === 'true') {\n console.log(`### get request id: ${requestID}`);\n }\n const getResponse = await I.sendGetRequest(\n `${requestorProps.endpoint.requestEndPoint}/${requestID}`,\n users.mainAcct.accessTokenHeader,\n );\n const responseData = getResponse.data;\n if (process.env.DEBUG === 'true') {\n console.log(`### responseData: ${JSON.stringify(responseData)}`);\n }\n const reqStatus = responseData.status;\n if (process.env.DEBUG === 'true') {\n console.log(`### request status: ${reqStatus}`);\n }\n return reqStatus;\n }", "title": "" }, { "docid": "bd38ebd93a444deff290e9b5ac6ca7cd", "score": "0.5567581", "text": "refreshUpdateStatus() {}", "title": "" }, { "docid": "67c3741116792f36570dd27f62e4996b", "score": "0.55537015", "text": "function onstatus(event) {\n velox.online = navigator.onLine;\n for(var i = 0; i < vs.length; i++)\n if(velox.online && vs[i].autoretry)\n vs[i].retry();\n }", "title": "" }, { "docid": "c7864adf1aa3125019595c59fe56484f", "score": "0.5553163", "text": "function pollfunction() {\n var timestamp = moment();\n poll(timestamp,'sfstage.s_servicecontract','ServiceContract');\n poll(timestamp,'sfstage.s_servicerole','Service_Role__c');\n// poll(timestamp,'sfstage.s_account','Account');\n setTimeout(pollfunction, monitor.pollinterval);\n}", "title": "" }, { "docid": "1fcbbdb4d3efc2faa0ff7e8c8e897ff3", "score": "0.55372167", "text": "function updateStatus() {\n Packlink.ajaxService.get(\n checkStatusUrl,\n /** @param {{logs: array, finished: boolean}} response */\n function (response) {\n let logPanel = document.getElementById('pl-auto-test-log-panel');\n\n logPanel.innerHTML = '';\n for (let log of response.logs) {\n logPanel.innerHTML += writeLogMessage(log);\n }\n\n logPanel.scrollIntoView();\n logPanel.scrollTop = logPanel.scrollHeight;\n response.finished ? finishTest(response) : setTimeout(updateStatus, 1000);\n }\n );\n }", "title": "" }, { "docid": "a029a1c56cd1485b90193ecbb6ab7fb6", "score": "0.55322146", "text": "function ping() {\n try {\n var xmlHttp = new XMLHttpRequest();\n // we don't want a cached result:\n xmlHttp.open( \"GET\", API_URL + \"alive?t=\" + Math.random(), false);\n xmlHttp.send();\n return JSON.parse(xmlHttp.responseText).success\n } catch(err) {\n return false;\n }\n}", "title": "" }, { "docid": "e16f0410016654c53f6b62a86309ddc4", "score": "0.5531384", "text": "updateStatus() {\n var that = this;\n setTimeout(function () {\n that.getPowerState(null);\n that.pollPlayContent();\n that.updateStatus();\n }, this.updaterate);\n }", "title": "" }, { "docid": "f7c3dd5bffb96cbf2cf37370c9517c85", "score": "0.55291", "text": "function checkStatus() {\n flushMonitoringOperations(self.queue);\n\n if(self.queue.length == 0) {\n // Get all the known connections\n var connections = self.availableConnections\n .concat(self.inUseConnections)\n .concat(self.nonAuthenticatedConnections)\n .concat(self.connectingConnections);\n\n // Check if we have any in flight operations\n for(var i = 0; i < connections.length; i++) {\n // There is an operation still in flight, reschedule a\n // check waiting for it to drain\n if(connections[i].workItems.length > 0) {\n return setTimeout(checkStatus, 1);\n }\n }\n\n destroy(self, connections);\n // } else if (self.queue.length > 0 && !this.reconnectId) {\n\n } else {\n // Ensure we empty the queue\n _execute(self)();\n // Set timeout\n setTimeout(checkStatus, 1);\n }\n }", "title": "" }, { "docid": "6901ce2b64b58941e75fad834f981c41", "score": "0.55232877", "text": "'app/SET_STATUS'(state, status)\n {\n state.status = status;\n\n if (status === 'ready') {\n state.fresh = false;\n }\n }", "title": "" }, { "docid": "2d7513009958ec89cde4b20bc2b52507", "score": "0.5515247", "text": "function statusDevices(func) {\n const statusOpts = createOptions();\n statusOpts.path = '/devices';\n statusOpts.method = 'GET';\n statusOpts.headers = { \"Authorization\": authToken };\n\n httpRequest(statusOpts, func);\n}", "title": "" }, { "docid": "ced9453de5bbbec9de0baee59083dd62", "score": "0.55108863", "text": "function getGameStatus() {}", "title": "" }, { "docid": "93169a97ae2373ba867021093801724f", "score": "0.5509131", "text": "function start_polling(fn_name){\n try {\n if (typeof fn_name == 'object'){\n polling_list.push(jQuery.extend(true, {}, fn_name));\n start_polling(fn_name.fn_name);\n } else { // fn_name is a string or an undefined\n fn_name = typeof fn_name !== 'undefined' ? fn_name: 'all'; // default value is 'all' if no fn_name given\n\n // set up timers for ajax updates \n if (fn_name == 'all'){\n // stop all timers first\n if (!stop_polling()){\n throw \"stop_polling function failed!\";\n }\n \n for (var i = 0; i < polling_list.length; i++){\n fn_preloader(polling_list[i]);\n }\n } else {\n // stop timer first\n if (!stop_polling(fn_name)){\n throw \"stop_polling function failed!\";\n }\n\n // locate the entry on ajax_function_timings\n var timing_entry;\n for (var i = 0; i < polling_list.length; i++){\n if (polling_list[i].fn_name == fn_name){\n timing_entry = i;\n break;\n }\n }\n if (typeof timing_entry == 'undefined'){\n throw \"function not found!\";\n }\n\n fn_preloader(polling_list[timing_entry]);\n }\n\n return true;\n }\n } catch (err) {\n console.log('Start polling failed.');\n return false;\n }\n }", "title": "" }, { "docid": "711b558e52163e7dbf8d99e952874b80", "score": "0.550007", "text": "function runStatusQueryLoop() {\n setInterval(function() {\n queryServerForStatus().\n then(registerServerQuery);\n }, 100);\n}", "title": "" }, { "docid": "8a1e3c16fc294439b85e70673e23969e", "score": "0.5485813", "text": "function checkStatus() {\n flushMonitoringOperations(self.queue);\n\n if (self.queue.length === 0) {\n // Get all the known connections\n var connections = self.availableConnections.concat(self.inUseConnections).concat(self.nonAuthenticatedConnections).concat(self.connectingConnections);\n\n // Check if we have any in flight operations\n for (var i = 0; i < connections.length; i++) {\n // There is an operation still in flight, reschedule a\n // check waiting for it to drain\n if (connections[i].workItems.length > 0) {\n return setTimeout(checkStatus, 1);\n }\n }\n\n destroy(self, connections);\n // } else if (self.queue.length > 0 && !this.reconnectId) {\n } else {\n // Ensure we empty the queue\n _execute(self)();\n // Set timeout\n setTimeout(checkStatus, 1);\n }\n }", "title": "" }, { "docid": "5dac93676a8acbd993bbd3788315437a", "score": "0.5479727", "text": "function check() {\n callAlertsService(node, params).then((response) => {\n if(response.body.taskStatusList[0].status === 'COMPLETE'){\n node.emit('alertsCreated', response);\n node.send({payload: response.body});\n } else {\n if(retries-- === 0){\n node.emit('requestTimeout', 5);\n } else {\n setTimeout(check, 500);\n }\n }\n });\n }", "title": "" }, { "docid": "7c32737240b2691c2c01f2f534e38e06", "score": "0.54791427", "text": "static get STATUS_RUNNING() {\n return 0; // used by compiler\n }", "title": "" }, { "docid": "4f6e37404ff5f87b643bdab0e6864398", "score": "0.5478955", "text": "function getVisitedStatus(){\n$.get(url_hasVisited, function getStatus(status) {\n\treturn status;\n\tconsole.log('Has visited before? '+status);\n\t});\n}", "title": "" }, { "docid": "b69a08f79e980f82e318334e1ec0f0e4", "score": "0.54596364", "text": "function get_state() {\n $table.bootstrapTable('showLoading');\n console.log(\"Fetching part table state\");\n // ajax call to parts api\n console.log(`API GET ${parts_endpoint}`);\n $.get({\n url: parts_endpoint\n }).then((data) => {\n // update global state\n parts = data.reverse();\n console.log(\"Response: \", parts);\n // update global state with supplier and manufacturers\n get_fks().then( () =>{\n // replace ids in parts table with name identifiers\n parts.forEach(part => {\n part.manufacturer = find_match(manufacturers, part.manufacturer_id);\n part.supplier = find_match(suppliers, part.supplier_id);\n });\n // temp timeout for load wheel debug\n setTimeout(() => {$table.bootstrapTable('load', parts)}, 1000);\n console.log(\"Compiled Response: \", parts);\n populate_selectors();\n });\n }).catch(() => {\n console.error(\"API request failed\");\n alert(\"API Request Failed\");\n });\n // manually reset remove and edit options since the table selections are cleared on reload\n $remove.prop('disabled', true);\n $edit.prop('disabled', true);\n}", "title": "" }, { "docid": "850c72a83d5aa7aea9825a7344487262", "score": "0.54557806", "text": "async function _getState() {\n const msg = `getState()`;\n if (_commandInProgress) {\n log.debug(LOG_PREFIX, `${msg} - skipped.`);\n return;\n }\n _startCommandInProgress();\n log.debug(LOG_PREFIX, msg);\n try {\n log.verbose(LOG_PREFIX, `${msg} - connecting...`);\n await _bedJet.connect(_bjRetries);\n log.verbose(LOG_PREFIX, `${msg} - getting state...`);\n const rawState = await _bedJet.getState(_bjRetries);\n _wsBroadcast(_parseState(rawState));\n log.verbose(LOG_PREFIX, `${msg} - disconnecting...`);\n await _bedJet.disconnect(_bjRetries);\n } catch (ex) {\n log.exception(LOG_PREFIX, `${msg} - failed.`, ex);\n const reason = ex.message || ex.name || 'Unknown exception.';\n const bcast = {\n log: {\n kind: 'exception',\n message: `${msg} - failed: ${reason}`,\n },\n };\n _wsBroadcast(bcast);\n }\n _clearCommandInProgress();\n}", "title": "" }, { "docid": "dee7c527d5a6b643e4491615144960e3", "score": "0.5454275", "text": "function getStatus() {\n var url = \"getStatus.php\";\n ajaxRequest(\"POST\", url, true, \"\", displayStatus);\n}", "title": "" }, { "docid": "be50bd1e18a9f365d749d8c2f695b0dc", "score": "0.5440531", "text": "async _refreshStatus() {\n try {\n const poolStatus = await this.poolController.getPoolStatus()\n this.log.debug('connected:', this.poolConfig.gatewayName, '(getPoolStatus)')\n this._updateAccessories(poolStatus, null)\n return null\n } catch (err) {\n this.log.error('error getting pool status', err)\n this._updateAccessories(null, err)\n throw err\n }\n }", "title": "" }, { "docid": "2328ba93ac2f84a6dee7543790e5bc16", "score": "0.54391336", "text": "_getAVRPowerStatus() {\n this._powerCommand( \"power_request\" ) ;\n }", "title": "" }, { "docid": "f6acbd6f26ec164fbcc29868e25aa0bf", "score": "0.5432572", "text": "async function getStatus(place_id) {\n if (!statusFetched) {\n let requestOption = {\n method: \"POST\",\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({'place_id': place_id}),\n };\n console.log(requestOption);\n let res = await fetch(`${REACT_APP_API_BACKEND}/map/get_live_status`, requestOption);\n // console.log(res);\n if (res.status === 200) {\n let val = await res.json();\n console.log(val);\n return val;\n }\n statusFetched = false;\n }\n }", "title": "" }, { "docid": "7922c8303d4f1699a3f042ae4ff24052", "score": "0.5430002", "text": "async _refreshProjectorStatus() {\n this.log.debug('Refresh projector status');\n \n try {\n this.log.debug('Refreshing power state.');\n await this.getPowerState();\n this.log.debug('Power state refreshed.');\n\n if (this.state) {\n this.log.debug('Refreshing input source.');\n await this.getInputSource();\n this.log.debug('Input source refreshed.');\n }\n }\n catch (e) {\n this.log.error(`Failed to refresh projector status: ${e}`);\n }\n \n // Schedule another update\n setTimeout(() => {\n this._refreshProjectorStatus();\n }, this.pollingInterval);\n }", "title": "" }, { "docid": "39c70b65a99ef35b1b403cc9ee9a72d7", "score": "0.5424392", "text": "function checkServerStatusAndRunWhenItDown(){\n var http = require('http');\n\n _.forEach(serverList, function(server){\n http.get(server.heartbeat, function(res){\n if(res.statusCode === 200){\n setServerActiveStatus(server, true);\n return;\n }\n\n handleServerWhenDown(server, res);\n }).on('error', function(error){\n handleServerWhenDown(server, error);\n });\n });\n}", "title": "" }, { "docid": "e8ec4a904e6c4a855eb646c033d445e9", "score": "0.5399167", "text": "async function checkState() {\n const threshold = parseInt(document.querySelector('#idle-threshold').value);\n const dom_threshold = document.querySelector('#idle-set-threshold');\n dom_threshold.innerText = threshold;\n\n // Request the state based off of the user-supplied threshold.\n chrome.idle.queryState(threshold, function (state) {\n const time = new Date();\n if (laststate != state) {\n laststate = state;\n laststatetime = time;\n }\n\n // Keep rendering results so we get a nice \"seconds elapsed\" view.\n const dom_result = document.querySelector('#idle-state');\n dom_result.innerHTML = renderState(state, time);\n const dom_laststate = document.querySelector('#idle-laststate');\n dom_laststate.innerHTML = renderState(laststate, laststatetime);\n });\n}", "title": "" }, { "docid": "14296a952dd750b49f188c819d7816e6", "score": "0.53983366", "text": "function getExabgpStatus(fallback) {\n if (fallback) {\n $.ajax({\n url: '<%= url_for('exabgp_status') %>',\n method: 'GET',\n success: function(data) {\n var file_missing = data.file_missing;\n var running = data.running;\n updateExabgpStatus(file_missing, running);\n setTimeout(function(){ getExabgpStatus(true); }, 1000);\n }\n });\n } else {\n var ws = new WebSocket('<%= url_for('exabgp_status')->to_abs() %>');\n ws.onopen = function() {\n console.log('Connection is established!');\n };\n ws.onclose = function() {\n console.log('Connection is closed');\n\n // Update Exabgp status\n $('#exabgp-status').toggleClass('label-danger', false);\n $('#exabgp-status').toggleClass('label-warning', false);\n $('#exabgp-status').toggleClass('label-success', false);\n $('#exabgp-status').toggleClass('label-info', true);\n $('#exabgp-status').html('<%= l('Getting Exabgp status') %>');\n\n // Try to reopen websocket\n getExabgpStatus();\n };\n ws.onerror = function() {\n console.log('error');\n delete ws;\n getExabgpStatus(true);\n };\n ws.onmessage = function(e) {\n console.log('New websocket message!');\n var data = JSON.parse(e.data);\n var file_missing = data.file_missing;\n var running = data.running;\n updateExabgpStatus(file_missing, running);\n };\n }\n}", "title": "" }, { "docid": "7e1d9a74bbb5de0589a7d0826d4122eb", "score": "0.5397748", "text": "function getPcState(){\n console.log(\"getting PC state\");\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = onGetPcState;\n xhttp.open(\"GET\", \"pcstate\", true);\n xhttp.send();\n}", "title": "" }, { "docid": "be4ebc33be79ce50f3af456e2dfd8107", "score": "0.53952265", "text": "function operatorStatusUpdated(status) {\r\n if (!initiated) {\r\n if (operator.status == operatorStatus.offline && status == operatorStatus.online) {\r\n serviceAlreadyRunning = true;\r\n }\r\n if (status === operatorStatus.offline) {\r\n serviceAlreadyRunning = false;\r\n }\r\n }\r\n\r\n operator.status = status;\r\n\r\n if (operator.status != operatorStatus.online) {\r\n $callBtn.addClass(disableClass);\r\n } else {\r\n $callBtn.removeClass(disableClass);\r\n }\r\n\r\n if (operator.status == operatorStatus.busy) {\r\n renderOperatorBox();\r\n return;\r\n }\r\n\r\n renderView();\r\n if (callToContactId) {\r\n makeCallToContact(callToContactId);\r\n }\r\n }", "title": "" }, { "docid": "52b54ec1ef8341f6cc549f03752622f2", "score": "0.5393561", "text": "getUserLoadStatus( state ){\n return function(){\n return state.userLoadStatus;\n }\n }", "title": "" }, { "docid": "a5fac72848d63ec3eef7475e94fcf612", "score": "0.5390278", "text": "function retrieveStatus(){\n request(icecastUrl, function (error, response, body) {\n // If error, log it\n var mountpointList = JSON.parse(body).icestats.source;\n // Check for all three mountpoints\n checkStatus(mountpointList, 'listen');\n checkStatus(mountpointList, 'hub');\n checkStatus(mountpointList, 'harrow');\n });\n}", "title": "" }, { "docid": "58e0a21e0cd180b18ef1b1a24f0c4670", "score": "0.53879136", "text": "function getState() {\n setupConfig();\n\n var activityId = $(\"#document-activity-id\").val();\n var actorEmail = $(\"#document-actor-email\").val(); // TODO: Agent\n var stateId = $(\"#get-document-state-id\").val();\n // registration\n var since = $(\"#get-document-since-date input\").val();\n var sinceDate = (since == \"\") ? null : new Date(since);\n // callback\n\n ADL.XAPIWrapper.getState(activityId, {\"mbox\":\"mailto:\" + actorEmail}, stateId, null, sinceDate, function(r) {\n if (r.status == 404)\n notify({ message: \"Status \" + r.status + \" \" + r.statusText }, notificationWarningSettings);\n else\n notify({ message: \"Status \" + r.status + \" \" + r.statusText }, notificationSettings);\n //$(\"#received-documents\").append(\"<p>Received State <b>\" + stateId + \"</b>: \" + r.response + \"</p>\");\n if (validateJSON(r.response) != true) {\n var stateValue = r.response;\n } else {\n var stateValue = JSON.stringify($.parseJSON(r.response), undefined, 4);\n }\n $(\"#received-documents\").append(styleDocumentsView(\"State: \" + stateId, stateValue));\n if (validateJSON(r.response) == true) {\n PR.prettyPrint();\n }\n console.log(r);\n });\n}", "title": "" }, { "docid": "66a4a09232eab3449a1ac2cd6a33cc48", "score": "0.5387403", "text": "function checkForUpdate() {\n return new Promise(resolve => {\n $.post(`/api/game/${lobbyCode}/state`, {cache: cachedState}).then( data => {\n if (data === \"Up to date\") {\n console.log(\"Game state matches cloud\");\n resolve();\n } else{\n cachedState = data;\n updatePage(data);\n resolve();\n }\n });\n });\n}", "title": "" }, { "docid": "53b55a3481a2af390cb5a4eb275cda04", "score": "0.538577", "text": "function checkWorkflowStatus(workflowId) {\n var workflowInfoURL = URL.workflow_conductor + \"/\" + workflowId;\n\n interval = setInterval(function () {\n httpGet(workflowInfoURL, updateWorkflowStatus);\n }, 1000);\n}", "title": "" }, { "docid": "7254c831e38dbf6cc3fb6e666fdda40e", "score": "0.5384055", "text": "function getStatus() {\n console.log(\"Loading user data\");\n getCertificatesRecord();\n getCheckingHistory();\n}", "title": "" }, { "docid": "f2fc69ce91792d4ba2d50e0c0870a17c", "score": "0.5383661", "text": "function fstatus(response){\n return new Promise(function(resolve,reject){\n console.log(\"In fstatus\", response.status);\n // Check the status\n if (response.status >= 200 && response.status < 300) {\n // Go to the next point\n resolve(response);\n } else {\n console.log(\"Error on fstatus.\", response.statusText);\n reject(new Error(response.statusText));\n }\n });// end promise\n}//end function fstatus", "title": "" }, { "docid": "230aabdbdaa98a9672f3411d36acf330", "score": "0.538189", "text": "function touchStatusAPI(){\n got(status_push_url).then(() => {\n //console.log('Message sent successfully');\n }).catch(error => {\n console.error('Failed to send message:', error.message);\n });\n}", "title": "" }, { "docid": "fb221ace9fa05b8ea03ce35dfe305665", "score": "0.5373054", "text": "function status(){\n if(!_.isEmpty(env)){\n console.log(\"Currently in the following environment:\");\n console.log(columnify(env));\n console.log(\" \"); \n }\n \n var ret = model.checkStatus();\n if(ret === false){\n console.log(\"You currently do not have any timers running\");\n }else{\n console.log(columnify(ret));\n }\n }", "title": "" }, { "docid": "8e58c1414a03104d5a0f52a77c526046", "score": "0.53715706", "text": "function checkStatus() {\n let seconds = 15;\n let now = (new Date).getTime() / 1000;\n\n if(clients[0]) {\n console.log(now - parseInt(clients[0].strategy.lastPing))\n }\n\n for (let i = 0; i < clients.length; i++) {\n // if (now - clients[i].lastPing > seconds) {\n if (now - parseInt(clients[i].strategy.lastPing) > seconds) {\n\n \n\n clients[i].strategy.status = \"DISCONNECTED\";\n }\n }\n}", "title": "" }, { "docid": "e4cade3cea3dd0e43b44d0c53e59d73f", "score": "0.5368062", "text": "async function monitor() {\n var status = 0;\n while (status != 1) {\n // console.log(txID);\n web3.eth.getTransactionReceipt(txID, function(error, result) {\n if (!error) {\n try {\n status = parseInt(result.status, 16);\n if (status == 1) {\n window.location.href = \"timer\";\n return;\n }\n } catch (e) {\n ;\n }\n } else {\n console.log(error);\n }\n });\n await sleep(1000);\n }\n}", "title": "" }, { "docid": "517f2b4353cc0c0d4810b4c266340c42", "score": "0.5364273", "text": "function stateFunctions() {\n\t//GET 'currentState' AND DO ACTION DEPENDING ON THAT\n\tif (currentState == \"lobby\") {\n\t\tlobbyWait();\n\t}\n\telse if (currentState == \"prompts\") {\n\t\tgetPrompt();\n\t}\n\telse if (currentState == \"answers\") {\n\t\tgetAnswers();\n\t}\n\telse if (currentState == \"tally\"){\n\t\t//tallyScore();\n\t}else{\n\t\t//console.log(\"Error with current state: current state is \" + currentState)\n\t}\n}", "title": "" }, { "docid": "39bdff35dac5c541ed360f2e7a4317ca", "score": "0.5360264", "text": "function checkSysStatus() {\r\nxapi.status\r\n .get('UserInterface Extensions Widget 14')\r\n .then((stat) => {\r\n console.log('Checking system status ...');\r\n checkCount(stat.Value);\r\n\r\n })\r\n}", "title": "" }, { "docid": "038f864ffcb2681c7dd8b5c382ebf3da", "score": "0.535388", "text": "function onGetHddState(){\n console.log(\"HDD state received\");\n console.log(this.onreadyState);\n console.log(this.status);\n console.log(this.responseText);\n if(this.onreadyState == 4 && this.status == 200){\n console.log(this.responseText);\n }\n\n document.getElementById(\"hddState\").innerHTML = this.responseText;\n if(this.responseText === \"On\"){\n document.getElementById(\"hddState\").style.color = \"green\";\n }else if(this.responseText === \"Off\"){\n document.getElementById(\"hddState\").style.color = \"red\";\n }else{\n document.getElementById(\"hddState\").innerHTML = \"Unknown\";\n document.getElementById(\"hddState\").style.color = \"gray\";\n }\n}", "title": "" }, { "docid": "e92f389923e09d4c29aa072a68d9ef88", "score": "0.5351057", "text": "function pingAddress(address, callback) {\n var start = Date.now();\n\n // timeout?\n request.get(address + '/wsapi/awsbox_status', function(err, res, body) {\n if (err) {\n return callback(err);\n }\n\n // yay - they have awsbox_status\n if (res.statusCode === 200) {\n var date = Date.now();\n var result = JSON.parse(body);\n result.statusCode = res.statusCode;\n result.data = date,\n result.time = date-start;\n return callback(null, result);\n }\n\n // no awsbox_status; just get '/'\n else {\n request.get(address, function(err, res, body) {\n var date = Date.now();\n return callback(null, {\n statusCode: res.statusCode,\n date: date,\n time: date - start\n });\n }).on('error', function(err) {\n // get '/' resulted in an error\n return callback(err);\n });\n }\n }).on('error', function(err) {\n // get 'wsapi/awsbox_status' resulted in an error\n return callback(err);\n });\n}", "title": "" }, { "docid": "b79f3cc7b3e2a5cbeb014b29137d8436", "score": "0.5348518", "text": "function checkStatus(){\n cli.debug(\"Check network status\");\n _.each(_.keys(__specification_receipts__) , function(regID , index){\n var rec = __specification_receipts__[regID];\n cli.debug(\"... \"+rec.fromNet+\" -> \"+rec.toNet)\n supervisor.showResults(new mplane.Redemption({receipt: rec}) , {\n host:cli.options.supervisorHost,\n port:cli.options.supervisorPort,\n ca:cli.options.ca,\n key:cli.options.key,\n cert:cli.options.cert\n },\n function(err , response){\n if (err){\n if (err.message == 403){\n // Not available\n return;\n }else{\n showTitle(\"Error:\"+body);\n return;\n }\n }else {\n var supResponse = mplane.from_dict(body);\n if (supResponse instanceof mplane.Result){\n unRegisterMeasure(rec.fromNet, rec.toNet);\n // Register the measure(s)\n supResponse.get_result_column_values(REACHABILITY_CAPABILITY).forEach(function(sample,index){\n //FIXME: select the sampleType\n storeSample(rec.toNet , sample , DEFAULT_SAMPLE_TYPE);\n });\n //TODO: choose which analyzer has to be triggered from the resultType\n analyzeDelay({\n fromNet:rec.fromNet,\n toNet:rec.toNet,\n sampleType:DEFAULT_SAMPLE_TYPE\n });\n }\n\n }\n });\n });\n}", "title": "" }, { "docid": "22426fc1bdb62b14d62ae72c90fccd28", "score": "0.5342539", "text": "getStatus() {\n return this.webSocket.readyState;\n }", "title": "" }, { "docid": "7fb4c64fc9a0a07146190281b3c773ec", "score": "0.5339744", "text": "function retrieveDeviceState() {\n DeviceType.getDeviceState(\n {\n typeId: DashboardFactory.getSelectedType().id,\n deviceId: DashboardFactory.getSelectedInstance().id,\n logicalIntfId: DashboardFactory.getSelectedLogicalInterface().id\n },\n function(response) {\n\n // Convert the ISO8601 date properties to millis \n response.updated = new Date(response.updated).getTime();\n response.timestamp = new Date(response.timestamp).getTime();\n\n // Store the state data\n vm.stateData.push(response);\n\n /*\n * We only display one minutes worth of data points. Strip off the first\n * element of the array if it is over a certain size.\n */\n // if (vm.stateData.length > 65) {\n // vm.stateData.shift();\n // }\n \n },\n function(response) {\n if ( response.status === 401\n || response.status === 403\n ) {\n onUnauthorizedOrForbiddenResponse();\n } else if (response.status === 404) {\n onNoStateFoundResponse();\n }\n }\n );\n }", "title": "" }, { "docid": "2c61beef0e22c64139445cc2480c3705", "score": "0.53351873", "text": "function farfalla_check_status() {\n\n $.getJSON(farfalla_path+\"backend/profiles/status/?callback=?\", {},\n function(data){\n if(data.top) {\n farfalla_set_top(data.top);\n } else if (options.top) {\n farfalla_set_top(options.top);\n }\n\n if(data.id == null){\n farfalla_selection_create();\n farfalla_selection_interaction();\n // session settings for toolbar visibility have precedence over website options...\n if(data.show==1 || (data.show == null && options.visibility==1)){\n $('#farfalla_logo').click();\n } else {\n farfalla_hide_toolbar(0);\n }\n } else {\n farfalla_plugins_listing_create(data.id);\n farfalla_plugins_listing_interaction();\n farfalla_hide_toolbar(data.show);\n }\n })\n }", "title": "" }, { "docid": "4e819714afc240d08413a1ea77b5d832", "score": "0.5335122", "text": "async function getTransferStatus(token){\n try{\n const {transferDetails: {transferId}} = config;\n const finalUrl = baseUrl + url[\"getTransferStatus\"] + transferId;\n const r = await getAsync(finalUrl, {headers: createHeader(token)});\n const {status, subCode, message} = JSON.parse(r.body);\n if(status !== 'SUCCESS' || subCode !== '200') throw {name: \"incorectResponseError\", message: \"incorrect response recieved: \" + message};\n console.log(JSON.parse(r.body));\n } catch(err) {\n console.log(\"err in getting transfer status\");\n throw err;\n }\n}", "title": "" }, { "docid": "15088b8194aa58df6a67e5c703e69b6e", "score": "0.5329209", "text": "getPowerState(callback) {\n let isFanOn = false;\n if (this.fanDevice && this.fanDevice.isFanConnected()) {\n isFanOn = this.fanDevice.isPowerOn();\n }\n callback(null, isFanOn ? Characteristic.Active.ACTIVE : Characteristic.Active.INACTIVE);\n }", "title": "" } ]
29c19586bf3af0cec7e91ca87d240a6a
Criar o background do jogo
[ { "docid": "ef24fdd11af83aa3b4dfb8a2a82204fe", "score": "0.5915392", "text": "function background() {\n\tcontext.fillStyle = \"black\";\n\tcontext.fillRect(0,0,16*box,16*box);\n}", "title": "" } ]
[ { "docid": "34893c728b5cb50c17472badacef186c", "score": "0.72239983", "text": "connectToBackground() {}", "title": "" }, { "docid": "c10ac81b7a0750452eff861cdcb33dd7", "score": "0.67051464", "text": "function tryPlay(){\r\n tiempoPulsado++;\r\n document.body.style.background = \"#742121\";\r\n if(bandera)playStopCronometro();\r\n if(tiempoPulsado > 20 )document.body.style.background = \"#1F4B2A\";\r\n}", "title": "" }, { "docid": "16d76e0a0169c1d7b0322e0627300c59", "score": "0.6674249", "text": "function tryPlay() {\r\n tiempoPulsado++;\r\n document.body.style.background = \"#742121\";\r\n if (bandera) playStopCronometro();\r\n if (tiempoPulsado > 20) document.body.style.background = \"#1F4B2A\";\r\n}", "title": "" }, { "docid": "798ec84261c1d8b5da09e40ae74dcebe", "score": "0.6588898", "text": "function sleep(){\n bg1.addImage(bgImg3);\n fish.addImage(sleepyFishImage);\n}", "title": "" }, { "docid": "7594aed2b04a0961e3ead7180bb69236", "score": "0.64769137", "text": "function drawBackground(){\r\n\t\t\r\n\t\t//**************\r\n\t\t//Pinta el fondo\r\n\t\t//**************\r\n\t\tvar v = 640 - backgroundSpr.width/2;\r\n var z = 360 - backgroundSpr.height/2;\r\n \r\n\t\tcontext.drawImage(backgroundSpr,v,z);\r\n\t\t\r\n\t\t//**************\r\n\t\t//Pinta el caldero\r\n\t\t//**************\t\t\r\n\t\tanimatorC.play(animC, context, 160, 200);\r\n\t\t\r\n\t\t//**************\r\n\t\t//Pinta el cartel de las recetas\r\n\t\t//**************\t\t\r\n\t\tvar m = 220 - recipeZoneSpr.width/2;\r\n var n = 100 - recipeZoneSpr.height/2;\r\n\t\t\r\n context.drawImage(recipeZoneSpr,m,n);\t\r\n\t}", "title": "" }, { "docid": "64c9f715f8ff0132b8a1a8ef3f9ccdc1", "score": "0.6459748", "text": "function gamePlay(){\n background(220);\n \n createBoard();\n\n gameStart();\n}", "title": "" }, { "docid": "660d6e1f3faa4f5b7293f97b31fe992a", "score": "0.64425176", "text": "function initializeBackground() {\n\n}", "title": "" }, { "docid": "5c1f7afa2be8a913b57a298c46dafa45", "score": "0.64317876", "text": "function updateBackground(){\n \n}", "title": "" }, { "docid": "40731ca0c6e69ea88b5b474ffc5d5917", "score": "0.6296534", "text": "function backgroundLoop(t) {\n t0 = t;\n updateBackground();\n drawBackground();\n if(!controller.playing) {\n window.requestAnimationFrame(backgroundLoop);\n }\n}", "title": "" }, { "docid": "52a5addae83400338d3095aa3da51274", "score": "0.62376887", "text": "async function start()\n{\n background = document.querySelector('#background');\n h1 = document.querySelector('h1');\n cursor = document.querySelector('#cursor');\n cursorMargin = getComputedStyle(cursor).marginLeft;\n cursor.style.marginLeft = 0;\n\n fillBackground();\n\n await type('Hey... ');\n await type('are you there?');\n\n await type(undefined, 1000);\n await type();\n await type('Do you feel the vibrations of the universe around you?');\n\n background.style.transition = 'opacity 2s ease-in-out';\n background.style.opacity = 1;\n animationFrame = window.requestAnimationFrame(animateBackground);\n\n await type(undefined, 2000);\n await type();\n await type('What do we actually experience? ');\n await type('Is it ours to keep? ');\n await type('Or is it just something we witness?');\n\n await type(undefined, 2000);\n await type();\n await type('Do you ever actually own a moment?');\n\n setTimeout(() =>\n {\n background.style.opacity = 0;\n h1.style.opacity = 0;\n setTimeout(() =>\n {\n h1.childNodes[0].textContent = '';\n h1.style.opacity = 1;\n window.cancelAnimationFrame(animationFrame);\n setTimeout(async () =>\n {\n await type('Enjoy the rest of your day.', 3000);\n await type();\n await type();\n await type('Thank you so much for stopping by.');\n });\n }, 2000);\n }, 3000);\n}", "title": "" }, { "docid": "9dd7259688d5fc8d0717be70150194ad", "score": "0.6158741", "text": "function fimdejogo(){\n background(zeramento);\nmenuBotao(\" Menu\", yMinBotao5, yMaxBotao5, 0); }", "title": "" }, { "docid": "4e58d65ea712d2b00db83c778d128e76", "score": "0.61533755", "text": "function initializeBackgroundOver() {\n\n}", "title": "" }, { "docid": "bccb0577836e9973491dde1526eccaec", "score": "0.6123799", "text": "function changeBackground() {\n setInterval(function(){\n if (peacefulBackground.alpha > 0) {\n peacefulBackground.alpha = 0;\n avatarIsGood = false;\n happyGame = false;\n chooseGameState();\n }\n else {\n peacefulBackground.alpha = 1;\n avatarIsGood = true;\n happyGame = true;\n chooseGameState();\n }\n },15000);\n}", "title": "" }, { "docid": "f4c5e6143ccb648939c69e2fa42a6ef2", "score": "0.6111973", "text": "function startBackground () {\n document.body.style.backgroundImage = \"url('https://media.licdn.com/mpr/mpr/AAEAAQAAAAAAAAl_AAAAJDA1NjYwN2I1LTRhM2UtNDk1YS05ZTRlLWYwOWEwYjEzOGM5Zg.jpg')\";\n}", "title": "" }, { "docid": "ec3c42c34c3eebd441bc515d8616bfd6", "score": "0.60974133", "text": "function background() {\r\n ctx.fillStyle = \"#26282F\";\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }", "title": "" }, { "docid": "13b0685078c454dbcc70e7527b5071d6", "score": "0.60824424", "text": "function playScreenContent() {\n\n image(backgroundImage, 0, 0, width, height);\n\n //CALL TO GENERATE FAKE SPIDERS UPON LAUNCH OF PROGRAM//\n for (let i = 0; i < spiders.length; i++) {\n spiders[i].update();\n }\n\n //CALL TO GENERATE REAL SPIDER UPON LAUNCH OF PROGRAM//\n realSpider.update();\n\n}", "title": "" }, { "docid": "adaaa5d29c4d6ddb31fea0e993212e65", "score": "0.60702604", "text": "function gameLoop()\n{\n\tcontext.save(); \n\t\n\tbackground = new Image();\n\tbackground.src = 'image/background.gif';\n\t\n\tcontext.drawImage(background, MineArea_x, MineArea_y, MineArea_width, MineArea_height);\n\t\n\tcontext.drawImage(background, 0, MineArea_y, 200, MineArea_height);\n\t\n\tif(GameState.status==0)\n\t{\n\t\tready(context, opponents);\n\t\t\n\t}\n\telse if(GameState.status==1)\n\t{\n\t\tready(context, opponents);\n\t\tcounting(context);\n\t}\n\telse if(GameState.status==2)\n\t{\n\t\tplaying(context, opponents, mines);\n\t}\n\tcontext.restore();\n}", "title": "" }, { "docid": "21ca14e45589f5426a1a4d33df6c134c", "score": "0.6062114", "text": "function start(){\n board.music.play();\n //si ya esta corriendo el boton, se agrega un if para que no se active de nuevo\n //if()return\n //se pueden colocar aqui extras que requieran inicializar\n if(intervalo > 0) return;\n intervalo = setInterval(function(){\n update();\n }, 1000/60);//fps a 60\n }", "title": "" }, { "docid": "e267441f68333e88252b9f8d584353e4", "score": "0.60610074", "text": "start() {\n loop.start()\n }", "title": "" }, { "docid": "a72b81b2b8bd2729552073b5242e7e7a", "score": "0.6049236", "text": "function startGame() {\n\t\t\t// Daca am incarcat suficiente imagini\n\t\t\tif (game.imaginiIncarcate >= game.imaginiNecesare) {\n\t\t\t\t// Pornim animatiile pe canvas.\n\t\t\t\tanimareFundal();\n\t\t\t} else {\t\n\t\t\t\t// In caz contrar, revenim dupa un anumit timp in aceasi functie, printr-o autoapelare.\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t// Pana in momentul inceperii functiei, afisam mesajul 'Loading'\n\t\t\t\t\trenderLoadingScreen();\n\t\t\t\t\tstartGame();\t// Autoapelul functiei\n\t\t\t\t}, 60/* Timpul de asteptare exprimat in milisecunde. */);\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "98cd5f50c0df792556fdcd516b617c31", "score": "0.6023959", "text": "function keyPressed() {\n // selecting imported background image \n background(bg);\n //plays the shock sound\n shock.loop(); \n}", "title": "" }, { "docid": "8f3e52d4a7948faca689b3c31e4ea76b", "score": "0.59846526", "text": "start() {\n loop.start();\n }", "title": "" }, { "docid": "2bfa373cd5433a22e369abec90a89ac3", "score": "0.5979974", "text": "function jogar(){\n // armazena o estado do jogo\n estadoAtual = estado.TelaJogo;\n // fade para a tela sumir\n $(\"#tela\").stop();\n // $(\"#tela\").transition({opacity:0}, 500, 'ease');-----------------------------------\n // mostra o score no top do jogo\n setPontuacao();\n // debug para considerar as bordas ao redor\n if(deubug){\n $(\".contorno\").show();\n }\n // comecar os loops do jogo - aumentar tempo e intervalo\n var upauVaiComer = 1000.0 / 60.0;// 60fps\n loopJogoloop = setInterval(loopJogo, upauVaiComer);\n loopCanoloop = setInterval(lopCano,1400);\n // acao de pulo para comecar o jogo\n pulaFrango();\n}", "title": "" }, { "docid": "675bead51af8a2c64f096c2e1f38f6bc", "score": "0.59489405", "text": "function confetti(){\n \n $(\"body\").css(\"background-image\",\"url('https://media.giphy.com/media/fxwpwPOhNknT2/giphy.gif'), url('https://www.dafont.com/img/illustration/s/o/something.jpg')\");\n setInterval(function(){ \n $(\"body\").css(\"background-image\",\"url(https://www.dafont.com/img/illustration/s/o/something.jpg)\");\n console.log(\"hi\");\n }, 4000);\n }", "title": "" }, { "docid": "d6b5b74ba3826e5fd707595373d48fc0", "score": "0.5948096", "text": "function background() {\r\n\t\r\n\tvar backgroundExtension = bgExtensions[\"Sky is Clear\"]; //default background\r\n\t\r\n \tif(currentWeather || currentMain) {\r\n\t\t\r\n\t\tif(currentWeather in bgExtensions) {\r\n\t\t\t\r\n\t\t\tbackgroundExtension = bgExtensions[currentWeather];\r\n\t\t\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tswitch(currentMain) {\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"Clear\":\r\n\t\t\t\tbackgroundExtension = bgExtensions[\"Sky is Clear\"];\r\n\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"Clouds\":\r\n\t\t\t\tbackgroundExtension = bgExtensions[\"broken clouds\"];\r\n\t\t\t\tbreak;\t\r\n\t\t\t\t\r\n\t\t\t\tcase \"Rain\":\r\n\t\t\t\tbackgroundExtension = bgExtensions[\"light intensity shower rain\"];\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase \"Snow\":\r\n\t\t\t\tbackgroundExtension = bgExtensions[\"snow\"];\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase \"Drizzle\":\r\n\t\t\t\tbackgroundExtension = bgExtensions[\"light rain\"];\r\n\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\tbackgroundExtension = bgExtensions[\"Sky is Clear\"];\t\r\n\t\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$(\"#bg\").attr(\"src\", bgDomain + backgroundExtension);\r\n}", "title": "" }, { "docid": "ae2f64afca200d45fc2de8828a13e61c", "score": "0.5936125", "text": "function drawBackground(){\ndrawGround();\n}", "title": "" }, { "docid": "94da7681c7e36e537a238eff2fa357bd", "score": "0.59039074", "text": "function startBackground(){\r\n if ( getal == 1){\r\n if( audio == 'nee'){\r\n window.background_music = new Audio();\r\n background_music.src = \" music/theme.mp3\";\r\n background_music.play();\r\n getal ++\r\n }\r\n}\r\n else if( audio =='ja'){\r\n \t background_music.pause();\r\n \t getal = 1\r\n \t audio = 'nee'\r\n \t menu();\r\n }\r\n}", "title": "" }, { "docid": "28d45bb8da6ad9776530acd64c79ec0f", "score": "0.588935", "text": "function renderBackground() {\n\t\tif( !rumbling ) {\n\t\t\tctx.fillStyle = colors.background;\n\t\t\tctx.fillRect( 0, 0, width, height );\n\t\t}\n\t}", "title": "" }, { "docid": "6b32540596c828e049dd3ada86c04e55", "score": "0.58812577", "text": "start() {\r\n \r\n }", "title": "" }, { "docid": "bf619018723075c13f6f474b93fa452d", "score": "0.584675", "text": "function makeBackground() {\n\n var $background = $('<div></div').attr('class', 'background').css('background', color);\n\n $('body').append($background).hide().fadeIn();\n\n setTimeout(function() {\n $($background).fadeOut(2000);\n loadSpots();\n }, 500);\n\n\n}", "title": "" }, { "docid": "3abf8da984ffa19982a83a3858b1cb65", "score": "0.5825114", "text": "function setBackground() {\n if (timerReset) {\n var pattern = Trianglify({\n width: width,\n height: height,\n cell_size: 150\n });\n\n\n scope.options = pattern.opts;\n\n if (dobg1) {\n pattern.canvas(bg1[0]);\n bg2.fadeOut(1000);\n dobg1 = false;\n } else {\n pattern.canvas(bg2[0]);\n bg2.fadeIn(1000);\n dobg1 = true;\n }\n timerReset = false;\n applyAfterTimeout = false;\n setTimeout(function() {\n timerReset = true;\n if (applyAfterTimeout)\n setBackground();\n }, 1000);\n } else {\n applyAfterTimeout = true;\n }\n }", "title": "" }, { "docid": "673484b8b3ec4d830fd6b66d619cfee9", "score": "0.582202", "text": "function loadHandler(){\n\t\t\tconsole.log(\"background loaded\");\n\t\t}", "title": "" }, { "docid": "af1130e9e5f03a65138e0c7f791e0c37", "score": "0.58116835", "text": "function makeBG(){\n setTimeout(_makeBG,10)\n function _makeBG(){\n BGCANV = paper({col:PAPER_COL0,tex:10,spr:0})\n var img = BGCANV.toDataURL(\"image/png\");\n document.body.style.backgroundImage = 'url('+img+')';\n }\n}", "title": "" }, { "docid": "b75fa6e1ca7a4074b3973a34930cf690", "score": "0.5811313", "text": "function drawBackground(){ \n ctx.fillStyle = 'white';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n drawGround();\n }", "title": "" }, { "docid": "6ee7158edfd81fc6816f154963df37d9", "score": "0.57939327", "text": "function drawBackground (game) {\n game.ctx.fillStyle=\"#3498db\";\n game.ctx.fillRect(0,0,game.canvas.width/2,game.canvas.height);\n\n game.ctx.fillStyle=\"#34495e\";\n game.ctx.fillRect(game.canvas.width/2,0,game.canvas.width/2,game.canvas.height);\n}", "title": "" }, { "docid": "59c288cb2e886a6b21c78f6840e4324b", "score": "0.5793201", "text": "function Run() {\n\n //Crea un ciclo\n requestAnimationFrame(Run);\n\n //Configura el juego\n Game();\n\n //Dibuja en el canvas\n Paint();\n }", "title": "" }, { "docid": "4c21ce9a126c90fc4b5663d1038971e1", "score": "0.577105", "text": "function setBgGreet() {\n let today = new Date();\n let hour = today.getHours();\n if(hour >= 6 && hour < 12) {\n // Morning\n if(dark === false) {\n document.body.style.backgroundImage = 'url(\"img/dm-morning.jpg\")';\n } else {\n document.body.style.backgroundImage = 'url(\"img/dm-morning.jpg)';\n }\n greeting.textContent = 'Good morning,';\n } else if(hour >= 12 && hour < 18) {\n // Afternoon\n if(dark === false) {\n document.body.style.backgroundImage = 'url(\"img/dm-midday.jpg\")';\n } else {\n document.body.style.backgroundImage = 'url(\"img/dm-midday.jpg)';\n }\n //document.body.style.backgroundImage = 'url(\"img/midday.jpg\")';\n greeting.textContent = 'Good afternoon,';\n } else if(hour >= 18 && hour < 22) {\n // Evening\n document.body.style.backgroundImage = 'url(\"img/dm-evening.jpg\")';\n greeting.textContent = 'Good evening,';\n document.body.style.color = 'white';\n } else {\n // Night\n document.body.style.backgroundImage = 'url(\"img/dm-night.jpg\")';\n greeting.textContent = 'Good night,';\n document.body.style.color = 'white';\n }\n setTimeout(setBgGreet, 1000);\n}", "title": "" }, { "docid": "6ef9037b340c6711ae19ff977c0d40d5", "score": "0.57670516", "text": "function noMoDisco() {\n document.body.style.background = \"white\";\n clearInterval(discoTimer);\n}", "title": "" }, { "docid": "aaa95d3939793e9df42362a65e6c5cfe", "score": "0.5741555", "text": "function drawMainBackground() {\n\t\tctx.fillStyle = 'PapayaWhip';\n\t\tctx.fillRect(0, 0, WIDTH, HEIGHT);\n\t}", "title": "" }, { "docid": "c50fec0060d6221645f94b00a5fb087e", "score": "0.57329655", "text": "function getNewBackground(status) {\n\n //click event ends here\n\n //change backgroundImage start from here\n\n $('.main').css('background-image', 'url(https://source.unsplash.com/1920x1366/?' + status + ')');\n //backgroundImage ends from here\n $('#user').html(\" Github\");\n\n\n Mousetrap.bind('ctrl+b', function (e) {\n window.top.location.reload(true);\n });\n }", "title": "" }, { "docid": "90aac6d6ff243bb20ad8a585bd03e9a3", "score": "0.5724185", "text": "start() { }", "title": "" }, { "docid": "90aac6d6ff243bb20ad8a585bd03e9a3", "score": "0.5724185", "text": "start() { }", "title": "" }, { "docid": "ca84973e8a52837bfe6af10d33206960", "score": "0.5710085", "text": "function start() {\n i = 0;\n clearInterval(set);\n onOff = !onOff;\n onOff ? $(this).css(\"background-color\", \"Chartreuse\") : $(this).css(\"background-color\", \"\");\n beginSequence();\n }", "title": "" }, { "docid": "7d2e2d46ee945dc60c47d6b1d587905c", "score": "0.5709833", "text": "start(){\n \n }", "title": "" }, { "docid": "f54090fc3b73a0addb69bf1bcc9284dc", "score": "0.5704439", "text": "function pocniIgru() {\n $(\"#krajigre\").css({\n \"visibility\": \"hidden\"\n });\n $(\".site-wrapper\").css({\n \"background-image\": pozadinaImgFile,\n \"background-size\": \"auto 100%\"\n });\n igranje = true;\n score = 0;\n speed = 10000;\n level = 1;\n if (!sviraMuzika) {\n pustiZvuk(bgAudio);\n sviraMuzika = true;\n }\n $(\"#score\").text(\"Rezultat: \" + score);\n $(\"#level\").text(\"Nivo: \" + level);\n $(\"#hiscore\").text(\"Rekord: \" + highScore);\n $(\".meda\").css(\"background-image\", medaOk);\n $(\"#meda1\").css({\n \"left\": +(5 + Math.floor(Math.random() * 25)) + \"%\"\n });\n $(\"#meda2\").css({\n \"left\": +(30 + Math.floor(Math.random() * 30)) + \"%\"\n });\n $(\"#meda3\").css({\n \"left\": +(60 + Math.floor(Math.random() * 20)) + \"%\"\n });\n $(\".meda\").css({\n \"top\": \"100%\"\n });\n TweenLite.to(\".meda\", speed / 1000, {\n \"top\": \"0%\",\n onComplete: function() {\n $(this).css({\n \"background-image\": medaVrh\n });\n krajIgre();\n }\n });\n $(\".meda\").click(medaClick());\n }", "title": "" }, { "docid": "cdb4668d748a28720d6f146093e242d0", "score": "0.5700339", "text": "function Start () {//start is called one time\n\t//default values\n\tlastBg = 1;\n\tfirstBg = 0; \n\tplayerObj = GameObject.FindGameObjectWithTag(\"Player\"); // get player object by tag\n\tinitBg(); // therefore initbg would be created one time\n}", "title": "" }, { "docid": "3abbce855c6012e04763bd75094fa977", "score": "0.5700088", "text": "function updateBackground() {\n farBg.tilePosition.x -= bgSpeed;\n midBg.tilePosition.x -= mapSpeed;\n lavaBg.tilePosition.x += lavaSpeed;\n mario.position.x -= mapSpeed;\n renderer.render(stage);\n}", "title": "" }, { "docid": "6498291e45a37e744f397ca8a6c9920a", "score": "0.56939757", "text": "function MainLoop() {\n\t// Transition to new shell if requested.\n\tcheckTransitionCue();\n\t\n\t// Update and draw shell.\n\tcurrentShell.update();\n\tcurrentShell.draw();\n\t\n\tframes++;\n\trequestAnimationFrame(MainLoop);\n}", "title": "" }, { "docid": "a8f84be228ef8308c20ef9a69a964145", "score": "0.5693611", "text": "function spawnB(){\r\n \r\n gameBackground = createSprite(width/2,height/2);\r\n gameBackground.addImage(gameBackgroundImage);\r\n gameBackgroundImage.width = displayWidth;\r\n gameBackgroundImage.height = displayHeight;\r\n gameBackground.lifetime = windowWidth;\r\n}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5693417", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5693417", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5693417", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5693417", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5693417", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5693417", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5693417", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5693417", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5693417", "text": "start() {}", "title": "" }, { "docid": "60fbec75488ee90482f0cef87bcdc938", "score": "0.5692619", "text": "function loop() {\n\n telaAtiva.desenha();\n telaAtiva.atualiza();\n\n frames = frames + 1;\n\n // ajudar a reproduzir os quadros do jogo\n requestAnimationFrame(loop);\n}", "title": "" }, { "docid": "4ec20547d7bc0cb8e51d092b2bf7e8ab", "score": "0.5687814", "text": "function draw() {\n push();\n imageMode(CORNER);\n image(bgImg, x1, 0, width, height);\n image(bgImg, x2, 0, width, height);\n\n // trying to loop the background\n x1 -= scrollSpeed;\n x2 -= scrollSpeed;\n\n if(x1 < -width){\n x1 = x2 + width;\n }\n if(x2 < -width){\n x2 = x1 + width;\n }\n pop();\n\n imageMode(CENTER);\n // can movement\n can.x -= can.vx;\n\n // bells movement\n bells.x -= bells.vx;\n\n // checking if can goes off screen\n if(can.x < 0){\n can.x = 1280;\n }\n\n if(bells.x < 0){\n bells.x = 1520;\n }\n\n // checking if roald touches can\n let d = dist(roald.x, roald.y, can.x,can.y);\n if(d < can.size/2 + roald.size/2)\n {\n myMusic.stop();\n gameOverMusic.play();\n noLoop();\n }\n\n // checking if roald touches bells\n let bellD = dist(roald.x, roald.y, bells.x,bells.y);\n if(bellD < bells.size/2 + roald.size/2)\n {\n bells.x = 1280 + random(300, 1000);\n pointCounter += 100;\n bellMusic.play();\n }\n\n // displaying can & bells\n image(canImg, can.x, can.y, can.size, can.size + 25);\n image(bellImg, bells.x, bells.y, bells.size, bells.size +20);\n\n // displaying roald\n roald.show();\n roald.move();\n\n // Displaying the point counter\n push();\n image(bellImg, 30, 35, bells.size, bells.size + 20);\n noStroke();\n fill(0);\n textSize(50);\n textAlign(LEFT);\n text(pointCounter, 70, 55);\n pop();\n\n textSize(25);\n textAlign(LEFT);\n fill(0,0,0, fade);\n text(\"press spacebar to jump over cans\", width/2, 55);\n if(fade > 255)\n {\n fadeAmonut = -1;\n }\n fade += fadeAmonut;\n\n}", "title": "" }, { "docid": "a670c5e79ec359fd9ebace8d0a5cff5e", "score": "0.5686281", "text": "function callAdaptiveBackground(){\r\n $.adaptiveBackground.run({\r\n parent : adaptiveBackgroundParent\r\n });\r\n}", "title": "" }, { "docid": "a0095ed13248a931be46e85b231417fb", "score": "0.56788903", "text": "function activityBackground(event){\n \n let timeNow = moment().format(\"H\");\n \n for (i=8; i<18; i++)\n if (i < currentTime) {\n $(`#${i}`).removeClass(\"green\");\n $(`#${i}`).removeClass(\"red\");\n $(`#${i}`).addClass(\"gray\");\n } else if (i > currentTime) {\n $(`#${i}`).removeClass(\"gray\");\n $(`#${i}`).addClass(\"red\");\n $(`#${i}`).addClass(\"green\");\n } else {\n $(`#${i}`).removeClass(\"gray\");\n $(`#${i}`).removeClass(\"green\");\n $(`#${i}`).addClass(\"red\");\n }\n}", "title": "" }, { "docid": "804f74855df9487c4eb5d3849b9c8baa", "score": "0.56733704", "text": "function mousePressed() {\n if (musica.isPlaying()) {\n musica.pause(); // la canzone riprende da dove si era fermata\n background(\"white\");\n } else {\n musica.play();\n background(\"thistle\");\n }\n}", "title": "" }, { "docid": "d56b3b50cea4e947a16de654e97c3cff", "score": "0.56726694", "text": "function setBackground() {\n let today = new Date(),\n hour = today.getHours(),\n second = today.getSeconds();\n\n if (second < 20) {\n if (\n !watchFaceBg.style.background ||\n watchFaceBg.style.background === \"var(--linear-bg-night)\"\n ) {\n watchFaceBg.style.background = \"var(--linear-bg-day)\";\n font.style.color = \"var(--fcolor-dark)\";\n // Animate out prev night elements\n eveOut();\n // Animate in day elements\n setTimeout(dayIn, 500);\n }\n } else if (second < 40) {\n if (\n !watchFaceBg.style.background ||\n watchFaceBg.style.background === \"var(--linear-bg-day)\"\n ) {\n watchFaceBg.style.background = \"var(--linear-bg-afternoon)\";\n // Animate out day elements\n dayOut();\n // Animate in afternoon elements\n setTimeout(afternoonIn, 500);\n }\n } else {\n if (\n !watchFaceBg.style.background ||\n watchFaceBg.style.background === \"var(--linear-bg-afternoon)\"\n ) {\n watchFaceBg.style.background = \"var(--linear-bg-night)\";\n font.style.color = \"var(--fcolor-light)\";\n // Animate out afternoon elements\n afternoonOut();\n // Animate in evening elements\n setTimeout(eveIn, 500);\n }\n }\n}", "title": "" }, { "docid": "6bd95f343d8e17277c6d8888233118b2", "score": "0.5672072", "text": "function start() {\n if (game == false) {\n pos_x = (background_w /2) - (personage_w / 2);\n pos_y = (background_h /2) - (personage_h / 2);\n \n personage.style.top = pos_y + 'px'; \n personage.style.left = pos_x + 'px';\n personage.style.cursor = \"url('cursor_images/roos3_zonder_achtergrond-removebg-preview2.png') 25 25, pointer\";\n \n game = true; \n fullsreen(); \n moveDuck(); \n }\n}", "title": "" }, { "docid": "c4e2cbbf54e5d4231a01b822a20a8a9d", "score": "0.56667644", "text": "function setBackGround() {\n this.style.backgroundImage = `url('img/${game.active().icon}')`;\n } //defines mouse overs", "title": "" }, { "docid": "103c536891f8b0dac3a5fd9624bf0904", "score": "0.56666017", "text": "function run() {\n paused = false;\n loop();\n}", "title": "" }, { "docid": "13f6831d95b179afe90f02d381b475f4", "score": "0.56627434", "text": "function main(){\n\tstart();\n}", "title": "" }, { "docid": "8daa64877b1a2a7bc93d5af03ef35cb5", "score": "0.5660195", "text": "start() {\n this.running = true;\n this.main();\n }", "title": "" }, { "docid": "8c690be85281f6a1890c0fff031ac635", "score": "0.56580347", "text": "function drawBackground(){\n document.body.style.backgroundColor = 'blue';\n }", "title": "" }, { "docid": "82666c099c830b796406ee7e0d6cc7a1", "score": "0.56538546", "text": "function setBgGreet() {\n let today = new Date(),\n hour = today.getHours();\n\n if (hour < 12 && hour >= 6) {\n // Morning\n greeting.textContent = 'Good Morning, ';\n dayTime = 'morning';\n var url = getImage();\n document.body.style.backgroundImage =\n `url('${url}')`;\n } else if (hour < 18 && hour >= 12) {\n // Afternoon\n dayTime = 'day';\n var url = getImage();\n document.body.style.backgroundImage =\n `url('${url}')`;\n greeting.textContent = 'Good Afternoon, ';\n \n } else if (hour <= 23 && hour >= 18) {\n // Evening\n greeting.textContent = 'Good Evening, ';\n document.body.style.color = 'white';\n dayTime = 'evening';\n var url = getImage();\n document.body.style.backgroundImage =\n `url('${url}')`;\n \n } else {\n greeting.textContent = 'Good Nigth, ';\n dayTime = 'night';\n var url = getImage();\n document.body.style.backgroundImage =\n `url('${url}')`;\n }\n\n setTimeout(setBgGreet, 3600000);\n}", "title": "" }, { "docid": "70c300172542cc5c175ec5476e897e16", "score": "0.564587", "text": "function cuerpop11(){\r\n \t\t\t\t$('#cuerpo').css('background',p1cue1);\r\n\t\t\t\t}", "title": "" }, { "docid": "06e1c3b19eae3b572092e09fac795259", "score": "0.5644507", "text": "function messageBackground(type,payload){\n chrome.runtime.sendMessage({type: type, payload: payload});\n}", "title": "" }, { "docid": "a9520f0d43414afb96808e671544d2fe", "score": "0.5636875", "text": "function drawJogo() {\n drawAnimacaoInicial();\n drawMenu();\n window.requestAnimationFrame(drawJogo);\n}", "title": "" }, { "docid": "c3d4495ba5f4c69265f38eea5e728c5b", "score": "0.5632016", "text": "Start()\n {\n\n }", "title": "" }, { "docid": "c3d4495ba5f4c69265f38eea5e728c5b", "score": "0.5632016", "text": "Start()\n {\n\n }", "title": "" }, { "docid": "efcd9a9bbff1bc27e897c38b0b485a8a", "score": "0.56212837", "text": "start() {\n\n }", "title": "" }, { "docid": "33d85a51df69abda424e1a745c454fd2", "score": "0.56193405", "text": "static init() {\n const background = new ChromeVoxBackground();\n }", "title": "" }, { "docid": "ee431d1291199d09141a66ca0ae7dacb", "score": "0.56160426", "text": "function segue () {\n\t\tcontext.fillStyle = \"rgb(0, 0, 0)\";\n\t\tcontext.fillRect(0, 0, screenSize.width, screenSize.height);\n\t\tfor(var i=0; i<timers.length; i++){\n\t\t\tclearInterval(timers[i]);\n\t\t}\n MainMenu();\n }", "title": "" }, { "docid": "8785c519607d7f0515cbba3a57750aaf", "score": "0.5602945", "text": "function backgroundLive() {\n b = 0;\n //\n // This is a main loop. Here organism checks if\n // last mutation do the job: generates correct\n // output.\n //\n while (b++ < busyCounter && _alive) {\n //\n // We don't need to change memory between the iterations.\n // Organism should remember it's previous experience. The\n // same about output.\n //\n _interpreter.run({\n code : code,\n mem : mem,\n out : out,\n codeLen: len\n });\n //\n // After every script run, we need to decrease organism's energy.\n // As big the script is, as more the energy we need.\n //\n _energy -= (energyDec * len);\n //\n // This is how organism dies :(\n //\n if (_energy < 1) {\n _alive = false;\n }\n }\n //\n // This line is very important, because it decrease CPU\n // load and current thread works \"silently\"\n //\n if (_alive) {\n setTimeout(backgroundLive, 0);\n }\n }", "title": "" }, { "docid": "149d85eba5f02bf8cb9cc0d048c14499", "score": "0.5601865", "text": "function start_coaster() {\n Main();\n setTimeout(function(){\n $('#coaster').addClass('coaster-slow');\n }, 4500);\n}", "title": "" }, { "docid": "680348cc55c65b6158d88d4ea552829f", "score": "0.5598374", "text": "function fight () {\n setTimeout(function(){ document.body.style.backgroundImage = \"url('images/2.jpg')\" }, 200);\n setTimeout(function(){ document.body.style.backgroundImage = \"url('images/3.jpg')\" }, 800);\n}", "title": "" }, { "docid": "ce221a65d2fa6f0bedd366e42f68ae57", "score": "0.5589846", "text": "function setBg() {\n const today = new Date(),\n hour = today.getHours();\n\n if (hour < 12) {\n // morning\n document.body.style.backgroundImage = \"url(../assets/images/morning.jpg)\";\n greet.textContent = \"Good Morning\";\n } else if (hour < 18) {\n // afternoon\n document.body.style.backgroundImage = \"url(../assets/images/afternoon.jpg)\";\n greet.textContent = \"Good Afternoon\";\n } else {\n // evening\n document.body.style.backgroundImage = \"url(../assets/images/evening.jpg)\";\n document.body.style.color = \"white\";\n greet.textContent = \"Good Evening\";\n }\n}", "title": "" }, { "docid": "60439e32f93335476c6160f240616528", "score": "0.5589164", "text": "function continute() {\n\tvar tohta = document.getElementById(\"suspent_pic\");\n\ttohta.style.display = \"none\";\n\tvar ninja_left = parseInt(window.getComputedStyle(ninja).left);\n\tvar tag_music = document.getElementById(\"tag_music\");\n\tvar step = document.getElementById(\"step_mp3\");\n\tstep.play();\n\ttag_music.play();\n\tif (ninja_left == 63) {\n\t\tninja.style.background = \"url('../img/leftwalk.gif')\";\n\t}\n\tif (ninja_left == 507) {\n\t\tninja.style.background = \"url('../img/rightwalk.gif')\";\n\t}\n\tif (ninja_left > 63 && ninja_left < 506) {\n\t\tninja.style.background = \"url('../img/move1.gif')\";\n\t\txx = true;\n\t}\n\tconsole.log(ran_side);\n\tif (ran_side == 1) {\n\t\tmonster.style.background = \"url('../img/toright.gif')\";\n\t}\n\tif (ran_side == 2) {\n\t\tmonster.style.background = \"url('../img/toleft.gif')\";\n\t}\n\t\n\t\n\tg = true;\n}", "title": "" }, { "docid": "9de3a5f7db5d3ea16d883d58a8d7a010", "score": "0.5588699", "text": "start() {\n\n }", "title": "" }, { "docid": "8228b27ffd3b20afa56e8a5166e96b79", "score": "0.5578584", "text": "function sendRemoteDesktopImage () {\n setInterval(function() {\n makeAwesomeShot();\n }, 1000);\n }", "title": "" }, { "docid": "b7082f44ce15be57df5fb0a1060e7c70", "score": "0.55772436", "text": "function create_background()\n\t{\n\t\tif ( typeof background !== 'undefined' && background.has( Background ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar t = Date.now();\n\n\t\t// Halt loop during generation/prerendering\n\t\t_.pause();\n\n\t\t// TODO: Load background configuration options from level data\n\t\tbackground = new Entity()\n\t\t\t.add(\n\t\t\t\tnew Background()\n\t\t\t\t\t.configure(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titerations: 11,\n\t\t\t\t\t\t\televation: 250,\n\t\t\t\t\t\t\tconcentration: 35,\n\t\t\t\t\t\t\tsmoothness: 8,\n\t\t\t\t\t\t\trepeat: true,\n\t\t\t\t\t\t\tcities: 250,\n\t\t\t\t\t\t\tmaxCitySize: 45,\n\t\t\t\t\t\t\ttileSize: 2,\n\t\t\t\t\t\t\tlightAngle: 220,\n\t\t\t\t\t\t\t//hours: [12, 19, 20, 0, 4, 6],\n\t\t\t\t\t\t\thours: [12],\n\t\t\t\t\t\t\tcycleSpeed: 60,\n\t\t\t\t\t\t\tscrollSpeed:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tx: -10,\n\t\t\t\t\t\t\t\ty: -2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpixelSnapping: false\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t\t.build(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprogress: function( rendered, total )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log('Rendering...' + rendered + '/' + total + '...');\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcomplete: function()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log('Total init time: ' + ( Date.now() - t ) + 'ms');\n\t\t\t\t\t\t\t\tinitialize_game();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t);\n\n\t\tstage.addChild( background );\n\t}", "title": "" }, { "docid": "47a7df54ac6662eeffc659862f7a3b4b", "score": "0.5574446", "text": "function criarBG() {\n context.fillStyle = \"#333652\"; \n context.fillRect(0, 0, 16 * box, 16 * box);\n}", "title": "" }, { "docid": "6d7bddbce5fda00247d59c90357dc7bd", "score": "0.557341", "text": "backgroundMove() {\n imageMode(CORNER);\n this.bgImg.resize(7250, 720);\n image(this.bgImg, this.bgLeft, 0);\n }", "title": "" }, { "docid": "35c6e5f5d2df2812291c85c544d4b509", "score": "0.55732757", "text": "function running(event) {\n if (event.keyCode === 39) {\n static.classList.add('running');\n interval = setInterval(moveBackground, 10);\n counter -= 5;\n }\n}", "title": "" }, { "docid": "de3205735579a10535b51a3314d2bf5f", "score": "0.55685943", "text": "function paintBackground(){\n\tpaintMap();\n\tpaintMessages();\n}", "title": "" }, { "docid": "5bacf767a25d8a7bc5dd09825091347a", "score": "0.5559067", "text": "function veille() {\n setInterval(() => {\n if (veilleuse == sleeptime) {\n $(mainscreen).removeClass('fadeIn').addClass('fadeOut').hide()\n $(screensaver).removeClass('fadeOut').addClass('fadeIn').show()\n $(bodyId).css('background:red')\n veilleuse = 0\n }\n veilleuse++\n }, 1000)\n }", "title": "" }, { "docid": "9842af4c7f0c556376a680e738cc8357", "score": "0.5557362", "text": "function timedBackground() {\n\n var currentHour = moment().hours();\n\n if (currentHour < 10) {\n $(\"body\").addClass(\"morning\")\n } else if (currentHour < 16) {\n $(\"body\").addClass(\"afternoon\")\n } else if(currentHour <20){\n $(\"body\").addClass(\"dusk\")\n }else{\n $(\"body\").addClass(\"night\");\n }\n }", "title": "" }, { "docid": "d5b7bb1ad88034c99efc9865c34823d2", "score": "0.5552077", "text": "function marqueBackground() {\n\t$( '.background-marque' ).each( function() {\n\t\tvar $el = $( this );\n\t\tvar x = 0;\n\t\tvar step = 1;\n\t\tvar speed = 10;\n\n\t\tif ( $el.hasClass( 'to-left' ) ) {\n\t\t\tstep = - 1;\n\t\t}\n\n\t\t$el.css( 'background-repeat', 'repeat-x' );\n\n\t\tvar loop = setInterval( function() {\n\t\t\tx += step;\n\t\t\t$el.css( 'background-position-x', x + 'px' );\n\t\t}, speed );\n\n\t\tif ( $el.data( 'marque-pause-on-hover' ) == true ) {\n\t\t\t$( this ).hover( function() {\n\t\t\t\tclearInterval( loop );\n\t\t\t}, function() {\n\t\t\t\tloop = setInterval( function() {\n\t\t\t\t\tx += step;\n\t\t\t\t\t$el.css( 'background-position-x', x + 'px' );\n\t\t\t\t}, speed );\n\t\t\t} );\n\t\t}\n\t});\n}", "title": "" }, { "docid": "bdde5f60773accec13a3333eb776f5a4", "score": "0.5551927", "text": "function run() {\n //prevents multiple clocks from running\n clearInterval(intervalId);\n intervalId = setInterval(countdown, 1000);\n //populates DOM with questions and answers from questions array above\n //$(\"#question-area\").css({background : 'url(./assets/images/utah_outline.jpg) no-repeat center 60%'});\n $(\"#question-area\").css(\"background-image\", \"url('./assets/images/utah_outline.jpg')\");\n addQuestionAnswer(questions);\n //adds a break between questions and done button\n $(\"#question-area\").append(\"<br>\");\n //adds done button \n addDoneButton();\n}", "title": "" }, { "docid": "f2128f4811bd95b252d3c54423165abf", "score": "0.554992", "text": "function changeBackground() {\n if (window.location.hash === '#/empire_sounds') {\n bg.setTexture(PIXI.Texture.fromFrame('data/displacement_BG.jpg'));\n } else if (window.location.hash === '#/last_minute_change_of_heart') {\n bg.setTexture(PIXI.Texture.fromFrame('data/displacement_BG1.jpg'));\n } else if (window.location.hash === '#/biomes') {\n bg.setTexture(PIXI.Texture.fromFrame('data/displacement_BG2.jpg'));\n } else if (window.location.hash === '#/ruqia') {\n bg.setTexture(PIXI.Texture.fromFrame('data/displacement_BG3.jpg'));\n } else if (window.location.hash === '#/mhope') {\n bg.setTexture(PIXI.Texture.fromFrame('data/displacement_BG4.jpg'));\n } else if (window.location.hash === '#/pathos') {\n bg.setTexture(PIXI.Texture.fromFrame('data/displacement_BG6.jpg'));\n } else if (window.location.hash === '#/teardrop_tattoo') {\n bg.setTexture(PIXI.Texture.fromFrame('data/displacement_BG7.jpg'));\n } else if (window.location.hash === '#/kraken') {\n bg.setTexture(PIXI.Texture.fromFrame('data/displacement_BG8.jpg'));\n } else if (window.location.hash === '#/blueprint') {\n bg.setTexture(PIXI.Texture.fromFrame('data/displacement_BG9.jpg'));\n }\n }", "title": "" }, { "docid": "4a7236218fcd4daf5699316bb69c6a42", "score": "0.5549121", "text": "function startLoop () {\n cooldownTimerId = setTimeout(function loop () {\n var cool_time = getCooldown(),\n disp_time = getDisplay(),\n alt = altImages.get();\n\n // swapImage out with alt pic\n swapImage(alt);\n\n // Schedule picture to revert back\n displayTimerId = setTimeout(function () {\n swapImage(imagePaths.main);\n\n // After picture has reverted, schedule the next time for it to run\n cooldownTimerId = setTimeout(loop, cool_time);\n }, disp_time);\n }, getCooldown());\n }", "title": "" }, { "docid": "4cff069482d260c4c3d413fe917c3b71", "score": "0.5539581", "text": "function drawBackground(){\n background(backgroundColor);\n}", "title": "" }, { "docid": "5ebd6a937ede884140f618ac77a34b4d", "score": "0.55392635", "text": "function loop() {\n\n // color in the background\n ctx.fillStyle = \"#000000\";\n ctx.fill(0, 0, canvasWidth, canvasHeight);\n\n moveAll();\n drawAll();\n}", "title": "" }, { "docid": "3bdc6f9a788135b2a262b9ed8db8d218", "score": "0.5534397", "text": "function setupBackgroundMusic() {\n // play on loop and only once at a time\n backgroundMusic.loop();\n backgroundMusic.playMode(\"untilDone\")\n}", "title": "" } ]
2ffc5cf31e8a47c4284bf43e331a3501
Base class helpers for the updating state of a component.
[ { "docid": "68f80c7dbfd927b81c200eee62c8fb6b", "score": "0.0", "text": "function Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}", "title": "" } ]
[ { "docid": "71344d4025832328010a90ae0e1784ce", "score": "0.6655663", "text": "constructor(props)\n {\n super(props);\n\n this.onUpdate = this.onUpdate.bind(this);\n this.onUpdateCancel = this.onUpdateCancel.bind(this);\n this.onUpdateSave = this.onUpdateSave.bind(this);\n this.onUpdate = this.onUpdate.bind(this);\n this.onInputChange = this.onInputChange.bind(this);\n this.state = {\n isUpdating: false,\n label: props.label\n }\n }", "title": "" }, { "docid": "0f12c71c767bb905ae3bd19fea95d961", "score": "0.63532543", "text": "update(props) {\n this.props = props\n this.updateState(props.state)\n this.updateDOMForProps()\n }", "title": "" }, { "docid": "e416361b4b1bd12576452139cbceeaf3", "score": "0.6349521", "text": "updateState(field, event){\n\t //this gives a warning, but ignore it because the state\n\t //is not used for rendering\n\t this.state[field]= event.target.value;\n }", "title": "" }, { "docid": "53f84b546eb5bf034c4ee9ad53dc4755", "score": "0.6340756", "text": "setState(newVal) {\n return this.componentToSync.setState(newVal);\n }", "title": "" }, { "docid": "1a1787d337d3e0a926b87692fac513a8", "score": "0.6337163", "text": "stateChanged() {\n const componentStore = mapStateToProps(getStore().getState());\n Object.entries(componentStore).forEach(([key, value]) => {\n this[key] = value;\n });\n }", "title": "" }, { "docid": "7f2b2c8dda941a48820aded25269a665", "score": "0.6332886", "text": "_stateChanged(state) { }", "title": "" }, { "docid": "ed27337f98c2327d3d330086bf1dd481", "score": "0.62413853", "text": "setState(next) {\n const compat = (a) => typeof this.state == 'object' && typeof a == 'object';\n // check and see if component should update\n // compares prev props with these new props passed in via next\n // if it should, we update it\n // if it has previously rendered it already has a base prop\n if (this.base && this.shouldComponentUpdate(this.props, next)) {\n // store existing state as previous state\n const prevState = this.state;\n this.componentWillUpdate(this.props, next);\n // compile object into a shallow copy if state is an object\n // reduce state to now have initial state plus whatever's new\n this.state = compat(next) ? Object.assign({}, this.state, next) : next;\n // patch this instance with a new render\n patch(this.base, this.render());\n // fire off a lifecycle hook showing new props and the prev state\n this.componentDidUpdate(this.props, prevState);\n } else {\n this.state = compat(next) ? Object.assign({}, this.state, next) : next;\n }\n }", "title": "" }, { "docid": "eb7aa2dd2946ca117efeff9a81f2697e", "score": "0.62370664", "text": "_setState(data) {\n var updated = false;\n\n for (var prop in this._state) {\n if (data.hasOwnProperty(prop)) {\n this._state[prop] = data[prop];\n updated = true;\n }\n }\n\n if (updated) {\n this._emitter.emit('status:update', this.get());\n }\n }", "title": "" }, { "docid": "196245f23a640497097666b21df687ca", "score": "0.6227317", "text": "constructor() {\n super();\n\n this.state = {\n txtState: 'txt State',\n red: 0,\n green: 0,\n blue: 0,\n val: 1,\n val2: 0,\n increasing: false\n };\n\n this.update = this.update.bind(this);\n }", "title": "" }, { "docid": "17426132ff877f4a78212e526d81894d", "score": "0.618041", "text": "update()\n {\n if(this.desiredState !== \"\")\n {\n if(this.currentState !== \"\")\n {\n this.states[this.currentState].exit();\n }\n\n this.currentState = this.desiredState;\n this.desiredState = \"\";\n\n if(this.states[this.currentState] !== undefined)\n {\n this.states[this.currentState].init();\n }\n }\n\n if(this.currentState !== \"\")\n {\n if(this.states[this.currentState] !== undefined)\n {\n this.states[this.currentState].update();\n }\n }\n }", "title": "" }, { "docid": "954d0e181406c5057d082338244181c7", "score": "0.61581206", "text": "updateItem() {\n this.setState(this.state);\n }", "title": "" }, { "docid": "70d651c6ea01f87e0f3739de8e1c8593", "score": "0.6148699", "text": "handleUpdate () {\n this.setState(getState(store, this.props))\n }", "title": "" }, { "docid": "2823978e2117b9d799bbf26daa311f72", "score": "0.61456084", "text": "stateChanged(_state) { }", "title": "" }, { "docid": "aaa0e69cf61d0218db0711bcf256049c", "score": "0.61445194", "text": "constructor(props) {\n super(props)\n //even though props won't be used it is still a good habit to get into to pass them in\n\n //setting our initial state\n this.state = {\n name: 'Bryan'\n }\n //binding our methods we created below\n this.handleUpdateName = this.handleUpdateName.bind(this)\n this.handleUpdateColor = this.handleUpdateColor.bind(this)\n }", "title": "" }, { "docid": "e00dfaafcfb99c2e3ec5f376ba3e891e", "score": "0.6129893", "text": "updateItem (key,value)\n {\n this.setState({[key]:value}); //this referes to instance of object from class\n }", "title": "" }, { "docid": "9ddeb9e03e24876712ddf8ae39ef9494", "score": "0.611252", "text": "update() {\n let subscription;\n subscription = this.store.events.subscribe('stateChanged', (loading) => {\n console.log(`UPDATE: Component \"${this.element.id}\"`)\n \n this.loading = loading\n this.render()\n subscription.unsubscribe()\n })\n }", "title": "" }, { "docid": "95b920b45dc1e6292314d3abcfeed533", "score": "0.6111048", "text": "componentWillUpdate() {}", "title": "" }, { "docid": "64a33591a3b2735465794e14eb935cb0", "score": "0.61106956", "text": "componentDidUpdate() {\n this.props.actions.updateQuestionSuccess(\n {\n id: this.state.id,\n value: this.state.question\n }\n );\n }", "title": "" }, { "docid": "ed4a8c7f4c9ab66ef544f382487710a8", "score": "0.61084956", "text": "stateChanged(state) {\n\n\n }", "title": "" }, { "docid": "ee023f6020bf5943130dd2ac9f2ac377", "score": "0.6103707", "text": "onUpdate()\n {\n this.setState(prevState => {\n return {\n ...prevState,\n isUpdating: !prevState.isUpdating\n }\n })\n }", "title": "" }, { "docid": "82030adbc6b989deecf814e36f730856", "score": "0.60971713", "text": "render(){\n return (\n <div>\n <h1 className=\"bro-class\">{this.state.txt}</h1> \n <input type=\"text\" onChange={this.update.bind(this)}/> //you can bind the input value directly with the update method\n </div>\n );\n //We can create a widget instead and re-use it as required/\n return (\n <div>\n <h1 className=\"bro-class\">{this.props.txt}</h1> \n <Widget updateVal={this.update.bind(this)} />\n <Widget updateVal={this.update.bind(this)} /> \n <Widget updateVal={this.update.bind(this)} />\n </div>\n );\n }", "title": "" }, { "docid": "2eb0de64ce3323f49a8463e5407dcdd2", "score": "0.60941106", "text": "_onChange() {\n this._updateState();\n }", "title": "" }, { "docid": "4eeee1ce975875e7994f8bfa2e2b1f11", "score": "0.6064471", "text": "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "title": "" }, { "docid": "e4c3be40e2c8cea5506a309b64d1787a", "score": "0.6055044", "text": "updateItems (newState) {\n this.setState({\n compItems: newState\n });\n }", "title": "" }, { "docid": "7df1e96f97498020749dbc7c4fb15dd9", "score": "0.6032431", "text": "onUpdateSave()\n {\n console.log('Save + ('+this.props.index+', '+this.state.label + ')');\n this.props.onUpdate(this.props.index, this.state.label);\n this.setState(prevState => {\n return {\n ...prevState,\n isUpdating: !prevState.isUpdating\n }\n })\n\n }", "title": "" }, { "docid": "9ddcdc58d824a41d9db5f115ca428a25", "score": "0.60319424", "text": "componentDidUpdate() {\n console.log('__UPDATE STATE__', this.state);\n }", "title": "" }, { "docid": "2d9ed4370b6429a0a99f02d09672c739", "score": "0.6029148", "text": "handleRuntimeChange( val ){\n // ** don't modity state directly\n // ** constructor only place where you can assign \"this.state\" \n // ** use setState() instead\n this.setState( { runtime : val } );\n // ** there's another form - setState( function(prevState, props) )\n }", "title": "" }, { "docid": "e47364bd56f341daa2b6424899f0a7b3", "score": "0.6025167", "text": "updateComponents() {\n\n /**Updates the User Time Every Time the User Presses the Button */\n this.clicker.updateComponents(this.user); \n\n /**Updates the User Shop */\n this.userShop.updateComponents(this.user); \n\n /**Updates the User */\n this.user.updateComponents(); \n }", "title": "" }, { "docid": "4a4d5f89e363ed0dc581395d45dffdb2", "score": "0.6015164", "text": "componentDidUpdate() {\n // this.onChange(this.state.value);\n }", "title": "" }, { "docid": "da13cd22e772c1aaf41c7c297905eb5f", "score": "0.6008041", "text": "_update_value (n, v) {\n\t\tlet state = {};\n\t\tstate[n] = v;\n\t\tthis.setState({\n\t\t\t...this.state,\n\t\t\t...state\n\t\t})\n\t\tthis.props.onChange(n, v);\n\t}", "title": "" }, { "docid": "f0f2fa3d022fd6f1d4746b5cdd8d18d7", "score": "0.5998951", "text": "componentDidReceiveBackendState(prevState){\n\n }", "title": "" }, { "docid": "0a190349cc31a5eb893eacc721165dcc", "score": "0.5995778", "text": "constructor(props) {\n super(props);\n this.state = { modified: false };\n }", "title": "" }, { "docid": "12da1181a26ec9f380626fa06d6716de", "score": "0.59809524", "text": "componentDidUpdate(prevProps,prevStates){\nconsole.log(\"components updated!\");\nconsole.log(prevProps,prevStates);\n\n}", "title": "" }, { "docid": "c8c0eae31d9b1b5a4c58ddd24f8d05f3", "score": "0.5979203", "text": "updateComponent(attribute, value) {\n switch (attribute) {\n case 'input-label':\n if (this.$input) {\n this.$input.setAttribute('placeholder', value);\n }\n break;\n case 'button-label':\n if (this.$button) {\n this.$button.setAttribute('aria-label', value);\n }\n break;\n case 'icon':\n if (this.$icon) {\n this.$icon.innerText = value;\n }\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "310c7abc71b422e3d0287b24ee42652c", "score": "0.596645", "text": "constructor(...args){\n super(...args)\n this.shouldComponentUpdate=PureRenderMixin.shouldComponentUpdate\n }", "title": "" }, { "docid": "75647bacda5c066f5553dd3128dab34d", "score": "0.59577245", "text": "setStateValue(obj) {\n this.setState(Object.assign(this.state, obj));\n }", "title": "" }, { "docid": "f9d4075e30f50384eff3f6c372db6bc7", "score": "0.59548134", "text": "updateState(varName, newVal) {\n \n if (this[varName] === newVal) {\n return; // No update.\n }\n \n let varToEventMapping = {\n \"nodePresent\": \"nodePresentChanged\",\n \"nodeVersion\": \"nodeVersionChanged\",\n \"nodeError\": \"nodeErrorChanged\"\n }\n \n if (varToEventMapping[varName]) {\n this.fireEvent(varToEventMapping[varName], this[varName], newVal);\n }\n \n this[varName] = newVal;\n }", "title": "" }, { "docid": "04ad52c3bd308e64cf46fb3105b5a333", "score": "0.5946666", "text": "updateComponents() {\n \n //Updating the shooting counter \n this.shootingCounter++; \n\n this._movePlayer(); //Moving the player\n // console.log(\"Player X Pos: \" + this.posX);\n // console.log(\"Player Y Pos: \" + this.posY);\n this._checkBoundaries(); //Ensures we are within the border\n \n /**Updating Survivor Inventory Elements With Clicker Stuff */\n this.updateInventoryElements();\n\n //Updating the Survivors Inventory Nums With the latest things from clicker game \n this.updateInventoryNums(); \n\n //Updating the Players Bullets\n this.bullets.forEach((bullet, index) => {\n bullet.updateComponents();\n });\n }", "title": "" }, { "docid": "4333e2af63f96695645b02a262a57e6e", "score": "0.59365463", "text": "updateItem(changedItem) {\n this.setState({\n item: changedItem\n });\n }", "title": "" }, { "docid": "c9249d435523fee9fdf5fe229f8aed22", "score": "0.5929531", "text": "componentDidUpdate() {\n this.props.actions.updateAnswerSuccess({\n questionId:this.state.questionId,\n id: this.state.id,\n label:this.state.answer,\n isTrue:this.props.isTrue});\n }", "title": "" }, { "docid": "19637528712d7bd5c6af79691c2d673b", "score": "0.59245104", "text": "updateInfo(event) {\n //These shoudl all have updated states already updated on any change to specific form feild.\n let { firstNameInput, lastNameInput, emailInput, phoneNumberInput } =\n this.state;\n // series of states updated\n this.setState({ firstName: firstNameInput });\n this.setState({ lastName: lastNameInput });\n this.setState({ email: emailInput });\n this.setState({ phoneNumber: phoneNumberInput });\n // Trying to add a function to render the information now stored in the compoenent\n\n this.setState({ formSubmitted: true });\n event.preventDefault();\n }", "title": "" }, { "docid": "a6cc46703afb3f692f931a26a433840c", "score": "0.5923921", "text": "render() {\n const { isUpdating } = this.state;\n const {checked, onCheck, index, label, onDelete} = this.props;\n console.log(isUpdating);\n\n if(isUpdating) {\n return (\n <div>\n <input ref={(input) => this.input = input} value={this.state.label} onChange={this.onInputChange}/>\n <button onClick={this.onUpdateCancel}>Cancel</button>\n <button onClick={this.onUpdateSave}>Save</button>\n </div>\n )\n }\n return (\n <div>\n <input type='checkbox' checked={checked} onChange={() => onCheck(index)}/>\n <span>{label}</span>\n <button onClick={() => onDelete(index)}>Delete Note</button>\n <button onClick = {this.onUpdate}>Edit</button>\n </div>\n )\n }", "title": "" }, { "docid": "0adbca1585c0ed4a760dd25b621fd580", "score": "0.5918422", "text": "updateInputState(inputState) {\n this.setState({ isActive: inputState.active });\n }", "title": "" }, { "docid": "262618651f74c18455d5ed9d7cbf504c", "score": "0.59148806", "text": "componentWillUpdate() {\r\n console.log(\"Befor State is Updated\");\r\n }", "title": "" }, { "docid": "f86f096483b278797ef379ed7b8ce11f", "score": "0.59067786", "text": "update() { // metodo\n\n }", "title": "" }, { "docid": "fe78e67e247017eafe47cba19e32bf72", "score": "0.5905874", "text": "updateState(state, value) {\n\t\t\n\t\tvar currentState = this.state;\n\t\t\n\t\t// check if state exists\n\t\tif(this.state[state] != undefined) {\n\t\t\tcurrentState[state] = value;\n\t\t\tthis.setState(currentState);\n\t\t}\n\t}", "title": "" }, { "docid": "d8895605496adfa1f23b5f5545916dce", "score": "0.5901603", "text": "stateChange(newState) {\n this.setState(newState)\n }", "title": "" }, { "docid": "b373cc69ef9c6ce72f9dacd6bd1f8730", "score": "0.58881044", "text": "constructor(props) {\n super(props);\n\n this.state = {\n value: undefined\n }\n\n //bind state to update func\n this.handleChange = this.handleChange.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }", "title": "" }, { "docid": "934d695ed50490fd1c18f51d1ac397b5", "score": "0.588675", "text": "updateItem ( changedItem ) {\n\t\t\tthis.setState({\n\t\t\t\titem: changedItem\n\t\t\t})\n\t}", "title": "" }, { "docid": "d180794952ae59967960c1112e7d78af", "score": "0.58852166", "text": "setState(newState) {\n this.state = newState;\n }", "title": "" }, { "docid": "6afcf7589426550c3add90a7f00acfe6", "score": "0.5857878", "text": "constructor(props) {\n super(props);\n this.state = {\n update: false,\n updateSmurf: {\n name: this.props.name,\n age: this.props.age,\n height: this.props.height\n }\n }\n }", "title": "" }, { "docid": "e598a8339b976acecc685ce7f2d4ba0b", "score": "0.5857562", "text": "function processChild(element, Component) {\n\t\t var publicContext = processContext(Component, context);\n\n\t\t var queue = [];\n\t\t var replace = false;\n\t\t var updater = {\n\t\t isMounted: function (publicInstance) {\n\t\t return false;\n\t\t },\n\t\t enqueueForceUpdate: function (publicInstance) {\n\t\t if (queue === null) {\n\t\t warnNoop(publicInstance, 'forceUpdate');\n\t\t return null;\n\t\t }\n\t\t },\n\t\t enqueueReplaceState: function (publicInstance, completeState) {\n\t\t replace = true;\n\t\t queue = [completeState];\n\t\t },\n\t\t enqueueSetState: function (publicInstance, currentPartialState) {\n\t\t if (queue === null) {\n\t\t warnNoop(publicInstance, 'setState');\n\t\t return null;\n\t\t }\n\t\t queue.push(currentPartialState);\n\t\t }\n\t\t };\n\n\t\t var inst = void 0;\n\t\t if (shouldConstruct(Component)) {\n\t\t inst = new Component(element.props, publicContext, updater);\n\n\t\t if (typeof Component.getDerivedStateFromProps === 'function') {\n\t\t {\n\t\t if (inst.state === null || inst.state === undefined) {\n\t\t var componentName = getComponentName(Component) || 'Unknown';\n\t\t if (!didWarnAboutUninitializedState[componentName]) {\n\t\t warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');\n\t\t didWarnAboutUninitializedState[componentName] = true;\n\t\t }\n\t\t }\n\t\t }\n\n\t\t var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);\n\n\t\t {\n\t\t if (partialState === undefined) {\n\t\t var _componentName = getComponentName(Component) || 'Unknown';\n\t\t if (!didWarnAboutUndefinedDerivedState[_componentName]) {\n\t\t warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);\n\t\t didWarnAboutUndefinedDerivedState[_componentName] = true;\n\t\t }\n\t\t }\n\t\t }\n\n\t\t if (partialState != null) {\n\t\t inst.state = _assign({}, inst.state, partialState);\n\t\t }\n\t\t }\n\t\t } else {\n\t\t {\n\t\t if (Component.prototype && typeof Component.prototype.render === 'function') {\n\t\t var _componentName2 = getComponentName(Component) || 'Unknown';\n\n\t\t if (!didWarnAboutBadClass[_componentName2]) {\n\t\t warning(false, \"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);\n\t\t didWarnAboutBadClass[_componentName2] = true;\n\t\t }\n\t\t }\n\t\t }\n\t\t inst = Component(element.props, publicContext, updater);\n\t\t if (inst == null || inst.render == null) {\n\t\t child = inst;\n\t\t validateRenderResult(child, Component);\n\t\t return;\n\t\t }\n\t\t }\n\n\t\t inst.props = element.props;\n\t\t inst.context = publicContext;\n\t\t inst.updater = updater;\n\n\t\t var initialState = inst.state;\n\t\t if (initialState === undefined) {\n\t\t inst.state = initialState = null;\n\t\t }\n\t\t if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {\n\t\t if (typeof inst.componentWillMount === 'function') {\n\n\t\t // In order to support react-lifecycles-compat polyfilled components,\n\t\t // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n\t\t if (typeof Component.getDerivedStateFromProps !== 'function') {\n\t\t inst.componentWillMount();\n\t\t }\n\t\t }\n\t\t if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {\n\t\t // In order to support react-lifecycles-compat polyfilled components,\n\t\t // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n\t\t inst.UNSAFE_componentWillMount();\n\t\t }\n\t\t if (queue.length) {\n\t\t var oldQueue = queue;\n\t\t var oldReplace = replace;\n\t\t queue = null;\n\t\t replace = false;\n\n\t\t if (oldReplace && oldQueue.length === 1) {\n\t\t inst.state = oldQueue[0];\n\t\t } else {\n\t\t var nextState = oldReplace ? oldQueue[0] : inst.state;\n\t\t var dontMutate = true;\n\t\t for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {\n\t\t var partial = oldQueue[i];\n\t\t var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;\n\t\t if (_partialState != null) {\n\t\t if (dontMutate) {\n\t\t dontMutate = false;\n\t\t nextState = _assign({}, nextState, _partialState);\n\t\t } else {\n\t\t _assign(nextState, _partialState);\n\t\t }\n\t\t }\n\t\t }\n\t\t inst.state = nextState;\n\t\t }\n\t\t } else {\n\t\t queue = null;\n\t\t }\n\t\t }\n\t\t child = inst.render();\n\n\t\t {\n\t\t if (child === undefined && inst.render._isMockFunction) {\n\t\t // This is probably bad practice. Consider warning here and\n\t\t // deprecating this convenience.\n\t\t child = null;\n\t\t }\n\t\t }\n\t\t validateRenderResult(child, Component);\n\n\t\t var childContext = void 0;\n\t\t if (typeof inst.getChildContext === 'function') {\n\t\t var childContextTypes = Component.childContextTypes;\n\t\t if (typeof childContextTypes === 'object') {\n\t\t childContext = inst.getChildContext();\n\t\t for (var contextKey in childContext) {\n\t\t !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;\n\t\t }\n\t\t } else {\n\t\t warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');\n\t\t }\n\t\t }\n\t\t if (childContext) {\n\t\t context = _assign({}, context, childContext);\n\t\t }\n\t\t\t}", "title": "" }, { "docid": "6bcb8dfc1055345b16a3c303a41a916c", "score": "0.58448833", "text": "constructor(getState, updateState) {\n this.getState = getState;\n this.updateState = updateState;\n }", "title": "" }, { "docid": "bec1c7309e9e9256df89d4ebe0b9de47", "score": "0.5837093", "text": "handleChange (event) {\n this.setState({ value: event.target.value }, () => {\n super.handleChange(event)\n if (this.props.onUpdate) {\n this.props.onUpdate({\n name: this.props.name,\n value: this.state.value\n })\n }\n })\n }", "title": "" }, { "docid": "693c938de1c13ae2069cc1c6ef67a1ed", "score": "0.5836465", "text": "setStateOfRender() {\n this.componentList.forEach(component => {\n if (component.tag === 1 && component.memoizedState) {\n console.log(component.stateNode);\n component.stateNode.setState({...component.memoizedState});\n }\n });\n }", "title": "" }, { "docid": "573b45f77e7840b177a17a9f9c8b2ce5", "score": "0.5836197", "text": "componentDidUpdate(curProps, curState) {\n //console.log(curState);\n }", "title": "" }, { "docid": "2ac64f18eb038327c730bc836ee17bbf", "score": "0.58311945", "text": "shouldComponentUpdate(newProps, newState) {\n return true;\n }", "title": "" }, { "docid": "2ac64f18eb038327c730bc836ee17bbf", "score": "0.58311945", "text": "shouldComponentUpdate(newProps, newState) {\n return true;\n }", "title": "" }, { "docid": "ac5abeb23ffa3d456b2e770389d46314", "score": "0.5827798", "text": "update( selectionState ) { /* jshint unused: false */\n throw new Error( \"No override could be found on the update method \" +\n \"of this button.\" );\n }", "title": "" }, { "docid": "4ae6c1a39b41ff58a5ae209f0b3a7a33", "score": "0.5824373", "text": "shouldComponentUpdate() {}", "title": "" }, { "docid": "4ae6c1a39b41ff58a5ae209f0b3a7a33", "score": "0.5824373", "text": "shouldComponentUpdate() {}", "title": "" }, { "docid": "1e4a9b7470900cfbe59a1818bbae8404", "score": "0.58170605", "text": "componentDidUpdate() {\n savedState = this.state;\n }", "title": "" }, { "docid": "5e918e53cc992ffaa8d0194a0390c8de", "score": "0.5809559", "text": "setState(state, eventType) {\n this.state = state;\n this.triggerUpdate(eventType);\n }", "title": "" }, { "docid": "56ed80cb129295489016cd5977b99682", "score": "0.5807118", "text": "putState (newState) {\n this._putState(newState)\n this.emit('update', newState)\n }", "title": "" }, { "docid": "f0b645cc9f53b364a4f2ba0c1ba2a38e", "score": "0.58059293", "text": "genericSync(event) {\n const { name, value } = event.target;\n this.setState({ [name]: value });\n }", "title": "" }, { "docid": "8843d48590ae764b2bddac8ec91aca10", "score": "0.58042103", "text": "constructor(props){ // set up the component's constructor\n super(props); // this is pretty boilerplate code, kind of like Java's public static void main()\n // or C's int main() or Python's def main()\n\n this.state = {}; //initial state, only manually assigned here, elsewhere it's this.setState()\n }", "title": "" }, { "docid": "5c6de5f7e9b5090466f5e5682af8f917", "score": "0.579843", "text": "updateState(e){\n this.props.onEditAction(e.target.value)\n }", "title": "" }, { "docid": "b0349a33ee163f57c4cec68bedd003c8", "score": "0.5792914", "text": "updateComponent() {\n const ctx = this;\n return (uri, req) => {\n ctx.emit(StatuspageAPI.UPDATE_COMPONENT, uri, req);\n const comp = ctx.cfg.incubator && ctx.cfg.incubatorComponent\n ? ctx.cfg.incubatorComponent\n : ctx.cfg.component;\n return ctx.reply(JSON.stringify(comp));\n };\n }", "title": "" }, { "docid": "b6541c4af06786cb012cd68a62f1c672", "score": "0.5782556", "text": "alter() {\n this.setState({ modification: true });\n }", "title": "" }, { "docid": "d412a4e53c92522c221566ee9abb9b1a", "score": "0.57813644", "text": "componentDidUpdate(preProps,preState,a){\n console.log('componentDidUpdate',a)\n }", "title": "" }, { "docid": "7c04fc1d1aeb3573823b760b5d092fca", "score": "0.57805485", "text": "componentDidUpdate(prevProps,prevState){\r\n //used to compare the new state with old state, or new props with old props. Even a ajax request to get new data from server.\r\n console.log('prevProps',prevProps);\r\n console.log('prevState',prevState);\r\n // if(prevProps.counter.value !== this.props.counter.value){\r\n // //here we can decide if to make a ajax call based on the changes on props and state objects.\r\n // }\r\n }", "title": "" }, { "docid": "4368a983442fc670f3d9d300ceb73c80", "score": "0.5773469", "text": "componentDidUpdate(){}", "title": "" }, { "docid": "4368a983442fc670f3d9d300ceb73c80", "score": "0.5773469", "text": "componentDidUpdate(){}", "title": "" }, { "docid": "44b64b0a1c59e5288fdad3211b25dd5d", "score": "0.5762215", "text": "_onChange() {\n\t\tthis.setState(this._getState());\n\t}", "title": "" }, { "docid": "b1e5e0c775f03ec8fb6af41c8344e945", "score": "0.5744417", "text": "updateState(key,value){\n this.setState(key: value)\n }", "title": "" }, { "docid": "4aa5b3474d4bb1fd97f9e6021703729e", "score": "0.57389534", "text": "updating() {}", "title": "" }, { "docid": "7ace45de276fc0e0ed2128a60050aa4a", "score": "0.57357234", "text": "componentDidUpdate(preProps , preState){\n console.log(\"updated\" , preProps, preState);\n }", "title": "" }, { "docid": "4311c9931ac60c2f82a69156112e8659", "score": "0.5735495", "text": "componentDidUpdate(prevProps, prevState, snapshot) {\n this.props.onchange(\n this.state.underlayCategory,\n this.state.underlay\n );\n }", "title": "" }, { "docid": "05e0bfba18d8c30bfee4716ea4746cd9", "score": "0.5735227", "text": "componentWillUpdate(nextProps, nextState){}", "title": "" }, { "docid": "e9bbfd061c4d87f9ad5fb21475714ac0", "score": "0.5734458", "text": "genericSync(event) {\n const { name, value } = event.target;\n this.setState({ [name]: value });\n }", "title": "" }, { "docid": "dc8c688e32adbb80a5030d388f7b3e24", "score": "0.5730195", "text": "componentDidUpdate() {}", "title": "" }, { "docid": "4b39b0e77d62015f7eea9f1ddfdb5f41", "score": "0.5729394", "text": "function processChild(element, Component) {\n var publicContext = processContext(Component, context);\n\n var queue = [];\n var replace = false;\n var updater = {\n isMounted: function (publicInstance) {\n return false;\n },\n enqueueForceUpdate: function (publicInstance) {\n if (queue === null) {\n warnNoop(publicInstance, 'forceUpdate');\n return null;\n }\n },\n enqueueReplaceState: function (publicInstance, completeState) {\n replace = true;\n queue = [completeState];\n },\n enqueueSetState: function (publicInstance, currentPartialState) {\n if (queue === null) {\n warnNoop(publicInstance, 'setState');\n return null;\n }\n queue.push(currentPartialState);\n }\n };\n\n var inst = void 0;\n if (shouldConstruct(Component)) {\n inst = new Component(element.props, publicContext, updater);\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n {\n if (inst.state === null || inst.state === undefined) {\n var componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUninitializedState[componentName]) {\n warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');\n didWarnAboutUninitializedState[componentName] = true;\n }\n }\n }\n\n var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);\n\n {\n if (partialState === undefined) {\n var _componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUndefinedDerivedState[_componentName]) {\n warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);\n didWarnAboutUndefinedDerivedState[_componentName] = true;\n }\n }\n }\n\n if (partialState != null) {\n inst.state = _assign({}, inst.state, partialState);\n }\n }\n } else {\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var _componentName2 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[_componentName2]) {\n warning(false, \"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);\n didWarnAboutBadClass[_componentName2] = true;\n }\n }\n }\n inst = Component(element.props, publicContext, updater);\n if (inst == null || inst.render == null) {\n child = inst;\n validateRenderResult(child, Component);\n return;\n }\n }\n\n inst.props = element.props;\n inst.context = publicContext;\n inst.updater = updater;\n\n var initialState = inst.state;\n if (initialState === undefined) {\n inst.state = initialState = null;\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {\n if (typeof inst.componentWillMount === 'function') {\n {\n if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {\n var _componentName3 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutDeprecatedWillMount[_componentName3]) {\n lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\\n\\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);\n didWarnAboutDeprecatedWillMount[_componentName3] = true;\n }\n }\n }\n\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n if (typeof Component.getDerivedStateFromProps !== 'function') {\n inst.componentWillMount();\n }\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n inst.UNSAFE_componentWillMount();\n }\n if (queue.length) {\n var oldQueue = queue;\n var oldReplace = replace;\n queue = null;\n replace = false;\n\n if (oldReplace && oldQueue.length === 1) {\n inst.state = oldQueue[0];\n } else {\n var nextState = oldReplace ? oldQueue[0] : inst.state;\n var dontMutate = true;\n for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {\n var partial = oldQueue[i];\n var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;\n if (_partialState != null) {\n if (dontMutate) {\n dontMutate = false;\n nextState = _assign({}, nextState, _partialState);\n } else {\n _assign(nextState, _partialState);\n }\n }\n }\n inst.state = nextState;\n }\n } else {\n queue = null;\n }\n }\n child = inst.render();\n\n {\n if (child === undefined && inst.render._isMockFunction) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n child = null;\n }\n }\n validateRenderResult(child, Component);\n\n var childContext = void 0;\n if (typeof inst.getChildContext === 'function') {\n var childContextTypes = Component.childContextTypes;\n if (typeof childContextTypes === 'object') {\n childContext = inst.getChildContext();\n for (var contextKey in childContext) {\n !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;\n }\n } else {\n warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');\n }\n }\n if (childContext) {\n context = _assign({}, context, childContext);\n }\n }", "title": "" }, { "docid": "4b39b0e77d62015f7eea9f1ddfdb5f41", "score": "0.5729394", "text": "function processChild(element, Component) {\n var publicContext = processContext(Component, context);\n\n var queue = [];\n var replace = false;\n var updater = {\n isMounted: function (publicInstance) {\n return false;\n },\n enqueueForceUpdate: function (publicInstance) {\n if (queue === null) {\n warnNoop(publicInstance, 'forceUpdate');\n return null;\n }\n },\n enqueueReplaceState: function (publicInstance, completeState) {\n replace = true;\n queue = [completeState];\n },\n enqueueSetState: function (publicInstance, currentPartialState) {\n if (queue === null) {\n warnNoop(publicInstance, 'setState');\n return null;\n }\n queue.push(currentPartialState);\n }\n };\n\n var inst = void 0;\n if (shouldConstruct(Component)) {\n inst = new Component(element.props, publicContext, updater);\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n {\n if (inst.state === null || inst.state === undefined) {\n var componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUninitializedState[componentName]) {\n warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');\n didWarnAboutUninitializedState[componentName] = true;\n }\n }\n }\n\n var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);\n\n {\n if (partialState === undefined) {\n var _componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUndefinedDerivedState[_componentName]) {\n warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);\n didWarnAboutUndefinedDerivedState[_componentName] = true;\n }\n }\n }\n\n if (partialState != null) {\n inst.state = _assign({}, inst.state, partialState);\n }\n }\n } else {\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var _componentName2 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[_componentName2]) {\n warning(false, \"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);\n didWarnAboutBadClass[_componentName2] = true;\n }\n }\n }\n inst = Component(element.props, publicContext, updater);\n if (inst == null || inst.render == null) {\n child = inst;\n validateRenderResult(child, Component);\n return;\n }\n }\n\n inst.props = element.props;\n inst.context = publicContext;\n inst.updater = updater;\n\n var initialState = inst.state;\n if (initialState === undefined) {\n inst.state = initialState = null;\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {\n if (typeof inst.componentWillMount === 'function') {\n {\n if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {\n var _componentName3 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutDeprecatedWillMount[_componentName3]) {\n lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\\n\\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);\n didWarnAboutDeprecatedWillMount[_componentName3] = true;\n }\n }\n }\n\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n if (typeof Component.getDerivedStateFromProps !== 'function') {\n inst.componentWillMount();\n }\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n inst.UNSAFE_componentWillMount();\n }\n if (queue.length) {\n var oldQueue = queue;\n var oldReplace = replace;\n queue = null;\n replace = false;\n\n if (oldReplace && oldQueue.length === 1) {\n inst.state = oldQueue[0];\n } else {\n var nextState = oldReplace ? oldQueue[0] : inst.state;\n var dontMutate = true;\n for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {\n var partial = oldQueue[i];\n var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;\n if (_partialState != null) {\n if (dontMutate) {\n dontMutate = false;\n nextState = _assign({}, nextState, _partialState);\n } else {\n _assign(nextState, _partialState);\n }\n }\n }\n inst.state = nextState;\n }\n } else {\n queue = null;\n }\n }\n child = inst.render();\n\n {\n if (child === undefined && inst.render._isMockFunction) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n child = null;\n }\n }\n validateRenderResult(child, Component);\n\n var childContext = void 0;\n if (typeof inst.getChildContext === 'function') {\n var childContextTypes = Component.childContextTypes;\n if (typeof childContextTypes === 'object') {\n childContext = inst.getChildContext();\n for (var contextKey in childContext) {\n !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;\n }\n } else {\n warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');\n }\n }\n if (childContext) {\n context = _assign({}, context, childContext);\n }\n }", "title": "" }, { "docid": "4b39b0e77d62015f7eea9f1ddfdb5f41", "score": "0.5729394", "text": "function processChild(element, Component) {\n var publicContext = processContext(Component, context);\n\n var queue = [];\n var replace = false;\n var updater = {\n isMounted: function (publicInstance) {\n return false;\n },\n enqueueForceUpdate: function (publicInstance) {\n if (queue === null) {\n warnNoop(publicInstance, 'forceUpdate');\n return null;\n }\n },\n enqueueReplaceState: function (publicInstance, completeState) {\n replace = true;\n queue = [completeState];\n },\n enqueueSetState: function (publicInstance, currentPartialState) {\n if (queue === null) {\n warnNoop(publicInstance, 'setState');\n return null;\n }\n queue.push(currentPartialState);\n }\n };\n\n var inst = void 0;\n if (shouldConstruct(Component)) {\n inst = new Component(element.props, publicContext, updater);\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n {\n if (inst.state === null || inst.state === undefined) {\n var componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUninitializedState[componentName]) {\n warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');\n didWarnAboutUninitializedState[componentName] = true;\n }\n }\n }\n\n var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);\n\n {\n if (partialState === undefined) {\n var _componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUndefinedDerivedState[_componentName]) {\n warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);\n didWarnAboutUndefinedDerivedState[_componentName] = true;\n }\n }\n }\n\n if (partialState != null) {\n inst.state = _assign({}, inst.state, partialState);\n }\n }\n } else {\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var _componentName2 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[_componentName2]) {\n warning(false, \"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);\n didWarnAboutBadClass[_componentName2] = true;\n }\n }\n }\n inst = Component(element.props, publicContext, updater);\n if (inst == null || inst.render == null) {\n child = inst;\n validateRenderResult(child, Component);\n return;\n }\n }\n\n inst.props = element.props;\n inst.context = publicContext;\n inst.updater = updater;\n\n var initialState = inst.state;\n if (initialState === undefined) {\n inst.state = initialState = null;\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {\n if (typeof inst.componentWillMount === 'function') {\n {\n if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {\n var _componentName3 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutDeprecatedWillMount[_componentName3]) {\n lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\\n\\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);\n didWarnAboutDeprecatedWillMount[_componentName3] = true;\n }\n }\n }\n\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n if (typeof Component.getDerivedStateFromProps !== 'function') {\n inst.componentWillMount();\n }\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n inst.UNSAFE_componentWillMount();\n }\n if (queue.length) {\n var oldQueue = queue;\n var oldReplace = replace;\n queue = null;\n replace = false;\n\n if (oldReplace && oldQueue.length === 1) {\n inst.state = oldQueue[0];\n } else {\n var nextState = oldReplace ? oldQueue[0] : inst.state;\n var dontMutate = true;\n for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {\n var partial = oldQueue[i];\n var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;\n if (_partialState != null) {\n if (dontMutate) {\n dontMutate = false;\n nextState = _assign({}, nextState, _partialState);\n } else {\n _assign(nextState, _partialState);\n }\n }\n }\n inst.state = nextState;\n }\n } else {\n queue = null;\n }\n }\n child = inst.render();\n\n {\n if (child === undefined && inst.render._isMockFunction) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n child = null;\n }\n }\n validateRenderResult(child, Component);\n\n var childContext = void 0;\n if (typeof inst.getChildContext === 'function') {\n var childContextTypes = Component.childContextTypes;\n if (typeof childContextTypes === 'object') {\n childContext = inst.getChildContext();\n for (var contextKey in childContext) {\n !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;\n }\n } else {\n warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');\n }\n }\n if (childContext) {\n context = _assign({}, context, childContext);\n }\n }", "title": "" }, { "docid": "effa3f2b67e19352bd018846e8269f35", "score": "0.5728282", "text": "componentDidUpdate(prevProps, prevState) {\n console.log(\"Estado Previo\", prevState.activo, \"Nuevo Estado\", this.state.activo)\n console.log(\"El componente se ha actualizado\")\n }", "title": "" }, { "docid": "872daf939189ebb068ce4e15a6a4b976", "score": "0.57249075", "text": "updateControlPanelState() {\n if (this.props.robotLocation) {\n const {x,y} = parseRobotLocation(this.props.robotLocation)\n this.setState({\n robotNewX: x,\n robotNewY: y,\n robotNewDirection: this.props.robotDirection,\n report: {\n x: x,\n y: y,\n facing: this.props.robotDirection\n }\n })\n }\n }", "title": "" }, { "docid": "120d07c0768c317431e74d2dbb9c7fa0", "score": "0.570838", "text": "_update() {\n this.layout.update({\n construct: this.props.construct,\n blocks: this.props.blocks,\n currentBlocks: this.props.focus.blockIds,\n currentConstructId: this.props.focus.constructId,\n focusedOptions: this.props.focus.options,\n showHidden: this.state.showHidden,\n });\n this.sg.update();\n this.sg.ui.update();\n }", "title": "" }, { "docid": "79e45ef87a21389eefeb1e31d1d0af81", "score": "0.5707951", "text": "componentDidUpdate(prevProps, prevState){}", "title": "" }, { "docid": "79e45ef87a21389eefeb1e31d1d0af81", "score": "0.5707951", "text": "componentDidUpdate(prevProps, prevState){}", "title": "" }, { "docid": "010f46d98362be60cafbae1d7e2dad5a", "score": "0.57069373", "text": "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "title": "" }, { "docid": "0105794ae345d373a3cc30bec1f6abd6", "score": "0.57026464", "text": "setState(changes) {\n const prevState = this.state;\n this.state = Object.freeze(Object.assign({}, this.state, changes));\n this.update(this.state, prevState);\n }", "title": "" }, { "docid": "44e7e49e8445ad735eab7d1339fb5dd4", "score": "0.5698392", "text": "updatePrice(newPrice) {\r\n this.setState({\r\n price : newPrice\r\n });\r\n var newState = {\r\n ...this.state,\r\n price : newPrice\r\n };\r\n this.updateState(newState);\r\n}", "title": "" }, { "docid": "2439b43c9a8ebe240920097b22fc2da4", "score": "0.56931955", "text": "setComponent(component) {\n this.component = component\n }", "title": "" }, { "docid": "cca264061be773dd639056c0b9825d6c", "score": "0.56914544", "text": "function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}", "title": "" }, { "docid": "24624bbf71c54e06088ccff08d3962f4", "score": "0.56906897", "text": "handlePrimitiveUpdate(event) {\n this.value = event.target.value;\n }", "title": "" }, { "docid": "3cb3f69c003fa170cdce44fec57704cb", "score": "0.56900334", "text": "componentDidUpdate(prevProps, prevState) {\n this.checkIfDataUpdated(prevProps);\n\n this.didTickDataUpdate(prevProps);\n this.didWidthChange(prevProps);\n }", "title": "" }, { "docid": "d183d67d9a6e3621df150697d53ec56c", "score": "0.56862956", "text": "update() {\n\n\t}", "title": "" }, { "docid": "7a3b29427380922f7ebedfc048953e8a", "score": "0.56837356", "text": "componentDidUpdate(prevProps, prevState, snapshot){\n const args = {\n prevProps : prevProps,\n prevState : prevState,\n snapshot : snapshot};\n Child.write(\"componentDidUpdate\" ,false, args);\n }", "title": "" }, { "docid": "dd19a7e4cebe8a7c71674f3228760419", "score": "0.56824064", "text": "componentDidUpdate(nextState, nextProps) {\n console.log(\"Component Did Update\");\n }", "title": "" }, { "docid": "bec625d029c71b046ee8bbabd3aa0dab", "score": "0.56790257", "text": "__stateChange(){\n this.__emitter.emit(this.__changeEvent);\n }", "title": "" }, { "docid": "8aa6321522bded92f835e9042990a4f2", "score": "0.5673617", "text": "function Component(props, context, updater) {\n\t this.props = props;\n\t this.context = context;\n\t this.refs = emptyObject;\n\t // We initialize the default updater but the real one gets injected by the\n\t // renderer.\n\t this.updater = updater || ReactNoopUpdateQueue;\n\t }", "title": "" } ]
b7b453816cb644f4d294b2622623118d
Creates a food on the map
[ { "docid": "a4f88b6ebd8808df66eed5c351a23128", "score": "0.6814538", "text": "function createFood() {\n let option = getNextOption();\n if (!option) return;\n last_food_spawned_timestamp = Date.now();\n\n //Dont spawn food near other food or the player\n let spawnX = getRndInteger(0.1 * width, 0.9 * width);\n let spawnY = getRndInteger(0.1 * height, 0.9 * height);\n let distanceToFood = getNearestFood(spawnX, spawnY).distance;\n let distanceToPlayer = distanceBetween(\n player.position.x,\n player.position.y,\n spawnX,\n spawnY\n );\n\n let iterations = 0;\n while (\n (distanceToFood < 100 || distanceToPlayer < 100) &&\n distanceToFood !== null &&\n distanceToPlayer !== null\n ) {\n iterations += 1;\n if (iterations >= 2000) {\n throw Error(\n 'Way too many attempts to create a food spawn point! Infinite loop!'\n );\n }\n spawnX = getRndInteger(0.1 * width, 0.9 * width);\n spawnY = getRndInteger(0.1 * height, 0.9 * height);\n distanceToFood = getNearestFood(spawnX, spawnY).distance;\n distanceToPlayer = distanceBetween(\n player.position.x,\n player.position.y,\n spawnX,\n spawnY\n );\n }\n\n let food = createSprite(spawnX, spawnY, 16, 16);\n food.addImage(food_img);\n food.scale = 0.02;\n food.option = option;\n food.spawnTimeStamp = Date.now();\n foods.push(food);\n}", "title": "" } ]
[ { "docid": "4a9148d3b775547407e0e353cc1e47e8", "score": "0.757244", "text": "function createFood()\n\t\t{\n\t\t\tvar random = Math.floor(Math.random()*6);\n\t\t\tvar C;\n\t\t\tvar T;\n\t\t\tif(random == 0)\t\t{C = red; T = \"red\";}\n\t\t\telse if(random == 1 || random == 2 )\t{C = orange; T = \"orange\" ;}\n\t\t\telse if( random == 3 || random == 4 || random == 5)\t{C = yellow; T = \"yellow\";}\n\t\t\tvar shape = new createjs.Shape();\n\t\t\t\tshape = paintCell(C);//paintCell has the code to paint a 10x10 px block\n\t\t\t\tshape.x = Math.floor(Math.random()*38 + 1) * 10;//places the food block somewhere in the stage\n\t\t\t\tshape.y = Math.floor(Math.random()*38 + 1) * 10;\n\t\t\t\t\n\t\t\tvar F = shape;\n\t\t\tfoodHolder.food = F;\n\t\t\tfoodHolder.Color = C;\n\t\t\tfoodHolder.Type = T;\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tstage.addChild(F);\n\t\t\t\n\t\t}", "title": "" }, { "docid": "7628292f872f85dcc46e030b03a9f00b", "score": "0.73965603", "text": "function create_food()\n\t{\n\t\tfood = {\n\t\t\tx: Math.round(Math.random()*(w-cw)/cw),\n\t\t\ty: Math.round(Math.random()*(h-cw)/cw),\n\t\t};\n\n // check if food is spawned on snake's body\n\t\tfood_collision(food)\n\t\t//This will create a cell with x/y between 0-44\n\t\t//Because there are 45(450/10) positions accross the rows and columns\n\t}", "title": "" }, { "docid": "14548eb51fbcb8612cc96ff87c895ccb", "score": "0.73527515", "text": "function create_food() {\r\n food = {\r\n x: Math.round(Math.random() * (w - cw) / cw),\r\n y: Math.round(Math.random() * (h - cw) / cw),\r\n };\r\n //This will create a cell with x/y between 0-44\r\n //Because there are 45(450/10) positions accross the rows and columns\r\n }", "title": "" }, { "docid": "14548eb51fbcb8612cc96ff87c895ccb", "score": "0.73527515", "text": "function create_food() {\r\n food = {\r\n x: Math.round(Math.random() * (w - cw) / cw),\r\n y: Math.round(Math.random() * (h - cw) / cw),\r\n };\r\n //This will create a cell with x/y between 0-44\r\n //Because there are 45(450/10) positions accross the rows and columns\r\n }", "title": "" }, { "docid": "a4af6abe25f98b670e3b2742bb72480e", "score": "0.73291636", "text": "function createFood(){\n\t\t//creates a cell\n\t\tfoodCell = {\n\t\t\tx: Math.round(Math.random()*(width-cellWidth)/(cellWidth)),\n\t\t\ty: Math.round(Math.random()*(height-cellWidth)/(cellWidth))\n\t\t};\n\t}", "title": "" }, { "docid": "c6f7ef6fc2eadce29c8145cf20c6dfd9", "score": "0.7248888", "text": "function createFood() {\n // Generate random foodX\n foodX = randomTen(0, gameCanvas.width - 10);\n // Generate random foodY\n foodY = randomTen(0, gameCanvas.height - 10);\n\n // If createFood intersects snake, regenerate\n snake.forEach(function isFoodOnSnake(part) {\n const foodIntSnake = part.x == foodX && part.y == foodY;\n if (foodIntSnake) createFood();\n });\n }", "title": "" }, { "docid": "c514cb5f77e7ca71e51eb415a4492b03", "score": "0.717977", "text": "function createFood(num) {\n\n\t\t// Create all Food Pellets\n\t\tif(num == -1)\n\t\t\tfor(var i = 0; i < _CONFIG.foodAmount; ++i)\n\t\t\t\tcreateFoodLocation(i);\n\t\t// Create a new Food Pellet\n\t\telse{\n\t\t\tcreateFoodLocation(num);\n\t\t}\n}", "title": "" }, { "docid": "ca29efc617b6a8842a1ea1949a9f622d", "score": "0.7121484", "text": "placeFood() {\n\t\tthis.food.location = new Point(\n\t\t\tHelpers.getRandomInt(0, this.gridSize-1),\n\t\t\tHelpers.getRandomInt(0, this.gridSize-1)\n\t\t);\n\t}", "title": "" }, { "docid": "a5c7ed01eaefd0c33ed4467aba871483", "score": "0.70936376", "text": "function create_food(){\n food = {\n x: Math.round(Math.random()*(w-cw)/cw), \n y: Math.round(Math.random()*(h-cw)/cw), \n };\n\n food2 = {\n x: Math.round(Math.random()*(w-cw)/cw), \n y: Math.round(Math.random()*(h-cw)/cw), \n };\n //This will create a cell with x/y between 0-44\n //Because there are 45(450/10) positions accross the rows and columns\n }", "title": "" }, { "docid": "a9ac676a7f70f0e130297685c13ec40e", "score": "0.7047809", "text": "function create_food()\n{\n\tfood = {\n\t\tx: Math.round(Math.random()*(width-cell_width)/cell_width), \n\t\ty: Math.round(Math.random()*(height-cell_width)/cell_width), \n\t};\n\t//This will create a cell with x/y between 0-44\n\t//Because there are 45(450/10) positions accross the rows and columns\n}", "title": "" }, { "docid": "755ce6a9450d4c518ca15c75aa98f310", "score": "0.7011898", "text": "function generateFood() {\n var food_pos = getRandomPosition(Grid.GRID_SIZE);\n return { x: food_pos.x, y: food_pos.y, type: 1 };\n }", "title": "" }, { "docid": "d170bf9f24de9c9daec2158d0945f57f", "score": "0.6968469", "text": "function createFood() {\n\n}", "title": "" }, { "docid": "08c8254bec8a94f56d7d16455abb41fb", "score": "0.69453704", "text": "function placeFood()\n{\n\t// Generate an empty Tile randomly.\n\tdo\n\t{\n\t\tfoodTile = tileMap\n\t\t\t[Math.floor(Math.random() * tilesPerSide)]\n\t\t\t[Math.floor(Math.random() * tilesPerSide)];\n\t}\n\twhile (foodTile.element != \"EMPTY\");\n\n\t//Set the element of the generated Tile to 'FOOD'.\n\tfoodTile.element = \"FOOD\";\n\n\t// Also, send the opponent player the chosen food tile.\n\tsend({\n\t\taction: \"send food tile\",\n\t\tfood_tile: foodTile,\n\t\topponent_player_id: opponentPlayerID,\n\t});\n}", "title": "" }, { "docid": "1598f89302f51254255c3c8300cd4e2f", "score": "0.6929525", "text": "function addFood() {\n const foodPixelCoords = generateRandomCoordinates();\n if (!isPixelInSnake(foodPixelCoords)) {\n paintPixel(foodPixelCoords, 'food');\n foodPixel = foodPixelCoords;\n } else {\n addFood();\n }\n}", "title": "" }, { "docid": "d73f987b788ef775c60184ec5ee41efe", "score": "0.69203866", "text": "placeFood(){\n this.food[0] = int(random(0,width/this.snakeThickness))*this.snakeThickness;\n this.food[1] = int(random(0,height/this.snakeThickness))*this.snakeThickness;\n for(let i = 0; 0 < this.map.lenth;i++)\n if (this.hasCollidedF(this.map[i][0],this.map[i][0]))//if Food is placed on snake\n this.placeFood();\n }", "title": "" }, { "docid": "0cb694c034485b5006bf87fe3cff75cf", "score": "0.68673927", "text": "function createFood() { \n\tfood.x = foodX[Math.floor(Math.random()*foodX.length)]; // random x position from array\n\tfood.y = foodY[Math.floor(Math.random()*foodY.length)]; // random y position from array\n\t// looping through the snake and checking if there is a collision\n\tfor(i = 0; i < snake.length; i++) {\n\t\tif(checkCollision(food.x, food.y, snake[i].x, snake[i].y)) {\n\t\t\tcreateFood(); \n\t\t}\n\t}\n}", "title": "" }, { "docid": "840660f80f7b076545cd24b638614386", "score": "0.6845655", "text": "function newFood(posX,posY,hue){\n\treturn{\n\t\tposX: posX,\n\t\tposY: posY,\n\t\thue: hue\n\t}\n}", "title": "" }, { "docid": "392a6ddf85ed4e4d5b83e5b9c77597b5", "score": "0.68453044", "text": "function createFood() {\n if (score % 5 != 0) {\n img.src = 'img/cake.ico';\n } else {\n img.src = 'img/ball.png';\n }\n\n\n food = {\n x: Math.round(Math.random()*(w-2*foodSize)),\n y: Math.round(Math.random()*(h-2*foodSize)),\n r: foodSize,\n img: img\n };\n }", "title": "" }, { "docid": "738b5e086c9fb1c48e042e7c5b14623a", "score": "0.66572505", "text": "function createFood(x) {\n let food = {\n x: x,\n y: random(-500, -10),\n size: 15,\n vx: 0,\n vy: 0,\n speed: 5,\n eaten: false,\n };\n return food;\n}", "title": "" }, { "docid": "773facf9f93ab38ed8824b5b071c8d19", "score": "0.6617616", "text": "function setFood() {\n\tvar empty = []; // All empty places in the grid\n\n\t// Find all empty cells\n\tfor (var x=0; x < grid.width; x++) {\n\t\tfor (var y=0; y < grid.height; y++) {\n\t\t\tif (grid.get(x, y) === EMPTY) {\n\t\t\t\tempty.push({x:x, y:y});\n\t\t\t}\n\t\t}\n\t}\n\n\tvar randpos = empty[Math.round(Math.random()*(empty.length - 1))]; // Pick random empty cell\n\tgrid.set(FOOD, randpos.x, randpos.y); // Create food\n}", "title": "" }, { "docid": "277dc7a5626a23928d2e94cad442831b", "score": "0.6604791", "text": "function makeFood() {\n\tfoodX = random(0, gameWidth - tile);\n\tfoodY = random(0, gameHeight - tile);\n\n\tsnake.forEach(function isFoodOnSnake(snakePart) {\n\t\tconst foodIsOnSnake = snakePart.x == foodX && snakePart.y == foodY;\n\n\t\tif (foodIsOnSnake) {\n\t\t\tmakeFood();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d29f26fa1dd02bafc4156de477d57a9b", "score": "0.6551872", "text": "function createFoodLocation(index){\n\n\t// Location flag\n\tvar invalidLocation = true;\n\n\twhile(invalidLocation){\n\t\t// Assume the location will be Valid\n\t\tinvalidLocation = false;\n\n\t\t// Get Random X and Y Coordinates\n\t\tvar foodX_pos = Math.round(Math.random() * (w - _CONFIG.wormWidth) / _CONFIG.wormWidth);\n\t\tvar foodY_pos = Math.round(Math.random() * (h - _CONFIG.wormWidth) / _CONFIG.wormWidth);\n\n\t\t// Check that Food isn't on top of anything\n\t\tif(checkCollision(foodX_pos, foodY_pos, _WORM) || checkCollision(foodX_pos, foodY_pos, _WALLS))\n\t\t\tinvalidLocation = true;\n\t}\n\n\t// Set Foods X and Y Coordinates\n\t_FOOD[index] = {\n\t\tx: foodX_pos,\n\t\ty: foodY_pos\n\t};\n\n}", "title": "" }, { "docid": "96d3d63bfc8d5208c45a9886f9f32c3a", "score": "0.6509422", "text": "function addFood() {\n food.position.x = Math.floor(Math.random() * ((canvas.width / 10) - 1));\n food.position.y = Math.floor(Math.random() * ((canvas.height / 10) - 1));\n}", "title": "" }, { "docid": "454c6a8b3a31de319d7b24bb33d1b731", "score": "0.64999115", "text": "function Food() {\r\n\r\n this.x = Math.floor(Math.random() * windowWidth);\r\n this.y = Math.floor(Math.random() * windowHeight);\r\n food.push(this);\r\n}", "title": "" }, { "docid": "b9533ce0fd7cc16d42bcf2cabb083c22", "score": "0.6495535", "text": "function foodSpawn(){\r\n\t\tvar a = 0;\r\n\t\tvar b = (Math.random() * 70) + 5;\r\n\t\t\r\n\t\tfor (i = 0; i < NUM_FOOD; i++){\r\n\t\t\t\r\n\t\t\ta = Math.random();\r\n\t\t\twhile (a < 0.2 || a > 0.95){\r\n\t\t\t\ta = Math.random();\r\n\t\t\t}\r\n\r\n\t\t\tfoods.push({x: b, y: a * 600, status: 1});\r\n\t\t\t\tb += 75;\r\n\t\t}\r\n}", "title": "" }, { "docid": "5e6d89dc673e3f09cef92cb561ac641f", "score": "0.6420388", "text": "function createFood() {\n randblock = Math.floor(Math.random() * 3)\n foodX = randomTen(0, canvas.width - 10)\n foodY = randomTen(0, canvas.height - 10)\n}", "title": "" }, { "docid": "a095939640a1be7a43beab17b5015ea2", "score": "0.64041805", "text": "function newFood() {\n const bugs = ['bug0', 'bug1', 'bug2', 'bug3']\n const randomBug = bugs[Math.floor(Math.random() * Math.floor(4))]\n const availableSquares = squares.filter(square => {\n return !square.classList.contains('player')\n })\n const foodLocation = Math.floor(Math.random() * availableSquares.length)\n const squareFood = availableSquares[foodLocation]\n console.log(squareFood)\n squareFood.classList.add('food')\n squareFood.style.backgroundImage = `url('./assets/${randomBug}.png')`\n squareFood.setAttribute('data-id', randomBug)\n }", "title": "" }, { "docid": "08496fff46cf7d8f8cabb39450ca601d", "score": "0.6381183", "text": "function newMarker(){\n var mapMark = \"{position: new google.maps.LatLng(\" + tLatitude + \",\" + tLongitude + \"), type: 'food'},\"\n features.push(mapMark);\n icon: icons[feature.type].icon,\n addMarker(feature);\n initMap();\n}", "title": "" }, { "docid": "12d1499246351a1f5808570a41f7b670", "score": "0.6374833", "text": "function placeFood() {\n food = createVector(floor(random(grid[0])), floor(random(grid[1])));\n food.mult(scl);\n checkforvalidity();\n}", "title": "" }, { "docid": "7c9a3eaed763818f2ae599af6da92bd5", "score": "0.63607323", "text": "generateFood() {\n let food = new Food(this._gameLayer.playgroundWidth, this._gameLayer.playgroundHeight);\n while (this._snake.isIn(food)) {\n food = new Food(this._gameLayer.playgroundWidth, this._gameLayer.playgroundHeight);\n }\n return food;\n }", "title": "" }, { "docid": "01c64a2c74c3b0d0d62d1c4dce523da0", "score": "0.6360196", "text": "function create_burger() {\n\n\t\t\t\tfood = {\n\t\t\t\t\tx: Math.round(Math.random()*(w-cw)/cw), \n\t\t\t\t\ty: Math.round(Math.random()*(h-cw)/cw), \n\t\t\t\t};\n\t\t\t}", "title": "" }, { "docid": "0c1958189537aa08800a3181788b586c", "score": "0.6356933", "text": "function positionFood() {\n food.x = random(0,width);\n food.y = random(0,height);\n}", "title": "" }, { "docid": "a5b2d8df53e692ea3c9dc5572616cb9e", "score": "0.63552076", "text": "function randomFood() {\n food.x = Math.floor(Math.random() * 20 + 1) * box;\n food.y = Math.floor(Math.random() * 18 + 3) * box;\n}", "title": "" }, { "docid": "409cb1a9c8bb04d41d94c52de2e5648b", "score": "0.6349819", "text": "function moveFood()\n\n\t\t{\n\t\t\tstage.removeChild(foodHolder.food);\n\t\t\t\n\t\t\tvar random = Math.floor(Math.random()*6);\n\t\t\tvar C;\n\t\t\tvar T;\n\t\t\tif(random == 0)\t\t{C = red; T = \"red\";}\n\t\t\telse if(random == 1 || random == 2 )\t{C = orange; T = \"orange\" ;}\n\t\t\telse if( random >= 3)\t{C = yellow; T = \"yellow\"}\n\t\t\tvar shape = new createjs.Shape();\n\t\t\t\tshape = paintCell(C);//paintCell has the code to paint a 10x10 px block\n\t\t\t\tshape.x = Math.round(Math.random()*38 + 1) * 10;//places the food block somewhere in the stage\n\t\t\t\tshape.y = Math.round(Math.random()*38 + 1) * 10;\n\t\t\t\t\n\t\t\tvar F = shape;\n\t\t\tfoodHolder.food = F;\n\t\t\tfoodHolder.Color = C;\n\t\t\tfoodHolder.Type = T;\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tstage.addChild(F);\n\t\t\t\n\t\t}", "title": "" }, { "docid": "b32536bfb79ca29b5b3d378f1b390959", "score": "0.63360775", "text": "function randomFood(){\n food = {\n x: Math.round(Math.random() * (width - cellWidth) / cellWidth), // randomize x axis\n y: Math.round(Math.random() * (height - cellWidth) / cellWidth) // randomize y axis\n\n };\n}", "title": "" }, { "docid": "05b55eb2b6593bbb8655f576818d7147", "score": "0.63359374", "text": "function foodSpawn(){\n if (foodState === true){\n fill(255);\n rect(random(width), random(height), cellSize, cellSize);\n // foodState = false;\n }\n}", "title": "" }, { "docid": "957d0f60bbe86b7866052c51e2d952c8", "score": "0.6333173", "text": "function newMarker(){\n var mapMark = \"{position: new google.maps.LatLng(\" + tLatitude + \",\" + tLongitude + \"), type: 'food'},\"\n features.push(mapMark);\n addMarker(feature);\n initMap();\n}", "title": "" }, { "docid": "1583d4d89b2c5a4af7dabd8031e5edf0", "score": "0.6305428", "text": "function generateRandomFood() {\n \n let randomX = randomOnBoard();\n let randomY = randomOnBoard();\n \n if(amIOnSnake(randomX,randomY)) {\n generateRandomFood();\n }else {\n food.x = randomX;\n food.y = randomY;\n }\n }", "title": "" }, { "docid": "2d74a87d2d201dd49ec074433fc3b0d7", "score": "0.6261021", "text": "function setFood() {\n\tvar empty = [];\n\t// Finds empty cells\n\tfor (var x=0; x < grid.width; x++) {\n\t\tfor (var y=0; y < grid.height; y++) {\n\t\t\tif (grid.get(x, y) === EMPTY) {\n\t\t\t\tempty.push({x:x, y:y});\n\t\t\t}\n\t\t}\n\t}\n\t// Chooses a random cell\n\tvar randpos = empty[Math.round(Math.random()*(empty.length - 1))];\n\tgrid.set(FRUIT, randpos.x, randpos.y);\n}", "title": "" }, { "docid": "5653833f47140ce21ec1c9c175dd36eb", "score": "0.62519866", "text": "function mapGen() {\n let newTileObjInput = { color: \"blue\", faction: kingdomName };\n\n let colors = [\n \"#27ae60\",\n \"#e67e22\",\n \"#e74c3c\",\n \"#9b59b6\",\n \"#1abc9c\",\n \"#34495e\",\n ];\n\n mapTiles.push(newTileObjInput);\n\n //Generates all kingdoms\n for (let i = 0; i < mapTileSet.length - 1; i++) {\n let random = Math.floor(Math.random() * 6);\n let randomColor = colors[random];\n let kingdomName = kingdomGen();\n let newTileGen = { color: randomColor, faction: kingdomName };\n mapTiles.push(newTileGen);\n }\n //Return kingdom\n for (let i = 0; i < mapTileSet.length; i++) {\n mapTileSet[i].style.backgroundColor = mapTiles[i].color;\n mapTileSet[i].innerHTML = `<h1>${mapTiles[i].faction}</h1>`;\n }\n\n //Generates invade buttons after the user enters their kingdom name\n invadeBtnGen();\n}", "title": "" }, { "docid": "e1b92a0d9817b78035eb654749072225", "score": "0.6220252", "text": "function spawnFood() {\n var x;\n var y;\n var randFrame;\n var isOverlap;\n var usedPos = [];\n var foodCount = 0;\n var usedFrames = [];\n // Obtain the Food's Sprite, frame width, height and number of frames\n var foodSprite = SGE.ResourceManager.getSprite(resourceIDs.FOOD);\n var foodWidth = foodSprite.frameWidth;\n var foodHeight = foodSprite.image.height;\n var foodFrames = foodSprite.numFrames;\n // Nested function that checks if Food overlaps with previous Food\n function checkFoodOverlap(pos) {\n return (\n Math.abs(x - pos.x) <= (foodWidth + foodSettings.SPREADX) &&\n Math.abs(y - pos.y) <= (foodHeight + foodSettings.SPREADY)\n );\n }\n // Generate Food with specific frame index within a specific range\n while (foodCount < foodSettings.AMOUNT) {\n // Generate random positions specified by the bound variables\n x = SGE.Utils.randomNumber(foodSettings.STARTX, foodSettings.ENDX);\n y = SGE.Utils.randomNumber(foodSettings.STARTY, foodSettings.ENDY);\n // Generate a random frame index for the Food's Sprite image\n randFrame = SGE.Utils.randomNumber(0, foodFrames - 1);\n // Ensure new position doesn't overlap with previous positions\n isOverlap = usedPos.some(checkFoodOverlap);\n // Create Food if there is no overlap\n if (!isOverlap) {\n // Ensure that a new frame index is generated for each Food\n while (usedFrames.indexOf(randFrame) >= 0) {\n // Use existing index if all frame indicies are used\n if (usedFrames.length === foodSprite.numFrames) {\n randFrame = SGE.Utils.randomItem(usedFrames);\n } else {\n randFrame = SGE.Utils.randomNumber(0, foodFrames - 1);\n }\n }\n superModule.addGameObject(\n new Food(foodSprite, randFrame, x, y),\n \"FOOD\"\n );\n usedPos.push({\"x\": x, \"y\": y});\n // Add the new frame index to used list if it doesn't exist\n if (usedFrames.indexOf(randFrame) < 0) {\n usedFrames.push(randFrame);\n }\n foodCount += 1;\n }\n }\n }", "title": "" }, { "docid": "42c3a79c108c5063fa186d419a89f0da", "score": "0.6208337", "text": "function getRandomFood(){\r\n let foodX=Math.round(Math.random()*(W-cs)/cs)\r\n \r\n let foodY=Math.round(Math.random()*(H-cs)/cs)\r\n const food={\r\n x:foodX,\r\n y:foodY\r\n \r\n }\r\n return food;\r\n}", "title": "" }, { "docid": "b9687458290dc0f8ccdf0f6f009c76e0", "score": "0.6182568", "text": "function setFood() {\n\tvar empty = [];\n\n\tfor (var i = 0; i < grid.width; i++) {\n\t\tfor (var j = 0; j < grid.height; j++) {\n\t\t\tif (grid.get(i, j) == EMPTY) {\n\t\t\t\tempty.push({x:i, y:j});\n\t\t\t}\n\n\t\t}\n\t}\n\n\tvar randPosition = empty[Math.floor(Math.random()*empty.length)];\n\tgrid.set(FRUIT, randPosition.x, randPosition.y);\n\n}", "title": "" }, { "docid": "b307c55028fcdd565fd91f161684026a", "score": "0.61790806", "text": "addNewCake(flavor,frosting,layers,shape){\n this.cakes.push( new Cake(utils.getNewId(),flavor,frosting,layers,shape));\n }", "title": "" }, { "docid": "a1930e5e54a6fe6d23ec12cb8e49ddd8", "score": "0.6169164", "text": "function generate_new_world(food_amount, width, height) {\n var svg_width = width;\n var svg_height = height;\n\n var artist = new Artist(svg_width, svg_height, MIN_XY, MAX_XY, MIN_XY, MAX_XY);\n var new_world = new World(artist);\n var xi = 1;\n var yi = 1;\n for (var i = 0; i < food_amount / 4; i++) {\n /*var xi = getRandomIntInclusive(0, 20);\n var yi = getRandomIntInclusive(0, 20);*/\n\n // Horizontal line at the top\n new_world.grow_food(\"food\" + i + \"p1\", xi + i, yi);\n // Horizontal Line\n new_world.grow_food(\"food\" + i + \"p2\", xi + i, yi + 18);\n // Vertical Line\n new_world.grow_food(\"food\" + i + \"p3\", xi, yi + i);\n // Vertical Line\n new_world.grow_food(\"food\" + i + \"p4\", xi + 18, yi + i);\n }\n\n\n\n return new_world;\n}", "title": "" }, { "docid": "3dc2175fb9e14284b0dfc4c7f5eb8d33", "score": "0.616865", "text": "function grow_food() {\n\t\tvar rand_no_x = Math.random();\n\t\tvar food_x = (15 * Math.ceil(rand_no_x * 29));\n\t\tvar rand_no_y = Math.random();\n\t\tvar food_y = (15 * Math.ceil(rand_no_y * 29));\n\t\t\n\t\tif (in_two_dimensional_array(food_x, food_y, snake_body, body_length)) {\n\t\t\tgrow_food();\n\t\t}\n\t\telse {\n\t\t\tincrease_snake_body();\n\t\t\tfood[0][0] = food_x;\n\t\t\tfood[0][1] = food_y;\n\t\t\t$('#food').css('left', food_x);\n\t\t\t$('#food').css('top', food_y);\n\t\t}\n\t}", "title": "" }, { "docid": "eab037ad397d74a4871488276ecbd418", "score": "0.61653227", "text": "function Food(game){\n var grid = game.grid;\n\n this.x = getRandomPoint(game.tile);\n this.y = getRandomPoint(game.tile);\n gameState.food.push([this.x, this.y]);\n\n this.draw = function(ctx){\n ctx.fillStyle = \"#f05\";\n ctx.fillRect(this.x * grid, this.y * grid, grid, grid);\n };\n\n this.spawnFood = function(game) {\n var self = this;\n var gameSnakes = game.entities.filter((e) => {\n return e.segments;\n });\n\n self.x = getRandomPoint(game.tile);\n self.y = getRandomPoint(game.tile);\n while (true) {\n var match = gameSnakes.filter((s) => {\n return (s.segments.filter((e) => {\n return game.collide(self,e);\n })).length;\n });\n if (match.length){\n self.x = getRandomPoint(game.tile);\n self.y = getRandomPoint(game.tile);\n }\n else {\n break;\n }\n }\n };\n}", "title": "" }, { "docid": "7636183132f30b9c13f3532fff979908", "score": "0.61533", "text": "function create() {\n setupGameArea(this);\n setupTileBackground(BACKGROUNDS.PINK, this);\n defineAllAnimations(this);\n\n pet = createPet({ petConfigKey: PET_CONFIG_KEYS.ROCK, _this: this });\n\n fruitsGroup = this.add.group();\n\n fruitsGroup.add(\n createFruit({\n foodConfigKey: FOOD_CONFIG_KEYS.BANANAS,\n phaser: this,\n coordinates: {\n x: 200,\n y: 300\n }\n })\n );\n\n fruitsGroup.add(\n createFruit({\n foodConfigKey: FOOD_CONFIG_KEYS.STRAWBERRY,\n phaser: this,\n coordinates: {\n x: 300,\n y: 200\n }\n })\n );\n\n movementDestinationMarker = setupMovementPointer(\n SPRITES.UI.MOVEMENT_DESTINATION_MARKER.CLICK,\n this\n );\n\n // Collisions\n defineObjectInteractions(this);\n setupInputHandlers(this);\n}", "title": "" }, { "docid": "83ad77145c3b527c1b5aa143b0583379", "score": "0.61448646", "text": "function createFood() {\n var foodCreated = false;\n \n while (!foodCreated) {\n var x = Math.floor(Math.random() * FIELD_SIZE_X);\n var y = Math.floor(Math.random() * FIELD_SIZE_Y);\n \n var newUnit = document.getElementsByClassName(\"cell-\" + x + \"-\" + y)[0];\n \n if (newUnit != undefined && isEmpty(newUnit)) {\n newUnit.classList.add(\"food-unit\");\n foodCreated = true;\n }\n }\n}", "title": "" }, { "docid": "6eefa1ad5649ec0d36fc32ea08fde336", "score": "0.6099513", "text": "function makeFood(w,h){\n var x=Math.round(Math.random()*(w-10)/10)\n\tvar y=Math.round(Math.random()*(h-10)/10)\n\t\n\treturn {x:x,y:y}\n}", "title": "" }, { "docid": "ad45aabd308ef2143c21f3897935ed2b", "score": "0.60886765", "text": "function drawFood(){\n for(i=0;i<foodArray.length;i++){\n makeFood(foodArray[i][0], foodArray[i][1]);\n }\n}", "title": "" }, { "docid": "3207590e80d88e552351f6e085d6e811", "score": "0.6074856", "text": "insertFood() {\n if (!this.validateGrid('insertFood')) {\n return false;\n }\n if (!this.foodCoordinate) {\n return false;\n }\n const x = this.foodCoordinate[0];\n const y = this.foodCoordinate[1];\n this.gameGrid[y][x] = 'X';\n return true;\n }", "title": "" }, { "docid": "c91e6337007866835bcde282992bea27", "score": "0.6067428", "text": "function generateFood() {\n\tlet rand = shuffle([...Array(colors.length).keys()])[0];\n\tif (colors[rand].style.backgroundColor !== green && colors[rand].style.backgroundColor !== black) {\n\t\tcolors[rand].style.backgroundColor = green;\n\t\tfoodLocation.push(rand);\n\t}\n}", "title": "" }, { "docid": "559673d7ec25310ef8b7ec4a27b590bd", "score": "0.60669744", "text": "function loadFood(n){\n food = new Food(colW*Math.floor(random(20)),rowH*Math.floor(random(20)));\n\n }", "title": "" }, { "docid": "7c875a3415ce66edaf34be2cc47588b7", "score": "0.5996273", "text": "function generate_fruit() {\n fruit_x = locations_x[Math.floor(Math.random() * locations_x.length)];\n fruit_y = locations_y[Math.floor(Math.random() * locations_y.length)];\n fruit_exists = true;\n}", "title": "" }, { "docid": "df4462f088e009076e462fcc6ffeecc9", "score": "0.5991981", "text": "function createRestaurant(/* code here */){\n\n /* code here */\n\n}", "title": "" }, { "docid": "ab96016052346d95a912192479550479", "score": "0.5948314", "text": "function drawFood() {\n\tdrawSquare(food.x, food.y, foodColor);\n}", "title": "" }, { "docid": "4b55bc3fd60f9933b85f881ab5695125", "score": "0.593897", "text": "refillFood() {\n // somehow check if new pt is NOT on snake if on make then make new one \n while (this.food.length < this.numFood) {\n const newFood = Pellet.newRandom(); // [x, y]\n // check each snake coordinates if it does not match newFood coordinates\n if (this.snakes.every(snake => !snake.contains(newFood))) this.food.push(newFood);\n }\n }", "title": "" }, { "docid": "5eceea2260ba82fc53a6062d2022c112", "score": "0.59297436", "text": "makeSnake(){\n this.map = [];\n this.gameOver = false;\n this.dir = 0;\n this.foodCount = 0;\n //to make the head of snake\n this.map[0] = [];\n this.map[0][0] = this.size/2 + this.snakeThickness;\n this.map[0][1] = this.size/2;\n square(this.map[0][0], this.map[0][1], this.snakeThickness);\n this.headValues = this.map[0];\n //to repeat 3 more times\n this.count = 0;\n for (let i = 1; i < 4;i++){\n this.map[i] = [];\n this.map[i][0] = this.size/2 - this.count;\n this.map[i][1] = this.size/2;\n square(this.map[i][0], this.map[i][1], this.snakeThickness);\n this.count += this.snakeThickness;\n }\n this.placeFood();\n }", "title": "" }, { "docid": "a7871bd75c4bb3d67cc9e5a831840046", "score": "0.59246486", "text": "withScoreComesNewFood() {\n this.updateScore(this.score += 1);\n foodPaper.clear();\n this.foodLocation = {\n x: (parseInt(((Math.random() * boundaries.bottom[0]))/blockSize) * (blockSize)),\n y: (parseInt(((Math.random() * boundaries.bottom[1]))/blockSize) * (blockSize))\n };\n this.renderFoodBlock();\n }", "title": "" }, { "docid": "5a254795e499c387cd61c3fc2de874bd", "score": "0.5916513", "text": "function FoodItem(name, calories, vegan, glutenFree, citrusFree) {\n this.name = name;\n this.calories = calories;\n this.vegan = vegan;\n this.glutenFree = glutenFree;\n this.citrusFree = citrusFree;\n}", "title": "" }, { "docid": "a9182fef7d951fbf515f85355c11d9c9", "score": "0.59159374", "text": "function createFood(id, name, amount, amountPerDelivery, isMeet) {\n return {\n id,\n name: name || 'unknown',\n amount: amount || 0,\n amountPerDelivery: amountPerDelivery || 1,\n isMeet: Boolean(isMeet),\n isOrderPending: false,\n\n toJSON() {\n return {\n id: this.id,\n name: this.name,\n amount: this.amount,\n amountPerDelivery: this.amountPerDelivery,\n isMeet: this.isMeet\n };\n }\n };\n}", "title": "" }, { "docid": "9026d64dbd80cf20ca645b889999bfc6", "score": "0.59132963", "text": "function draw() {\n background(51);\n s.death();\n s.update();\n s.show();\n\n if (s.eat(food)) {\n pickLocation();\n }\n\n fill(255, 0, 100);\n rect(food.x, food.y, scl, scl);\n}", "title": "" }, { "docid": "40be541096d8032b30dc6c46fb005ca7", "score": "0.59107596", "text": "function displayFood(food) {\n if (!food.eaten) {\n push();\n fill(97, 56, 26);\n noStroke();\n ellipse(food.x, food.y, food.size);\n pop();\n }\n}", "title": "" }, { "docid": "ddf1f870c5948656058363acafa397dc", "score": "0.590777", "text": "function makeFoods(probs){\n for(var f = 0; f < probs.length; f++){\n var genNum = Math.floor(Math.random() * (probs[f].max + 1));\n for(var n = 0; n < genNum; n++){\n var x = Math.floor(Math.random() * cols);\n var y = Math.floor(Math.random() * rows);\n var it;\n if(probs[f].name == \"apple\"){\n it = new item(\"apple\", x, y);\n it.img = appleIMG;\n it.imgReady = appleReady;\n it.dispX = 4;\n it.dispY = 6;\n it.imageW = it.img.width;\n it.imageH = it.img.height;\n it.spec = \"health\";\n it.value = 10;\n }\n itemSet.push(it);\n foodSet.push(it);\n }\n }\n}", "title": "" }, { "docid": "242a0c77f6a4edf4f4b59360ccdaa6cb", "score": "0.5899681", "text": "function newFood() {\n\n let safe = false;\n // keep generating new food locations untill it is not on the snake\n while(!safe) {\n food = Math.random()*rb+50;\n food -= food%50;\n food -= 50;\n let temp = Math.random()*bb+50;\n temp -= temp%50;\n temp -= 50;\n food = food*1000+temp;\n\n safe = true;\n\n // check if the food is not spawned on the snake body\n for(let i=0; i<snake.length; i++) {\n if(food === snake[i]) {\n safe = false;\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "f0aa7725501915062fbba3d529b063b2", "score": "0.58534235", "text": "function generateFood(){\n for (x=4; x<=38;x++){\n for (y=4; y<=20;y++){\n if (x%2===0&&y%2===0){\n food.push(new Food(x*escala,y*escala));\n walls.forEach(function(w){\n if (crashWith(w,food[food.length-1])){\n food.pop();\n }\n });\n }\n }\n }\n }", "title": "" }, { "docid": "068b3adacf133cf2c8f3605aa6e8115e", "score": "0.58355504", "text": "function generateFoodCoords() {\n return {\n x: Math.floor((Math.random() * arenaWidthBoxes + arenaX0Boxes)) * boxSidePxls,\n y: Math.floor((Math.random() * arenaHeightBoxes + arenaY0Boxes)) * boxSidePxls,\n };\n}", "title": "" }, { "docid": "c7ffcec7f11f6eac2abbdeb10bab462e", "score": "0.58309805", "text": "function createFish(x, y, size) {\n let fish = {\n x: x,\n y: y,\n size: size,\n vx: 0,\n vy: 0,\n speed: 2,\n };\n return fish;\n}", "title": "" }, { "docid": "8c254eca944d222b6421e123309d9efb", "score": "0.5824409", "text": "function maybeSpawnFood() {\n if (Date.now() - question_changed_timestamp < 4000) return;\n if (!last_food_spawned_timestamp) {\n createFood();\n return;\n }\n let timeNow = Date.now();\n let timeSinceLastFood = timeNow - last_food_spawned_timestamp;\n\n if (timeSinceLastFood <= 100) return;\n\n if (correctAnswersOnMap() == 0) {\n createFood();\n return;\n }\n\n if (foods.length <= 2) {\n createFood();\n return;\n }\n\n if (timeSinceLastFood >= 7500 && foods.length <= 7) {\n createFood();\n return;\n }\n}", "title": "" }, { "docid": "6b0036ede0de766515a30736423f39e7", "score": "0.58151966", "text": "function placeFood() {\n var self = this;\n function notEqual(snake) {\n return !(self.$food.is(snake));\n }\n self.foodCoord = [Math.floor(Math.random() * self.myGrid.cols), Math.floor(Math.random() * self.myGrid.rows)];\n self.$food = $(\"#\" + self.foodCoord[0] + \"_\" + self.foodCoord[1]);\n\n while (!(self.snake.every(notEqual))) {\n self.foodCoord = [Math.floor(Math.random() * self.myGrid.cols), Math.floor(Math.random() * self.myGrid.rows)];\n self.$food = $(\"#\" + self.foodCoord[0] + \"_\" + self.foodCoord[1]);\n\n }\n self.$food.css({\"background-color\":\"red\"});\n}", "title": "" }, { "docid": "41a23c8ec4ec0fe2d94c160fd3c1baae", "score": "0.57916856", "text": "function draw() {\nbackground(51);\n snake.update();\n snake.show();\n// resets location of food if eaten\nif (snake.eat(food)){\n picklocation();\n}\n fill(51, 255, 51);\n rect(food.x, food.y, gri, gri);\n\n}", "title": "" }, { "docid": "aa18c2cc7e749aeb1d85dcd8055b0da2", "score": "0.5780595", "text": "drawFood(){\n fill(0,255,0);\n square(this.food[0],this.food[1],this.snakeThickness);\n }", "title": "" }, { "docid": "0c6789c915bc12f0c3b31ac8d8254176", "score": "0.5771496", "text": "function food (state = {}, action) {\n switch (action.type) {\n case ADD_RECIPE :\n const { recipe } = action;\n\n return {\n ...state,\n [recipe.label]: recipe\n }\n default :\n return state;\n }\n}", "title": "" }, { "docid": "07625369463978877d210291aa051d7e", "score": "0.5768114", "text": "start() {\n super.start();\n for (let f = 0; f < this.gameEngine.foodCount; f++) {\n let newF = new Food(this.gameEngine, null, { position: this.gameEngine.randPos() });\n this.gameEngine.addObjectToWorld(newF);\n }\n for (let ai = 0; ai < this.gameEngine.aiCount; ai++)\n this.addAI();\n }", "title": "" }, { "docid": "7f35fac710f04e024bfcb32184a24002", "score": "0.5760867", "text": "function createMarker(restaurant){\n var position = restaurant.location;\n\n restaurant.marker = new google.maps.Marker({\n position: position,\n map: map,\n icon: \"images/default-marker.png\",\n name: restaurant.name,\n about: restaurant.about,\n id: restaurant.id,\n animation: google.maps.Animation.DROP\n });\n\n // Push the marker to array of markers\n markers.push(restaurant.marker);\n\n // Get Facebook info on restaurant when marker is clicked\n restaurant.marker.addListener('click', function(){\n\n // open current restaurant marker\n openRestaurantMarker(restaurant);\n });\n }", "title": "" }, { "docid": "988b2657f5ebcb3e24d4e4b3ffe0f3f6", "score": "0.5750698", "text": "function createRecipe() {\n //this part adds the amount and name of each add on to the ingredient list\n if (firstAddOn){\n recipe.ingredients.push(firstAddOn.amount + ' ' + firstAddOn.name);\n }\n if (secondAddOn){\n recipe.ingredients.push(secondAddOn.amount + ' ' + secondAddOn.name);\n }\n //this splices the addDirections property from the add ons into the instructions array\n //this one is for chocolate chip cookies\n //TODO: add logic for new add-ins\n //TODO: improve logic for amounts based on cookie selections\n if (recipe === chocolateChipRecipe) {\n //chocolate chips\n //coconut\n if (firstAddOn === addOn[1] || secondAddOn === addOn[1]) {\n recipe.instructions.splice(5, 0, addOn[1].addDirections)\n }\n if (firstAddOn === addOn[0] || secondAddOn === addOn[0]) {\n recipe.instructions.splice(5, 0, addOn[0].addDirections)\n }\n //peanut butter\n if (firstAddOn === addOn[2] || secondAddOn === addOn[2]) {\n recipe.instructions.splice(3, 0, addOn[2].addDirections)\n }\n //cinnamon\n if (firstAddOn === addOn[3] || secondAddOn === addOn[3]) {\n recipe.instructions.splice(4, 0, addOn[3].addDirections)\n }\n //sprinkles\n if (firstAddOn === addOn[4] || secondAddOn === addOn[4]) {\n recipe.instructions.splice(6, 0, addOn[4].addDirections)\n }//frosting (always goes last)\n if (firstAddOn === addOn[5] || secondAddOn === addOn[5]) {\n recipe.instructions.push(addOn[5].addDirections)\n }//nutes\n if (firstAddOn === addOn[6] || secondAddOn === addOn[6]) {\n recipe.instructions.splice(5, 0, addOn[6].addDirections)\n\n }\n }\n //this one is for oatmeal cookies\n if (recipe === oatmealCookieRecipe) {\n if (firstAddOn === addOn[0] || secondAddOn === addOn[0]) {\n recipe.instructions.splice(3, 0, addOn[0].addDirections)\n }\n if (firstAddOn === addOn[1] || secondAddOn === addOn[1]) {\n recipe.instructions.splice(3, 0, addOn[1].addDirections)\n }\n if (firstAddOn === addOn[2] || secondAddOn === addOn[2]) {\n recipe.instructions.splice(2, 0, addOn[2].addDirections)\n }\n if (firstAddOn === addOn[3] || secondAddOn === addOn[3]) {\n recipe.instructions.splice(3, 0, addOn[3].addDirections)\n }\n if (firstAddOn === addOn[4] || secondAddOn === addOn[4]) {\n recipe.instructions.splice(6, 0, addOn[4].addDirections)\n }\n if (firstAddOn === addOn[5] || secondAddOn === addOn[5]) {\n recipe.instructions.push(addOn[5].addDirections)\n }\n if (firstAddOn === addOn[6] || secondAddOn === addOn[6]) {\n recipe.instructions.splice(3, 0, addOn[6].addDirections)\n\n }\n }\n //this one is for sugar cookies\n if (recipe === sugarCookieRecipe) {\n if (firstAddOn === addOn[0] || secondAddOn === addOn[0]) {\n recipe.instructions.splice(4, 0, addOn[0].addDirections)\n }\n if (firstAddOn === addOn[1] || secondAddOn === addOn[1]) {\n recipe.instructions.splice(4, 0, addOn[1].addDirections)\n }\n if (firstAddOn === addOn[2] || secondAddOn === addOn[2]) {\n recipe.instructions.splice(1, 0, addOn[2].addDirections)\n }\n if (firstAddOn === addOn[3] || secondAddOn === addOn[3]) {\n recipe.instructions.splice(4, 0, addOn[3].addDirections)\n }\n if (firstAddOn === addOn[4] || secondAddOn === addOn[4]) {\n recipe.instructions.splice(6, 0, addOn[4].addDirections)\n }\n if (firstAddOn === addOn[5] || secondAddOn === addOn[5]) {\n recipe.instructions.push(addOn[5].addDirections)\n }\n if (firstAddOn === addOn[6] || secondAddOn === addOn[6]) {\n recipe.instructions.splice(3, 0, addOn[6].addDirections)\n\n }\n }\n }", "title": "" }, { "docid": "3ceae677ef5e305961f5f882a07edce3", "score": "0.5750282", "text": "function Food() {}", "title": "" }, { "docid": "1c8c7db3b6fb360ac14e70385ce3efda", "score": "0.5743338", "text": "function pickLocation() {\n // The location must be on a grid, divisable by the scale of the game, in this case 20, so the food spawns on places where the snake can be.\n var cols = floor(width / scl);\n var rows = floor(height / scl);\n // Pics a random location, meeting this criteria\n food = createVector(floor(random(cols)), floor(random(rows)));\n food.mult(scl);\n}", "title": "" }, { "docid": "011f95207704fe347fd6daeae83eb06b", "score": "0.57330567", "text": "function Food(num) {\n var food = [];\n \n // Start with some food\n //food = new ArrayList();\n for (var i = 0; i < num; i++) {\n food.push(random(width),random(height)); \n }\n \n \n // Add some food at a position\n this.add = function(lx, ly) {\n var f = {x:lx, y:ly};\n food.push(f); \n \n }\n \n // Display the food\n this.run = function() {\n for (var j = 0; j < food.length; j++) {\n image(torch, food[j].x, food[j].y, torch.width, torch.height);\n }\n \n \n // There's a small chance food will appear randomly\n if (random(1) < 0.001) {\n food.add(random(width),random(height)); \n }\n }\n \n // Return the list of food\n this.getFood = function() {\n return food; \n }\n}", "title": "" }, { "docid": "3ed827c2dbad4f203b5cf7980b02fe0a", "score": "0.5730106", "text": "function createMarkers(places) {\n places.forEach(place => {\n if(fastFood.includes(place.name) == false) {\n let marker = new google.maps.Marker({\n position: place.geometry.location,\n map: map,\n title: place.name\n });\n\n google.maps.event.addListener(marker, 'click', () => {\n const request = {\n placeId: place.place_id,\n fields: ['name', 'formatted_address', 'geometry', 'rating',\n 'website', 'photos']\n };\n\n service.getDetails(request, (placeResult, status) => {\n showDetails(placeResult, marker, status)\n });\n });\n\n markers.push(marker);\n // Adjust the map bounds to include the location of this marker\n bounds.extend(place.geometry.location);\n } \n });\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "3dd05f7a7cb1bfc977323d2df5ec411a", "score": "0.572625", "text": "function populate(number){\n for(let i = 0; i < number; i++){\n let o = FactionJSON[Math.floor((Math.random() * FactionJSON.length))]\n let distance = 4000\n spawnPOI(ObjectJSON[Math.floor((Math.random() * ObjectJSON.length))].type, FactionJSON[Math.floor((Math.random() * FactionJSON.length))].name , undefined, false, Math.floor((Math.random() * distance)-(distance/2)), Math.floor((Math.random() * distance)-(distance/2)), Math.floor((Math.random() * distance)-(distance/2)), undefined, undefined);\n }\n}", "title": "" }, { "docid": "eb89061c4d31d8cbc992bc1b865da3f0", "score": "0.5724324", "text": "function foodFactory(food) {\n console.log(\"test test\", food);\n return `\n <div>\n <section class=\"foodTitle\">${food.name}</section>\n <section class=\"foodEthnicity\">${food.ethnicity}</section>\n <section class=\"foodCategory\">${food.category}</section>\n <section class=\"barcode\">${food.barcode}</section>\n <section class=\"ingredients\">${food.ingredients}</section>\n <section class=\"countriesOrigin\">${food.countries}</section>\n <section class=\"fat\">${food.fat}</section>\n <section class=\"sugar\">${food.sugar}</section>\n <section class=\"calories\">${food.calories} calories</section>\n </div>\n`\n}", "title": "" }, { "docid": "ed59d69d1b13b114228e58ce606168b1", "score": "0.570961", "text": "start() {\n const ran = this.getRandomPosition();\n this.fruits = [new Food(ran.x, ran.y)];\n this.startLoops();\n }", "title": "" }, { "docid": "0dcbdcd1b8bb1d7d50b37f13f9398cd3", "score": "0.5706532", "text": "function setFish1() {\n fish1.x = random(100, 400);\n fish1.y = random(100, 400);\n fish1.size = random(40, 60);\n }", "title": "" }, { "docid": "2f1ff3c3c015a5c872b7b58e35d33ae0", "score": "0.56973934", "text": "function Food(name) {\n this.name = name;\n this.price = 0;\n this.callories = 0;\n}", "title": "" }, { "docid": "de837aeed0d66d8a181b18573998569b", "score": "0.569731", "text": "function generateFood(){\n\t\t\t\n\t\t\tvar success = false;\n\t\t\twhile(!success){\n\t\t\t\tfoodX = parseInt(Math.random()*N);\n\t\t\t\tfoodY = parseInt(Math.random()*N);\n\n\t\t\t\tsuccess = true;\n\t\t\t\tfor(var i=0;i<body.length;i++){\n\t\t\t\t\tif(body[i][0]==foodX && body[i][1]==foodY){\n\t\t\t\t\t\tsuccess = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4ba9ecd4dd29877723d01aa7a55dffad", "score": "0.5695913", "text": "function createApple() {\n appleX = randomNo(0, play_area.width - 20);\n appleY = randomNo(0, play_area.height - 20);\n snake.forEach(function isOverlapping(part) { // Checks if bait is not present at the same place as snake's body.\n const overlap = part.x == appleX && part.y == appleY;\n if(overlap) createApple(); \n });\n}", "title": "" }, { "docid": "f72b156b51c7a719587d7abf1db105c9", "score": "0.5694989", "text": "function createFruit ()\n{\n // fruit = stock [converti string en numberInter (nombre aléatoire() multiplié par map)]\n apple = [ parseInt( Math.random() * map_y ),parseInt( Math.random() * map_x ) ];\n\n // sélectionne toutes <tr></tr> qui correspond à l'index .eq(fruit[0])\n $( \"tr\" ).eq( apple[ 0 ] ).find( \"td\" ).eq( apple[ 1 ] ).toggleClass( \"createFruit\" ); // puis\n // sélectionne la <td></td> qui correspond à l'index .eq(fruit[1])\n\n fruit.push( apple );\n}", "title": "" }, { "docid": "55533af930e6932ebc609bbbe067596d", "score": "0.56916624", "text": "randomMapPlace(){\n let randomBreed = Math.floor((Math.random() * 28) + 1);\n let randomHoog = Math.floor((Math.random() * 18) + 1);\n return {\n x: randomBreed,\n y: randomHoog\n }\n }", "title": "" }, { "docid": "1c993190b25e915219e92884a8957d9c", "score": "0.56851995", "text": "function displayFood() {\n push();\n noStroke();\n fill(food.color);\n ellipse(food.x,food.y,food.size);\n pop();\n}", "title": "" }, { "docid": "415d4c62ffbb909b55463a2a527cd466", "score": "0.56789726", "text": "function createPlacemark() {\n const placemarkLayer = new WorldWind.RenderableLayer();\n wwd.addLayer(placemarkLayer);\n const placemarkAttributes = genericPlaceMarkAttributes();\n //Get the data from the api\n request(\"GET\", \"http://localhost:3000/api/diseases\")\n .then(res => {\n const obj = [];\n const dados = JSON.parse(res[\"currentTarget\"][\"response\"]);\n if (dados && dados != \"\" && !dados[\"error\"]) {\n const keys = Object.keys(dados);\n for (const key of keys) {\n obj.push(dados[key]);\n }\n for (const disease of Object.keys(obj)) {\n const countries = Object.keys(obj[disease][\"countries\"]);\n for (const country of countries) {\n const name = obj[disease][\"name\"];\n const lat = obj[disease][\"countries\"][country][\"lat\"];\n const countryName = obj[disease][\"countries\"][country][\"name\"];\n const ltn =\n obj[disease][\"countries\"][country][\"ltn\"] ||\n obj[disease][\"countries\"][country][\"ltn\"];\n const plac3mark = addPlacemark(name, lat, ltn, countryName);\n //add placemark to the map\n placemarkLayer.addRenderable(plac3mark);\n }\n }\n }\n })\n .catch(err => {\n // console.error(new Error(err));\n });\n}", "title": "" }, { "docid": "0b555841e1d3266e040076fdb1935fcf", "score": "0.5649316", "text": "function createFlower() {\n let flower = {\n flower_coordinates: {\n lat: lStorage.lat,\n lng: lStorage.lng,\n },\n flower_type: lStorage.type,\n flower_name: lStorage.flowername,\n user_name: lStorage.name,\n user_location: lStorage.location,\n };\n socket.emit(\"createFlower\", flower);\n}", "title": "" }, { "docid": "4402cb326519a3282246060f846b822f", "score": "0.563233", "text": "function FastFoodRestaurant(name, employees, valueMenu = true) {\n this.name = name\n this.employees = employees\n this.valueMenu = valueMenu\n }", "title": "" }, { "docid": "aa9aeaec6e60ad64cb4c1a708f51e9c4", "score": "0.56251687", "text": "function food () {\n if (frameCount % 80 === 0) {\n var banana = createSprite(400,320,40,10);\n banana.y = Math.round(random(120,200));\n banana.addImage(bananaImage);\n banana.scale = 0.05;\n banana.velocityX = -3;\n\n //Assign lifetime to the variable\n banana.lifetime = 134;\n \n //Add each banana to the group\n bananaGroup.add(banana);\n }\n}", "title": "" }, { "docid": "d01a300cb621a66a827b5933a956245d", "score": "0.56250954", "text": "function populate()\n{\n // mark houses\n for (var house in HOUSES)\n {\n // plant house on map\n new google.maps.Marker({\n icon: \"https://google-maps-icons.googlecode.com/files/home.png\",\n map: map,\n position: new google.maps.LatLng(HOUSES[house].lat, HOUSES[house].lng),\n title: house\n });\n }\n\n // get current URL, sans any filename\n var url = window.location.href.substring(0, (window.location.href.lastIndexOf(\"/\")) + 1);\n\n // scatter passengers\n for (var i = 0; i < PASSENGERS.length; i++)\n {\n // pick a random building\n var building = BUILDINGS[Math.floor(Math.random() * BUILDINGS.length)];\n\n // prepare placemark\n var placemark = earth.createPlacemark(\"\");\n placemark.setName(PASSENGERS[i].name + \" to \" + PASSENGERS[i].house);\n\n // prepare icon\n var icon = earth.createIcon(\"\");\n icon.setHref(url + \"/img/\" + PASSENGERS[i].username + \".jpg\");\n\n // prepare style\n var style = earth.createStyle(\"\");\n style.getIconStyle().setIcon(icon);\n style.getIconStyle().setScale(4.0);\n\n // prepare stylemap\n var styleMap = earth.createStyleMap(\"\");\n styleMap.setNormalStyle(style);\n styleMap.setHighlightStyle(style);\n\n // associate stylemap with placemark\n placemark.setStyleSelector(styleMap);\n\n // prepare point\n var point = earth.createPoint(\"\");\n point.setAltitudeMode(earth.ALTITUDE_RELATIVE_TO_GROUND);\n point.setLatitude(building.lat);\n point.setLongitude(building.lng);\n point.setAltitude(0.0);\n\n // associate placemark with point\n placemark.setGeometry(point);\n\n // add placemark to Earth\n earth.getFeatures().appendChild(placemark);\n\n // save placemark to passenger for later use\n PASSENGERS[i].placemark = placemark;\n\n // add marker to map\n var marker = new google.maps.Marker({\n icon: \"https://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/man.png\",\n map: map,\n position: new google.maps.LatLng(building.lat, building.lng),\n title: PASSENGERS[i].name + \" at \" + building.name\n });\n\n PASSENGERS[i].lat = building.lat;\n PASSENGERS[i].lng = building.lng;\n PASSENGERS[i].marker = marker;\n PASSENGERS[i].pickedUp = null;\n PASSENGERS[i].droppedOff = null;\n\n //logPassenger(PASSENGERS[i]);\n }\n}", "title": "" }, { "docid": "0e82c76625aa2bf760e0690373290491", "score": "0.5621638", "text": "function createPowerUp() \n\t\t{\n\t\t\t\n\t\t\tvar random = Math.floor(Math.random()*6);\n\t\t\tvar C;\n\t\t\tvar T;//type\n\t\t\tvar timeC = createjs.Ticker.getTime();//holds the time of creation\n\t\t\tif(random == 0)\t\t{C = neonGreen; T = \"killEnemies\";}//kills all the enemies on screen\n\t\t\telse if(random == 1 || random == 2 )\t{C = neonOrange; T = \"lifeUp\";}// life +1\n\t\t\telse if( random >= 3)\t{C = neonBlueSky; T = \"reduceSize\";}//reduces the size by 2\n\t\t\t\n\t\t\tvar shape = new createjs.Shape();\n\t\t\t\tshape = paintCircle(C);//paintCell has the code to paint a 10x10 px block\n\t\t\t\tshape.x = Math.round(Math.random()*49) * cw;//places the food block somewhere in the stage\n\t\t\t\tshape.y = Math.round(Math.random()*49) * cw;\n\t\t\t\t\n\t\t\tvar F = shape;\n\t\t\tpowerUpsHolder.push(\n\t\t\t\t{\t\n\t\t\t\t\tpowerUp : F,\n\t\t\t\t\tcolor : C,\n\t\t\t\t\ttype: T,\n\t\t\t\t\ttimeCreation : timeC\n\t\t\t\t}); \n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tstage.addChild(F);\n\t\t}", "title": "" }, { "docid": "6a67555ca86c83b1bd89d218aaf40269", "score": "0.5619008", "text": "function hermitdemfutter(_event) {\n let xCanvas = _event.clientX;\n let yCanvas = _event.clientY;\n for (let i = 0; i < 10; i++) {\n let nomNom = new aufgabe13.Foodistsogut(xCanvas, yCanvas);\n aufgabe13.allesArray.push(nomNom);\n ////141 -150 erpel\n }\n for (let i = 0; i < alleVoegel.length; i++) {\n alleVoegel[i].foodLocation = xCanvas;\n alleVoegel[i].findFood();\n }\n }", "title": "" }, { "docid": "9a9359d5b21436d8c5b5d353fffc72c4", "score": "0.5612137", "text": "function setFood() {\n randomSeed(new Date().getTime());\n var currentValue = 0;\n for (i = 0; i < food.length; i++) {\n var myFood = food[i];\n currentValue += myFood.r;\n }\n var iterations = totalFoodValue - currentValue; //how many new Blobs with avg of 1 will be created\n for (i = 0; i < iterations/2; i++) {\n var x = random(-constrainX,constrainX-1);\n var y = random(-constrainY,constrainY-1);\n var size = random(0.2,2);\n var newBlob = new Blob(\"food\", null, x,y,size,foodShape);\n food.push(newBlob);\n }\n}", "title": "" }, { "docid": "49441f4f55b6f465a804399387d3167f", "score": "0.56119835", "text": "function drawFood() {\n for (const index in foods) {\n const food = foods[index];\n if (typeof food !== \"undefined\") {\n food.draw();\n\n // simulates that the snake eat.\n if (hit(food, snake.head)) {\n snake.eat();\n removeFromFoods(food);\n }\n }\n }\n }", "title": "" } ]
45c3680bfc585e32b011c3e7f4bec975
Implementation of localStorage API to get filters from local storage. This should get called whenever the DOM is loaded.
[ { "docid": "39987c821681a195e80e51e0b1c61e55", "score": "0.8307906", "text": "function getFiltersFromLocalStorage() {\n // TODO: MODULE_FILTERS\n // 1. Get the filters from localStorage and return in JSON format\n\n\n // Place holder for functionality to work in the Stubs\n return null;\n}", "title": "" } ]
[ { "docid": "df9d8f71f1d8005811f160351e0aa870", "score": "0.8201639", "text": "function getFiltersFromLocalStorage() {\n // TODO: MODULE_FILTERS\n // 1. Get the filters from localStorage and return in JSON format\n let persistedFilters = JSON.parse(localStorage.getItem('filters'));\n\n // Place holder for functionality to work in the Stubs\n return persistedFilters;\n}", "title": "" }, { "docid": "0edad8878c238b92e791c2438c15a8b2", "score": "0.8176289", "text": "function getFiltersFromLocalStorage() {\n let getFilter = JSON.parse(window.localStorage.getItem('filters'));\n\n if(getFilter !== null)\n return getFilter;\n else\n return null;\n \n}", "title": "" }, { "docid": "ff5dcd6892c2efd60df3b1fbba58444d", "score": "0.7293842", "text": "function getLocalStorage() {\n if (localStorage.genres && localStorage.genres !== [\"\"]) {\n setGenresFilter();\n }\n}", "title": "" }, { "docid": "591a45a23208717d796da5cbf6661810", "score": "0.7131958", "text": "function saveFiltersToLocalStorage(filters) {\n // TODO: MODULE_FILTERS\n // 1. Store the filters to localStorage using JSON.stringify()\n localStorage.setItem('filters',JSON.stringify(filters));\n return true;\n \n}", "title": "" }, { "docid": "5626b10c086d15b23d32575edda64de0", "score": "0.7085988", "text": "function loadSettings(){\n var filter_setting = 0,\n oJson = {},\n storage_key;\n while( filter_setting < window.localStorage.length) {\n filter_setting++;\n storage_key = window.localStorage.key(filter_setting);\n oJson[storage_key] = window.localStorage.getItem(storage_key);\n }\n number_of_filters = oJson[\"q\"];\n filters = getPropertyByRegex(oJson,\"filter[0-9]*\");\n filters.forEach(function(filter){\n initial_filters.push(formatSettings(oJson[filter]));\n });\n}", "title": "" }, { "docid": "6760863690c01648db414a66c45eb2d3", "score": "0.70536417", "text": "function saveFiltersToLocalStorage(filters) {\n let strFilter = JSON.stringify(filters);\n window.localStorage.setItem('filters', strFilter);\n return true;\n}", "title": "" }, { "docid": "9425f9371946ce36dcfde74bfb7c46f0", "score": "0.6935186", "text": "function saveFilters() {\n\t\n\tlocalStorage.setItem(\"s4l_loxone_filters\", JSON.stringify(filters));\n\t// console.log(\"saveFilters\", filters, localStorage.getItem(\"s4l_loxone_filters\"));\n}", "title": "" }, { "docid": "69f59137711e88cc1b095aeb908e4a82", "score": "0.68028337", "text": "function filterClick(node){\n var filters = document.querySelectorAll(\".filter-item\");\n\n //remove active class to all filters\n filters.forEach(item => {\n item.classList.remove(\"filter-active\");\n })\n\n //add active class the filter that is clicked\n node.classList.add(\"filter-active\");\n\n //if \"All\" filter is clicked\n if(node.innerHTML == \"All\"){\n\n //change \"filterActive\" in localStorage to \"All\"\n localStorage.setItem('filterActive', 'All');\n \n //if \"Active\" filter is clicked\n }else if(node.innerHTML == \"Active\"){\n localStorage.setItem('filterActive', 'Active');\n\n //if \"Completed\" filter is clicked\n }else{\n localStorage.setItem('filterActive', 'Completed');\n }\n\n\n filtersRefreshList();\n \n}", "title": "" }, { "docid": "2c5a9d25cb71c066dcc95084f9eb1c02", "score": "0.67909527", "text": "function saveFiltersToLocalStorage(filters) {\n // TODO: MODULE_FILTERS\n // 1. Store the filters to localStorage using JSON.stringify()\n\n return true;\n}", "title": "" }, { "docid": "4ff0f7076e6b9d31a19acf1225c6f4d9", "score": "0.6743206", "text": "function saveFilters() {\n var divs = $('#filterForm div'), filters = [];\n for (var i = 0; i < divs.length; i++) {\n var div = divs[i];\n if (div.className) {\n var filter = [ div.className ];\n for (var j = 1; j < div.childNodes.length; j++) {\n var childNode = div.childNodes[j];\n if (childNode.className.indexOf(div.className) >= 0) {\n var value = $(childNode).val();\n filter.push(value);\n }\n }\n filters.push(filter.join('\\u241F'));\n }\n }\n if (localStorage) {\n localStorage.SCFilterFilters = filters.join('\\u241E');\n }\n}", "title": "" }, { "docid": "ec4bfc0928cb3c0b47baa02594b10228", "score": "0.67363584", "text": "function persistFilter() {\n var trasaction_type = JSON.parse(localStorage.getItem(\"Transaction_Type\"));\n var start = JSON.parse(localStorage.getItem(\"trans_Start_Date\"));\n var end = JSON.parse(localStorage.getItem(\"trans_End_Date\"));\n var searchText = JSON.parse(localStorage.getItem(\"Search_Text\"));\n vm.filters.transactiontype = utils.isEmptyVal(trasaction_type) ? '' : trasaction_type;\n vm.filters.t_start_date = utils.isEmptyVal(start) ? '' : start;\n vm.filters.t_end_date = utils.isEmptyVal(end) ? '' : end;\n vm.searchText = utils.isEmptyVal(searchText) ? '' : searchText;\n }", "title": "" }, { "docid": "762e20de8ef5a96a5aecaea00e4e922e", "score": "0.6612199", "text": "function getLocalStorage() {\n arrFavoriteList = JSON.parse(localStorage.getItem(\"LocalStorageList\"));\n if (arrFavoriteList === null) {\n arrFavoriteList = [];\n }\n paintMovies();\n listenFavMovies();\n paintFavorite();\n listenTrashItem();\n}", "title": "" }, { "docid": "a536527f4693e42ef3987c7893a840b1", "score": "0.6559739", "text": "function filtersRefreshList(){\n var listItems = document.querySelectorAll(\"li\");\n\n //get filter state(All/Active/Completed) from localStorage\n var filterActive = localStorage.getItem('filterActive');\n\n //if filter state is \"All\"\n if(filterActive == \"All\"){\n\n //remove the class \"hidden\" for every item on the list\n listItems.forEach(item => {\n item.classList.remove(\"hidden\");\n })\n\n //if filter state is \"Active\"\n }else if(filterActive == \"Active\"){\n \n listItems.forEach(item => {\n if(item.classList.contains(\"completed\")){\n //add the class \"hidden\" if item is \"completed\"\n item.classList.add(\"hidden\");\n }else{\n //remove the class \"hidden\" if item is \"completed\"\n item.classList.remove(\"hidden\");\n }\n \n })\n \n //if filter state is \"Completed\"\n }else{\n\n listItems.forEach(item => {\n if(item.classList.contains(\"completed\")){\n //remove the class \"hidden\" if item is \"completed\"\n item.classList.remove(\"hidden\");\n }else{\n //add the class \"hidden\" if item is \"completed\"\n item.classList.add(\"hidden\");\n }\n \n })\n }\n\n updateLocalStorageArray();\n}", "title": "" }, { "docid": "2a5ab23472991fccd75a4d76ba3557ba", "score": "0.63771623", "text": "function getListFromLocal() {\n var productList = localStorage.getItem(\"productList\");\n if(productList != null) {\n adapter.setProductList(JSON.parse(productList));\n }\n }", "title": "" }, { "docid": "087d52dd4bf7cd28344c5b95cf595a02", "score": "0.637141", "text": "function getLocalStorage() {\n var storedCities = JSON.parse(localStorage.getItem(\"cities\"));\n if (storedCities !== null) {\n var Cities = storedCities;\n }\n renderCities(Cities);\n }", "title": "" }, { "docid": "b7122827fddfbbaffd361f91f383b9f0", "score": "0.63501596", "text": "function loadState() {\n var success = false;\n\n if (localStorageAvailable()) {\n var state = localStorage.getItem('filterizer-' + window.location);\n if (state) {\n $(holder).append($(state));\n\n success = true;\n }\n }\n\n triggerEvent('filterizer.loadstate', {'result': success});\n\n return success;\n }", "title": "" }, { "docid": "7680805a437a11ff9fbfa907b63766e9", "score": "0.63087213", "text": "function load() {\n\t\t\t//get the list of exclusions as an array\n\t\t\treturn JSON.parse(localStorage[storageKey] || '[]');\n\t\t}", "title": "" }, { "docid": "aa6bd5c437720bb7b3618a94e50a06eb", "score": "0.62832934", "text": "function storeFilterValues() {\n \n \tfilterCookieString = '';\n\tif(filterElementCount >0 ) {\n\t \t\n\t \tfor(i = 0; i<filterElementCount;i++) \n\t \t{\n\t \t\tfilterValue = document.getElementById(\"filterElementId_\"+i).value;\n\t \t\tfilterCookieString += (filterCookieString!='')? ( \":\" + filterValue):filterValue ;\n\t \t}\n\t} else {\n\t\tbuildInitialFilterValues();\n\t\t\n\t}\n \n\tcookieFilterValues = filterCookieString; \n\tcookieFilterValuesArray = cookieFilterValues.split(\":\");\n\tdocument.cookie = \"FILTER_VALUES=\" + filterCookieString;\n}", "title": "" }, { "docid": "408a441a7743c0ac91c3d245d7abf95f", "score": "0.6248353", "text": "function retrieveStates(){\n var storage_position = 0,\n oJson = {},\n storage_key;\n while(storage_position < window.localStorage.length) {\n storage_key = window.localStorage.key(storage_position);\n oJson[storage_key] = window.localStorage.getItem(storage_key);\n storage_position++;\n }\n local_store_threads = getPropertyByRegex(oJson,\"[0-9]+IMG\");\n\texpire_time = localStorage.getItem(\"Expiration_Time\");\n\tmd5_filters = localStorage.getItem(\"MD5_List_FSE\");\n\tif(md5_filters !== null)\n\t\tmd5_filters_arr = md5_filters.split(\"\\n\");\n\tmd5_filters_arr.forEach(function(md5, index){\n\t\tmd5 = md5.trim();\n\t\tmd5_filters_arr[index] = md5.substring(1, md5.length - 1);\n\t});\n}", "title": "" }, { "docid": "48779dbc8e9b44b6ba821eae9fb78120", "score": "0.62067807", "text": "function getLocalStorage() {\n return localStorage.getItem(\"list\") ? JSON.parse(localStorage.getItem(\"list\")) : [];\n}", "title": "" }, { "docid": "8c8a69448acf218d74213d1749d538d5", "score": "0.6202356", "text": "function initialize(){\r\n //localStorage.setItem(\"GetSessionData\",\"\");\r\n favStars = localStorage.getItem(\"GetSearchData\");\r\n renderFavPage();\r\n localStorage.setItem(\"GetSearchData\",'');\r\n }", "title": "" }, { "docid": "d20a51cf5acf106b7563ed0e6acd73c0", "score": "0.61774963", "text": "function getLocalStorage() {\n if (localStorage.getItem('list')) {\n return JSON.parse(localStorage.getItem('list'))\n } else {\n return []\n }\n}", "title": "" }, { "docid": "031923020a2059aed8b2dd826afb1b02", "score": "0.6156939", "text": "function setFilter(newFilter) {\n console.log(newFilter);\n \n sessionStorage.setItem(\"currentFilter\", newFilter);\n}", "title": "" }, { "docid": "48018cb2f4a0ccd1ea533de98c1d4567", "score": "0.6123925", "text": "function LocalStorage() {}", "title": "" }, { "docid": "48018cb2f4a0ccd1ea533de98c1d4567", "score": "0.6123925", "text": "function LocalStorage() {}", "title": "" }, { "docid": "b3891c0363fa4488b679d42882dfcc3c", "score": "0.6123431", "text": "function all(){var items=[];var storage=JSON.parse(localStorage.getItem(self.storageContainer));if(storage){for(var key in storage){items.push(self.transform(storage[key]));}}return items;}", "title": "" }, { "docid": "b0f3a0cd301f3b704e09e965c30f11e3", "score": "0.6111001", "text": "function getFilters(){\n return filters;\n }", "title": "" }, { "docid": "26fc43ffc433754d99af0527d03eb5f9", "score": "0.60995066", "text": "function doFilter() {\n\tlet filterMe = document.querySelectorAll(\".filter-me\");\n\t// If I can't find you :p \n\tif (!filterMe.length)\n\t\treturn;\n\n\tfor (let i of filterMe) {\n\t\ti.addEventListener(\"click\", function () {\n\t\t\tlocalStorage.setItem(\"imgData\", this.src);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "f361c1374a408767a65b67e624541e38", "score": "0.60711193", "text": "function listWestern() {\n\n localStorage.setItem(\"category\",\"Western\");\n }", "title": "" }, { "docid": "2043dd135fdd7ffe9716c68ed3ca969b", "score": "0.6060509", "text": "function setRecentSearches() {\n // Get our data out of local storage.\n var allSearched = JSON.parse(localStorage.getItem(\"search\"));\n\n // If local storage is empty, display a message for the user.\n if (allSearched === null) {\n console.log(\"Nothing in recent\")\n var li = $(\"<li>\");\n li.addClass(\"no-searches\")\n li.text(\"No searches here yet!\")\n li.appendTo($(\".recentSearches\"));\n } // If local storage has values, display them to the user.\n else {\n store = store.concat(allSearched)\n $(\".no-searches\").remove();\n for (var i = 0; i < allSearched.length; i++) {\n var li = $(\"<li>\");\n li.html(allSearched[i].artist + \": \" + allSearched[i].song);\n li.appendTo($(\".recentSearches\"));\n }\n }\n}", "title": "" }, { "docid": "6418238eebe700367abc2c452c2686de", "score": "0.606022", "text": "function getFavoritesFromLocalStorage() {\r\n const localStorageFavorites = localStorage.getItem('favoriteShows');\r\n if (localStorageFavorites !== null) {\r\n const favoritesArray = JSON.parse(localStorageFavorites);\r\n favoriteShows = favoritesArray;\r\n paintFavorites();\r\n }\r\n}", "title": "" }, { "docid": "5b02a7441280525f264b68a6afd544b0", "score": "0.6037629", "text": "function loadTaskFromLS(){\r\n \r\n let taskstore;\r\n if(localStorage.getItem('tasks') === null){\r\n taskstore = [];\r\n }\r\n else{\r\n document.querySelector('#filterlist').classList.remove('hide');\r\n taskstore = JSON.parse(localStorage.getItem('tasks'));\r\n \r\n }\r\n taskstore.forEach(task=>{\r\n addTaskToWindow(task);\r\n })\r\n}", "title": "" }, { "docid": "aea3e388250f405c53b6c0d63685b769", "score": "0.60362244", "text": "function filterRetain() {\n var filtertext = vm.taskFilterText;\n sessionStorage.setItem(\"globalTaskText\", filtertext);\n }", "title": "" }, { "docid": "288ab7b8f533608df39b5eadf093381b", "score": "0.6007437", "text": "function retrieveData () {\t\t\t\n\tvar frozen = localStorage.getItem(\"listOfProducts\");\n\tvar unfrozen = JSON.parse(frozen);\n\tif (unfrozen !== null) {\n\t\tnewProductsList = unfrozen;\n\t\treturn newProductsList;\n\t}\n}", "title": "" }, { "docid": "ceab01db1bb94b26ef920b34f449971c", "score": "0.5992985", "text": "function filter() {\n distances = distanceUser.filter(choice => choice.km < document.getElementById(\"distSelect\").value);\n console.log(distances);\n //Print filtered Venues to the Screen\n document.getElementById(\"demo\").innerHTML = JSON.stringify(distances, null, 4);\n //Create array with only the names of the filtered Venues\n filteredVenues = distances.map(names => names.name);\n console.log(filteredVenues);\n //push filtered Venue names into the Local Storage\n localStorage.setItem(\"Venues\", JSON.stringify(filteredVenues));\n return distances\n}", "title": "" }, { "docid": "ddd1e6a9716df283a4202d5438bda9fa", "score": "0.5987021", "text": "function setLocalFilters(filters) {\n localFilters = filters;\n localPage = 0;\n}", "title": "" }, { "docid": "403d926b2174621a80852912f4a8b6dd", "score": "0.59749204", "text": "function getItemsFromLS(){\r\n if(localStorage.getItem('items')===null){\r\n items = [];\r\n }else {\r\n items = JSON.parse(localStorage.getItem('items'))\r\n }\r\n return items;\r\n}", "title": "" }, { "docid": "c9c79d7236333bd6730577bb2fb5835f", "score": "0.5963091", "text": "function retrieve() {\n var todos = JSON.parse(localStorage.getItem('todomvc-jtmpl') || '[]')\n .map(function(el) {\n // Attach filter function\n el.filter = applyCurrentFilter;\n return el;\n });\n jtmpl('#todoapp')('todos', todos);\n }", "title": "" }, { "docid": "d2ba54bc7329bd9bab9e0999c8969ffb", "score": "0.5934689", "text": "function getItemsFromLS() {\r\n if (localStorage.getItem('items') === null) {\r\n items = [];\r\n } else {\r\n items = JSON.parse(localStorage.getItem('items'));\r\n }\r\n return items;\r\n}", "title": "" }, { "docid": "43d7b98cf2bfd182c9f6e569826393b8", "score": "0.5926476", "text": "function retainFilters(filterObj) {\n var storeObj = angular.copy(filterObj);\n localStorage.setItem(\"Transaction_Type\", JSON.stringify(storeObj.transactiontype));\n localStorage.setItem(\"trans_Start_Date\", JSON.stringify(storeObj.t_start_date));\n localStorage.setItem(\"trans_End_Date\", JSON.stringify(storeObj.t_end_date));\n\n }", "title": "" }, { "docid": "ed2e4b1b2faecc367bcb93c4cf02db9d", "score": "0.5902754", "text": "localStorageGet() {\n return JSON.parse(localStorage.getItem(this.name));\n }", "title": "" }, { "docid": "69d5b9571fa7e4f27326ef33eca1469c", "score": "0.58963317", "text": "function mostraLocalStorage(){alert(localStorage.palestras)}", "title": "" }, { "docid": "ee5a5e9e24a1f3d3e2f8fd82883a0736", "score": "0.5895786", "text": "function getSetData() {\n return localStorage.data;\n }", "title": "" }, { "docid": "d0ebdfe7854ed9ccaa6bea14b5e34715", "score": "0.5883013", "text": "function getItemsFromLS(){\n if(localStorage.getItem('items')===null){\n items = [];\n \n }else{\n items = JSON.parse(localStorage.getItem('items'))\n }\n return items;\n}", "title": "" }, { "docid": "15d5136bb7773702f4f6f027d271ef1c", "score": "0.58760583", "text": "function getLocalStorage(){\n\t\tif(typeof localStorage.getItem('tripList') !== 'undefined' && localStorage.getItem('tripList') != null ){\n\t\t\ttripList = JSON.parse(localStorage.getItem('tripList'));\n\t\t}\n\n\t}", "title": "" }, { "docid": "569f8877516e21c407404b6a1de36e8c", "score": "0.58705205", "text": "initLocalStorage() {\n if (this.getLocalStorage() == null)\n this.setLocalStorage([]);\n }", "title": "" }, { "docid": "56c88012e1611785f0080752fd49076b", "score": "0.58684814", "text": "static get local() { return this._local ? this._local : this._local = new Xtorage(localStorage) }", "title": "" }, { "docid": "6542e97dca3239827800931544b195eb", "score": "0.58632225", "text": "function loadSavedItemsFromLocalStorage(){\n\tlet savedItems = localStorage.getItem('savedItems');\n\n\tif(savedItems != null && savedItems != \"\"){\n\t\tfavItemsIndex = savedItems.split(',').map(x => parseInt(x));\n\t\tupdateFavList();\n\t}\n}", "title": "" }, { "docid": "8cc20df8260e6044c3619f9412c15ae1", "score": "0.58516186", "text": "function populateStorage() {\n\n localStorage.setItem('searchValue', document.getElementById('searchbar').value);\n if(document.getElementById('searchbar').length > 0)\n {\n setStyles();\n }\n}", "title": "" }, { "docid": "6d1c0e6db2879918821057ee7e21efc0", "score": "0.5845348", "text": "function retrieveFilters() {\t\t\t\r\n\t\t\t\r\n\t\t\tif($navigator.getViewParams().OperationsToSigningView &&\r\n\t\t\t\t$navigator.getViewParams().OperationsToSigningView.filterData &&\r\n\t\t\t\t$navigator.getViewParams().OperationsToSigningView.filterData.id) {\r\n\t\t\t\t\t\r\n\t\t\t\tfilters = {\r\n\t\t\t\t\ttypeOperation: $navigator.getViewParams().OperationsToSigningView.filterData\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tpage = $navigator.getViewParams().OperationsToSigningView.page;\r\n\t\t \r\n\t\t\t\t$timeout(function() {\r\n\t\t\t\t\t$filtersAlert.showAlertPendingOperations({\r\n\t\t\t\t\t\ttypeOperation: filters.typeOperation\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t$dropdownList.defaultTypeOperation(null, filters.typeOperation.id);\r\n\t\t\t\t}, 500);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "c3556d092f08f1a063c6148a831fe574", "score": "0.58411187", "text": "function getItemsFromLS() {\n if (localStorage.getItem('items')===null) {\n items = [];\n }else {\n items = JSON.parse(localStorage.getItem('items'));\n }\n\n return items;\n}", "title": "" }, { "docid": "fdf261303b05262bea1c34c4f30bacae", "score": "0.58268774", "text": "function getItemsfromlocal(){\r\n let items; \r\n //get Item \r\n if(localStorage.getItem('items') === null ){\r\n return items = []\r\n }else{\r\n items = JSON.parse(localStorage.getItem('items'))\r\n console.log(\"items---------------------------------------\");\r\n console.log(items);\r\n console.log(\"items---------------------------------------\");\r\n }\r\n return items; \r\n}", "title": "" }, { "docid": "bb197469f7c6a36e0089dec84dad946d", "score": "0.5826807", "text": "function eventsFiltern() {\n let events = document.querySelectorAll('.festivals__item'); // Alle Festival-Einträge\n let genreCheckbox = document.querySelectorAll('.filter__genres-item-checkbox'); // Alle Festival-Filter\n // Wenn Genres in LocalStorage gespeichert, folgenden Code ausführen:\n if (localStorage.getItem('genres') && JSON.parse(localStorage.getItem('genres')).length != 0) {\n for (var i = 0; i < events.length; i++) {\n // Zuerst alle Events ausblenden\n events[i].classList.add('notvisible');\n }\n function eventsClassHandler(element) {\n if (element.checked) {\n let genreItems = document.querySelectorAll('.' + element.id);\n genreItems.forEach(element => {\n element.classList.remove('notvisible');\n });\n }\n };\n genreCheckbox.forEach(element => {\n eventsClassHandler(element);\n });\n } else {\n // Wenn Localstorage leer ist, folgenden Code ausführen:\n for (var i = 0; i < events.length; i++) {\n // alle Events einblenden, da nichts gespeichert\n events[i].classList.remove('notvisible');\n };\n };\n setTimeout(checkIfNoFestivals(), 500);\n}", "title": "" }, { "docid": "6214604c6132a903b3dd5c0167f719b6", "score": "0.5825022", "text": "function getItems() {\n var storedHistory = JSON.parse(localStorage.getItem(\"searchHistory\"));\n if (storedHistory !== null) {\n searchHistory = storedHistory;\n }\n\n // For loop that will list a maximum of 8 items in Search History\n for (i = 0; i < searchHistory.length; i++) {\n if (i == 8) {\n break;\n }\n\n // Creates list items as links for locally stored data as the output in Search History\n // Gets locally stored data for it to persist\n historyButton = $(\"<a>\").attr({\n class: \"list-group-item list-group-item-action\",\n href: \"#\",\n });\n\n historyButton.text(searchHistory[i]);\n $(\"#searchList\").append(historyButton);\n }\n}", "title": "" }, { "docid": "0c0b196d0d730b4bf2193a90f7986d01", "score": "0.58213747", "text": "function updateLocal() {\n localStorage.setItem(\"SearchHistory\", JSON.stringify(searchHistory));\n}", "title": "" }, { "docid": "a9592dbc1b438a3f0eadd1f1857c02af", "score": "0.582095", "text": "function getStorage() {\r\n\treturn JSON.parse(localStorage.getItem('todoList')) || [];\r\n}", "title": "" }, { "docid": "433813a2ba2678ec8d8c61b62ea2e017", "score": "0.58120465", "text": "function localList() {\n var localButton = JSON.parse(localStorage.getItem('button'));\n\n\n buttons = localButton;\n }", "title": "" }, { "docid": "cec85cd184f6a1e32b287a66c91fcd79", "score": "0.5804667", "text": "function checknInLocalStorage(){\n return localStorage.getItem('li') ? JSON.parse(localStorage.getItem('li')) : []\n}", "title": "" }, { "docid": "3319d81d2f9fa7cbd264249406e772cf", "score": "0.57850474", "text": "function readLocalstorage() {\r\n clickElemID = JSON.parse(localStorage.getItem('myClickElem')) + '';\r\n usersGroups = JSON.parse(localStorage.getItem('usersGroups'));\r\n officeHours = JSON.parse(localStorage.getItem('officeHours'));\r\n localStorage.removeItem('myClickElem');\r\n}", "title": "" }, { "docid": "133346f7cc42278ef0ddaa6643cb065d", "score": "0.57847524", "text": "getLists() {\n let saved = JSON.parse(localStorage.getItem('list'))\n if (saved) {\n _state.list = saved;\n }\n }", "title": "" }, { "docid": "1124bfc171be0163fe7000f9a1f24199", "score": "0.5783127", "text": "function cargaLs() {\r\n if (localStorage.getItem(\"favLs\") != null) {\r\n favoritos = JSON.parse(localStorage.getItem(\"favLs\"));\r\n }\r\n}", "title": "" }, { "docid": "857a309f17a40cb26d5b98f02700a574", "score": "0.578072", "text": "getAllItems() {\n var list = new Array();\n for (var i = 0; i < localStorage.length; i++) {\n var key = localStorage.key(i);\n var value = localStorage.getItem(key);\n list.push(new StorageItem({\n key: key,\n value: value\n }));\n }\n return list;\n }", "title": "" }, { "docid": "edb4eb4894becd72bf5b96d22542e63f", "score": "0.5778396", "text": "function getlocalStorage(storage_name){\n\t\n\tlet mostrar = localStorage.getItem(storage_name);\n\tlet listos = JSON.parse(mostrar);\n\treturn listos\n}", "title": "" }, { "docid": "a4251b82be6257d28e0b911fff0338e5", "score": "0.5776585", "text": "function getList() {\n var storedList = localStorage.getItem('localList');\n if (storedList === null) {//si no hay nada se resetea con corchetes vacios\n list = [];\n } else {//si hay informacion se parsea el texto retomando los datos del LS\n list = JSON.parse(storedList); //de texto vuelve al formato que tenia\n }\n return list;\n }", "title": "" }, { "docid": "28da92a64c1c93283ec9c5544277a567", "score": "0.5766471", "text": "function loadFilterVals() {\n var filterJSON = null;\n $.ajax({\n 'url':\"data/filterText\"+suffix+\".json\",\n 'success': function(data) {filterJSON=data;},\n 'async': false,\n 'global': false,\n 'dataType': \"json\"});\n return filterJSON;\n }", "title": "" }, { "docid": "c4f7da1d24c8790b612208e4350e6ac2", "score": "0.5765731", "text": "function filterStoring(){\n if (myLocal.userInfo != null){\n newPage();\n }\n if (mySession.filters == null){\n return;\n } else {\n mySessionJson = sessionParser()\n sidebarPop()\n accordionPops(mySessionJson)\n for (i in mySessionJson){\n var curr = mySessionJson[i]\n for (j in curr){\n if (document.getElementById(curr[j]) != null){\n document.getElementById(curr[j]).checked = true;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "38882acf402b8801d3521a2a14da0e79", "score": "0.57645", "text": "function setLocalStorage() {\r\n localStorage.setItem(\"favoritesList\", JSON.stringify(favoritesList)); // change data from json to string\r\n}", "title": "" }, { "docid": "1b28df33fe12a9b40bf7aaa6df0bcf91", "score": "0.5754697", "text": "function _getLocalStorage() {\n return JSON.parse(window.localStorage.getItem(STORE_KEY)) || {};\n }", "title": "" }, { "docid": "d7f5a0ba6924aa97793e606371996065", "score": "0.5746942", "text": "function getItemsFromLocalStorage(){\n\n if(localStorage.getItem('items')===null){ // items içi boşsa dizi haline getirelim\n items = [];\n }else{\n items = JSON.parse(localStorage.getItem('items')); // items içi doluysa Json parsa ile dönüştürelim \n }\n return items;\n}", "title": "" }, { "docid": "64fb2402299581515c916a70d86fe1fd", "score": "0.57437897", "text": "getLists() {\n let saved = JSON.parse(localStorage.getItem('lists'))\n if (saved) {\n _state.lists = saved;\n }\n }", "title": "" }, { "docid": "64fb2402299581515c916a70d86fe1fd", "score": "0.57437897", "text": "getLists() {\n let saved = JSON.parse(localStorage.getItem('lists'))\n if (saved) {\n _state.lists = saved;\n }\n }", "title": "" }, { "docid": "92e42ac53993762568db9e47ff658587", "score": "0.5732758", "text": "function clearState() {\n if (localStorageAvailable()) {\n localStorage.removeItem('filterizer-' + window.location);\n }\n\n triggerEvent('filterizer.clearstate');\n }", "title": "" }, { "docid": "8b5f8652c15ada5330b385904d439387", "score": "0.5729456", "text": "function getFavorites() {\n if (localStorage)\n if (localStorage.getItem('favorites'))\n return JSON.parse(localStorage.getItem('favorites'));\n return [];\n}", "title": "" }, { "docid": "eb0f9213a1b8abc0e108dd8072c9913f", "score": "0.5728386", "text": "getLocalData() {\n let eleId = this.getModuleName() + this.element.id;\n if (versionBasedStatePersistence) {\n return window.localStorage.getItem(eleId + this.ej2StatePersistenceVersion);\n }\n else {\n return window.localStorage.getItem(eleId);\n }\n }", "title": "" }, { "docid": "f4acc0ff9e2959f698365dd5a840a229", "score": "0.5726195", "text": "function getLocalStorage() {\n const cart = JSON.parse(localStorage.getItem('cart'));\n if (cart) return cart;\n return [];\n}", "title": "" }, { "docid": "aaf347b2185bb2207f0115a47d04a67e", "score": "0.57260096", "text": "function getItemsFromLS(){\n let items = localStorage.getItem('items')\n return (items) ? JSON.parse(items) : []\n}", "title": "" }, { "docid": "be4937fbfb665a7ac5071843f5219ddf", "score": "0.5718757", "text": "function storageCitySearchHistory () {\n localStorage.setItem(\"citySearchHistoryList\", JSON.stringify(citySearchHistoryList));\n}", "title": "" }, { "docid": "6bbe4356c2a66f02e0be18fe1f891ae6", "score": "0.5714333", "text": "function getFavorites(){\n let localFav = JSON.parse(localStorage.getItem(\"favorites\"));\n if (localFav == null){\n return []\n }else{\n return localFav;\n }\n }", "title": "" }, { "docid": "c87a589a208cd72fd5dc49a2638dde07", "score": "0.5710986", "text": "function getItems() {\r\n\r\n var items = {};\r\n var keys = Object.keys(localStorage);\r\n var i = keys.length;\r\n\r\n while (i--) {\r\n var key = keys[i];\r\n items[key] = get(key);\r\n }\r\n\r\n return items;\r\n\r\n}", "title": "" }, { "docid": "d041de5e32d5f97ab7a6f552d4eed9a6", "score": "0.5700467", "text": "function setLocalStorage() {\n localStorage.setItem(\"LocalStorageList\", JSON.stringify(arrFavoriteList));\n}", "title": "" }, { "docid": "4367c3802b5c9396a962e0a720544cdd", "score": "0.5698552", "text": "initEventHandlers() {\n this.defaultFilterBy.forEach((elem) =>\n elem.addEventListener(\"change\", (event) =>\n window.localStorage.setItem(\n \"satisDefaultFilterBy\",\n event.target.value\n )\n )\n );\n this.useThisField.addEventListener(\"change\", (event) =>\n window.localStorage.setItem(\"satisUseThisField\", event.target.value)\n );\n this.activeFilter.addEventListener(\"change\", (event) =>\n window.localStorage.setItem(\"satisActiveFilter\", event.target.value)\n );\n }", "title": "" }, { "docid": "b08607c198d2fbd6a97b9eaead9cfa4a", "score": "0.56883955", "text": "load (){\n return JSON.parse(localStorage.getItem(STORAGE_KEY)||'[]')\n }", "title": "" }, { "docid": "4a09fb2cf8bc075856b02d59777f56f0", "score": "0.5687977", "text": "function Store() {\n this.searches = [];\n this.searches = JSON.parse(localStorage.getItem(local_storage_key)) || [];\n\n this.update = function (search) {\n this.searches.push(search);\n localStorage.setItem(local_storage_key, JSON.stringify(this.searches));\n };\n\n this.get = function() {\n return JSON.parse(localStorage.getItem(local_storage_key)) || [];\n }\n }", "title": "" }, { "docid": "0c27e2d6173906c1eab18de14bc6747e", "score": "0.56871474", "text": "static getAllEntries () {\n if (this.isStorageAvailable) {\n const datasetJson = storage.getItem(storeKey)\n\n // Check if json is empty, return empty array in that case\n if (datasetJson == null) {\n return []\n }\n const dataset = JSON.parse(datasetJson)\n return dataset\n } else {\n console.log('Could not load persisted data, browser does not support local storage')\n }\n }", "title": "" }, { "docid": "f1bdc37abaad686f49fd9277208353f9", "score": "0.5678475", "text": "function onFilterJS() {\n filterJS = !filterJS;\n list.load(getFilters());\n const el = document.querySelector('.jsButton');\n if (el) el.classList.toggle('selected');\n}", "title": "" }, { "docid": "473adf66cbfb00e3b0dd099209be7cf6", "score": "0.5677055", "text": "function loadLocalStorage() {\n let localTimeEvent = JSON.parse(localStorage.getItem(\"timeEvents\"));\n // if there is local storage sets timeEvents to localTimeEvents\n if (localTimeEvent) {\n timeEvents = localTimeEvent;\n }\n}", "title": "" }, { "docid": "7f527fbfc344de95c23e816f64822ebf", "score": "0.56757325", "text": "function getFromLocalStorage() {\n let shop;\n // get array of local storage\n if (localStorage.getItem('shops')) {\n shop = JSON.parse(localStorage.getItem('shops'))\n\n } else {\n shop = []\n }\n return shop\n}", "title": "" }, { "docid": "40cf66ca9e2cea641c5220934ce4ef77", "score": "0.56739277", "text": "function getPrFromLocal() {\n if (typeof (Storage) !== \"undefined\") {\n var list = [];\n if (localStorage.getItem('product')) {\n list = JSON.parse(localStorage.getItem(\"product\"));\n }\n else {\n $(\"#f-nothing-prd\").show();\n $(\".f-pay-money\").hide();\n $(\".body-prd\").css(\"width\",\"100%\");\n\n }\n return list;\n }\n else {\n alert('Trình duyệt của bạn đã quá cũ. Hãy nâng cấp trình duyệt ngay!');\n }\n}", "title": "" }, { "docid": "209a4a43635d7e99acd63998351f9df4", "score": "0.5673357", "text": "function recuperarLS() { return JSON.parse(localStorage.getItem('msj')); }", "title": "" }, { "docid": "162f4f544a5068eed675fca15a31f689", "score": "0.56699383", "text": "function searchResidence() {\n var searchVal = document.getElementById(\"inputSearch\").value;\n localStorage.searchVal = searchVal;\n\n var searchArea = document.getElementById(\"inputArea\").value;\n localStorage.searchArea = searchArea;\n\n var searchCity = document.getElementById(\"inputCity\").value;\n localStorage.searchCity = searchCity;\n\n}", "title": "" }, { "docid": "47278b2398bf059a8395a36a4121ab0a", "score": "0.5669654", "text": "getDataFromStorage() {\n const storage = JSON.parse(localStorage.getItem('saved'));\n // Test whether there is a storage or not otherwise it will return null\n if (storage) {\n // If there is data, then we just reset vault items with the ones from storage. \n this.saved = storage;\n }\n }", "title": "" }, { "docid": "cd14fae963f0c0e9e8ec0727ffae2691", "score": "0.56679004", "text": "function favoriteList() {\n let favoriteSearches = JSON.parse(localStorage.getItem(\"favorite searches\")) || [];\n let artistName = (document.getElementById(\"searchBar\").value);\n if (favoriteSearches.indexOf(artistName) === -1){\n favoriteSearches.push(artistName);\n }\n\n localStorage.setItem(\"favorite searches\", JSON.stringify(favoriteSearches));\n // console.log(favoriteSearches);\n searchHistory();\n}", "title": "" }, { "docid": "4be18a65d4c890f4e2f03a6c888ca91f", "score": "0.56661105", "text": "function localStorageOnLoad() {\n let cityList = getCityFromLocalStorage();\n console.log(cityList);\n\n for (let i = 0; i < cityList.length; i++) {\n const city = cityList[i];\n console.log(city);\n\n //$('#searchList').html(city);\n\n const removeCityBtn = document.createElement(\"a\");\n removeCityBtn.classList = \"remove-city\";\n removeCityBtn.textContent = \"X\";\n\n const li = document.createElement(\"li\");\n li.textContent = city;\n\n // Stage 6: adding the removeCityBtn to the searchedCitiesList\n li.append(removeCityBtn);\n\n // add to the list\n $(\"#searchList\").append(li);\n }\n }", "title": "" }, { "docid": "03d197e20083e6240cae77dd33de01fa", "score": "0.5664783", "text": "function getLocalStorageData() {\n //User first and last name entered into header via userName\n var users = JSON.parse(localStorage.getItem(\"users\"));\n // get current user from local storage\n var events = JSON.parse(localStorage.getItem(\"events\"));\n}", "title": "" }, { "docid": "a2d8bb8f2772c95afaaafb2fca940242", "score": "0.56499416", "text": "function storeSearch() {\n localStorage.setItem(\"searched\", JSON.stringify(searched));\n}", "title": "" }, { "docid": "ab65bb956d74a347b37f263cfd43de22", "score": "0.564579", "text": "function loadProducts() {\n let productsList = JSON.parse(localStorage.getItem(\"productsList\"));\n if (productsList == null) {\n return [];\n } else {\n return productsList;\n }\n}", "title": "" }, { "docid": "17676efe943c5abf216d3fab983c52c4", "score": "0.56415904", "text": "function getFilters() {\n let filters = '{}';\n const urlParts = document.location.pathname.split('/');\n try {\n filters = JSON.parse(decodeURIComponent(urlParts[urlParts.length - 1]));\n } catch (e) {\n filters = '{}';\n }\n if (typeof filters === 'object') {\n filters = JSON.stringify(filters);\n } else {\n filters = '{}';\n }\n return filters;\n}", "title": "" }, { "docid": "17676efe943c5abf216d3fab983c52c4", "score": "0.56415904", "text": "function getFilters() {\n let filters = '{}';\n const urlParts = document.location.pathname.split('/');\n try {\n filters = JSON.parse(decodeURIComponent(urlParts[urlParts.length - 1]));\n } catch (e) {\n filters = '{}';\n }\n if (typeof filters === 'object') {\n filters = JSON.stringify(filters);\n } else {\n filters = '{}';\n }\n return filters;\n}", "title": "" }, { "docid": "279ff6b9f499b65fbd6afbc7a62ff0fc", "score": "0.563551", "text": "returnValue() {\n suggestions = JSON.parse(localStorage.getItem(btoa('search_data')));\n }", "title": "" }, { "docid": "462a94c4c8048c4abbc28aed5b1ad305", "score": "0.56336045", "text": "function init() {\n// Get stored cities from localStorage\nvar storedCities = JSON.parse(localStorage.getItem(\"cityName\"));\n\n// If cities were retrieved from localStorage\nif (storedCities !== null) {\n cityNames = storedCities;\n}\n\n// This is a helper function that will render cities to the DOM\nrenderCities();\n}", "title": "" } ]
6bebd3889e8910e92953f3121832796c
constructor call automatically but constructor doesnt rreturn anything
[ { "docid": "47d58030a2306c242b588e65bff35f04", "score": "0.0", "text": "constructor(a,b){\n this.frstnmbr =a\n this.scndnmbr = b;\n\n }", "title": "" } ]
[ { "docid": "9b6cde66c4752b670374bb5219aea8e5", "score": "0.7840098", "text": "constructor() { return; }", "title": "" }, { "docid": "9b6cde66c4752b670374bb5219aea8e5", "score": "0.7840098", "text": "constructor() { return; }", "title": "" }, { "docid": "29309d242b1774a419f3a30357cf2b00", "score": "0.7804668", "text": "function Ctor(){}", "title": "" }, { "docid": "59d3beeaa84f482085e491e2542c80f9", "score": "0.7647164", "text": "constructor() {\n\t\t//\n\t}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7632623", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7632623", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7632623", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7632623", "text": "constructor(){}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.7450166", "text": "function Ctor() {}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.7450166", "text": "function Ctor() {}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.7450166", "text": "function Ctor() {}", "title": "" }, { "docid": "909bd4ee65523817bac81c65f4b8dfb3", "score": "0.73910236", "text": "constructor(){\n\t}", "title": "" }, { "docid": "c72b2ed1f88f7a0e5341ebeb965369c6", "score": "0.7367588", "text": "constructor(){\n //Empty Constructor\n }", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.73663604", "text": "constructor() {}", "title": "" }, { "docid": "3664ba3504ef155297b04945cba468f1", "score": "0.7354377", "text": "constructor() {\n // declare our class properties\n // call init\n this.init();\n }", "title": "" }, { "docid": "391a0e74106f023a918bf20204d79b4d", "score": "0.7313723", "text": "constructor() {\n // declare our class properties\n\n // call init\n this.init();\n }", "title": "" }, { "docid": "d70a588c9c8603d0d6763381e733fdbd", "score": "0.73078126", "text": "constructor( ) {}", "title": "" }, { "docid": "9851e8df41445356787eb1b2d399c104", "score": "0.7244939", "text": "constructor()\n {}", "title": "" }, { "docid": "e43cc8aff0c0a266f57933830f0f8d25", "score": "0.7236189", "text": "constructor(){\n\n }", "title": "" }, { "docid": "e43cc8aff0c0a266f57933830f0f8d25", "score": "0.7236189", "text": "constructor(){\n\n }", "title": "" }, { "docid": "3eeff0117597e685aa9853fc454a85ca", "score": "0.715964", "text": "function Ctor() {\n}", "title": "" }, { "docid": "28ac5520325b548b0551c934e7165a41", "score": "0.7116301", "text": "constructor() {\n\t super();\n\t }", "title": "" }, { "docid": "29455e2b194fc092fdbb545236840f03", "score": "0.7104216", "text": "constructor() {\n // do nothing\n }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7091177", "text": "constructor() { }", "title": "" }, { "docid": "342ae19702f60fcf49f04b7fa2cf29b8", "score": "0.70856595", "text": "constructor(a) {\n if (a === undefined) {\n this.constructor0();\n } else {\n this.constructor1(a);\n }\n }", "title": "" }, { "docid": "b051776c4a331e59a98728903a7dc95a", "score": "0.70818007", "text": "initialize(){}", "title": "" }, { "docid": "57eb0dae55206821eb04e46a89693c11", "score": "0.7081232", "text": "function TempCtor() {}", "title": "" }, { "docid": "ded051485897ee2404864029fbba35ff", "score": "0.7074461", "text": "constructor(arg) {}", "title": "" }, { "docid": "3a0df0814032bf6fe65ab66f00f794d1", "score": "0.7071519", "text": "function tempCtor() {}", "title": "" }, { "docid": "a14a82fc30745b59820199a46d30b5e7", "score": "0.70646584", "text": "constructor(_) { return (_ = super(_)).init(), _; }", "title": "" }, { "docid": "571fea20efadbf48175fc5efee96a62e", "score": "0.7044487", "text": "constructor() {\n this.init();\n }", "title": "" }, { "docid": "571fea20efadbf48175fc5efee96a62e", "score": "0.7044487", "text": "constructor() {\n this.init();\n }", "title": "" }, { "docid": "60485d8260f929848a6739b99793201a", "score": "0.7041685", "text": "constructor()\n {\n super();\n this.init();\n\n }", "title": "" }, { "docid": "762157313ca2bf2e3dbd5a7d53fc5051", "score": "0.7035474", "text": "constructor()\n {\n\n\n\n }", "title": "" }, { "docid": "86e56995127472c4a50a0757fa324610", "score": "0.7015209", "text": "constructor(){\n\n }", "title": "" }, { "docid": "86e56995127472c4a50a0757fa324610", "score": "0.7015209", "text": "constructor(){\n\n }", "title": "" }, { "docid": "7bb6a805035b581c343be95de63a1fd2", "score": "0.6998413", "text": "initialize() {\n // Pseudo-constructor\n }", "title": "" }, { "docid": "2616fe81e5212ad9c3365d2c85edbbd3", "score": "0.6997785", "text": "constructor() \n { \n \n }", "title": "" }, { "docid": "8c8bad128aa02d98f9601396d3520e51", "score": "0.6988054", "text": "constructor() {\n \n \n return this;\n }", "title": "" }, { "docid": "68469dc1feafde8c1ba5853b4aefabdb", "score": "0.6980679", "text": "constructor() {\n void 0;\n }", "title": "" }, { "docid": "b24a7239269fcd53f66c091b7c2c0115", "score": "0.69555587", "text": "constructor() {\n \n }", "title": "" }, { "docid": "bba930b6cd4675683606b7f5a09be2ed", "score": "0.69523185", "text": "constructor (){\n\n }", "title": "" }, { "docid": "254dccd7c058e6d30f7c95013df9dd36", "score": "0.6941265", "text": "function ctor() {\n return function(){};\n }", "title": "" }, { "docid": "1b86c8a22a97dcf445a2305ea10aea8f", "score": "0.69209445", "text": "constructor () {\n super(0, 1)\n }", "title": "" }, { "docid": "558f1e2010c89907f057aed713ce6437", "score": "0.6918529", "text": "constructor()\n{\n}", "title": "" }, { "docid": "3a2943e8e3abc5a88438c127731dc588", "score": "0.6897751", "text": "constructor(...args) {\n super(...args);\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.6893367", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.6893367", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.6893367", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.6893367", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.6893367", "text": "constructor() {\n }", "title": "" } ]
2ddc21389aa728e2f27d44cf2cdbfeb5
Case reducer for adding a cuisine
[ { "docid": "383f746ccd4096ae5be07d376ec92d8d", "score": "0.66273504", "text": "function addCuisine(state = initialState.cuisines, action) {\n return state.concat(action.payload.name);\n}", "title": "" } ]
[ { "docid": "3315cdc13b7797e08963c1bbcf7d4760", "score": "0.645051", "text": "function cuisinesReducer(state = initialState.cuisines, action) {\n switch (action.type) {\n case ActionTypes.dietaryPreferences.ADD_CUISINE:\n return addCuisine(state, action);\n\n case ActionTypes.dietaryPreferences.REMOVE_CUISINE:\n return removeCuisine(state, action);\n\n case ActionTypes.dietaryPreferences.REMOVE_ALL_CUISINES:\n return removeAllCuisines(state, action);\n\n default:\n return state;\n }\n}", "title": "" }, { "docid": "f651fd887c1580758a192be3781141b9", "score": "0.5372896", "text": "function addCase(type, selectedCase) { \n return selectedCase + type;\n}", "title": "" }, { "docid": "b52863dcbdd833921aa8637138399d3e", "score": "0.51500726", "text": "function applyIcuSwitchCase(tView, tIcus, tICuIndex, lView, value) {\n applyIcuSwitchCaseRemove(tView, tIcus, tICuIndex, lView);\n // Rebuild a new case for this ICU\n let caseCreated = false;\n const tIcu = tIcus[tICuIndex];\n const caseIndex = getCaseIndex(tIcu, value);\n lView[tIcu.currentCaseLViewIndex] = caseIndex !== -1 ? caseIndex : null;\n if (caseIndex > -1) {\n // Add the nodes for the new case\n applyCreateOpCodes(tView, -1, // -1 means we don't have parent node\n tIcu.create[caseIndex], lView);\n caseCreated = true;\n }\n return caseCreated;\n}", "title": "" }, { "docid": "019c9e725f6985f065a0ba11f84414f5", "score": "0.5132414", "text": "addAccidentals(note){\n var noteWithAccidental = note;\n if(this.numberOfSharps > 0){\n for(var i = 0; i < this.numberOfSharps; i++){\n if(note === this.sharps[i]){\n noteWithAccidental = note.concat(\"#\");\n }\n }\n\n }else if(this.numberOfFlats > 0){\n\n for(var i = 0; i < this.numberOfFlats; i++){\n if(note === this.flats[i]){\n if(note === \"H\"){\n noteWithAccidental = \"B\";\n } else{\n noteWithAccidental = note.concat(\"b\");\n }\n }\n }\n }\n return noteWithAccidental;\n }", "title": "" }, { "docid": "81326d74380b0673901b4543e29fc425", "score": "0.51279724", "text": "function counterReducer(state = initialState, action) {\n const { type, payload } = action\n switch (type) {\n case ADD_ONE:\n\n return state = {\n count: state.count + payload.num,\n msg: payload.msg\n }\n\n default:\n return state;\n }\n}", "title": "" }, { "docid": "9c2dda2032d40c26de27eb321309a446", "score": "0.497597", "text": "function applyIcuSwitchCase(tView, tIcu, lView, value) {\n // Rebuild a new case for this ICU\n var caseIndex = getCaseIndex(tIcu, value);\n var activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n\n if (activeCaseIndex !== caseIndex) {\n applyIcuSwitchCaseRemove(tView, tIcu, lView);\n lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;\n\n if (caseIndex !== null) {\n // Add the nodes for the new case\n var anchorRNode = lView[tIcu.anchorIdx];\n\n if (anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);\n }\n }\n }\n }", "title": "" }, { "docid": "363cdbdb4fb2eb647f1583108d2bf750", "score": "0.4950097", "text": "changeCupValue(cup) {\n this.state.cupValues[cup.id] = cup;\n }", "title": "" }, { "docid": "7d1534121d4930cdd1a311400181d151", "score": "0.49337342", "text": "function applyIcuSwitchCase(tView, tIcu, lView, value) {\n // Rebuild a new case for this ICU\n const caseIndex = getCaseIndex(tIcu, value);\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== caseIndex) {\n applyIcuSwitchCaseRemove(tView, tIcu, lView);\n lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;\n if (caseIndex !== null) {\n // Add the nodes for the new case\n const anchorRNode = lView[tIcu.anchorIdx];\n if (anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);\n }\n }\n }\n}", "title": "" }, { "docid": "7d1534121d4930cdd1a311400181d151", "score": "0.49337342", "text": "function applyIcuSwitchCase(tView, tIcu, lView, value) {\n // Rebuild a new case for this ICU\n const caseIndex = getCaseIndex(tIcu, value);\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== caseIndex) {\n applyIcuSwitchCaseRemove(tView, tIcu, lView);\n lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;\n if (caseIndex !== null) {\n // Add the nodes for the new case\n const anchorRNode = lView[tIcu.anchorIdx];\n if (anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);\n }\n }\n }\n}", "title": "" }, { "docid": "eaeca517e8f76a2d480ae76ad4edaf93", "score": "0.4844766", "text": "function removeCuisine(state = initialState.cuisines, action) {\n return state.filter((name) =>\n name !== action.payload.name\n );\n}", "title": "" }, { "docid": "2b046c288ec861c19237cb64d48b1315", "score": "0.48390445", "text": "renderCuisineInfo() {\n const {base_cuisine, fuse_cuisine} = this.props;\n\n if (fuse_cuisine === null || fuse_cuisine === 'None') {\n return (\n <>{base_cuisine}</>\n );\n }\n else {\n return (\n <>{base_cuisine}, {fuse_cuisine}</>\n );\n }\n }", "title": "" }, { "docid": "754fcb823f642965c9a59ad3052c1de2", "score": "0.48290673", "text": "function sumarAño(coche){\n\n return {\n ...coche,\n annio:coche.annio + 1\n }\n\n}", "title": "" }, { "docid": "1e7389ccef2f7f4eee4510ad78dbf87a", "score": "0.47838208", "text": "function reducer(state = initialStore, action) {\n switch (action.type) {\n case CLEAR_CART:\n return { ...state, cart: [] }\n case INCREASE: {\n console.log('you increased')\n // crease a new array\n let tempCart = state.cart.map((cartItem) => {\n if (cartItem.id === action.payload.id) {\n return { ...cartItem, amount: cartItem.amount + 1 }\n }\n return cartItem\n })\n return { ...state, cart: tempCart }\n }\n case DECREASE: {\n console.log('you decreased')\n let tempCart = state.cart.map((cartItem) => {\n if (cartItem.id === action.payload.id) {\n return { ...cartItem, amount: cartItem.amount - 1 }\n }\n if (cartItem.amount <= 0) {\n }\n return cartItem\n })\n\n return {\n ...state,\n cart: tempCart,\n }\n }\n case REMOVE: {\n console.log('removed')\n return {\n ...state,\n cart: state.cart.filter(\n (cartItem) => cartItem.id !== action.payload.id\n ),\n }\n }\n case GET_TOTALS: {\n console.log('get total')\n let { total, amount } = state.cart.reduce(\n // gia tri thang du, gia tri moi vong lap\n (cartTotal, cartItem) => {\n const { price, amount } = cartItem\n const itemTotal = price * amount\n cartTotal.total += itemTotal\n\n cartTotal.amount += amount\n return cartTotal\n },\n {\n total: 0,\n amount: 0,\n }\n )\n // only get 2 digit after ,\n total = parseFloat(total.toFixed(2))\n return { ...state, total, amount }\n }\n case TOGGLE_AMOUNT: {\n return {\n ...state,\n cart: state.cart.map((cartItem) => {\n // if (cartItem.id !== action.payload.id) return cartItem\n // if (action.payload.toggle === 'inc') {\n // console.log('inc')\n // return (cartItem = { ...cartItem, amount: cartItem.amount + 1 })\n // // return cartItem\n // }\n // if (action.payload.toggle === 'dec') {\n // console.log('dec')\n // return (cartItem = { ...cartItem, amount: cartItem.amount - 1 })\n // // return cartItem\n // }\n if (cartItem.id === action.payload.id) {\n if (action.payload.toggle === 'inc') {\n return (cartItem = { ...cartItem, amount: cartItem.amount + 1 })\n }\n if (action.payload.toggle === 'dec') {\n return (cartItem = { ...cartItem, amount: cartItem.amount - 1 })\n }\n }\n return cartItem\n }),\n }\n }\n default:\n return state\n }\n}", "title": "" }, { "docid": "0b191c0c27ea6584bf2577da9b6ab19c", "score": "0.47136137", "text": "function reducer(total,currentValue){\n return total+currentValue;\n}", "title": "" }, { "docid": "55dd50229d6efc24df5b8502fdc6bc4b", "score": "0.46963894", "text": "function RemapAdd(cp, pos)\n\t{ // Remap adding on 3 element vector\n\t\treturn cp.map(function (p) {return [(p[0]+pos[0]), (p[1]+pos[1]), (p[2]+pos[2])]});\n\t}", "title": "" }, { "docid": "25ffa41ea274cc6f80b1d779707b3afc", "score": "0.4692892", "text": "enterOC_UnaryAddOrSubtractExpression(ctx) {}", "title": "" }, { "docid": "2ca1553c802728061ac130a818ce13fc", "score": "0.46749344", "text": "function accumulateChakra(element) {\n switch (element) {\n case \"water\":\n current += water;\n break;\n case \"earth\":\n current += earth;\n break;\n case \"fire\":\n current += fire;\n break;\n case \"air\":\n current += air;\n break;\n default:\n alert('function \"accumulateChakra\" broke');\n break;\n }\n $(\"#current\").text(\"Spiritual Energy: \" + current);\n}", "title": "" }, { "docid": "c63e5a905f194bda694ee50d7e90f43f", "score": "0.4673525", "text": "function reduceNIdentifiedAdd(p,v) {\n if (v['status'] == \"Not identified\")\n p.status += +1;\n return p;\n }", "title": "" }, { "docid": "08fb2a77c1f3dd741b383ffae8f802a7", "score": "0.46540436", "text": "function counterReducer(state = initialState, action) {\n switch (action.type) {\n case INCREMENTED:\n return {\n ...state,\n value: state.value + 1\n };\n case DECREMENTED:\n return {\n ...state,\n value: state.value - 1\n };\n default:\n return state;\n }\n}", "title": "" }, { "docid": "beb880ce4e0620ec59a554fce0b90e4d", "score": "0.4642759", "text": "function addSauces(sauce) {\n \n if (checkExistionAdding(sauce,sauces)) {\n return `Sorry but this sauce doesn't exists`;\n }\n\n for (let key in sauces) {\n if (key === sauce) {\n pizza.sauces.push(key);\n }\n }\n return \"sauce succesfully added\"\n}", "title": "" }, { "docid": "a704c2eec685d86863be3d1db462840c", "score": "0.46399054", "text": "function counterReducer(count, event) {\n switch (event.type) {\n case \"INC\":\n return count + 1;\n case \"DEC\":\n return count - 1;\n default:\n return count;\n }\n}", "title": "" }, { "docid": "06a2cc141cdec4a67c51f9f4dc2eb50f", "score": "0.46351537", "text": "function addToCauldron(item) {\n\n // check if item is addable\n if (items[item].count == 0) {\n return;\n }\n if (typeof items[item] == \"undefined\") {\n throw \"in addToCauldron, item \" + item + \" does not exist!\"\n }\n\n // remove item / update item count\n if (!items[item].infinite) {\n substractItem(item)\n }\n \n cauldron.push(items[item])\n let unixTime = new Date().getTime() / 1000\n cauldron.push(unixTime)\n\n lookForRecipe(cauldron)\n\n saveEverything()\n}", "title": "" }, { "docid": "676cdd88ae38a35fd3a6ab1e5929b10b", "score": "0.46137106", "text": "function parseAddExpCont(stream) {\n var startPos = stream.position;\n var ans;\n try { // \"+\" MulExp AddExpCont\n stream.consumeChar('+');\n var me = parseMulExp(stream);\n var aeCont = parseAddExpCont(stream);\n \n ans = makeAstNode('addExpCont');\n ans.children.push(me);\n ans.children.push(aeCont);\n } catch (e) { // epsilon\n //if (e instanceof ConsumeError) {\n // throw e;\n //}\n stream.position = startPos;\n ans = makeAstNode('addExpCont');\n }\n \n return ans;\n}", "title": "" }, { "docid": "112ebe03a8618685b90909fb18ec8c5c", "score": "0.46113294", "text": "function reducer(state = initialState, action) {\n switch (action.type) {\n case ADD_ONE:\n return {\n number: state.number + 1\n };\n case MINUS_ONE:\n return {\n number: state.number - 1\n };\n default:\n return state;\n }\n}", "title": "" }, { "docid": "3feb828904f38ebda6b34937c3f538f3", "score": "0.46066007", "text": "function vowelCount(str) {\n // console.log(str);\n const vowels = \"aeiou\";\n const splitStr = str.split(\"\");\n // console.log(splitStr);\n return splitStr.reduce(function (acc, nextLetter) {\n let lowerCase = nextLetter.toLowerCase();\n // console.log(lowerCase);\n if (vowels.indexOf(lowerCase) !== -1) {\n if (acc[lowerCase]) {\n acc[lowerCase]++;\n } else {\n acc[lowerCase] = 1;\n }\n }\n return acc;\n }, {});\n}", "title": "" }, { "docid": "8922c492adcc781fa326dadb13250a04", "score": "0.45998028", "text": "function add() {\n // trackOutput = `${currentResult} + ${userInput.value}`;\n // currentResult = currentResult + parseInt(userInput.value);\n // console.log(\"input\", trackOutput, currentResult);\n // outputResult(currentResult, trackOutput);\n operatorRule(\"add\");\n objectLogEntry(\"add\");\n}", "title": "" }, { "docid": "84983e388d02cae6b9fcc97b9340a2bc", "score": "0.45982668", "text": "function currence(state = {}, action) {\n if (action.type === 'ADD_TODO') {\n return [\n ...state,\n action.payload\n ] \n }\n\n if (action.type === 'ADD_Currency') {\n return [\n ...state,\n action.payload\n\n ] \n \n }\n\n }", "title": "" }, { "docid": "e9881466cfd0341f7805878bb238deb0", "score": "0.45940894", "text": "function addTo(input){\n return input + 3;\n}", "title": "" }, { "docid": "f33bc65f69fd6179304c61812bce04bc", "score": "0.45902553", "text": "function cambiaColore(){\n \n \n \n}", "title": "" }, { "docid": "4fd176d31adb98ddcd207112de183d8c", "score": "0.45866278", "text": "function counterReducer(state, action) {\n switch (action.type) {\n case 'INCREMET_COUNTER':\n return state + action.by;\n default:\n return 0;\n }\n}", "title": "" }, { "docid": "a3fdd3432542fb08a4a27b9f338473f7", "score": "0.45750788", "text": "function addiere(a, b, c) {\n return a + b + c;\n}", "title": "" }, { "docid": "17e9db58bc4794bc4e47eb88fe8e0102", "score": "0.4569834", "text": "function addCal(n){\n\tif(typeof n === 'number'){\n\t\tcalorieCounter.innerHTML = parseInt(calorieCounter.innerHTML) + n;\n\t}else{\n\t\tconsole.log('CC: NaN')\n\t}\n}", "title": "" }, { "docid": "cc5100980830a03781b0898f9ada4353", "score": "0.45661166", "text": "cuisineOptions() {\r\n return this.state.cuisines.map((res) => {\r\n const cuisine = res.cuisine\r\n return {\r\n label: cuisine.cuisine_name,\r\n value: cuisine.cuisine_id,\r\n }\r\n })\r\n }", "title": "" }, { "docid": "849929e6920b87083c801df74bb765ad", "score": "0.45595318", "text": "function addfyra(input) {\n return input + 1;\n}", "title": "" }, { "docid": "d70f60450b995313db88d4a37978a145", "score": "0.4553515", "text": "insertCoin(type) {\n if (type === \"quarter\"){\n this.cashtendered -= \"25\";\n }else if (type === \"dime\"){\n this.cashtendered -= \"10\";\n }else if (type === \"nickel\"){\n this.cashtendered -= \"5\";\n }else if (type === \"penny\"){\n this.cashtendered -= \"1\";\n }else{\n this.cashtendered;\n }\n }", "title": "" }, { "docid": "4b2900d2d5a7e165222af252b6d11d6b", "score": "0.45303908", "text": "function reducer3(acc, val) {\n var sum = acc + val;\n}", "title": "" }, { "docid": "d677747ea83a19a3ce82b5551942f0ad", "score": "0.45188373", "text": "enterOC_CaseExpression(ctx) {}", "title": "" }, { "docid": "3fd613659afafd3e77f8078b377a248a", "score": "0.45118853", "text": "function notReduce(str) {\n if (str.length >= 2) {\n switch (str) {\n case '22':\n return '22';\n break;\n case '11':\n return '11';\n break;\n default:\n strAdded = addition(str);\n if (strAdded.length >= 2) {\n var strAdded = notReduce(strAdded);\n }\n return strAdded;\n break;\n }\n } else {\n return str;\n } \n }", "title": "" }, { "docid": "5fa6407841bae1ef5c2ef98d1a9492e5", "score": "0.4511682", "text": "function addConversion(srcUnitType, destUnitType, value) {\n function row(unitType) {\n if (!table[unitType]) {\n table[unitType] = {};\n }\n return table[unitType];\n }\n row(srcUnitType)[destUnitType] = value;\n row(destUnitType)[srcUnitType] = 1 / value;\n }", "title": "" }, { "docid": "93ab9a441f8b36d8b148268a8bd2b794", "score": "0.45015854", "text": "function addExpenseReducer(state, action) {\n\tconst newExpense = Object.assign({}, action.payload, { _id: state.nextId })\n\treturn fromJS(state)\n\t\t.updateIn(['rawExpenses'], rawExpenses => rawExpenses.push(newExpense))\n\t\t.update('nextId', nextId => (nextId += 1))\n\t\t.toJS()\n}", "title": "" }, { "docid": "355eccb076b2f1848ddea017081fad50", "score": "0.4495721", "text": "addCitizen(quantity) {\n let previousValue = +this.configManager.currentPopulation.storage;\n this.configManager.currentPopulation.storage.setValue(Number.MAX_SAFE_INTEGER);\n this.configManager.currentPopulation.changeValue(quantity);\n // It allows to pass current population storage limit\n this.configManager.currentPopulation.storage.setValue(previousValue);\n\n this.configManager.lazybones.changeValue(quantity);\n this.configManager.foodTotalProduction.changeValue(-quantity);\n }", "title": "" }, { "docid": "9519f56c593083dc816b745f26630582", "score": "0.4494166", "text": "function add(a) {\n if(actress.includes('ramya') === true) {\n return;\n }\n else {\n actress.push('ramya');\n \n }\n return;\n}", "title": "" }, { "docid": "bc215df94eaf1ab97ec6548290c23bdc", "score": "0.44879276", "text": "exitOC_UnaryAddOrSubtractExpression(ctx) {}", "title": "" }, { "docid": "d5d6919c17661513606fa3646878b030", "score": "0.4486568", "text": "function question1(){\n fs.readFile('./santa.txt', (err,data)=>{\n const directions = data.toString();\n const directionsArray = directions.split('');\n //maping out\n const answer = directionsArray.reduce((acc, currentItem)=>{\n if (currentItem === '('){\n return acc += 1\n }else if (currentItem === ')'){\n return acc -= 1\n }\n }, 0)\n\n })\n}", "title": "" }, { "docid": "c26009f7943af3766d352c5ef96b4fad", "score": "0.4482499", "text": "function addInductive( amount)\n{\n\tinductiveValue += amount;\n}", "title": "" }, { "docid": "41283d8327d97eebd8e2f46c398dc9d3", "score": "0.4479454", "text": "function createCoffee(inputNewCoffee, inputRoast) {\n var addingCoffeeName = addingCoffee.value;\n var roastAdd = addingRoast.value;\n\n\n var addCoffee = {id: coffees.length + 1, name: addingCoffeeName, roast: roastAdd, all: 'all'};\n\n if (addingCoffeeName === \"\" || roastAdd === \"Select Roast\") {\n updateCoffees();\n } else {\n coffees.push(addCoffee);\n }\n}", "title": "" }, { "docid": "6e2f8cd677a1498b6aa0c92d2a522814", "score": "0.44787782", "text": "function getCuenCuadCntx() {\n\t\tvar cntx = ctxl.baseCntx();\n\t\tcntx.form.set('cuen', ctxl.makeField(0));\n\t\tcntx.form.set('sald', ctxl.makeField(0));\n\t\tcntx.form.set('impo', ctxl.makeField(0));\n\t\tcntx.form.set('cate', ctxl.makeField(0));\n\t\tcntx.form.set('conc', ctxl.makeField(0));\n\t\tcntx.form.set('btCuad', ctxl.makeBtn('Cuadre'));\n\t\tcntx.form.set('stApun', ctxl.makeSection('StApunte'));\n\t\treturn cntx;\n\t}", "title": "" }, { "docid": "e662cc9113ea1fce219c2e9d453aecb6", "score": "0.44760087", "text": "function removeAllCuisines(state = initialState.cuisines, action) {\n return initialState.cuisines;\n}", "title": "" }, { "docid": "bded62afbce26fdf3df6ae5f1f238edc", "score": "0.4475656", "text": "function dataHandling2(input){\n input.splice(4,1)\n input.splice(1,3 , \"Roman Alamsyah Elsharawy\", \"Provinsi Bandar Lampung\", \"21/05/1989\", \"Pria\", \"SMA Internasional Metro\")\n console.log(input)\n\n var inputBaru1 = input[3]\n var bulan = inputBaru1[3] + inputBaru1[4];\n Number(bulan)\n \n console.log(bulan)\n console.log(typeof(bulan))\n switch(bulan) {\n case 01 : { console.log('Januari') ; break;}\n case 02 : { console.log('Februari') ; break;}\n case 03 : { console.log('Februari') ; break;}\n case 04 : { console.log('Februari') ; break;}\n case 05 : { console.log('Februari') ; break;}\n case 06 : { console.log('Februari') ; break;}\n case 07 : { console.log('Februari') ; break;}\n case 08 : { console.log('Februari') ; break;}\n case 09 : { console.log('Februari') ; break;}\n case 10 : { console.log('Februari') ; break;}\n case 11 : { console.log('Februari') ; break;}\n case 12 : { console.log('Februari') ; break;}\n default : console.log('sdfdsfsd')\n }\n console.log(bulan)\n \n}", "title": "" }, { "docid": "2791249e2ab187d78b3eb110048f5eb6", "score": "0.44715044", "text": "addRc(ct)\n {\n if (arguments.length === 0)\n {\n ct = [0.5, 0.5];\n }\n\n {\n for (var xi = 1; xi < this.coef.Nx - 1; xi++)\n {\n let X = xi * h;\n\n for (var yi = 1; yi < this.coef.Ny - 1; yi++)\n {\n let cp = yi + (xi * this.coef.Ny);\n let Y = yi * h;\n let dist = Math.sqrt(Math.pow(X - (ct[0] * this.coef.Lx), 2) + Math.pow(Y - (ct[1] * this.coef.Ly), 2));\n let ind = signum((this.coef.wid * 0.5) - dist); // displacement (Math.logical)\n let rc = .5 * ind * (1 + Math.cos(2 * pi * dist / this.coef.wid)); // displacement\n this.state.u1[cp] += rc * this.coef.k;\n }\n }\n }\n }", "title": "" }, { "docid": "f0605529e857486a26d2b13c640bd321", "score": "0.4470714", "text": "function tabToCouleurSingulier(tab) {\r\n if (tab === 0) {\r\n return 'rouge'\r\n }\r\n if (tab === 1) {\r\n return 'blanc'\r\n }\r\n if (tab === 2) {\r\n return 'rose'\r\n }\r\n}", "title": "" }, { "docid": "d815f2e95d238a827a53787c42995256", "score": "0.44700342", "text": "function reducefunction (x,y) {\n return x + y;\n }", "title": "" }, { "docid": "10d04680206ce1d7460cbd9262c88d6a", "score": "0.44692317", "text": "function reduceRiskAcceptedAdd(p,v) {\n if (v['status'] == \"Risk accepted\")\n p.status += +1;\n return p;\n }", "title": "" }, { "docid": "168a6b51fa65f83acae30275d5d557de", "score": "0.44562802", "text": "addTo(num){\n return this.aduend + num;\n }", "title": "" }, { "docid": "36077ea33dff9cc74902a5a007e71f66", "score": "0.44469327", "text": "function nuggetizer(animal){ \n\nreturn `${animal} + stix`;\n}", "title": "" }, { "docid": "38058f0645f33e04ded3a27a5ab16b4d", "score": "0.44442087", "text": "function reducer(state = initialState, action) {\n // The action is an object that can only have two properties:\n // \"payload\", which holds any data that you may want to use\n // inside of this function to update state (optional); and\n // \"type\", which is a unique identifier that can be used to\n // tell this function what you want to do with the data\n // either in state or the payload\n \n // You will often see a \"switch\" statement that will return\n // what you want the next state to be from each of its \"case\"\n // statements.\n switch (action.type) {\n // In this case, the \"type\" will be a plus\n case '+':\n // We don't want to lose everything else that was in\n // state (in case there was anything else), and so\n // you will often see the previous state being spread\n // out into a new object and the updates added beneath\n // it. This new object is returned.\n return {\n ...state,\n // Here, we're wanting to only change \"count\" to\n // be one more than it used to be, so we add a\n // property to the new state object called \"count\"\n // that will have the value of the previous \"count\"\n // plus one\n count: state.count + 1,\n };\n \n // The same thing can be said of this case as with the plus\n // case except it will decrease the count by 1\n case '-':\n return {\n ...state,\n count: state.count - 1,\n }\n }\n \n // If it doesn't match any of the other cases, we want to make\n // sure to return the previous state. If this happens, none of\n // the code listening to state changes will will fire, and we\n // want to make sure that the state is available to our code\n // when we ask for it from the store.\n // Failing to return anything will be catastrophic.\n return state;\n}", "title": "" }, { "docid": "64dc609916d667e26695726dc96a6901", "score": "0.44382668", "text": "function MaiusculoPlus (props){\n const textoRecebido = props.texto\n const textoMaiusculo = textoRecebido.toUpperCase() //converte em maiusculo.\n return<div style={{color: props.cor}}> {textoMaiusculo} </div>\n}", "title": "" }, { "docid": "fa9f6b4f0653f55d8bbb31ef73e94922", "score": "0.44381884", "text": "function reducer(state, action) {//The \"action\" we got from step 9 {type: ACTIONS.ADD_TODO} and step 12 (type: ACTIONS.MARK_COMPLETE)\n switch (action.type) {//switch case by the action.type thats or \"'add-todo'\" or \"toggle-complete\"\n case ACTIONS.ADD_TODO: \n return{\n ...state,//Bring me all the todos that already exist, put them in an object,we will overide its value with setting \"todos:\" next:\n todos: [...state.todos, {//then distructure them to a new array, and add the new todo to it:\n id:Date.now(), //each todo object will have 3 keys - \"id\" \"comlete\" and \"text\" \n complete:false, \n text: action.payload.text //the value of \"text\" is the text of the added todo\n }]\n };\n //14.Take care of the second case: \n case ACTIONS.TOGGLE_COMPLETE: \n return{\n ...state,\n todos: state.todos.map(todo => todo.id === action.payload.id\n ? {...todo, complete: !todo.complete} \n : todo\n )\n };\n default:\n return state;\n }\n }", "title": "" }, { "docid": "1d8ae0e10ad59fa32bd0d81641a06ef7", "score": "0.44318286", "text": "function programmationFonctionnelle() {\n var tab=[2, 3, 4, 5];\n tab.map(x => x + 3)\n .filter(x => x >= 6)\n .forEach(function(a, b) {\n cl(a - 3);\n });\n\n cl();\n var somme = \n //tab.map(x => x + 3)\n //.filter(x => x > 5)\n //.reduce(function(sum, elem) {return sum + elem;})\n // tab.map(x => x)\n // .reduce((a, b) => a + b);\n\n tab.reduce((a, b) => a + b + 3);\n cl(somme);\n\n const addition = (a, b) => a + b;\n var res = addition(18, 22);\n cl(res);\n\n const sumSP = new Function(\"a\", \"b\", \"c\", \"return a + b - c\");\n cl(sumSP(1, 6, 3));\n\n //const sum3 = \n}", "title": "" }, { "docid": "4755a259d404c203c0b71b1a3f7e375c", "score": "0.4425928", "text": "function add(a, b, c) {\n return a + b + c;\n }", "title": "" }, { "docid": "17e432d649517630977914187b29b859", "score": "0.44252047", "text": "function insertValue(type, ingre , region){\n\n newCountryObj = countryObj\n var count = regionCount(region);\n\n if(type==\"carbo\")\n {\n var valueArr = countryObj[\"carbo\"];\n countryObj[\"carbo\"] = insert(valueArr,ingre,region);\n carboCounter[count]++;\n }\n\n else if(type==\"protein\")\n {\n var valueArr = countryObj[\"protein\"];\n countryObj[\"protein\"] = insert(valueArr,ingre,region);\n proteinCounter[count]++;\n }\n else if(type==\"fat\")\n {\n var valueArr = countryObj[\"fat\"];\n countryObj[\"fat\"] = insert(valueArr,ingre,region);\n fatCounter[count]++;\n }\n\n }//insertValue ends here", "title": "" }, { "docid": "3a802ca6700a83a381d06621f36d50de", "score": "0.44241655", "text": "function reduceAddTypeCount() {\n return function(p,v){\n var p_type = v.properties.p_type;\n if(p_type === \"collision\") p.collision++;\n else if(p_type === \"nearmiss\") p.nearmiss++;\n else if(p_type === \"hazard\") p.hazard++;\n else if(p_type === \"theft\") p.theft++;\n return p;\n };\n}", "title": "" }, { "docid": "a7e0012c7480cdaabfa1628d6a7a2e19", "score": "0.4409842", "text": "enterOC_AddOrSubtractExpression(ctx) {}", "title": "" }, { "docid": "d9296afdf0bf6fe65e8a4f3db79a06a7", "score": "0.44089264", "text": "function rootReducer(state = initialState ,action){\n //the actual function one\nswitch(action.type){\n case 'INCREMENT' :\n return {counter: state.counter+1}\n //actual function two \n case 'DECREMENT' :\n return {counter: state.counter-1}\n //default action\n default:\n return state\n}\n}", "title": "" }, { "docid": "f16e612a8c1c30570bf556dd746d54dd", "score": "0.43901664", "text": "function astintop() {\n matchMe('+', counter);\n counter++;\n\n\n}", "title": "" }, { "docid": "2bf05c04d9a084f3f34a2622fab67db3", "score": "0.43863112", "text": "function reducer(prev, curr) {\n\n return prev + parseFloat(curr.amount);\n}", "title": "" }, { "docid": "3b596ab34e72b04bcafbc3e5378b4642", "score": "0.4386005", "text": "function RoleGenerator(note,srcID,typeRole,ouoStarArr,typeOuo,roleOuoArr,aonName){\n //note è sub o super\n //srcID è una str dati\n //typeRole ---> tipo di ruolo (simple, complex,doublecomplex)\n //ouoStarArr--> tipo arco che va da ouo a starRuolo (o piu spesso da subruolo a starruolo)\n //typeOuo--> tipo degli (sub o super / andornot o ouo) oppure undefined (spesso)\n //roleOuoArr--> tipo arco che va da subruolo a ouo oppure undefinde\n //aonName--> testo che deve apparire nel ouo solo nel caso in cui è andornot\n if(typeOuo == undefined){\n for (let i = 0; i < srcID.length; i++) {\n const el = srcID[i];\n cy.add([\n {group: 'nodes', data: {id: el,type: typeRole, hint:note}},\n {\n group:'edges',\n data:{\n id: soggetto+el,\n source: el,\n target: soggetto,\n type:ouoStarArr\n\n }\n }\n ]);\n }\n return;\n }\n else if(typeOuo == \"subAndornot\"){\n cy.add([\n {group: 'nodes', data: { id: 'ouo'+srcID[0], type: typeOuo, andornot: aonName}},\n {\n group: 'edges', \n data:{\n id: 'ouo'+soggetto+srcID[0],\n source: 'ouo'+srcID[0],\n target: soggetto,\n type:ouoStarArr\n }\n }\n ]);\n }\n \n else{\n cy.add([\n {group: 'nodes', data: { id: 'ouo'+srcID[0], type: typeOuo}},\n {\n group: 'edges', \n data:{\n id: 'ouo'+soggetto+srcID[0],\n source: 'ouo'+srcID[0],\n target: soggetto,\n type:ouoStarArr\n }\n }\n ]);\n }\n \n for (let i = 0; i < srcID.length; i++) {\n const el = srcID[i];\n cy.add([\n {group: 'nodes', data: { id: el, type: typeRole,hint:note}}, \n {\n group: 'edges', \n data:{\n id: 'ouo'+srcID[0]+el,\n source: el,\n target: 'ouo'+srcID[0],\n type:roleOuoArr\n }\n }\n ]);\n }\n}", "title": "" }, { "docid": "c5e695c4a5b5b5234ec74159683c7704", "score": "0.438206", "text": "add(other, into) {\n\t\tfor(let i = 0; i < this.feats.length; ++i) {\n\t\t\tinto[i] = this.feats[i] + other[i];\n\t\t}\n\t}", "title": "" }, { "docid": "3de5582bdfd666e7bb1ccf8f1b94d16d", "score": "0.43793613", "text": "function anotherReducer(prev,curr) {\n\n return Math.round((prev + (curr.amount * 0.189)) * 100) /100;\n}", "title": "" }, { "docid": "9d0b523418f9e98f70aa18993cb4d988", "score": "0.43788916", "text": "function couleurSingulierToTab(couleur) {\r\n if (couleur === 'false' || couleur === 'rouge') {\r\n return 0\r\n }\r\n if (couleur === 'blanc') {\r\n return 1\r\n }\r\n if (couleur === 'rose') {\r\n return 2\r\n }\r\n}", "title": "" }, { "docid": "95874e3b901ee0ee04f36efddd5755c1", "score": "0.43788335", "text": "visitOC_CaseExpression(ctx) {\n return this.visitChildren(ctx);\n }", "title": "" }, { "docid": "cc4a818b223910b1739e31819d1dbe19", "score": "0.43755957", "text": "function reduce(add, remove, initial) {\n\t reduceAdd = add;\n\t reduceRemove = remove;\n\t reduceInitial = initial;\n\t resetNeeded = true;\n\t return group;\n\t }", "title": "" }, { "docid": "dff759fd66c9bee5533e84bbbbb15d8f", "score": "0.43700117", "text": "function reduce(add, remove, initial) {\n\t reduceAdd = add;\n\t reduceRemove = remove;\n\t reduceInitial = initial;\n\t resetNeeded = true;\n\t return group;\n\t }", "title": "" }, { "docid": "3e90b2df256f0bd10e6e672a0a71a571", "score": "0.43694094", "text": "function plusOne() {\n return {\n type: 'PLUS_ONE'\n };\n}", "title": "" }, { "docid": "67a9aec88e6c416e0aac6c8317f8cb1a", "score": "0.43687877", "text": "function druzy(stone, silver){ //function stores costs for druzr cabochon and silver for making centerpiece of cuff\n\n\tvar total = stone + silver;\n\n\treturn total;\n}", "title": "" }, { "docid": "8fe11a5ef56badc7fb967b5a35f4d682", "score": "0.43677694", "text": "function currenciesCountry(currencies) {\n // console.log(\"Functie aangeroepen?\", currencies);\n const allCurrencies = currencies.reduce((acc, currency, index) => {\n // console.log(\"Laatste valuta\", currency, index === currencies.length -1);\n\n if(index !== currencies.length -1 || currencies.length === 1){\n return acc + `${currency.name}'s`;\n }\n if(index === currencies.length -1) {\n return acc + ` and ${currency.name}'s `;\n }\n\n},\"and you can pay with \");\n return allCurrencies;\n}", "title": "" }, { "docid": "874821b5035d140af4a26a9f703b65d3", "score": "0.43628192", "text": "function addCI(){\n\t\n\tremoveCore();\n\n\tvar flag = 9;\n\tvar i;\n\t\n\tfor (i=0;i<4;i++){\n\t\tif (Winter[i] == \"CORE\"){\n\t\t\tflag = i;\n\t\t}\n\t\tif (Winter[i] == \"CI2\" || Winter[i] == \"CI1\"){\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\t//this means that there is no core in the winter\n\t//and you will not add C&I\n\tif (flag == 9){\n\t\treturn;\n\t}\n\t\n\tfor (i=0;i<4;i++){\n\t\tif (Fall[i] == \"CORE\"){\n\t\t\tFall[i]= \"CI1\";//this needs to change the class in the matrix\n\t\t\tWinter[flag] = \"CI2\";//this needs to change the class in the matrix\n\t\t\t\n\t\t\tif (flag == 0){\n\t\t\t\tWinter[0] = \"CI2\";\n\t\t\t} else if (flag == 1) {\n\t\t\t\tWinter[1] = \"CI2\";\n\t\t\t} else if (flag == 2) {\n\t\t\t\tWinter[2] = \"CI2\";\n\t\t\t} else if (flag == 3) {\n\t\t\t\tWinter[3] = \"CI2\";\n\t\t\t}\n\t\t\t\n\t\t\tif (i == 0){\n\t\t\t\tFall[0] = \"CI1\";\n\t\t\t} else if (i == 1) {\n\t\t\t\tFall[1] = \"CI1\";\n\t\t\t} else if (i == 2) {\n\t\t\t\tFall[2] = \"CI1\";\n\t\t\t} else if (i == 3) {\n\t\t\t\tFall[3] = \"CI1\";\n\t\t\t}\n\t\t\t\n\t\t\treturn;\t\t\t\n\t\t}\n\t}\t\n\tfor (i=0;i<4;i++){\n\t\tif (Spring[i] == \"CORE\"){\n\t\t\tSpring[i]= \"CI2\";//this needs to change the class in the matrix\n\t\t\tWinter[flag] = \"CI1\";//this needs to change the class in the matrix\n\t\t\t\n\t\t\tif (flag == 0){\n\t\t\t\tWinter[0] = \"CI1\";\n\t\t\t} else if (flag == 1) {\n\t\t\t\tWinter[1] = \"CI1\";\n\t\t\t} else if (flag == 2) {\n\t\t\t\tWinter[2] = \"CI1\";\n\t\t\t} else if (flag == 3) {\n\t\t\t\tWinter[3] = \"CI1\";\n\t\t\t}\n\t\t\t\n\t\t\tif (i == 0){\n\t\t\t\tSpring[0] = \"CI2\";\n\t\t\t} else if (i == 1) {\n\t\t\t\tSpring[1] = \"CI2\";\n\t\t\t} else if (i == 2) {\n\t\t\t\tSpring[2] = \"CI2\";\n\t\t\t} else if (i == 3) {\n\t\t\t\tSpring[3] = \"CI2\";\n\t\t\t}\n\t\t\t\n\t\t\treturn;\t\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f8e486b07bd0adfc24e4c02a0d65311c", "score": "0.43611956", "text": "function reduceSolvedAdd(p,v) {\n if (v['status'] == \"Solved\")\n p.status += +1;\n return p;\n }", "title": "" }, { "docid": "2d17005617b4158fa2fae94c99b7bdef", "score": "0.43574193", "text": "visitOC_UnaryAddOrSubtractExpression(ctx) {\n return this.visitChildren(ctx);\n }", "title": "" }, { "docid": "e5f49c656f77538bb9974cde32bb7ce9", "score": "0.43570173", "text": "clinc(userInput) {\n if (userInput.startsWith('remove ')) {\n var pos = parseInt(userInput.slice(7));\n return { 'intent': 'remove', 'position': pos }\n } else if (userInput.startsWith('see details ')) {\n var pos = parseInt(userInput.slice(12));\n return { 'intent': 'detail', 'position': pos }\n } else if (userInput.startsWith('find ')) {\n return { 'intent': 'find', 'require': userInput.slice(5) };\n } else if (userInput.startsWith('select ')) {\n var pos = parseInt(userInput.slice(7));\n return { 'intent': 'select', 'position': pos }\n } else if (userInput.startsWith('help ')) {\n return { 'intent': 'help', 'require': userInput.slice(5) };\n } else {\n return { 'intent': 'outofscope' };\n }\n }", "title": "" }, { "docid": "a001890448df16b55724e60836bf49d5", "score": "0.43555927", "text": "function applyIcuSwitchCaseRemove(tView, tIcu, lView) {\n var activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n\n if (activeCaseIndex !== null) {\n var removeCodes = tIcu.remove[activeCaseIndex];\n\n for (var i = 0; i < removeCodes.length; i++) {\n var nodeOrIcuIndex = removeCodes[i];\n\n if (nodeOrIcuIndex > 0) {\n // Positive numbers are `RNode`s.\n var rNode = getNativeByIndex(nodeOrIcuIndex, lView);\n rNode !== null && nativeRemoveNode(lView[RENDERER], rNode);\n } else {\n // Negative numbers are ICUs\n applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex), lView);\n }\n }\n }\n }", "title": "" }, { "docid": "2c946ef8fd9e89ceda63fdd6dbe47821", "score": "0.43492168", "text": "addUnitCode(theUnit) {\n let uCode = theUnit['csCode_'];\n\n if (uCode) {\n if (this.unitCodes_[uCode]) throw new Error(`UnitTables.addUnitCode called, already contains entry for ` + `unit with code = ${uCode}`);else {\n this.unitCodes_[uCode] = theUnit;\n this.codeOrder_.push(uCode);\n\n if (uCode == 'g') {\n let dimVec = theUnit.dim_.dimVec_;\n let d = 0;\n\n for (; d < dimVec.length && dimVec[d] < 1; d++);\n\n this.massDimIndex_ = d;\n }\n }\n } else throw new Error('UnitTables.addUnitCode called for unit that has ' + 'no code.');\n }", "title": "" }, { "docid": "81c21bf038cc398249dbc8346ce0ecf9", "score": "0.43484056", "text": "function interestReducer(state = {result: null}, action){\n switch(action.type){\n case 'CALCULATE_INTEREST':\n return {result: action.principal * (1 + (action.rate * action.years))}\n default:\n return state\n }\n}", "title": "" }, { "docid": "e2f9f170330615ba39dfd1e8d3b36aa7", "score": "0.4343812", "text": "function chooseUsCanada(object){\n\n var code = object['text'];\n var usIndex = getCountryInfo({text:'+1'}).index;\n\n object['country_info'] = countryCodes[usIndex+1];\n\n for (i=0;i<canadaCodes.length;i++) {\n if (code === canadaCodes[i]) {\n object['country_info'] = countryCodes[usIndex+2];\n break;\n }\n }\n\n}", "title": "" }, { "docid": "93cef37333942e326b2acbcf985f4289", "score": "0.43408075", "text": "function Cine (){\n\tthis.nombre;\n\tthis.Peliculas = [];\n}", "title": "" }, { "docid": "9ee209bc7b0c60a62e64312be60c6908", "score": "0.43382198", "text": "function currencyReducer(storeData = \"INR\", action) { \n switch (action.type) { \n case CurrencyActions.actionTypes.CHANGE_CURRENCY: \n console.log(action.code+\"reducer\");\n return action.code; \n default: \n return storeData; // current state \n } \n}", "title": "" }, { "docid": "db81cc7011a69b5af488bd6d181b667c", "score": "0.43353567", "text": "getLine(line) {\n const reducer = (accumulator, currentValue) => {\n let v = \".\";\n if (currentValue == 1) v = \"X\";\n else if (currentValue == 2) v = \"O\";\n return accumulator + v;\n };\n let res = line.reduce(reducer, \"\");\n return res;\n }", "title": "" }, { "docid": "03e3d312d090a83ecc403a831448f8f3", "score": "0.43334106", "text": "function callback(acc, el) {\n return acc + el;\n}", "title": "" }, { "docid": "f6951180d0610cef0fb44a43ad7b0040", "score": "0.43318453", "text": "function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }", "title": "" }, { "docid": "5b2f865487592a90da78fbc251036b97", "score": "0.4330213", "text": "addCorner(newCorner, inputMap)\n {\n let lat = newCorner[1];\n let lon = newCorner[0];\n\n if (this._corners.length > 3)\n {\n // Check if the point is on the wrong location\n if (this._polygon.TestPoint(lat, lon, true, true) < 0)\n {\n // Return false to tell that\n return false;\n }\n }\n this._corners.push(newCorner);\n this._polygon.AddPoint(lat, lon);\n this._markers.push(new mapboxgl.Marker().setLngLat(newCorner).addTo(inputMap));\n return true;\n }", "title": "" }, { "docid": "d2bfc984c92143792bd0b53c1826e62e", "score": "0.43288648", "text": "function reducer(state, action) {\n\tconsole.log(action);\n\tswitch (action.type) {\n\t\t// for user we have to add another case\n\t\tcase \"SET_USER\":\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuser: action.user\n\t\t\t};\n\t\tcase \"ADD_TO_BUSKET\":\n\t\t\t// logic here\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tbusket: [...state.busket, action.item]\n\t\t\t};\n\t\t\tbreak;\n\t\tcase \"REMOVE_FROM_BUSKET\":\n\t\t\t// logic here\n\t\t\tconst newBusket = [...state.busket];\n\t\t\tconst index = state.busket.findIndex(\n\t\t\t\t(busketItem) => busketItem.id === action.item.id\n\t\t\t);\n\t\t\tif (index >= 0) newBusket.splice(index, 1);\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tbusket: newBusket\n\t\t\t};\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}", "title": "" }, { "docid": "e75da1aa52c3b1a5f03335f2b2c6c0eb", "score": "0.43285918", "text": "function coconutsClever(totalFloors, willBreakAt) {\n\n}", "title": "" }, { "docid": "a590b41c92ea55d83a35f0d804ca2256", "score": "0.43281978", "text": "function addNumber(number) { // 1, 2, 5, 2 // \n console.log('Number', number)\n setNumberConcat(n => n + number)\n console.log('op', operation !== '')\n setParcialF(number)\n if (operation !== '') {\n logica(operation) // 3 \n }\n }", "title": "" }, { "docid": "28868acf7ad2ab464781fb5d0cb5f622", "score": "0.43255404", "text": "CounterStrike(Map){\n this.IsBlindMap()\n this.compteurregles = 0\n this.CL('G3', 'CounterStrike', '', 'ia')\n for (let yy = 0; yy < this.NbCasesCote; yy++) {\n this.compteurreglescases = 0\n this.CL('G3', 'Boucle', 'ligne', 'ia')\n for (let xx = 0; xx < this.NbCasesCote; xx++) {\n // --------------------------------\n this.TestCasesPossibles('cs',xx, xx, xx, yy, yy-2, yy-1) // +2 en haut\n this.TestCasesPossibles('cs',xx, xx+1, xx+2, yy, yy-1, yy-2) // +2 en haut à droite\n this.TestCasesPossibles('cs',xx, xx+2, xx+1, yy, yy, yy) // +2 à droite\n this.TestCasesPossibles('cs',xx, xx+1, xx+2, yy, yy+1, yy+2) // +2 en bas à droite\n this.TestCasesPossibles('cs',xx, xx, xx, yy, yy+2, yy+1) // +2 en bas\n this.TestCasesPossibles('cs',xx, xx-1, xx-2, yy, yy+1, yy+2) // +2 en bas à gauche\n this.TestCasesPossibles('cs',xx, xx-2, xx-1, yy, yy, yy) // +2 à gauche \n this.TestCasesPossibles('cs',xx, xx-1, xx-2, yy, yy-1, yy-2) // +2 en haut à gauche\n this.TestCasesPossibles('cs',xx, xx, xx, yy, yy-1, yy+1) // Vertical\n this.TestCasesPossibles('cs',xx, xx-1, xx+1, yy, yy-1, yy+1) // +2 en haut à droite\n this.TestCasesPossibles('cs',xx, xx-1, xx+1, yy, yy, yy) // horizontal\n }\n this.CL('GEnd')\n }\n this.CL('GEnd')\n }", "title": "" }, { "docid": "b6491fbcfbbd3ccb5f2ddf7488270179", "score": "0.43220544", "text": "function Asiancountriespop(details){\r\n\r\n\t\tvar asianpop = details.filter((val)=>val.region===\"Asia\")\r\n\t\t\t\t\t\t\t\t.reduce((acc,curr)=>{\r\n\t\t\t\t\t\t\t\t\tacc = acc + parseInt(curr.population);\r\n\t\t\t\t\t\t\t\t\treturn acc;},0)\r\n\r\n\t\tconsole.log(asianpop); \t\t\t//4391254784\r\n\r\n\t}", "title": "" }, { "docid": "7fa3fadf2340d16e620466a884e1bbb4", "score": "0.43192738", "text": "function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }", "title": "" }, { "docid": "3782e705280f2fd32e67bdda66847d9a", "score": "0.43184376", "text": "function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }", "title": "" }, { "docid": "3782e705280f2fd32e67bdda66847d9a", "score": "0.43184376", "text": "function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }", "title": "" }, { "docid": "3782e705280f2fd32e67bdda66847d9a", "score": "0.43184376", "text": "function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }", "title": "" }, { "docid": "3782e705280f2fd32e67bdda66847d9a", "score": "0.43184376", "text": "function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }", "title": "" } ]
e1b1e75420e8c083111b64172b217cfe
> Create a setTimeout to remove added messages
[ { "docid": "f93492e1f1f3c1cdd2f9eb438c1a964c", "score": "0.7683921", "text": "function removeMsg(message) {\n setTimeout(function() {\n message.remove();\n }, 5000);\n}", "title": "" } ]
[ { "docid": "535f06166a2c8b1f0bbb1b744a7c7472", "score": "0.7525043", "text": "function hideMessages() {\n setTimeout(clearMessages, 5000);\n}", "title": "" }, { "docid": "09299135b6c20c79a535b058279a2f1c", "score": "0.67710114", "text": "function checkTimeoutElements()\n\t\t{\n\t\t\tsetTimeout(function(){ \n\t\t\t\t\n\t\t\t\tvar i = 0;\n\t\t\t\twhile(i < globals.timeoutElements.length)\n\t\t\t\t{\n\t\t\t\t\tvar tele = globals.timeoutElements[i];\n\t\t\t\t\tvar currenttime = +new Date();\n\t\t\t\t\tif (currenttime > tele.activationPoint + (tele.duration *1000))\n\t\t\t\t\t{\t//remove element...\n\t\t\t\t\t\ttele.fnRemove(tele.element);\n\t\t\t\t\t\tglobals.timeoutElements.splice(i, 1);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse (i++);\n\t\t\t\t}\n\t\t\t\tcheckTimeoutElements(); \n\t\t\t\t\n\t\t\t}, 1000);\n\t\t}", "title": "" }, { "docid": "57cd625a22c9e917c1953c2143a4f7eb", "score": "0.6734308", "text": "function clearMsg(){\n\tsetTimeout(function(){\n\t\tdocument.getElementById('msg').innerHTML = \"\";\t\n\t},3000);\n\t\n}", "title": "" }, { "docid": "62b3e3284e244ff1d30104820dffb38f", "score": "0.6711044", "text": "messageTimeout () {\n\t\tthis.messageCallback();\n\t}", "title": "" }, { "docid": "62b3e3284e244ff1d30104820dffb38f", "score": "0.6711044", "text": "messageTimeout () {\n\t\tthis.messageCallback();\n\t}", "title": "" }, { "docid": "5dd5ca1fa1bf8cccf28a6b92ba47e122", "score": "0.6695675", "text": "function removeByTimer( selector, timeout ) {\n setTimeout( function( ) {\n selector.remove( );\n }, timeout );\n }", "title": "" }, { "docid": "a5315297d35a9d61e44bcf62aaf62b31", "score": "0.66007864", "text": "function timeMessages(destination) {\n setTimeout(destination, 1000 * timeSet);\n}", "title": "" }, { "docid": "a7a2d0aeb12070b32b513af07ca6f4ce", "score": "0.6574703", "text": "function tmoTmr() {\n setTimeout(clearMsg, 1*60*1000);\n }", "title": "" }, { "docid": "dc2daeb998fe20574c6688a18662400e", "score": "0.6549208", "text": "static hideMessage() {\n setTimeout(() => {\n document.getElementById('message').remove();\n }, 2000);\n }", "title": "" }, { "docid": "1fe74309e26d8766344c6749eb83f103", "score": "0.6469405", "text": "function DisplayMsg(msg) {\n var div = $(\"#userMessage\")\n div.append(\"<div><h2>\" + msg + \"</h2></div>\")\n setTimeout(function () { $(\"#userMessage\").empty() }, 5000)\n}", "title": "" }, { "docid": "d17a9b5a0c825d8e881a567a183ea8b7", "score": "0.6459631", "text": "function t$f(e){return {setTimeout:(t,o)=>{const r=e.setTimeout(t,o);return {remove:()=>e.clearTimeout(r)}}}}", "title": "" }, { "docid": "4f6ecca4f2a762c51dbf5c0982c8d4af", "score": "0.64098656", "text": "function setTimeout(toasty, time) {\n\t\t\t\ttoasty.timeout = $timeout(function() {\n\t\t\t\t\tclear(toasty.id);\n\t\t\t\t}, time);\n\t\t\t}", "title": "" }, { "docid": "c1c1152ce1bc63dac3285629958b7860", "score": "0.63492095", "text": "function setNotificationTimeout(timeTillRemove, timestamp) {\n\n setTimeout(function() {\n\n //notification may not exist if its been erased\n\n let notification = '';\n\n try {\n notification = document.querySelectorAll('[data-identifier=\"aos__notificationIdentifier'+timestamp+'\"]');\n } catch(e) {\n\n }\n \n\n if(notification && notification.length) {\n destroyNotification(notification)\n }\n \n\n }, timeTillRemove)\n\n}", "title": "" }, { "docid": "21bda8a762fa1c25d014357c21df3df4", "score": "0.633515", "text": "appendToDOM() {\n this.root.append(this.element);\n NotificationMessage.timerID = setTimeout(()=> {\n this.removeAllNotifications();\n }, this.duration);\n console.log(\"create timer \" + NotificationMessage.timerID)\n }", "title": "" }, { "docid": "b78188fdcaa5c2ba2273c46c90ce6232", "score": "0.63312596", "text": "function loadDisappearAlert() {\n setTimeout(removeAlert, 5000);\n}", "title": "" }, { "docid": "a43ef7b358554fcbfe3bbc48242bb631", "score": "0.6328495", "text": "function timeOutRecur(){\n setTimeout(function(){\n loadMessage();\n //Only load private message recursively when its shown\n if(privateMessageFlag){\n showPrivateMessage(user2Conv);\n }\n timeOutRecur();\n },1000);\n}", "title": "" }, { "docid": "fd63102ef01a147d4fc46937362ebc92", "score": "0.6323972", "text": "function removeMessage(message) {\n message.style.transition = \"opacity 1000ms\";\n message.style.opacity = 0;\n message.offsetWidth;\n message.style.opacity = 1;\n setTimeout(function() {\n message.style.opacity = 0;\n }, 2000);\n message.offsetWidth;\n setTimeout(function() {\n message.parentNode.removeChild(message);\n }, 3000);\n}", "title": "" }, { "docid": "4deddaf171f602777cb0804a3cb67499", "score": "0.629967", "text": "function setZeroTimeoutPostMessage(fn) {\n timeouts.push(fn);\n global.postMessage(messageName, '*');\n }", "title": "" }, { "docid": "4deddaf171f602777cb0804a3cb67499", "score": "0.629967", "text": "function setZeroTimeoutPostMessage(fn) {\n timeouts.push(fn);\n global.postMessage(messageName, '*');\n }", "title": "" }, { "docid": "4deddaf171f602777cb0804a3cb67499", "score": "0.629967", "text": "function setZeroTimeoutPostMessage(fn) {\n timeouts.push(fn);\n global.postMessage(messageName, '*');\n }", "title": "" }, { "docid": "476e1bc6f2b703878eba986db2c6a175", "score": "0.62882024", "text": "function showMessage(){\n document.getElementById(\"sent-message\").innerHTML = \"Thanks, your message has been sent!\";\n setTimeout(unshowMessage, 1000);\n }", "title": "" }, { "docid": "fae2ec8f775eb2a9a6e43f72a8ecb7e4", "score": "0.6271091", "text": "function remove_note(id){\n setTimeout(function(){\n $(\"#note_\"+id).remove();\n }, 5000);\n}", "title": "" }, { "docid": "1cc3b4db0afad1c1bbb11df8f1775230", "score": "0.6259824", "text": "function deleteMessage(messages) {\r\n\t\"use strict\";\r\n\tif (messages.length > 0) {\r\n\t\tArray.prototype.forEach.call(messages, function (message) {\r\n\t\t\tmessage.addClass(\"is-hidden\");\r\n\t\t\ttimer = setInterval(function () {\r\n\t\t\t\tmessage.removeElement();\r\n\t\t\t\tclearInterval(timer);\r\n\t\t\t}, 400);\r\n\t\t});\r\n\t}\r\n}", "title": "" }, { "docid": "a9d81d7447e213f232a729ac22cb5ac4", "score": "0.62582296", "text": "function showMessageSubmitinvalid(msg){\r\n var parent = document.querySelector('.form-submit-msg');\r\n var child = document.createElement('div');\r\n child.className = 'booking-message-invalid';\r\n child.appendChild(document.createTextNode(msg));\r\n parent.appendChild(child);\r\n \r\n setTimeout(function(){document.querySelector('.booking-message-invalid').remove();}, 5000);\r\n}", "title": "" }, { "docid": "583ce5fc5717df44d79042cad152c666", "score": "0.6253755", "text": "function showAddedMsg(e) {\n console.log(123);\n if (addedMsg.style.display != 'block') {\n addedMsg.style.display = 'block';\n // setTimeout(() => document.getElementById('added-sucess').remove(), 3000);\n }\n}", "title": "" }, { "docid": "edf923ffc39069c91681fd4dda7ac3ab", "score": "0.6195709", "text": "function clearMessage(nTimeout){\n\tif (tClearMessage && !nTimeout){\n\t\treturn;\n\t}\n\tdo_clearMessage(nTimeout||0);\n}", "title": "" }, { "docid": "4a3f86d7e2f4cfc377a82232ea1f7f17", "score": "0.6177139", "text": "function hide_messages(DOM_element) {\n var DOM_element = DOM_element;\n setTimeout(function() {\n $(DOM_element).fadeOut('slow');\n }, 3000);\n }", "title": "" }, { "docid": "88bf862da0c0f1b497bcc0ff3f426195", "score": "0.61734223", "text": "mostrarmensaje(a){\n const mensaje = document.getElementById('mensaje error');\n const imprimir = document.createElement('p');\n imprimir.innerHTML = '<p class=\"mensaje error\">'+a+'<p>';\n mensaje.appendChild(imprimir);\n\n // Remueve el texto dspues de tres segundos \n setTimeout(function () {\n document.querySelector('p').remove();\n }, 3000);\n }", "title": "" }, { "docid": "5393d007ef6c07a1b7a6f5ca2e663764", "score": "0.6170955", "text": "clearMessages() {\n setTimeout(function(){\n this.setState({\n error:false,\n success:false\n })\n }.bind(this),3000)\n }", "title": "" }, { "docid": "cd7ee5d7900a838ae482c5d699f2adb8", "score": "0.61528736", "text": "function chatTimeOut(newPayload) {\n if (timer) {\n clearTimeout(timer);\n timer = 0;\n }\n timer = setTimeout(function () {\n if (!newPayload.context.skills[\"main skill\"].user_defined.timedout) {\n chat.actions.lock(\"textInput\", \"Chat encerrado.\");\n chat.actions.unlock = util.disabled();\n newPayload.context.skills[\"main skill\"].user_defined.timedout = true;\n Api.sendRequest('Tchau.', newPayload.context);\n sessionStorage.removeItem(\"watson_session\");\n $(\".chat-button\").attr(\"disabled\", \"disabled\");\n }\n }, 240000);\n if (newPayload.output !== undefined && newPayload.output.user_defined !== undefined) {\n const action = newPayload.output.user_defined.action;\n if (action === 'end_conversation') {\n timedLock(5000);\n }\n if (action === 'abrupt_end') {\n timedLock(1000);\n }\n }\n }", "title": "" }, { "docid": "78ed42d3e1704af3f80930102729187e", "score": "0.613553", "text": "_timeout() {\n this._timer = false;\n this._ratelimit = false;\n this._queue.splice(0).forEach(this.execute, this);\n }", "title": "" }, { "docid": "3bd0511bf6798fb153212623853bd2f7", "score": "0.61233854", "text": "function beginTimeout() {\n $scope.exitTimeout = $timeout(remove, 500);\n }", "title": "" }, { "docid": "7a0c0156ef730a77fb13f6240120d0b9", "score": "0.6120824", "text": "function hideMsg(msg) {\n var msg = document.getElementById('msg');\n if(!msg.timer) {\n msg.timer = setInterval(\"fadeMsg(0)\", MSGTIMER);\n }\n}", "title": "" }, { "docid": "b199bc3d357e5330cb4108f02bc5ff84", "score": "0.61207366", "text": "_createTimeout() {\n this._timeout = setTimeout(() => {\n this._createTimeout();\n this._callback();\n }, this._updateInterval * 1000);\n }", "title": "" }, { "docid": "f45d45bab81e51904bbcf44b550049eb", "score": "0.61127955", "text": "function hideMsg(msg) {\r\n var msg = document.getElementById('msg');\r\n if(!msg.timer) {\r\n msg.timer = setInterval(\"fadeMsg(0)\", MSGTIMER);\r\n }\r\n}", "title": "" }, { "docid": "f45d45bab81e51904bbcf44b550049eb", "score": "0.61127955", "text": "function hideMsg(msg) {\r\n var msg = document.getElementById('msg');\r\n if(!msg.timer) {\r\n msg.timer = setInterval(\"fadeMsg(0)\", MSGTIMER);\r\n }\r\n}", "title": "" }, { "docid": "7de83476711d940bf52199acb475db86", "score": "0.6088117", "text": "_createTimeout() {\n this._timeout = setTimeout(() => {\n this._createTimeout();\n this._callback();\n }, this._updateInterval * 1000);\n }", "title": "" }, { "docid": "85ad7b950debbfc2531e3eb7ce03f547", "score": "0.6083283", "text": "function fakeMessage(reply) {\n if ($('.message-input').val() != '') {\n return false;\n }\n $('<div class=\"message loading new\"><figure class=\"avatar\"><img src=\"img/bat.png\" /></figure><span></span></div>').appendTo($('.mCSB_container'));\n updateScrollbar();\n\n setTimeout(function() {\n $('.message.loading').remove();\n //console.log(reply[\"data\"][\"messages\"][0][\"unstructured\"][\"text\"]);\n $('<div class=\"message new\"><figure class=\"avatar\"><img src=\"img/bat.png\" /></figure>' + reply + '</div>').appendTo($('.mCSB_container')).addClass('new');\n setDate();\n updateScrollbar();\n i++;\n }, 1000 + (Math.random() * 20) * 100);\n\n}", "title": "" }, { "docid": "7f5e153526abb369c9abfea92505cc79", "score": "0.60607654", "text": "function timeoutClear() {\n clearTimeout(timeout);\n}", "title": "" }, { "docid": "af6afb8e40afaa8c8a36bc3e3b9c66b5", "score": "0.60454684", "text": "process({ action }, dispatch) {\n const arrMsgs = action.payload;\n setTimeout(() => {\n dispatch(notifyRemove(arrMsgs));\n }, DISPLAY_TIME);\n }", "title": "" }, { "docid": "4739306c08f4967cf40bcd979ea1b797", "score": "0.60407346", "text": "function actually_setTimeout() {\n data.id = setTimeout( function(){ data.fn(); }, delay );\n }", "title": "" }, { "docid": "634a14e32434393c23575ec5588fb1f6", "score": "0.60323864", "text": "function hideMsg(msg) {\r\r\n var msg = document.getElementById('msg');\r\r\n if(!msg.timer) {\r\r\n msg.timer = setInterval(\"fadeMsg(0)\", MSGTIMER);\r\r\n }\r\r\n}", "title": "" }, { "docid": "b68abf871206bb7dd5c4d76f94c21840", "score": "0.6022228", "text": "function setZeroTimeout(fn) {\n timeouts.push(fn);\n postMessage(messageName, \"*\");\n }", "title": "" }, { "docid": "89db51d24f67eb5945f4e8cfff89f41b", "score": "0.600196", "text": "function actually_setTimeout() {\n data.id = setTimeout( function(){ data.fn(); }, delay );\n }", "title": "" }, { "docid": "89db51d24f67eb5945f4e8cfff89f41b", "score": "0.600196", "text": "function actually_setTimeout() {\n data.id = setTimeout( function(){ data.fn(); }, delay );\n }", "title": "" }, { "docid": "a239caebdc1b08a041439ebd8d8cf01f", "score": "0.6001527", "text": "function sampleFunction() { //\n messages = setTimeout(alertFunc, 1000); //\n } //", "title": "" }, { "docid": "770dccd5f6253fb113c1d20326ab78c4", "score": "0.6000436", "text": "function setZeroTimeout(fn) {\n timeouts.push(fn);\n window.postMessage(messageName, \"*\");\n }", "title": "" }, { "docid": "7889a2ba3076cb6b81df836f2904b12b", "score": "0.59887576", "text": "message(elt, text, typeClass){\n let textForm = document.querySelector(elt);\n var message = document.createElement(\"p\");\n message.classList.add(typeClass);\n message.textContent = text;\n textForm.appendChild(message);\n setTimeout(()=> {\n message.style.display = \"none\";\n }, 2000)\n }", "title": "" }, { "docid": "33f85fb4a3b8566c427a982966c3ef96", "score": "0.5987869", "text": "addNewMessage() {\n const newMsg = {\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\n text: this.userNewMessage,\n status: 'sent'\n }\n console.log(newMsg);\n this.contacts[this.activeContact].messages.push(newMsg);\n this.userNewMessage = '';\n\n //arrow function per avere in automatico dopo un secondo come risposta un messaggio dal computer\n setTimeout(() => {\n const newReplyMsg = {\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\n text: 'Ok',\n status: 'received' \n }\n \n this.contacts[this.activeContact].messages.push(newReplyMsg);\n\n }, 1000);\n }", "title": "" }, { "docid": "9d10bf7d4d8a87a1692110e473b6175b", "score": "0.5968565", "text": "function removeWaitTime(timeToRemove: double) {\n\twaitTime -= timeToRemove;\n}", "title": "" }, { "docid": "d8deda21c2e3a15f7244148baddc6fcf", "score": "0.5967562", "text": "function removeAlert() {\n\t\tsetTimeout(()=> document.querySelector('.alert').remove(),2500);\n\t}", "title": "" }, { "docid": "00fdbff7b3377762364c9047ff0210b4", "score": "0.5943051", "text": "function removeText () {\n setTimeout( function (){\n document.getElementById(\"comment\").innerHTML = \"\";\n document.getElementById(\"result\").innerHTML = \"\";\n }, 5000);\n}", "title": "" }, { "docid": "3f6b5e076751f9478d98a6fe8dcbb68e", "score": "0.5942359", "text": "function resetMessageTimer(check){\n message_sent[check] = true;\n setTimeout(function(){\n message_sent[check] = false;\n }, slack_options.message_reset);\n}", "title": "" }, { "docid": "53f888defb98e63cf82c22f679ab4bb3", "score": "0.5926057", "text": "setTimeout(callback, timeout) {\n const handle = window.setTimeout(callback, timeout)\n this.timeoutIds.push(handle)\n return () => window.clearTimeout(handle)\n }", "title": "" }, { "docid": "713978c18bfe35ad14154f970fc655a6", "score": "0.5915294", "text": "function clearExistingTimeout () {\n\t\t\tif ( timeoutID ) {\n\t\t\t\tclearTimeout(timeoutID);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8ec909d189b9da2d83a44ce224c6e28e", "score": "0.5896191", "text": "function doPoll(){\n getMessages();\n setTimeout(doPoll,5000);\n}", "title": "" }, { "docid": "f0fe2d396407c04d69ec19cd0586ffc4", "score": "0.58904946", "text": "function clearMessages() {\n// const messagesElement = document.querySelector('#messages');\n// while (messagesElement.hasChildNodes()) {\n// messagesElement.removeChild(messagesElement.lastChild);\n// }\n}", "title": "" }, { "docid": "c0c9b156da25a65e8430b2bff8b36b4e", "score": "0.5882813", "text": "process({ action }, dispatch) {\n const msg = action.payload;\n setTimeout(() => {\n dispatch(notifyRemove([msg]));\n }, DISPLAY_TIME);\n }", "title": "" }, { "docid": "e51c5833b0dc6ce2f6e84edb5b99e738", "score": "0.5876713", "text": "setTimeout(a_timeout){\n this.timeout = a_timeout;\n }", "title": "" }, { "docid": "5df0f128b4729a59e1d1ec7b82119c87", "score": "0.5869476", "text": "function messageTimer(){\n// check if there is a new message\nif(checkMessage()){\n\t// check if it can be decoded properly\n\tif (decodeMessage()){\n\t\t// check if it is conform the security requirements\n\t\tif (checkSecurity()){\n\t\t\t// process it\n\t\t\tprocessMessage();\n\t\t}\t\t\t\t\t\n\t}\t\t\t\t\n}\n// Only sent if an ack was received for the last transmitted message.\nif (checkAck()){\n\t// send anything that might be in the out queue\n\tsendMessage();\n}\n}", "title": "" }, { "docid": "5e6ccfd64e65e1ee483a140511993e3d", "score": "0.58596575", "text": "function clearDelayTimeouts() {\n clearTimeout(showTimeoutId);\n clearTimeout(hideTimeoutId);\n }", "title": "" }, { "docid": "54ed2dcdda3beb24fd99c98519976b99", "score": "0.5854268", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "54ed2dcdda3beb24fd99c98519976b99", "score": "0.5854268", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "866676602f6f07d2a298d04eda6c47f9", "score": "0.5854203", "text": "function show_message(message_text, message_type){\n $('#message').html('<p>' + message_text + '</p>').attr('class', message_type);\n $('#message_container').show();\n if (typeof timeout_message !== 'undefined'){\n window.clearTimeout(timeout_message);\n }\n timeout_message = setTimeout(function(){\n hide_message();\n }, 8000);\n}", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.5844967", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.5844967", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.5844967", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.5844967", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.5844967", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.5844967", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "e61b3516af4f267f20e56099bea9cd14", "score": "0.58431417", "text": "function timeMsg() {\n \tvar t=setTimeout(\"alertMsgTO()\",3000);\n}", "title": "" }, { "docid": "01c5f73283cee646f0fe8a45acdad09c", "score": "0.583121", "text": "function auto_removing_tag(id, message, timeout) {\n\treturn util.format(\" \\\n\t\t<span id=\\\"%s\\\"> %s \\\n\t\t\t<script> \\\n\t\t\t\ttoastr.error(\\\"%s\\\"); \\\n\t\t\t\tsetTimeout(function() { \\\n\t\t\t\t\t$(\\\"#%s\\\").remove(); \\\n\t\t\t\t}, %d); \\\n\t\t\t</script> \\\n\t\t</span>\", id, message, message, id, timeout);\n}", "title": "" }, { "docid": "b0187a3571bfeb093dc6f8f0f27c5d9b", "score": "0.5831177", "text": "function clear() {\n\t timeoutID = undefined;\n\t }", "title": "" }, { "docid": "12182a412cc412cd9982911ba7f796db", "score": "0.5829448", "text": "function hideMsg(msg) {\n\tvar msg = document.getElementById('msg');\n\tif (!msg.timer) {\n\t\tmsg.timer = setInterval(\"fadeMsg(0)\", MSGTIMER);\n\t}\n}", "title": "" }, { "docid": "c4db2cc89a37326dfe0bbe85021267cd", "score": "0.5827024", "text": "queueTimeoutHandler() {\n this.queueTimeoutId = undefined;\n this.flush();\n }", "title": "" }, { "docid": "d039df71fe6811f431bf1a07fc6d2bc4", "score": "0.58264565", "text": "function updateMessage(){\n\n setTimeout( function(){\n\n //Set all id in the array\n var arrayIDs = $('#newMessage').children().map(function() {\n return parseInt(this.id);\n }).get();\n\n //Get the bigger value in the array\n var lastID = Math.max.apply(Math, arrayIDs);\n\n //Get $_GET value\n var group = $_GET('g');\n\n //Ajax query to charge new message\n $.ajax({\n url : \"getMessage.php?id=\" + lastID + \"&g=\" + group,//Url of the page to get message\n type : \"GET\", //The type of sending data\n success : function(html){\n $('#newMessage').append(html);\n }\n });\n\n updateMessage();\n\n }, 1500);\n\n}", "title": "" }, { "docid": "3b894caa72b631a21a76cee50d85f259", "score": "0.5825807", "text": "componentDidUpdate(){\n const timer = setTimeout(()=> {\n this.loadMessages();\n }, 60000);\n return () => clearTimeout(timer);\n }", "title": "" }, { "docid": "5dfdc30e96082718318e6da038e24a4c", "score": "0.58091456", "text": "function remove() {\n clearTimeout(timeout);\n // remove only if node is appended to dom\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }", "title": "" }, { "docid": "1336adaf749690c6915dc428417e9d42", "score": "0.58071077", "text": "printMessage(message, className) {\n const div = document.createElement('div');\n div.classList = className;\n div.appendChild(document.createTextNode(message));\n \n const messagesDiv = document.querySelector('.messages');\n messagesDiv.appendChild(div);\n\n setTimeout(() => {\n document.querySelector('.messages div').remove();\n }, 2000);\n }", "title": "" }, { "docid": "6cb710a3a63c42d4925b779d893a4f1b", "score": "0.5803778", "text": "clear_() {\n if (this.lastTimeoutId_) {\n Services.timerFor(this.win).cancel(this.lastTimeoutId_);\n this.lastTimeoutId_ = null;\n }\n }", "title": "" }, { "docid": "ed0415ab6b356de35d0067baf475b427", "score": "0.57975274", "text": "function clear() {\r\n timeout_id = undefined;\r\n }", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.57808286", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.57808286", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.57808286", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.57808286", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.57808286", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "004187113b24f98af9217eb6c1fa1720", "score": "0.57781655", "text": "function setTime() {\n var secondsLeft = 5;\n var timerInterval = setInterval(function() {\n secondsLeft--;\n \n if(secondsLeft === 0) {\n clearInterval(timerInterval);\n sendMessage();\n }\n }, 1000);\n}", "title": "" }, { "docid": "0309a5d6a2f92d99461c05af82056f0d", "score": "0.5768625", "text": "function clearTimeouts() {\n while (timeouts.length) {\n clearTimeout(timeouts.pop());\n }\n}", "title": "" }, { "docid": "5aead140ff12725af62b70ed49d09641", "score": "0.57613355", "text": "function _clearDelayTimeouts() {\n var _ref = this._(key),\n showTimeout = _ref.showTimeout,\n hideTimeout = _ref.hideTimeout;\n\n clearTimeout(showTimeout);\n clearTimeout(hideTimeout);\n}", "title": "" }, { "docid": "82a61dc4fbde4bca0bbad3bc70ed72a8", "score": "0.5759983", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "82a61dc4fbde4bca0bbad3bc70ed72a8", "score": "0.5759983", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "7444306c6418101e1ab3acb9408cac68", "score": "0.57593304", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "7444306c6418101e1ab3acb9408cac68", "score": "0.57593304", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "7444306c6418101e1ab3acb9408cac68", "score": "0.57593304", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "7444306c6418101e1ab3acb9408cac68", "score": "0.57593304", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "7444306c6418101e1ab3acb9408cac68", "score": "0.57593304", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "90bc5a1ecd620cafa35fd48c990e9325", "score": "0.5752918", "text": "function timeout(email) {\n window.timer = $timeout(function () {\n $scope.acpt = false;\n $scope.decln = false;\n socket.emit('timeout', email)\n }, 35000);\n }", "title": "" }, { "docid": "a5c021f1c246d0ac3431be0bb57b3532", "score": "0.57496136", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "a5c021f1c246d0ac3431be0bb57b3532", "score": "0.57496136", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "21793d99f3cf69487bf4a8f5bf77a625", "score": "0.57461923", "text": "function setCallBackTimeOut(delay) {\n $timeout(function () {\n terminalText1 = document.querySelector('.terminalText1');\n animationText.style.position = 'absolute';\n animationText.style.top = '50%';\n animationText.style.left = '50%';\n terminalText1.className += ' centerTextAfterAnim';\n blinkPipe.parentNode.removeChild(blinkPipe);\n $rootScope.$broadcast('terminalTextFinish');\n }, delay);\n }", "title": "" } ]
0bcb88c273ef881eb9718c3f753bdd83
setup events to detect gestures on the document
[ { "docid": "5c675c8854693fa21b0d96315a878ecb", "score": "0.7626449", "text": "function setup() {\n\t if(ionic.Gestures.READY) {\n\t return;\n\t }\n\t\n\t // find what eventtypes we add listeners to\n\t ionic.Gestures.event.determineEventTypes();\n\t\n\t // Register all gestures inside ionic.Gestures.gestures\n\t for(var name in ionic.Gestures.gestures) {\n\t if(ionic.Gestures.gestures.hasOwnProperty(name)) {\n\t ionic.Gestures.detection.register(ionic.Gestures.gestures[name]);\n\t }\n\t }\n\t\n\t // Add touch events on the document\n\t ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_MOVE, ionic.Gestures.detection.detect);\n\t ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_END, ionic.Gestures.detection.detect);\n\t\n\t // ionic.Gestures is ready...!\n\t ionic.Gestures.READY = true;\n\t }", "title": "" } ]
[ { "docid": "3630ee0ba01c0ab04348f188c0e4a6c0", "score": "0.75595564", "text": "function setup() {\n if (GestureDetector.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Event$1.determineEventTypes();\n\n // Register all gestures inside GestureDetector.gestures\n Utils.each(GestureDetector.gestures, function (gesture) {\n Detection.register(gesture);\n });\n\n // Add touch events on the document\n Event$1.onTouch(GestureDetector.DOCUMENT, EVENT_MOVE, Detection.detect);\n Event$1.onTouch(GestureDetector.DOCUMENT, EVENT_END, Detection.detect);\n\n // GestureDetector is ready...!\n GestureDetector.READY = true;\n }", "title": "" }, { "docid": "4d8088be31fa12d59efc7d40385af87b", "score": "0.7401305", "text": "function setup() {\n if (GestureDetector.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Event$1.determineEventTypes();\n\n // Register all gestures inside GestureDetector.gestures\n Utils.each(GestureDetector.gestures, function (gesture) {\n Detection.register(gesture);\n });\n\n // Add touch events on the document\n Event$1.onTouch(GestureDetector.DOCUMENT, EVENT_MOVE, Detection.detect);\n Event$1.onTouch(GestureDetector.DOCUMENT, EVENT_END, Detection.detect);\n\n // GestureDetector is ready...!\n GestureDetector.READY = true;\n}", "title": "" }, { "docid": "c6314ca47f06c3298574d1c9e7218cdb", "score": "0.7296803", "text": "function setup() {\r\n if(Hammer.READY) {\r\n return;\r\n }\r\n\r\n // find what eventtypes we add listeners to\r\n Hammer.event.determineEventTypes();\r\n\r\n // Register all gestures inside Hammer.gestures\r\n for(var name in Hammer.gestures) {\r\n if(Hammer.gestures.hasOwnProperty(name)) {\r\n Hammer.detection.register(Hammer.gestures[name]);\r\n }\r\n }\r\n\r\n // Add touch events on the document\r\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\r\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\r\n\tHammer.event.onTouch(window.top, Hammer.EVENT_END, Hammer.detection.detect);\r\n // Hammer is ready...!\r\n Hammer.READY = true;\r\n}", "title": "" }, { "docid": "cde46c0b704e166d40e2706321ab31fb", "score": "0.71596694", "text": "function setup() {\r\n if(Hammer.READY) {\r\n return;\r\n }\r\n\r\n // find what eventtypes we add listeners to\r\n Hammer.event.determineEventTypes();\r\n\r\n // Register all gestures inside Hammer.gestures\r\n for(var name in Hammer.gestures) {\r\n if(Hammer.gestures.hasOwnProperty(name)) {\r\n Hammer.detection.register(Hammer.gestures[name]);\r\n }\r\n }\r\n\r\n // Add touch events on the document\r\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\r\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\r\n\r\n // Hammer is ready...!\r\n Hammer.READY = true;\r\n}", "title": "" }, { "docid": "972d64feb8260a2e7b696d7b5ee1bc8b", "score": "0.7151727", "text": "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n for(var name in Hammer.gestures) {\n if(Hammer.gestures.hasOwnProperty(name)) {\n Hammer.detection.register(Hammer.gestures[name]);\n }\n }\n\n // Add touch events on the document\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "title": "" }, { "docid": "972d64feb8260a2e7b696d7b5ee1bc8b", "score": "0.7151727", "text": "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n for(var name in Hammer.gestures) {\n if(Hammer.gestures.hasOwnProperty(name)) {\n Hammer.detection.register(Hammer.gestures[name]);\n }\n }\n\n // Add touch events on the document\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "title": "" }, { "docid": "8cbfd25bf22299af6242cf851a056317", "score": "0.70930916", "text": "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n for(var name in Hammer.gestures) {\n if(Hammer.gestures.hasOwnProperty(name)) {\n Hammer.detection.register(Hammer.gestures[name]);\n }\n }\n\n // Add touch events on the document\n Hammer.event.onTouch(document, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(document, Hammer.EVENT_END, Hammer.detection.endDetect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "title": "" }, { "docid": "bc43e35689fd4c1eaefa42728b7b16f3", "score": "0.7056578", "text": "function startup() {\n el.addEventListener(\"touchstart\", handleStart, false);\n // el.addEventListener(\"touchend\", handleEnd, false);\n // el.addEventListener( \"touchcancel\", handleCancel, false );\n el.addEventListener(\"touchmove\", handleMove, false);\n}", "title": "" }, { "docid": "1648663c449bbcb58c48c4752a2c8583", "score": "0.70530534", "text": "function setup() {\n if (Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n Hammer.utils.each(Hammer.gestures, function (gesture) {\n Hammer.detection.register(gesture);\n });\n\n // Add touch events on the document\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n }", "title": "" }, { "docid": "4d9c170b8c2c97036c9384425568483e", "score": "0.7043654", "text": "function setup() {\n if (Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n Utils.each(Hammer.gestures, function (gesture) {\n Detection.register(gesture);\n });\n\n // Add touch events on the document\n Event.onTouch(Hammer.DOCUMENT, EVENT_MOVE, Detection.detect);\n Event.onTouch(Hammer.DOCUMENT, EVENT_END, Detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n }", "title": "" }, { "docid": "addb6e3390986bf4ccf1453894328a7a", "score": "0.7010326", "text": "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n Hammer.utils.each(Hammer.gestures, function(gesture){\n Hammer.detection.register(gesture);\n });\n\n // Add touch events on the document\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "title": "" }, { "docid": "addb6e3390986bf4ccf1453894328a7a", "score": "0.7010326", "text": "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n Hammer.utils.each(Hammer.gestures, function(gesture){\n Hammer.detection.register(gesture);\n });\n\n // Add touch events on the document\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "title": "" }, { "docid": "addb6e3390986bf4ccf1453894328a7a", "score": "0.7010326", "text": "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n Hammer.utils.each(Hammer.gestures, function(gesture){\n Hammer.detection.register(gesture);\n });\n\n // Add touch events on the document\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "title": "" }, { "docid": "addb6e3390986bf4ccf1453894328a7a", "score": "0.7010326", "text": "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n Hammer.utils.each(Hammer.gestures, function(gesture){\n Hammer.detection.register(gesture);\n });\n\n // Add touch events on the document\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "title": "" }, { "docid": "afa5b81e65ef9e9846877d83a0c6db65", "score": "0.70068806", "text": "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n Utils.each(Hammer.gestures, function(gesture) {\n Detection.register(gesture);\n });\n\n // Add touch events on the document\n Event.onTouch(Hammer.DOCUMENT, EVENT_MOVE, Detection.detect);\n Event.onTouch(Hammer.DOCUMENT, EVENT_END, Detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "title": "" }, { "docid": "81a6d8ecee47c9ea5227899dd793f6ac", "score": "0.69376624", "text": "setupEventListeners() {\n if (this.config.useTouchEvents) {\n // Disables scrolling on touch devices.\n document.body.addEventListener('touchmove', (event) => {\n event.preventDefault();\n }, false);\n this.element.addEventListener('touchstart', this.startEvent.bind(this));\n this.element.addEventListener('touchend', this.stopEvent.bind(this));\n } else {\n document.addEventListener('mouseleave', this.stopEvent.bind(this));\n this.element.addEventListener('mousedown', this.startEvent.bind(this));\n this.element.addEventListener('mouseup', this.stopEvent.bind(this));\n }\n }", "title": "" }, { "docid": "55a482825074b9b83a040c559aa47bea", "score": "0.6588988", "text": "function startup() {\n var el = gCanvas;\n el.addEventListener('touchstart', onDown, false);\n el.addEventListener('touchend', onUp, false);\n el.addEventListener('touchmove', onMove, false);\n // el.addEventListener('touchstart', handleStart, false);\n // el.addEventListener('touchend', handleEnd, false);\n // el.addEventListener('touchcancel', handleCancel, false);\n // el.addEventListener('touchmove', handleMove, false);\n console.log('initialized.');\n}", "title": "" }, { "docid": "88bb4f2c1665286ee597cec7e28e666b", "score": "0.6550298", "text": "function addListeners(){\n document.getElementById('viewing').addEventListener('touchstart', touchStart);\n document.getElementById('viewing').addEventListener('touchmove', touchMove);\n document.getElementById('viewing').addEventListener('touchend', touchEnd);\n window.addEventListener('resize', resize);\n}", "title": "" }, { "docid": "507038abb33ea8f8a02e1dbe1157fef9", "score": "0.65333134", "text": "function listenForTouch() {\n touchListeners();\n}", "title": "" }, { "docid": "4d7bff950a3db5f4e7df1ee2aa1d6bc4", "score": "0.6527375", "text": "function addTouchEvents() {\n if (Modernizr.touch) {\n $module.swipe({\n swipe: function(event, direction, distance, duration, fingerCount) {\n if (isLocked === false) {\n isLocked = true;\n\n if (direction === \"left\") {\n next();\n } else if (direction === \"right\") {\n prev();\n }\n }\n },\n allowPageScroll: \"vertical\"\n });\n }\n }", "title": "" }, { "docid": "387a790e06bb53fb390e48c383f1bde3", "score": "0.6520815", "text": "function setupEventListeners () {\n console.log(\"setting up event listeners\");\n\n document.getElementById(\"canvas\");\n \n canvas.addEventListener('mousedown', onMouseDown, false);\n canvas.addEventListener('mouseup', onMouseUp, false);\n canvas.addEventListener('mousemove', onMouseMove, false);\n canvas.addEventListener('mousewheel', onMouseWheel, false);\n canvas.addEventListener('DOMMouseScroll', onFFMouseWheel, false);\n canvas.addEventListener('mouseover', onMouseOver, false);\n canvas.addEventListener('keydown', onKeyDown, false);\n}", "title": "" }, { "docid": "aab67e297e07a29dd5362c6ffcef20b4", "score": "0.6466199", "text": "function defineGestures () {\n\n var gestureMap = extend2({}, gestures); /** @todo reduce dependency on lib functions as much as possible */\n //browType = getBrowserClass();\n\n // switch (browType) {\n\n // // Add browser vendor specific code here defining each gesture as a\n // // sequence of events.\n\n // default:\n // break;\n // }\n\n return gestureMap;\n }", "title": "" }, { "docid": "04d2112e3aa44775519c618d0b130dc7", "score": "0.64552855", "text": "function _initListeners() {\n // capture clicks and touches\n window.addEventListener( 'click', ( e ) => captureEvent( e ) )\n window.addEventListener( 'touchstart', ( e ) => captureEvent( e ) )\n }", "title": "" }, { "docid": "c021be0c372c9d59c1d5c6c09c7a91bb", "score": "0.6370677", "text": "init () {\n this.sliderElements.holder.addEventListener('touchstart', (event) => {\n this.start(event)\n })\n this.sliderElements.holder.addEventListener('touchmove', (event) => {\n this.move(event)\n })\n this.sliderElements.holder.addEventListener('touchend', (event) => {\n this.end(event)\n })\n }", "title": "" }, { "docid": "c3701fa0dd2cad19bac26811ef761b3e", "score": "0.63643175", "text": "function touchEventInit(el) {\n el.addEventListener(\"touchstart\" , handleTouchStart , false);\n el.addEventListener(\"touchend\" , handleTouchEnd , false);\n el.addEventListener(\"touchcancel\", handleTouchCancel, false);\n el.addEventListener(\"touchmove\" , handleTouchMove , false); \n}", "title": "" }, { "docid": "7cfee7311d3532992c5e239198e48859", "score": "0.6347237", "text": "function attachEvents(){\n\t$(\"#head\").on('click',head)\n\tdoc.on('keyup',upArrow)\n\n\t$(\"#leftArm\").on('click',leftArm)\n\tdoc.on('keyup',leftArrow)\n\n\t$(\"#rightArm\").on('click',rightArm)\n \tdoc.on('keyup',rightArrow)\n\n\t$(\"#abs\").on('click',abs)\n\tdoc.on('keyup',downArrow)\n}", "title": "" }, { "docid": "d4b99a56f7574663947884fd17e823da", "score": "0.6315355", "text": "function appEvents(){\n $document.on( 'click', '.scroll-up', initUp );\n $document.on( 'mouseOver', '.scroll-up', initUp );\n}", "title": "" }, { "docid": "3a20430f1da50001b6231fdb112260fb", "score": "0.6308705", "text": "function initializeViewportEventListeners() {\r\n\t\t// Handle viewport mouse and keyboards events.\r\n\t\tZ.Utils.addEventListener(document, \"keydown\", keyDownHandler);\r\n\t\tZ.Utils.addEventListener(document, \"keyup\", keyUpHandler);\r\n\t\tif (!Z.mobileDevice) {\r\n\t\t\t// Event handlers for browser contexts with mouse support.\r\n\t\t\tZ.Utils.addEventListener(Z.ViewerDisplay, \"mouseover\", viewerDisplayMouseOverHandler);\r\n\t\t\tZ.Utils.addEventListener(Z.ViewerDisplay, \"mouseout\", viewerDisplayMouseOutHandler);\r\n\t\t\tZ.Utils.addEventListener(Z.ViewerDisplay, \"mousemove\", Z.Utils.preventDefault);\r\n\t\t\tZ.Utils.addEventListener(cD, \"mousedown\", viewportDisplayMouseDownHandler);\r\n\t\t\tZ.Utils.addEventListener(cD, \"mousemove\", Z.Utils.preventDefault);\r\n\t\t} else {\r\n\t\t\t// Event handlers for mobile devices.\r\n\t\t\tZ.Utils.addEventListener(cD, \"touchstart\", viewerDisplayTouchStartHandler);\r\n\t\t\tZ.Utils.addEventListener(cD, \"touchmove\", viewerDisplayTouchMoveHandler);\r\n\t\t\tZ.Utils.addEventListener(cD, \"touchend\", viewerDisplayTouchEndHandler);\r\n\t\t\tZ.Utils.addEventListener(cD, \"touchcancel\", viewerDisplayTouchCancelHandler);\r\n\t\t\tZ.Utils.addEventListener(cD, \"gesturestart\", viewerDisplayGestureStartHandler);\r\n\t\t\tZ.Utils.addEventListener(cD, \"gesturechange\", viewerDisplayGestureChangeHandler);\r\n\t\t\tZ.Utils.addEventListener(cD, \"gestureend\", viewerDisplayGestureEndHandler);\r\n\t\t\t\r\n\t\t\t// The following handler assignment approach is necessary for iOS to properly respond.\r\n\t\t\tdocument.getElementsByTagName(\"body\")[0].onorientationchange = orientationChangeHandler;\r\n\t\t\t//Z.Utils.addEventListener(document, \"onresize\", orientationChangeHandler);\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// Disable right-click / control-click / click-hold menu.\r\n\t\tZ.Utils.addEventListener(bD, \"contextmenu\", Z.Utils.preventDefault);\r\n\t\tZ.Utils.addEventListener(vD, \"contextmenu\", Z.Utils.preventDefault);\r\n\t\tif (wD) { Z.Utils.addEventListener(wD, \"contextmenu\", Z.Utils.preventDefault); }\r\n\t\tif (hD) { Z.Utils.addEventListener(hD, \"contextmenu\", Z.Utils.preventDefault); }\r\n\t}", "title": "" }, { "docid": "687454650793f82f3ee5574eae02e946", "score": "0.6301006", "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": "687454650793f82f3ee5574eae02e946", "score": "0.6301006", "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": "850811bf965dacf19a516032e7bf62c0", "score": "0.629006", "text": "function bindEvents() {\r\n document.addEventListener('mousemove', onMouseMove);\r\n document.addEventListener('touchmove', onTouchMove);\r\n document.addEventListener('touchstart', onTouchMove);\r\n \r\n window.addEventListener('resize', onWindowResize);\r\n }", "title": "" }, { "docid": "1d629286f772c6b05be3b7e0ee9e9449", "score": "0.6276313", "text": "function initEvents() {\n var bind = _this.h.addEventListener;\n var eventTarget = params.eventTarget === 'wrapper' ? _this.wrapper : _this.container;\n //Touch Events\n if (! (_this.browser.ie10 || _this.browser.ie11)) {\n if (_this.support.touch) {\n bind(eventTarget, 'touchstart', onTouchStart);\n bind(eventTarget, 'touchmove', onTouchMove);\n bind(eventTarget, 'touchend', onTouchEnd);\n }\n if (params.simulateTouch) {\n bind(eventTarget, 'mousedown', onTouchStart);\n bind(document, 'mousemove', onTouchMove);\n bind(document, 'mouseup', onTouchEnd);\n }\n }\n else {\n bind(eventTarget, _this.touchEvents.touchStart, onTouchStart);\n bind(document, _this.touchEvents.touchMove, onTouchMove);\n bind(document, _this.touchEvents.touchEnd, onTouchEnd);\n }\n\n //Resize Event\n if (params.autoResize) {\n bind(window, 'resize', _this.resizeFix);\n }\n //Slide Events\n addSlideEvents();\n //Mousewheel\n _this._wheelEvent = false;\n if (params.mousewheelControl) {\n if (document.onmousewheel !== undefined) {\n _this._wheelEvent = 'mousewheel';\n }\n if (!_this._wheelEvent) {\n try {\n new WheelEvent('wheel');\n _this._wheelEvent = 'wheel';\n } catch (e) {}\n }\n if (!_this._wheelEvent) {\n _this._wheelEvent = 'DOMMouseScroll';\n }\n if (_this._wheelEvent) {\n bind(_this.container, _this._wheelEvent, handleMousewheel);\n }\n }\n\n //Keyboard\n function _loadImage(src) {\n var image = new Image();\n image.onload = function () {\n if (typeof _this === 'undefined' || _this === null) return;\n if (_this.imagesLoaded !== undefined) _this.imagesLoaded++;\n if (_this.imagesLoaded === _this.imagesToLoad.length) {\n _this.reInit();\n if (params.onImagesReady) _this.fireCallback(params.onImagesReady, _this);\n }\n };\n image.src = src;\n }\n\n if (params.keyboardControl) {\n bind(document, 'keydown', handleKeyboardKeys);\n }\n if (params.updateOnImagesReady) {\n _this.imagesToLoad = $$('img', _this.container);\n\n for (var i = 0; i < _this.imagesToLoad.length; i++) {\n _loadImage(_this.imagesToLoad[i].getAttribute('src'));\n }\n }\n }", "title": "" }, { "docid": "7c8b19fb9f647257a4c09bf784766bac", "score": "0.62466174", "text": "function bindEvents() {\n \n Edils.addEvent(window, \"load\", bindWindowLoadedHandler);\n Edils.addEvent(window, \"resize\", bindWindowResizingHandler);\n Edils.addEvent(window, \"hashchange\", bindWindowHashchangeHandler); // ie8\n \n \"click touchstart\".split(\" \").forEach(function(type) {\n Edils.addEvent(dom.controlsNext, type, bindControlsClickedNextHandler);\n Edils.addEvent(dom.controlsPrev, type, bindControlsClickedPrevHandler);\n Edils.addEvent(dom.controlsPlay, type, bindControlsClickedPlayHandler);\n Edils.addEvent(dom.controlsStop, type, bindControlsClickedStopHandler);\n \n if( support.requestFullscreen && support.cancelFullScreen ) {\n Edils.addEvent(dom.controlsExpand, type, bindControlsClickedExpandHandler);\n }\n });\n \n if( config.keyboard ) {\n Edils.addEvent(document, \"keydown\", bindDocumentKeyDownHandler);\n }\n }", "title": "" }, { "docid": "318085ee9cc699272a148f5c4fa0af59", "score": "0.623968", "text": "function addListeners() {\n prevBtn.on(\"click\", showPrevSlide);\n nextBtn.on(\"click\", showNextSlide);\n registerEventHandler(prevBtn, \"click\", showPrevSlide);\n registerEventHandler(nextBtn, \"click\", showNextSlide);\n \n if (mergedOptions.keyboardShortCuts) {\n var keydownHandler = function (e) {\n switch (e.which) {\n case 37: // left\n case 38: // up\n showPrevSlide(e);\n break;\n case 39: // right\n case 40: // down\n showNextSlide(e);\n break;\n default: return; // exit this handler for other keys\n }\n e.preventDefault(); // prevent the default action (scroll / move caret)\n };\n $(document).on(\"keydown\", keydownHandler);\n registerEventHandler($(document), \"keydown\", keydownHandler);\n }\n \n if (mergedOptions.mousewheelSupport) {\n // detect available wheel event\n var wheelSupport = \"onwheel\" in document.createElement(\"div\") ? \"wheel\" : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? \"mousewheel\" : // Webkit and IE support at least \"mousewheel\"\n \"DOMMouseScroll\"; // let's assume that remaining browsers are older Firefox\n\n var wheelHandlerFunction = function(event){\n if (event.wheelDelta) {\n if (event.wheelDelta > 0) {\n //console.log(\"scroll up\");\n showPrevSlide(event);\n } else {\n //console.log(\"scroll down\");\n showNextSlide(event);\n }\n } else {\n var firefoxDelta = event.deltaY;\n if (firefoxDelta) {\n if (firefoxDelta > 0) {\n //console.log(\"scroll down\");\n showNextSlide(event);\n } else {\n //console.log(\"scroll up\");\n showPrevSlide(event);\n }\n }\n }\n };\n $(document).on(wheelSupport, wheelHandlerFunction);\n registerEventHandler($(document), wheelSupport, wheelHandlerFunction);\n }\n \n if (mergedOptions.touchGesture && mergedOptions.touchPlugin) {\n var touchPlugin = mergedOptions.touchPlugin;\n switch (touchPlugin) {\n case \"zepto\":\n var pages = visualContainer.children();\n pages.on(\"swipeLeft\", showNextSlide);\n pages.on(\"swipeRight\", showPrevSlide);\n \n registerEventHandler(pages, \"swipeLeft\", showNextSlide);\n registerEventHandler(pages, \"swipeRight\", showPrevSlide);\n break;\n case 'jquerymobile':\n var pages = visualContainer.children();\n pages.on(\"swipeleft\", showNextSlide);\n pages.on(\"swiperight\", showPrevSlide);\n registerEventHandler(pages, \"swipeleft\", showNextSlide);\n registerEventHandler(pages, \"swiperight\", showPrevSlide);\n break;\n case 'hammer':\n var pages = visualContainer.children().hammer();\n pages.on(\"swipeleft\", showNextSlide);\n pages.on(\"swiperight\", showPrevSlide);\n registerEventHandler(pages, \"swipeleft\", showNextSlide);\n registerEventHandler(pages, \"swiperight\", showPrevSlide);\n break;\n case \"toe\":\n var pages = visualContainer.children();\n var handleSwipe = function (e) {\n var direction = e.direction;\n if (direction === \"left\") {\n showNextSlide(e);\n } else if (direction === \"right\") {\n showPrevSlide(e);\n }\n return false;\n };\n pages.on('swipe', handleSwipe);\n registerEventHandler(pages, \"swipe\", handleSwipe);\n break;\n case \"doubletap\":\n var pages = visualContainer.children();\n var swipeEventObj = pages.addSwipeEvents();\n swipeEventObj.on('swipeleft', showNextSlide).on(\"swiperight\", showPrevSlide);\n registerEventHandler(swipeEventObj, \"swipeleft\", showNextSlide);\n registerEventHandler(swipeEventObj, \"swiperight\", showPrevSlide);\n break;\n case \"zeptoSwipeMy\":\n var pages = $(\"div.page\");\n if (mergedOptions.orientation == \"horizontal\") {\n pages.on(\"swipeLeftMy\", showNextSlide);\n pages.on(\"swipeRightMy\", showPrevSlide);\n \n registerEventHandler(pages, \"swipeLeftMy\", showNextSlide);\n registerEventHandler(pages, \"swipeRightMy\", showPrevSlide);\n } else {\n pages.on(\"swipeUpMy\", showNextSlide);\n pages.on(\"swipeDownMy\", showPrevSlide);\n \n registerEventHandler(pages, \"swipeUpMy\", showNextSlide);\n registerEventHandler(pages, \"swipeDownMy\", showPrevSlide);\n }\n break;\n default:\n console.warn(\"The touch plugin is not supported yet.\", touchPlugin);\n break;\n }\n }\n \n // There is no transitionstart event yet, we create this custome event handler.\n var transitionStartHandler = function(e, eventInfo){\n var oldPageIndex = currentPageIndex;\n if (eventInfo.slideType === \"next\") {\n currentPageIndex++;\n } else {\n currentPageIndex--;\n }\n transitionProgressObject.slideType = eventInfo.slideType;\n transitionProgressObject.element = eventInfo.element;\n updatePager();\n \n if(!isTransitionSupported) {\n transitionProgressObject.element.trigger(transitionEndName);\n }\n // Trigger the custom pageselected event.\n console.log('this.element', element);\n element.trigger({\n \"type\":'pageselected',\n \"detail\": {\n \"oldPageIndex\": oldPageIndex,\n \"currentPageIndex\": currentPageIndex,\n \"element\":transitionProgressObject.element\n }\n });\n return false;\n };\n visualContainer.on(\"transition_start\", transitionStartHandler);\n registerEventHandler(visualContainer, \"transition_start\", transitionStartHandler);\n \n /**\n * Add event listener for the transition end event.\n * @param {Event} e\n * @return {Boolean} false\n */\n var transitionEndHandler = function(e) {\n console.log(\"transition end........,\", e.target, e);\n if (transitionProgressObject.element && transitionProgressObject.slideType === \"next\") {\n visualContainer.prepend(transitionProgressObject.element);\n }\n var pageElement = $(e.target) || transitionProgressObject.element;\n if (pageElement) {\n // Remove the .transition CSS class before remove the transform CSS rule. !important!\n pageElement.removeClass(\"slideLeft\").removeClass(\"transition\").removeClass(\"slideRight\").removeClass(\"slideUp\").removeClass(\"slideDown\");\n }\n \n resetTransitionProgressObject();\n return false;\n };\n \n var visualContainerChildren = visualContainer.children();\n visualContainerChildren.on(transitionEndName, transitionEndHandler);\n registerEventHandler(visualContainerChildren, transitionEndName, transitionEndHandler);\n }", "title": "" }, { "docid": "be44c50fc29e64110178b71a2e973fa0", "score": "0.62332517", "text": "function events() {\n var global = $('.global'), //global button\n global_wrap = $('.global-block-wrap'), //global block\n nextButton = $('.next-slide-button'),\n menuItem = $('.menu-item').find('a');\n scrollOn();\n navLinkArrows();\n $(window).on({\n resize: function() {\n winHeight = $(window).height();\n resizeHeights();\n }\n });\n $(\".slide-item\").swipe({\n swipe: function(event, direction) {\n if (direction == \"down\") {\n nextSlide(false);\n }\n if (direction == \"up\") {\n nextSlide(true);\n }\n },\n threshold: 50,\n fingers: 'all'\n });\n }", "title": "" }, { "docid": "76a82ba9b33338b22af8be9cf1b7ee32", "score": "0.6226694", "text": "setEventListeners() {\n $('body').on('click','[data-open-pane]',this.onOpenPane);\n $('body').on('click','.pane__item, .tutorial__menu-item',this.onPaneMenuItemClick);\n $('body').on('click', '[data-skip-to-page]',this.onSkipToPageClick.bind(this));\n $('body').on('click activate','[data-close]',this.onCloseClick);\n this.$container.on('resize',this.setViewPortSize.bind(this));\n this.app.on('load:book',this.onBookLoaded.bind(this));\n this.settings.on('change:letterboxing',this.onLetterboxSettingsChange.bind(this));\n this.settings.on('change:leftHandMode',this.onLeftHandModeSettingsChange.bind(this));\n }", "title": "" }, { "docid": "61b3926ce49c13b81decb39b42f01a22", "score": "0.61724484", "text": "setup() {\n window.addEventListener(\"mousedown\", this._onMouseDown);\n window.addEventListener(\"mouseup\", this._onMouseUp);\n }", "title": "" }, { "docid": "cc1988aa279515b48fb016a967212c0f", "score": "0.61699265", "text": "listen() {\n const { trackTouch } = this.options\n\n if (!hasTouch || trackTouch) {\n ensurePointerEvents()\n EventManager.on('resize', this.onResize)\n EventManager.on('pointerinview', this.onPointerInView)\n EventManager.on('pointermove', this.onPointerMove)\n EventManager.on('pointerover', this.onPointerOver)\n EventManager.on('pointerdown', this.onPointerDown)\n EventManager.on('pointerup', this.onPointerUp)\n }\n }", "title": "" }, { "docid": "bb7daa71234458a75d92f0b3d9d0403f", "score": "0.61595315", "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": "ef4e952e4974b096e464088e43cc3745", "score": "0.61593467", "text": "function setupEventlistner() {\n window.addEventListener('resize', resizedFunction);\n window.addEventListener(\"scroll\", scrolled);\n document.querySelector('.media-button').addEventListener('click', displayMenuFunction);\n}", "title": "" }, { "docid": "b7f3a1314d28e35ffe99e6ac51076181", "score": "0.6158373", "text": "function setupListeners(tap) {\n setInterval(orientationChangeHandler, 500); //Note: what's the best in terms of performance here? Should it even be considered?\n if (tap) { //Tap required for movement.\n document.addEventListener('touchstart', function() {\n if (touchCount === 0) {\n applyEventListeners();\n }\n touchCount++;\n }, false);\n document.addEventListener('touchend', function() {\n if (touchCount === 1) {\n detachEventListeners();\n }\n touchCount--;\n }, false);\n } else if (tap === false) { //Tap stops all movement\n document.addEventListener('touchstart', function() {\n if (touchCount === 1) {\n detachEventListeners();\n }\n touchCount--;\n }, false );\n document.addEventListener('touchend', function() {\n if (touchCount === 0) {\n applyEventListeners();\n }\n touchCount++;\n } , false);\n } else {\n applyEventListeners();\n }//null or undefined --> always move\n }", "title": "" }, { "docid": "a340732c183c501ab453441557f66fa9", "score": "0.61513346", "text": "function initEvents() {\n var bind = _this.h.addEventListener;\n \n //Touch Events\n if (!_this.browser.ie10) {\n if (_this.support.touch) {\n bind(_this.wrapper, 'touchstart', onTouchStart);\n bind(_this.wrapper, 'touchmove', onTouchMove);\n bind(_this.wrapper, 'touchend', onTouchEnd);\n }\n if (params.simulateTouch) {\n bind(_this.wrapper, 'mousedown', onTouchStart);\n bind(document, 'mousemove', onTouchMove);\n bind(document, 'mouseup', onTouchEnd);\n }\n }\n else {\n bind(_this.wrapper, _this.touchEvents.touchStart, onTouchStart);\n bind(document, _this.touchEvents.touchMove, onTouchMove);\n bind(document, _this.touchEvents.touchEnd, onTouchEnd);\n }\n\n //Resize Event\n if (params.autoResize) {\n bind(window, 'resize', _this.resizeFix);\n }\n //Slide Events\n addSlideEvents();\n //Mousewheel\n _this._wheelEvent = false;\n if (params.mousewheelControl) {\n if ( document.onmousewheel !== undefined ) {\n _this._wheelEvent = \"mousewheel\";\n }\n try {\n WheelEvent(\"wheel\");\n _this._wheelEvent = \"wheel\";\n } catch (e) {}\n if ( !_this._wheelEvent ) {\n _this._wheelEvent = \"DOMMouseScroll\";\n }\n\n if (_this._wheelEvent) {\n bind(_this.container, _this._wheelEvent, handleMousewheel);\n }\n }\n\n //Keyboard\n if (params.keyboardControl) {\n bind(document, 'keydown', handleKeyboardKeys);\n }\n if (params.updateOnImagesReady) {\n _this.imagesToLoad = $$('img', _this.container);\n\n for (var i=0; i<_this.imagesToLoad.length; i++) {\n _loadImage(_this.imagesToLoad[i].getAttribute('src'))\n }\n }\n function _loadImage(src) {\n var image = new Image();\n image.onload = function(){\n _this.imagesLoaded++;\n if (_this.imagesLoaded==_this.imagesToLoad.length) {\n _this.reInit();\n if (params.onImagesReady) _this.fireCallback(params.onImagesReady, _this);\n }\n }\n image.src = src;\n }\n }", "title": "" }, { "docid": "fbb40386ada7b4514458f6dec667864a", "score": "0.6146519", "text": "function onDocumentTouchStart() {\n if (currentInput.isTouch) {\n return;\n }\n\n currentInput.isTouch = true;\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n }", "title": "" }, { "docid": "04a71ce2830524d18713e92f74c64be8", "score": "0.6142644", "text": "function onDocumentTouchStart() {\n if (currentInput.isTouch) {\n return;\n }\n\n currentInput.isTouch = true;\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}", "title": "" }, { "docid": "04a71ce2830524d18713e92f74c64be8", "score": "0.6142644", "text": "function onDocumentTouchStart() {\n if (currentInput.isTouch) {\n return;\n }\n\n currentInput.isTouch = true;\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}", "title": "" }, { "docid": "04a71ce2830524d18713e92f74c64be8", "score": "0.6142644", "text": "function onDocumentTouchStart() {\n if (currentInput.isTouch) {\n return;\n }\n\n currentInput.isTouch = true;\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}", "title": "" }, { "docid": "04a71ce2830524d18713e92f74c64be8", "score": "0.6142644", "text": "function onDocumentTouchStart() {\n if (currentInput.isTouch) {\n return;\n }\n\n currentInput.isTouch = true;\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}", "title": "" }, { "docid": "04a71ce2830524d18713e92f74c64be8", "score": "0.6142644", "text": "function onDocumentTouchStart() {\n if (currentInput.isTouch) {\n return;\n }\n\n currentInput.isTouch = true;\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}", "title": "" }, { "docid": "54288e99ee15c7329c324ce68c58f1de", "score": "0.61182547", "text": "enable() {\n this.context.addEventListener(moveEvent, this.moveHandler);\n this.context.addEventListener(startEvent, this.startHandler);\n this.context.addEventListener(stopEvent, this.stopHandler);\n this.context.addEventListener('touchcancel', this.cleanupHandler);\n }", "title": "" }, { "docid": "c6aae9fb6492b6b559a643d8fa29c948", "score": "0.6072184", "text": "function init_detector() {\n $(\"#detector\").mousedown(canvas_mousedown);\n $(\"#detector\").mouseup(canvas_mouseup);\n $(\"#detector\").mousemove(canvas_mousemove);\n $(\"#detector\").mouseover(canvas_mouseover);\n $(\"#detector\").mouseout(canvas_mouseout);\n}", "title": "" }, { "docid": "04874e8e5444ff0e6f9ec90c265ce020", "score": "0.6066714", "text": "setEventListenersLogic() {\n let self = this;\n this.canvas.addEventListener(\"mousedown\", (e) => self.setDragger(e, self));\n this.canvas.addEventListener(\"mousemove\", (e) => self.startDragging(e, self));\n this.canvas.addEventListener(\"mouseup\", (e) => self.unsetDragger(e, self));\n this.canvas.addEventListener(\"mouseout\", (e) => self.unsetDragger(e, self));\n }", "title": "" }, { "docid": "8c4d3a0d1728b78209a894cbf08acd72", "score": "0.60536397", "text": "function init() {\n\n //touch events\n canvas.addEventListener('touchstart',dragStartTouch);\n canvas.addEventListener('touchend',dragStopTouch);\n canvas.addEventListener('touchmove',dragTouch);\n //mouse events\n canvas.addEventListener('mousedown',dragStartMouse);\n canvas.addEventListener('mouseup',dragStopMouse);\n canvas.addEventListener('mouseleave',dragStopMouse);\n canvas.addEventListener('mousemove',dragMouse);\n //set slider\n setSlider(attribute.width);\n}", "title": "" }, { "docid": "dc4614837716c00b4fda57e865c5a831", "score": "0.6051421", "text": "addEvents() {\n this.addEvent(document, 'click', 'onDocumentClick');\n this.addEvent(this.$wrapper, 'keydown', 'onKeyDown');\n this.addEvent(this.$toggleButton, 'click', 'onToggleButtonClick');\n this.addEvent(this.$clearButton, 'click', 'onClearButtonClick');\n this.addEvent(this.$dropboxContainer, 'click', 'onDropboxContainerClick');\n this.addEvent(this.$dropboxCloseButton, 'click', 'onDropboxCloseButtonClick');\n this.addEvent(this.$optionsContainer, 'scroll', 'onOptionsScroll');\n this.addEvent(this.$options, 'click', 'onOptionsClick');\n this.addEvent(this.$options, 'mouseover', 'onOptionsMouseOver');\n this.addEvent(this.$options, 'touchmove', 'onOptionsTouchMove');\n }", "title": "" }, { "docid": "66ed029829d972226af8e000b21e2340", "score": "0.6050443", "text": "function addListeners() {\n gCanvas.addEventListener('mousedown', onDown);\n gCanvas.addEventListener('mousemove', onMove);\n gCanvas.addEventListener('mouseup', onUp);\n gCanvas.addEventListener('touchmove', onMove)\n gCanvas.addEventListener('touchstart', onDown)\n gCanvas.addEventListener('touchend', onUp)\n}", "title": "" }, { "docid": "5d4a597002caf49eae1abd6f573585df", "score": "0.6050297", "text": "enableEventListeners() {\n\n if (this.eventListenersEnabled) {\n return\n }\n this.eventListenersEnabled = true;\n\n // handle events for on-screen keyboard\n document.querySelector('#qwerty').addEventListener('click', event => {\n if (event.target.tagName === 'BUTTON') {\n // console.log('button event', event);\n game.handleInteraction(event.target);\n }\n });\n\n // handle events for physical keyboard\n document.addEventListener('keydown', event => {\n const button = game.translateKey(event.key);\n if (button) {\n game.handleInteraction(button);\n }\n });\n }", "title": "" }, { "docid": "3fd410e95148a1dd0d6b0f087ef1122d", "score": "0.6044377", "text": "addEventListeners(el) {\n const that = this;\n function navClickHandler(event) {\n const evTarget = event.target || event.srcElement;\n const targetSlide = evTarget.getAttribute(navTargetSlideAttr);\n that.jumpToSlide(targetSlide);\n }\n function toggleClickHandler() {\n that.toggleFullScreen(el);\n }\n\n this.navigationControls.forEach(function (navCtl) {\n navCtl.addEventListener(\"click\", navClickHandler);\n });\n\n // Add click handler if the full screen toggle control was created\n const optionalControlEle = el.querySelector(navFullScreenSelector);\n if (optionalControlEle !== null) {\n optionalControlEle.addEventListener(\"click\", toggleClickHandler, false);\n }\n\n if (this.opts.swipe) {\n // TODO detect if hammer.js is loaded\n const ht = new Hammer(el);\n // IDEA: can this be switches to use addEventListener syntax??\n ht.on(\"swiperight\", function (ignore) {\n that.jumpToSlide(that.prevSlide());\n });\n ht.on(\"swipeleft\", function (ignore) {\n that.jumpToSlide(that.nextSlide());\n });\n }\n\n // el.onkeydown = function (e) {\n // e = e || window.event;\n // if (e.keyCode === 37) {\n // that.jumpToSlide(-1); // decrement & show\n // } else if (e.keyCode === 39) {\n // that.jumpToSlide(1); // increment & show\n // }\n // };\n }", "title": "" }, { "docid": "3f2afac918a5a034d67b6916fee6dde3", "score": "0.60435814", "text": "function initEvents(s, plt) {\n var win = plt.win();\n var doc = plt.doc();\n s._supportTouch = (function () {\n return !!(('ontouchstart' in win) || win.DocumentTouch && doc instanceof win.DocumentTouch);\n })();\n // Define Touch Events\n s._touchEventsDesktop = { start: 'mousedown', move: 'mousemove', end: 'mouseup' };\n if (win.navigator.pointerEnabled) {\n s._touchEventsDesktop = { start: 'pointerdown', move: 'pointermove', end: 'pointerup' };\n }\n else if (win.navigator.msPointerEnabled) {\n s._touchEventsDesktop = { start: 'MSPointerDown', move: 'MSPointerMove', end: 'MSPointerUp' };\n }\n s._touchEvents = {\n start: s._supportTouch || !s.simulateTouch ? 'touchstart' : s._touchEventsDesktop.start,\n move: s._supportTouch || !s.simulateTouch ? 'touchmove' : s._touchEventsDesktop.move,\n end: s._supportTouch || !s.simulateTouch ? 'touchend' : s._touchEventsDesktop.end\n };\n // WP8 Touch Events Fix\n if (win.navigator.pointerEnabled || win.navigator.msPointerEnabled) {\n (s.touchEventsTarget === 'container' ? s.container : s._wrapper).classList.add('swiper-wp8-' + s.direction);\n }\n var unregs = [];\n var touchEventsTarget = s.touchEventsTarget === 'container' ? s.container : s._wrapper;\n // Touch Events\n if (s._supportTouch) {\n // touchstart\n plt.registerListener(touchEventsTarget, s._touchEvents.start, function (ev) {\n onTouchStart(s, plt, ev);\n }, { passive: true, zone: false }, unregs);\n // touchmove\n plt.registerListener(touchEventsTarget, s._touchEvents.move, function (ev) {\n onTouchMove(s, plt, ev);\n }, { zone: false }, unregs);\n // touchend\n plt.registerListener(touchEventsTarget, s._touchEvents.end, function (ev) {\n onTouchEnd(s, plt, ev);\n }, { passive: true, zone: false }, unregs);\n }\n if ((s.simulateTouch && !plt.is('ios') && !plt.is('android')) || (s.simulateTouch && !s._supportTouch && plt.is('ios')) || plt.getQueryParam('ionicPlatform')) {\n // mousedown\n plt.registerListener(touchEventsTarget, 'mousedown', function (ev) {\n onTouchStart(s, plt, ev);\n }, { zone: false }, unregs);\n // mousemove\n plt.registerListener(touchEventsTarget, 'mousemove', function (ev) {\n onTouchMove(s, plt, ev);\n }, { zone: false }, unregs);\n // mouseup\n plt.registerListener(touchEventsTarget, 'mouseup', function (ev) {\n onTouchEnd(s, plt, ev);\n }, { zone: false }, unregs);\n }\n // onresize\n var resizeObs = plt.resize.subscribe(function () { return onResize(s, plt, false); });\n // Next, Prev, Index\n if (s.nextButton) {\n plt.registerListener(s.nextButton, 'click', function (ev) {\n onClickNext(s, plt, ev);\n }, { zone: false }, unregs);\n }\n if (s.prevButton) {\n plt.registerListener(s.prevButton, 'click', function (ev) {\n onClickPrev(s, plt, ev);\n }, { zone: false }, unregs);\n }\n if (s.paginationType) {\n plt.registerListener(s._paginationContainer, 'click', function (ev) {\n onClickIndex(s, plt, ev);\n }, { zone: false }, unregs);\n }\n // Prevent Links Clicks\n if (s.preventClicks || s.preventClicksPropagation) {\n plt.registerListener(touchEventsTarget, 'click', function (ev) {\n preventClicks(s, ev);\n }, { zone: false, capture: true }, unregs);\n }\n // return a function that removes all of the added listeners\n return function () {\n resizeObs.unsubscribe();\n unregs.forEach(function (unreg) {\n unreg();\n });\n unregs = null;\n };\n}", "title": "" }, { "docid": "3f2afac918a5a034d67b6916fee6dde3", "score": "0.60435814", "text": "function initEvents(s, plt) {\n var win = plt.win();\n var doc = plt.doc();\n s._supportTouch = (function () {\n return !!(('ontouchstart' in win) || win.DocumentTouch && doc instanceof win.DocumentTouch);\n })();\n // Define Touch Events\n s._touchEventsDesktop = { start: 'mousedown', move: 'mousemove', end: 'mouseup' };\n if (win.navigator.pointerEnabled) {\n s._touchEventsDesktop = { start: 'pointerdown', move: 'pointermove', end: 'pointerup' };\n }\n else if (win.navigator.msPointerEnabled) {\n s._touchEventsDesktop = { start: 'MSPointerDown', move: 'MSPointerMove', end: 'MSPointerUp' };\n }\n s._touchEvents = {\n start: s._supportTouch || !s.simulateTouch ? 'touchstart' : s._touchEventsDesktop.start,\n move: s._supportTouch || !s.simulateTouch ? 'touchmove' : s._touchEventsDesktop.move,\n end: s._supportTouch || !s.simulateTouch ? 'touchend' : s._touchEventsDesktop.end\n };\n // WP8 Touch Events Fix\n if (win.navigator.pointerEnabled || win.navigator.msPointerEnabled) {\n (s.touchEventsTarget === 'container' ? s.container : s._wrapper).classList.add('swiper-wp8-' + s.direction);\n }\n var unregs = [];\n var touchEventsTarget = s.touchEventsTarget === 'container' ? s.container : s._wrapper;\n // Touch Events\n if (s._supportTouch) {\n // touchstart\n plt.registerListener(touchEventsTarget, s._touchEvents.start, function (ev) {\n onTouchStart(s, plt, ev);\n }, { passive: true, zone: false }, unregs);\n // touchmove\n plt.registerListener(touchEventsTarget, s._touchEvents.move, function (ev) {\n onTouchMove(s, plt, ev);\n }, { zone: false }, unregs);\n // touchend\n plt.registerListener(touchEventsTarget, s._touchEvents.end, function (ev) {\n onTouchEnd(s, plt, ev);\n }, { passive: true, zone: false }, unregs);\n }\n if ((s.simulateTouch && !plt.is('ios') && !plt.is('android')) || (s.simulateTouch && !s._supportTouch && plt.is('ios')) || plt.getQueryParam('ionicPlatform')) {\n // mousedown\n plt.registerListener(touchEventsTarget, 'mousedown', function (ev) {\n onTouchStart(s, plt, ev);\n }, { zone: false }, unregs);\n // mousemove\n plt.registerListener(touchEventsTarget, 'mousemove', function (ev) {\n onTouchMove(s, plt, ev);\n }, { zone: false }, unregs);\n // mouseup\n plt.registerListener(touchEventsTarget, 'mouseup', function (ev) {\n onTouchEnd(s, plt, ev);\n }, { zone: false }, unregs);\n }\n // onresize\n var resizeObs = plt.resize.subscribe(function () { return onResize(s, plt, false); });\n // Next, Prev, Index\n if (s.nextButton) {\n plt.registerListener(s.nextButton, 'click', function (ev) {\n onClickNext(s, plt, ev);\n }, { zone: false }, unregs);\n }\n if (s.prevButton) {\n plt.registerListener(s.prevButton, 'click', function (ev) {\n onClickPrev(s, plt, ev);\n }, { zone: false }, unregs);\n }\n if (s.paginationType) {\n plt.registerListener(s._paginationContainer, 'click', function (ev) {\n onClickIndex(s, plt, ev);\n }, { zone: false }, unregs);\n }\n // Prevent Links Clicks\n if (s.preventClicks || s.preventClicksPropagation) {\n plt.registerListener(touchEventsTarget, 'click', function (ev) {\n preventClicks(s, ev);\n }, { zone: false, capture: true }, unregs);\n }\n // return a function that removes all of the added listeners\n return function () {\n resizeObs.unsubscribe();\n unregs.forEach(function (unreg) {\n unreg();\n });\n unregs = null;\n };\n}", "title": "" }, { "docid": "e5078ed3895170be7008c3edf1142dfd", "score": "0.6030293", "text": "function setupHandlers() {\n // Add listener for moving triangle with arrow keys.\n window.addEventListener('keydown', handleClick);\n\n // Setup window resize listener.\n window.addEventListener('resize', resizeWindow);\n\n // Add listener for select object\n document.getElementById(\"whichObject\").addEventListener(\"change\", handleSelect);\n}", "title": "" }, { "docid": "5c033b7240685378988b36cdd29634c2", "score": "0.60236394", "text": "start() {\r\n this.container.addEventListener(initMouse, this);\r\n this.container.addEventListener(updateMouse, this);\r\n this.container.addEventListener(endMouse, this);\r\n\r\n if (this.touchable) {\r\n this.container.addEventListener(initTouch, this);\r\n this.container.addEventListener(updateTouch, this);\r\n this.container.addEventListener(endTouch, this);\r\n }\r\n }", "title": "" }, { "docid": "3ca72da426e1fd2000b29ed71c5d3ca0", "score": "0.6012474", "text": "function gameEvents(){\n\t\t/**\n\t\t * Create a simple instance\n\t\t * by default, it only adds horizontal recognizers\n\t\t */\n\t\tvar mcCanvas = new Hammer(GameJam.canvasa);\n\n\t\t/**\n\t\t * Let the pan gesture support all directions\n\t\t * this will block the vertical scrolling on a touch-device while on the element\n\t\t */\n\t\tmcCanvas.get('pan').set({\n\t\t\tdirection: Hammer.DIRECTION_ALL\n\t\t});\n\n\t\tvar canvas = document.getElementsByTagName('canvas'),\n\t\t\tstartMarginLeft = 0,\n\t\t\tstartMarginTop = 0;\n\n\t\t/** Listen to pan events */\n\t\tmcCanvas.on('pan panstart panend', function(e){\n\t\t\tvar boundings = GameJam.canvasa.getBoundingClientRect(),\n\t\t\t\tboundingsMain = document.getElementsByTagName('main')[0].getBoundingClientRect(),\n \t\tx,\n \t\ty,\n \t\txScroll,\n \t\tyScroll;\n\n\t\t\t// Grab html page coords\n\t\t\tx = e.center.x + document.body.scrollLeft + document.documentElement.scrollLeft;\n\t\t\ty = e.center.y + document.body.scrollTop + document.documentElement.scrollTop;\n\n\t\t\t// Make them relative to the canvas only\n\t\t\tx -= GameJam.canvasa.offsetLeft;\n\t\t\ty -= GameJam.canvasa.offsetTop;\n\n\t\t\t// Return tile x,y that we dragged\n\t\t\tvar cell = [\n\t\t\t\tMath.floor(x/(boundings.width / GameJam.worldWidth)),\n\t\t\t\tMath.floor(y/(boundings.height / GameJam.worldHeight))\n\t\t\t];\n\n\t\t\tswitch(e.type) {\n\t case 'panstart':\n\t \tGameJam.panning = true;\n\n\t \t// Hide obstacles list\n\t\t core.HideObstacles();\n\n\t \t// Check if an item is at the dragstart cell\n\t\t\t\t\tfor (var i in GameJam.items) {\n\t\t\t\t\t\tvar startwidth = Math.floor(GameJam.items[i].pos[0]/GameJam.tileWidth),\n\t\t\t\t\t\t\tendwidth = Math.floor(GameJam.items[i].pos[0]/GameJam.tileWidth + GameJam.items[i].width/GameJam.tileWidth - 1),\n\t\t\t\t\t\t\tstartheight = Math.floor(GameJam.items[i].pos[1]/GameJam.tileHeight),\n\t\t\t\t\t\t\tendheight = Math.floor(GameJam.items[i].pos[1]/GameJam.tileHeight + GameJam.items[i].height/GameJam.tileHeight - 1);\n\n\t\t\t\t\t\t//console.log(startwidth + \"-\" + endwidth + \"-\" + startheight + \"-\" + endheight + \"-\" + cell);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (startwidth <= cell[0] && cell[0] <= endwidth && startheight <= cell[1] && cell[1] <= endheight) {\n\t\t\t\t\t\t\tGameJam.sound.play('move');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGameJam.draggedItem = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get the starting margins\n\t\t\t\t\tstartMarginLeft = parseInt(window.getComputedStyle(canvas[0]).getPropertyValue('margin-left'));\n\t\t\t\t\tstartMarginTop = parseInt(window.getComputedStyle(canvas[0]).getPropertyValue('margin-top'));\n\t break;\n\n\t case 'pan':\n\t \t// Move the dragged item\n\t \tif (GameJam.draggedItem) {\n\t \t\tvar cellwidth = cell[0] - Math.floor((GameJam.items[GameJam.draggedItem].width)/GameJam.tileWidth) + 1 ,\n\t \t\t\tcellheight = cell[1] - Math.floor((GameJam.items[GameJam.draggedItem].height)/GameJam.tileHeight) + 1,\n\t \t\t\tcellxhigh = GameJam.items[GameJam.draggedItem].width/ GameJam.tileWidth,\n\t \t\t\tcellyhigh = GameJam.items[GameJam.draggedItem].height/ GameJam.tileHeight,\n\t \t\t\tnewxpos = cellwidth * GameJam.tileWidth,\n\t \t\t\tnewypos = cellheight * GameJam.tileHeight,\n\t \t\t\tnewxhighpos = newxpos + GameJam.tileWidth*(GameJam.items[GameJam.draggedItem].width/GameJam.tileWidth -1),\n\t \t\t\tnewyhighpos = newypos + GameJam.tileHeight*(GameJam.items[GameJam.draggedItem].height/GameJam.tileHeight -1),\n\t \t\t\tposHasItem = false;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if it has an obstacle we don't move it there\n\t\t\t\t\t\tif (GameJam.obstacles[cellwidth] && GameJam.obstacles[cellwidth][cellheight] === 0 ){\n\t \t\t\t// checkin all x blocks from the item with the obstacles\n\t \t\t\twhile(!posHasItem && cellxhigh>1){\n\t \t\t\t\t//console.log(\"ob XX\" + GameJam.obstacles[cellwidth + cellxhigh -1][cellheight] + '-'+cellwidth + '-' +cellxhigh + posHasItem );\n\t \t\t\t\tif (GameJam.obstacles[cellwidth + cellxhigh -1][cellheight] !== 0){\n\t \t\t\t\t\tposHasItem = true;\n\t \t\t\t\t\t//console.log(\"ob X\" + GameJam.obstacles[cellwidth + cellxhigh -1][cellheight] + '-'+cellwidth + '-' +cellxhigh + posHasItem );\n\t \t\t\t\t}\n\t \t\t\t\tcellxhigh--;\n\t \t\t\t}\n\n\t \t\t\t// checkin all y blocks from the item with the obstacles\n\t \t\t\twhile(!posHasItem && cellyhigh>1){\n\t \t\t\t\tif (GameJam.obstacles[cellwidth][cellheight + cellyhigh -1] !== 0){\n\t \t\t\t\t\tposHasItem = true;\n\t \t\t\t\t\t//console.log(\"ob y\" + GameJam.obstacles[cellwidth][cellheight + cellyhigh -1] + '-'+cellheight + '-' +cellyhigh + posHasItem);\n\t \t\t\t\t}\n\t \t\t\t\tcellyhigh--;\n\t \t\t\t}\n\t \t\t\tvar i = 0;\n\t \t\t\twhile (!posHasItem && i < GameJam.items.length){\n\t \t\t\t\t//we want to check all items but not the one that we drag\n\t \t\t\t\tif(i != GameJam.draggedItem){\n\t \t\t\t\t\tvar itemxpos = GameJam.items[i].pos[0],\n\t \t\t\t\t\t\titemypos = GameJam.items[i].pos[1],\n\t \t\t\t\t\t\titemxhighpos = itemxpos + GameJam.tileWidth*(GameJam.items[i].width/GameJam.tileWidth -1),\n\t \t\t\t\t\t\titemyhighpos = itemypos + GameJam.tileHeight*(GameJam.items[i].height/GameJam.tileHeight -1);\n\n\t\t \t\t\t\t//console.log('x:' + newxpos + ':' + newxhighpos + '-'+ itemxpos + ':' + itemxhighpos + '::' + i);\n\t\t \t\t\t\t//console.log('y:' + newypos + ':' + newyhighpos + '-'+ itemypos + ':' + itemyhighpos + '::' + i);\n\n\t\t \t\t\t\t//ix <= nx <= nhx <= ihx\n\t\t \t\t\t\t//iy <= ny <= nhy <= ihy\n\t\t\t\t\t\t\t\t\tif (((itemxpos <= newxpos && newxpos <= itemxhighpos) || (itemxpos <= newxhighpos && newxhighpos <= itemxhighpos)) &&\n\t\t\t\t\t\t\t\t\t\t((itemypos <= newypos && newypos <= itemyhighpos) || (itemypos <= newyhighpos && newyhighpos <= itemyhighpos))){\n\n\t\t\t\t\t\t\t\t\t\t//console.log('xx:'+GameJam.items[i].pos[0] + '-' + newxpos + ':' + newxhighpos + '::' + i);\n\t\t \t\t\t\t\t//console.log('yy:'+GameJam.items[i].pos[1] + '-' + newypos + ':' + newyhighpos + '::' + i);\n\n\t\t\t\t\t\t\t\t\t\tposHasItem = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// it didnt have any obstacle or another item so we can move it\n\t\t \t\tif (!posHasItem){\n\t\t \t\t\tGameJam.items[GameJam.draggedItem].pos = [newxpos, newypos];\n\t\t \t\t}\n\n\t \t\t}\n\t \t} else{\n\t\t\t\t\t\t// Map scrolling\n\t\t\t\t\t\tvar newMarginLeft = e.deltaX + startMarginLeft,\n\t\t\t\t\t\t\tnewMarginTop = e.deltaY + startMarginTop;\n\n\t\t\t\t\t\t// Horizontal scolling with restriction to viewport\n\t\t\t\t\t\tif (newMarginLeft <= 0 && (newMarginLeft - boundingsMain.width) * -1 <= boundings.width) {\n\t\t\t\t\t\t\tfor (var i=0; i < canvas.length; i++) {\n\t\t\t\t\t\t\t\tcanvas[i].style.marginLeft = newMarginLeft + 'px';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Vertical scolling with restriction to viewport\n\t\t\t\t\t\tif (newMarginTop <= 0 && (newMarginTop - boundingsMain.height) * -1 <= boundings.height) {\n\t\t\t\t\t\t\tfor (var i=0; i < canvas.length; i++) {\n\t\t\t\t\t\t\t\tcanvas[i].style.marginTop = newMarginTop + 'px';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t \t}\n\t \tbreak;\n\n\t case 'panend':\n\t \t// Stop the dragging\n\t \tGameJam.panning = false;\n\t \tGameJam.draggedItem = null;\n\t \tbreak;\n\t }\n\t\t});\n\n\n\t\t/** Free the mouse ... */\n\t\tvar mcStart = new Hammer(document.getElementById('start-game'));\n\t\tmcStart.on('tap', function(e){\n\t\t\tif (e.target.className.match(/disabled/g)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tcore.StartGame();\n\t\t});\n\n\t\t/** Expand/minimize the item list */\n\t\tvar mcSlider = new Hammer(document.getElementById('slider'));\n\t\tmcSlider.on('tap', function(e){\n\t\t\tGameJam.sound.play('click');\n\t\t\tif (e.target.className.match(/minimized/g)) {\n\t\t\t\tcore.ShowObstacles();\n\t\t\t} else{\n\t\t core.HideObstacles();\n\t\t\t}\n\t\t});\n\n\t\t/** Reset margin on resize */\n\t\twindow.onresize = function(e){\n\t\t for (var i=0; i < canvas.length; i++) {\n\t\t \tcanvas[i].style.marginLeft = '0px';\n\t\t\t\tcanvas[i].style.marginTop = '0px';\n\t\t\t}\n\t\t};\n\n\t\t/** Replay level button */\n\t\tvar mcReplay = new Hammer(document.querySelectorAll('.replay-btn')[0]);\n\t\tmcReplay.on('tap', function(e){\n\t\t\tGameJam.sound.play('click');\n\t\t\tdocument.getElementById('complete').className = 'window hide';\n\t\t\tcore.LoadLevel(GameJam.currentLevel);\n\t\t});\n\t}", "title": "" }, { "docid": "467a91512b447978596df2dd17083631", "score": "0.6010425", "text": "addEventListeners () {\n\t\tthis.toggleButton.addEventListener('click', this.showSidenav);\n\t\t// this.sidenavEl.addEventListener('click', this.hideSidenav);\n\n\n\t\tthis.sidenavEl.addEventListener('touchstart', this.onTouchStart);\n\t\tthis.sidenavEl.addEventListener('touchmove', this.onTouchMove);\n\t\tthis.sidenavEl.addEventListener('touchend', this.onTouchEnd);\n\t\t// User can grad the sidenav (app like)\n\t\tthis.bodyEl.addEventListener('touchstart', this.onBodyTouchStart);\n\t\tthis.bodyEl.addEventListener('touchend', this.onBodyTouchEnd);\n\t}", "title": "" }, { "docid": "d0948d1c7aaf6508c120a6f5f81bf053", "score": "0.60097647", "text": "enable() {\n // `wheel` is the standard, but Safari<8 only supports `mousewheel`.\n // IE9+, Chrome, Firefox, Opera all use `wheel`.\n this.element.addEventListener('wheel', this._handleWheel, this._listenerOptions);\n this.element.addEventListener('mousewheel', this._handleWheel, this._listenerOptions);\n\n // Use the arrow keys to navigate next and previous as well.\n document.addEventListener('keydown', this._handleKeydown, this._listenerOptions);\n\n // Prevent touch events from scrolling the page. They need to be interpreted.\n document.body.addEventListener('touchstart', this._handleTouchStart, this._listenerOptions);\n document.body.addEventListener('touchmove', this._handleTouchMove, this._listenerOptions);\n document.body.addEventListener('touchend', this._resume, this._listenerOptions);\n }", "title": "" }, { "docid": "ff20736c723011c48f1a8fcb3a295c12", "score": "0.6009219", "text": "addEventListeners() {\n if (!this.document) {\n return;\n }\n\n this._triggerEvent = this.triggerEvent.bind(this);\n _utils_constants__WEBPACK_IMPORTED_MODULE_5__[/* DOM_EVENTS */ \"a\"].forEach(function (eventName) {\n this.document.addEventListener(eventName, this._triggerEvent, {\n passive: true\n });\n }, this);\n }", "title": "" }, { "docid": "000695a238d4ca3a83d82868b09f6922", "score": "0.6007872", "text": "function documentTouchStartHandler(event) {\n\t\tif(event.touches.length == 1) {\n\t\t\tmouse.down = true;\n\t\t\t\n\t\t\tmouse.x = event.touches[0].pageX - (window.innerWidth - world.width) * 0.5;\n\t\t\tmouse.y = event.touches[0].pageY - (window.innerHeight - world.height) * 0.5;\n\t\t\t\n\t\t\thandlePointerPress( event );\n\t\t\t\n\t\t\tevent.preventDefault();\n\t\t}\n\t}", "title": "" }, { "docid": "6b689c5040216819447945e0923513e9", "score": "0.6004551", "text": "_handleTouchStart(event) {\n var G = this;\n if (G.debug) console.log(\"GestureBase._handleTouchStart()\");\n\n // Change the native events to listen for the rest of the system\n G._cursor = \"touch\";\n G._start = \"start\";\n G._end = \"end\";\n\n G._handleDown(event);\n }", "title": "" }, { "docid": "b2a7be3ea1ccf55413e6ff26acb811b3", "score": "0.5996048", "text": "function DeviceMotionEventInit() {\n}", "title": "" }, { "docid": "373ef78f28121007b447b0b23e17ef8f", "score": "0.5981199", "text": "function onDocumentTouchStart( event ) {\r\n\r\n if ( event.touches.length === 1 ) {\r\n\r\n event.preventDefault();\r\n\r\n mouseYOnMouseDown = event.touches[ 0 ].pageY - windowHalfY;\r\n\r\n targetRotationOnMouseDown = targetRotation;\r\n\r\n }\r\n\r\n }", "title": "" }, { "docid": "ef3b0531ed07b46a9a68709682547756", "score": "0.59804124", "text": "function setup() {\n console.log('we are in setup');\n\n // Make the canvas the size of the mobile device screen\n mainCanvas = createCanvas(2000, 2000);\n mainCanvas.parent('mainCanvas-div');\n mainCanvas.style('display', 'block');\n\n txt = createDiv('gestureDiv');\n txt.elt.innerText = 'touch me';\n\n coords = createDiv('coordsDiv');\n coords.style('color', 'red');\n\n // create a new Layer to load these Images onto\n gridCanvas = createGraphics(2000, 2000);\n // generate a 2D array to hold the state of each grid cell\n grid = create2DArray(grid_cols, grid_rows, false);\n\n drawGrid();\n \n // things that happen when you gesture on the canvas\n myElement = document.getElementById('mainCanvas-div');\n\n // create a simple instance\n // by default, it only adds horizontal recognizers\n var mc = new Hammer(myElement);\n\n // Tap recognizer with minimal 2 taps\n mc.get('doubletap').set({\n enable: true\n });\n\n // let the pan gesture support all directions.\n // this will block the vertical scrolling on a touch-device while on the element\n mc.get('pan').set({\n direction: Hammer.DIRECTION_ALL\n });\n\n mc.get('pinch').set({\n enable: true\n });\n\n mc.get('rotate').set({\n enable: true\n });\n\n\n mc.add(new Hammer.Tap());\n\n mc.on(\"doubletap panleft panright panu tap press pinch rotate\", function(ev) {\n txt.elt.innerText = ev.type + \" gesture detected.\";\n txt.position(touches[touches.length - 1].x, touches[touches.length - 1].y);\n coords.elt.innerText = '(' + touches[touches.length - 1].x + ',' + touches[touches.length -1].y + ')';\n coords.position(touches[touches.length - 1].x, touches[touches.length - 1].y - 32);\n });\n}", "title": "" }, { "docid": "4acba8b5630f58d9a96f60456ae26ab4", "score": "0.5977246", "text": "function registerImageEventListeners() {\n $(\".thumbContainer img\").hammer({}).bind(\"doubletap transform transformstart transformend\", function(ev) {\n\n if (ev.type == 'doubletap') {\n $(ev.target).toggleClass('fullscreen');\n }\n else if (ev.type == 'transform') {\n scale = previousScale * ev.scale;\n rotation = previousRotation + ev.rotation;\n var cssTransform = \"scale(\"+ previousScale * ev.scale +\") rotate(\" + rotation + \"deg)\";\n $(ev.target).css('-webkit-transform', cssTransform); \n }\n else if (ev.type == 'transformend') {\n previousScale = scale;\n previousRotation = rotation;\n }\n \n ev.preventDefault();\n });\n }", "title": "" }, { "docid": "592cd71c32fb6e7e7e8db1052d5e0191", "score": "0.5969041", "text": "function bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouch, PASSIVE);\n window.addEventListener('blur', onWindowBlur);\n}", "title": "" }, { "docid": "592cd71c32fb6e7e7e8db1052d5e0191", "score": "0.5969041", "text": "function bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouch, PASSIVE);\n window.addEventListener('blur', onWindowBlur);\n}", "title": "" }, { "docid": "d352d24776927a616bec2a3397dd57a2", "score": "0.59620327", "text": "function onDocumentTouchStart(e) {\n if (e.touches.length === 1) {\n e.preventDefault();\n mouseX = e.touches[0].pageX - windowHalfX;\n mouseY = e.touches[0].pageY - windowHalfY;\n }\n }", "title": "" }, { "docid": "54f5526a123aabfdc854fff6a2141fd7", "score": "0.59526384", "text": "function onInit() {\n renderImgs();\n renderSearchOptions();\n renderSearchKeywords();\n gCanvas = document.querySelector('#my-canvas');\n if (window.innerWidth > 600) gCanvas.width = 600;\n else gCanvas.width = 300;\n gCtx = gCanvas.getContext('2d');\n // Line below prevents scrolling on canvas\n gCanvas.addEventListener(\"touchmove\", function (event) { event.preventDefault() });\n var canvasHammer = new Hammer(gCanvas);\n canvasHammer.get('pan').set({ direction: Hammer.DIRECTION_ALL });\n // The 'if' is here to check if 'panstart' actually detected a mouseclick\n canvasHammer.on('panstart', function () { if (!gIsMouseDown) selectLine(event.offsetX, event.offsetY) });\n canvasHammer.on('pan', function () { handleTouch(event) });\n window.addEventListener('resize', resizeCanvas);\n}", "title": "" }, { "docid": "856e6e92025bdaefeaf322e4a7b3ef68", "score": "0.59485096", "text": "function addListeners() {\n if(!('ontouchstart' in window)) {\n window.addEventListener('mousemove', mouseMove);\n }\n window.addEventListener('scroll', scrollCheck);\n window.addEventListener('resize', resize);\n }", "title": "" }, { "docid": "66751b704472404d4ab34de7ceece9dc", "score": "0.59444803", "text": "function onGestureEvent(event) {\n thisWindow.onGestureEvent(event);\n }", "title": "" }, { "docid": "7d10edc4b64347552e859c085a1dba5c", "score": "0.5938392", "text": "ready() {\n super.ready();\n let root = this;\n root.addEventListener(\"mousedown\", function(e) {\n console.log(\"mousedown\", e);\n });\n root.addEventListener(\"keypress\", function(e) {\n e.preventDefault();\n });\n }", "title": "" }, { "docid": "7c2467a9b3e36efce4c1bf7e57edd58d", "score": "0.59369785", "text": "function initEventListeners()\n\t{\n\t\t// key and mouse event handlers initialization\n\t\tKeyMouseEventHandlers.init(canvas);\n\n\t\t// disable the context menu\n\t\tcanvas.oncontextmenu = function () {\n\t\t\treturn false;\n\t\t}; \n\t\t\n\t\t// window event listeners\n\t\twindow.onresize = function() {\n\t\t\tcw = canvas.width = window.innerWidth;\n\t\t\tch = canvas.height = window.innerHeight;\n\t\t};\n\t}", "title": "" }, { "docid": "3471a26d4810a7b1038e09cf0542bbf9", "score": "0.59310657", "text": "function Wt(){document.addEventListener(\"click\",Pt,!0),document.addEventListener(\"touchstart\",Ot,{passive:!0}),window.addEventListener(\"blur\",Ct),window.addEventListener(\"resize\",Nt),Fe||!navigator.maxTouchPoints&&!navigator.msMaxTouchPoints||document.addEventListener(\"pointerdown\",Ot)}", "title": "" }, { "docid": "65c559a3f1f96da746f049e95c4f2357", "score": "0.59306574", "text": "function setupInteractions() {\n if (Modernizr.touch === true) {\n $alert.click(hide);\n } else {\n $alert.mouseleave(hide);\n }\n }", "title": "" }, { "docid": "a08f1793cab01b6ad89138eca1a8919d", "score": "0.5921875", "text": "function setUpPage() {\n document.querySelector(\"nav ul li:first-of-type\").addEventListener(\"click\", loadSetup, false);\n document.querySelector(\"nav ul li:last-of-type\").addEventListener(\"click\", loadDirections, false);\n\n var moveableItems = document.querySelectorAll(\"#room div\");\n zIndezCounter = moveableItems.length + 1;\n for (var i = 0; i < moveableItems.length; i++) {\n\n //disables IE10+ interface gestures (supports only mouse events with the ms prefix)\n moveableItems[i].style.msTouchAction = \"none\";\n moveableItems[i].style.touchAction = \"none\";\n\n moveableItems[i].addEventListener(\"msponterdown\", startDrag, false);\n moveableItems[i].addEventListener(\"ponterdown\", startDrag, false);\n \n if (moveableItems[i].addEventListener) {\n moveableItems[i].addEventListener(\"mousedown\", startDrag, false);\n moveableItems[i].addEventListener(\"touchstart\", startDrag, false);\n }else if (moveableItems[i].attachEvent) {\n moveableItems[i].attachEvent(\"onmousedown\", startDrag);\n }\n }\n}", "title": "" }, { "docid": "dd34d6c78a704f75065ec651aeeeef21", "score": "0.5916083", "text": "function documentTouchStartHandler(event)\n\t{\n\t\tif(event.touches.length == 1) {\n\t\t\tevent.preventDefault();\n\n\t\t\tmouse.x = event.touches[0].pageX - (window.innerWidth - world.width) * 0.5;\n\t\t\tmouse.y = event.touches[0].pageY - (window.innerHeight - world.height) * 0.5;\n\t\t\t\n\t\t\tmouse.down = true;\n\t\t}\n\t}", "title": "" }, { "docid": "f0420b93303c7e34e2ff56a97197159a", "score": "0.59109473", "text": "function attachEventHandlers() {\n\n // GSV custom handles cursor on '.widget-scene' element. We need to be more specific than that to override.\n function handlerViewControlLayerMouseDown(e) {\n $('.widget-scene-canvas').css('cursor', 'url(/assets/javascripts/SVLabel/img/cursors/closedhand.cur) 4 4, move');\n }\n\n function handlerViewControlLayerMouseUp(e) {\n $('.widget-scene-canvas').css('cursor', '');\n }\n\n // Google Street View loads inside 'actual-pano' but there is no event triggered after it loads all the components.\n // So we need to detect it by brute-force.\n $('.actual-pano').bind('DOMNodeInserted', function(e) {\n if (e.target && e.target.className && typeof e.target.className === 'string' && e.target.className.indexOf('widget-scene-canvas') > -1) {\n $('.widget-scene-canvas').bind('mousedown', handlerViewControlLayerMouseDown).bind('mouseup', handlerViewControlLayerMouseUp);\n }\n });\n }", "title": "" }, { "docid": "bdb727238994e81a0fe9272b370dd3e2", "score": "0.5909188", "text": "function setUpControls() {\n\n //Check to see if Touch is Enabled...\n isTouchEnabled = 'createTouch' in document;\n //\n //If the touch events are enabled, listen for the events.\n //The controls will only draw on touch enabled browsers\n //In all other cases, you can revert to whatever control mechanism (like keyboard) that you wish to utilize\n if (isTouchEnabled) {\n var canvas = document.getElementById('canvas');\n canvas.addEventListener('touchstart', onTouchStart, false);\n canvas.addEventListener('touchmove', onTouchMove, false);\n canvas.addEventListener('touchend', onTouchEnd, false);\n }\n }", "title": "" }, { "docid": "e1e625f3bbad9ef3dba1dec72cee4157", "score": "0.59076816", "text": "function _via_init_mouse_handlers() {\n _via_reg_canvas.addEventListener('dblclick', _via_reg_canvas_dblclick_handler, false);\n _via_reg_canvas.addEventListener('mousedown', _via_reg_canvas_mousedown_handler, false);\n _via_reg_canvas.addEventListener('mouseup', _via_reg_canvas_mouseup_handler, false);\n _via_reg_canvas.addEventListener('mouseover', _via_reg_canvas_mouseover_handler, false);\n _via_reg_canvas.addEventListener('mousemove', _via_reg_canvas_mousemove_handler, false);\n _via_reg_canvas.addEventListener('wheel', _via_reg_canvas_mouse_wheel_listener, false);\n // touch screen event handlers\n // @todo: adapt for mobile users\n _via_reg_canvas.addEventListener('touchstart', _via_reg_canvas_mousedown_handler, false);\n _via_reg_canvas.addEventListener('touchend', _via_reg_canvas_mouseup_handler, false);\n _via_reg_canvas.addEventListener('touchmove', _via_reg_canvas_mousemove_handler, false);\n}", "title": "" }, { "docid": "1739fa69c8f8be3681f534dce03aa0a8", "score": "0.58986086", "text": "function setupEventListeners(reference,options,state,updateBound){// Resize event listener on window\nstate.updateBound=updateBound;getWindow(reference).addEventListener('resize',state.updateBound,{passive:true});// Scroll event listener on scroll parents\nvar scrollElement=getScrollParent(reference);attachToScrollParents(scrollElement,'scroll',state.updateBound,state.scrollParents);state.scrollElement=scrollElement;state.eventsEnabled=true;return state;}", "title": "" }, { "docid": "1739fa69c8f8be3681f534dce03aa0a8", "score": "0.58986086", "text": "function setupEventListeners(reference,options,state,updateBound){// Resize event listener on window\nstate.updateBound=updateBound;getWindow(reference).addEventListener('resize',state.updateBound,{passive:true});// Scroll event listener on scroll parents\nvar scrollElement=getScrollParent(reference);attachToScrollParents(scrollElement,'scroll',state.updateBound,state.scrollParents);state.scrollElement=scrollElement;state.eventsEnabled=true;return state;}", "title": "" }, { "docid": "1739fa69c8f8be3681f534dce03aa0a8", "score": "0.58986086", "text": "function setupEventListeners(reference,options,state,updateBound){// Resize event listener on window\nstate.updateBound=updateBound;getWindow(reference).addEventListener('resize',state.updateBound,{passive:true});// Scroll event listener on scroll parents\nvar scrollElement=getScrollParent(reference);attachToScrollParents(scrollElement,'scroll',state.updateBound,state.scrollParents);state.scrollElement=scrollElement;state.eventsEnabled=true;return state;}", "title": "" }, { "docid": "c9385bc57b5a441ec361cee3dc843727", "score": "0.58981436", "text": "_initEvents()\n {\n if (this.config.responsive)\n {\n this._onResize();\n }\n\n if (this.config.mouseOverEvents)\n {\n this._onMouseMove();\n this._onMouseLeave();\n }\n\n if (this.config.mouseClickEvents)\n {\n this._onMouseClick();\n }\n\n if (this.config.audio)\n {\n this._onTimeUpdate();\n this._onCanPlay();\n }\n }", "title": "" }, { "docid": "5ae77047704ddf37369fb66ef6ebdb83", "score": "0.58956057", "text": "attachEvents() {\n \n this.transformProperty = transformPropertyName();\n this.selectorWidth = this.component.getEl().offsetWidth\n\n // Resize element on window resize\n this.component.subscribeTo(window).on('resize', this.resizeHandler);\n \n // If element is draggable / swipable, add event handlers\n if (this.config.draggable) {\n // Keep track pointer hold and dragging distance\n this.pointerDown = false;\n this.drag = {\n startX: 0,\n endX: 0,\n startY: 0,\n letItGo: null,\n preventClick: false,\n };\n \n // Touch events\n this.subscribeTo('touchstart', this.touchstartHandler);\n this.subscribeTo('touchend', this.touchendHandler);\n this.subscribeTo('touchmove', this.touchmoveHandler);\n \n // Mouse events\n this.subscribeTo('mousedown', this.mousedownHandler);\n \n this.subscribeTo('mouseup', this.mouseupHandler);\n this.subscribeTo('mouseleave', this.mouseleaveHandler);\n this.subscribeTo('mousemove', this.mousemoveHandler);\n\n this.subscribeTo('mouseenter', this.mouseenterHandler);\n\n \n // Click\n this.subscribeTo('click', this.clickHandler);\n }\n\n }", "title": "" }, { "docid": "2cdd7f4211ddbe548e4df9b690945148", "score": "0.5869936", "text": "init() {\n this.container = document.querySelector(this._containerSelector);\n this.container.addEventListener('mousedown', this.dragStart);\n this.container.addEventListener('mousemove', this.drag);\n this.container.addEventListener('mouseup', this.dragEnd);\n }", "title": "" }, { "docid": "42d87cf783d848eee0a3e9d1c0ac8364", "score": "0.58665603", "text": "function setDragListeners () {\n angular.element($window).on('mouseup', handleMouseUp);\n angular.element($window).on('mousemove', handleMouseMove);\n }", "title": "" }, { "docid": "48358ffd6fe3f0fd3179326419ea3f5b", "score": "0.5865928", "text": "#handleEvents() {\n if (this.swipeType === 'continuous') {\n this.onEvent('swipe', this, (e) => {\n this.querySelector(`[slot=\"action-${e.detail.direction === 'left' ? 'right' : 'left'}\"`).click();\n }, { scrollContainer: this.container });\n }\n\n // Close on click\n // istanbul ignore next\n if (this.swipeType === 'reveal') {\n this.onEvent('click', this.leftButton, () => {\n this.container.scrollLeft = 85;\n });\n this.onEvent('click', this.rightButton, () => {\n this.container.scrollLeft = 85;\n });\n }\n }", "title": "" }, { "docid": "84b80fb51a4273ab157649a90da029f4", "score": "0.5865906", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\r\n\r\n // Polyfill document.contains for IE11.\r\n // TODO: move to util\r\n document.contains || (document.contains = function (node) {\r\n return document.body.contains(node);\r\n });\r\n\r\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\r\n /*\r\n * If hijack clicks is true, we preventDefault any click that wasn't\r\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\r\n * click event will be sent ~400ms after a touchend event happens.\r\n * The only way to know if this click is real is to prevent any normal\r\n * click events, and add a flag to events sent by material so we know not to prevent those.\r\n * \r\n * Two exceptions to click events that should be prevented are:\r\n * - click events sent by the keyboard (eg form submit)\r\n * - events that originate from an Ionic app\r\n */\r\n document.addEventListener('click' , clickHijacker , true);\r\n document.addEventListener('mouseup' , mouseInputHijacker, true);\r\n document.addEventListener('mousedown', mouseInputHijacker, true);\r\n document.addEventListener('focus' , mouseInputHijacker, true);\r\n\r\n isInitialized = true;\r\n }\r\n\r\n function mouseInputHijacker(ev) {\r\n var isKeyClick = !ev.clientX && !ev.clientY;\r\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\r\n && !isInputEventFromLabelClick(ev)) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n }\r\n\r\n function clickHijacker(ev) {\r\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\r\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\r\n && !isInputEventFromLabelClick(ev)) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n lastLabelClickPos = null;\r\n } else {\r\n lastLabelClickPos = null;\r\n if (ev.target.tagName.toLowerCase() == 'label') {\r\n lastLabelClickPos = {x: ev.x, y: ev.y};\r\n }\r\n }\r\n }\r\n\r\n\r\n // Listen to all events to cover all platforms.\r\n var START_EVENTS = 'mousedown touchstart pointerdown';\r\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\r\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\r\n\r\n angular.element(document)\r\n .on(START_EVENTS, gestureStart)\r\n .on(MOVE_EVENTS, gestureMove)\r\n .on(END_EVENTS, gestureEnd)\r\n // For testing\r\n .on('$$mdGestureReset', function gestureClearCache () {\r\n lastPointer = pointer = null;\r\n });\r\n\r\n /*\r\n * When a DOM event happens, run all registered gesture handlers' lifecycle\r\n * methods which match the DOM event.\r\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\r\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\r\n */\r\n function runHandlers(handlerEvent, event) {\r\n var handler;\r\n for (var name in HANDLERS) {\r\n handler = HANDLERS[name];\r\n if( handler instanceof $$MdGestureHandler ) {\r\n\r\n if (handlerEvent === 'start') {\r\n // Run cancel to reset any handlers' state\r\n handler.cancel();\r\n }\r\n handler[handlerEvent](event, pointer);\r\n\r\n }\r\n }\r\n }\r\n\r\n /*\r\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\r\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\r\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\r\n * won't effect it.\r\n */\r\n function gestureStart(ev) {\r\n // If we're already touched down, abort\r\n if (pointer) return;\r\n\r\n var now = +Date.now();\r\n\r\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\r\n // If <400ms have passed, don't allow an event of a different type than the previous event\r\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\r\n return;\r\n }\r\n\r\n pointer = makeStartPointer(ev);\r\n\r\n runHandlers('start', ev);\r\n }\r\n /*\r\n * If a move event happens of the right type, update the pointer and run all the move handlers.\r\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\r\n */\r\n function gestureMove(ev) {\r\n if (!pointer || !typesMatch(ev, pointer)) return;\r\n\r\n updatePointerState(ev, pointer);\r\n runHandlers('move', ev);\r\n }\r\n /*\r\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\r\n */\r\n function gestureEnd(ev) {\r\n if (!pointer || !typesMatch(ev, pointer)) return;\r\n\r\n updatePointerState(ev, pointer);\r\n pointer.endTime = +Date.now();\r\n\r\n runHandlers('end', ev);\r\n\r\n lastPointer = pointer;\r\n pointer = null;\r\n }\r\n\r\n}", "title": "" }, { "docid": "7bbd846efdfe25a8dc45e6c775420400", "score": "0.5855212", "text": "setListeners() {\n window.addEventListener('resize', this.resizeHandler.bind(this));\n this.canvas.addEventListener('click', this.clickHandler.bind(this));\n this.canvas.addEventListener('mousedown', this.mouseDownHandler.bind(this));\n this.canvas.addEventListener('touchstart', this.mouseDownHandler.bind(this),{passive:true});\n this.canvas.addEventListener('mousemove', this.mouseMoveHanlder.bind(this));\n this.canvas.addEventListener('touchmove', this.mouseMoveHanlder.bind(this),{passive:true});\n this.canvas.addEventListener('mouseup', this.mouseUpHandler.bind(this));\n this.canvas.addEventListener('touchsend', this.mouseUpHandler.bind(this),{passive:true});\n }", "title": "" }, { "docid": "34b9da4b0af616a1064cdf01a1cbbff9", "score": "0.5854304", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n * \n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click' , clickHijacker , true);\n document.addEventListener('mouseup' , mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus' , mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = {x: ev.x, y: ev.y};\n }\n }\n }\n\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n runHandlers('end', ev);\n\n lastPointer = pointer;\n pointer = null;\n }\n\n}", "title": "" }, { "docid": "34b9da4b0af616a1064cdf01a1cbbff9", "score": "0.5854304", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n * \n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click' , clickHijacker , true);\n document.addEventListener('mouseup' , mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus' , mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = {x: ev.x, y: ev.y};\n }\n }\n }\n\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n runHandlers('end', ev);\n\n lastPointer = pointer;\n pointer = null;\n }\n\n}", "title": "" }, { "docid": "34b9da4b0af616a1064cdf01a1cbbff9", "score": "0.5854304", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n * \n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click' , clickHijacker , true);\n document.addEventListener('mouseup' , mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus' , mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = {x: ev.x, y: ev.y};\n }\n }\n }\n\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n runHandlers('end', ev);\n\n lastPointer = pointer;\n pointer = null;\n }\n\n}", "title": "" }, { "docid": "660c053fef9b97a9671ff84420e21b86", "score": "0.5850334", "text": "function bindEventHandlers() {\r\n\t\t\tif(pageNumber > 1) {\r\n\r\n\t\t\t\t//mobile device finger slide events\r\n\t\t\t\t$root.touchwipe({\r\n\t\t\t\t\twipeLeft: doOnNextSlide,\r\n\t\t\t\t\twipeRight: doOnPreviousSlide,\r\n\t\t\t\t\tpreventDefaultEvents: false\r\n\t\t\t\t});\r\n\r\n\t\t\t\t$(window).on('resize.' + o.namespace, doOnWindowResize);\r\n\t\t\t}\r\n\r\n\t\t\t$root.on('destroy' + o.namespace, doOnDestroy);\r\n\t\t}", "title": "" }, { "docid": "f837a023cd66ab121bc0a90780d6f9a2", "score": "0.5849506", "text": "function addEventListeners() {\n\twindow.addEventListener('resize', resizeCanvas);\n\twindow.addEventListener('keydown', changeDirection);\n\twindow.addEventListener('keyup', stopCharacter);\n\twindow.addEventListener('mousemove', rotate);\n\twindow.addEventListener('click', throwWeapon);\n}", "title": "" } ]
96fb56f913d22b794164829dda9e7279
These helpers produce better VM code in JS engines due to their explicitness and function inlining.
[ { "docid": "642587c0dffe8f20c966f94f9796cfbb", "score": "0.0", "text": "function isUndef (v) {\n return v === undefined || v === null\n}", "title": "" } ]
[ { "docid": "2e950e3a9813cf9c92fdd372ffedcb48", "score": "0.6009507", "text": "function Module(stdlib, foreign, heap) {\n 'use asm';\n\n function foo1(i1) {\n i1 = i1 | 0;\n var i10 = 0;\n i10 = (i1 >> 5) | 0;\n if (i10 >>> 0 < 5) {\n return 1;\n } else {\n return 0;\n }\n return 0;\n }\n\n function foo2(i1) {\n i1 = i1 | 0;\n var i10 = 0;\n i10 = ((i1 | 0) / 32) | 0;\n if (i10 >>> 0 < 5) {\n return 1;\n } else {\n return 0;\n }\n return 0;\n }\n\n function foo3(i1) {\n i1 = i1 | 0;\n var i10 = 0;\n i10 = (i1 + 32 | 0) / 32 | 0;\n if (i10 >>> 0 < 5) {\n return 1;\n } else {\n return 0;\n }\n return 0;\n }\n return {foo1: foo1, foo2: foo2, foo3: foo3};\n}", "title": "" }, { "docid": "3bc6f0d550f6ce4bfd3db989ec532381", "score": "0.59415317", "text": "function __ZNSt3__112_GLOBAL__N_14makeINS_7collateIcEEjEERT_T0_($a0) {\n var label = 0;\n label = 1; \n while(1) switch(label) {\n case 1: \n var $1;\n var $2;\n var $3;\n var $4;\n var $5;\n var $6;\n var $7;\n var $8;\n var $9;\n $9=$a0;\n if (0) { var $28 = 0;label = 3; break; } else { label = 2; break; }\n case 2: \n var $11=$9;\n $7=9968;\n $8=$11;\n var $12=$7;\n var $13=$8;\n $5=$12;\n $6=$13;\n var $14=$5;\n var $15=$14;\n var $16=$6;\n $3=$15;\n $4=$16;\n var $17=$3;\n var $18=$17;\n var $19=$4;\n var $20=((($19)-(1))|0);\n $1=$18;\n $2=$20;\n var $21=$1;\n var $22=$21;\n HEAP32[(($22)>>2)]=((13000)|0);\n var $23=(($21+4)|0);\n var $24=$2;\n HEAP32[(($23)>>2)]=$24;\n var $25=$17;\n HEAP32[(($25)>>2)]=((12344)|0);\n var $26=$14;\n HEAP32[(($26)>>2)]=((12080)|0);\n var $28 = 9968;label = 3; break;\n case 3: \n var $28;\n return 9968;\n default: assert(0, \"bad label: \" + label);\n }\n}", "title": "" }, { "docid": "f2e22bdd7dd07f8f909023a2e276ebcf", "score": "0.5697769", "text": "function _FunctionOptimizeCommand() {\n}", "title": "" }, { "docid": "1c5d4e44a9dff9595478eef7e84124a5", "score": "0.5677531", "text": "function o0(o9,o1,o70) {\n try {\n\"use asm\";\n}catch(e){}\n var o1077 = 0;\n //views\n var o55 = 925107091;\n\n function o0() { try {\no2(\"medium\");\n}catch(e){} }\n try {\nreturn this.o230;\n}catch(e){}\n}", "title": "" }, { "docid": "3ef02ff9f9c1c965dae4b298625f8d49", "score": "0.5666034", "text": "function newVM(a, x, e, r, s){\n return {\n a : a,\n x : x,\n e : e,\n r : r,\n s : s,\n\n /*\n * halt the VM and return the value in the accumulator\n *\n * [halt () a]\n */\n halt : function(){\n return this.a;\n },\n\n /*\n * find value of variable v in the environment and places this into\n * accumulator\n * set next expression to x\n *\n * [refer (var x)\n * (VM (car (lookup var e)) x e r s)]\n */\n refer : function(args){\n var v = args.get(0);\n var x = args.get(1);\n this.a = lookup(v, this.e).car;\n this.x = x;\n return this;\n },\n\n 'native' : function(args){\n var f = args.get(0);\n var x = args.get(1);\n var vars = f.vars;\n\n var map = {};\n while (vars !== list()){\n map[vars.car.value] = lookup(vars.car, this.e).car;\n vars = vars.cdr;\n }\n\n\n this.a = f.apply(this, [map]);\n\t\t\t\tif (this.a.type === undefined){\n\t\t\t\t\tthrow \"unknown type returned by native function \" + f.name;\n\t\t\t\t}\n this.x = x;\n return this;\n },\n\n /*\n * places obj into the accumulator\n * set next expression to x\n *\n * [constant (obj x)\n * (VM obj x e r s)]\n */\n constant : function(args){\n var obj = args.get(0);\n var x = args.get(1);\n this.a = obj;\n this.x = x;\n return this;\n },\n\n /*\n * creates a closure from body, vars and the current environment,\n * places the closure into the accumulator, and\n * sets the next expression to x.\n *\n * [close (vars body x)\n * (VM (closure body e vars) x e r s)]\n */\n close : function(args){\n var vars = args.get(0);\n var body = args.get(1);\n var x = args.get(2);\n \n this.a = closure(body, this.e, vars);\n this.x = x;\n return this;\n },\n\n /*\n * tests the accumulator\n * if the accumulator is #t sets the next expression to thn.\n * otherwise test sets the next expression to els\n *\n * [test (then else)\n * (VM a (if a then else) e r s)]\n */\n test : function(args){ \n var thn = args.get(0);\n var els = args.get(1);\n if (this.a === Types.T){\n this.x = thn;\n } else {\n this.x = els;\n }\n return this;\n },\n\n /*\n * changes the current environment binding for the variable v\n * to the value in the accumulator.\n * sets the next expression to x\n *\n * [assign (var x)\n * (set-car! (lookup var e) a) (VM a x e r s)]\n */\n assign : function(args){ \n var v = args.get(0);\n var x = args.get(1);\n var r = lookup(v, this.e);\n if (r !== list()){\n r.setCar(this.a);\n } else {\n throw v.toString() + \" not defined\";\n }\n this.x = x;\n return this;\n },\n\n define : function(args){\n var v = args.get(0);\n var x = args.get(1);\n var r = lookup(v, cons(this.e.car , list()));\n if (r === list()){\n addToEnv(this.e, v, this.a);\n } else {\n throw v.toString() + \" already defined\";\n }\n this.x = x;\n return this;\n },\n\n /*\n * creates a continuation from the current stack,\n * places this continuation in the accumulator.\n * sets the next expression to x\n *\n * [conti (x)\n * (VM (continuation s) x e r s)]\n */\n conti : function(args){ \n var x = args.get(0);\n this.a = continuation(this.s);\n this.x = x;\n return this;\n },\n\n /*\n * restores s to be the current stack\n * sets the accumulator to the value of var in the current environment,\n * sets the next expression to (return)\n *\n * [nuate (s var)\n * (VM (car (lookup var e)) '(return) e r s)]\n */\n nuate : function(args){ \n var s = args.get(0);\n var v = args.get(1);\n this.a = lookup(v, this.e).car;\n this.s = s;\n this.x = _RETURN_;\n return this;\n },\n\n /*\n * creates a new frame from:\n * ret as the next expression,\n * the current environment,\n * the current rib,\n * and adds this frame to the current stack\n * sets the current rib to the empty list,\n * sets the next expression to x\n *\n * [frame (ret x)\n * (VM a x e '() (call-frame ret e r s))]\n */\n frame : function(args){ \n var ret = args.get(0);\n var x = args.get(1);\n this.s = list(ret, this.e, this.r, this.s);\n this.r = list();\n this.x = x;\n return this;\n },\n\n /*\n * adds the value in the accumulator to the current rib\n * sets the next expression to x\n *\n * [argument (x)\n * (VM a x e (cons a r) s)]\n */\n argument : function(args){ \n var x = args.get(0);\n this.x = x;\n this.r = cons(this.a, this.r);\n return this;\n },\n\n /*\n * takes the closure in the accumulator and:\n * extends the closure's environment with the closure's\n * variable list and the current rib,\n * sets the current environment to this new environment,\n * sets the current rib to the empty list,\n * sets the next expression to the closure's body.\n *\n * [apply ()\n * (record a (body e vars)\n * (VM a body (extend e vars r) '() s))]\n */\n apply : function(){\n\n \n var body = this.a.get(0);\n var e = this.a.get(1);\n var vars = this.a.get(2);\n\n this.x = body;\n if (vars.type === 'symbol'){\n this.e = extend(e, list(vars), list(this.r)); \n } else if (vars.type === 'cons'){\n this.e = extend(e, vars, this.r);\n }\n this.r = list();\n\n return this;\n\n },\n\n /*\n * removes the first frame from the stack and resets the current\n * environment, the current rib, the next expression, and the current stack\n *\n *[return ()\n * (record s (x e r s)\n * (VM a x e r s))])))\n */\n 'return' : function(){\n var x = this.s.get(0);\n var e = this.s.get(1);\n var r = this.s.get(2);\n var s = this.s.get(3);\n\n this.x = x;\n this.e = e;\n this.r = r;\n this.s = s;\n\n return this;\n },\n cycle : function(){\n var result = this;\n var instruction;\n var args;\n while (result === this){\n if (Log.isEnabled){\n Log.log('--------------------------------------');\n Log.log('a');\n Log.log(this.a);\n Log.log('x');\n Log.log(this.x);\n Log.log('e');\n Log.log(envToString(this.e));\n Log.log('r');\n Log.log(this.r);\n Log.log('s');\n Log.log(this.s);\n Log.log('--------------------------------------');\n }\n instruction = this.x.get(0).value;\n args = this.x.cdr;\n if (Log.isEnabled){\n Log.log(\"calling \" + instruction + \" args = \" + args);\n }\n\n\n result = (this[instruction]).apply(this, [args]);\n }\n Log.log(\"=============================================\");\n return result;\n }\n };\n }", "title": "" }, { "docid": "448f5e52569ddda8cc460331b3838259", "score": "0.56147903", "text": "function asm() {\r\n \"use asm\"\r\n function f(a, b) {\r\n a = a|0;\r\n b = b|0;\r\n return a|0;\r\n }\r\n return f;\r\n}", "title": "" }, { "docid": "7b77206b46172e49c73034657a063d8c", "score": "0.5567506", "text": "function Optimizer() {\n}", "title": "" }, { "docid": "e4f7ebfa2083bfc1279739bb0acf59e7", "score": "0.55656743", "text": "function createFunction(mi, scope, hasDynamicScope, breakpoint) {\n release || assert(!mi.isNative(), \"Method should have a builtin: \", mi.name);\n\n if (mi.freeMethod) {\n if (hasDynamicScope) {\n return bindFreeMethodScope(mi, scope);\n }\n return mi.freeMethod;\n }\n\n var fn;\n\n if ((fn = checkMethodOverrides(mi))) {\n release || assert (!hasDynamicScope);\n return fn;\n }\n\n ensureFunctionIsInitialized(mi);\n\n totalFunctionCount ++;\n\n var useInterpreter = false;\n if ((mi.abc.applicationDomain.mode === EXECUTION_MODE.INTERPRET || !shouldCompile(mi)) && !forceCompile(mi)) {\n useInterpreter = true;\n }\n\n if (compileOnly.value >= 0) {\n if (Number(compileOnly.value) !== totalFunctionCount) {\n print(\"Compile Only Skipping \" + totalFunctionCount);\n useInterpreter = true;\n }\n }\n\n if (compileUntil.value >= 0) {\n if (totalFunctionCount > 1000) {\n print(backtrace());\n print(AVM2.getStackTrace());\n }\n if (totalFunctionCount > compileUntil.value) {\n print(\"Compile Until Skipping \" + totalFunctionCount);\n useInterpreter = true;\n }\n }\n\n if (useInterpreter) {\n mi.freeMethod = createInterpretedFunction(mi, scope, hasDynamicScope);\n } else {\n compiledFunctionCount++;\n console.info(\"Compiling: \" + mi + \" count: \" + compiledFunctionCount);\n if (compileOnly.value >= 0 || compileUntil.value >= 0) {\n print(\"Compiling \" + totalFunctionCount);\n }\n mi.freeMethod = createCompiledFunction(mi, scope, hasDynamicScope, breakpoint, mi.isInstanceInitializer);\n }\n\n mi.freeMethod.methodInfo = mi;\n\n if (hasDynamicScope) {\n return bindFreeMethodScope(mi, scope);\n }\n return mi.freeMethod;\n}", "title": "" }, { "docid": "032828e42a2103f55011cd8371922b2f", "score": "0.5548024", "text": "function Compiler () {}", "title": "" }, { "docid": "b3d127db18cab15ca4c7b33a5c718ae5", "score": "0.55286247", "text": "function main() {\n const v2 = [1337,1337,1337,1337,1337];\n function v9() {\n const v15 = {get:RegExp};\n Object.defineProperty(v2,501,v15);\n const v18 = RegExp();\n const v19 = 1337 instanceof v18;\n }\n const v30 = {defineProperty:Function,get:v9,getPrototypeOf:Object};\n const v32 = new Proxy(ArrayBuffer,v30);\n const v34 = gc(v32);\n}", "title": "" }, { "docid": "e8fd4c49c3841c04152d06335a3a4821", "score": "0.55277145", "text": "function lwiw47520() { return ' { v'; }", "title": "" }, { "docid": "876dafb2514e8ab88063edc32e874bac", "score": "0.5525364", "text": "function inlinedFunctionCreator() {\n var layers = cop.computeLayersFor(this),\n hashForLayers = cop.computeHashForLayers(layers);\n\n/*\n// inline method caching -- accessing\nvar cache = cop.inlinedMethodCache[defObj._layer_object_id],\n cachedMethod = cache && cache[hashForLayers];\nif (cachedMethod) {\n cop.installMethod(cachedMethod, defObj, slotName, type)\n return cachedMethod.apply(this, arguments)\n}\n*/\n// if (slotName == 'connect') debugger\n var partialMethods = cop.findPartialMethodsForObject(layers, this, slotName, type),\n inlineFunc = cop.directDynamicInlining ?\n 'inlinePartialMethodsWithDirectValidation' : \n 'inlinePartialMethodsWithValidation',\n inlinedMethod = cop.inliner[inlineFunc](\n defObj, slotName, type, partialMethods, inlinedFunctionCreator, hashForLayers);\n\n inlinedMethod.isInlinedByCop = true;\n inlinedMethod.hash = hashForLayers;\n\n/* \n// inline method caching -- storing\nif (!cache) cache = cop.inlinedMethodCache[defObj._layer_object_id] = {}\ncache[hashForLayers] = inlinedMethod;\n*/\n\n cop.installMethod(inlinedMethod, defObj, slotName, type)\n return inlinedMethod.apply(this, arguments)\n }", "title": "" }, { "docid": "e3c07d7ec35e31fe02e56deeff083230", "score": "0.5521364", "text": "function foo(x) {\n // Two variables holding constants such that the bytecode generation constant folder\n // will not constant fold the division below, but the DFG constant folder will.\n var a = 1;\n var b = 4000;\n // A division that is going to be predicted integer on the first compilation. The\n // compilation will be triggered from the loop below so the slow case counter of the\n // division will be 1, which is too low for the division to be predicted double.\n // If we constant fold this division, we'll have a constant node that is predicted\n // integer but that contains a double. The subsequent addition to x, which is\n // predicted double, will lead the Fixup phase to inject an Int32ToDouble node on\n // the constant-that-was-a-division; subsequent fases in the fixpoint will constant\n // fold that Int32ToDouble. And hence we will have an infinite loop. The correct fix\n // is to disable constant folding of mispredicted nodes; that allows the normal\n // process of correcting predictions (OSR exit profiling, exiting to profiled code,\n // and recompilation with exponential backoff) to take effect so that the next\n // compilation does not make this same mistake.\n var c = (a / b) + x;\n // A pointless loop to force the first compilation to occur before the division got\n // hot. If this loop was not here then the division would be known to produce doubles\n // on the first compilation.\n var d = 0;\n for (var i = 0; i < 1000; ++i)\n d++;\n return c + d;\n}", "title": "" }, { "docid": "582088e4a0f91266b36c381782e727db", "score": "0.5521262", "text": "function adaptToRuntime(body) {\n //body = body.replace(/global\\.__createIterableObject/g,\"__createIterableObject\");\n return body;\n}", "title": "" }, { "docid": "28cf57f68d21e6c2886a74b84cf9dcc5", "score": "0.55162096", "text": "function asmModule() {\r\n \"use asm\";\r\n\r\n let a = [1];\r\n for (let i = 0; i < 2; i++) { // JIT\r\n a[0] = 1;\r\n if (i > 0) {\r\n a[0] = {}; // the array type changed, bailout!!\r\n }\r\n }\r\n\r\n function f(v) {\r\n v = v | 0;\r\n return v | 0;\r\n }\r\n return f;\r\n}", "title": "" }, { "docid": "457bd5e0b08123e6c9167de626666e75", "score": "0.5476076", "text": "function f() {\n \"use asm\";\n\n}", "title": "" }, { "docid": "0aaf3b1041425a40fb6b3f311aaa64a2", "score": "0.54734963", "text": "function _InlineOptimizeCommand() {\n}", "title": "" }, { "docid": "d773a876c10b49541084c23dc81c5975", "score": "0.5472508", "text": "function v2(v3,v4) {\n for (let v8 = 0; v8 < 100; v8 = v8 + 1) {\n }\n const v9 = eval;\n // v9 = .function([.string] => .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"]))\n const v12 = (13.37).toLocaleString();\n // v12 = .unknown\n const v13 = 1337 + v1;\n // v13 = .primitive\n const v14 = v12 >= v13;\n // v14 = .boolean\n}", "title": "" }, { "docid": "bc86b91c8ad4bcbb5233c67d2b157a56", "score": "0.5463699", "text": "function AsmModule() {\r\n \"use asm\";\r\n function f() { \r\n function g() { } \r\n }\r\n}", "title": "" }, { "docid": "a7afeb8b50af2795aa0d588dde9fe7b2", "score": "0.545157", "text": "function v144(v145,v146) {\n function v147(v148,v149) {\n const v150 = 0;\n // v150 = .integer\n const v151 = 100;\n // v151 = .integer\n const v153 = 0;\n // v153 = .integer\n const v154 = 100;\n // v154 = .integer\n const v156 = !1337;\n // v156 = .boolean\n const v157 = {call:v149,construct:v145,defineProperty:v99,deleteProperty:v48,get:v149,getOwnPropertyDescriptor:v148,getPrototypeOf:v148,has:isNaN,isExtensible:v48,ownKeys:v96,preventExtensions:RegExp,set:v145,setPrototypeOf:v148};\n // v157 = .object(ofGroup: Object, withProperties: [\"__proto__\"], withMethods: [\"preventExtensions\", \"get\", \"call\", \"setPrototypeOf\", \"has\", \"getPrototypeOf\", \"isExtensible\", \"deleteProperty\", \"set\", \"construct\", \"getOwnPropertyDescriptor\", \"ownKeys\", \"defineProperty\"])\n const v159 = new Proxy(-1024,v157);\n // v159 = .unknown\n const v160 = v143[1];\n // v160 = .unknown\n const v161 = 1;\n // v161 = .integer\n const v162 = new Float32Array(v136);\n // v162 = .object(ofGroup: Float32Array, withProperties: [\"__proto__\", \"constructor\", \"buffer\", \"byteLength\", \"length\", \"byteOffset\"], withMethods: [\"sort\", \"fill\", \"lastIndexOf\", \"findIndex\", \"entries\", \"copyWithin\", \"reverse\", \"forEach\", \"filter\", \"includes\", \"map\", \"set\", \"keys\", \"every\", \"subarray\", \"reduceRight\", \"join\", \"some\", \"values\", \"find\", \"reduce\", \"indexOf\", \"slice\"])\n const v164 = [v147,-1024];\n // v164 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v165 = v162.includes;\n // v165 = .unknown\n const v166 = Reflect.apply(v165,v160,v164);\n // v166 = .unknown\n return v145;\n }\n const v168 = new Promise(v147);\n // v168 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n return v36;\n }", "title": "" }, { "docid": "e7b9754e712a0d093d755f885d3b1671", "score": "0.54357374", "text": "function foo() { return 1; }", "title": "" }, { "docid": "4debe338af781e2145f8ff42de416b33", "score": "0.54295677", "text": "function v11(v12,v13) {\n for (const v15 of v10) {\n function v16(v17,v18) {\n return v15;\n }\n const v21 = new Int32Array(42908);\n // v21 = .object(ofGroup: Int32Array, withProperties: [\"__proto__\", \"constructor\", \"byteOffset\", \"byteLength\", \"length\", \"buffer\"], withMethods: [\"fill\", \"every\", \"set\", \"reduceRight\", \"sort\", \"join\", \"copyWithin\", \"find\", \"lastIndexOf\", \"values\", \"subarray\", \"reverse\", \"filter\", \"slice\", \"some\", \"indexOf\", \"includes\", \"findIndex\", \"keys\", \"forEach\", \"map\", \"reduce\", \"entries\"])\n let v22 = 42908;\n if (v15) {\n v22 = v12;\n } else {\n v22 = 42908;\n }\n const v26 = -1504637233;\n // v26 = .integer\n let v28 = -1504637233;\n const v30 = [13.37,13.37,13.37,v28,13.37];\n // v30 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v31 = v30 - 1;\n // v31 = .primitive\n for (let v34 = 0; v34 < 100; v34 = v34 + 1) {\n const v35 = v16(\"127\",13.37);\n // v35 = .unknown\n }\n }\n const v37 = new Int8Array(61855);\n // v37 = .object(ofGroup: Int8Array, withProperties: [\"__proto__\", \"byteLength\", \"length\", \"byteOffset\", \"buffer\", \"constructor\"], withMethods: [\"reverse\", \"find\", \"includes\", \"forEach\", \"reduce\", \"values\", \"lastIndexOf\", \"fill\", \"map\", \"keys\", \"some\", \"findIndex\", \"reduceRight\", \"indexOf\", \"join\", \"set\", \"every\", \"sort\", \"subarray\", \"copyWithin\", \"entries\", \"filter\", \"slice\"])\n const v38 = v1.copyWithin(1337,v12);\n // v38 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n}", "title": "" }, { "docid": "e1e2c3164a0f179a0c2d401c34373cf3", "score": "0.5385156", "text": "function pnw () {\n var __symbols__ = ['__py3.6__', '__esv6__'];\n var __all__ = {};\n var __world__ = __all__;\n \n // Nested object creator, part of the nesting may already exist and have attributes\n var __nest__ = function (headObject, tailNames, value) {\n // In some cases this will be a global object, e.g. 'window'\n var current = headObject;\n \n if (tailNames != '') { // Split on empty string doesn't give empty list\n // Find the last already created object in tailNames\n var tailChain = tailNames.split ('.');\n var firstNewIndex = tailChain.length;\n for (var index = 0; index < tailChain.length; index++) {\n if (!current.hasOwnProperty (tailChain [index])) {\n firstNewIndex = index;\n break;\n }\n current = current [tailChain [index]];\n }\n \n // Create the rest of the objects, if any\n for (var index = firstNewIndex; index < tailChain.length; index++) {\n current [tailChain [index]] = {};\n current = current [tailChain [index]];\n }\n }\n \n // Insert it new attributes, it may have been created earlier and have other attributes\n for (var attrib in value) {\n current [attrib] = value [attrib]; \n } \n };\n __all__.__nest__ = __nest__;\n \n // Initialize module if not yet done and return its globals\n var __init__ = function (module) {\n if (!module.__inited__) {\n module.__all__.__init__ (module.__all__);\n module.__inited__ = true;\n }\n return module.__all__;\n };\n __all__.__init__ = __init__;\n \n \n // Proxy switch, controlled by __pragma__ ('proxy') and __pragma ('noproxy')\n var __proxy__ = false; // No use assigning it to __all__, only its transient state is important\n \n \n // Since we want to assign functions, a = b.f should make b.f produce a bound function\n // So __get__ should be called by a property rather then a function\n // Factory __get__ creates one of three curried functions for func\n // Which one is produced depends on what's to the left of the dot of the corresponding JavaScript property\n var __get__ = function (self, func, quotedFuncName) {\n if (self) {\n if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) { // Object before the dot\n if (quotedFuncName) { // Memoize call since fcall is on, by installing bound function in instance\n Object.defineProperty (self, quotedFuncName, { // Will override the non-own property, next time it will be called directly\n value: function () { // So next time just call curry function that calls function\n var args = [] .slice.apply (arguments);\n return func.apply (null, [self] .concat (args));\n }, \n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n return function () { // Return bound function, code dupplication for efficiency if no memoizing\n var args = [] .slice.apply (arguments); // So multilayer search prototype, apply __get__, call curry func that calls func\n return func.apply (null, [self] .concat (args));\n };\n }\n else { // Class before the dot\n return func; // Return static method\n }\n }\n else { // Nothing before the dot\n return func; // Return free function\n }\n }\n __all__.__get__ = __get__;\n\n var __getcm__ = function (self, func, quotedFuncName) {\n if (self.hasOwnProperty ('__class__')) {\n return function () {\n var args = [] .slice.apply (arguments);\n return func.apply (null, [self.__class__] .concat (args));\n };\n }\n else {\n return function () {\n var args = [] .slice.apply (arguments);\n return func.apply (null, [self] .concat (args));\n };\n }\n }\n __all__.__getcm__ = __getcm__;\n \n var __getsm__ = function (self, func, quotedFuncName) {\n return func;\n }\n __all__.__getsm__ = __getsm__;\n \n // Mother of all metaclasses \n var py_metatype = {\n __name__: 'type',\n __bases__: [],\n \n // Overridable class creation worker\n __new__: function (meta, name, bases, attribs) {\n // Create the class cls, a functor, which the class creator function will return\n var cls = function () { // If cls is called with arg0, arg1, etc, it calls its __new__ method with [arg0, arg1, etc]\n var args = [] .slice.apply (arguments); // It has a __new__ method, not yet but at call time, since it is copied from the parent in the loop below\n return cls.__new__ (args); // Each Python class directly or indirectly derives from object, which has the __new__ method\n }; // If there are no bases in the Python source, the compiler generates [object] for this parameter\n \n // Copy all methods, including __new__, properties and static attributes from base classes to new cls object\n // The new class object will simply be the prototype of its instances\n // JavaScript prototypical single inheritance will do here, since any object has only one class\n // This has nothing to do with Python multiple inheritance, that is implemented explictly in the copy loop below\n for (var index = bases.length - 1; index >= 0; index--) { // Reversed order, since class vars of first base should win\n var base = bases [index];\n for (var attrib in base) {\n var descrip = Object.getOwnPropertyDescriptor (base, attrib);\n Object.defineProperty (cls, attrib, descrip);\n } \n\n for (var symbol of Object.getOwnPropertySymbols (base)) {\n var descrip = Object.getOwnPropertyDescriptor (base, symbol);\n Object.defineProperty (cls, symbol, descrip);\n }\n \n }\n \n // Add class specific attributes to the created cls object\n cls.__metaclass__ = meta;\n cls.__name__ = name;\n cls.__bases__ = bases;\n \n // Add own methods, properties and own static attributes to the created cls object\n for (var attrib in attribs) {\n var descrip = Object.getOwnPropertyDescriptor (attribs, attrib);\n Object.defineProperty (cls, attrib, descrip);\n }\n\n for (var symbol of Object.getOwnPropertySymbols (attribs)) {\n var descrip = Object.getOwnPropertyDescriptor (attribs, symbol);\n Object.defineProperty (cls, symbol, descrip);\n }\n \n // Return created cls object\n return cls;\n }\n };\n py_metatype.__metaclass__ = py_metatype;\n __all__.py_metatype = py_metatype;\n \n // Mother of all classes\n var object = {\n __init__: function (self) {},\n \n __metaclass__: py_metatype, // By default, all classes have metaclass type, since they derive from object\n __name__: 'object',\n __bases__: [],\n \n // Object creator function, is inherited by all classes (so could be global)\n __new__: function (args) { // Args are just the constructor args \n // In JavaScript the Python class is the prototype of the Python object\n // In this way methods and static attributes will be available both with a class and an object before the dot\n // The descriptor produced by __get__ will return the right method flavor\n var instance = Object.create (this, {__class__: {value: this, enumerable: true}});\n \n if ('__getattr__' in this || '__setattr__' in this) {\n instance = new Proxy (instance, {\n get: function (target, name) {\n var result = target [name];\n if (result == undefined) { // Target doesn't have attribute named name\n return target.__getattr__ (name);\n }\n else {\n return result;\n }\n },\n set: function (target, name, value) {\n try {\n target.__setattr__ (name, value);\n }\n catch (exception) { // Target doesn't have a __setattr__ method\n target [name] = value;\n }\n return true;\n }\n })\n }\n\n // Call constructor\n this.__init__.apply (null, [instance] .concat (args));\n\n // Return constructed instance\n return instance;\n } \n };\n __all__.object = object;\n \n // Class creator facade function, calls class creation worker\n var __class__ = function (name, bases, attribs, meta) { // Parameter meta is optional\n if (meta == undefined) {\n meta = bases [0] .__metaclass__;\n }\n \n return meta.__new__ (meta, name, bases, attribs);\n }\n __all__.__class__ = __class__;\n \n // Define __pragma__ to preserve '<all>' and '</all>', since it's never generated as a function, must be done early, so here\n var __pragma__ = function () {};\n __all__.__pragma__ = __pragma__;\n \n \t__nest__ (\n\t\t__all__,\n\t\t'org.transcrypt.__base__', {\n\t\t\t__all__: {\n\t\t\t\t__inited__: false,\n\t\t\t\t__init__: function (__all__) {\n\t\t\t\t\tvar __Envir__ = __class__ ('__Envir__', [object], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self) {\n\t\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'self': var self = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tself.interpreter_name = 'python';\n\t\t\t\t\t\t\tself.transpiler_name = 'transcrypt';\n\t\t\t\t\t\t\tself.transpiler_version = '3.6.54';\n\t\t\t\t\t\t\tself.target_subdir = '__javascript__';\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar __envir__ = __Envir__ ();\n\t\t\t\t\t__pragma__ ('<all>')\n\t\t\t\t\t\t__all__.__Envir__ = __Envir__;\n\t\t\t\t\t\t__all__.__envir__ = __envir__;\n\t\t\t\t\t__pragma__ ('</all>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t__nest__ (\n\t\t__all__,\n\t\t'org.transcrypt.__standard__', {\n\t\t\t__all__: {\n\t\t\t\t__inited__: false,\n\t\t\t\t__init__: function (__all__) {\n\t\t\t\t\tvar Exception = __class__ ('Exception', [object], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self) {\n\t\t\t\t\t\t\tvar kwargs = dict ();\n\t\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'self': var self = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tdefault: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdelete kwargs.__kwargtrans__;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tvar args = tuple ();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tself.__args__ = args;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tself.stack = kwargs.error.stack;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (__except0__) {\n\t\t\t\t\t\t\t\tself.stack = 'No stack trace available';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});},\n\t\t\t\t\t\tget __repr__ () {return __get__ (this, function (self) {\n\t\t\t\t\t\t\tif (len (self.__args__)) {\n\t\t\t\t\t\t\t\treturn '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__)));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\treturn '{}()'.format (self.__class__.__name__);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});},\n\t\t\t\t\t\tget __str__ () {return __get__ (this, function (self) {\n\t\t\t\t\t\t\tif (len (self.__args__) > 1) {\n\t\t\t\t\t\t\t\treturn str (tuple (self.__args__));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (len (self.__args__)) {\n\t\t\t\t\t\t\t\treturn str (self.__args__ [0]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar IterableError = __class__ ('IterableError', [Exception], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, error) {\n\t\t\t\t\t\t\tException.__init__ (self, \"Can't iterate over non-iterable\", __kwargtrans__ ({error: error}));\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar StopIteration = __class__ ('StopIteration', [Exception], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, error) {\n\t\t\t\t\t\t\tException.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error}));\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar ValueError = __class__ ('ValueError', [Exception], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, error) {\n\t\t\t\t\t\t\tException.__init__ (self, 'Erroneous value', __kwargtrans__ ({error: error}));\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar KeyError = __class__ ('KeyError', [Exception], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, error) {\n\t\t\t\t\t\t\tException.__init__ (self, 'Invalid key', __kwargtrans__ ({error: error}));\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar AssertionError = __class__ ('AssertionError', [Exception], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\n\t\t\t\t\t\t\tif (message) {\n\t\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tException.__init__ (self, __kwargtrans__ ({error: error}));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar NotImplementedError = __class__ ('NotImplementedError', [Exception], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\n\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar IndexError = __class__ ('IndexError', [Exception], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\n\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar AttributeError = __class__ ('AttributeError', [Exception], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\n\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar Warning = __class__ ('Warning', [Exception], {\n\t\t\t\t\t});\n\t\t\t\t\tvar UserWarning = __class__ ('UserWarning', [Warning], {\n\t\t\t\t\t});\n\t\t\t\t\tvar DeprecationWarning = __class__ ('DeprecationWarning', [Warning], {\n\t\t\t\t\t});\n\t\t\t\t\tvar RuntimeWarning = __class__ ('RuntimeWarning', [Warning], {\n\t\t\t\t\t});\n\t\t\t\t\tvar __sort__ = function (iterable, key, reverse) {\n\t\t\t\t\t\tif (typeof key == 'undefined' || (key != null && key .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar key = null;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (typeof reverse == 'undefined' || (reverse != null && reverse .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar reverse = false;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'key': var key = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (key) {\n\t\t\t\t\t\t\titerable.sort ((function __lambda__ (a, b) {\n\t\t\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'a': var a = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'b': var b = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn (key (a) > key (b) ? 1 : -(1));\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\titerable.sort ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (reverse) {\n\t\t\t\t\t\t\titerable.reverse ();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tvar sorted = function (iterable, key, reverse) {\n\t\t\t\t\t\tif (typeof key == 'undefined' || (key != null && key .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar key = null;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (typeof reverse == 'undefined' || (reverse != null && reverse .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar reverse = false;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'key': var key = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (py_typeof (iterable) == dict) {\n\t\t\t\t\t\t\tvar result = copy (iterable.py_keys ());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar result = copy (iterable);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__sort__ (result, key, reverse);\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t\tvar map = function (func, iterable) {\n\t\t\t\t\t\treturn function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var item of iterable) {\n\t\t\t\t\t\t\t\t__accu0__.append (func (item));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn __accu0__;\n\t\t\t\t\t\t} ();\n\t\t\t\t\t};\n\t\t\t\t\tvar filter = function (func, iterable) {\n\t\t\t\t\t\tif (func == null) {\n\t\t\t\t\t\t\tvar func = bool;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var item of iterable) {\n\t\t\t\t\t\t\t\tif (func (item)) {\n\t\t\t\t\t\t\t\t\t__accu0__.append (item);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn __accu0__;\n\t\t\t\t\t\t} ();\n\t\t\t\t\t};\n\t\t\t\t\tvar __Terminal__ = __class__ ('__Terminal__', [object], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self) {\n\t\t\t\t\t\t\tself.buffer = '';\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tself.element = document.getElementById ('__terminal__');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (__except0__) {\n\t\t\t\t\t\t\t\tself.element = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (self.element) {\n\t\t\t\t\t\t\t\tself.element.style.overflowX = 'auto';\n\t\t\t\t\t\t\t\tself.element.style.boxSizing = 'border-box';\n\t\t\t\t\t\t\t\tself.element.style.padding = '5px';\n\t\t\t\t\t\t\t\tself.element.innerHTML = '_';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});},\n\t\t\t\t\t\tget print () {return __get__ (this, function (self) {\n\t\t\t\t\t\t\tvar sep = ' ';\n\t\t\t\t\t\t\tvar end = '\\n';\n\t\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'self': var self = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'sep': var sep = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'end': var end = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tvar args = tuple ();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tself.buffer = '{}{}{}'.format (self.buffer, sep.join (function () {\n\t\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\t\tfor (var arg of args) {\n\t\t\t\t\t\t\t\t\t__accu0__.append (str (arg));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn __accu0__;\n\t\t\t\t\t\t\t} ()), end).__getslice__ (-(4096), null, 1);\n\t\t\t\t\t\t\tif (self.element) {\n\t\t\t\t\t\t\t\tself.element.innerHTML = self.buffer.py_replace ('\\n', '<br>');\n\t\t\t\t\t\t\t\tself.element.scrollTop = self.element.scrollHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tconsole.log (sep.join (function () {\n\t\t\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\t\t\tfor (var arg of args) {\n\t\t\t\t\t\t\t\t\t\t__accu0__.append (str (arg));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn __accu0__;\n\t\t\t\t\t\t\t\t} ()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});},\n\t\t\t\t\t\tget input () {return __get__ (this, function (self, question) {\n\t\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'self': var self = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'question': var question = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tself.print ('{}'.format (question), __kwargtrans__ ({end: ''}));\n\t\t\t\t\t\t\tvar answer = window.prompt ('\\n'.join (self.buffer.py_split ('\\n').__getslice__ (-(16), null, 1)));\n\t\t\t\t\t\t\tself.print (answer);\n\t\t\t\t\t\t\treturn answer;\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar __terminal__ = __Terminal__ ();\n\t\t\t\t\t__pragma__ ('<all>')\n\t\t\t\t\t\t__all__.AssertionError = AssertionError;\n\t\t\t\t\t\t__all__.AttributeError = AttributeError;\n\t\t\t\t\t\t__all__.DeprecationWarning = DeprecationWarning;\n\t\t\t\t\t\t__all__.Exception = Exception;\n\t\t\t\t\t\t__all__.IndexError = IndexError;\n\t\t\t\t\t\t__all__.IterableError = IterableError;\n\t\t\t\t\t\t__all__.KeyError = KeyError;\n\t\t\t\t\t\t__all__.NotImplementedError = NotImplementedError;\n\t\t\t\t\t\t__all__.RuntimeWarning = RuntimeWarning;\n\t\t\t\t\t\t__all__.StopIteration = StopIteration;\n\t\t\t\t\t\t__all__.UserWarning = UserWarning;\n\t\t\t\t\t\t__all__.ValueError = ValueError;\n\t\t\t\t\t\t__all__.Warning = Warning;\n\t\t\t\t\t\t__all__.__Terminal__ = __Terminal__;\n\t\t\t\t\t\t__all__.__sort__ = __sort__;\n\t\t\t\t\t\t__all__.__terminal__ = __terminal__;\n\t\t\t\t\t\t__all__.filter = filter;\n\t\t\t\t\t\t__all__.map = map;\n\t\t\t\t\t\t__all__.sorted = sorted;\n\t\t\t\t\t__pragma__ ('</all>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n var __call__ = function (/* <callee>, <this>, <params>* */) { // Needed for __base__ and __standard__ if global 'opov' switch is on\n var args = [] .slice.apply (arguments);\n if (typeof args [0] == 'object' && '__call__' in args [0]) { // Overloaded\n return args [0] .__call__ .apply (args [1], args.slice (2));\n }\n else { // Native\n return args [0] .apply (args [1], args.slice (2));\n }\n };\n __all__.__call__ = __call__;\n\n // Initialize non-nested modules __base__ and __standard__ and make its names available directly and via __all__\n // They can't do that itself, because they're regular Python modules\n // The compiler recognizes their names and generates them inline rather than nesting them\n // In this way it isn't needed to import them everywhere\n\n // __base__\n\n __nest__ (__all__, '', __init__ (__all__.org.transcrypt.__base__));\n var __envir__ = __all__.__envir__;\n\n // __standard__\n\n __nest__ (__all__, '', __init__ (__all__.org.transcrypt.__standard__));\n\n var Exception = __all__.Exception;\n var IterableError = __all__.IterableError;\n var StopIteration = __all__.StopIteration;\n var ValueError = __all__.ValueError;\n var KeyError = __all__.KeyError;\n var AssertionError = __all__.AssertionError;\n var NotImplementedError = __all__.NotImplementedError;\n var IndexError = __all__.IndexError;\n var AttributeError = __all__.AttributeError;\n\n // Warnings Exceptions\n var Warning = __all__.Warning;\n var UserWarning = __all__.UserWarning;\n var DeprecationWarning = __all__.DeprecationWarning;\n var RuntimeWarning = __all__.RuntimeWarning;\n\n var __sort__ = __all__.__sort__;\n var sorted = __all__.sorted;\n\n var map = __all__.map;\n var filter = __all__.filter;\n\n __all__.print = __all__.__terminal__.print;\n __all__.input = __all__.__terminal__.input;\n\n var __terminal__ = __all__.__terminal__;\n var print = __all__.print;\n var input = __all__.input;\n\n // Complete __envir__, that was created in __base__, for non-stub mode\n __envir__.executor_name = __envir__.transpiler_name;\n\n // Make make __main__ available in browser\n var __main__ = {__file__: ''};\n __all__.main = __main__;\n\n // Define current exception, there's at most one exception in the air at any time\n var __except__ = null;\n __all__.__except__ = __except__;\n \n // Creator of a marked dictionary, used to pass **kwargs parameter\n var __kwargtrans__ = function (anObject) {\n anObject.__kwargtrans__ = null; // Removable marker\n anObject.constructor = Object;\n return anObject;\n }\n __all__.__kwargtrans__ = __kwargtrans__;\n\n // 'Oneshot' dict promotor, used to enrich __all__ and help globals () return a true dict\n var __globals__ = function (anObject) {\n if (isinstance (anObject, dict)) { // Don't attempt to promote (enrich) again, since it will make a copy\n return anObject;\n }\n else {\n return dict (anObject)\n }\n }\n __all__.__globals__ = __globals__\n \n // Partial implementation of super () .<methodName> (<params>)\n var __super__ = function (aClass, methodName) {\n // Lean and fast, no C3 linearization, only call first implementation encountered\n // Will allow __super__ ('<methodName>') (self, <params>) rather than only <className>.<methodName> (self, <params>)\n \n for (let base of aClass.__bases__) {\n if (methodName in base) {\n return base [methodName];\n }\n }\n\n throw new Exception ('Superclass method not found'); // !!! Improve!\n }\n __all__.__super__ = __super__\n \n // Python property installer function, no member since that would bloat classes\n var property = function (getter, setter) { // Returns a property descriptor rather than a property\n if (!setter) { // ??? Make setter optional instead of dummy?\n setter = function () {};\n }\n return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true};\n }\n __all__.property = property;\n \n // Conditional JavaScript property installer function, prevents redefinition of properties if multiple Transcrypt apps are on one page\n var __setProperty__ = function (anObject, name, descriptor) {\n if (!anObject.hasOwnProperty (name)) {\n Object.defineProperty (anObject, name, descriptor);\n }\n }\n __all__.__setProperty__ = __setProperty__\n \n // Assert function, call to it only generated when compiling with --dassert option\n function assert (condition, message) { // Message may be undefined\n if (!condition) {\n throw AssertionError (message, new Error ());\n }\n }\n\n __all__.assert = assert;\n\n var __merge__ = function (object0, object1) {\n var result = {};\n for (var attrib in object0) {\n result [attrib] = object0 [attrib];\n }\n for (var attrib in object1) {\n result [attrib] = object1 [attrib];\n }\n return result;\n };\n __all__.__merge__ = __merge__;\n\n // Manipulating attributes by name\n \n var dir = function (obj) {\n var aList = [];\n for (var aKey in obj) {\n aList.push (aKey);\n }\n aList.sort ();\n return aList;\n };\n __all__.dir = dir;\n\n var setattr = function (obj, name, value) {\n obj [name] = value;\n };\n __all__.setattr = setattr;\n\n var getattr = function (obj, name) {\n return obj [name];\n };\n __all__.getattr= getattr;\n\n var hasattr = function (obj, name) {\n try {\n return name in obj;\n }\n catch (exception) {\n return false;\n }\n };\n __all__.hasattr = hasattr;\n\n var delattr = function (obj, name) {\n delete obj [name];\n };\n __all__.delattr = (delattr);\n\n // The __in__ function, used to mimic Python's 'in' operator\n // In addition to CPython's semantics, the 'in' operator is also allowed to work on objects, avoiding a counterintuitive separation between Python dicts and JavaScript objects\n // In general many Transcrypt compound types feature a deliberate blend of Python and JavaScript facilities, facilitating efficient integration with JavaScript libraries\n // If only Python objects and Python dicts are dealt with in a certain context, the more pythonic 'hasattr' is preferred for the objects as opposed to 'in' for the dicts\n var __in__ = function (element, container) {\n if (py_typeof (container) == dict) { // Currently only implemented as an augmented JavaScript object\n return container.hasOwnProperty (element);\n }\n else { // Parameter 'element' itself is an array, string or a plain, non-dict JavaScript object\n return (\n container.indexOf ? // If it has an indexOf\n container.indexOf (element) > -1 : // it's an array or a string,\n container.hasOwnProperty (element) // else it's a plain, non-dict JavaScript object\n );\n }\n };\n __all__.__in__ = __in__;\n\n // Find out if an attribute is special\n var __specialattrib__ = function (attrib) {\n return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_');\n };\n __all__.__specialattrib__ = __specialattrib__;\n\n // Compute length of any object\n var len = function (anObject) {\n if (anObject === undefined || anObject === null) {\n return 0;\n }\n\n if (anObject.__len__ instanceof Function) {\n return anObject.__len__ ();\n }\n\n if (anObject.length !== undefined) {\n return anObject.length;\n }\n\n var length = 0;\n for (var attr in anObject) {\n if (!__specialattrib__ (attr)) {\n length++;\n }\n }\n\n return length;\n };\n __all__.len = len;\n\n // General conversions\n\n function __i__ (any) { // Conversion to iterable\n return py_typeof (any) == dict ? any.py_keys () : any;\n }\n\n // If the target object is somewhat true, return it. Otherwise return false.\n // Try to follow Python conventions of truthyness\n function __t__ (target) { \n return (\n // Avoid invalid checks\n target === undefined || target === null ? false :\n \n // Take a quick shortcut if target is a simple type\n ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target :\n \n // Use __bool__ (if present) to decide if target is true\n target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) :\n \n // There is no __bool__, use __len__ (if present) instead\n target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) :\n \n // There is no __bool__ and no __len__, declare Functions true.\n // Python objects are transpiled into instances of Function and if\n // there is no __bool__ or __len__, the object in Python is true.\n target instanceof Function ? target :\n \n // Target is something else, compute its len to decide\n len (target) !== 0 ? target :\n \n // When all else fails, declare target as false\n false\n );\n }\n __all__.__t__ = __t__;\n\n var bool = function (any) { // Always truly returns a bool, rather than something truthy or falsy\n return !!__t__ (any);\n };\n bool.__name__ = 'bool'; // So it can be used as a type with a name\n __all__.bool = bool;\n\n var float = function (any) {\n if (any == 'inf') {\n return Infinity;\n }\n else if (any == '-inf') {\n return -Infinity;\n }\n else if (isNaN (parseFloat (any))) { // Call to parseFloat needed to exclude '', ' ' etc.\n if (any === false) {\n return 0;\n }\n else if (any === true) {\n return 1;\n }\n else { // Needed e.g. in autoTester.check, so \"return any ? true : false\" won't do\n throw ValueError (new Error ());\n }\n }\n else {\n return +any;\n }\n };\n float.__name__ = 'float';\n __all__.float = float;\n\n var int = function (any) {\n return float (any) | 0\n };\n int.__name__ = 'int';\n __all__.int = int;\n\n var py_typeof = function (anObject) {\n var aType = typeof anObject;\n if (aType == 'object') { // Directly trying '__class__ in anObject' turns out to wreck anObject in Chrome if its a primitive\n try {\n return anObject.__class__;\n }\n catch (exception) {\n return aType;\n }\n }\n else {\n return ( // Odly, the braces are required here\n aType == 'boolean' ? bool :\n aType == 'string' ? str :\n aType == 'number' ? (anObject % 1 == 0 ? int : float) :\n null\n );\n }\n };\n __all__.py_typeof = py_typeof;\n\n var isinstance = function (anObject, classinfo) {\n function isA (queryClass) {\n if (queryClass == classinfo) {\n return true;\n }\n for (var index = 0; index < queryClass.__bases__.length; index++) {\n if (isA (queryClass.__bases__ [index], classinfo)) {\n return true;\n }\n }\n return false;\n }\n\n if (classinfo instanceof Array) { // Assume in most cases it isn't, then making it recursive rather than two functions saves a call\n for (let aClass of classinfo) {\n if (isinstance (anObject, aClass)) {\n return true;\n }\n }\n return false;\n }\n\n try { // Most frequent use case first\n return '__class__' in anObject ? isA (anObject.__class__) : anObject instanceof classinfo;\n }\n catch (exception) { // Using isinstance on primitives assumed rare\n var aType = py_typeof (anObject);\n return aType == classinfo || (aType == bool && classinfo == int);\n }\n };\n __all__.isinstance = isinstance;\n\n var callable = function (anObject) {\n if ( typeof anObject == 'object' && '__call__' in anObject ) {\n return true;\n }\n else {\n return typeof anObject === 'function';\n }\n };\n __all__.callable = callable;\n\n // Repr function uses __repr__ method, then __str__, then toString\n var repr = function (anObject) {\n try {\n return anObject.__repr__ ();\n }\n catch (exception) {\n try {\n return anObject.__str__ ();\n }\n catch (exception) { // anObject has no __repr__ and no __str__\n try {\n if (anObject == null) {\n return 'None';\n }\n else if (anObject.constructor == Object) {\n var result = '{';\n var comma = false;\n for (var attrib in anObject) {\n if (!__specialattrib__ (attrib)) {\n if (attrib.isnumeric ()) {\n var attribRepr = attrib; // If key can be interpreted as numerical, we make it numerical\n } // So we accept that '1' is misrepresented as 1\n else {\n var attribRepr = '\\'' + attrib + '\\''; // Alpha key in dict\n }\n\n if (comma) {\n result += ', ';\n }\n else {\n comma = true;\n }\n result += attribRepr + ': ' + repr (anObject [attrib]);\n }\n }\n result += '}';\n return result;\n }\n else {\n return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString ();\n }\n }\n catch (exception) {\n return '<object of type: ' + typeof anObject + '>';\n }\n }\n }\n };\n __all__.repr = repr;\n\n // Char from Unicode or ASCII\n var chr = function (charCode) {\n return String.fromCharCode (charCode);\n };\n __all__.chr = chr;\n\n // Unicode or ASCII from char\n var ord = function (aChar) {\n return aChar.charCodeAt (0);\n };\n __all__.ord = ord;\n\n // Maximum of n numbers\n var max = Math.max;\n __all__.max = max;\n\n // Minimum of n numbers\n var min = Math.min;\n __all__.min = min;\n\n // Absolute value\n var abs = Math.abs;\n __all__.abs = abs;\n\n // Bankers rounding\n var round = function (number, ndigits) {\n if (ndigits) {\n var scale = Math.pow (10, ndigits);\n number *= scale;\n }\n\n var rounded = Math.round (number);\n if (rounded - number == 0.5 && rounded % 2) { // Has rounded up to odd, should have rounded down to even\n rounded -= 1;\n }\n\n if (ndigits) {\n rounded /= scale;\n }\n\n return rounded;\n };\n __all__.round = round;\n\n // BEGIN unified iterator model\n\n function __jsUsePyNext__ () { // Add as 'next' method to make Python iterator JavaScript compatible\n try {\n var result = this.__next__ ();\n return {value: result, done: false};\n }\n catch (exception) {\n return {value: undefined, done: true};\n }\n }\n\n function __pyUseJsNext__ () { // Add as '__next__' method to make JavaScript iterator Python compatible\n var result = this.next ();\n if (result.done) {\n throw StopIteration (new Error ());\n }\n else {\n return result.value;\n }\n }\n\n function py_iter (iterable) { // Alias for Python's iter function, produces a universal iterator / iterable, usable in Python and JavaScript\n if (typeof iterable == 'string' || '__iter__' in iterable) { // JavaScript Array or string or Python iterable (string has no 'in')\n var result = iterable.__iter__ (); // Iterator has a __next__\n result.next = __jsUsePyNext__; // Give it a next\n }\n else if ('selector' in iterable) { // Assume it's a JQuery iterator\n var result = list (iterable) .__iter__ (); // Has a __next__\n result.next = __jsUsePyNext__; // Give it a next\n }\n else if ('next' in iterable) { // It's a JavaScript iterator already, maybe a generator, has a next and may have a __next__\n var result = iterable\n if (! ('__next__' in result)) { // If there's no danger of recursion\n result.__next__ = __pyUseJsNext__; // Give it a __next__\n }\n }\n else if (Symbol.iterator in iterable) { // It's a JavaScript iterable such as a typed array, but not an iterator\n var result = iterable [Symbol.iterator] (); // Has a next\n result.__next__ = __pyUseJsNext__; // Give it a __next__\n }\n else {\n throw IterableError (new Error ()); // No iterator at all\n }\n result [Symbol.iterator] = function () {return result;};\n return result;\n }\n\n function py_next (iterator) { // Called only in a Python context, could receive Python or JavaScript iterator\n try { // Primarily assume Python iterator, for max speed\n var result = iterator.__next__ ();\n }\n catch (exception) { // JavaScript iterators are the exception here\n var result = iterator.next ();\n if (result.done) {\n throw StopIteration (new Error ());\n }\n else {\n return result.value;\n }\n }\n if (result == undefined) {\n throw StopIteration (new Error ());\n }\n else {\n return result;\n }\n }\n\n function __PyIterator__ (iterable) {\n this.iterable = iterable;\n this.index = 0;\n }\n\n __PyIterator__.prototype.__next__ = function () {\n if (this.index < this.iterable.length) {\n return this.iterable [this.index++];\n }\n else {\n throw StopIteration (new Error ());\n }\n };\n\n function __JsIterator__ (iterable) {\n this.iterable = iterable;\n this.index = 0;\n }\n\n __JsIterator__.prototype.next = function () {\n if (this.index < this.iterable.py_keys.length) {\n return {value: this.index++, done: false};\n }\n else {\n return {value: undefined, done: true};\n }\n };\n\n // END unified iterator model\n\n // Reversed function for arrays\n var py_reversed = function (iterable) {\n iterable = iterable.slice ();\n iterable.reverse ();\n return iterable;\n };\n __all__.py_reversed = py_reversed;\n\n // Zip method for arrays and strings\n var zip = function () {\n var args = [] .slice.call (arguments);\n for (var i = 0; i < args.length; i++) {\n if (typeof args [i] == 'string') {\n args [i] = args [i] .split ('');\n }\n else if (!Array.isArray (args [i])) {\n args [i] = Array.from (args [i]);\n }\n }\n var shortest = args.length == 0 ? [] : args.reduce ( // Find shortest array in arguments\n function (array0, array1) {\n return array0.length < array1.length ? array0 : array1;\n }\n );\n return shortest.map ( // Map each element of shortest array\n function (current, index) { // To the result of this function\n return args.map ( // Map each array in arguments\n function (current) { // To the result of this function\n return current [index]; // Namely it's index't entry\n }\n );\n }\n );\n };\n __all__.zip = zip;\n\n // Range method, returning an array\n function range (start, stop, step) {\n if (stop == undefined) {\n // one param defined\n stop = start;\n start = 0;\n }\n if (step == undefined) {\n step = 1;\n }\n if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) {\n return [];\n }\n var result = [];\n for (var i = start; step > 0 ? i < stop : i > stop; i += step) {\n result.push(i);\n }\n return result;\n };\n __all__.range = range;\n\n // Any, all and sum\n\n function any (iterable) {\n for (let item of iterable) {\n if (bool (item)) {\n return true;\n }\n }\n return false;\n }\n function all (iterable) {\n for (let item of iterable) {\n if (! bool (item)) {\n return false;\n }\n }\n return true;\n }\n function sum (iterable) {\n let result = 0;\n for (let item of iterable) {\n result += item;\n }\n return result;\n }\n\n __all__.any = any;\n __all__.all = all;\n __all__.sum = sum;\n\n // Enumerate method, returning a zipped list\n function enumerate (iterable) {\n return zip (range (len (iterable)), iterable);\n }\n __all__.enumerate = enumerate;\n\n // Shallow and deepcopy\n\n function copy (anObject) {\n if (anObject == null || typeof anObject == \"object\") {\n return anObject;\n }\n else {\n var result = {};\n for (var attrib in obj) {\n if (anObject.hasOwnProperty (attrib)) {\n result [attrib] = anObject [attrib];\n }\n }\n return result;\n }\n }\n __all__.copy = copy;\n\n function deepcopy (anObject) {\n if (anObject == null || typeof anObject == \"object\") {\n return anObject;\n }\n else {\n var result = {};\n for (var attrib in obj) {\n if (anObject.hasOwnProperty (attrib)) {\n result [attrib] = deepcopy (anObject [attrib]);\n }\n }\n return result;\n }\n }\n __all__.deepcopy = deepcopy;\n\n // List extensions to Array\n\n function list (iterable) { // All such creators should be callable without new\n var instance = iterable ? Array.from (iterable) : [];\n // Sort is the normal JavaScript sort, Python sort is a non-member function\n return instance;\n }\n __all__.list = list;\n Array.prototype.__class__ = list; // All arrays are lists (not only if constructed by the list ctor), unless constructed otherwise\n list.__name__ = 'list';\n\n /*\n Array.from = function (iterator) { // !!! remove\n result = [];\n for (item of iterator) {\n result.push (item);\n }\n return result;\n }\n */\n\n Array.prototype.__iter__ = function () {return new __PyIterator__ (this);};\n\n Array.prototype.__getslice__ = function (start, stop, step) {\n if (start < 0) {\n start = this.length + start;\n }\n\n if (stop == null) {\n stop = this.length;\n }\n else if (stop < 0) {\n stop = this.length + stop;\n }\n else if (stop > this.length) {\n stop = this.length;\n }\n\n var result = list ([]);\n for (var index = start; index < stop; index += step) {\n result.push (this [index]);\n }\n\n return result;\n };\n\n Array.prototype.__setslice__ = function (start, stop, step, source) {\n if (start < 0) {\n start = this.length + start;\n }\n\n if (stop == null) {\n stop = this.length;\n }\n else if (stop < 0) {\n stop = this.length + stop;\n }\n\n if (step == null) { // Assign to 'ordinary' slice, replace subsequence\n Array.prototype.splice.apply (this, [start, stop - start] .concat (source));\n }\n else { // Assign to extended slice, replace designated items one by one\n var sourceIndex = 0;\n for (var targetIndex = start; targetIndex < stop; targetIndex += step) {\n this [targetIndex] = source [sourceIndex++];\n }\n }\n };\n\n Array.prototype.__repr__ = function () {\n if (this.__class__ == set && !this.length) {\n return 'set()';\n }\n\n var result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{';\n\n for (var index = 0; index < this.length; index++) {\n if (index) {\n result += ', ';\n }\n result += repr (this [index]);\n }\n\n if (this.__class__ == tuple && this.length == 1) {\n result += ',';\n }\n\n result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';;\n return result;\n };\n\n Array.prototype.__str__ = Array.prototype.__repr__;\n\n Array.prototype.append = function (element) {\n this.push (element);\n };\n\n Array.prototype.clear = function () {\n this.length = 0;\n };\n\n Array.prototype.extend = function (aList) {\n this.push.apply (this, aList);\n };\n\n Array.prototype.insert = function (index, element) {\n this.splice (index, 0, element);\n };\n\n Array.prototype.remove = function (element) {\n var index = this.indexOf (element);\n if (index == -1) {\n throw ValueError (new Error ());\n }\n this.splice (index, 1);\n };\n\n Array.prototype.index = function (element) {\n return this.indexOf (element);\n };\n\n Array.prototype.py_pop = function (index) {\n if (index == undefined) {\n return this.pop (); // Remove last element\n }\n else {\n return this.splice (index, 1) [0];\n }\n };\n\n Array.prototype.py_sort = function () {\n __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); // Can't work directly with arguments\n // Python params: (iterable, key = None, reverse = False)\n // py_sort is called with the Transcrypt kwargs mechanism, and just passes the params on to __sort__\n // __sort__ is def'ed with the Transcrypt kwargs mechanism\n };\n\n Array.prototype.__add__ = function (aList) {\n return list (this.concat (aList));\n };\n\n Array.prototype.__mul__ = function (scalar) {\n var result = this;\n for (var i = 1; i < scalar; i++) {\n result = result.concat (this);\n }\n return result;\n };\n\n Array.prototype.__rmul__ = Array.prototype.__mul__;\n\n // Tuple extensions to Array\n\n function tuple (iterable) {\n var instance = iterable ? [] .slice.apply (iterable) : [];\n instance.__class__ = tuple; // Not all arrays are tuples\n return instance;\n }\n __all__.tuple = tuple;\n tuple.__name__ = 'tuple';\n\n // Set extensions to Array\n // N.B. Since sets are unordered, set operations will occasionally alter the 'this' array by sorting it\n\n function set (iterable) {\n var instance = [];\n if (iterable) {\n for (var index = 0; index < iterable.length; index++) {\n instance.add (iterable [index]);\n }\n\n\n }\n instance.__class__ = set; // Not all arrays are sets\n return instance;\n }\n __all__.set = set;\n set.__name__ = 'set';\n\n Array.prototype.__bindexOf__ = function (element) { // Used to turn O (n^2) into O (n log n)\n // Since sorting is lex, compare has to be lex. This also allows for mixed lists\n\n element += '';\n\n var mindex = 0;\n var maxdex = this.length - 1;\n\n while (mindex <= maxdex) {\n var index = (mindex + maxdex) / 2 | 0;\n var middle = this [index] + '';\n\n if (middle < element) {\n mindex = index + 1;\n }\n else if (middle > element) {\n maxdex = index - 1;\n }\n else {\n return index;\n }\n }\n\n return -1;\n };\n\n Array.prototype.add = function (element) {\n if (this.indexOf (element) == -1) { // Avoid duplicates in set\n this.push (element);\n }\n };\n\n Array.prototype.discard = function (element) {\n var index = this.indexOf (element);\n if (index != -1) {\n this.splice (index, 1);\n }\n };\n\n Array.prototype.isdisjoint = function (other) {\n this.sort ();\n for (var i = 0; i < other.length; i++) {\n if (this.__bindexOf__ (other [i]) != -1) {\n return false;\n }\n }\n return true;\n };\n\n Array.prototype.issuperset = function (other) {\n this.sort ();\n for (var i = 0; i < other.length; i++) {\n if (this.__bindexOf__ (other [i]) == -1) {\n return false;\n }\n }\n return true;\n };\n\n Array.prototype.issubset = function (other) {\n return set (other.slice ()) .issuperset (this); // Sort copy of 'other', not 'other' itself, since it may be an ordered sequence\n };\n\n Array.prototype.union = function (other) {\n var result = set (this.slice () .sort ());\n for (var i = 0; i < other.length; i++) {\n if (result.__bindexOf__ (other [i]) == -1) {\n result.push (other [i]);\n }\n }\n return result;\n };\n\n Array.prototype.intersection = function (other) {\n this.sort ();\n var result = set ();\n for (var i = 0; i < other.length; i++) {\n if (this.__bindexOf__ (other [i]) != -1) {\n result.push (other [i]);\n }\n }\n return result;\n };\n\n Array.prototype.difference = function (other) {\n var sother = set (other.slice () .sort ());\n var result = set ();\n for (var i = 0; i < this.length; i++) {\n if (sother.__bindexOf__ (this [i]) == -1) {\n result.push (this [i]);\n }\n }\n return result;\n };\n\n Array.prototype.symmetric_difference = function (other) {\n return this.union (other) .difference (this.intersection (other));\n };\n\n Array.prototype.py_update = function () { // O (n)\n var updated = [] .concat.apply (this.slice (), arguments) .sort ();\n this.clear ();\n for (var i = 0; i < updated.length; i++) {\n if (updated [i] != updated [i - 1]) {\n this.push (updated [i]);\n }\n }\n };\n\n Array.prototype.__eq__ = function (other) { // Also used for list\n if (this.length != other.length) {\n return false;\n }\n if (this.__class__ == set) {\n this.sort ();\n other.sort ();\n }\n for (var i = 0; i < this.length; i++) {\n if (this [i] != other [i]) {\n return false;\n }\n }\n return true;\n };\n\n Array.prototype.__ne__ = function (other) { // Also used for list\n return !this.__eq__ (other);\n };\n\n Array.prototype.__le__ = function (other) {\n return this.issubset (other);\n };\n\n Array.prototype.__ge__ = function (other) {\n return this.issuperset (other);\n };\n\n Array.prototype.__lt__ = function (other) {\n return this.issubset (other) && !this.issuperset (other);\n };\n\n Array.prototype.__gt__ = function (other) {\n return this.issuperset (other) && !this.issubset (other);\n };\n\n // String extensions\n\n function str (stringable) {\n try {\n return stringable.__str__ ();\n }\n catch (exception) {\n try {\n return repr (stringable);\n }\n catch (exception) {\n return String (stringable); // No new, so no permanent String object but a primitive in a temporary 'just in time' wrapper\n }\n }\n };\n __all__.str = str;\n\n String.prototype.__class__ = str; // All strings are str\n str.__name__ = 'str';\n\n String.prototype.__iter__ = function () {new __PyIterator__ (this);};\n\n String.prototype.__repr__ = function () {\n return (this.indexOf ('\\'') == -1 ? '\\'' + this + '\\'' : '\"' + this + '\"') .py_replace ('\\t', '\\\\t') .py_replace ('\\n', '\\\\n');\n };\n\n String.prototype.__str__ = function () {\n return this;\n };\n\n String.prototype.capitalize = function () {\n return this.charAt (0).toUpperCase () + this.slice (1);\n };\n\n String.prototype.endswith = function (suffix) {\n return suffix == '' || this.slice (-suffix.length) == suffix;\n };\n\n String.prototype.find = function (sub, start) {\n return this.indexOf (sub, start);\n };\n\n String.prototype.__getslice__ = function (start, stop, step) {\n if (start < 0) {\n start = this.length + start;\n }\n\n if (stop == null) {\n stop = this.length;\n }\n else if (stop < 0) {\n stop = this.length + stop;\n }\n\n var result = '';\n if (step == 1) {\n result = this.substring (start, stop);\n }\n else {\n for (var index = start; index < stop; index += step) {\n result = result.concat (this.charAt(index));\n }\n }\n return result;\n }\n\n // Since it's worthwhile for the 'format' function to be able to deal with *args, it is defined as a property\n // __get__ will produce a bound function if there's something before the dot\n // Since a call using *args is compiled to e.g. <object>.<function>.apply (null, args), the function has to be bound already\n // Otherwise it will never be, because of the null argument\n // Using 'this' rather than 'null' contradicts the requirement to be able to pass bound functions around\n // The object 'before the dot' won't be available at call time in that case, unless implicitly via the function bound to it\n // While for Python methods this mechanism is generated by the compiler, for JavaScript methods it has to be provided manually\n // Call memoizing is unattractive here, since every string would then have to hold a reference to a bound format method\n __setProperty__ (String.prototype, 'format', {\n get: function () {return __get__ (this, function (self) {\n var args = tuple ([] .slice.apply (arguments).slice (1));\n var autoIndex = 0;\n return self.replace (/\\{(\\w*)\\}/g, function (match, key) {\n if (key == '') {\n key = autoIndex++;\n }\n if (key == +key) { // So key is numerical\n return args [key] == undefined ? match : str (args [key]);\n }\n else { // Key is a string\n for (var index = 0; index < args.length; index++) {\n // Find first 'dict' that has that key and the right field\n if (typeof args [index] == 'object' && args [index][key] != undefined) {\n return str (args [index][key]); // Return that field field\n }\n }\n return match;\n }\n });\n });},\n enumerable: true\n });\n\n String.prototype.isalnum = function () {\n return /^[0-9a-zA-Z]{1,}$/.test(this)\n }\n\n String.prototype.isalpha = function () {\n return /^[a-zA-Z]{1,}$/.test(this)\n }\n\n String.prototype.isdecimal = function () {\n return /^[0-9]{1,}$/.test(this)\n }\n\n String.prototype.isdigit = function () {\n return this.isdecimal()\n }\n\n String.prototype.islower = function () {\n return /^[a-z]{1,}$/.test(this)\n }\n\n String.prototype.isupper = function () {\n return /^[A-Z]{1,}$/.test(this)\n }\n\n String.prototype.isspace = function () {\n return /^[\\s]{1,}$/.test(this)\n }\n\n String.prototype.isnumeric = function () {\n return !isNaN (parseFloat (this)) && isFinite (this);\n };\n\n String.prototype.join = function (strings) {\n strings = Array.from (strings); // Much faster than iterating through strings char by char\n return strings.join (this);\n };\n\n String.prototype.lower = function () {\n return this.toLowerCase ();\n };\n\n String.prototype.py_replace = function (old, aNew, maxreplace) {\n return this.split (old, maxreplace) .join (aNew);\n };\n\n String.prototype.lstrip = function () {\n return this.replace (/^\\s*/g, '');\n };\n\n String.prototype.rfind = function (sub, start) {\n return this.lastIndexOf (sub, start);\n };\n\n String.prototype.rsplit = function (sep, maxsplit) { // Combination of general whitespace sep and positive maxsplit neither supported nor checked, expensive and rare\n if (sep == undefined || sep == null) {\n sep = /\\s+/;\n var stripped = this.strip ();\n }\n else {\n var stripped = this;\n }\n\n if (maxsplit == undefined || maxsplit == -1) {\n return stripped.split (sep);\n }\n else {\n var result = stripped.split (sep);\n if (maxsplit < result.length) {\n var maxrsplit = result.length - maxsplit;\n return [result.slice (0, maxrsplit) .join (sep)] .concat (result.slice (maxrsplit));\n }\n else {\n return result;\n }\n }\n };\n\n String.prototype.rstrip = function () {\n return this.replace (/\\s*$/g, '');\n };\n\n String.prototype.py_split = function (sep, maxsplit) { // Combination of general whitespace sep and positive maxsplit neither supported nor checked, expensive and rare\n if (sep == undefined || sep == null) {\n sep = /\\s+/;\n var stripped = this.strip ();\n }\n else {\n var stripped = this;\n }\n\n if (maxsplit == undefined || maxsplit == -1) {\n return stripped.split (sep);\n }\n else {\n var result = stripped.split (sep);\n if (maxsplit < result.length) {\n return result.slice (0, maxsplit).concat ([result.slice (maxsplit).join (sep)]);\n }\n else {\n return result;\n }\n }\n };\n\n String.prototype.startswith = function (prefix) {\n return this.indexOf (prefix) == 0;\n };\n\n String.prototype.strip = function () {\n return this.trim ();\n };\n\n String.prototype.upper = function () {\n return this.toUpperCase ();\n };\n\n String.prototype.__mul__ = function (scalar) {\n var result = this;\n for (var i = 1; i < scalar; i++) {\n result = result + this;\n }\n return result;\n };\n\n String.prototype.__rmul__ = String.prototype.__mul__;\n\n // Dict extensions to object\n\n function __keys__ () {\n var keys = [];\n for (var attrib in this) {\n if (!__specialattrib__ (attrib)) {\n keys.push (attrib);\n }\n }\n return keys;\n }\n\n function __items__ () {\n var items = [];\n for (var attrib in this) {\n if (!__specialattrib__ (attrib)) {\n items.push ([attrib, this [attrib]]);\n }\n }\n return items;\n }\n\n function __del__ (key) {\n delete this [key];\n }\n\n function __clear__ () {\n for (var attrib in this) {\n delete this [attrib];\n }\n }\n\n function __getdefault__ (aKey, aDefault) { // Each Python object already has a function called __get__, so we call this one __getdefault__\n var result = this [aKey];\n return result == undefined ? (aDefault == undefined ? null : aDefault) : result;\n }\n\n function __setdefault__ (aKey, aDefault) {\n var result = this [aKey];\n if (result != undefined) {\n return result;\n }\n var val = aDefault == undefined ? null : aDefault;\n this [aKey] = val;\n return val;\n }\n\n function __pop__ (aKey, aDefault) {\n var result = this [aKey];\n if (result != undefined) {\n delete this [aKey];\n return result;\n } else {\n // Identify check because user could pass None\n if ( aDefault === undefined ) {\n throw KeyError (aKey, new Error());\n }\n }\n return aDefault;\n }\n \n function __popitem__ () {\n var aKey = Object.keys (this) [0];\n if (aKey == null) {\n throw KeyError (aKey, new Error ());\n }\n var result = tuple ([aKey, this [aKey]]);\n delete this [aKey];\n return result;\n }\n \n function __update__ (aDict) {\n for (var aKey in aDict) {\n this [aKey] = aDict [aKey];\n }\n }\n \n function __values__ () {\n var values = [];\n for (var attrib in this) {\n if (!__specialattrib__ (attrib)) {\n values.push (this [attrib]);\n }\n }\n return values;\n\n }\n \n function __dgetitem__ (aKey) {\n return this [aKey];\n }\n \n function __dsetitem__ (aKey, aValue) {\n this [aKey] = aValue;\n }\n\n function dict (objectOrPairs) {\n var instance = {};\n if (!objectOrPairs || objectOrPairs instanceof Array) { // It's undefined or an array of pairs\n if (objectOrPairs) {\n for (var index = 0; index < objectOrPairs.length; index++) {\n var pair = objectOrPairs [index];\n if ( !(pair instanceof Array) || pair.length != 2) {\n throw ValueError(\n \"dict update sequence element #\" + index +\n \" has length \" + pair.length +\n \"; 2 is required\", new Error());\n }\n var key = pair [0];\n var val = pair [1];\n if (!(objectOrPairs instanceof Array) && objectOrPairs instanceof Object) {\n // User can potentially pass in an object\n // that has a hierarchy of objects. This\n // checks to make sure that these objects\n // get converted to dict objects instead of\n // leaving them as js objects.\n \n if (!isinstance (objectOrPairs, dict)) {\n val = dict (val);\n }\n }\n instance [key] = val;\n }\n }\n }\n else {\n if (isinstance (objectOrPairs, dict)) {\n // Passed object is a dict already so we need to be a little careful\n // N.B. - this is a shallow copy per python std - so\n // it is assumed that children have already become\n // python objects at some point.\n \n var aKeys = objectOrPairs.py_keys ();\n for (var index = 0; index < aKeys.length; index++ ) {\n var key = aKeys [index];\n instance [key] = objectOrPairs [key];\n }\n } else if (objectOrPairs instanceof Object) {\n // Passed object is a JavaScript object but not yet a dict, don't copy it\n instance = objectOrPairs;\n } else {\n // We have already covered Array so this indicates\n // that the passed object is not a js object - i.e.\n // it is an int or a string, which is invalid.\n \n throw ValueError (\"Invalid type of object for dict creation\", new Error ());\n }\n }\n\n // Trancrypt interprets e.g. {aKey: 'aValue'} as a Python dict literal rather than a JavaScript object literal\n // So dict literals rather than bare Object literals will be passed to JavaScript libraries\n // Some JavaScript libraries call all enumerable callable properties of an object that's passed to them\n // So the properties of a dict should be non-enumerable\n __setProperty__ (instance, '__class__', {value: dict, enumerable: false, writable: true});\n __setProperty__ (instance, 'py_keys', {value: __keys__, enumerable: false});\n __setProperty__ (instance, '__iter__', {value: function () {new __PyIterator__ (this.py_keys ());}, enumerable: false});\n __setProperty__ (instance, Symbol.iterator, {value: function () {new __JsIterator__ (this.py_keys ());}, enumerable: false});\n __setProperty__ (instance, 'py_items', {value: __items__, enumerable: false});\n __setProperty__ (instance, 'py_del', {value: __del__, enumerable: false});\n __setProperty__ (instance, 'py_clear', {value: __clear__, enumerable: false});\n __setProperty__ (instance, 'py_get', {value: __getdefault__, enumerable: false});\n __setProperty__ (instance, 'py_setdefault', {value: __setdefault__, enumerable: false});\n __setProperty__ (instance, 'py_pop', {value: __pop__, enumerable: false});\n __setProperty__ (instance, 'py_popitem', {value: __popitem__, enumerable: false});\n __setProperty__ (instance, 'py_update', {value: __update__, enumerable: false});\n __setProperty__ (instance, 'py_values', {value: __values__, enumerable: false});\n __setProperty__ (instance, '__getitem__', {value: __dgetitem__, enumerable: false}); // Needed since compound keys necessarily\n __setProperty__ (instance, '__setitem__', {value: __dsetitem__, enumerable: false}); // trigger overloading to deal with slices\n return instance;\n }\n\n __all__.dict = dict;\n dict.__name__ = 'dict';\n \n // Docstring setter\n\n function __setdoc__ (docString) {\n this.__doc__ = docString;\n return this;\n }\n\n // Python classes, methods and functions are all translated to JavaScript functions\n __setProperty__ (Function.prototype, '__setdoc__', {value: __setdoc__, enumerable: false});\n\n // General operator overloading, only the ones that make most sense in matrix and complex operations\n\n var __neg__ = function (a) {\n if (typeof a == 'object' && '__neg__' in a) {\n return a.__neg__ ();\n }\n else {\n return -a;\n }\n };\n __all__.__neg__ = __neg__;\n\n var __matmul__ = function (a, b) {\n return a.__matmul__ (b);\n };\n __all__.__matmul__ = __matmul__;\n\n var __pow__ = function (a, b) {\n if (typeof a == 'object' && '__pow__' in a) {\n return a.__pow__ (b);\n }\n else if (typeof b == 'object' && '__rpow__' in b) {\n return b.__rpow__ (a);\n }\n else {\n return Math.pow (a, b);\n }\n };\n __all__.pow = __pow__;\n\n var __jsmod__ = function (a, b) {\n if (typeof a == 'object' && '__mod__' in a) {\n return a.__mod__ (b);\n }\n else if (typeof b == 'object' && '__rpow__' in b) {\n return b.__rmod__ (a);\n }\n else {\n return a % b;\n }\n };\n __all__.__jsmod__ = __jsmod__;\n \n var __mod__ = function (a, b) {\n if (typeof a == 'object' && '__mod__' in a) {\n return a.__mod__ (b);\n }\n else if (typeof b == 'object' && '__rpow__' in b) {\n return b.__rmod__ (a);\n }\n else {\n return ((a % b) + b) % b;\n }\n };\n __all__.mod = __mod__;\n\n // Overloaded binary arithmetic\n \n var __mul__ = function (a, b) {\n if (typeof a == 'object' && '__mul__' in a) {\n return a.__mul__ (b);\n }\n else if (typeof b == 'object' && '__rmul__' in b) {\n return b.__rmul__ (a);\n }\n else if (typeof a == 'string') {\n return a.__mul__ (b);\n }\n else if (typeof b == 'string') {\n return b.__rmul__ (a);\n }\n else {\n return a * b;\n }\n };\n __all__.__mul__ = __mul__;\n\n var __truediv__ = function (a, b) {\n if (typeof a == 'object' && '__truediv__' in a) {\n return a.__truediv__ (b);\n }\n else if (typeof b == 'object' && '__rtruediv__' in b) {\n return b.__rtruediv__ (a);\n }\n else if (typeof a == 'object' && '__div__' in a) {\n return a.__div__ (b);\n }\n else if (typeof b == 'object' && '__rdiv__' in b) {\n return b.__rdiv__ (a);\n }\n else {\n return a / b;\n }\n };\n __all__.__truediv__ = __truediv__;\n\n var __floordiv__ = function (a, b) {\n if (typeof a == 'object' && '__floordiv__' in a) {\n return a.__floordiv__ (b);\n }\n else if (typeof b == 'object' && '__rfloordiv__' in b) {\n return b.__rfloordiv__ (a);\n }\n else if (typeof a == 'object' && '__div__' in a) {\n return a.__div__ (b);\n }\n else if (typeof b == 'object' && '__rdiv__' in b) {\n return b.__rdiv__ (a);\n }\n else {\n return Math.floor (a / b);\n }\n };\n __all__.__floordiv__ = __floordiv__;\n\n var __add__ = function (a, b) {\n if (typeof a == 'object' && '__add__' in a) {\n return a.__add__ (b);\n }\n else if (typeof b == 'object' && '__radd__' in b) {\n return b.__radd__ (a);\n }\n else {\n return a + b;\n }\n };\n __all__.__add__ = __add__;\n\n var __sub__ = function (a, b) {\n if (typeof a == 'object' && '__sub__' in a) {\n return a.__sub__ (b);\n }\n else if (typeof b == 'object' && '__rsub__' in b) {\n return b.__rsub__ (a);\n }\n else {\n return a - b;\n }\n };\n __all__.__sub__ = __sub__;\n\n // Overloaded binary bitwise\n \n var __lshift__ = function (a, b) {\n if (typeof a == 'object' && '__lshift__' in a) {\n return a.__lshift__ (b);\n }\n else if (typeof b == 'object' && '__rlshift__' in b) {\n return b.__rlshift__ (a);\n }\n else {\n return a << b;\n }\n };\n __all__.__lshift__ = __lshift__;\n\n var __rshift__ = function (a, b) {\n if (typeof a == 'object' && '__rshift__' in a) {\n return a.__rshift__ (b);\n }\n else if (typeof b == 'object' && '__rrshift__' in b) {\n return b.__rrshift__ (a);\n }\n else {\n return a >> b;\n }\n };\n __all__.__rshift__ = __rshift__;\n\n var __or__ = function (a, b) {\n if (typeof a == 'object' && '__or__' in a) {\n return a.__or__ (b);\n }\n else if (typeof b == 'object' && '__ror__' in b) {\n return b.__ror__ (a);\n }\n else {\n return a | b;\n }\n };\n __all__.__or__ = __or__;\n\n var __xor__ = function (a, b) {\n if (typeof a == 'object' && '__xor__' in a) {\n return a.__xor__ (b);\n }\n else if (typeof b == 'object' && '__rxor__' in b) {\n return b.__rxor__ (a);\n }\n else {\n return a ^ b;\n }\n };\n __all__.__xor__ = __xor__;\n\n var __and__ = function (a, b) {\n if (typeof a == 'object' && '__and__' in a) {\n return a.__and__ (b);\n }\n else if (typeof b == 'object' && '__rand__' in b) {\n return b.__rand__ (a);\n }\n else {\n return a & b;\n }\n };\n __all__.__and__ = __and__;\n\n // Overloaded binary compare\n \n var __eq__ = function (a, b) {\n if (typeof a == 'object' && '__eq__' in a) {\n return a.__eq__ (b);\n }\n else {\n return a == b;\n }\n };\n __all__.__eq__ = __eq__;\n\n var __ne__ = function (a, b) {\n if (typeof a == 'object' && '__ne__' in a) {\n return a.__ne__ (b);\n }\n else {\n return a != b\n }\n };\n __all__.__ne__ = __ne__;\n\n var __lt__ = function (a, b) {\n if (typeof a == 'object' && '__lt__' in a) {\n return a.__lt__ (b);\n }\n else {\n return a < b;\n }\n };\n __all__.__lt__ = __lt__;\n\n var __le__ = function (a, b) {\n if (typeof a == 'object' && '__le__' in a) {\n return a.__le__ (b);\n }\n else {\n return a <= b;\n }\n };\n __all__.__le__ = __le__;\n\n var __gt__ = function (a, b) {\n if (typeof a == 'object' && '__gt__' in a) {\n return a.__gt__ (b);\n }\n else {\n return a > b;\n }\n };\n __all__.__gt__ = __gt__;\n\n var __ge__ = function (a, b) {\n if (typeof a == 'object' && '__ge__' in a) {\n return a.__ge__ (b);\n }\n else {\n return a >= b;\n }\n };\n __all__.__ge__ = __ge__;\n \n // Overloaded augmented general\n \n var __imatmul__ = function (a, b) {\n if ('__imatmul__' in a) {\n return a.__imatmul__ (b);\n }\n else {\n return a.__matmul__ (b);\n }\n };\n __all__.__imatmul__ = __imatmul__;\n\n var __ipow__ = function (a, b) {\n if (typeof a == 'object' && '__pow__' in a) {\n return a.__ipow__ (b);\n }\n else if (typeof a == 'object' && '__ipow__' in a) {\n return a.__pow__ (b);\n }\n else if (typeof b == 'object' && '__rpow__' in b) {\n return b.__rpow__ (a);\n }\n else {\n return Math.pow (a, b);\n }\n };\n __all__.ipow = __ipow__;\n\n var __ijsmod__ = function (a, b) {\n if (typeof a == 'object' && '__imod__' in a) {\n return a.__ismod__ (b);\n }\n else if (typeof a == 'object' && '__mod__' in a) {\n return a.__mod__ (b);\n }\n else if (typeof b == 'object' && '__rpow__' in b) {\n return b.__rmod__ (a);\n }\n else {\n return a % b;\n }\n };\n __all__.ijsmod__ = __ijsmod__;\n \n var __imod__ = function (a, b) {\n if (typeof a == 'object' && '__imod__' in a) {\n return a.__imod__ (b);\n }\n else if (typeof a == 'object' && '__mod__' in a) {\n return a.__mod__ (b);\n }\n else if (typeof b == 'object' && '__rpow__' in b) {\n return b.__rmod__ (a);\n }\n else {\n return ((a % b) + b) % b;\n }\n };\n __all__.imod = __imod__;\n \n // Overloaded augmented arithmetic\n \n var __imul__ = function (a, b) {\n if (typeof a == 'object' && '__imul__' in a) {\n return a.__imul__ (b);\n }\n else if (typeof a == 'object' && '__mul__' in a) {\n return a = a.__mul__ (b);\n }\n else if (typeof b == 'object' && '__rmul__' in b) {\n return a = b.__rmul__ (a);\n }\n else if (typeof a == 'string') {\n return a = a.__mul__ (b);\n }\n else if (typeof b == 'string') {\n return a = b.__rmul__ (a);\n }\n else {\n return a *= b;\n }\n };\n __all__.__imul__ = __imul__;\n\n var __idiv__ = function (a, b) {\n if (typeof a == 'object' && '__idiv__' in a) {\n return a.__idiv__ (b);\n }\n else if (typeof a == 'object' && '__div__' in a) {\n return a = a.__div__ (b);\n }\n else if (typeof b == 'object' && '__rdiv__' in b) {\n return a = b.__rdiv__ (a);\n }\n else {\n return a /= b;\n }\n };\n __all__.__idiv__ = __idiv__;\n\n var __iadd__ = function (a, b) {\n if (typeof a == 'object' && '__iadd__' in a) {\n return a.__iadd__ (b);\n }\n else if (typeof a == 'object' && '__add__' in a) {\n return a = a.__add__ (b);\n }\n else if (typeof b == 'object' && '__radd__' in b) {\n return a = b.__radd__ (a);\n }\n else {\n return a += b;\n }\n };\n __all__.__iadd__ = __iadd__;\n\n var __isub__ = function (a, b) {\n if (typeof a == 'object' && '__isub__' in a) {\n return a.__isub__ (b);\n }\n else if (typeof a == 'object' && '__sub__' in a) {\n return a = a.__sub__ (b);\n }\n else if (typeof b == 'object' && '__rsub__' in b) {\n return a = b.__rsub__ (a);\n }\n else {\n return a -= b;\n }\n };\n __all__.__isub__ = __isub__;\n\n // Overloaded augmented bitwise\n \n var __ilshift__ = function (a, b) {\n if (typeof a == 'object' && '__ilshift__' in a) {\n return a.__ilshift__ (b);\n }\n else if (typeof a == 'object' && '__lshift__' in a) {\n return a = a.__lshift__ (b);\n }\n else if (typeof b == 'object' && '__rlshift__' in b) {\n return a = b.__rlshift__ (a);\n }\n else {\n return a <<= b;\n }\n };\n __all__.__ilshift__ = __ilshift__;\n\n var __irshift__ = function (a, b) {\n if (typeof a == 'object' && '__irshift__' in a) {\n return a.__irshift__ (b);\n }\n else if (typeof a == 'object' && '__rshift__' in a) {\n return a = a.__rshift__ (b);\n }\n else if (typeof b == 'object' && '__rrshift__' in b) {\n return a = b.__rrshift__ (a);\n }\n else {\n return a >>= b;\n }\n };\n __all__.__irshift__ = __irshift__;\n\n var __ior__ = function (a, b) {\n if (typeof a == 'object' && '__ior__' in a) {\n return a.__ior__ (b);\n }\n else if (typeof a == 'object' && '__or__' in a) {\n return a = a.__or__ (b);\n }\n else if (typeof b == 'object' && '__ror__' in b) {\n return a = b.__ror__ (a);\n }\n else {\n return a |= b;\n }\n };\n __all__.__ior__ = __ior__;\n\n var __ixor__ = function (a, b) {\n if (typeof a == 'object' && '__ixor__' in a) {\n return a.__ixor__ (b);\n }\n else if (typeof a == 'object' && '__xor__' in a) {\n return a = a.__xor__ (b);\n }\n else if (typeof b == 'object' && '__rxor__' in b) {\n return a = b.__rxor__ (a);\n }\n else {\n return a ^= b;\n }\n };\n __all__.__ixor__ = __ixor__;\n\n var __iand__ = function (a, b) {\n if (typeof a == 'object' && '__iand__' in a) {\n return a.__iand__ (b);\n }\n else if (typeof a == 'object' && '__and__' in a) {\n return a = a.__and__ (b);\n }\n else if (typeof b == 'object' && '__rand__' in b) {\n return a = b.__rand__ (a);\n }\n else {\n return a &= b;\n }\n };\n __all__.__iand__ = __iand__;\n \n // Indices and slices\n\n var __getitem__ = function (container, key) { // Slice c.q. index, direct generated call to runtime switch\n if (typeof container == 'object' && '__getitem__' in container) {\n return container.__getitem__ (key); // Overloaded on container\n }\n else {\n return container [key]; // Container must support bare JavaScript brackets\n }\n };\n __all__.__getitem__ = __getitem__;\n\n var __setitem__ = function (container, key, value) { // Slice c.q. index, direct generated call to runtime switch\n if (typeof container == 'object' && '__setitem__' in container) {\n container.__setitem__ (key, value); // Overloaded on container\n }\n else {\n container [key] = value; // Container must support bare JavaScript brackets\n }\n };\n __all__.__setitem__ = __setitem__;\n\n var __getslice__ = function (container, lower, upper, step) { // Slice only, no index, direct generated call to runtime switch\n if (typeof container == 'object' && '__getitem__' in container) {\n return container.__getitem__ ([lower, upper, step]); // Container supports overloaded slicing c.q. indexing\n }\n else {\n return container.__getslice__ (lower, upper, step); // Container only supports slicing injected natively in prototype\n }\n };\n __all__.__getslice__ = __getslice__;\n\n var __setslice__ = function (container, lower, upper, step, value) { // Slice, no index, direct generated call to runtime switch\n if (typeof container == 'object' && '__setitem__' in container) {\n container.__setitem__ ([lower, upper, step], value); // Container supports overloaded slicing c.q. indexing\n }\n else {\n container.__setslice__ (lower, upper, step, value); // Container only supports slicing injected natively in prototype\n }\n };\n __all__.__setslice__ = __setslice__;\n\t__nest__ (\n\t\t__all__,\n\t\t'ferret.pnw.constants', {\n\t\t\t__all__: {\n\t\t\t\t__inited__: false,\n\t\t\t\t__init__: function (__all__) {\n\t\t\t\t\tvar AlliancePosition = __class__ ('AlliancePosition', [object], {\n\t\t\t\t\t\tNONE: 0,\n\t\t\t\t\t\tAPPLICANT: 1,\n\t\t\t\t\t\tMEMBER: 2,\n\t\t\t\t\t\tOFFICER: 3,\n\t\t\t\t\t\tHEIR: 4,\n\t\t\t\t\t\tLEADER: 5\n\t\t\t\t\t});\n\t\t\t\t\tvar Color = __class__ ('Color', [object], {\n\t\t\t\t\t\tAQUA: 0,\n\t\t\t\t\t\tBEIGE: 1,\n\t\t\t\t\t\tBLACK: 2,\n\t\t\t\t\t\tBLUE: 3,\n\t\t\t\t\t\tBROWN: 4,\n\t\t\t\t\t\tGRAY: 5,\n\t\t\t\t\t\tGREEN: 6,\n\t\t\t\t\t\tLIME: 7,\n\t\t\t\t\t\tMAROON: 8,\n\t\t\t\t\t\tOLIVE: 9,\n\t\t\t\t\t\tORANGE: 10,\n\t\t\t\t\t\tPINK: 11,\n\t\t\t\t\t\tPURPLE: 12,\n\t\t\t\t\t\tRED: 13,\n\t\t\t\t\t\tWHITE: 14,\n\t\t\t\t\t\tYELLOW: 15\n\t\t\t\t\t});\n\t\t\t\t\tvar Continent = __class__ ('Continent', [object], {\n\t\t\t\t\t\tNORTH_AMERICA: 0,\n\t\t\t\t\t\tSOUTH_AMERICA: 1,\n\t\t\t\t\t\tEUROPE: 2,\n\t\t\t\t\t\tAFRICA: 3,\n\t\t\t\t\t\tASIA: 4,\n\t\t\t\t\t\tAUSTRALIA: 5\n\t\t\t\t\t});\n\t\t\t\t\tvar DomesticPolicy = __class__ ('DomesticPolicy', [object], {\n\t\t\t\t\t\tMANIFEST_DESTINY: 0,\n\t\t\t\t\t\tOPEN_MARKETS: 1,\n\t\t\t\t\t\tTECHNOLOGICAL_ADVANCEMENT: 2,\n\t\t\t\t\t\tIMPERIALISM: 3,\n\t\t\t\t\t\tURBANIZATION: 4\n\t\t\t\t\t});\n\t\t\t\t\tvar EconomicPolicy = __class__ ('EconomicPolicy', [object], {\n\t\t\t\t\t\tEXTREMELY_LEFT_WING: 0,\n\t\t\t\t\t\tFAR_LEFT_WING: 1,\n\t\t\t\t\t\tLEFT_WING: 2,\n\t\t\t\t\t\tMODERATE: 3,\n\t\t\t\t\t\tRIGHT_WING: 4,\n\t\t\t\t\t\tFAR_RIGHT_WING: 5,\n\t\t\t\t\t\tEXTREMELY_RIGHT_WING: 6\n\t\t\t\t\t});\n\t\t\t\t\tvar Improvement = __class__ ('Improvement', [object], {\n\t\t\t\t\t\tCOAL_POWER: 0,\n\t\t\t\t\t\tOIL_POWER: 1,\n\t\t\t\t\t\tNUCLEAR_POWER: 2,\n\t\t\t\t\t\tWIND_POWER: 3,\n\t\t\t\t\t\tCOAL_MINE: 4,\n\t\t\t\t\t\tOIL_WELL: 5,\n\t\t\t\t\t\tIRON_MINE: 6,\n\t\t\t\t\t\tBAUXITE_MINE: 7,\n\t\t\t\t\t\tLEAD_MINE: 8,\n\t\t\t\t\t\tURANIUM_MINE: 9,\n\t\t\t\t\t\tFARM: 10,\n\t\t\t\t\t\tGASOLINE_REFINERY: 11,\n\t\t\t\t\t\tSTEEL_MILL: 12,\n\t\t\t\t\t\tALUMINUM_REFINERY: 13,\n\t\t\t\t\t\tMUNITIONS_FACTORY: 14,\n\t\t\t\t\t\tPOLICE_STATION: 15,\n\t\t\t\t\t\tHOSPITAL: 16,\n\t\t\t\t\t\tRECYCLING_CENTER: 17,\n\t\t\t\t\t\tSUBWAY: 18,\n\t\t\t\t\t\tSUPERMARKET: 19,\n\t\t\t\t\t\tBANK: 20,\n\t\t\t\t\t\tMALL: 21,\n\t\t\t\t\t\tSTADIUM: 22,\n\t\t\t\t\t\tBARRACKS: 23,\n\t\t\t\t\t\tFACTORY: 24,\n\t\t\t\t\t\tHANGAR: 25,\n\t\t\t\t\t\tDRYDOCK: 26\n\t\t\t\t\t});\n\t\t\t\t\tvar ImprovementStats = __class__ ('ImprovementStats', [object], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, py_name, purchase, upkeep, production, usage, pollution, commerce, capacity, _max, power) {\n\t\t\t\t\t\t\tif (typeof upkeep == 'undefined' || (upkeep != null && upkeep .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar upkeep = 0.0;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (typeof production == 'undefined' || (production != null && production .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar production = null;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (typeof usage == 'undefined' || (usage != null && usage .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar usage = null;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (typeof pollution == 'undefined' || (pollution != null && pollution .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar pollution = 0;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (typeof commerce == 'undefined' || (commerce != null && commerce .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar commerce = 0.0;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (typeof capacity == 'undefined' || (capacity != null && capacity .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar capacity = null;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (typeof _max == 'undefined' || (_max != null && _max .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar _max = null;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (typeof power == 'undefined' || (power != null && power .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar power = false;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'self': var self = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'py_name': var py_name = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'purchase': var purchase = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'upkeep': var upkeep = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'production': var production = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'usage': var usage = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'pollution': var pollution = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'commerce': var commerce = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'capacity': var capacity = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase '_max': var _max = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'power': var power = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tself.py_name = py_name;\n\t\t\t\t\t\t\tself.purchase = purchase;\n\t\t\t\t\t\t\tself.upkeep = upkeep;\n\t\t\t\t\t\t\tself.production = (production !== null ? production : dict ({}));\n\t\t\t\t\t\t\tself.usage = (usage !== null ? usage : dict ({}));\n\t\t\t\t\t\t\tself.pollution = pollution;\n\t\t\t\t\t\t\tself.commerce = commerce;\n\t\t\t\t\t\t\tself.capacity = (capacity !== null ? capacity : dict ({}));\n\t\t\t\t\t\t\tself.max = _max;\n\t\t\t\t\t\t\tself.power = power;\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar Military = __class__ ('Military', [object], {\n\t\t\t\t\t\tSOLDIERS: 1,\n\t\t\t\t\t\tTANKS: 2,\n\t\t\t\t\t\tAIRCRAFT: 3,\n\t\t\t\t\t\tSHIPS: 4,\n\t\t\t\t\t\tSPIES: 5,\n\t\t\t\t\t\tMISSILES: 6,\n\t\t\t\t\t\tNUKES: 7\n\t\t\t\t\t});\n\t\t\t\t\tvar MilitaryStats = __class__ ('MilitaryStats', [object], {\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, purchase, upkeep_peace, upkeep_war, battle) {\n\t\t\t\t\t\t\tif (typeof upkeep_war == 'undefined' || (upkeep_war != null && upkeep_war .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar upkeep_war = null;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (typeof battle == 'undefined' || (battle != null && battle .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\t\tvar battle = null;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'self': var self = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'purchase': var purchase = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'upkeep_peace': var upkeep_peace = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'upkeep_war': var upkeep_war = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t\tcase 'battle': var battle = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tself.purchase = purchase;\n\t\t\t\t\t\t\tself.upkeep_peace = upkeep_peace;\n\t\t\t\t\t\t\tself.upkeep_war = (upkeep_war !== null ? upkeep_war : upkeep_peace);\n\t\t\t\t\t\t\tself.battle = battle;\n\t\t\t\t\t\t});}\n\t\t\t\t\t});\n\t\t\t\t\tvar Project = __class__ ('Project', [object], {\n\t\t\t\t\t\tIRON_WORKS: 0,\n\t\t\t\t\t\tBAUXITE_WORKS: 1,\n\t\t\t\t\t\tARMS_STOCK_PILE: 2,\n\t\t\t\t\t\tEMERGENCY_GAS_RESERVE: 3,\n\t\t\t\t\t\tMASS_IRRIGATION: 4,\n\t\t\t\t\t\tINTERNATIONAL_TRADE_CENTER: 5,\n\t\t\t\t\t\tMISSILE_LAUNCH_PAD: 6,\n\t\t\t\t\t\tNUCLEAR_RESEARCH_FACILITY: 7,\n\t\t\t\t\t\tIRON_DOME: 8,\n\t\t\t\t\t\tVITAL_DEFENSE_SYSTEM: 9,\n\t\t\t\t\t\tINTELLIGENCE_AGENCY: 10,\n\t\t\t\t\t\tURANIUM_ENRICHMENT_PROGRAM: 11,\n\t\t\t\t\t\tPROPAGANDA_BUREAU: 12,\n\t\t\t\t\t\tCENTER_CIVIL_ENGINEERING: 13\n\t\t\t\t\t});\n\t\t\t\t\tvar Resource = __class__ ('Resource', [object], {\n\t\t\t\t\t\tMONEY: 0,\n\t\t\t\t\t\tFOOD: 1,\n\t\t\t\t\t\tCOAL: 2,\n\t\t\t\t\t\tOIL: 3,\n\t\t\t\t\t\tURANIUM: 4,\n\t\t\t\t\t\tIRON: 5,\n\t\t\t\t\t\tBAUXITE: 6,\n\t\t\t\t\t\tLEAD: 7,\n\t\t\t\t\t\tGASOLINE: 8,\n\t\t\t\t\t\tSTEEL: 9,\n\t\t\t\t\t\tALUMINUM: 10,\n\t\t\t\t\t\tMUNITIONS: 11\n\t\t\t\t\t});\n\t\t\t\t\tvar Season = __class__ ('Season', [object], {\n\t\t\t\t\t\tSUMMER: 0,\n\t\t\t\t\t\tFALL: 1,\n\t\t\t\t\t\tWINTER: 2,\n\t\t\t\t\t\tSPRING: 4\n\t\t\t\t\t});\n\t\t\t\t\tvar SocialPolicy = __class__ ('SocialPolicy', [object], {\n\t\t\t\t\t\tANARCHIST: 0,\n\t\t\t\t\t\tLIBERTARIAN: 1,\n\t\t\t\t\t\tLIBERAL: 2,\n\t\t\t\t\t\tMODERATE: 3,\n\t\t\t\t\t\tCONSERVATIVE: 4,\n\t\t\t\t\t\tAUTHORITARIAN: 5,\n\t\t\t\t\t\tFASCIST: 6\n\t\t\t\t\t});\n\t\t\t\t\tvar WarPolicy = __class__ ('WarPolicy', [object], {\n\t\t\t\t\t\tATTRITION: 0,\n\t\t\t\t\t\tTURTLE: 1,\n\t\t\t\t\t\tBLITZKRIEG: 2,\n\t\t\t\t\t\tFORTRESS: 3,\n\t\t\t\t\t\tMONEYBAGS: 4,\n\t\t\t\t\t\tPIRATE: 5,\n\t\t\t\t\t\tTACTICIAN: 6,\n\t\t\t\t\t\tGUARDIAN: 7,\n\t\t\t\t\t\tCOVERT: 8,\n\t\t\t\t\t\tARCANE: 9\n\t\t\t\t\t});\n\t\t\t\t\tvar im = Improvement;\n\t\t\t\t\tvar mil = Military;\n\t\t\t\t\tvar pr = Project;\n\t\t\t\t\tvar res = Resource;\n\t\t\t\t\tvar CONTINENT_RESOURCES = dict ([[Continent.NORTH_AMERICA, tuple ([im.COAL_MINE, im.IRON_MINE, im.URANIUM_MINE])], [Continent.SOUTH_AMERICA, tuple ([im.OIL_POWER, im.BAUXITE_MINE, im.LEAD_MINE])], [Continent.EUROPE, tuple ([im.COAL_MINE, im.IRON_MINE, im.LEAD_MINE])], [Continent.AFRICA, tuple ([im.OIL_POWER, im.BAUXITE_MINE, im.URANIUM_MINE])], [Continent.ASIA, tuple ([im.OIL_POWER, im.IRON_MINE, im.URANIUM_MINE])], [Continent.AUSTRALIA, tuple ([im.COAL_MINE, im.BAUXITE_MINE, im.LEAD_MINE])]]);\n\t\t\t\t\tvar CONTINENTS = tuple ([Continent.NORTH_AMERICA, Continent.SOUTH_AMERICA, Continent.EUROPE, Continent.AFRICA, Continent.ASIA, Continent.AUSTRALIA]);\n\t\t\t\t\tvar ECONOMIC_POLICIES = tuple ([EconomicPolicy.EXTREMELY_LEFT_WING, EconomicPolicy.FAR_LEFT_WING, EconomicPolicy.LEFT_WING, EconomicPolicy.MODERATE, EconomicPolicy.RIGHT_WING, EconomicPolicy.FAR_RIGHT_WING, EconomicPolicy.EXTREMELY_RIGHT_WING]);\n\t\t\t\t\tvar MILITARY = dict ([[mil.SOLDIERS, MilitaryStats (__kwargtrans__ ({purchase: dict ([[res.MONEY, 2.0]]), upkeep_peace: dict ([[res.MONEY, 1.25], [res.FOOD, 1 / 750]]), upkeep_war: dict ([[res.MONEY, 1.88], [res.FOOD, 1 / 500]]), battle: dict ([[res.MUNITIONS, 1 / 5000]])}))], [mil.TANKS, MilitaryStats (__kwargtrans__ ({purchase: dict ([[res.MONEY, 60.0], [res.STEEL, 1.0]]), upkeep_peace: dict ([[res.MONEY, 50.0]]), upkeep_war: dict ([[res.MONEY, 70.0]]), battle: dict ([[res.MUNITIONS, 1 / 100], [res.GASOLINE, 1 / 100]])}))], [mil.AIRCRAFT, MilitaryStats (__kwargtrans__ ({purchase: dict ([[res.MONEY, 4000.0], [res.ALUMINUM, 3.0]]), upkeep_peace: dict ([[res.MONEY, 500.0]]), upkeep_war: dict ([[res.MONEY, 750.0]]), battle: dict ([[res.MUNITIONS, 1 / 4], [res.GASOLINE, 1 / 4]])}))], [mil.SHIPS, MilitaryStats (__kwargtrans__ ({purchase: dict ([[res.MONEY, 50000.0], [res.STEEL, 25.0]]), upkeep_peace: dict ([[res.MONEY, 3750.0]]), upkeep_war: dict ([[res.MONEY, 5625.0]]), battle: dict ([[res.MUNITIONS, 3], [res.GASOLINE, 2]])}))], [mil.SPIES, MilitaryStats (__kwargtrans__ ({purchase: dict ([[res.MONEY, 50000.0]]), upkeep_peace: dict ([[res.MONEY, 2400.0]])}))], [mil.MISSILES, MilitaryStats (__kwargtrans__ ({purchase: dict ([[res.MONEY, 150000.0], [res.ALUMINUM, 100.0], [res.MUNITIONS, 75.0], [res.GASOLINE, 75.0]]), upkeep_peace: dict ([[res.MONEY, 21000.0]]), upkeep_war: dict ([[res.MONEY, 31500.0]])}))], [mil.NUKES, MilitaryStats (__kwargtrans__ ({purchase: dict ([[res.MONEY, 1750000.0], [res.ALUMINUM, 750.0], [res.MUNITIONS, 500.0], [res.URANIUM, 250.0]]), upkeep_peace: dict ([[res.MONEY, 35000.0]]), upkeep_war: dict ([[res.MONEY, 52500.0]])}))]]);\n\t\t\t\t\tvar IMPROVEMENTS = dict ([[im.COAL_POWER, ImprovementStats (__kwargtrans__ ({py_name: 'Coal Power Plant', purchase: dict ([[res.MONEY, 5000.0]]), upkeep: 1200.0, pollution: 8, power: false}))], [im.OIL_POWER, ImprovementStats (__kwargtrans__ ({py_name: 'Oil Power Plant', purchase: dict ([[res.MONEY, 5000.0]]), upkeep: 1800.0, pollution: 6, power: false}))], [im.NUCLEAR_POWER, ImprovementStats (__kwargtrans__ ({py_name: 'Nuclear Power Plant', purchase: dict ([[res.MONEY, 500000.0], [res.STEEL, 100.0]]), upkeep: 10500.0, power: false}))], [im.WIND_POWER, ImprovementStats (__kwargtrans__ ({py_name: 'Wind Power Plant', purchase: dict ([[res.MONEY, 30000.0], [res.ALUMINUM, 25.0]]), upkeep: 500.0, power: false}))], [im.COAL_MINE, ImprovementStats (__kwargtrans__ ({py_name: 'Coal Mine', purchase: dict ([[res.MONEY, 1000.0]]), upkeep: 400.0, production: dict ([[res.COAL, 3.0]]), pollution: 12, _max: 12, power: false}))], [im.OIL_WELL, ImprovementStats (__kwargtrans__ ({py_name: 'Oil Well', purchase: dict ([[res.MONEY, 1500.0]]), upkeep: 600.0, production: dict ([[res.OIL, 3.0]]), pollution: 12, _max: 12, power: false}))], [im.IRON_MINE, ImprovementStats (__kwargtrans__ ({py_name: 'Iron Mine', purchase: dict ([[res.MONEY, 9500.0]]), upkeep: 1600.0, production: dict ([[res.IRON, 3.0]]), pollution: 12, _max: 6, power: false}))], [im.BAUXITE_MINE, ImprovementStats (__kwargtrans__ ({py_name: 'Bauxite Mine', purchase: dict ([[res.MONEY, 9500.0]]), upkeep: 1600.0, production: dict ([[res.BAUXITE, 3.0]]), pollution: 12, _max: 6, power: false}))], [im.LEAD_MINE, ImprovementStats (__kwargtrans__ ({py_name: 'Lead Mine', purchase: dict ([[res.MONEY, 7500.0]]), upkeep: 1500.0, production: dict ([[res.LEAD, 3.0]]), pollution: 12, _max: 10, power: false}))], [im.URANIUM_MINE, ImprovementStats (__kwargtrans__ ({py_name: 'Uranium Mine', purchase: dict ([[res.MONEY, 25000.0]]), upkeep: 5000.0, production: dict ([[res.URANIUM, 3.0]]), pollution: 20, _max: 3, power: false}))], [im.FARM, ImprovementStats (__kwargtrans__ ({py_name: 'Farm', purchase: dict ([[res.MONEY, 1000.0]]), upkeep: 300.0, production: dict ([[res.FOOD, 12.0 / 500.0]]), pollution: 2, _max: 20, power: false}))], [im.GASOLINE_REFINERY, ImprovementStats (__kwargtrans__ ({py_name: 'Oil Refinery', purchase: dict ([[res.MONEY, 45000.0]]), upkeep: 4000.0, production: dict ([[res.GASOLINE, 6.0]]), usage: dict ([[res.OIL, 3.0]]), pollution: 32, _max: 5, power: true}))], [im.STEEL_MILL, ImprovementStats (__kwargtrans__ ({py_name: 'Steel Mill', purchase: dict ([[res.MONEY, 45000.0]]), upkeep: 4000.0, production: dict ([[res.STEEL, 9.0]]), usage: dict ([[res.IRON, 3.0], [res.COAL, 3.0]]), pollution: 40, _max: 5, power: true}))], [im.ALUMINUM_REFINERY, ImprovementStats (__kwargtrans__ ({py_name: 'Aluminum Refinery', purchase: dict ([[res.MONEY, 30000.0]]), upkeep: 2500.0, production: dict ([[res.ALUMINUM, 9.0]]), usage: dict ([[res.BAUXITE, 3.0]]), pollution: 40, _max: 5, power: true}))], [im.MUNITIONS_FACTORY, ImprovementStats (__kwargtrans__ ({py_name: 'Munitions Factory', purchase: dict ([[res.MONEY, 35000.0]]), upkeep: 3500.0, production: dict ([[res.MUNITIONS, 18.0]]), usage: dict ([[res.LEAD, 6.0]]), pollution: 32, _max: 5, power: true}))], [im.POLICE_STATION, ImprovementStats (__kwargtrans__ ({py_name: 'Police Station', purchase: dict ([[res.MONEY, 75000.0], [res.STEEL, 20.0]]), upkeep: 750.0, pollution: 1, _max: 5, power: true}))], [im.HOSPITAL, ImprovementStats (__kwargtrans__ ({py_name: 'Hospital', purchase: dict ([[res.MONEY, 100000.0], [res.ALUMINUM, 25.0]]), upkeep: 1000.0, pollution: 4, _max: 5, power: true}))], [im.RECYCLING_CENTER, ImprovementStats (__kwargtrans__ ({py_name: 'Recycling Center', purchase: dict ([[res.MONEY, 125000.0]]), upkeep: 2500.0, pollution: -(70), _max: 3, power: true}))], [im.SUBWAY, ImprovementStats (__kwargtrans__ ({py_name: 'Subway', purchase: dict ([[res.MONEY, 250000.0], [res.ALUMINUM, 25], [res.STEEL, 50]]), upkeep: 3250.0, pollution: -(45), commerce: 8, _max: 1, power: true}))], [im.SUPERMARKET, ImprovementStats (__kwargtrans__ ({py_name: 'Supermarket', purchase: dict ([[res.MONEY, 5000.0]]), upkeep: 600.0, commerce: 3, _max: 6, power: true}))], [im.BANK, ImprovementStats (__kwargtrans__ ({py_name: 'Bank', purchase: dict ([[res.MONEY, 15000.0], [res.ALUMINUM, 10], [res.STEEL, 5]]), upkeep: 1800.0, commerce: 5, _max: 5, power: true}))], [im.MALL, ImprovementStats (__kwargtrans__ ({py_name: 'Shopping Mall', purchase: dict ([[res.MONEY, 45000.0], [res.ALUMINUM, 25], [res.STEEL, 20]]), upkeep: 5400.0, pollution: 2, commerce: 9, _max: 4, power: true}))], [im.STADIUM, ImprovementStats (__kwargtrans__ ({py_name: 'Stadium', purchase: dict ([[res.MONEY, 100000.0], [res.ALUMINUM, 50], [res.STEEL, 40]]), upkeep: 12150.0, pollution: 5, commerce: 12, _max: 3, power: true}))], [im.BARRACKS, ImprovementStats (__kwargtrans__ ({py_name: 'Barracks', purchase: dict ([[res.MONEY, 3000.0]]), _max: 5, capacity: dict ([[mil.SOLDIERS, 3000]]), power: true}))], [im.FACTORY, ImprovementStats (__kwargtrans__ ({py_name: 'Factory', purchase: dict ([[res.MONEY, 0.0]]), _max: 5, capacity: dict ([[mil.TANKS, 250]]), power: true}))], [im.HANGAR, ImprovementStats (__kwargtrans__ ({py_name: 'Hangar', purchase: dict ([[res.MONEY, 0.0]]), _max: 5, capacity: dict ([[mil.AIRCRAFT, 18]]), power: true}))], [im.DRYDOCK, ImprovementStats (__kwargtrans__ ({py_name: 'Drydock', purchase: dict ([[res.MONEY, 0.0]]), _max: 3, capacity: dict ([[mil.SHIPS, 5]]), power: true}))]]);\n\t\t\t\t\tvar PROJECT_MODS = dict ([[Project.ARMS_STOCK_PILE, 1.34], [Project.BAUXITE_WORKS, 1.36], [Project.EMERGENCY_GAS_RESERVE, 2.0], [Project.IRON_WORKS, 1.36], [Project.MASS_IRRIGATION, 500 / 400], [Project.URANIUM_ENRICHMENT_PROGRAM, 2.0]]);\n\t\t\t\t\tvar RES_PROD_MODS = dict ([[res.MUNITIONS, Project.ARMS_STOCK_PILE], [res.ALUMINUM, Project.BAUXITE_WORKS], [res.GASOLINE, Project.EMERGENCY_GAS_RESERVE], [res.STEEL, Project.IRON_WORKS], [res.FOOD, Project.MASS_IRRIGATION], [res.URANIUM, Project.URANIUM_ENRICHMENT_PROGRAM]]);\n\t\t\t\t\tvar RES_USAGE_MODS = dict ([[res.LEAD, Project.ARMS_STOCK_PILE], [res.BAUXITE, Project.BAUXITE_WORKS], [res.OIL, Project.EMERGENCY_GAS_RESERVE], [res.COAL, Project.IRON_WORKS], [res.IRON, Project.IRON_WORKS]]);\n\t\t\t\t\tvar RESOURCES = tuple ([res.FOOD, res.COAL, res.OIL, res.URANIUM, res.IRON, res.BAUXITE, res.LEAD, res.GASOLINE, res.STEEL, res.ALUMINUM, res.MUNITIONS]);\n\t\t\t\t\tvar SOCIAL_POLICIES = tuple ([SocialPolicy.ANARCHIST, SocialPolicy.LIBERTARIAN, SocialPolicy.LIBERAL, SocialPolicy.MODERATE, SocialPolicy.CONSERVATIVE, SocialPolicy.AUTHORITARIAN, SocialPolicy.FASCIST]);\n\t\t\t\t\tvar TAX_RATES = dict ([[EconomicPolicy.EXTREMELY_LEFT_WING, 46.63], [EconomicPolicy.FAR_LEFT_WING, 44.38], [EconomicPolicy.LEFT_WING, 36.5], [EconomicPolicy.MODERATE, 30.88], [EconomicPolicy.RIGHT_WING, 16.25], [EconomicPolicy.FAR_RIGHT_WING, 12.88], [EconomicPolicy.EXTREMELY_RIGHT_WING, 5.0]]);\n\t\t\t\t\t__pragma__ ('<all>')\n\t\t\t\t\t\t__all__.AlliancePosition = AlliancePosition;\n\t\t\t\t\t\t__all__.CONTINENTS = CONTINENTS;\n\t\t\t\t\t\t__all__.CONTINENT_RESOURCES = CONTINENT_RESOURCES;\n\t\t\t\t\t\t__all__.Color = Color;\n\t\t\t\t\t\t__all__.Continent = Continent;\n\t\t\t\t\t\t__all__.DomesticPolicy = DomesticPolicy;\n\t\t\t\t\t\t__all__.ECONOMIC_POLICIES = ECONOMIC_POLICIES;\n\t\t\t\t\t\t__all__.EconomicPolicy = EconomicPolicy;\n\t\t\t\t\t\t__all__.IMPROVEMENTS = IMPROVEMENTS;\n\t\t\t\t\t\t__all__.Improvement = Improvement;\n\t\t\t\t\t\t__all__.ImprovementStats = ImprovementStats;\n\t\t\t\t\t\t__all__.MILITARY = MILITARY;\n\t\t\t\t\t\t__all__.Military = Military;\n\t\t\t\t\t\t__all__.MilitaryStats = MilitaryStats;\n\t\t\t\t\t\t__all__.PROJECT_MODS = PROJECT_MODS;\n\t\t\t\t\t\t__all__.Project = Project;\n\t\t\t\t\t\t__all__.RESOURCES = RESOURCES;\n\t\t\t\t\t\t__all__.RES_PROD_MODS = RES_PROD_MODS;\n\t\t\t\t\t\t__all__.RES_USAGE_MODS = RES_USAGE_MODS;\n\t\t\t\t\t\t__all__.Resource = Resource;\n\t\t\t\t\t\t__all__.SOCIAL_POLICIES = SOCIAL_POLICIES;\n\t\t\t\t\t\t__all__.Season = Season;\n\t\t\t\t\t\t__all__.SocialPolicy = SocialPolicy;\n\t\t\t\t\t\t__all__.TAX_RATES = TAX_RATES;\n\t\t\t\t\t\t__all__.WarPolicy = WarPolicy;\n\t\t\t\t\t\t__all__.im = im;\n\t\t\t\t\t\t__all__.mil = mil;\n\t\t\t\t\t\t__all__.pr = pr;\n\t\t\t\t\t\t__all__.res = res;\n\t\t\t\t\t__pragma__ ('</all>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t__nest__ (\n\t\t__all__,\n\t\t'ferret.pnw.formulas', {\n\t\t\t__all__: {\n\t\t\t\t__inited__: false,\n\t\t\t\t__init__: function (__all__) {\n\t\t\t\t\tvar alliance = __init__ (__world__.ferret.pnw.formulas.alliance);\n\t\t\t\t\tvar city = __init__ (__world__.ferret.pnw.formulas.city);\n\t\t\t\t\tvar general = __init__ (__world__.ferret.pnw.formulas.general);\n\t\t\t\t\tvar nation = __init__ (__world__.ferret.pnw.formulas.nation);\n\t\t\t\t\t__pragma__ ('<use>' +\n\t\t\t\t\t\t'ferret.pnw.formulas.alliance' +\n\t\t\t\t\t\t'ferret.pnw.formulas.city' +\n\t\t\t\t\t\t'ferret.pnw.formulas.general' +\n\t\t\t\t\t\t'ferret.pnw.formulas.nation' +\n\t\t\t\t\t'</use>')\n\t\t\t\t\t__pragma__ ('<all>')\n\t\t\t\t\t\t__all__.alliance = alliance;\n\t\t\t\t\t\t__all__.city = city;\n\t\t\t\t\t\t__all__.general = general;\n\t\t\t\t\t\t__all__.nation = nation;\n\t\t\t\t\t__pragma__ ('</all>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t__nest__ (\n\t\t__all__,\n\t\t'ferret.pnw.formulas.alliance', {\n\t\t\t__all__: {\n\t\t\t\t__inited__: false,\n\t\t\t\t__init__: function (__all__) {\n\t\t\t\t\tvar sqrt = __init__ (__world__.math).sqrt;\n\t\t\t\t\tvar RESOURCES = __init__ (__world__.ferret.pnw.constants).RESOURCES;\n\t\t\t\t\tvar nation = __init__ (__world__.ferret.pnw.formulas.nation);\n\t\t\t\t\tvar rev_gross = function (alliance) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'alliance': var alliance = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var member of alliance.members) {\n\t\t\t\t\t\t\t\t__accu0__.append (nation.rev_gross (member));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn py_iter (__accu0__);\n\t\t\t\t\t\t} ());\n\t\t\t\t\t};\n\t\t\t\t\tvar rev_expenses = function (alliance) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'alliance': var alliance = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var member of alliance.members) {\n\t\t\t\t\t\t\t\t__accu0__.append (nation.rev_expenses (member));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn py_iter (__accu0__);\n\t\t\t\t\t\t} ());\n\t\t\t\t\t};\n\t\t\t\t\tvar res_prod = function (alliance) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'alliance': var alliance = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar prod = function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var r of RESOURCES) {\n\t\t\t\t\t\t\t\t__accu0__.append (list ([r, 0.0]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn dict (__accu0__);\n\t\t\t\t\t\t} ();\n\t\t\t\t\t\tfor (var member of alliance.members) {\n\t\t\t\t\t\t\tfor (var [r, p] of nation.res_prod (member).py_items ()) {\n\t\t\t\t\t\t\t\tprod [r] += p;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn prod;\n\t\t\t\t\t};\n\t\t\t\t\tvar res_usage = function (alliance) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'alliance': var alliance = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar prod = function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var r of RESOURCES) {\n\t\t\t\t\t\t\t\t__accu0__.append (list ([r, 0.0]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn dict (__accu0__);\n\t\t\t\t\t\t} ();\n\t\t\t\t\t\tfor (var member of alliance.members) {\n\t\t\t\t\t\t\tfor (var [r, p] of nation.res_usage (member).py_items ()) {\n\t\t\t\t\t\t\t\tprod [r] += p;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn prod;\n\t\t\t\t\t};\n\t\t\t\t\tvar treasure_bonus = function (alliance) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'alliance': var alliance = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (alliance) {\n\t\t\t\t\t\t\treturn round (sqrt (alliance.treasures * 4), 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn 0.0;\n\t\t\t\t\t};\n\t\t\t\t\t__pragma__ ('<use>' +\n\t\t\t\t\t\t'ferret.pnw.constants' +\n\t\t\t\t\t\t'ferret.pnw.formulas.nation' +\n\t\t\t\t\t\t'math' +\n\t\t\t\t\t'</use>')\n\t\t\t\t\t__pragma__ ('<all>')\n\t\t\t\t\t\t__all__.RESOURCES = RESOURCES;\n\t\t\t\t\t\t__all__.nation = nation;\n\t\t\t\t\t\t__all__.res_prod = res_prod;\n\t\t\t\t\t\t__all__.res_usage = res_usage;\n\t\t\t\t\t\t__all__.rev_expenses = rev_expenses;\n\t\t\t\t\t\t__all__.rev_gross = rev_gross;\n\t\t\t\t\t\t__all__.sqrt = sqrt;\n\t\t\t\t\t\t__all__.treasure_bonus = treasure_bonus;\n\t\t\t\t\t__pragma__ ('</all>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t__nest__ (\n\t\t__all__,\n\t\t'ferret.pnw.formulas.city', {\n\t\t\t__all__: {\n\t\t\t\t__inited__: false,\n\t\t\t\t__init__: function (__all__) {\n\t\t\t\t\tvar AlliancePosition = __init__ (__world__.ferret.pnw.constants).AlliancePosition;\n\t\t\t\t\tvar CONTINENTS = __init__ (__world__.ferret.pnw.constants).CONTINENTS;\n\t\t\t\t\tvar CONTINENT_RESOURCES = __init__ (__world__.ferret.pnw.constants).CONTINENT_RESOURCES;\n\t\t\t\t\tvar Color = __init__ (__world__.ferret.pnw.constants).Color;\n\t\t\t\t\tvar Continent = __init__ (__world__.ferret.pnw.constants).Continent;\n\t\t\t\t\tvar DomesticPolicy = __init__ (__world__.ferret.pnw.constants).DomesticPolicy;\n\t\t\t\t\tvar ECONOMIC_POLICIES = __init__ (__world__.ferret.pnw.constants).ECONOMIC_POLICIES;\n\t\t\t\t\tvar EconomicPolicy = __init__ (__world__.ferret.pnw.constants).EconomicPolicy;\n\t\t\t\t\tvar IMPROVEMENTS = __init__ (__world__.ferret.pnw.constants).IMPROVEMENTS;\n\t\t\t\t\tvar Improvement = __init__ (__world__.ferret.pnw.constants).Improvement;\n\t\t\t\t\tvar ImprovementStats = __init__ (__world__.ferret.pnw.constants).ImprovementStats;\n\t\t\t\t\tvar MILITARY = __init__ (__world__.ferret.pnw.constants).MILITARY;\n\t\t\t\t\tvar Military = __init__ (__world__.ferret.pnw.constants).Military;\n\t\t\t\t\tvar MilitaryStats = __init__ (__world__.ferret.pnw.constants).MilitaryStats;\n\t\t\t\t\tvar PROJECT_MODS = __init__ (__world__.ferret.pnw.constants).PROJECT_MODS;\n\t\t\t\t\tvar Project = __init__ (__world__.ferret.pnw.constants).Project;\n\t\t\t\t\tvar RESOURCES = __init__ (__world__.ferret.pnw.constants).RESOURCES;\n\t\t\t\t\tvar RES_PROD_MODS = __init__ (__world__.ferret.pnw.constants).RES_PROD_MODS;\n\t\t\t\t\tvar RES_USAGE_MODS = __init__ (__world__.ferret.pnw.constants).RES_USAGE_MODS;\n\t\t\t\t\tvar Resource = __init__ (__world__.ferret.pnw.constants).Resource;\n\t\t\t\t\tvar SOCIAL_POLICIES = __init__ (__world__.ferret.pnw.constants).SOCIAL_POLICIES;\n\t\t\t\t\tvar Season = __init__ (__world__.ferret.pnw.constants).Season;\n\t\t\t\t\tvar SocialPolicy = __init__ (__world__.ferret.pnw.constants).SocialPolicy;\n\t\t\t\t\tvar TAX_RATES = __init__ (__world__.ferret.pnw.constants).TAX_RATES;\n\t\t\t\t\tvar WarPolicy = __init__ (__world__.ferret.pnw.constants).WarPolicy;\n\t\t\t\t\tvar im = __init__ (__world__.ferret.pnw.constants).im;\n\t\t\t\t\tvar mil = __init__ (__world__.ferret.pnw.constants).mil;\n\t\t\t\t\tvar pr = __init__ (__world__.ferret.pnw.constants).pr;\n\t\t\t\t\tvar res = __init__ (__world__.ferret.pnw.constants).res;\n\t\t\t\t\tvar average_income = function (city, nation, minimum_wage) {\n\t\t\t\t\t\tif (typeof nation == 'undefined' || (nation != null && nation .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar nation = null;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (typeof minimum_wage == 'undefined' || (minimum_wage != null && minimum_wage .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar minimum_wage = 1.0;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'city': var city = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'minimum_wage': var minimum_wage = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nation === null) {\n\t\t\t\t\t\t\tvar nation = city.nation;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (minimum_wage === null) {\n\t\t\t\t\t\t\tvar minimum_wage = nation.minimum_wage;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (commerce (city, nation) / 50 + 1) * minimum_wage;\n\t\t\t\t\t};\n\t\t\t\t\tvar base_population = function (city) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'city': var city = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn city.infrastructure * 100;\n\t\t\t\t\t};\n\t\t\t\t\tvar commerce = function (city, nation) {\n\t\t\t\t\t\tif (typeof nation == 'undefined' || (nation != null && nation .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar nation = null;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'city': var city = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!(powered (city))) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nation === null) {\n\t\t\t\t\t\t\tvar nation = city.nation;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar improvements = dict (city.improvements);\n\t\t\t\t\t\treturn min (sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var [i, n] of improvements.py_items ()) {\n\t\t\t\t\t\t\t\t__accu0__.append (n * IMPROVEMENTS [i].commerce);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn py_iter (__accu0__);\n\t\t\t\t\t\t} ()), (nation && nation.projects [pr.INTERNATIONAL_TRADE_CENTER] ? 115 : 100));\n\t\t\t\t\t};\n\t\t\t\t\tvar crime = function (city, nation) {\n\t\t\t\t\t\tif (typeof nation == 'undefined' || (nation != null && nation .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar nation = null;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'city': var city = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nation === null) {\n\t\t\t\t\t\t\tvar nation = city.nation;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar _crime = (Math.pow (103 - commerce (city, nation), 2) + base_population (city)) / 111111;\n\t\t\t\t\t\tif (powered (city)) {\n\t\t\t\t\t\t\t_crime -= city.improvements [im.POLICE_STATION] * 2.5;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn min (100, max (0, _crime));\n\t\t\t\t\t};\n\t\t\t\t\tvar disease = function (city) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'city': var city = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar base_pop = base_population (city);\n\t\t\t\t\t\tvar _disease = (Math.pow (base_pop / city.land, 2) * 0.01 - 25) / 100;\n\t\t\t\t\t\t_disease += base_pop / 100000;\n\t\t\t\t\t\t_disease += pollution (city) * 0.05;\n\t\t\t\t\t\tif (powered (city)) {\n\t\t\t\t\t\t\t_disease -= city.improvements [im.HOSPITAL] * 2.5;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn min (100, max (0, _disease));\n\t\t\t\t\t};\n\t\t\t\t\tvar pollution = function (city) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'city': var city = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar _powered = powered (city);\n\t\t\t\t\t\tvar improvements = dict (city.improvements);\n\t\t\t\t\t\tvar p = sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var [i, n] of improvements.py_items ()) {\n\t\t\t\t\t\t\t\t__accu0__.append ((!(IMPROVEMENTS [i].power) || IMPROVEMENTS [i].power && _powered ? IMPROVEMENTS [i].pollution * n : 0));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn __accu0__;\n\t\t\t\t\t\t} ());\n\t\t\t\t\t\treturn max (0, p);\n\t\t\t\t\t};\n\t\t\t\t\tvar population = function (city, nation) {\n\t\t\t\t\t\tif (typeof nation == 'undefined' || (nation != null && nation .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar nation = null;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'city': var city = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nation === null) {\n\t\t\t\t\t\t\tvar nation = city.nation;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar py_pop = base_population (city);\n\t\t\t\t\t\tpy_pop -= max (0, (crime (city, nation) / 10) * base_population (city) - 25);\n\t\t\t\t\t\tpy_pop -= max (0, disease (city) * city.infrastructure);\n\t\t\t\t\t\tpy_pop *= 1 + city.age / 3000;\n\t\t\t\t\t\treturn max (py_pop, 10);\n\t\t\t\t\t};\n\t\t\t\t\tvar powered = function (city) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'city': var city = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar infra = ((city.improvements [im.COAL_POWER] * 500 + city.improvements [im.OIL_POWER] * 500) + city.improvements [im.NUCLEAR_POWER] * 2000) + city.improvements [im.WIND_POWER] * 250;\n\t\t\t\t\t\treturn infra >= city.infrastructure;\n\t\t\t\t\t};\n\t\t\t\t\t__pragma__ ('<use>' +\n\t\t\t\t\t\t'ferret.pnw.constants' +\n\t\t\t\t\t'</use>')\n\t\t\t\t\t__pragma__ ('<all>')\n\t\t\t\t\t\t__all__.AlliancePosition = AlliancePosition;\n\t\t\t\t\t\t__all__.CONTINENTS = CONTINENTS;\n\t\t\t\t\t\t__all__.CONTINENT_RESOURCES = CONTINENT_RESOURCES;\n\t\t\t\t\t\t__all__.Color = Color;\n\t\t\t\t\t\t__all__.Continent = Continent;\n\t\t\t\t\t\t__all__.DomesticPolicy = DomesticPolicy;\n\t\t\t\t\t\t__all__.ECONOMIC_POLICIES = ECONOMIC_POLICIES;\n\t\t\t\t\t\t__all__.EconomicPolicy = EconomicPolicy;\n\t\t\t\t\t\t__all__.IMPROVEMENTS = IMPROVEMENTS;\n\t\t\t\t\t\t__all__.Improvement = Improvement;\n\t\t\t\t\t\t__all__.ImprovementStats = ImprovementStats;\n\t\t\t\t\t\t__all__.MILITARY = MILITARY;\n\t\t\t\t\t\t__all__.Military = Military;\n\t\t\t\t\t\t__all__.MilitaryStats = MilitaryStats;\n\t\t\t\t\t\t__all__.PROJECT_MODS = PROJECT_MODS;\n\t\t\t\t\t\t__all__.Project = Project;\n\t\t\t\t\t\t__all__.RESOURCES = RESOURCES;\n\t\t\t\t\t\t__all__.RES_PROD_MODS = RES_PROD_MODS;\n\t\t\t\t\t\t__all__.RES_USAGE_MODS = RES_USAGE_MODS;\n\t\t\t\t\t\t__all__.Resource = Resource;\n\t\t\t\t\t\t__all__.SOCIAL_POLICIES = SOCIAL_POLICIES;\n\t\t\t\t\t\t__all__.Season = Season;\n\t\t\t\t\t\t__all__.SocialPolicy = SocialPolicy;\n\t\t\t\t\t\t__all__.TAX_RATES = TAX_RATES;\n\t\t\t\t\t\t__all__.WarPolicy = WarPolicy;\n\t\t\t\t\t\t__all__.average_income = average_income;\n\t\t\t\t\t\t__all__.base_population = base_population;\n\t\t\t\t\t\t__all__.commerce = commerce;\n\t\t\t\t\t\t__all__.crime = crime;\n\t\t\t\t\t\t__all__.disease = disease;\n\t\t\t\t\t\t__all__.im = im;\n\t\t\t\t\t\t__all__.mil = mil;\n\t\t\t\t\t\t__all__.pollution = pollution;\n\t\t\t\t\t\t__all__.population = population;\n\t\t\t\t\t\t__all__.powered = powered;\n\t\t\t\t\t\t__all__.pr = pr;\n\t\t\t\t\t\t__all__.res = res;\n\t\t\t\t\t__pragma__ ('</all>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t__nest__ (\n\t\t__all__,\n\t\t'ferret.pnw.formulas.general', {\n\t\t\t__all__: {\n\t\t\t\t__inited__: false,\n\t\t\t\t__init__: function (__all__) {\n\t\t\t\t\tvar res_net = function (prod, usage) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'prod': var prod = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'usage': var usage = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar net = function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var [res, p] of prod.py_items ()) {\n\t\t\t\t\t\t\t\t__accu0__.append (list ([res, p]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn dict (__accu0__);\n\t\t\t\t\t\t} ();\n\t\t\t\t\t\tfor (var [res, u] of usage.py_items ()) {\n\t\t\t\t\t\t\tif (__in__ (res, net)) {\n\t\t\t\t\t\t\t\tnet [res] = net [res] - u;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tnet [res] = -(u);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn net;\n\t\t\t\t\t};\n\t\t\t\t\t__pragma__ ('<all>')\n\t\t\t\t\t\t__all__.res_net = res_net;\n\t\t\t\t\t__pragma__ ('</all>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t__nest__ (\n\t\t__all__,\n\t\t'ferret.pnw.formulas.nation', {\n\t\t\t__all__: {\n\t\t\t\t__inited__: false,\n\t\t\t\t__init__: function (__all__) {\n\t\t\t\t\tvar ceil = __init__ (__world__.math).ceil;\n\t\t\t\t\tvar AlliancePosition = __init__ (__world__.ferret.pnw.constants).AlliancePosition;\n\t\t\t\t\tvar CONTINENTS = __init__ (__world__.ferret.pnw.constants).CONTINENTS;\n\t\t\t\t\tvar CONTINENT_RESOURCES = __init__ (__world__.ferret.pnw.constants).CONTINENT_RESOURCES;\n\t\t\t\t\tvar Color = __init__ (__world__.ferret.pnw.constants).Color;\n\t\t\t\t\tvar Continent = __init__ (__world__.ferret.pnw.constants).Continent;\n\t\t\t\t\tvar DomesticPolicy = __init__ (__world__.ferret.pnw.constants).DomesticPolicy;\n\t\t\t\t\tvar ECONOMIC_POLICIES = __init__ (__world__.ferret.pnw.constants).ECONOMIC_POLICIES;\n\t\t\t\t\tvar EconomicPolicy = __init__ (__world__.ferret.pnw.constants).EconomicPolicy;\n\t\t\t\t\tvar IMPROVEMENTS = __init__ (__world__.ferret.pnw.constants).IMPROVEMENTS;\n\t\t\t\t\tvar Improvement = __init__ (__world__.ferret.pnw.constants).Improvement;\n\t\t\t\t\tvar ImprovementStats = __init__ (__world__.ferret.pnw.constants).ImprovementStats;\n\t\t\t\t\tvar MILITARY = __init__ (__world__.ferret.pnw.constants).MILITARY;\n\t\t\t\t\tvar Military = __init__ (__world__.ferret.pnw.constants).Military;\n\t\t\t\t\tvar MilitaryStats = __init__ (__world__.ferret.pnw.constants).MilitaryStats;\n\t\t\t\t\tvar PROJECT_MODS = __init__ (__world__.ferret.pnw.constants).PROJECT_MODS;\n\t\t\t\t\tvar Project = __init__ (__world__.ferret.pnw.constants).Project;\n\t\t\t\t\tvar RESOURCES = __init__ (__world__.ferret.pnw.constants).RESOURCES;\n\t\t\t\t\tvar RES_PROD_MODS = __init__ (__world__.ferret.pnw.constants).RES_PROD_MODS;\n\t\t\t\t\tvar RES_USAGE_MODS = __init__ (__world__.ferret.pnw.constants).RES_USAGE_MODS;\n\t\t\t\t\tvar Resource = __init__ (__world__.ferret.pnw.constants).Resource;\n\t\t\t\t\tvar SOCIAL_POLICIES = __init__ (__world__.ferret.pnw.constants).SOCIAL_POLICIES;\n\t\t\t\t\tvar Season = __init__ (__world__.ferret.pnw.constants).Season;\n\t\t\t\t\tvar SocialPolicy = __init__ (__world__.ferret.pnw.constants).SocialPolicy;\n\t\t\t\t\tvar TAX_RATES = __init__ (__world__.ferret.pnw.constants).TAX_RATES;\n\t\t\t\t\tvar WarPolicy = __init__ (__world__.ferret.pnw.constants).WarPolicy;\n\t\t\t\t\tvar im = __init__ (__world__.ferret.pnw.constants).im;\n\t\t\t\t\tvar mil = __init__ (__world__.ferret.pnw.constants).mil;\n\t\t\t\t\tvar pr = __init__ (__world__.ferret.pnw.constants).pr;\n\t\t\t\t\tvar res = __init__ (__world__.ferret.pnw.constants).res;\n\t\t\t\t\tvar _city = __init__ (__world__.ferret.pnw.formulas.city);\n\t\t\t\t\tvar average_income = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar p = function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var city of nation.cities) {\n\t\t\t\t\t\t\t\t__accu0__.append (_city.population (city, nation));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn __accu0__;\n\t\t\t\t\t\t} ();\n\t\t\t\t\t\treturn sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var [i, city] of enumerate (nation.cities)) {\n\t\t\t\t\t\t\t\t__accu0__.append (p [i] * _city.average_income (city, nation, minimum_wage (nation)));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn py_iter (__accu0__);\n\t\t\t\t\t\t} ()) / sum (p);\n\t\t\t\t\t};\n\t\t\t\t\tvar color_bonus = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nation.color == Color.BEIGE) {\n\t\t\t\t\t\t\treturn 5.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (nation.color == Color.GRAY) {\n\t\t\t\t\t\t\treturn 0.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (nation.alliance && nation.alliance.color != nation.color) {\n\t\t\t\t\t\t\treturn 0.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn 3.0;\n\t\t\t\t\t};\n\t\t\t\t\tvar cumulative_bonus = function (nation, treasure_bonus) {\n\t\t\t\t\t\tif (typeof treasure_bonus == 'undefined' || (treasure_bonus != null && treasure_bonus .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar treasure_bonus = null;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'treasure_bonus': var treasure_bonus = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (treasure_bonus === null && nation.alliance) {\n\t\t\t\t\t\t\tvar treasure_bonus = nation.alliance.treasure_bonus;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn treasure_bonus + color_bonus (nation);\n\t\t\t\t\t};\n\t\t\t\t\tvar full_name = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (nation.name_prefix + ' ') + nation.py_name;\n\t\t\t\t\t};\n\t\t\t\t\tvar infrastructure = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var city of nation.cities) {\n\t\t\t\t\t\t\t\t__accu0__.append (city.infrastructure);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn py_iter (__accu0__);\n\t\t\t\t\t\t} ());\n\t\t\t\t\t};\n\t\t\t\t\tvar land = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var city of nation.cities) {\n\t\t\t\t\t\t\t\t__accu0__.append (city.land);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn py_iter (__accu0__);\n\t\t\t\t\t\t} ());\n\t\t\t\t\t};\n\t\t\t\t\tvar minimum_wage = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn 725 / (tax_rate (nation) * 10);\n\t\t\t\t\t};\n\t\t\t\t\tvar population = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var city of nation.cities) {\n\t\t\t\t\t\t\t\t__accu0__.append (_city.population (city, nation));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn py_iter (__accu0__);\n\t\t\t\t\t\t} ());\n\t\t\t\t\t};\n\t\t\t\t\tvar res_prod = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar prod = function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var r of RESOURCES) {\n\t\t\t\t\t\t\t\t__accu0__.append (list ([r, 0.0]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn dict (__accu0__);\n\t\t\t\t\t\t} ();\n\t\t\t\t\t\tfor (var city of nation.cities) {\n\t\t\t\t\t\t\tfor (var [i, n] of city.improvements.py_items ()) {\n\t\t\t\t\t\t\t\tfor (var [resource, p] of IMPROVEMENTS [i].production.py_items ()) {\n\t\t\t\t\t\t\t\t\tif (resource == res.FOOD) {\n\t\t\t\t\t\t\t\t\t\tprod [resource] += (p * n) * city.land;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tprod [resource] += p * n;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar season = Season.SPRING;\n\t\t\t\t\t\tif (season == Season.SUMMER) {\n\t\t\t\t\t\t\tprod [res.FOOD] *= 1.2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (season == Season.WINTER) {\n\t\t\t\t\t\t\tprod [res.FOOD] *= 0.8;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var [resource, project] of RES_PROD_MODS.py_items ()) {\n\t\t\t\t\t\t\tif (__in__ (resource, prod) && nation.projects [project]) {\n\t\t\t\t\t\t\t\tprod [resource] *= PROJECT_MODS [project];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn prod;\n\t\t\t\t\t};\n\t\t\t\t\tvar res_usage = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar usage = function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var r of RESOURCES) {\n\t\t\t\t\t\t\t\t__accu0__.append (list ([r, 0.0]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn dict (__accu0__);\n\t\t\t\t\t\t} ();\n\t\t\t\t\t\tfor (var city of nation.cities) {\n\t\t\t\t\t\t\tfor (var [i, n] of city.improvements.py_items ()) {\n\t\t\t\t\t\t\t\tfor (var [resource, u] of IMPROVEMENTS [i].usage.py_items ()) {\n\t\t\t\t\t\t\t\t\tusage [resource] += u * n;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tusage [res.FOOD] += population (nation) / 1000;\n\t\t\t\t\t\tvar war = false;\n\t\t\t\t\t\tusage [res.FOOD] += nation.soldiers * (war ? MILITARY [mil.SOLDIERS].upkeep_war : MILITARY [mil.SOLDIERS].upkeep_peace) [res.FOOD];\n\t\t\t\t\t\tfor (var [resource, project] of RES_USAGE_MODS.py_items ()) {\n\t\t\t\t\t\t\tif (__in__ (resource, usage) && nation.projects [project]) {\n\t\t\t\t\t\t\t\tusage [resource] *= PROJECT_MODS [project];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var city of nation.cities) {\n\t\t\t\t\t\t\tvar powered = city.improvements [im.WIND_POWER] * 250;\n\t\t\t\t\t\t\tif (powered >= city.infrastructure) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar __left0__ = _calc_power_resource_usage (city, powered, im.NUCLEAR_POWER, 2000, 1000, 1.2);\n\t\t\t\t\t\t\tvar powered = __left0__ [0];\n\t\t\t\t\t\t\tvar uranium_usage = __left0__ [1];\n\t\t\t\t\t\t\tusage [res.URANIUM] += uranium_usage;\n\t\t\t\t\t\t\tif (powered >= city.infrastructure) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar __left0__ = _calc_power_resource_usage (city, powered, im.OIL_POWER, 500, 100, 1.2);\n\t\t\t\t\t\t\tvar powered = __left0__ [0];\n\t\t\t\t\t\t\tvar oil_usage = __left0__ [1];\n\t\t\t\t\t\t\tusage [res.OIL] += oil_usage;\n\t\t\t\t\t\t\tif (powered >= city.infrastructure) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar __left0__ = _calc_power_resource_usage (city, powered, im.COAL_POWER, 500, 100, 1.2);\n\t\t\t\t\t\t\tvar powered = __left0__ [0];\n\t\t\t\t\t\t\tvar coal_usage = __left0__ [1];\n\t\t\t\t\t\t\tusage [res.COAL] += coal_usage;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn usage;\n\t\t\t\t\t};\n\t\t\t\t\tvar rev_gross = function (nation, treasure_bonus) {\n\t\t\t\t\t\tif (typeof treasure_bonus == 'undefined' || (treasure_bonus != null && treasure_bonus .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar treasure_bonus = null;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'treasure_bonus': var treasure_bonus = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (((((average_income (nation) * population (nation)) * tax_rate (nation)) / 100) * (100 + cumulative_bonus (nation, treasure_bonus))) / 100) * (nation.domestic_policy == DomesticPolicy.OPEN_MARKETS ? 1.01 : 1.0);\n\t\t\t\t\t};\n\t\t\t\t\tvar rev_expenses = function (nation, category) {\n\t\t\t\t\t\tif (typeof category == 'undefined' || (category != null && category .hasOwnProperty (\"__kwargtrans__\"))) {;\n\t\t\t\t\t\t\tvar category = null;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'category': var category = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (category == 'power') {\n\t\t\t\t\t\t\treturn _calc_improvement_upkeep (nation, tuple ([im.OIL_POWER, im.COAL_POWER, im.NUCLEAR_POWER, im.WIND_POWER]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (category == 'resources') {\n\t\t\t\t\t\t\treturn _calc_improvement_upkeep (nation, tuple ([im.COAL_MINE, im.OIL_WELL, im.IRON_MINE, im.BAUXITE_MINE, im.LEAD_MINE, im.URANIUM_MINE, im.FARM, im.GASOLINE_REFINERY, im.STEEL_MILL, im.ALUMINUM_REFINERY, im.MUNITIONS_FACTORY]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (category == 'military') {\n\t\t\t\t\t\t\treturn _calc_military_upkeep (nation);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (category == 'city') {\n\t\t\t\t\t\t\treturn _calc_improvement_upkeep (nation, tuple ([im.POLICE_STATION, im.HOSPITAL, im.RECYCLING_CENTER, im.SUBWAY, im.SUPERMARKET, im.BANK, im.MALL, im.STADIUM]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn ((rev_expenses (nation, 'power') + rev_expenses (nation, 'resources')) + rev_expenses (nation, 'military')) + rev_expenses (nation, 'city');\n\t\t\t\t\t};\n\t\t\t\t\tvar tax_rate = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn TAX_RATES [nation.economic_policy];\n\t\t\t\t\t};\n\t\t\t\t\tvar _calc_improvement_upkeep = function (nation, improvements) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'improvements': var improvements = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var city of nation.cities) {\n\t\t\t\t\t\t\t\tfor (var i of improvements) {\n\t\t\t\t\t\t\t\t\t__accu0__.append (city.improvements [i] * IMPROVEMENTS [i].upkeep);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn py_iter (__accu0__);\n\t\t\t\t\t\t} ());\n\t\t\t\t\t};\n\t\t\t\t\tvar _calc_military_upkeep = function (nation) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'nation': var nation = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar war = false;\n\t\t\t\t\t\tvar units = dict ([[mil.SOLDIERS, nation.soldiers], [mil.TANKS, nation.tanks], [mil.AIRCRAFT, nation.aircraft], [mil.SHIPS, nation.ships], [mil.SPIES, nation.spies], [mil.MISSILES, nation.missiles], [mil.NUKES, nation.nukes]]);\n\t\t\t\t\t\treturn sum (function () {\n\t\t\t\t\t\t\tvar __accu0__ = [];\n\t\t\t\t\t\t\tfor (var [i, n] of units.py_items ()) {\n\t\t\t\t\t\t\t\t__accu0__.append (n * (war ? MILITARY [i].upkeep_war : MILITARY [i].upkeep_peace) [res.MONEY]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn py_iter (__accu0__);\n\t\t\t\t\t\t} ()) * (nation.domestic_policy == DomesticPolicy.IMPERIALISM ? 0.95 : 1.0);\n\t\t\t\t\t};\n\t\t\t\t\tvar _calc_power_resource_usage = function (city, powered, improvement, infra_capacity, infra_per_level, usage_per_level) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'city': var city = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'powered': var powered = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'improvement': var improvement = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'infra_capacity': var infra_capacity = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'infra_per_level': var infra_per_level = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'usage_per_level': var usage_per_level = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar imp_powered = min (city.improvements [improvement] * infra_capacity, city.infrastructure - powered);\n\t\t\t\t\t\treturn tuple ([powered + imp_powered, ceil (imp_powered / infra_per_level) * usage_per_level]);\n\t\t\t\t\t};\n\t\t\t\t\t__pragma__ ('<use>' +\n\t\t\t\t\t\t'ferret.pnw.constants' +\n\t\t\t\t\t\t'ferret.pnw.formulas.city' +\n\t\t\t\t\t\t'math' +\n\t\t\t\t\t'</use>')\n\t\t\t\t\t__pragma__ ('<all>')\n\t\t\t\t\t\t__all__.AlliancePosition = AlliancePosition;\n\t\t\t\t\t\t__all__.CONTINENTS = CONTINENTS;\n\t\t\t\t\t\t__all__.CONTINENT_RESOURCES = CONTINENT_RESOURCES;\n\t\t\t\t\t\t__all__.Color = Color;\n\t\t\t\t\t\t__all__.Continent = Continent;\n\t\t\t\t\t\t__all__.DomesticPolicy = DomesticPolicy;\n\t\t\t\t\t\t__all__.ECONOMIC_POLICIES = ECONOMIC_POLICIES;\n\t\t\t\t\t\t__all__.EconomicPolicy = EconomicPolicy;\n\t\t\t\t\t\t__all__.IMPROVEMENTS = IMPROVEMENTS;\n\t\t\t\t\t\t__all__.Improvement = Improvement;\n\t\t\t\t\t\t__all__.ImprovementStats = ImprovementStats;\n\t\t\t\t\t\t__all__.MILITARY = MILITARY;\n\t\t\t\t\t\t__all__.Military = Military;\n\t\t\t\t\t\t__all__.MilitaryStats = MilitaryStats;\n\t\t\t\t\t\t__all__.PROJECT_MODS = PROJECT_MODS;\n\t\t\t\t\t\t__all__.Project = Project;\n\t\t\t\t\t\t__all__.RESOURCES = RESOURCES;\n\t\t\t\t\t\t__all__.RES_PROD_MODS = RES_PROD_MODS;\n\t\t\t\t\t\t__all__.RES_USAGE_MODS = RES_USAGE_MODS;\n\t\t\t\t\t\t__all__.Resource = Resource;\n\t\t\t\t\t\t__all__.SOCIAL_POLICIES = SOCIAL_POLICIES;\n\t\t\t\t\t\t__all__.Season = Season;\n\t\t\t\t\t\t__all__.SocialPolicy = SocialPolicy;\n\t\t\t\t\t\t__all__.TAX_RATES = TAX_RATES;\n\t\t\t\t\t\t__all__.WarPolicy = WarPolicy;\n\t\t\t\t\t\t__all__._calc_improvement_upkeep = _calc_improvement_upkeep;\n\t\t\t\t\t\t__all__._calc_military_upkeep = _calc_military_upkeep;\n\t\t\t\t\t\t__all__._calc_power_resource_usage = _calc_power_resource_usage;\n\t\t\t\t\t\t__all__._city = _city;\n\t\t\t\t\t\t__all__.average_income = average_income;\n\t\t\t\t\t\t__all__.ceil = ceil;\n\t\t\t\t\t\t__all__.color_bonus = color_bonus;\n\t\t\t\t\t\t__all__.cumulative_bonus = cumulative_bonus;\n\t\t\t\t\t\t__all__.full_name = full_name;\n\t\t\t\t\t\t__all__.im = im;\n\t\t\t\t\t\t__all__.infrastructure = infrastructure;\n\t\t\t\t\t\t__all__.land = land;\n\t\t\t\t\t\t__all__.mil = mil;\n\t\t\t\t\t\t__all__.minimum_wage = minimum_wage;\n\t\t\t\t\t\t__all__.population = population;\n\t\t\t\t\t\t__all__.pr = pr;\n\t\t\t\t\t\t__all__.res = res;\n\t\t\t\t\t\t__all__.res_prod = res_prod;\n\t\t\t\t\t\t__all__.res_usage = res_usage;\n\t\t\t\t\t\t__all__.rev_expenses = rev_expenses;\n\t\t\t\t\t\t__all__.rev_gross = rev_gross;\n\t\t\t\t\t\t__all__.tax_rate = tax_rate;\n\t\t\t\t\t__pragma__ ('</all>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t__nest__ (\n\t\t__all__,\n\t\t'math', {\n\t\t\t__all__: {\n\t\t\t\t__inited__: false,\n\t\t\t\t__init__: function (__all__) {\n\t\t\t\t\tvar pi = Math.PI;\n\t\t\t\t\tvar e = Math.E;\n\t\t\t\t\tvar exp = Math.exp;\n\t\t\t\t\tvar expm1 = function (x) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'x': var x = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Math.exp (x) - 1;\n\t\t\t\t\t};\n\t\t\t\t\tvar log = function (x, base) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'x': var x = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t\tcase 'base': var base = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (base === undefined ? Math.log (x) : Math.log (x) / Math.log (base));\n\t\t\t\t\t};\n\t\t\t\t\tvar log1p = function (x) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'x': var x = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Math.log (x + 1);\n\t\t\t\t\t};\n\t\t\t\t\tvar log2 = function (x) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'x': var x = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Math.log (x) / Math.LN2;\n\t\t\t\t\t};\n\t\t\t\t\tvar log10 = function (x) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'x': var x = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Math.log (x) / Math.LN10;\n\t\t\t\t\t};\n\t\t\t\t\tvar pow = Math.pow;\n\t\t\t\t\tvar sqrt = Math.sqrt;\n\t\t\t\t\tvar sin = Math.sin;\n\t\t\t\t\tvar cos = Math.cos;\n\t\t\t\t\tvar tan = Math.tan;\n\t\t\t\t\tvar asin = Math.asin;\n\t\t\t\t\tvar acos = Math.acos;\n\t\t\t\t\tvar atan = Math.atan;\n\t\t\t\t\tvar atan2 = Math.atan2;\n\t\t\t\t\tvar hypot = Math.hypot;\n\t\t\t\t\tvar degrees = function (x) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'x': var x = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (x * 180) / Math.PI;\n\t\t\t\t\t};\n\t\t\t\t\tvar radians = function (x) {\n\t\t\t\t\t\tif (arguments.length) {\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\n\t\t\t\t\t\t\t\t\t\tcase 'x': var x = __allkwargs0__ [__attrib0__]; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (x * Math.PI) / 180;\n\t\t\t\t\t};\n\t\t\t\t\tvar sinh = Math.sinh;\n\t\t\t\t\tvar cosh = Math.cosh;\n\t\t\t\t\tvar tanh = Math.tanh;\n\t\t\t\t\tvar asinh = Math.asinh;\n\t\t\t\t\tvar acosh = Math.acosh;\n\t\t\t\t\tvar atanh = Math.atanh;\n\t\t\t\t\tvar floor = Math.floor;\n\t\t\t\t\tvar ceil = Math.ceil;\n\t\t\t\t\tvar trunc = Math.trunc;\n\t\t\t\t\tvar isnan = isNaN;\n\t\t\t\t\tvar inf = Infinity;\n\t\t\t\t\tvar nan = NaN;\n\t\t\t\t\t__pragma__ ('<all>')\n\t\t\t\t\t\t__all__.acos = acos;\n\t\t\t\t\t\t__all__.acosh = acosh;\n\t\t\t\t\t\t__all__.asin = asin;\n\t\t\t\t\t\t__all__.asinh = asinh;\n\t\t\t\t\t\t__all__.atan = atan;\n\t\t\t\t\t\t__all__.atan2 = atan2;\n\t\t\t\t\t\t__all__.atanh = atanh;\n\t\t\t\t\t\t__all__.ceil = ceil;\n\t\t\t\t\t\t__all__.cos = cos;\n\t\t\t\t\t\t__all__.cosh = cosh;\n\t\t\t\t\t\t__all__.degrees = degrees;\n\t\t\t\t\t\t__all__.e = e;\n\t\t\t\t\t\t__all__.exp = exp;\n\t\t\t\t\t\t__all__.expm1 = expm1;\n\t\t\t\t\t\t__all__.floor = floor;\n\t\t\t\t\t\t__all__.hypot = hypot;\n\t\t\t\t\t\t__all__.inf = inf;\n\t\t\t\t\t\t__all__.isnan = isnan;\n\t\t\t\t\t\t__all__.log = log;\n\t\t\t\t\t\t__all__.log10 = log10;\n\t\t\t\t\t\t__all__.log1p = log1p;\n\t\t\t\t\t\t__all__.log2 = log2;\n\t\t\t\t\t\t__all__.nan = nan;\n\t\t\t\t\t\t__all__.pi = pi;\n\t\t\t\t\t\t__all__.pow = pow;\n\t\t\t\t\t\t__all__.radians = radians;\n\t\t\t\t\t\t__all__.sin = sin;\n\t\t\t\t\t\t__all__.sinh = sinh;\n\t\t\t\t\t\t__all__.sqrt = sqrt;\n\t\t\t\t\t\t__all__.tan = tan;\n\t\t\t\t\t\t__all__.tanh = tanh;\n\t\t\t\t\t\t__all__.trunc = trunc;\n\t\t\t\t\t__pragma__ ('</all>')\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t(function () {\n\t\tvar AlliancePosition = __init__ (__world__.ferret.pnw.constants).AlliancePosition;\n\t\tvar CONTINENTS = __init__ (__world__.ferret.pnw.constants).CONTINENTS;\n\t\tvar CONTINENT_RESOURCES = __init__ (__world__.ferret.pnw.constants).CONTINENT_RESOURCES;\n\t\tvar Color = __init__ (__world__.ferret.pnw.constants).Color;\n\t\tvar Continent = __init__ (__world__.ferret.pnw.constants).Continent;\n\t\tvar DomesticPolicy = __init__ (__world__.ferret.pnw.constants).DomesticPolicy;\n\t\tvar ECONOMIC_POLICIES = __init__ (__world__.ferret.pnw.constants).ECONOMIC_POLICIES;\n\t\tvar EconomicPolicy = __init__ (__world__.ferret.pnw.constants).EconomicPolicy;\n\t\tvar IMPROVEMENTS = __init__ (__world__.ferret.pnw.constants).IMPROVEMENTS;\n\t\tvar Improvement = __init__ (__world__.ferret.pnw.constants).Improvement;\n\t\tvar ImprovementStats = __init__ (__world__.ferret.pnw.constants).ImprovementStats;\n\t\tvar MILITARY = __init__ (__world__.ferret.pnw.constants).MILITARY;\n\t\tvar Military = __init__ (__world__.ferret.pnw.constants).Military;\n\t\tvar MilitaryStats = __init__ (__world__.ferret.pnw.constants).MilitaryStats;\n\t\tvar PROJECT_MODS = __init__ (__world__.ferret.pnw.constants).PROJECT_MODS;\n\t\tvar Project = __init__ (__world__.ferret.pnw.constants).Project;\n\t\tvar RESOURCES = __init__ (__world__.ferret.pnw.constants).RESOURCES;\n\t\tvar RES_PROD_MODS = __init__ (__world__.ferret.pnw.constants).RES_PROD_MODS;\n\t\tvar RES_USAGE_MODS = __init__ (__world__.ferret.pnw.constants).RES_USAGE_MODS;\n\t\tvar Resource = __init__ (__world__.ferret.pnw.constants).Resource;\n\t\tvar SOCIAL_POLICIES = __init__ (__world__.ferret.pnw.constants).SOCIAL_POLICIES;\n\t\tvar Season = __init__ (__world__.ferret.pnw.constants).Season;\n\t\tvar SocialPolicy = __init__ (__world__.ferret.pnw.constants).SocialPolicy;\n\t\tvar TAX_RATES = __init__ (__world__.ferret.pnw.constants).TAX_RATES;\n\t\tvar WarPolicy = __init__ (__world__.ferret.pnw.constants).WarPolicy;\n\t\tvar im = __init__ (__world__.ferret.pnw.constants).im;\n\t\tvar mil = __init__ (__world__.ferret.pnw.constants).mil;\n\t\tvar pr = __init__ (__world__.ferret.pnw.constants).pr;\n\t\tvar res = __init__ (__world__.ferret.pnw.constants).res;\n\t\tvar alliance = __init__ (__world__.ferret.pnw.formulas).alliance;\n\t\tvar city = __init__ (__world__.ferret.pnw.formulas).city;\n\t\tvar general = __init__ (__world__.ferret.pnw.formulas).general;\n\t\tvar nation = __init__ (__world__.ferret.pnw.formulas).nation;\n\t\t__pragma__ ('<use>' +\n\t\t\t'ferret.pnw.constants' +\n\t\t\t'ferret.pnw.formulas' +\n\t\t'</use>')\n\t\t__pragma__ ('<all>')\n\t\t\t__all__.AlliancePosition = AlliancePosition;\n\t\t\t__all__.CONTINENTS = CONTINENTS;\n\t\t\t__all__.CONTINENT_RESOURCES = CONTINENT_RESOURCES;\n\t\t\t__all__.Color = Color;\n\t\t\t__all__.Continent = Continent;\n\t\t\t__all__.DomesticPolicy = DomesticPolicy;\n\t\t\t__all__.ECONOMIC_POLICIES = ECONOMIC_POLICIES;\n\t\t\t__all__.EconomicPolicy = EconomicPolicy;\n\t\t\t__all__.IMPROVEMENTS = IMPROVEMENTS;\n\t\t\t__all__.Improvement = Improvement;\n\t\t\t__all__.ImprovementStats = ImprovementStats;\n\t\t\t__all__.MILITARY = MILITARY;\n\t\t\t__all__.Military = Military;\n\t\t\t__all__.MilitaryStats = MilitaryStats;\n\t\t\t__all__.PROJECT_MODS = PROJECT_MODS;\n\t\t\t__all__.Project = Project;\n\t\t\t__all__.RESOURCES = RESOURCES;\n\t\t\t__all__.RES_PROD_MODS = RES_PROD_MODS;\n\t\t\t__all__.RES_USAGE_MODS = RES_USAGE_MODS;\n\t\t\t__all__.Resource = Resource;\n\t\t\t__all__.SOCIAL_POLICIES = SOCIAL_POLICIES;\n\t\t\t__all__.Season = Season;\n\t\t\t__all__.SocialPolicy = SocialPolicy;\n\t\t\t__all__.TAX_RATES = TAX_RATES;\n\t\t\t__all__.WarPolicy = WarPolicy;\n\t\t\t__all__.alliance = alliance;\n\t\t\t__all__.city = city;\n\t\t\t__all__.general = general;\n\t\t\t__all__.im = im;\n\t\t\t__all__.mil = mil;\n\t\t\t__all__.nation = nation;\n\t\t\t__all__.pr = pr;\n\t\t\t__all__.res = res;\n\t\t__pragma__ ('</all>')\n\t}) ();\n return __all__;\n}", "title": "" }, { "docid": "ef0e12e1a0a80571530a1ff95df8aa89", "score": "0.53829986", "text": "async function v26(v27,v28) {\n const v32 = [1337];\n // v32 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n try {\n const v34 = v32 instanceof isNaN;\n // v34 = .boolean\n } catch(v35) {\n function v36(v37,v38) {\n const v39 = 0;\n // v39 = .integer\n const v40 = 10;\n // v40 = .integer\n const v41 = eval;\n // v41 = .function([.string] => .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"]))\n const v42 = 1;\n // v42 = .integer\n }\n }\n let v43 = 0;\n do {\n for (let v47 = 0; v47 < 100; v47 = v47 + 1) {\n }\n const v48 = v43 + 1;\n // v48 = .primitive\n v43 = v48;\n } while (v43 !== 7);\n }", "title": "" }, { "docid": "b9a0dcb0685f0194778c6c62a22c9089", "score": "0.5381421", "text": "function InlineTransformer() {}", "title": "" }, { "docid": "957589fab53844c100307f01cd213af8", "score": "0.5380291", "text": "function v53(v54,v55) {\n function v57(v58,v59) {\n }\n const v64 = [13.37,13.37,Int16Array,13.37];\n // v64 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v65(v66,v67) {\n const v69 = \"512\".padStart(\"512\",v65);\n // v69 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n }\n for (let v70 = 1; v70 <= 100; v70 = v70 + 1) {\n const v71 = v57(-2677088782,v70);\n // v71 = .unknown\n }\n const v72 = v54.toLocaleString();\n // v72 = .unknown\n const v74 = Infinity.toLocaleString();\n // v74 = .unknown\n const v76 = [v74];\n // v76 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n JSON[v76] = v76;\n const v79 = [v52];\n // v79 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v80 = {constructor:2.220446049250313e-16,d:\"ZmRsGzLg8m\",toString:v79};\n // v80 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"toString\", \"d\", \"constructor\"])\n const v85 = [v72,-2510862370,v80,JSON,v54];\n // v85 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v86 = JSON.stringify(v85,-1,13.37);\n // v86 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n return v86;\n}", "title": "" }, { "docid": "25be4a7227e6b06372bc14cf74f64fb2", "score": "0.5351721", "text": "function o0(stdlib,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n function add(o2,o3) {\n try {\nArray.prototype.indexOf = +\"objects don't have a bounded length so we should find the index given any length\";\n}catch(e){}\n try {\no3 = +o3;\n}catch(e){}\n try {\nreturn +(o2+o3);\n}catch(e){}\n }\n \n var o582 = o421.o143 + o588 + ((o421.o367) ? 1 : 0)\n \n var o7 = [add,add,add,add];\n \n \n try {\nreturn { \n o4 : o4\n };\n}catch(e){}\n}", "title": "" }, { "docid": "1a513aade0be617f6ce810716d1bc6c8", "score": "0.5330874", "text": "function __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev($this) {\n var label = 0;\n label = 1; \n while(1) switch(label) {\n case 1: \n var $1;\n var $2;\n var $3;\n var $4;\n var $5;\n var $6;\n var $7;\n var $8;\n var $9;\n var $10;\n var $11;\n var $12;\n var $13;\n var $14;\n var $15;\n var $16;\n var $17;\n var $18;\n var $19;\n var $20;\n $20=$this;\n var $21=$20;\n $19=$21;\n var $22=$19;\n label = 2; break;\n case 2: \n $12=$21;\n var $24=$12;\n var $25=(($24)|0);\n $11=$25;\n var $26=$11;\n var $27=$26;\n $10=$27;\n var $28=$10;\n var $29=(($28)|0);\n var $30=(($29)|0);\n var $31=$30;\n var $32=(($31)|0);\n var $33=$32;\n var $34=HEAP8[($33)];\n var $35=(($34)&(255));\n var $36=$35 & 1;\n var $37=(($36)|(0))!=0;\n if ($37) { label = 3; break; } else { label = 4; break; }\n case 3: \n $3=$21;\n var $39=$3;\n var $40=(($39)|0);\n $2=$40;\n var $41=$2;\n var $42=$41;\n $1=$42;\n var $43=$1;\n var $44=$43;\n $6=$21;\n var $45=$6;\n var $46=(($45)|0);\n $5=$46;\n var $47=$5;\n var $48=$47;\n $4=$48;\n var $49=$4;\n var $50=(($49)|0);\n var $51=(($50)|0);\n var $52=$51;\n var $53=(($52+8)|0);\n var $54=HEAP32[(($53)>>2)];\n $9=$21;\n var $55=$9;\n var $56=(($55)|0);\n $8=$56;\n var $57=$8;\n var $58=$57;\n $7=$58;\n var $59=$7;\n var $60=(($59)|0);\n var $61=(($60)|0);\n var $62=$61;\n var $63=(($62)|0);\n var $64=HEAP32[(($63)>>2)];\n var $65=$64 & -2;\n $16=$44;\n $17=$54;\n $18=$65;\n var $66=$16;\n var $67=$17;\n var $68=$18;\n $13=$66;\n $14=$67;\n $15=$68;\n var $69=$13;\n var $70=$14;\n __ZdlPv($70);\n label = 4; break;\n case 4: \n return;\n default: assert(0, \"bad label: \" + label);\n }\n}", "title": "" }, { "docid": "53ebdf87d7a4df1af412f4f51aa1cdad", "score": "0.53194946", "text": "function compiles(code) { ... }", "title": "" }, { "docid": "d3163a066f536d8eb21ee0b920e52c62", "score": "0.5312811", "text": "function __ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE8__appendEj($this, $__n) {\n var label = 0;\n var __stackBase__ = STACKTOP; STACKTOP = (STACKTOP + 56)|0; (assert((STACKTOP|0) < (STACK_MAX|0))|0);\n label = 1; \n while(1) switch(label) {\n case 1: \n var $1;\n var $2;\n var $3;\n var $4;\n var $5;\n var $6;\n var $7=__stackBase__;\n var $8;\n var $9;\n var $10=(__stackBase__)+(8);\n var $11;\n var $12;\n var $13;\n var $14;\n var $15;\n var $16;\n var $17;\n var $18=(__stackBase__)+(16);\n var $__ms_i;\n var $__cap_i;\n var $19=(__stackBase__)+(24);\n var $20;\n var $21;\n var $22;\n var $23;\n var $24;\n var $25;\n var $26;\n var $27;\n var $28;\n var $__a;\n var $__v=(__stackBase__)+(32);\n var $29;\n var $30;\n $27=$this;\n $28=$__n;\n var $31=$27;\n var $32=$31;\n $26=$32;\n var $33=$26;\n var $34=(($33+8)|0);\n $25=$34;\n var $35=$25;\n var $36=$35;\n $24=$36;\n var $37=$24;\n var $38=(($37)|0);\n var $39=HEAP32[(($38)>>2)];\n var $40=$31;\n var $41=(($40+4)|0);\n var $42=HEAP32[(($41)>>2)];\n var $43=$39;\n var $44=$42;\n var $45=((($43)-($44))|0);\n var $46=((((($45)|(0)))/(4))&-1);\n var $47=$28;\n var $48=(($46)>>>(0)) >= (($47)>>>(0));\n if ($48) { label = 2; break; } else { label = 3; break; }\n case 2: \n var $50=$28;\n __ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE18__construct_at_endEj($31, $50);\n label = 15; break;\n case 3: \n var $52=$31;\n $23=$52;\n var $53=$23;\n var $54=(($53+8)|0);\n $22=$54;\n var $55=$22;\n var $56=$55;\n $21=$56;\n var $57=$21;\n var $58=(($57+8)|0);\n $__a=$58;\n $20=$31;\n var $59=$20;\n var $60=$59;\n var $61=(($60+4)|0);\n var $62=HEAP32[(($61)>>2)];\n var $63=$59;\n var $64=(($63)|0);\n var $65=HEAP32[(($64)>>2)];\n var $66=$62;\n var $67=$65;\n var $68=((($66)-($67))|0);\n var $69=((((($68)|(0)))/(4))&-1);\n var $70=$28;\n var $71=((($69)+($70))|0);\n $17=$31;\n HEAP32[(($18)>>2)]=$71;\n var $72=$17;\n var $73=__ZNKSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE8max_sizeEv($72);\n $__ms_i=$73;\n var $74=HEAP32[(($18)>>2)];\n var $75=$__ms_i;\n var $76=(($74)>>>(0)) > (($75)>>>(0));\n if ($76) { label = 4; break; } else { label = 5; break; }\n case 4: \n var $78=$72;\n __ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv($78);\n label = 5; break;\n case 5: \n $15=$72;\n var $80=$15;\n var $81=$80;\n $14=$81;\n var $82=$14;\n $13=$82;\n var $83=$13;\n var $84=(($83+8)|0);\n $12=$84;\n var $85=$12;\n var $86=$85;\n $11=$86;\n var $87=$11;\n var $88=(($87)|0);\n var $89=HEAP32[(($88)>>2)];\n var $90=(($82)|0);\n var $91=HEAP32[(($90)>>2)];\n var $92=$89;\n var $93=$91;\n var $94=((($92)-($93))|0);\n var $95=((((($94)|(0)))/(4))&-1);\n $__cap_i=$95;\n var $96=$__cap_i;\n var $97=$__ms_i;\n var $98=Math.floor(((($97)>>>(0)))/(2));\n var $99=(($96)>>>(0)) >= (($98)>>>(0));\n if ($99) { label = 6; break; } else { label = 7; break; }\n case 6: \n var $101=$__ms_i;\n $16=$101;\n label = 11; break;\n case 7: \n var $103=$__cap_i;\n var $104=($103<<1);\n HEAP32[(($19)>>2)]=$104;\n $8=$19;\n $9=$18;\n var $105=$8;\n var $106=$9;\n var $tmp_i_i=$7;\n var $tmp1_i_i=$10;\n assert(1 % 1 === 0);HEAP8[($tmp_i_i)]=HEAP8[($tmp1_i_i)];\n $5=$105;\n $6=$106;\n var $107=$5;\n var $108=$6;\n $2=$7;\n $3=$107;\n $4=$108;\n var $109=$2;\n var $110=$3;\n var $111=HEAP32[(($110)>>2)];\n var $112=$4;\n var $113=HEAP32[(($112)>>2)];\n var $114=(($111)>>>(0)) < (($113)>>>(0));\n if ($114) { label = 8; break; } else { label = 9; break; }\n case 8: \n var $116=$6;\n var $119 = $116;label = 10; break;\n case 9: \n var $118=$5;\n var $119 = $118;label = 10; break;\n case 10: \n var $119;\n var $120=HEAP32[(($119)>>2)];\n $16=$120;\n label = 11; break;\n case 11: \n var $121=$16;\n $1=$31;\n var $122=$1;\n var $123=$122;\n var $124=(($123+4)|0);\n var $125=HEAP32[(($124)>>2)];\n var $126=$122;\n var $127=(($126)|0);\n var $128=HEAP32[(($127)>>2)];\n var $129=$125;\n var $130=$128;\n var $131=((($129)-($130))|0);\n var $132=((((($131)|(0)))/(4))&-1);\n var $133=$__a;\n __ZNSt3__114__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lj28EEEEC1EjjS6_($__v, $121, $132, $133);\n var $134=$28;\n (function() { try { __THREW__ = 0; return __ZNSt3__114__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lj28EEEE18__construct_at_endEj($__v, $134) } catch(e) { if (typeof e != \"number\") throw e; if (ABORT) throw e; __THREW__ = 1; return null } })();if (!__THREW__) { label = 12; break; } else { label = 14; break; }\n case 12: \n (function() { try { __THREW__ = 0; return __ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE($31, $__v) } catch(e) { if (typeof e != \"number\") throw e; if (ABORT) throw e; __THREW__ = 1; return null } })();if (!__THREW__) { label = 13; break; } else { label = 14; break; }\n case 13: \n __ZNSt3__114__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lj28EEEED1Ev($__v);\n label = 15; break;\n case 14: \n var $138$0 = ___cxa_find_matching_catch(-1, -1); $138$1 = tempRet0;\n var $139=$138$0;\n $29=$139;\n var $140=$138$1;\n $30=$140;\n __ZNSt3__114__split_bufferIPNS_6locale5facetERNS_15__sso_allocatorIS3_Lj28EEEED1Ev($__v);\n label = 16; break;\n case 15: \n STACKTOP = __stackBase__;\n return;\n case 16: \n var $143=$29;\n var $144=$30;\n var $145$0=$143;\n var $145$1=0;\n var $146$0=$145$0;\n var $146$1=$144;\n ___resumeException($146$0)\n default: assert(0, \"bad label: \" + label);\n }\n}", "title": "" }, { "docid": "bdaef22a9752c12ee2ab4911434893ff", "score": "0.5312549", "text": "function _DeadCodeEliminationOptimizeCommand() {\n}", "title": "" }, { "docid": "a9eb0cd0a7714fa5ae3c7fa8ea7c2963", "score": "0.5310629", "text": "function Compiler() {\n}", "title": "" }, { "docid": "efc183e1f5dcf6f84e406b6b897557d1", "score": "0.5306388", "text": "inline() {\n this.perform_refactoring(\"inline\", undefined);\n }", "title": "" }, { "docid": "430cb1d3e440f7047663606235ba3110", "score": "0.53018516", "text": "function _LCSEOptimizeCommand() {\n}", "title": "" }, { "docid": "da4d5bcfed717406afd9c096ce542530", "score": "0.52982336", "text": "function convertJsFunctionToWasm(func, sig) {\n\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n var typeSection = [\n 0x01, // id: section,\n 0x00, // length: 0 (placeholder)\n 0x01, // count: 1\n 0x60, // form: func\n ];\n var sigRet = sig.slice(0, 1);\n var sigParam = sig.slice(1);\n var typeCodes = {\n 'i': 0x7f, // i32\n 'j': 0x7e, // i64\n 'f': 0x7d, // f32\n 'd': 0x7c, // f64\n };\n\n // Parameters, length + signatures\n typeSection.push(sigParam.length);\n for (var i = 0; i < sigParam.length; ++i) {\n typeSection.push(typeCodes[sigParam[i]]);\n }\n\n // Return values, length + signatures\n // With no multi-return in MVP, either 0 (void) or 1 (anything else)\n if (sigRet == 'v') {\n typeSection.push(0x00);\n } else {\n typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);\n }\n\n // Write the overall length of the type section back into the section header\n // (excepting the 2 bytes for the section id and length)\n typeSection[1] = typeSection.length - 2;\n\n // Rest of the module is static\n var bytes = new Uint8Array([\n 0x00, 0x61, 0x73, 0x6d, // magic (\"\\0asm\")\n 0x01, 0x00, 0x00, 0x00, // version: 1\n ].concat(typeSection, [\n 0x02, 0x07, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,\n 0x07, 0x05, // export section\n // (export \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x66, 0x00, 0x00,\n ]));\n\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n e: {\n f: func\n }\n });\n var wrappedFunc = instance.exports.f;\n return wrappedFunc;\n}", "title": "" }, { "docid": "b9dd89e41c9250e1c6ea466c2c073485", "score": "0.52936304", "text": "function someFunction(){\n return 1+1;\n}", "title": "" }, { "docid": "a70aedd110da7051fc729a2e93be8866", "score": "0.52837414", "text": "function u(a,b){\"string\"===typeof a&&(a=ea(a,\"code\"));this.La=a.constructor;var c=new this.La({options:{}});for(d in a)c[d]=\"body\"===d?a[d].slice():a[d];this.ka=c;this.rb=b;this.Aa=!1;this.aa=[];this.Xa=0;this.vb=Object.create(null);var d=/^step([A-Z]\\w*)$/;var e,g;for(g in this)\"function\"===typeof this[g]&&(e=g.match(d))&&(this.vb[e[1]]=this[g].bind(this));this.T=fa(this,this.ka,null);this.Ya=this.T.object;this.ka=ea(this.aa.join(\"\\n\"),\"polyfills\");this.aa=void 0;ha(this.ka,void 0,void 0);e=new v(this.ka,\nthis.T);e.done=!1;this.m=[e];this.ub();this.value=void 0;this.ka=c;e=new v(this.ka,this.T);e.done=!1;this.m.length=0;this.m[0]=e;this.stateStack=this.m}", "title": "" }, { "docid": "4e941517748ee58efdff72f113400b9d", "score": "0.52624017", "text": "function vito() {\n\n}", "title": "" }, { "docid": "28e61b4e41fc3edb8270eee991aff903", "score": "0.5256305", "text": "function __ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwj($this, $__s, $__sz) {\n var label = 0;\n var __stackBase__ = STACKTOP; STACKTOP = (STACKTOP + 32)|0; (assert((STACKTOP|0) < (STACK_MAX|0))|0);\n label = 1; \n while(1) switch(label) {\n case 1: \n var $1;\n var $2;\n var $3;\n var $4;\n var $5;\n var $6;\n var $7;\n var $8;\n var $9;\n var $10;\n var $11;\n var $12;\n var $13;\n var $14;\n var $15;\n var $16;\n var $17;\n var $18;\n var $19;\n var $20;\n var $21;\n var $22;\n var $23;\n var $24;\n var $25;\n var $26;\n var $27;\n var $28;\n var $29;\n var $30;\n var $31;\n var $32;\n var $33;\n var $34;\n var $35;\n var $36;\n var $37=__stackBase__;\n var $38;\n var $39=(__stackBase__)+(8);\n var $40=(__stackBase__)+(16);\n var $41;\n var $42;\n var $43;\n var $44;\n var $__m_i;\n var $45;\n var $46;\n var $47;\n var $__p;\n var $__cap;\n var $48=(__stackBase__)+(24);\n $45=$this;\n $46=$__s;\n $47=$__sz;\n var $49=$45;\n var $50=$47;\n $44=$49;\n var $51=$44;\n $43=$51;\n var $52=$43;\n var $53=(($52)|0);\n $42=$53;\n var $54=$42;\n var $55=$54;\n $41=$55;\n var $56=$41;\n var $57=$56;\n $38=$57;\n var $58=$40;\n var $59=$38;\n var $tmp_i_i=$37;\n var $tmp1_i_i=$39;\n assert(1 % 1 === 0);HEAP8[($tmp_i_i)]=HEAP8[($tmp1_i_i)];\n $36=$59;\n var $60=$36;\n $35=$60;\n var $61=$35;\n $__m_i=1073741823;\n var $62=$__m_i;\n var $63=((($62)-(1))|0);\n var $64=(($50)>>>(0)) > (($63)>>>(0));\n if ($64) { label = 2; break; } else { label = 3; break; }\n case 2: \n var $66=$49;\n __ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv($66);\n label = 3; break;\n case 3: \n var $68=$47;\n var $69=(($68)>>>(0)) < 2;\n if ($69) { label = 4; break; } else { label = 5; break; }\n case 4: \n var $71=$47;\n $28=$49;\n $29=$71;\n var $72=$28;\n var $73=$29;\n var $74=$73 << 1;\n var $75=(($74) & 255);\n var $76=(($72)|0);\n $27=$76;\n var $77=$27;\n var $78=$77;\n $26=$78;\n var $79=$26;\n var $80=(($79)|0);\n var $81=(($80)|0);\n var $82=$81;\n var $83=(($82)|0);\n var $84=$83;\n HEAP8[($84)]=$75;\n $8=$49;\n var $85=$8;\n var $86=(($85)|0);\n $7=$86;\n var $87=$7;\n var $88=$87;\n $6=$88;\n var $89=$6;\n var $90=(($89)|0);\n var $91=(($90)|0);\n var $92=$91;\n var $93=(($92+4)|0);\n var $94=(($93)|0);\n $__p=$94;\n label = 9; break;\n case 5: \n var $96=$47;\n $2=$96;\n var $97=$2;\n var $98=(($97)>>>(0)) < 2;\n if ($98) { label = 6; break; } else { label = 7; break; }\n case 6: \n var $106 = 2;label = 8; break;\n case 7: \n var $101=$2;\n var $102=((($101)+(1))|0);\n $1=$102;\n var $103=$1;\n var $104=((($103)+(3))|0);\n var $105=$104 & -4;\n var $106 = $105;label = 8; break;\n case 8: \n var $106;\n var $107=((($106)-(1))|0);\n $__cap=$107;\n $5=$49;\n var $108=$5;\n var $109=(($108)|0);\n $4=$109;\n var $110=$4;\n var $111=$110;\n $3=$111;\n var $112=$3;\n var $113=$112;\n var $114=$__cap;\n var $115=((($114)+(1))|0);\n $12=$113;\n $13=$115;\n var $116=$12;\n var $117=$13;\n $9=$116;\n $10=$117;\n $11=0;\n var $118=$9;\n var $119=$10;\n var $120=($119<<2);\n var $121=__Znwj($120);\n var $122=$121;\n $__p=$122;\n var $123=$__p;\n $16=$49;\n $17=$123;\n var $124=$16;\n var $125=$17;\n var $126=(($124)|0);\n $15=$126;\n var $127=$15;\n var $128=$127;\n $14=$128;\n var $129=$14;\n var $130=(($129)|0);\n var $131=(($130)|0);\n var $132=$131;\n var $133=(($132+8)|0);\n HEAP32[(($133)>>2)]=$125;\n var $134=$__cap;\n var $135=((($134)+(1))|0);\n $20=$49;\n $21=$135;\n var $136=$20;\n var $137=$21;\n var $138=1 | $137;\n var $139=(($136)|0);\n $19=$139;\n var $140=$19;\n var $141=$140;\n $18=$141;\n var $142=$18;\n var $143=(($142)|0);\n var $144=(($143)|0);\n var $145=$144;\n var $146=(($145)|0);\n HEAP32[(($146)>>2)]=$138;\n var $147=$47;\n $24=$49;\n $25=$147;\n var $148=$24;\n var $149=$25;\n var $150=(($148)|0);\n $23=$150;\n var $151=$23;\n var $152=$151;\n $22=$152;\n var $153=$22;\n var $154=(($153)|0);\n var $155=(($154)|0);\n var $156=$155;\n var $157=(($156+4)|0);\n HEAP32[(($157)>>2)]=$149;\n label = 9; break;\n case 9: \n var $159=$__p;\n var $160=$46;\n var $161=$47;\n $30=$159;\n $31=$160;\n $32=$161;\n var $162=$30;\n var $163=$31;\n var $164=$32;\n var $165=_wmemcpy($162, $163, $164);\n var $166=$47;\n var $167=$__p;\n var $168=(($167+($166<<2))|0);\n HEAP32[(($48)>>2)]=0;\n $33=$168;\n $34=$48;\n var $169=$34;\n var $170=HEAP32[(($169)>>2)];\n var $171=$33;\n HEAP32[(($171)>>2)]=$170;\n STACKTOP = __stackBase__;\n return;\n default: assert(0, \"bad label: \" + label);\n }\n}", "title": "" }, { "docid": "d3dce8bbb627b60fa8de1cdeef5e2c63", "score": "0.52545613", "text": "function he(e){\n// Use a string member so Uglify doesn't mangle it.\nvar t=e[me];if(t)return t;for(var n=e.ownerDocument.defaultView,r=0,i=0;i<ge.length;i++){var o=ge[i];l(o)?e instanceof n[o]&&(r|=1<<i):e instanceof o&&(r|=1<<i)}\n// Use an intermediate object so it errors on incorrect data.\nvar a={types:r,count:0,computedStyle:null,cache:{},queueList:{},lastAnimationList:{},lastFinishList:{},window:n};return Object.defineProperty(e,me,{value:a}),a}", "title": "" }, { "docid": "3b8dfa3013d8eb635a9504db98e37de8", "score": "0.5251954", "text": "function Module(stdlib) {\n \"use asm\";\n\n function f(a, b, c) {\n a = +a;\n b = +b;\n c = +c;\n var r = 0.0;\n r = a / b * c;\n return +r;\n }\n\n return {\n f: f\n };\n}", "title": "" }, { "docid": "b1394758ec2d7d58772f1918bb93b254", "score": "0.5249312", "text": "function __ZNSt3__112_GLOBAL__N_14makeINS_8messagesIcEEjEERT_T0_($a0) {\n var label = 0;\n label = 1; \n while(1) switch(label) {\n case 1: \n var $1;\n var $2;\n var $3;\n var $4;\n var $5;\n var $6;\n var $7;\n var $8;\n var $9;\n var $10;\n var $11;\n var $12;\n $12=$a0;\n if (0) { var $33 = 0;label = 3; break; } else { label = 2; break; }\n case 2: \n var $14=$12;\n $10=9920;\n $11=$14;\n var $15=$10;\n var $16=$11;\n $6=$15;\n $7=$16;\n var $17=$6;\n var $18=$17;\n var $19=$7;\n $4=$18;\n $5=$19;\n var $20=$4;\n var $21=$20;\n var $22=$5;\n var $23=((($22)-(1))|0);\n $2=$21;\n $3=$23;\n var $24=$2;\n var $25=$24;\n HEAP32[(($25)>>2)]=((13000)|0);\n var $26=(($24+4)|0);\n var $27=$3;\n HEAP32[(($26)>>2)]=$27;\n var $28=$20;\n HEAP32[(($28)>>2)]=((12344)|0);\n var $29=$17;\n $1=$29;\n var $30=$1;\n var $31=$17;\n HEAP32[(($31)>>2)]=((11672)|0);\n var $33 = 9920;label = 3; break;\n case 3: \n var $33;\n return 9920;\n default: assert(0, \"bad label: \" + label);\n }\n}", "title": "" }, { "docid": "fbb2068b26758eea277644d73aa35866", "score": "0.5222709", "text": "function foo () { return 1 }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "45cba8b62c928db848e214faf18c602a", "score": "0.52188534", "text": "__init2() {this.noAnonFunctionType = false}", "title": "" }, { "docid": "5412cbec186d84761f7c0bb74ddbad34", "score": "0.5214271", "text": "function __func(){}", "title": "" }, { "docid": "a26e3b1d4af14e57b0e23da1be989866", "score": "0.5208191", "text": "function $2() {\n // const start2 = Date.now();\n var $0_1 = 0, $2_1 = 0, $1_1 = 0, $3_1 = 0;\n $2_1 = global$0 - 4194304 | 0;\n global$0 = $2_1;\n $1_1 = $2_1;\n label$1 : while (1) {\n HEAP8[$1_1 >> 0] = $0_1;\n $3_1 = $0_1 + 1 | 0;\n HEAP8[($1_1 + 1 | 0) >> 0] = Math_imul($3_1, $0_1);\n HEAP8[($1_1 + 2 | 0) >> 0] = Math_imul($0_1 + Math_imul(($0_1 >>> 0) / (5 >>> 0) | 0, -5) | 0, $0_1);\n $1_1 = $1_1 + 3 | 0;\n $0_1 = $3_1;\n if (($0_1 | 0) != (1048576 | 0)) {\n continue label$1\n }\n break label$1;\n };\n $1($2_1 | 0, $2_1 + 3145728 | 0 | 0, 1048576 | 0);\n global$0 = $2_1 + 4194304 | 0;\n // const end2 = Date.now();\n // print(\"init + compute\");\n // print(end2 - start2);\n return 0 | 0;\n }", "title": "" }, { "docid": "745fb6a4af7879aef457f924e5e31df4", "score": "0.51998925", "text": "function _StaticizeOptimizeCommand() {\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "38bd3d29be4ab8625b5475318ffa0e0d", "score": "0.5192007", "text": "function foo() { return 'foo' }", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "a3585382d7eae0ce449567e773a4950c", "score": "0.51880723", "text": "function IMPLEMENTS(_) {\r\n return function (t) { return t; };\r\n}", "title": "" }, { "docid": "3633ba3e7468a1854940eea145535382", "score": "0.51852965", "text": "function generateScriptCodes() {\n var ret = '';\n \n ret += 'function traverseWatchedObjects(configObject, targetObject, trail) {';\n \n ret += ' var resultObject = [];';\n\n ret += ' if (configObject && targetObject && typeof configObject == \"object\" && typeof targetObject == \"object\") {';\n\n ret += ' for (var k in configObject) {';\n\n ret += ' if (k && configObject.hasOwnProperty(k) && targetObject.hasOwnProperty(k)) {';\n ret += ' var currentTrail = trail.slice();';\n ret += ' currentTrail.push(k);';\n\n ret += ' var configValue = configObject[k];';\n ret += ' var targetValue = targetObject[k];';\n\n ret += ' if (typeof configValue == \"object\") {';\n ret += ' deepResult = traverseWatchedObjects(configValue, targetValue, currentTrail);';\n\n ret += ' if (typeof deepResult == \"object\") {';\n ret += ' for (var i in deepResult) {';\n ret += ' if (deepResult.hasOwnProperty(i)) {';\n ret += ' resultObject.push(deepResult[i]);';\n ret += ' }';\n ret += ' }';\n ret += ' }';\n ret += ' } else {';\n ret += ' var elementValue = \"[Object]\";';\n\n ret += ' if (typeof targetValue !== \"object\") {';\n ret += ' elementValue = targetValue;';\n ret += ' }';\n\n ret += ' resultObject.push([currentTrail, elementValue]);';\n ret += ' }';\n ret += ' }';\n ret += ' }';\n ret += ' }';\n ret += ' return resultObject;';\n ret += '}';\n\n return ret;\n}", "title": "" }, { "docid": "e676b16604be2a8b2f481f0fa3830429", "score": "0.51833797", "text": "function genCacheStateFunctions(ops) {\n var preamble = \"global = (function () { return this; })();\\n\";\n \n for (var i = 0; i < ops.length; i+=2) {\n var name = ops[i];\n var Name = ops[i][0].toUpperCase() + ops[i].slice(1);\n var scalarOp = ops[i+1];\n preamble += \n \"function init\" + Name + \"(name,x,y) {\\n\" +\n \" if ((typeof x) === 'number' && (typeof y) === 'number') {\\n\" + \n \" global[name] = scalar\" + Name + \";\\n\" + \n \" }\\n\" + \n \" return _McLib.\" + name + \"(x,y);\\n\" +\n \"}\\n\" +\n \"function scalar\" + Name + \"(name,x,y) {\\n\" + \n \" if ((typeof x) === 'number' && (typeof y) === 'number') {\\n\" + \n \" return x \" + scalarOp + \" y;\\n\" + \n \" }\\n\" + \n \" \\n\" + \n \" global[name] = generic\" + Name + \";\\n\" + \n \" return _McLib.\" + name + \"(x,y);\\n\" + \n \"}\\n\" + \n \"function generic\" + Name + \"(name,x,y) {\\n\" + \n \" return _McLib.\" + name + \"(x,y);\\n\" + \n \"}\\n\";\n }\n\n function genArgs(nb) {\n var id = \"x\";\n var args = [];\n for (var i=0; i<nb; ++i) {\n args.push(id+i);\n } \n return args;\n }\n\n function genFnCallWithArgs(name,args) {\n return name + \"(\" + args.join(\",\") + \")\";\n }\n \n function genArrayAccessWithArgs(name,args) {\n if (args.length < 1) \n return name; \n args = args.map(function (x) { return x + \"-1\"; });\n return name + \"[\" + args.join(\"][\") + \"]\";\n }\n\n var exprType = \"ParamExpr\";\n for (var argNb=0; argNb<2; ++argNb) {\n var Name = exprType + argNb + \"_\";\n var args = genArgs(argNb);\n var argsStr = [\"name\",\"target\"].concat(args).join(\",\");\n preamble +=\n \"function init\" + Name + \"(\" + argsStr + \") {\\n\" +\n \" if ((typeof target) === 'function') {\\n\" + \n \" global[name] = fn\" + Name + \";\\n\" + \n \" return \" + genFnCallWithArgs(\"target\",args) + \";\\n\" +\n \" } else {\\n\" + \n \" global[name] = array\" + Name +\";\\n\" + \n \" return \" + genArrayAccessWithArgs(\"target\",args) + \";\\n\" +\n \" }\\n\" + \n \"}\\n\" +\n \"function fn\" + Name + \"(\" + argsStr + \") {\\n\" + \n \" if ((typeof target) === 'function') {\\n\" + \n \" return \" + genFnCallWithArgs(\"target\",args) + \";\\n\" +\n \" }\\n\" + \n \" \\n\" + \n \" global[name] = generic\" + Name + \";\\n\" + \n \" return generic\" + Name + \"(\" + argsStr + \");\\n\" + \n \"}\\n\" + \n \"function array\" + Name + \"(\" + argsStr + \") {\\n\" + \n \" if ((typeof target) !== 'function') {\\n\" + \n \" return \" + genArrayAccessWithArgs(\"target\",args) + \";\\n\" +\n \" }\\n\" + \n \" \\n\" + \n \" global[name] = generic\" + Name + \";\\n\" + \n \" return generic\" + Name + \"(\" + argsStr + \");\\n\" + \n \"}\\n\" + \n \"function generic\" + Name + \"(name,target\" + args +\") {\\n\" +\n \" if ((typeof target) === 'function') {\\n\" + \n \" return \" + genFnCallWithArgs(\"target\",args) + \";\\n\" +\n \" } else {\\n\" + \n \" return \" + genArrayAccessWithArgs(\"target\",args) + \";\\n\" +\n \" }\\n\" + \n \"}\\n\";\n }\n return preamble;\n}", "title": "" }, { "docid": "7cf8f49eb4b6e5d60f3544793086acdd", "score": "0.51784235", "text": "function ExpandoInstructions() {}", "title": "" }, { "docid": "7cf8f49eb4b6e5d60f3544793086acdd", "score": "0.51784235", "text": "function ExpandoInstructions() {}", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.5173437", "text": "function func() {}", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.5173437", "text": "function func() {}", "title": "" }, { "docid": "a750066c8ec806fdc9766aeb00f67cbb", "score": "0.5172739", "text": "function asmModule(stdlib, imports, buffer) {\r\n \"use asm\";\r\n\r\n var log = stdlib.Math.log;\r\n var toF = stdlib.Math.fround;\r\n var imul = stdlib.Math.imul;\r\n\r\n var i4 = stdlib.SIMD.Int32x4;\r\n var i4store = i4.store;\r\n var i4load = i4.load\r\n var i4swizzle = i4.swizzle;\r\n var i4check = i4.check;\r\n var i4add = i4.add;\r\n var i4sub = i4.sub;\r\n var i4lessThan = i4.lessThan;\r\n var i4splat = i4.splat;\r\n\r\n var f4 = stdlib.SIMD.Float32x4;\r\n var f4equal = f4.equal;\r\n var f4lessThan = f4.lessThan;\r\n var f4splat = f4.splat;\r\n var f4store = f4.store;\r\n var f4load = f4.load;\r\n var f4check = f4.check;\r\n var f4abs = f4.abs;\r\n var f4add = f4.add;\r\n var f4sub = f4.sub;\r\n\r\n var Float32Heap = new stdlib.Float32Array(buffer);\r\n var Int32Heap = new stdlib.Int32Array(buffer);\r\n var BLOCK_SIZE = 4;\r\n\r\n function matrixMultiplication(aIndex, bIndex, cIndex) {\r\n aIndex = aIndex|0;\r\n bIndex = bIndex|0;\r\n cIndex = cIndex|0;\r\n\r\n var i = 0, j = 0, dim1 = 0, dim2 = 0, intersectionNum = 0, matrixSize = 0;\r\n\r\n var newPiece = i4(0, 0, 0, 0), cPiece = i4(0, 0, 0, 0);\r\n\r\n //array dimensions don't match\r\n if((Int32Heap[aIndex + 1 << 2 >> 2]|0) != (Int32Heap[bIndex << 2 >> 2]|0)) {\r\n return -1;\r\n }\r\n\r\n dim1 = Int32Heap[aIndex << 2 >> 2]|0;\r\n dim2 = Int32Heap[bIndex + 1 << 2 >> 2]|0;\r\n intersectionNum = Int32Heap[bIndex << 2 >> 2]|0;\r\n matrixSize = imul(dim1, dim2);\r\n\r\n Int32Heap[cIndex << 2 >> 2] = dim1;\r\n Int32Heap[cIndex + 1 << 2 >> 2] = dim2;\r\n\r\n while((i|0) < (matrixSize|0)) {\r\n cPiece = i4(0, 0, 0, 0);\r\n j = 0;\r\n while( (j|0) < (intersectionNum|0)) {\r\n newPiece = i4((getIntersectionPiece(aIndex, bIndex, dim2, i, 0, j)|0),\r\n (getIntersectionPiece(aIndex, bIndex, dim2, i, 1, j)|0),\r\n (getIntersectionPiece(aIndex, bIndex, dim2, i, 2, j)|0),\r\n (getIntersectionPiece(aIndex, bIndex, dim2, i, 3, j)|0));\r\n cPiece = i4add(cPiece, newPiece);\r\n j = (j + 1)|0;\r\n }\r\n i4store(Int32Heap, cIndex + 2 + i << 2 >> 2, cPiece);\r\n\r\n i = (i + BLOCK_SIZE)|0;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n function getIntersectionPiece(aIndex, bIndex, dim2, resultBlock, resultIndex, intersectionNum) {\r\n aIndex = aIndex|0;\r\n bIndex = bIndex|0;\r\n dim2 = dim2|0;\r\n resultBlock = resultBlock|0;\r\n resultIndex = resultIndex|0;\r\n intersectionNum = intersectionNum|0;\r\n var aElem = 0, bElem = 0, cElem = 0;\r\n\r\n aElem = (getElement(aIndex, ((resultBlock|0) / (dim2|0))|0, intersectionNum))|0;\r\n bElem = (getElement(bIndex, intersectionNum, (resultBlock + resultIndex)|0))|0;\r\n\r\n return (aElem * bElem)|0;\r\n }\r\n\r\n function getElement(start, row, column) {\r\n start = start|0;\r\n row = row|0;\r\n column = column|0;\r\n var dim1 = 0, dim2 = 0;\r\n\r\n dim2 = Int32Heap[start << 2 >> 2]|0;\r\n dim1 = Int32Heap[start + 1 << 2 >> 2]|0;\r\n return (Int32Heap[(start + 2 + imul(row, dim1) + column) << 2 >> 2])|0;\r\n\r\n }\r\n\r\n function new2DMatrix(startIndex, dim1, dim2) {\r\n startIndex = startIndex|0;\r\n dim1 = dim1|0;\r\n dim2 = dim2|0;\r\n\r\n var i = 0, matrixSize = 0;\r\n matrixSize = imul(dim1, dim2);\r\n Int32Heap[startIndex << 2 >> 2] = dim1;\r\n Int32Heap[startIndex + 1 << 2 >> 2] = dim2;\r\n for(i = 0; (i|0) < ((matrixSize - BLOCK_SIZE)|0); i = (i + BLOCK_SIZE)|0) {\r\n i4store(Int32Heap, startIndex + 2 + i << 2 >> 2, i4((i+1), (i+2), (i+3), (i+4)));\r\n }\r\n for(; (i|0) < (matrixSize|0); i = (i + 1)|0) {\r\n Int32Heap[(startIndex + 2 + i) << 2 >> 2] = (i+1)|0;\r\n }\r\n return (startIndex + 2 + i)|0;\r\n }\r\n\r\n return {new2DMatrix: new2DMatrix,\r\n matrixMultiplication:matrixMultiplication};\r\n}", "title": "" }, { "docid": "ad36b610ff1f8e3e058e1ddbe507518a", "score": "0.51648253", "text": "function es5_fix_extend_builtins() {\n return (context) => (root) => {\n const { factory } = context;\n function visit(node) {\n if (ts.isFunctionDeclaration(node)) {\n if (node.name != null && node.name.text.endsWith(\"NDArray\") && node.body != null) {\n const [stmt, ...rest] = node.body.statements;\n if (ts.isVariableStatement(stmt) && stmt.declarationList.declarations.length == 1) {\n const [decl] = stmt.declarationList.declarations;\n if (ts.isIdentifier(decl.name) && decl.name.text == \"_this\" && decl.initializer != null) {\n const init = factory.createNewExpression(factory.createIdentifier(\"_super\"), undefined, [factory.createIdentifier(\"seq\")]);\n const decl_new = factory.updateVariableDeclaration(decl, decl.name, decl.exclamationToken, decl.type, init);\n const decls_new = factory.updateVariableDeclarationList(stmt.declarationList, [decl_new]);\n const stmt_new = factory.updateVariableStatement(stmt, stmt.modifiers, decls_new);\n const body = factory.createBlock([stmt_new, ...rest], true);\n const constructor = factory.updateFunctionDeclaration(node, node.decorators, node.modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, body);\n return constructor;\n }\n }\n }\n }\n return ts.visitEachChild(node, visit, context);\n }\n return ts.visitNode(root, visit);\n };\n}", "title": "" }, { "docid": "fdf58d1b4574601262d04038dbba1607", "score": "0.5159504", "text": "function skdzdrHL2Te9uAFMbXAqvw(){}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "ec6587fa014637387de2f3fede971873", "score": "0.51517266", "text": "function xS(t,e,n,i,r,o,a,s){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"source.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "8fd7ac988e3c9ded6a956c0e0a0ce70b", "score": "0.5147705", "text": "function Module(stdlib, imports, buffer) {\n \"use asm\";\n\n function f() {\n var bar = 0;\n return 0x1e + bar | 0;\n }\n\n return f;\n}", "title": "" }, { "docid": "ef7453d311c3f7406ba7d25f483d706f", "score": "0.5143248", "text": "function bN(t,e,n,i,r,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,l}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.5128631", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.5128631", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.5128631", "text": "function dummy() {}", "title": "" }, { "docid": "fae46126c94214e6d29b32b98b500b3e", "score": "0.5119885", "text": "function RiotCompiler() {}", "title": "" }, { "docid": "c4ca5cee3edb6db4d5333f31ca7d6ae6", "score": "0.51014084", "text": "function script_compile(script, onmsg) {\n var r = '', scriptlines = script.split('\\n'), labels = {}, labelswap = [], swaps = [];\n // Go thru each script line and encode it\n for (var i in scriptlines) {\n var scriptline = scriptlines[i];\n if (scriptline.startsWith('##SWAP ')) { var x = scriptline.split(' '); if (x.length == 3) { swaps[x[1]] = x[2]; } } // Add a swap instance\n if (scriptline[0] == '#' || scriptline.length == 0) continue; // Skip comments & blank lines\n for (var x in swaps) { scriptline = scriptline.split(x).join(swaps[x]); } // Apply all swaps\n var keywords = scriptline.match(/\"[^\"]*\"|[^\\s\"]+/g);\n if (keywords.length == 0) continue; // Skip blank lines\n if (scriptline[0] == ':') { labels[keywords[0].toUpperCase()] = r.length; continue; } // Mark a label position\n var funcIndex = script_functionTable1.indexOf(keywords[0].toLowerCase());\n if (funcIndex == -1) { funcIndex = script_functionTable2.indexOf(keywords[0].toLowerCase()); if (funcIndex >= 0) funcIndex += 10000; }\n if (funcIndex == -1) { funcIndex = script_functionTable3.indexOf(keywords[0].toLowerCase()); if (funcIndex >= 0) funcIndex += 20000; } // Optional methods\n if (funcIndex == -1) { if (onmsg) { onmsg(\"Unabled to compile, unknown command: \" + keywords[0]); } return ''; }\n // Encode CommandId, CmdSize, ArgCount, Arg1Len, Arg1, Arg2Len, Arg2...\n var cmd = ShortToStr(keywords.length - 1);\n for (var j in keywords) {\n if (j == 0) continue;\n if (keywords[j][0] == ':') {\n labelswap.push([keywords[j], r.length + cmd.length + 7]); // Add a label swap\n cmd += ShortToStr(5) + String.fromCharCode(3) + IntToStr(0xFFFFFFFF); // Put an empty label\n } else {\n var argint = parseInt(keywords[j]);\n if (argint == keywords[j]) {\n cmd += ShortToStr(5) + String.fromCharCode(2) + IntToStr(argint);\n } else {\n if (keywords[j][0] == '\"' && keywords[j][keywords[j].length - 1] == '\"') {\n cmd += ShortToStr(keywords[j].length - 1) + String.fromCharCode(1) + keywords[j].substring(1, keywords[j].length - 1);\n } else {\n cmd += ShortToStr(keywords[j].length + 1) + String.fromCharCode(0) + keywords[j];\n }\n }\n }\n }\n cmd = ShortToStr(funcIndex) + ShortToStr(cmd.length + 4) + cmd;\n r += cmd;\n }\n // Perform all the needed label swaps\n for (i in labelswap) {\n var label = labelswap[i][0].toUpperCase(), position = labelswap[i][1], target = labels[label];\n if (target == undefined) { if (onmsg) { onmsg(\"Unabled to compile, unknown label: \" + label); } return ''; }\n r = r.substr(0, position) + IntToStr(target) + r.substr(position + 4);\n }\n return IntToStr(0x247D2945) + ShortToStr(1) + r;\n}", "title": "" }, { "docid": "6ad9932bfd769e30605b4eec1a496c71", "score": "0.5099541", "text": "renderChunk(code, chunk, opts) {\n if (opts.format === 'umd') {\n // minified:\n code = code.replace(\n /([a-zA-Z$_]+)=\"undefined\"!=typeof globalThis\\?globalThis:(\\1\\|\\|self)/,\n '$2'\n );\n // unminified:\n code = code.replace(\n /(global *= *)typeof +globalThis *!== *['\"]undefined['\"] *\\? *globalThis *: *(global *\\|\\| *self)/,\n '$1$2'\n );\n return { code, map: null };\n }\n }", "title": "" }, { "docid": "7bba19ab72d7b0fba2c9fe8526915822", "score": "0.5075956", "text": "function foo() { }", "title": "" }, { "docid": "7bba19ab72d7b0fba2c9fe8526915822", "score": "0.5075956", "text": "function foo() { }", "title": "" }, { "docid": "af9e21b4123ebb23326aba313f582543", "score": "0.5075873", "text": "function c$1t({code:c},i){i.doublePrecisionRequiresObfuscation?c.add(n$1x`vec3 dpPlusFrc(vec3 a, vec3 b) {\nreturn mix(a, a + b, vec3(notEqual(b, vec3(0))));\n}\nvec3 dpMinusFrc(vec3 a, vec3 b) {\nreturn mix(vec3(0), a - b, vec3(notEqual(a, b)));\n}\nvec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {\nvec3 t1 = dpPlusFrc(hiA, hiB);\nvec3 e = dpMinusFrc(t1, hiA);\nvec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;\nreturn t1 + t2;\n}`):c.add(n$1x`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {\nvec3 t1 = hiA + hiB;\nvec3 e = t1 - hiA;\nvec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;\nreturn t1 + t2;\n}`);}", "title": "" }, { "docid": "cff0e3eac1b9d2363b0275607ec6429c", "score": "0.5072603", "text": "function Module(stdlib) {\n \"use asm\";\n function TernaryMin(a, b) {\n a=+(a);\n b=+(b);\n return (+((a < b) ? a : b));\n }\n function TernaryMax(a, b) {\n a=+(a);\n b=+(b);\n return (+((b < a) ? a : b));\n }\n return { TernaryMin: TernaryMin,\n TernaryMax: TernaryMax };\n}", "title": "" }, { "docid": "6c10cbe0efc9b1e71756dd34897b2611", "score": "0.5072206", "text": "function decompile(fun, env) {\n logc(\"decompile\", fun.name);\n increment(\"decompile\");\n\n if(!(fun instanceof Function))\n throw new TypeError(\"fun\");\n if(!(env instanceof Object))\n throw new TypeError(\"env\");\n\n // Decompile ?\n if(!(__decompile__))\n return fun;\n\n // Note: Roman Matthias Keil\n // * use strict mode only\n // var body = \"(\" + fun.toString() + \")\"; \n // var sbxed = eval(\"(function() { with(env) { return \" + body + \" }})();\");\n\n try {\n var body = \"(function() {'use strict'; return \" + (\"(\" + fun.toString() + \")\") + \"})();\";\n var sbxed = eval(\"(function() { with(env) { return \" + body + \" }})();\");\n return sbxed;\n } catch(error) {\n throw new SyntaxError(\"Incompatible function object.\" + \"\\n\" + fun);\n } \n }", "title": "" } ]
4d967537e71f9425ca58496c1e657387
MutationObserver to detect title element changes (e.g. youtube and other ajax sites) NOTE: This slows down the page
[ { "docid": "40e499f1844dc181d6345438d8827067", "score": "0.79313445", "text": "function addMutationObserver() {\n\t\ttry {\n\t\t\t// allow offline\n\t\t\tif (Page.data.mode.notActive) return;\n\t\t\t// don't allow if mode disabled\n\t\t\tif (T.tally_options.gameMode === \"disabled\") return;\n\n\t\t\tnew MutationObserver(function(mutations) {\n\t\t\t\tif (DEBUG) console.log(\"title changed\", mutations[0].target.nodeValue);\n\t\t\t\trestartAfterMutation(\"🗒 Page.addMutationObserver()\");\n\t\t\t}).observe(\n\t\t\t\tdocument.querySelector('title'), {\n\t\t\t\t\tsubtree: true,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t\tchildList: true\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "26f62095578630617cdc82484b0bc801", "score": "0.86134845", "text": "function registerTitleMutationObserver() {\r\n const observer = new window.MutationObserver(\r\n (mutations, observer) => requestUpdateTitle());\r\n observer.observe(\r\n document.head,\r\n {\r\n subtree: true,\r\n childList: true,\r\n });\r\n}", "title": "" }, { "docid": "acdc9b32686f8b52f2ce1e14984a872c", "score": "0.75116384", "text": "function addTitleChecker() {\n\t\ttry {\n\t\t\tlet pageTitleInterval = setInterval(function() {\n\t\t\t\tlet title = getTitle();\n\t\t\t\tif (title != data.title) {\n\t\t\t\t\t//if (DEBUG) console.log(\"title changed\", Page.data.title, \" to: \",title);\n\t\t\t\t\trestartAfterMutation(\"🗒 Page.addTitleChecker()\");\n\t\t\t\t} else {\n\t\t\t\t\t//if (DEBUG) console.log(\"title is same\", Page.data.title, \" to: \",title);\n\t\t\t\t}\n\t\t\t}, 10000);\n\t\t} catch (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t}", "title": "" }, { "docid": "2cbdff5a475e37487b6ed1fad387777e", "score": "0.7199234", "text": "function updateTitle() {\n let oldTitle = content.html();\n let newTitle = node.getTitle();\n if (oldTitle != newTitle) {\n content.html(newTitle);\n }\n }", "title": "" }, { "docid": "744bf13fb23a5090f8933ee25aa8d4d3", "score": "0.6975498", "text": "function walkAndObserve(doc) {\n var docTitle = doc.getElementsByTagName('title')[0],\n observerConfig = {\n characterData: true,\n childList: true,\n subtree: true\n },\n bodyObserver, titleObserver;\n\n // Do the initial text replacements in the document body and title\n walk(doc.body);\n doc.title = replaceText(doc.title);\n\n // Observe the body so that we replace text in any added/modified nodes\n bodyObserver = new MutationObserver(observerCallback);\n bodyObserver.observe(doc.body, observerConfig);\n\n // Observe the title so we can handle any modifications there\n if (docTitle) {\n titleObserver = new MutationObserver(observerCallback);\n titleObserver.observe(docTitle, observerConfig);\n }\n}", "title": "" }, { "docid": "744bf13fb23a5090f8933ee25aa8d4d3", "score": "0.6975498", "text": "function walkAndObserve(doc) {\n var docTitle = doc.getElementsByTagName('title')[0],\n observerConfig = {\n characterData: true,\n childList: true,\n subtree: true\n },\n bodyObserver, titleObserver;\n\n // Do the initial text replacements in the document body and title\n walk(doc.body);\n doc.title = replaceText(doc.title);\n\n // Observe the body so that we replace text in any added/modified nodes\n bodyObserver = new MutationObserver(observerCallback);\n bodyObserver.observe(doc.body, observerConfig);\n\n // Observe the title so we can handle any modifications there\n if (docTitle) {\n titleObserver = new MutationObserver(observerCallback);\n titleObserver.observe(docTitle, observerConfig);\n }\n}", "title": "" }, { "docid": "744bf13fb23a5090f8933ee25aa8d4d3", "score": "0.6975498", "text": "function walkAndObserve(doc) {\n var docTitle = doc.getElementsByTagName('title')[0],\n observerConfig = {\n characterData: true,\n childList: true,\n subtree: true\n },\n bodyObserver, titleObserver;\n\n // Do the initial text replacements in the document body and title\n walk(doc.body);\n doc.title = replaceText(doc.title);\n\n // Observe the body so that we replace text in any added/modified nodes\n bodyObserver = new MutationObserver(observerCallback);\n bodyObserver.observe(doc.body, observerConfig);\n\n // Observe the title so we can handle any modifications there\n if (docTitle) {\n titleObserver = new MutationObserver(observerCallback);\n titleObserver.observe(docTitle, observerConfig);\n }\n}", "title": "" }, { "docid": "744bf13fb23a5090f8933ee25aa8d4d3", "score": "0.6975498", "text": "function walkAndObserve(doc) {\n var docTitle = doc.getElementsByTagName('title')[0],\n observerConfig = {\n characterData: true,\n childList: true,\n subtree: true\n },\n bodyObserver, titleObserver;\n\n // Do the initial text replacements in the document body and title\n walk(doc.body);\n doc.title = replaceText(doc.title);\n\n // Observe the body so that we replace text in any added/modified nodes\n bodyObserver = new MutationObserver(observerCallback);\n bodyObserver.observe(doc.body, observerConfig);\n\n // Observe the title so we can handle any modifications there\n if (docTitle) {\n titleObserver = new MutationObserver(observerCallback);\n titleObserver.observe(docTitle, observerConfig);\n }\n}", "title": "" }, { "docid": "744bf13fb23a5090f8933ee25aa8d4d3", "score": "0.6975498", "text": "function walkAndObserve(doc) {\n var docTitle = doc.getElementsByTagName('title')[0],\n observerConfig = {\n characterData: true,\n childList: true,\n subtree: true\n },\n bodyObserver, titleObserver;\n\n // Do the initial text replacements in the document body and title\n walk(doc.body);\n doc.title = replaceText(doc.title);\n\n // Observe the body so that we replace text in any added/modified nodes\n bodyObserver = new MutationObserver(observerCallback);\n bodyObserver.observe(doc.body, observerConfig);\n\n // Observe the title so we can handle any modifications there\n if (docTitle) {\n titleObserver = new MutationObserver(observerCallback);\n titleObserver.observe(docTitle, observerConfig);\n }\n}", "title": "" }, { "docid": "d9e43ae10fc86a8ca129afd0774f97a9", "score": "0.6921072", "text": "function walkAndObserve(doc) {\n const docTitle = doc.getElementsByTagName('title')[0];\n const observerConfig = {\n characterData: true,\n childList: true,\n subtree: true\n };\n\n // Do the initial text replacements in the document body and title\n walk(doc.body);\n doc.title = replaceText(doc.title);\n\n // Observe the body so that we replace text in any added/modified nodes\n const bodyObserver = new MutationObserver(observerCallback);\n bodyObserver.observe(doc.body, observerConfig);\n\n // Observe the title so we can handle any modifications there\n if (docTitle) {\n const titleObserver = new MutationObserver(observerCallback);\n titleObserver.observe(docTitle, observerConfig);\n }\n}", "title": "" }, { "docid": "8ec59a450c7c69bc43a9a749008cb2d2", "score": "0.69050276", "text": "function walkAndObserve (doc) {\n var docTitle = doc.getElementsByTagName('title')[0],\n observerConfig = {\n characterData: true,\n childList: true,\n subtree: true\n },\n bodyObserver, titleObserver;\n\n // Do the initial text replacements in the document body and title\n walk(doc.body);\n doc.title = replaceText(doc.title);\n\n // Observe the body so that we replace text in any added/modified nodes\n bodyObserver = new MutationObserver(observerCallback);\n bodyObserver.observe(doc.body, observerConfig);\n\n // Observe the title so we can handle any modifications there\n if (docTitle) {\n titleObserver = new MutationObserver(observerCallback);\n titleObserver.observe(docTitle, observerConfig);\n }\n}", "title": "" }, { "docid": "6435c9813841fd879fb8cce470f211fa", "score": "0.68948567", "text": "function waitTitleChanged() {\n setTimeout(function () {\n if (oldTitle !== document.title) {\n resolve()\n } else {\n waitTitleChanged()\n }\n }, 50)\n }", "title": "" }, { "docid": "6b635a7ee29158bce2a695a91e11577c", "score": "0.6873797", "text": "onTitleChanged() {\n if (this._titleChanged) {\n this._titleChanged.raise();\n }\n this.onFieldValueChanged('title', this.title);\n }", "title": "" }, { "docid": "4e8a1cb9b7646fa7e51091b50af223ca", "score": "0.6839469", "text": "function titleChange() { updateVis(); }", "title": "" }, { "docid": "c30a91303c795d1ca908bbe74e661ede", "score": "0.66126716", "text": "function updateTitle() {\n ;\n }", "title": "" }, { "docid": "fb36ad9230e54687ec8e58992ddda918", "score": "0.6570837", "text": "updateTitleTime() {\n this.DOM_ELEMENTS.title.innerHTML = this.getTitleTimeString();\n }", "title": "" }, { "docid": "32f770f848d69195784192e1eabd76be", "score": "0.6541612", "text": "_setUpTitleListener(aTab) {\n function onDOMTitleChanged(aEvent) {\n aTab.title = aTab.browser.contentTitle;\n document.getElementById(\"tabmail\").setTabTitle(aTab);\n }\n // Save the function we'll use as listener so we can remove it later.\n aTab.titleListener = onDOMTitleChanged;\n // Add the listener.\n aTab.browser.addEventListener(\"pagetitlechanged\", aTab.titleListener, true);\n }", "title": "" }, { "docid": "f218b028f12c1ab4cb7b7c258ba3b59d", "score": "0.6538905", "text": "_updateTitle() {\n if (this._changeGuard || !this.content) {\n return;\n }\n this._changeGuard = true;\n const content = this.content;\n this.title.label = content.title.label;\n this.title.mnemonic = content.title.mnemonic;\n this.title.iconClass = content.title.iconClass;\n this.title.iconLabel = content.title.iconLabel;\n this.title.iconRenderer = content.title.iconRenderer;\n this.title.caption = content.title.caption;\n this.title.className = content.title.className;\n this.title.dataset = content.title.dataset;\n this._changeGuard = false;\n }", "title": "" }, { "docid": "5de6ab204918f1e8d309fbcdd551b76b", "score": "0.6519831", "text": "function adjustTitle(title) {\n\t$('#title').val(title).change();\n\tvar event = new UIEvent('change');\n\tdocument.getElementById('title').dispatchEvent(event);\n}", "title": "" }, { "docid": "9c713b15e592cf05469752e2d023b7a7", "score": "0.64967597", "text": "_titleUpdate() {\r\n this.title = this.el.querySelector(\".slider-menu h1\");\r\n this.title.innerText = this.images[this.cpt].title;\r\n }", "title": "" }, { "docid": "273f433121c93b604411c2957c9d4788", "score": "0.6465856", "text": "onTitleScreenUpdates(callback) {\n this.on('update_titlescreen', callback);\n }", "title": "" }, { "docid": "926dcc8d424fed0f08b5d72d5d6e11d9", "score": "0.63906676", "text": "set title(value) {\n var changed = value !== this._title;\n this._title = value;\n if (changed) {\n this.onTitleChanged();\n }\n }", "title": "" }, { "docid": "fde643ec6b3de324023bd88172a6607a", "score": "0.63901883", "text": "get titleChanged() {\n if (!this._titleChanged) {\n this._titleChanged = new latte.LatteEvent(this);\n }\n return this._titleChanged;\n }", "title": "" }, { "docid": "07360b566e5df801085e7e4deb3811b3", "score": "0.63286936", "text": "function updateTitle(title) {\n $window.document.title = title;\n }", "title": "" }, { "docid": "bbc9865b439d27d14725bb6541fddf09", "score": "0.63097215", "text": "_updateContentTitle() {\n if (this._changeGuard || !this.content) {\n return;\n }\n this._changeGuard = true;\n const content = this.content;\n content.title.label = this.title.label;\n content.title.mnemonic = this.title.mnemonic;\n content.title.iconClass = this.title.iconClass;\n content.title.iconLabel = this.title.iconLabel;\n content.title.iconRenderer = this.title.iconRenderer;\n content.title.caption = this.title.caption;\n content.title.className = this.title.className;\n content.title.dataset = this.title.dataset;\n this._changeGuard = false;\n }", "title": "" }, { "docid": "7a5c03173d859c0937d6db26f7f2248b", "score": "0.62739927", "text": "function rewriteTitle() {\n if(typeof(SKIP_TITLE_REWRITE) != 'undefined' && SKIP_TITLE_REWRITE)\n return;\n\n var titleDiv = document.getElementById('title-meta');\n if(titleDiv == null || titleDiv == undefined)\n return;\n\n // For the title in the Monaco masthead\n if (skin == \"monaco\" && (wgCanonicalNamespace == \"User\" || wgCanonicalNamespace == \"User_talk\")) {\n var mastheadUser = document.getElementById(\"user_masthead_head\");\n var mastheadSince = document.getElementById(\"user_masthead_since\");\n\n var titleString = '<h2>' + titleDiv.innerHTML;\n titleString += '<small id=\"user_masthead_since\">' + mastheadSince.innerHTML;\n titleString += '</small></h2>';\n \n mastheadUser.innerHTML = titleString;\n } else {\n var cloneNode = titleDiv.cloneNode(true);\n var firstHeading = getElementsByClass('firstHeading', document.getElementById('content'), 'h1')[0];\n var node = firstHeading.childNodes[0];\n\n // new, then old!\n firstHeading.replaceChild(cloneNode, node);\n cloneNode.style.display = \"inline\";\n\n var titleAlign = document.getElementById('title-align');\n firstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue;\n }\n}", "title": "" }, { "docid": "eccca584c84bc799944785f94e5daae1", "score": "0.6265139", "text": "updateTitle() {\n this.title.text = this.window.title;\n }", "title": "" }, { "docid": "c7cf5c91464b3f2894fb1defba11e94a", "score": "0.62594134", "text": "_onTitleChanged(sender) {\n this._setHeader();\n }", "title": "" }, { "docid": "0d854b1153a6a092527c6fd908bd4ea7", "score": "0.6254869", "text": "function observeTrackChanges() {\n\tvar trackProgress = document.querySelector(Track.TitleId);\n\tif( !trackProgress ) {\n\t\tsetTimeout(observeTrackChanges, preObserverUpdateInterval);\n\t\treturn;\n\t}\n\n\tsetInterval(sendTrackUpdate, 1000);\n}", "title": "" }, { "docid": "9c93a43bbc629601e79111a379cfc51f", "score": "0.62346405", "text": "onTabTitleChanged() {}", "title": "" }, { "docid": "170ea143068e545db3933b87755059fd", "score": "0.6231909", "text": "function updateTitle()\n {\n var s = my.html.title.value\n \n my.html.outputTitle.style.display = s === '' ? 'none' : 'block'\n my.html.outputTitle.innerHTML = s\n sanitizeDOM(my.html.outputTitle)\n MathJax.Hub.Queue(['Typeset', MathJax.Hub, my.html.outputTitle])\n }", "title": "" }, { "docid": "b139fd5b95340181647bf55be03a1fd2", "score": "0.6168958", "text": "function changeTitle() {\n /***\n The code below may be a little more difficult. I was not able to find\n the getVideoData() in the documentation page.\n Look at the load video functions for another way of the changing the video title\n ***/\n\n //Get the element in the HTML that will display the title of the video\n var titleElement = document.getElementById(\"video-title\");\n // Get the data of the current video\n var data = player.getVideoData();\n // Get the title from the data\n var videoTitle = data.title;\n // Set the text inside of the the titleElement to be the video title\n titleElement.innerHTML = videoTitle;\n}", "title": "" }, { "docid": "8836ac7918cd3fd2c06e7f534acec279", "score": "0.61174864", "text": "function updateTitleIfV2() {\n gimme('.eduRfi', el => {\n if (el.classList.contains('eduRfi--v2')) {\n const title = el.getAttribute('data-title');\n gimme('.entry-title', el => {\n el.innerText = title\n el.classList.add('center-text');\n });\n }\n });\n}", "title": "" }, { "docid": "6600c3d66d8c38af64e5430bd73f6c0d", "score": "0.6093969", "text": "function updateTitleFromHead (head) {\n var titleNodes = head.getElementsByTagName('title')\n assert(titleNodes.length > 0,\n 'Head component should include a <title> tag\\n' +\n 'check the function `config.head_component`')\n\n if (titleNodes && titleNodes[0].innerHTML !== '') {\n document.title = titleNodes[0].innerHTML\n }\n}", "title": "" }, { "docid": "78dee0be472a0517510c0ec5a09eb4da", "score": "0.6075001", "text": "function update_title(content)\n{\n let title = $('title');\n\n let update = title.html();\n let uPos = update.search(' - ');\n\n if (uPos !== -1) {\n update = content + update.substr(uPos);\n $(title).html(update);\n }\n}", "title": "" }, { "docid": "df9454664a6cc0c5b12b88f4b802aca1", "score": "0.6052416", "text": "function updateNewHistoryTitle() {\r\n try {\r\n this.removeEventListener(\"SSTabRestored\", updateNewHistoryTitle, true);\r\n let browser = this.linkedBrowser;\r\n if (Tabmix.isVersion(320))\r\n browser.messageManager.sendAsyncMessage(\"Tabmix:updateHistoryTitle\", {title: this.label});\r\n else {\r\n let history = browser.webNavigation.sessionHistory;\r\n Tabmix.Utils.updateHistoryTitle(history, this.label);\r\n }\r\n } catch (ex) {\r\n Tabmix.assert(ex);\r\n }\r\n }", "title": "" }, { "docid": "dc5badf95050dcbbbf148395147fadca", "score": "0.605052", "text": "function update_page_title() {\n if ($scope.params.status_message === $scope.defaults.messages.failed) {\n $window.document.title = 'Search failed';\n } else if ($scope.params.search_in_progress) {\n $window.document.title = 'Searching...';\n } else if ($scope.params.status_message === $scope.defaults.messages.done) {\n $window.document.title = 'Search done';\n } else {\n $window.document.title = 'Sequence search';\n }\n }", "title": "" }, { "docid": "e88dfe2bc93e4cb31b45135d3a5cd6d1", "score": "0.6044867", "text": "function titleNotifications(data) {\n if (data && data.length) {\n var count = (data.length < 100) ? data.length : '+99';\n document.title = count > 0 ? \"(\" + count + \") \" + originalTitle : originalTitle;\n }\n }", "title": "" }, { "docid": "5092ea161de03d8db925c3c9a5599218", "score": "0.60369444", "text": "function cp_title_visibility_changed( data ) {\n\n\t// if all went well, update element\n\tif ( data.error == 'success' ) {\n\t\tif ( data.toggle == 'show' ) {\n\t\t\tjQuery( 'h2.post_title' ).show();\n\t\t} else {\n\t\t\tjQuery( 'h2.post_title' ).hide();\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "eeb1398496088d2318679b8314e84b78", "score": "0.6033396", "text": "function setTitle(title) {\n const element = document.querySelector('.title-sec-cur')\n element.innerHTML = title\n }", "title": "" }, { "docid": "1bba02fb7698da32b770a2daec741130", "score": "0.6024668", "text": "function setup() {\r\n $ = jQuery = window.jQuery;\r\n\r\n title = $('title');\r\n\r\n \r\n // Sets updated title every ~5000ms.\r\n //--------------------\r\n (function runTimer() {\r\n setTimeout(function () {\r\n setTitle();\r\n runTimer();\r\n }, 5000);\r\n })();\r\n }", "title": "" }, { "docid": "2ba7c1192d15734992c6006127a91cb2", "score": "0.60228175", "text": "function updateTitle(){\n var appname = \"platform chat\";\n if (CONFIG.unread) {\n document.title = \"(\" + CONFIG.unread.toString() + \") \"+ appname;\n } else {\n document.title = appname;\n }\n }", "title": "" }, { "docid": "a688e68b0d46d18d8d6bc848ed458822", "score": "0.59665126", "text": "setTitle(title) {\n this.tit$?.unsubscribe();\n this.tit$ = of(title)\n .pipe(switchMap(tit => (tit ? of(tit) : this.getByRoute())), switchMap(tit => (tit ? of(tit) : this.getByMenu())), switchMap(tit => (tit ? of(tit) : this.getByElement())), map(tit => tit || this.default), map(title => (!Array.isArray(title) ? [title] : title)), takeUntilDestroyed(this.destroy$))\n .subscribe(titles => {\n let newTitles = [];\n if (this._prefix) {\n newTitles.push(this._prefix);\n }\n newTitles.push(...titles.filter(title => !!title));\n if (this._suffix) {\n newTitles.push(this._suffix);\n }\n if (this._reverse) {\n newTitles = newTitles.reverse();\n }\n this.title.setTitle(newTitles.join(this._separator));\n });\n }", "title": "" }, { "docid": "2e6e23f299ec8272411292138dd32e3d", "score": "0.5962794", "text": "function setTitle(title) {\n document.querySelector('h1').innerHTML = title;\n}", "title": "" }, { "docid": "8e5d4c0c162401d93d7f23ed7af91f10", "score": "0.592782", "text": "function rewriteTitle()\n {\n if(typeof(SKIP_TITLE_REWRITE) != 'undefined' && SKIP_TITLE_REWRITE)\n return;\n \n var titleDiv = document.getElementById('title-meta');\n \n if(titleDiv == null || titleDiv == undefined)\n return;\n \n var cloneNode = titleDiv.cloneNode(true);\n var firstHeading = YAHOO.util.Dom.getElementsByClassName('firstHeading', 'h1', document.getElementById('content') )[0];\n var node = firstHeading.childNodes[0];\n \n // new, then old!\n firstHeading.replaceChild(cloneNode, node);\n cloneNode.style.display = \"inline\";\n \n var titleAlign = document.getElementById('title-align');\n firstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue;\n }", "title": "" }, { "docid": "2d93f02e40d88834eca5b6163975b7d1", "score": "0.5923929", "text": "updateTitle(newTitle, newColor) {\n document.title = newTitle;\n let title = document.createElement('h4');\n title.innerText = newTitle;\n if (newColor) {\n title.style.color = newColor;\n } else {\n title.style.color = \"#ccc\";\n }\n title.style.animation = 'fadein';\n title.style.animationDuration = '5s';\n\n this.nodes.header.innerHTML = '';\n this.nodes.header.appendChild(title);\n }", "title": "" }, { "docid": "3a539999bee618a7ec24e2ddc6ad358c", "score": "0.5921764", "text": "handleSetPageTitle(name) {\n document.title = `${name} / Mass Effect Checklist`;\n }", "title": "" }, { "docid": "dc014104e5b731ef37c01c9556d8c29a", "score": "0.5917473", "text": "function setTitle(title) {\n UI.find(\"title\").innerText = title;\n}", "title": "" }, { "docid": "de35d90bf9ea8afcbc16b9fd33f0c425", "score": "0.5891194", "text": "static updateTitles() {\n const $notes = $('#notes .note');\n const $pinnedNotes = $('#pinned-notes .note');\n\n if ($notes.length) {\n $('.other-notes-title').removeClass('deactivated');\n } else {\n $('.other-notes-title').addClass('deactivated');\n }\n\n if ($pinnedNotes.length) {\n $('.pinned-notes-title').removeClass('deactivated');\n } else {\n $('.pinned-notes-title').addClass('deactivated');\n $('.other-notes-title').addClass('deactivated');\n }\n }", "title": "" }, { "docid": "a359c72489d014f2b35dd125386be6b5", "score": "0.5878515", "text": "function get_title() {\n\txmlrequest(\"get_title\",\n\t\tfunction() {\n\t\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\t\tdocument.getElementById(\"title\").innerHTML =\n\t\t\t\t\tparse_xml_from_string(this.responseText).getElementsByTagName(\"title\")[0].textContent\n\t\t\t}\n\t\t}\n\t)\n}", "title": "" }, { "docid": "c5736bd9c3d5ca361710ee06ed137ec1", "score": "0.5877953", "text": "function titleChange() {\n\n if (window.matchMedia(\"(max-width: 850px)\").matches) {\n\n var titrePageBrut = $('.titre h2').text().slice($('.titre h2').text().lastIndexOf(' ') + 1);\n var titrePage = capitalizeFirstLetter(titrePageBrut);\n // on ajoute le texte dans le liseret seulement si l'orientation est la bonne\n if (window.matchMedia(\"(orientation: portrait)\").matches) {\n var titreSection = $('section .titre').text().length;\n if (titreSection == 16) {\n $('#portfolio p').append('<span> - Livre d\\'or </span>');\n } else if (titreSection == 13) {\n $('#portfolio p').append('<span> - Sur moi </span>');\n } else {\n $('#portfolio p').append('<span> - ' + titrePage + '</span>');\n }\n } else {\n $('#portfolio span').remove();\n }\n }\n\n }", "title": "" }, { "docid": "54d9b4b28e965a775f9651d26e3a456f", "score": "0.5871913", "text": "willUpdate() {\n super.willUpdate(...arguments);\n this._removeTitle();\n }", "title": "" }, { "docid": "9ddc19d6557e06b91b4c53f4be155175", "score": "0.5871645", "text": "function setTitle(title) {\n\t$( \"title\" ).html( title )\n}", "title": "" }, { "docid": "3c9a0d3fd1cb65eb313ded5976ad9626", "score": "0.58625907", "text": "function setPageTitle() {\n const pageTitle = document.getElementById('title');\n pageTitle.innerText = webpageTitle;\n}", "title": "" }, { "docid": "82e8cd26f760904e4da69572c44feac7", "score": "0.5861188", "text": "async validateTitle(title) {\n await t.expect(this.title.innerText).eql(title, 'The page is not correct. Web Tables title was expected.')\n }", "title": "" }, { "docid": "ef982eeb53751b43d5d334e99c840dcf", "score": "0.585618", "text": "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "title": "" }, { "docid": "cc9f16b7618a97186eee0a535758b2cf", "score": "0.5846362", "text": "function handleInspectedURLChanged() {\n try {\n let url = new URL(location.href);\n let searchParams = new URLSearchParams(url.search);\n let title = searchParams.get(\"uxp_window_title\");\n if (!!title) {\n // Chrome CDT overwrites the window title with \"Devtool - \"\n // We need to use uxp plugin info here - We get the title from the query-params\n // and override the title again here.\n document.title = title;\n }\n }\n catch (err) {\n console.error(\"Failed to set Window title to UXP Devtools\");\n }\n}", "title": "" }, { "docid": "c530088052cdf582896931b4e6e63d62", "score": "0.58448774", "text": "setTitle(){\n var titleNode = document.getElementsByTagName('hi');\n var titleArr = (titleNode[0])? titleNode[0].innerText.toLowerCase().split(':') : [] ;\n console.log('title', titleArr[0], titleArr[1])\n }", "title": "" }, { "docid": "e7d33030c4b0434e64dc3efb7cf57595", "score": "0.5834994", "text": "set title(x)\n {\n if (this._title === x)\n return;\n this._title = x;\n\n this.titleElement.innerHTML = x;\n }", "title": "" }, { "docid": "1fb277927a096bbfc2cf761278525bc0", "score": "0.5833915", "text": "function MutationObserverInit() {\n}", "title": "" }, { "docid": "a1881146f6df1a175f89a46682542471", "score": "0.5832862", "text": "function changePageTitle(page_title) {\n \n // mudar titulo da pagina\n $('#page-title').text(page_title);\n\n // mudar tag titulo\n document.title = page_title;\n}", "title": "" }, { "docid": "7faaac6ffe3b5ca56011269198a95e01", "score": "0.5818371", "text": "function setPageTitle() {\n let title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "title": "" }, { "docid": "ed63c5a9f488dc303d6ed5c929f42614", "score": "0.5812879", "text": "function newTitle() {\n document.getElementById(\"main-title\").innerText = \"Dom's Page\";\n}", "title": "" }, { "docid": "ce324178b9277b87cc54849d1cdae497", "score": "0.58053505", "text": "function handleTitleEvents() {\n var cur_title = $(this).text();\n var text_input = $('<input type=\"text\" class=\"snippage-title-input\" size=\"50\">');\n $(this).replaceWith(text_input);\n text_input.val(cur_title).focus().select();\n $(text_input).keydown(function(evt) {\n var new_title = $(this).val();\n if (evt.which == 13 && new_title.length) {\n createTitle($(this), new_title);\n snippage.title = new_title;\n chrome.extension.getBackgroundPage().updateLocalStorage();\n } else if (evt.which == 27) {\n createTitle($(this), cur_title);\n }\n });\n $(text_input).blur(function() {\n var new_title = $(this).val();\n if (new_title.length) {\n createTitle($(this), new_title);\n if (new_title != defaultSnippageTitle) {\n snippage.title = new_title;\n chrome.extension.getBackgroundPage().updateLocalStorage();\n }\n } else {\n createTitle($(this), cur_title);\n }\n });\n}", "title": "" }, { "docid": "dfd48277f5a6c3a6ea9207c21c71f58a", "score": "0.5801405", "text": "function setupTitle() {\n\n // Title field\n var title = $('#title div #title_field');\n title.val(getTitle());\n\n if(title.val() !== getDefaultTitle()) {\n title.removeClass('example');\n }\n\n title.focus(\n function () {\n if (title.val() === getDefaultTitle()) {\n title.removeClass('example').val(\"\");\n }\n }\n ).blur(\n function () {\n if(title.val() === \"\") {\n title.addClass('example').val(getDefaultTitle());\n }\n }\n ).keyup(\n function () {\n store('title', title.val());\n });\n\n\n // Search field\n $('#search_field').focus(\n function (event) {\n $(this).removeClass('example').val(\"\");\n }\n ).blur(\n function () {\n $(this).addClass('example').val(chrome.i18n.getMessage(\"example\", [\"Apple\"]));\n });\n }", "title": "" }, { "docid": "81952901a68cd1d419da7de1ba4b246a", "score": "0.5798371", "text": "function setPageTitle() {\n\n let title = document.getElementById(`title`);\n\n title.innerText = pageTitle;\n}", "title": "" }, { "docid": "0f8649af6ab046b9b243ed471b724290", "score": "0.57885265", "text": "function eventTitleChanged() {\n if (EventFormData.id && EventFormData.name !== '') {\n $rootScope.$emit('eventTitleChanged', EventFormData);\n }\n }", "title": "" }, { "docid": "30cf1c238003e1f5d39fef7063c7258b", "score": "0.5777487", "text": "static assertTitle() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield protractor_1.browser.getTitle();\n });\n }", "title": "" }, { "docid": "50a8a8f5c65637881f6e6765ecefa983", "score": "0.5773718", "text": "function transitionTitles() {\n self.playerTimeout = setTimeout(function() {\n $(episodeTitle).toggleClass('hide');\n $(podcastTitle).toggleClass('hide');\n resize(episodeTitle);\n resize(podcastTitle);\n transitionTitles();\n }, 4000);\n }", "title": "" }, { "docid": "6ff246ba9256da9d8570621f42d7c88c", "score": "0.5768976", "text": "onDidChangeTitle (callback) {\n const renameSubscription = this.file.onDidRename(callback);\n this.subscriptions.add(renameSubscription);\n return renameSubscription;\n }", "title": "" }, { "docid": "f4754dccef167454f7bb756e16371bc7", "score": "0.5767684", "text": "function updateTitle() {\n var text = editor.getLine(0); // TODO: find first # Title line?\n text = text.replace(/^\\s*#+\\s*/, \"\");\n document.title = text + \" | mathdown\";\n window.location.hash = text.replace(/\\W+/g, \"-\").replace(/^-/, \"\").replace(/-$/, \"\");\n }", "title": "" }, { "docid": "f050c9e3c468910b719df2d2a78b7cbb", "score": "0.57648647", "text": "set title(title) {\n let myId = this.getAttribute(\"my-id\");\n let titleWrapper = document.querySelector(\"#note_\" + myId + \"_title\");\n\n if (titleWrapper !== null) {\n titleWrapper.innerText = title;\n } else {\n titleWrapper = document.createElement(\"h3\");\n titleWrapper.setAttribute(\"id\", \"note_\" + myId + \"_title\");\n titleWrapper.innerText = title !== null && title !== '' ? title : \"untitled note\";\n this.appendChild(titleWrapper);\n }\n }", "title": "" }, { "docid": "24f9263fe0c5d791209cd8d76614dec4", "score": "0.57571405", "text": "function getTitleOfPageFromDOM(tabId, callback) {\n setTimeout(function () {\n chrome.tabs.sendMessage(tabId, {\n command: \"GetCurrentPageTitleFromDOM\",\n },\n function (title) {\n console.log(\"Response from content script:\", title);\n callback(title);\n });\n }, 2000);\n}", "title": "" }, { "docid": "92edc3f4190e06999ab59d563eabcabc", "score": "0.57510114", "text": "function updateTitle(str)\n{\n document.getElementById(\"videoTitle\").innerHTML = str;\n document.title = str + \" - KachoTube\";\n}", "title": "" }, { "docid": "5fda8d875cf90bd0082cba3304b20631", "score": "0.5749032", "text": "function injectTitle(name) {\n document.getElementById(\"pageTitle\").innerHTML = name;\n}", "title": "" }, { "docid": "9f6c23572a2c8b763feb326ca979f9c7", "score": "0.5736552", "text": "function queryTitleHandler() {\n let customSettings = {\n data: JSON.stringify({\n title: $titleInput.val(),\n queryId: $querySelectInput.attr('id'),\n queryName: $querySelectInput.val(),\n })\n };\n let eventName = WidgetHelpers.WidgetEvent.ConfigurationChange;\n let eventArgs = WidgetHelpers.WidgetEvent.Args(customSettings);\n widgetConfigurationContext.notify(eventName, eventArgs);\n }", "title": "" }, { "docid": "ed19f7be092cb91fb26bffeb5d631a47", "score": "0.5726784", "text": "updateTitle_() {\n var parts = [];\n\n var feature = /** @type {Feature} */ (this.scope['items'][0]);\n if (feature) {\n var sourceId = /** @type {string|undefined} */ (feature.get('sourceId'));\n if (sourceId) {\n parts.push(layer.getTitle(sourceId, false) || undefined);\n }\n\n parts.push(osFeature.getTitle(feature) || undefined);\n }\n\n this['title'] = parts.filter(filterFalsey).join(': ');\n }", "title": "" }, { "docid": "9e1873e1f644f9c8634bacd8756a5554", "score": "0.5714708", "text": "function setPageTitle(){\r\n\r\n const title = document.getElementById('title');\r\n title.innerText = pageTitle;\r\n}", "title": "" }, { "docid": "41433f74fd9d61cc0d683b3f6a80267b", "score": "0.5709899", "text": "function rewriteTitle()\n{\n if(typeof(window.SKIP_TITLE_REWRITE) != 'undefined' && window.SKIP_TITLE_REWRITE)\n return;\n\n var titleDiv = document.getElementById('title-meta');\n\n if(titleDiv == null)\n return;\n\n var cloneNode = titleDiv.cloneNode(true);\n var firstHeading = getFirstHeading();\n var node = firstHeading.childNodes[0];\n\n // new, then old!\n firstHeading.replaceChild(cloneNode, node);\n cloneNode.style.display = \"inline\";\n\n var titleAlign = document.getElementById('title-align');\n firstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue;\n}", "title": "" }, { "docid": "6d10995179b39cd3bea4d6c13c1275b3", "score": "0.5692912", "text": "set title (text) {\n let $title = this.$element.find(\"#title\")\n $title.text(text)\n }", "title": "" }, { "docid": "32e3df2c0d31f8b9a361396a8b2f4a9d", "score": "0.56898487", "text": "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n}", "title": "" }, { "docid": "0036729e6a8713e02508360775ff424a", "score": "0.5680942", "text": "function setPageTitle(title) {\n document.title = title;\n}", "title": "" }, { "docid": "9e389e00ede541e3a7859225bd2e3362", "score": "0.5680598", "text": "function news_title_init()\r\n{\r\n// Event.observe('news_title', 'change', savedraft);\r\n// $('news_urltitle_details').hide();\r\n $('news_status_info').hide();\r\n $('news_picture_warning').hide();\r\n \r\n // not the correct location but for reference later on:\r\n //new PeriodicalExecuter(savedraft, 30);\r\n}", "title": "" }, { "docid": "b57252af1f9b90cee89369cfb1328b64", "score": "0.56703043", "text": "onActionSetTitle(action) {\n if (!this.actionForID(action.id)) {\n // This may be called before the action has been added.\n return;\n }\n for (let bpa of allBrowserPageActions()) {\n bpa.updateActionTitle(action);\n }\n }", "title": "" }, { "docid": "fb2155572a47091dc685b2fa4d28dbf6", "score": "0.5668346", "text": "onTitleEdited(newTitle) {\n this.setState({\n title: newTitle\n });\n }", "title": "" }, { "docid": "d2d1acca7b76dc3b8b5f26da677bfa1c", "score": "0.56631315", "text": "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n}", "title": "" }, { "docid": "20ffdc843f22e39de780af4438a4f6af", "score": "0.56587064", "text": "function setPageTitle() {\n var $pageTitle;\n if ($.md.config.title)\n $('title').text($.md.config.title);\n\n $pageTitle = $('#md-content h1').eq(0);\n if ($.trim($pageTitle.toptext()).length > 0) {\n $('#md-title').prepend($pageTitle);\n var title = $pageTitle.toptext();\n // document.title = title;\n } else {\n $('#md-title').remove();\n }\n }", "title": "" }, { "docid": "5aebfd51944f62268f71e421749fc85d", "score": "0.5658105", "text": "function setuptitles()\n{\n var logopener=\"----entering setuptitles----\";\n console.log(logopener);\n\n //get the title H1 tags\n var maintitleline1 = document.getElementById(\"maintitleline1\");\n var maintitleline2 = document.getElementById(\"maintitleline2\");\n\n //set them with desired values.\n let titleline1 = \"bari basic tutorial demo app\";\n let titleline2 = \"built using HTML, CSS and JS plus Bootstrap only\";\n\n maintitleline1.innerHTML = titleline1;\n maintitleline2.innerHTML = titleline2;\n\n var logcloser=\"----leaving setuptitles----\";\n console.log(logcloser);\n}", "title": "" }, { "docid": "395ca109cb44a99f77741b4a860a66e8", "score": "0.5655358", "text": "function fillInTitle(selector, title) {\n var element = document.querySelector(selector);\n if (!element) {\n return;\n }\n\telement.innerHTML = title;\n}", "title": "" }, { "docid": "4768010e3093c75eddb6daa08d63ff68", "score": "0.5621013", "text": "get title() {\n return $(\"//h1[text()='Chofer']\");\n }", "title": "" }, { "docid": "674fb37cefe99f6d07a41ceb9923643c", "score": "0.56204766", "text": "async getNotificationTitle(element) {\n let titleElement = await this.selenium.findElementBy(\"className\", \"title\", element);\n let title = await titleElement.getAttribute(\"innerText\");\n return title;\n }", "title": "" }, { "docid": "29b1161f4a5f7e9df01faa2aea2f0ea8", "score": "0.56193477", "text": "function setEmployeeTitle() {\n console.info('setTitle')\n $('#title').html('Medewerker instellingen')\n $('#subtitle').html('Voeg hier medewerker toe')\n}", "title": "" }, { "docid": "3b3172d4261935bfbcff304d0c9bdb4d", "score": "0.56189525", "text": "function titleUpdate() {\n\t\t//console.log(dataFeedQuery);\n\t\tvar start = new Date(dataFeedQuery.params[\"start-date\"]);\n\t\tvar end = new Date(dataFeedQuery.params[\"end-date\"]);\n\t\tstart = $.datepicker.formatDate('dd-mm-y', start);\n\t\tend = $.datepicker.formatDate('dd-mm-y', end);\n\t\t$('#inner-content > h3').html(dataFeedQuery.title + \": \" + start + \" to \" + end);\n\t}", "title": "" }, { "docid": "99c6e839b32ebc1aecb46334a560db88", "score": "0.56186134", "text": "function bs_ttt_hideTitle(ev) {\n\tif (typeof(ev) == 'undefined') ev = window.event;\n\t//var ev = ('object' == typeof(window.event)) ? window.event : ev; //1st is for ie, 2nd for ns\n\t\n\tvar elm = ev.srcElement;\n\tvar div = bs_ttt_getTitleElm();\n\tif ((div == false) || (div == null)) return;\n\telm.title = div.innerHTML; //set it back.\n\tdiv.innerHTML = '';\n\tdiv.style.display = 'none';\n}", "title": "" }, { "docid": "16c73e091479e8b70e7cd1b00f78a786", "score": "0.5617957", "text": "function walkAndObserve(doc) {\n let logos = document.querySelectorAll(\".a-icon\");\n for (let l of logos) {\n if (! (l.classList.contains(\"a-icon-next-rounded\") || l.classList.contains('a-icon-previous-rounded'))) {\n l.style.backgroundImage = 'url(\"' + browser.extension.getURL(\"icons/brunozon-logo.png\") + '\")';\n l.style.backgroundSize = 'cover';\n l.style.backgroundPosition = '0px 0px';\n l.style.height = '38px';\n }\n }\n\n logos = document.querySelectorAll(\".nav-logo-base\");\n for (let l of logos) {\n l.style.backgroundImage = 'url(\"' + browser.extension.getURL(\"icons/brunozon-logo-inverted.png\") + '\")';\n l.style.backgroundSize = 'cover';\n l.style.backgroundPosition = '0px 0px';\n l.style.height = '38px';\n l.style.width = '100px';\n }\n\n const docTitle = doc.getElementsByTagName('title')[0],\n observerConfig = {\n characterData: true,\n childList: true,\n subtree: true\n },\n bodyObserver, titleObserver;\n\n // Do the initial text replacements in the document body and title\n walk(doc.body);\n doc.title = replaceText(doc.title);\n\n // Observe the body so that we replace text in any added/modified nodes\n bodyObserver = new MutationObserver(observerCallback);\n bodyObserver.observe(doc.body, observerConfig);\n\n // Observe the title so we can handle any modifications there\n if (docTitle) {\n titleObserver = new MutationObserver(observerCallback);\n titleObserver.observe(docTitle, observerConfig);\n }\n}", "title": "" }, { "docid": "84f9ad80e77592cbc93b78a538a831e3", "score": "0.56174344", "text": "function assignObserver(target, config, slidesTitleMap) {\n var i = 1;\n var observer = new MutationObserver(function(mutations) {\n\n if (i % 2 === 0) {\n clearInterval(interval2);\n //Empty the text field\n $(\".carousel-inner .item .typed-text\").empty();\n\n //Add text and cursor\n addTextToSlides(slidesTitleMap);\n }\n i++;\n });\n observer.observe(target, config);\n }", "title": "" }, { "docid": "8951c0e310edb39ca71d99cbfd05370d", "score": "0.56138843", "text": "function titleHandler(event) {\n setTitle(event.target.value);\n }", "title": "" }, { "docid": "c23e92335229530a83fe8f662f447a68", "score": "0.5611602", "text": "resolveTitleFromVirtualDocument() {\n\t\tvar title = this.virtualDocument.querySelector(this.titleSelector);\n\t\tif (title) {\n\t\t\tthis.setTitle(title.innerHTML.trim());\n\t\t}\n\t}", "title": "" }, { "docid": "45bc5001e235996954e48426641814ff", "score": "0.5609243", "text": "onunload() {\n console.log(`unloading ${this.manifest.id} plugin`);\n //console.log(`reverting title to '${this.baseTitle}'`);\n document.title = this.baseTitle;\n }", "title": "" }, { "docid": "72ce24e1c0e03931d8a3ba5f200ec434", "score": "0.56078243", "text": "function setPageTitle() {\n document.getElementById(\"title\").innerHTML = pageTitle\n}", "title": "" }, { "docid": "6dc839242d9e81353c8124543ca55c1b", "score": "0.5606991", "text": "function prepareTitle(selector) {\n var request = new XMLHttpRequest();\n request.open(\"GET\", \"title.txt\");\n request.addEventListener(\"load\", function() {\n fillInTitle(selector, request.responseText);\n });\n request.send();\n}", "title": "" } ]
786008b4d83b9fbcdae802e42911518f
Loads the images from the cache using the imageIndex variable as index. changeOpacityOfCurrentImages is used to if the opacity of images should be changed by showLoading()
[ { "docid": "4d760d60fa815bd5fe3491ee6c548234", "score": "0.80326813", "text": "function loadImagesFromCache(changeOpacityOfCurrentImages) {\n\tvar numberToCount;\n\tif(observations.length < currentEntryHolders.length) {\n\t\tnumberToCount = observations.length - 1;\n\t} else {\n\t\tnumberToCount = currentEntryHolders.length;\n\t}\n\t\n\tfor (var i = 0; i < numberToCount; i ++) {\n\t\t// load previous thumbnail and fullsize images into cache\n\t\tvar cleanIndex = checkIndex(imageIndex - numberToCount + i);\n\t\tpreviousEntryHolders[i].content.html(observations[cleanIndex].content);\n\t\tpreviousEntryHolders[i].observationIndex = cleanIndex;\n\t\t\n\t\t// load next thumbnail and fullsize images into cache\n\t\tcleanIndex = checkIndex(imageIndex + i);\n\t\t//display image (restarting at the beginning, if no more images can be fetched from the server\n\t\tcurrentEntryHolders[i].content.html(observations[cleanIndex].content);\n\t\tcurrentEntryHolders[i].observationIndex = cleanIndex;\n\t\t\n\t\t// load future thumbnail and fullsize images into cache\n\t\tcleanIndex = checkIndex(imageIndex + numberToCount + i);\n\t\tfutureEntryHolders[i].content.html(observations[cleanIndex].content);\n\t\tfutureEntryHolders[i].observationIndex = cleanIndex;\n\t\t\n\t\tpreviousEntryHolders[i].content.css({ height: 0, opacity: 0 });\n\t\tpreviousEntryHolders[i].content.hide();\n\t\t\n\t\tif (i < futureEntryHolders.length) {\n\t\t\tfutureEntryHolders[i].content.css({ height: 0, opacity: 0 });\n\t\t\tfutureEntryHolders[i].content.hide();\n\t\t}\n\t\t\n\t\tif(changeOpacityOfCurrentImages)\n\t\t\tcurrentEntryHolders[i].content.css({ height: observations[currentEntryHolders[i].observationIndex].height, opacity: 0.5 });\n\t\telse currentEntryHolders[i].content.css({ height: observations[currentEntryHolders[i].observationIndex].height, opacity: 1 });\n\t\t\n\t\tcurrentEntryHolders[i].content.show();\n\t}\n\t\n\t// hide next/previous button if there are not enough images to switch\n\tif (observations.length <= currentEntryHolders.length) {\n\t\t$('.imageSliderNavigation').hide();\n\t\tfor (var i = observations.length - 1; i < currentEntryHolders.length; i ++) {\n\t\t\tcurrentEntryHolders[i].content.hide();\n\t\t}\n\t} else {\n\t\t$('.imageSliderNavigation').show();\n\t\tfor (var i = observations.length - 1; i < currentEntryHolders.length; i ++) {\n\t\t\tcurrentEntryHolders[i].content.show();\n\t\t}\n\t}\n\tinitLightBox();\n}", "title": "" } ]
[ { "docid": "8946e54fa26fccfd5ae51a60653b0b16", "score": "0.70543885", "text": "function replaceImage(index, img) {\n var $img = $(img);\n var src = $img.attr('src');\n cache.get(src, loadImage).then(function(url) {\n $img.attr({src: url, src_: src});\n });\n }", "title": "" }, { "docid": "16efbe78546be2a004f36e0542c3a85b", "score": "0.67686945", "text": "function updateCache() {\n\tvar cache = document.getElementById(\"cache\");\n\twhile (cache.firstChild) {\n\t\tcache.removeChild(cache.firstChild);\n\t}\n\tfor (var i = 0; i < CACHE_PRELOAD_SIZE; i++) {\n\t\tvar img = document.createElement('img');\n\t\timg.setAttribute(\"src\", getJson(slideIndex + i + 1).file.url);\n\t\tcache.appendChild(img);\n\t}\n\tfor (var i = 0; i < CACHE_POSTLOAD_SIZE; i++) {\n\t\tvar json = getJson(slideIndex - i - 1);\n\t\tif (json != 0) {\n\t\t\tvar img = document.createElement('img');\n\t\t\timg.setAttribute(\"src\", json.file.url);\n\t\t\tcache.appendChild(img);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8fd11228a1d86cdd3c23555a800cd784", "score": "0.6766855", "text": "function setImage(index)\n{\n\t$(\"#img\").hide();\t\t\t\t\t\t\n\t$(\"#img\").attr('src',\"images\"+\"/\"+types[index][\"image\"]);\n\t$(\"#img\").fadeIn();\n}", "title": "" }, { "docid": "cdac08c0de08dfac44ad0bce37ae21d4", "score": "0.66935813", "text": "cacheImages() {\n console.log('[scene ' + this.name + '] ' + ' caching Images');\n // var max = this.resources.length,\n // i,\n // id;\n if (!this.resources) {\n return;\n }\n\n try {\n for (let i = 0, max = this.resources.length; i < max; i++) {\n let id = this.resources[i].id;\n if (this.resources[i].type === 'image') {\n this.pics[id] = ResourceManager.getResourceById(id);\n }\n }\n } catch (err) {\n debugger;\n }\n }", "title": "" }, { "docid": "91edb4c0cf5a4d7ecc8b23cd0c7d5a50", "score": "0.66909176", "text": "function loadImageToCache(imageId) {\n imageId = parseInt(imageId);\n\n if (gImageList.indexOf(imageId) === -1) {\n console.log(\n 'skiping request to load image ' + imageId +\n ' as it is not in current image list.');\n return;\n }\n\n if (gImageCache[imageId] !== undefined) {\n // already cached\n return;\n }\n\n gImageCache[imageId] = $('<img>');\n gImageCache[imageId].data('imageid', imageId).attr(\n 'src', '/images/image/' + imageId + '/');\n }", "title": "" }, { "docid": "a859417c96d02a1a6705dbffdc7150c0", "score": "0.66848135", "text": "function loadImage(index, imageList) {\n let image = document.getElementsByClassName(\"image\")[0];\n image.src = imageList[index].url;\n image.onload = function() {\n formatImage(index, imageList);\n }\n}", "title": "" }, { "docid": "c2d32aff2d7d1434141bc598456121b2", "score": "0.6672494", "text": "function load_index(data, textStatus, xhr)\n{\n var title = data[\"title\"];\n var images = data[\"images\"];\n var i;\n var img;\n var elem;\n var num_images;\n\n $(\".title\").text(title);\n\n // Track the number of images, and set up the page once they've all been\n // loaded.\n num_images = images.length;\n function image_loaded() {\n\tnum_images--;\n\tif (num_images == 0) {\n\t // There needs to be a slight delay after the last image\n\t // is loaded. (This may be because Chrome fires the event\n\t // before the image's attributes have been changed.)\n\t // Without the delay, verify_images_ok() only finds N-1\n\t // images and fails.\n\t setTimeout(function () {\n\t\t// Sanity check the images\n\t\tif (verify_images_ok(images.length)) {\n\t\t // Perform an initial update\n\t\t update_result();\n\t\t}\n\t }, 250);\n\t}\n }\n\n // Create image objects.\n for(i = 0; i < images.length; i++) {\n\tvar im = images[i];\n\tvar image_path = IMAGE_PATH + im['filename'];\n\tvar image_elem;\n\n\t// Create thumbnails for images and the slider widgets.\n\telem = $('<div class=\"component\"><p><img /><br />' +\n\t\t im['title'] +\n\t\t ':<br /><input class=\"range-slider\" type=\"range\" min=\"0\" max=\"100\" step=\"1\" value=\"50\" /></p><hr /></div>');\n\t$('#div-image-list').append(elem);\n\telem.data('component-index', i).data('legend', im['legend']);\n\n\t// We don't want clicking on the slider to also trigger the select/deselect of a component.\n\telem.find('input.range-slider').on('mousedown mouseup click', function (event) {\n\t event.stopPropagation();\n\t});\n\n\t// Fill in the elements on the image\n\telem.find('img').attr({\n\t 'src': image_path,\n\t 'width': 205, 'height': 105,\n\t 'class': 'image-thumbnail',\n\t});\n\telem.click(function (event) {\n\t // Check number of selected components\n\t if ($(this).hasClass('component-selected')) {\n\t\t// Toggle the class off.\n\t\t$(this).toggleClass('component-selected');\n\t\tupdate_result();\n\t }\n\t else if ($(\"#div-image-list .component-selected\").length < MAXIMUM_SELECTED_IMAGES) {\n\t\t// Haven't selected the maximum number yet, so toggle the class on.\n\t\t$(this).toggleClass('component-selected');\n\t\tupdate_result();\n\t } else {\n\t\t// Too many selected; warn the user.\n\t\t// XXX fix this popover.\n\t\t$('body').popover({\n\t\t placement: \"right\",\n\t\t trigger: \"manual\",\n\t\t selector: this,\n\t\t title: \"Can't select another image\",\n\t\t content: \"You can only select up to \" + MAXIMUM_SELECTED_IMAGES.toString() + \" images.\"\n\t\t});\n\t }\n\t});\n\n\t// XXX should replace use of Image.onLoad with something else, because\n\t// the event isn't fired reliably.\n\timage_elem = $('<img />', {\n\t 'class': 'image-component'\n\t}).on(\"load\", image_loaded);\n\timage_elem.attr('src', image_path);\n\t$(\"#div-image-masters\").append(image_elem);\n }\n\n // Make slider adjustments update the displayed image.\n $('.range-slider').change(update_result);\n}", "title": "" }, { "docid": "615718594dd605380c08208d793dca3a", "score": "0.66593933", "text": "function WB_build_image_cache()\r\n{\r\n\r\n\r\n\tWB_images_cache[0] = new Image();\r\n\tWB_images_cache[0].src = wb_image_topheaderplus;\r\n\tWB_images_cache[0].alt = '(show)';\r\n\r\n\tWB_images_cache[1] = new Image();\r\n\tWB_images_cache[1].src = wb_image_topheaderminus;\r\n\tWB_images_cache[1].alt = '(hide)';\r\n\r\n\tWB_images_cache[2] = new Image();\r\n\tWB_images_cache[2].src = wb_image_childplus;\r\n\tWB_images_cache[2].alt = '(show)';\r\n\r\n\tWB_images_cache[3] = new Image();\r\n\tWB_images_cache[3].src = wb_image_childminus;\r\n\tWB_images_cache[3].alt = '(hide)';\r\n\r\n\tWB_images_cache[4] = new Image();\r\n\tWB_images_cache[4].src = wb_image_leaf;\r\n\tWB_images_cache[4].alt = '(dot)';\r\n\r\n\tWB_images_cache[5] = new Image();\r\n\tWB_images_cache[5].src = wb_image_highlightplus;\r\n\tWB_images_cache[5].alt = '(show)';\r\n\r\n\tWB_images_cache[6] = new Image();\r\n\tWB_images_cache[6].src = wb_image_highlightminus;\r\n\tWB_images_cache[6].alt = '(hide)';\r\n\r\n\tWB_images_cache[7] = new Image();\r\n\tWB_images_cache[7].src = wb_image_highlightleaf;\r\n\tWB_images_cache[7].alt = '(dot)';\r\n}", "title": "" }, { "docid": "675f917758279aaf48c1af4e18b37c3c", "score": "0.66137373", "text": "load(index)\n {\n if(index < this.imgURL.length)\n {\n const image = new Image();\n image.addEventListener(\"load\", () => {\n index++;\n console.log(index);\n this.load(index);\n });\n image.src = this.imgURL[index];\n }\n else\n {\n document.dispatchEvent(new CustomEvent(\"loaded\"));\n this.randomGif(this.forward);\n this.randomGif(this.backward);\n }\n }", "title": "" }, { "docid": "71056ad135e7deb042205e892d2be542", "score": "0.6595456", "text": "function showImg(index){\n var imgSlide = $('.imageSlide')[0];\n var thumbnails = $('.thumbnail');\n var images = getData(imgSlide.id).images;\n if(index >= images.length){\n curIndex = index % images.length;\n } else if (index < 0){\n curIndex = images.length - 1;\n }\n imgSlide.style.opacity = 1;\n $.when($(imgSlide).fadeOut(500)).done(function(){\n imgSlide.src = 'img/projects/' + images[curIndex];\n $(imgSlide).fadeIn(500);\n for(var i = 0; i < images.length; i++){\n if(i == curIndex){\n thumbnails[curIndex].style.opacity = 1.0;\n }else {\n thumbnails[i].style.opacity = 0.5;\n }\n }});\n}", "title": "" }, { "docid": "a6b690f534de637c5206a5899f70c3db", "score": "0.6501567", "text": "function preload(index){\n\t\t\tsetTimeout(function(){\n\t\t\t\tshowImage(index);\n\t\t\t}, 1000);\n\t\t}", "title": "" }, { "docid": "2d4814d1b82a4d47dfba4fb9051ac504", "score": "0.6497514", "text": "function preload(index){\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tshowImage(index);\n\t\t\t}, 1000);\n\t\t}", "title": "" }, { "docid": "12ba5cb1af972eca7095e930221eeed9", "score": "0.6463264", "text": "function loadImageData(imageWidth,imageHeight,index,imageList) {\n let image = document.getElementsByClassName(\"image\")[0];\n let link = document.getElementsByClassName(\"flickr-link\")[0]\n image.alt = imageList[index].title\n document.getElementsByClassName(\"title\")[0].innerHTML = imageList[index].title;\n link.href = imageList[index].link;\n link.innerHTML = \"View Photo on Flickr\"\n image.style.width = imageWidth + \"px\";\n image.style.height = imageHeight + \"px\";\n fadein(imageWidth,imageHeight,index,imageList);\n}", "title": "" }, { "docid": "eb758cfb1f309a5f13d5ba3b46a1afe2", "score": "0.6407332", "text": "function updateImage(){\n\t\t$(\".image-holder\").html(\n\t\t\"<img src='images/\"+images[index]+\"'/>\"\n\t);\n}", "title": "" }, { "docid": "6d9b49b40258ed08e130492d5e6d3c32", "score": "0.63633335", "text": "function updateImage() {\n\tconsole.log (\"update image\");\n\tconsole.log (images[index]);\n\t$(\"#image-wrapper\").html(\"<img src='images/\"+images[index]+\"' />\");\n}", "title": "" }, { "docid": "6fcff6994b11872cec33801b27ef8fa0", "score": "0.6344183", "text": "nextImages() {\n if (this.state.images[this.props.count] !== undefined) {\n this.startDeleteAll();\n this.loadImg(this.canvasWdt, this.canvasHgt)\n }\n }", "title": "" }, { "docid": "21b38982e4ed98ad8369c07406202e9c", "score": "0.6336039", "text": "function animateCurrentImages() {\n\t\n\t// set the new image index to reload the images\n\timageIndex = checkIndex(stepsToMove + imageIndex);\n\t\n\t//check if the next images are positive or negative. if positive the future images will be loaded, if negative the previousEntryHolders will be loaded\n\tvar positive = stepsToMove >= 0;\n\tfor (var i = 0; i < Math.abs(stepsToMove); i ++) {\n\t\tif (positive) {\n\t\t\tif (i < futureEntryHolders.length) {\n\t\t\t\tfutureEntryHolders[i].content.show();\n\t\t\t\tfutureEntryHolders[i].content.animate({ height: observations[futureEntryHolders[i].observationIndex].height, opacity: 1 }, 1500, function() {\n\t\t\t\t\tnavigationDisabled = false;\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (i < currentEntryHolders.length) {\n\t\t\t\tif(i >= Math.abs(stepsToMove) - 1){\n\t\t\t\t\tcurrentEntryHolders[i].content.animate({ height: 0, opacity: 0 }, 1500, function() {\n\t\t\t\t\t\tloadImagesFromCache();\n\t\t\t\t\t\tnavigationDisabled = false;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tcurrentEntryHolders[i].content.animate({ height: 0, opacity: 0 }, 1500, function() {\n\t\t\t\t\t\tnavigationDisabled = false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (i < previousEntryHolders.length) {\n\t\t\t\tvar cleanIndex = currentEntryHolders.length - i - 1;\n\t\t\t\tif (cleanIndex < 0) {\n\t\t\t\t\tcleanIndex = 0;\n\t\t\t\t}\n\t\t\t\tpreviousEntryHolders[cleanIndex].content.show();\n\t\t\t\tpreviousEntryHolders[cleanIndex].content.animate({ height: observations[previousEntryHolders[cleanIndex].observationIndex].height, opacity: 1 }, 1500, function() {\n\t\t\t\t\tnavigationDisabled = false;\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (i < currentEntryHolders.length) {\n\t\t\t\tif(i >= Math.abs(stepsToMove) - 1){\n\t\t\t\t\tcurrentEntryHolders[currentEntryHolders.length - i - 1].content.animate({ height: 0, opacity: 0 }, 1500, function() {\n\t\t\t\t\t\tloadImagesFromCache();\n\t\t\t\t\t\tnavigationDisabled = false;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tcurrentEntryHolders[currentEntryHolders.length - i - 1].content.animate({ height: 0, opacity: 0 }, 1500, function() {\n\t\t\t\t\t\tnavigationDisabled = false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9f880e7f268a8813697f9da06e292c83", "score": "0.6315841", "text": "function iLoad() {\n cILoaded++;\n if (cILoaded == images.length) {\n reset();\n }\n}", "title": "" }, { "docid": "8447c24eb40ab3cbceeee87233a4e79b", "score": "0.6312661", "text": "function preloadImages() {\n\t// Add the references image path\n\tvar iReference = getRandomValues(1, 1, 12)[0];\n\t$('input.numeric').attr('value', iReference);\n\taImages.push(sImagesPath + 'reference/stim_050_' + iReference + '.BMP');\n\t// Add blank image path\n\taImages.push(sImagesPath + 'blank.bmp');\n\t// Add fixing cross image path\n\taImages.push(sImagesPath + 'fixing_cross.bmp');\n\t// Add the easy image path\n\taImages.push(sImagesPath + sContext + 'stim_0' + aEasy[Math.floor(Math.random() * aEasy.length)] + '_' + getRandomValues(1, 1, 4)[0] + '.BMP');\n\t// Add the middle image path\n\taImages.push(sImagesPath + sContext + 'stim_0' + aMiddle[Math.floor(Math.random() * aMiddle.length)] + '_' + getRandomValues(1, 1, 4)[0] + '.BMP');\n\t// Add the hard image path\n\taImages.push(sImagesPath + sContext + 'stim_0' + aHard[Math.floor(Math.random() * aHard.length)] + '_' + getRandomValues(1, 1, 4)[0] + '.BMP');\n\t// Preload images into cache\n\tvar length \t\t= aImages.length - 1;\n\t$.each(aImages, function(index) {\n\t\t(function(index) {\n\t\t\t$.ajax({\n\t\t\t\turl: aImages[index],\n\t\t\t}).done(function() {\n\t\t\t\t// If images loading finished, launch the game\n\t\t\t\tif(index == length) {\n\t\t\t\t\t$('.lightbox img').css('padding-top', '');\n\t\t\t\t\tstep_01(0);\n\t\t\t\t}\n\t\t\t});\n\t\t}(index));\n\t});\n}", "title": "" }, { "docid": "fdf7eb2d5da291f425ff3407f5993a30", "score": "0.6311722", "text": "function displayImages(position){\n $(\".imageHolder img\").attr(\"src\", images[position]);\n currentPosition = position; \n }", "title": "" }, { "docid": "b59c9f2343cfb33640f647358e5057ae", "score": "0.6286741", "text": "function updateImages(){ queue = Data.images.get() }", "title": "" }, { "docid": "5c9e8afd86bcdd6fc76fc96181962f26", "score": "0.6277882", "text": "function updatePictureCache() {\r\r\n var smallPicCache = new Array(Books.length);\r\r\n var largePicCache = new Array(Books.length);\r\r\n for (i = 0; i < Books.length; i++) {\r\r\n //smallPicCache[i] = new Image();\r\r\n //smallPicCache[i].src = Books[i].SmallPictureLink;\r\r\n //largePicCache[i] = new Image();\r\r\n //largePicCache[i].src = Books[i].LargePictureLink;\r\r\n }\r\r\n}", "title": "" }, { "docid": "6b7b072e441cb5934506ff5e43148daf", "score": "0.62678653", "text": "function dispatchImage(index) {\r\n return (\r\n <div>\r\n <Img\r\n fluid={\r\n images2d[getPath(globalHistory.location.pathname)][index]\r\n }\r\n />\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "ce4cadb6aae4f08f70d8d8f83e1b37de", "score": "0.62648314", "text": "function drawImage(index) {\n var img = document.createElement('img');\n var li = document.createElement('li');\n var imageList = document.getElementById('images');\n var imagePath = images[index].path;\n images[index].views++;\n\n //set src\n img.setAttribute('src', imagePath);\n //add to dom\n li.appendChild(img);\n imageList.appendChild(li);\n}", "title": "" }, { "docid": "7dd7e78b270a881eda4d473e68bfcfda", "score": "0.62525815", "text": "function changeImage(indexChange){\n showImg(curIndex += indexChange);\n}", "title": "" }, { "docid": "7073069926ab40624d2831c39ece54eb", "score": "0.62520367", "text": "function loadAllImages() {\n\t\tif ( observer ) {\n\t\t\tobserver.disconnect();\n\t\t}\n\n\t\twhile ( lazyImages.length > 0 ) {\n\t\t\tapplyImage( lazyImages[ 0 ] );\n\t\t}\n\t}", "title": "" }, { "docid": "218abb58365ce38dcbb3b6aa33ae7c99", "score": "0.6246619", "text": "function showImage(index){\n\t\n\t\t\t// If the index is outside the bonds of the array\n\t\t\tif(index < 0 || index >= items.length){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Call the load function with the href attribute of the item\n\t\t\tloadImage(items.eq(index).attr('href'), function(){\n\t\t\t\tplaceholders.eq(index).html(this);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "218abb58365ce38dcbb3b6aa33ae7c99", "score": "0.6246619", "text": "function showImage(index){\n\t\n\t\t\t// If the index is outside the bonds of the array\n\t\t\tif(index < 0 || index >= items.length){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Call the load function with the href attribute of the item\n\t\t\tloadImage(items.eq(index).attr('href'), function(){\n\t\t\t\tplaceholders.eq(index).html(this);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "c81fc1f5e63949e26e4779346b24590a", "score": "0.62355405", "text": "function imageOnload() {\n this.style.zIndex = imageNr; // Image finished, bring to front!\n while (1 < finished.length) {\n var del = finished.shift(); // Delete old image(s) from document\n del.parentNode.removeChild(del);\n }\n finished.push(this);\n if (!paused) createImageLayer();\n}", "title": "" }, { "docid": "a9617747d8680ac297cfd1bd223b6137", "score": "0.6218413", "text": "loadMoreImages() {\n this.element = this.viewPort.element;\n //\n // loop thru all imageIds, load and cache them for exhibition (up the the maximum limit defined)\n //\n const maxImages = (this.maxImagesToLoad <= 0) ? (this.imageIdList.length - this.loadedImages.length) : Math.min(this.maxImagesToLoad, this.imageIdList.length - this.loadedImages.length);\n this.loadingImages = true; // activate progress indicator\n this.targetImageCount += maxImages;\n let nextImageIndex = this.loadedImages.length;\n for (let index = 0; index < maxImages; index++) {\n const imageId = this.imageIdList[nextImageIndex++];\n cornerstone.loadAndCacheImage(imageId)\n .then(imageData => { this.imageLoaded(imageData); })\n .catch(err => { this.targetImageCount--; });\n }\n }", "title": "" }, { "docid": "82c76b8e380179d0c882efabfa416cbd", "score": "0.621238", "text": "lazyLoadImages () {\n /**\n * The IntersectionObserver instance which will handle lazy loading\n *\n * @type {IntersectionObserver}\n */\n this.observer = new IntersectionObserver(this.onIntersection, this.config)\n\n this.images.forEach((image) => {\n if (image.dataset.loadInstantly) {\n this.load(image)\n return\n }\n\n this.observer.observe(image)\n })\n this.images.on('update', (newItems, oldItems) => {\n oldItems.forEach(image => this.observer.unobserve(image))\n newItems.forEach(image => {\n if (image.dataset.loadInstantly) {\n this.load(image)\n return\n }\n\n this.observer.observe(image)\n })\n\n this.setupSlideshows()\n })\n }", "title": "" }, { "docid": "4a1520e8db41d866171fb639320d61f9", "score": "0.6203079", "text": "function preloadImages() {\n var keepImages = [];\n for (var imageId = gImageId - PRELOAD_BACKWARD;\n imageId <= gImageId + PRELOAD_FORWARD;\n imageId++) {\n keepImages.push(imageId);\n loadImageToCache(imageId);\n }\n pruneImageCache(keepImages);\n }", "title": "" }, { "docid": "1f3018a6e6d5fdcb6a023a1ef8e00fb7", "score": "0.61979216", "text": "lazyLoadImages() {\n const images = this.renderRoot.querySelectorAll(\"img[loading='lazy']\");\n if (this._imgObserver)\n images.forEach(image => {\n this._imgObserver.observe(image);\n });\n else\n images.forEach(image => {\n image.src = image.dataset.src;\n });\n }", "title": "" }, { "docid": "75efd0cfb02387928fc8e354c9ddd218", "score": "0.6192564", "text": "function loadZoomInImages(i) {\n\t\tif (i < 77) {\n\t\t\tpicnumstring = ('00000' + i).slice(-5);\n\t\t\tinnerProject = currentInnerProject();\n\t\t\tpicstring = './sequences/rotate/ZOOMIN/' + innerProject + '/' + innerProject + '_' + picnumstring + '.jpg';\n\t\t\t$('#configurator .inset-0').prepend('<img class=\"hidden sequence-image inner-' + innerProject + '-' + picnumstring + '\" src=\"' + picstring + '\">');\n\n\n\t\t\tanimTimer = setTimeout(function(){ loadZoomInImages(i + 1) }, 50);\n\n\t\t\t\n\t\t} else {\n\t\t\tloadedProjects.push(innerProject);\n\t\t}\n\n\t}", "title": "" }, { "docid": "ccc5adf287eb4df8f50babcdd8b26ddb", "score": "0.61557394", "text": "loadAllImages(props = this.props) {\n //console.log('LOAD ALL IMAGES!!!');\n const generateLoadDoneCallback = (srcType, imageSrc) => err => {\n // Give up showing image on error\n if (err) {\n return;\n }\n\n // Don't rerender if the src is not the same as when the load started\n // or if the component has unmounted\n if (this.props[srcType] !== imageSrc || this.didUnmount) {\n return;\n }\n\n // Force rerender with the new image\n this.forceUpdate();\n };\n\n // Load the images\n this.getSrcTypes().forEach(srcType => {\n const type = srcType.name;\n //console.log(type);\n\n // there is no error when we try to load it initially\n if (props[type] && this.state.loadErrorStatus[type]) {\n this.setState(prevState => ({\n loadErrorStatus: { ...prevState.loadErrorStatus, [type]: false },\n }));\n }\n\n // Load unloaded images\n if (props[type] && !this.isImageLoaded(props[type])) {\n this.loadImage(\n type,\n props[type],\n generateLoadDoneCallback(type, props[type])\n );\n }\n });\n }", "title": "" }, { "docid": "0e4f6af9c75804e7705d66760aaca0ea", "score": "0.6150705", "text": "function showImage(newIndex){\n if (newIndex > numOfImages) {imageIndex = 1; newIndex = 1;}\n if (newIndex < 1) {imageIndex = numOfImages; newIndex = numOfImages}\n\n imageIndex = newIndex;\n\n //For all images set them to display none\n for (i = 0; i < numOfImages; i++) {\n images[i].style.display = 'none';\n dots[i].style.backgroundColor = defaultColor;\n }\n\n //For the image we want to see set it to block\n images[newIndex - 1].style.display = 'block';\n dots[newIndex - 1].style.backgroundColor = highlightColor\n }", "title": "" }, { "docid": "49616a5a4789435a6efa4e864e477b62", "score": "0.6150666", "text": "function onItemImageUpdated(event, index){\n\t\t\n\t\tvar objItem = t.getItem(index);\t\t\n\t\tcheckPreloadItemImage(objItem);\t\t\n\t}", "title": "" }, { "docid": "49616a5a4789435a6efa4e864e477b62", "score": "0.6150666", "text": "function onItemImageUpdated(event, index){\n\t\t\n\t\tvar objItem = t.getItem(index);\t\t\n\t\tcheckPreloadItemImage(objItem);\t\t\n\t}", "title": "" }, { "docid": "51afcc19b54d1c8c67ab9e16228e3444", "score": "0.6128562", "text": "function renderThreeImages() {\n\n leftImageIndex = generateRandomIndex();\n centerImageIndex = generateRandomIndex();\n rightImageIndex = generateRandomIndex();\n\n while\n (\n leftImageIndex === centerImageIndex\n || leftImageIndex === rightImageIndex\n || centerImageIndex === rightImageIndex\n // dont display twice in-series checker\n || displayedImages.includes(leftImageIndex)\n || displayedImages.includes(centerImageIndex)\n || displayedImages.includes(rightImageIndex)\n\n ) {\n leftImageIndex = generateRandomIndex();\n centerImageIndex = generateRandomIndex();\n rightImageIndex = generateRandomIndex();\n }\n\n\n // dont display same images in the next round \n displayedImages = []; // reset my global array\n displayedImages = [leftImageIndex, centerImageIndex, rightImageIndex]; // update the values again\n // console.log(displayedImages);\n\n //seen++\n myImages[leftImageIndex].seen++;\n myImages[centerImageIndex].seen++;\n myImages[rightImageIndex].seen++;\n\n // console.log('===2222');\n // console.log(myImages);\n\n // give it src attribute\n leftImage.src = myImages[leftImageIndex].soucre;\n centerImage.src = myImages[centerImageIndex].soucre;\n rightImage.src = myImages[rightImageIndex].soucre;\n\n // console.log('inside the fun - to check ');\n // console.log(leftImage.src);\n // console.log(centerImage.src);\n // console.log(rightImage.src);\n\n}", "title": "" }, { "docid": "6e2382daf422c3aece9d0df635806862", "score": "0.6121012", "text": "function loadZoomOutImages(i) {\n\t\tif (i < 77) {\n\t\t\tpicnumstring = ('00000' + i).slice(-5);\n\t\t\tinnerProject = currentInnerProject();\n\t\t\tpicstring = './sequences/rotate/ZOOMOUT/' + innerProject + '/' + innerProject + '_' + picnumstring + '.jpg';\n\t\t\t$('#configurator .inset-0').prepend('<img class=\"hidden sequence-image outer-' + innerProject + '-' + picnumstring + '\" src=\"' + picstring + '\">');\n\t\t\tanimTimer = setTimeout(function(){ loadZoomOutImages(i + 1) }, 50);\n\n\t\t\t\n\t\t} else {\n\t\t\tloadedProjects.push(innerProject);\n\t\t}\n\n\t}", "title": "" }, { "docid": "082097beb500a06e82864b58c71eee8c", "score": "0.60946727", "text": "function fadeout(index, imageList){\n let opacity = 1;\n\tlet image = document.getElementsByClassName(\"image\")[0];\n\tlet timer = setInterval(function() {\n if (opacity <= 0) {\n clearInterval(timer);\n image.style.height = \"\";\n image.style.width = \"\";\n\t\t\tloadImage(index, imageList);\n\t\t}\n\t\timage.style.opacity = opacity;\n\t\topacity -= 0.1;\n\t}, 30);\n}", "title": "" }, { "docid": "b1a43a9cdf6911ee4538400bc41e68c0", "score": "0.6037772", "text": "function showImage (index){\r\n var img = document.querySelector('#image');\r\n var msg = document.querySelector('#msg');\r\n if (index >= 0 && index <= imageCount){\r\n img.setAttribute(\"src\", \"images/\" +index +\".jpg\");\r\n msg.style.display = 'none';\r\n img.style.display = 'block';\r\n }\r\n}", "title": "" }, { "docid": "16074e34795cd00a822cfb2ebbe3c437", "score": "0.60286105", "text": "reorderImages() {\n let images = this.state.images;\n let index = this.state.index;\n let newImages = images.slice();\n if (index === 0) {\n index = index + 1;\n newImages = images.slice(-1).concat(images.slice(0,-1));\n } else if (index === images.length-1) {\n index = index - 1;\n newImages = images.slice(1).concat(images[0]);\n }\n newImages.forEach((image, i) => {\n if (i !== index) {\n image.opacity.setValue(1);\n image.color = this.randomColor();\n }\n })\n this.setState({\n images: newImages,\n index: index,\n scrollValue: new Animated.Value(index)\n });\n }", "title": "" }, { "docid": "ce8282b275fcfb494d42665bf834f182", "score": "0.60259354", "text": "function previousFunction() {\n // set image to highest index when moving past 0\n if(imageIndex == 0){\n imageIndex = images.length - 1;\n\n }\n else{\n imageIndex--;\n }\n\n// Add the source attribute with the value of \"images\" stored array that are triggered from individual index image counter.\n image.setAttribute(\"src\", images[imageIndex]);\n }", "title": "" }, { "docid": "0d249677e79d6fb34192e742546a685f", "score": "0.6025077", "text": "function imageLoader()\n{\n loadedImages++;\n if(loadedImages === totalImages)\n {\n ready = true;\n loader.hidden = true;\n count = 30;\n }\n}", "title": "" }, { "docid": "a8218525ee9c105d1cac5905d4088f3c", "score": "0.60225636", "text": "function findImagesToLoad() {\n\tsetLazyImagePositions.call(this);\n\tvar imagesToLoad = getImagesInView(this.images);\n\tloadImages.call(this, imagesToLoad);\n}", "title": "" }, { "docid": "9c2ca150af0d15109b2c32ab7cff4574", "score": "0.60082513", "text": "function fetchThumbs(){\n var interval=window.setInterval(function(){\n if(typeof thumbs.images[thumbs.index] == 'undefined'){\n var src=thumbs.scheme(thumbs.index);\n console.log(src);\n thumbs.images[thumbs.index]=cache_image(src);\n }\n thumbs.index++;\n if(thumbs.index>=opt.frames){\n window.clearInterval(interval);\n flipper.invoke.fetchCompletion();\n }\n },opt.rate||50);\n }", "title": "" }, { "docid": "0f96b7c48727894a6f2ffc3ee21aefbb", "score": "0.60065556", "text": "function loadImg(){\t\t\r\n\t\treloadCount = 5;\r\n\t\tfor(var i = 0; i < 15; i++){\r\n\t\t\tplayerVideo[roleNum[i]] = [];\r\n\t\t\tfor(var j = 0; j< 2; j++){\r\n\t\t\t\tplayerVideo[roleNum[i]][j] = [];\r\n\t\t\t\tplayerVideo[roleNum[i]][j][0] = false;\r\n//\t\t\t\tplayerVideo[roleNum[i]][j][1] = \"./img/ani/role/\"+roleNum[i]+\"/\"+direct[j]+\"/role.png\";\r\n\t\t\t\tplayerVideo[roleNum[i]][j][1] = \"./img/ani/role/\"+roleNum[i]+\"/\"+direct[j]+\"/1.png\";\r\n\t\t\t\timgLoad(playerVideo[roleNum[i]],j,playerVideo[roleNum[i]][j][1]);\t\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\tfor(var i = 1; i <= 3; i++){\r\n\t\t\tplayerBack[i] = [];\r\n\t\t\tfor(var j = 0; j< 2; j++){\r\n\t\t\t\tplayerBack[i][j] = [];\r\n\t\t\t\tfor(var k = 1; k<3; k++){\r\n\t\t\t\t\tplayerBack[i][j][k] = [];\r\n\t\t\t\t\tplayerBack[i][j][k][0] = false;\r\n\t\t\t\t\tplayerBack[i][j][k][1] = \"./img/ani/bg/\"+i+\"/\"+direct[j]+\"/\"+k+\".png\";\r\n\t\t\t\t\timgLoad(playerBack[i][j],k,playerBack[i][j][k][1]);\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\tfor(var i = 0; i < 15; i++){\r\n\t\t\tplayerEff[roleNum[i]] = [];\r\n\t\t\tfor(var j = 0; j< 2; j++){\r\n\t\t\t\tplayerEff[roleNum[i]][j] = [];\r\n\t\t\t\tfor(var k = 1; k<9; k++){\r\n\t\t\t\t\tplayerEff[roleNum[i]][j][k] = [];\r\n\t\t\t\t\tplayerEff[roleNum[i]][j][k][0] = false;\r\n\t\t\t\t\tplayerEff[roleNum[i]][j][k][1] = \"./img/ani/effect/\"+roleNum[i]+\"/\"+direct[j]+\"/\"+k+\".png\";\r\n\t\t\t\t\timgLoad(playerEff[roleNum[i]][j],k, playerEff[roleNum[i]][j][k][1]);\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tisFirstTimeLoadingImg = false;\r\n\t\tsetTimeout(function(){\r\n\t\t\treloadAniImg();\r\n\t\t},3000);\r\n\t}", "title": "" }, { "docid": "5115deb4c8793ded445126ee837d405d", "score": "0.6003634", "text": "function changeImage() {\r\n $(\"img\").show();\r\n myImage.setAttribute(\"src\", images[imageIndex]);\r\n imageIndex++;\r\n\r\n}", "title": "" }, { "docid": "a440f68a12893beb3af29e513f229b65", "score": "0.6003496", "text": "function updateImages() {\n canvas.clear();\n const imgArray = [];\n for (var i = 0; i < this.value; i++) {\n imgArray.push(path);\n }\n\n imgArray.forEach((image, index) => {\n fabric.Image.fromURL(image, function(img) {\n var x = 100 + (15 * index);\n console.log(\"index value is: \" + index);\n var img = img.scale(0.8);\n img.set(\"left\", x);\n // alert(\"X value is\" + x);\n img.set(\"top\", 100);\n img.selectable = false;\n canvas.add(img);\n });\n });\n}", "title": "" }, { "docid": "03cc3b7b4a6e60537d8ad65007be74d1", "score": "0.5996729", "text": "function preload() {\r\n \"use strict\";\r\n for (i = 0; i < count; i++) {\r\n image.src = images[i];\r\n image2.src = largeImages[i];\r\n images.push(image);\r\n largeImages.push(image2);\r\n }\r\n}", "title": "" }, { "docid": "03cc3b7b4a6e60537d8ad65007be74d1", "score": "0.5996729", "text": "function preload() {\r\n \"use strict\";\r\n for (i = 0; i < count; i++) {\r\n image.src = images[i];\r\n image2.src = largeImages[i];\r\n images.push(image);\r\n largeImages.push(image2);\r\n }\r\n}", "title": "" }, { "docid": "e20da6e0545aeeef4098b159f6b3f90e", "score": "0.59578645", "text": "function changeImages() {\n if (document.images && (preloadFlag == true)) {\n for (var i=0; i<changeImages.arguments.length; i+=2) {\n document[changeImages.arguments[i]].src = changeImages.arguments[i+1];\n }\n }\n}", "title": "" }, { "docid": "4a338d859784971d9bb7ede7caa47c06", "score": "0.59568226", "text": "function cacheImages(array)\n{\n\tvar img = new Image();\n\tfor (var item in array)\n\t\timg.src = item;\n}", "title": "" }, { "docid": "c94d7a75b41d482107ba2a9cf786b67d", "score": "0.5944547", "text": "function loadImages() {\r\n\tvar imageList = [\r\n\t\t{varName: playerImage, theFile: \"client/images/rr_002.png\"},\r\n\t\t{tileType: TILE_GRASS, theFile: \"client/images/grass.jpg\"},\r\n\t\t{tileType: TILE_HEDGE, theFile: \"client/images/hedge.png\"},\r\n\t\t{tileType: TILE_BISCUIT, theFile: \"client/images/dog_biscuit.png\"},\r\n\t\t{tileType: TILE_GATE, theFile: \"client/images/redgate_small.png\"},\r\n\t\t{tileType: TILE_OPEN_GATE, theFile: \"client/images/redgate_open.png\"},\r\n\t\t{tileType: TILE_EXIT_ONE, theFile: \"client/images/redgate_small.png\"},\r\n\t\t{tileType: TILE_EXIT_TWO, theFile: \"client/images/redgate_small.png\"},\r\n\t\t{tileType: TILE_BAD_BISCUIT, theFile: \"client/images/dog_biscuit.png\"},\r\n\t\t{tileType: TILE_POOP, theFile: \"client/images/poop.png\"}\r\n\t\t];\r\n\r\n\r\n\tnumberOfImages = imageList.length; //number of images now equals the length of the array\r\n\r\n//loop through array and load each image\r\n\tfor(var i=0;i<imageList.length;i++) {\r\n\r\n\t\tif(imageList[i].varName != undefined) {\r\n\t\t\tbeginLoadingImage(imageList[i].varName, imageList[i].theFile);\r\n\t\t} else {\r\n\t\t\tloadImagesForMapTiles(imageList[i].tileType, imageList[i].theFile);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "2b9bdf082b53755f755a17a208033042", "score": "0.59418106", "text": "function preload(){\n images_classic[0] = loadImage('images/LiebesOrakel.png');\n images_classic[1] = loadImage('images/DigitalAnxietyHelp.png');\n images_classic[2] = loadImage('images/3Dporn.png');\n images_classic[3] = loadImage('images/OnlineConfession.png');\n}", "title": "" }, { "docid": "8ccc321167499a21c53a895404a3a43c", "score": "0.59372693", "text": "function cacheImages(imgs) {\n imgs.forEach(function(img) {\n var originalUrl = img.src;\n // Are we already using a cached image?\n if (isCached(originalUrl)) return;\n // Exclude certain domains **FOR TESTING ONLY -- REMOVE**\n if (originalUrl.match(/formhub/)) return;\n\n // Check if the image is already in the cache\n var cachedUrl = guessFileSystemURL(originalUrl);\n resolveLocalFileSystemURL(cachedUrl, function(url) {\n // If it is, set the image source to the cached version\n img.src = cachedUrl;\n }, function(err) {\n // If not, then wait until the image is loaded, then kick off\n // a worker script to download and cache the image\n img.addEventListener('load', onLoad);\n });\n });\n}", "title": "" }, { "docid": "54f45c4a176b12d9d89f8effe7b93a30", "score": "0.5936851", "text": "function nextFunction() {\n if(imageIndex === images.length - 1){\n imageIndex = 0;\n }\n else{\n imageIndex++;\n }\n\n// Add the source attribute with the value of \"images\" stored array that are triggered from individual index image counter.\n image.setAttribute(\"src\", images[imageIndex]); \n }", "title": "" }, { "docid": "b2f56d807076bf029e1b3c2eca01c327", "score": "0.59339225", "text": "function load_assets(){\n\tvar num_loaded = 0;\n\tvar total_images = 0;\n\tfor (var key in images) {\n\t\tif (images.hasOwnProperty(key)) {\n\t\t\ttotal_images++;\n\t\t}\n\t}\n\tfor (var key in images) {\n\t\tif (images.hasOwnProperty(key)) {\n\t\t\timages[key].loaded = false;\n\t\t\timages[key].obj = new Image();\n\t\t\timages[key].obj.src = image_path + images[key].src;\n\t\t\timages[key].obj.onload = function(){\n\t\t\t\timages[key].loaded = true;\n\t\t\t\tnum_loaded++;\n\t\t\t\tif (num_loaded == total_images){\n\t\t\t\t\tassets_loaded();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0149729830163b637c7dba1bc9e5f6c4", "score": "0.5926118", "text": "function onItemImageUpdate(event, index, urlImage){\n\t\t\t\t\n\t\tif(g_objSlide1.data(\"index\") == index){\n\t\t\tobjItem = g_gallery.getItem(index);\n\t\t\tsetImageToSlide(g_objSlide1, objItem, true);\t//force\n\t\t}\n\t\t\n\t\tif(g_objSlide2.data(\"index\") == index){\n\t\t\tobjItem = g_gallery.getItem(index);\n\t\t\tsetImageToSlide(g_objSlide2, objItem, true);\n\t\t}\n\t\t\n\t\tif(g_objSlide3.data(\"index\") == index){\n\t\t\tobjItem = g_gallery.getItem(index);\n\t\t\tsetImageToSlide(g_objSlide3, objItem, true);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "0149729830163b637c7dba1bc9e5f6c4", "score": "0.5926118", "text": "function onItemImageUpdate(event, index, urlImage){\n\t\t\t\t\n\t\tif(g_objSlide1.data(\"index\") == index){\n\t\t\tobjItem = g_gallery.getItem(index);\n\t\t\tsetImageToSlide(g_objSlide1, objItem, true);\t//force\n\t\t}\n\t\t\n\t\tif(g_objSlide2.data(\"index\") == index){\n\t\t\tobjItem = g_gallery.getItem(index);\n\t\t\tsetImageToSlide(g_objSlide2, objItem, true);\n\t\t}\n\t\t\n\t\tif(g_objSlide3.data(\"index\") == index){\n\t\t\tobjItem = g_gallery.getItem(index);\n\t\t\tsetImageToSlide(g_objSlide3, objItem, true);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "fffdd454dd74f91d9318098455a65982", "score": "0.59205455", "text": "preloadImages(node, images) {\n var imagesLoaded = 0;\n\n var imgLoaded = () => {\n imagesLoaded++;\n\n if (imagesLoaded === images.length) {\n this.setState({\n maxHeight: this.props.expanded ? node.scrollHeight + 'px' : 0,\n overflow: 'hidden'\n });\n }\n };\n\n for (let i = 0; i < images.length; i += 1) {\n let img = new Image();\n img.src = images[i].src;\n img.onload = img.onerror = imgLoaded;\n }\n }", "title": "" }, { "docid": "fafec53dc377ec86acbb63eeae7eaf4a", "score": "0.59162086", "text": "function loadImages(i, dir) {\n\t\tif (i < 406 && i > -1) {\n\t\t\t$('#progress-bar-3d').removeClass('hidden');\n\n\t\t\tproject = currentProject();\n\t\t\tpicnumstring = ('00000' + i).slice(-5);\n\t\t\tpicstring = path + '/' + project +'/' + project + '_' + picnumstring + '.jpg';\n\n\t\t\t$('#configurator .inset-0').prepend('<img class=\"hidden sequence-image ' + project + '-' + picnumstring + '\" src=\"' + picstring + '\">');\n\t\t\t\n\t\t\t// If slider changed to a position image not loaded yet, now lets show it to user.\n\t\t\tif ($('#slider').val() * 4 == i) {\n\t\t\t\tsetPic(i);\n\t\t\t}\n\n\t\t\tif (dir == 'right') {\n\t\t\t\tsetTimeout(function(){ loadImages(i+4, 'right') }, 50);\n\t\t\t}\n\t\t\tif (dir == 'left') {\n\t\t\t\tsetTimeout(function(){ loadImages(i-4, 'left') }, 50);\n\t\t\t}\n\n\t\t\tif (dir == 'start') {\n\t\t\t\tsetTimeout(function(){ loadImages(i+4, 'right') }, 50);\n\t\t\t\tsetTimeout(function(){ loadImages(i-4, 'left') }, 50);\n\t\t\t}\n\t\t} else {\n\t\t\t// All images loaded.\n\t\t\t$('#progress-bar-3d').addClass('hidden');\n\t\t}\n\n\t}", "title": "" }, { "docid": "abbb4567f1786b700d0e6e134aedf720", "score": "0.59000343", "text": "function preload() {\n imgs[0] = loadImage('https://i.imgur.com/Co34OXy.png')\n imgs[1]= loadImage('https://i.imgur.com/WWeMZFO.png')\n imgs[2]= loadImage('https://i.imgur.com/v6r3eoA.png')\n imgs[3]= loadImage('https://i.imgur.com/72mIk78.png')\n}", "title": "" }, { "docid": "dec0d417e3b3be0fbd5c045fda6074a2", "score": "0.58913773", "text": "function imgUpdate(thumbnailIndex) {\n var thumbnail = document.getElementsByClassName('thumbnail');\n var i;\n\n /*Sets all thumbnails to semi-transparant.*/\n for (i = 0; i < thumbnail.length; i++) {\n thumbnail[i].style.opacity = 0.5;\n }\n\n /*Changes gallery image.*/\n switch (thumbnailIndex) {\n case 0:\n document.getElementById('currentImage').src =\n '../images/details-page/living-room.jpg';\n break;\n case 1:\n document.getElementById('currentImage').src =\n '../images/details-page/bathroom.jpg';\n break;\n case 2:\n document.getElementById('currentImage').src =\n '../images/details-page/bedroom.jpg';\n break;\n case 3:\n document.getElementById('currentImage').src =\n '../images/details-page/kitchen.jpg';\n break;\n }\n\n /*Sets chosen thumbnail to fully opacity to give the illusion it is active.*/\n thumbnail[thumbnailIndex].style.opacity = 1;\n}", "title": "" }, { "docid": "334feb6b835a57cd830430d9b405474a", "score": "0.58742625", "text": "function preload_sequential() {\n\n if (images[i].complete == true) {\n showimage(i);\n i++;\n }\n }", "title": "" }, { "docid": "2ff855d4d04d178af96dc305f5cc2be0", "score": "0.58737224", "text": "function reloadAniImg(){\r\n\t\tif(getEle(\"alreadyLoadingPlayerRole\").value != 1 && reloadCount > 0){\r\n\t\t\tfor(var i = 0; i < 15; i++){\r\n\t\t\t\tplayerVideo[roleNum[i]] = [];\r\n\t\t\t\tfor(var j = 0; j< 2; j++){\r\n\t\t\t\t\tif(playerVideo[roleNum[i]][j][0] != true){\r\n\t\t\t\t\t\timgLoad(playerVideo[roleNum[i]],j,playerVideo[roleNum[i]][j][1]);\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tfor(var i = 1; i <= 3; i++){\r\n\t\t\t\tplayerBack[i] = [];\r\n\t\t\t\tfor(var j = 0; j< 2; j++){\r\n\t\t\t\t\tplayerBack[i][j] = [];\r\n\t\t\t\t\tfor(var k = 1; k<3; k++){\r\n\t\t\t\t\t\tif(playerBack[i][j][k][0] != true){\r\n\t\t\t\t\t\t\timgLoad(playerBack[i][j],k,playerBack[i][j][k][1]);\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tfor(var i = 0; i < 15; i++){\r\n\t\t\t\tplayerEff[roleNum[i]] = [];\r\n\t\t\t\tfor(var j = 0; j< 2; j++){\r\n\t\t\t\t\tplayerEff[roleNum[i]][j] = [];\r\n\t\t\t\t\tfor(var k = 1; k<9; k++){\r\n\t\t\t\t\t\tif(playerEff[roleNum[i]][j][k][0] != true){\r\n\t\t\t\t\t\t\timgLoad(playerEff[roleNum[i]][j],k, playerEff[roleNum[i]][j][k][1]);\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treloadCount--;\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\treloadAniImg();\r\n\t\t\t},3000);\r\n\t\t}\r\n\t\telse{\r\n\t\t\treloadCount = 0;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e40692c9687fb18db2ad9fbae0a4ab77", "score": "0.5868177", "text": "previous() {\n if(this.props.count === this.state.images.length - 1) this.loadCanvas()\n this.startDeleteAll();\n this.loadImg(this.canvasWdt, this.canvasHgt)\n }", "title": "" }, { "docid": "5429b7abd5e7bd468680d9d6fb64457a", "score": "0.5864839", "text": "function fadein(imageWidth,imageHeight,index,imageList) {\n let image = document.getElementsByClassName(\"image\")[0];\n let opacity = 0; // initial opacity\n let timer = setInterval(function() {\n if (opacity >= 1) { clearInterval(timer); }\n document.getElementsByClassName(\"image\")[0].style.opacity = opacity;\n opacity += 0.1;\n }, 30);\n}", "title": "" }, { "docid": "9853476547faba7e5ebf6606dd04cc32", "score": "0.58628535", "text": "function renderImage(){\n imgContainer.innerHTML = `<img src=\"${images[index]}\">`;\n}", "title": "" }, { "docid": "652de5a38a9d805ef89609251a6caf05", "score": "0.5857201", "text": "function _preload_neighbor_images() {\n\t\t\tif ( (settings['imageArray'].length -1) > settings['activeImage'] ) {\n\t\t\t\tobjNext = new Image();\n\t\t\t\tobjNext.src = settings['imageArray'][settings['activeImage'] + 1][0];\n\t\t\t}\n\t\t\tif ( settings['activeImage'] > 0 ) {\n\t\t\t\tobjPrev = new Image();\n\t\t\t\tobjPrev.src = settings['imageArray'][settings['activeImage'] -1][0];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "23227b9430c14267bda9b03afc3dd7f9", "score": "0.58553934", "text": "getPics() {\n\t\tlet url = '/homes/' + this.state.homeId + '/images';\n\t\tfetch(url)\n\t\t.then((res)=>{return res.json()})\n\t\t.then((data)=>{\n\t\t\tdata = data.map((obj, index) => {\n\t\t\t\tobj.index = index;\n\t\t\t\treturn obj\n\t\t\t})\n\t\t\tthis.setState({\n\t\t\t\timagesArr: data,\n\t\t\t\tfeatureImgObj: data[0]\n\t\t\t})\n\t\t})\n\t\t.catch( (err)=> console.log(err) )\n\t}", "title": "" }, { "docid": "b8b070b57468dc0d45a445c4f8d34ffd", "score": "0.58537483", "text": "function preload() {\r\n for (let i = 0; i < 2; i++) {\r\n let index = nf(i + 1, 4, 0);\r\n\tlet lbl1=localStorage.getItem(\"lbl1\");\r\n\tlet lbl2=localStorage.getItem(\"lbl2\");\r\n\t\r\n happy[i] = loadImage(`images/`+lbl1+`/`+lbl1+`-${index}.jpg`);\r\n sad[i] = loadImage(`images/`+lbl2+`/`+lbl2+`-${index}.jpg`);\r\n // tigers[i] = loadImage(`images/tiger/tiger${index}.jpg`);\r\n }\r\n}", "title": "" }, { "docid": "ae0d63325652c2f0ca79f3601e2e26a2", "score": "0.5847871", "text": "function showimage(i) {\n if (checkFlag[i] == false) {\n counter++;\n options.oneachload(images[i]);\n checkFlag[i] = true;\n }\n\n if (options.imagedelay == 0 && options.delay == 0)\n $(images[i]).css(\"visibility\", \"visible\").animate({ opacity: 1 }, 700);\n else if (options.delay == 0) {\n imagedelayer(images[i], j);\n j += options.imagedelay;\n }\n else if (options.imagedelay == 0) {\n imagedelayer(images[i], options.delay);\n\n }\n else {\n imagedelayer(images[i], (options.delay + j));\n j += options.imagedelay;\n }\n\n }", "title": "" }, { "docid": "e0651448d22bdcbc5aafcab69b1d6bf8", "score": "0.5839776", "text": "function ImageObject(url, node, index, cssIndex) {\n\t\tthis.url = url;\n\t\tthis.node = node;\n\t\tthis.index = index;\n\t\tthis.cssIndex = cssIndex;\n\t\tthis.isRightOfCenter = true;\n\t\tthis.imageIsLoaded = false;\n\t\tthis.isVisible = false;\n\t\t\t\t\n\t\tthis.show = function(arg) {\n//\t\t\tlog('showing', this.index);\n\t\t\tthis.isVisible = true;\n\t\t\tthis.node.show(arg);\n\t\t\tif(!this.imageIsLoaded) {\n\t\t\t\tthis.node.find('img').attr('src', this.url);\n this.node.find('img').css('opacity',opacity);\n\t\t\t\tthis.imageIsLoaded = true;\n\t\t\t\t//log('loading image for indes' , imageObj.index);\n\t\t\t\t//TODO check if width/height is more that 3/4, and change image class to be wide\n\t\t\t}\n\t\t};\n\t\tthis.hide = function(arg) {\n//\t\t\tlog('hiding', this.index);\n\t\t\tthis.isVisible = false;\n\t\t\tthis.node.hide(arg);\n\t\t};\n\n\t}", "title": "" }, { "docid": "b2aa96d88150762d561ff6e823eb2a27", "score": "0.5834946", "text": "function loadItems() {\n fetch(`/load?page=${counter}`).then((response) => {\n response.json().then((data) => {\n\n if (!data.length) {\n sentinel.innerHTML = \"NO MORE IMAGES\";\n return;\n }\n\n for (let i = 0; i < data.length; i++) {\n data[i].DOM = document.createElement('img');\n data[i].DOM.src = data[i]['url'];\n data[i].DOM.className = 'image-item';\n scroller.appendChild(data[i].DOM);\n alldata.push(data[i]);\n }\n\n alldata.forEach(item => {\n $(item.DOM).on('click', function (e) {\n lightbox.classList.add('active');\n const flink = document.createElement('a');\n const focus = document.createElement('img');\n flink.className = 'focus';\n focus.className = 'focus';\n flink.href = item['unsplashed'];\n focus.src = this.src;\n\n const desc = document.createElement('label');\n if(item['caption'] == null)\n desc.innerHTML = \"Image by \" + item['author'];\n else {\n if(item['caption'].length > 50)\n desc.innerHTML = item['caption'].substring(0, 50) + '...';\n else\n desc.innerHTML = item['caption'];\n }\n desc.id = 'caption';\n while(lightbox.firstChild)\n lightbox.removeChild(lightbox.firstChild);\n\n lightbox.appendChild(flink);\n flink.appendChild(focus);\n lightbox.appendChild(desc);\n })\n });\n\n\n const display = $('.display');\n let _cols = Number(display.css('column-count'))\n for(let _col = 0; _col < _cols; _col++) {\n for (let i = 0; i < alldata.length; i += _cols) {\n if (alldata[i + _col].DOM !== undefined)\n scroller.appendChild(alldata[i + _col].DOM);\n\n }\n }\n\n })\n })\n}", "title": "" }, { "docid": "c5a90c4c351c2fe3d406a3fec3242c42", "score": "0.58283466", "text": "function preloadImages(call_back) {\n loaded_images[loaded_img_counter] = new Image();\n loaded_images[loaded_img_counter].src = image_urls[loaded_img_counter];\n loaded_images[loaded_img_counter].onload = function () {\n //increment\n loaded_img_counter++;\n\n //check if all images is fully loaded\n if (loaded_img_counter >= image_urls_length) { //case base\n call_back();\n\n } else {\n call_back();\n preloadImages(call_back);\n }\n };\n\n loaded_images[loaded_img_counter].onerror = function () {\n //increment\n loaded_img_counter++;\n\n //check if all images is fully loaded\n if (loaded_img_counter >= image_urls_length) { //base case\n call_back();\n\n } else {\n call_back();\n preloadImages(call_back);\n }\n };\n }", "title": "" }, { "docid": "fc05e760ed23edd7cc28cd5f094d701f", "score": "0.5826887", "text": "function LoadImages() {\n var microtime= Date.now();\n //console.log(microtime);\n\n $.imgpreloader({\n paths: [ SERVER_CAM+microtime ]\n }).done(function($allImages){\n $(\"#output\").html($allImages);\n //console.log(\"cargada imagen\");\n });\n }", "title": "" }, { "docid": "31b9a18727a10c7801fa4a34b1d3cd0f", "score": "0.5824425", "text": "function loadImages() {\n var counter = 0;\n var images = $('.lqva-lazy-load-images');\n\n images.each(function() {\n loadImage (this);\n counter++;\n });\n\n}//loadImages()", "title": "" }, { "docid": "2411806e133ccb192bdb3c80f4cbd6d9", "score": "0.58239955", "text": "function buildImages(options){\t\r\n\t//Loop for lazy loading images.\t\r\n\tfor(var i = 1; i <= options.totalImages; i++){\r\n\t\tvar filename = options.fileObj.filePath + '' + i + '.' + options.fileObj.fileExt,//Path to images\r\n\t\t\timg = new Image, //New img obj for lazy loading images\r\n\t\t\tdataStr = '', //placeholder for datapoints to show images\r\n\t\t\topacity = 0,\r\n\t\t\tk = 1, //Loop counter for nested loop.\r\n\t\t\tloopIteratorTwo = (i == options.totalImages ? 2 : 3);//Figure out second loop iterator. \r\n\t\t\t\r\n\t\timg.src = filename;//Set image path\r\n\t\t\r\n\t\t//If we are on the first image, set its opacity to 1, otherwise it will be 0 by default.\r\n\t\tif(i === 1){\r\n\t\t\topacity = 1;\r\n\t\t}\r\n\t\t\r\n\t\t//Build the first data point. Will be 0 for all point except the first image.\r\n\t\tdataStr = 'data-' + options.startPoint + 'p=\"opacity: ' + opacity + ';\"';\r\n\t\t\r\n\t\tfor(var j = (i - 1); k <= loopIteratorTwo; j++){\t\t\t\r\n\t\t\topacity = 0;//Reset opacity to zero.\r\n\t\t\t\r\n\t\t\t//If we are on the current image that needs to be shown on the data point\r\n\t\t\tif(j === i){\r\n\t\t\t\topacity = 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Build 3 other data point for the frames to be shown and hidden.\r\n\t\t\tdataStr = dataStr + 'data-' + ((options.frameInterval * j) + options.startPoint) + 'p=\"opacity: ' + opacity + ';\"';\r\n\t\t\t\r\n\t\t\tk++;//Increment loop counter.\r\n\t\t}\r\n\t\t\r\n\t\t//Build image tag with data points and add to var to to added to DOM later.\r\n\t\toptions.lazyImage = options.lazyImage + '<img src=\"' + img.src + '\" ' + dataStr + '/>';\t\t\r\n\t}\r\n\t\r\n\treturn options.lazyImage;\r\n\t\r\n}", "title": "" }, { "docid": "dd1e8f92c3218fd2bb84fee3373f912e", "score": "0.5823619", "text": "function _preload_neighbor_images() {\n if ( (settings.imageArray.length -1) > settings.activeImage ) {\n objNext = new Image();\n objNext.src = settings.imageArray[settings.activeImage + 1][0];\n }\n if ( settings.activeImage > 0 ) {\n objPrev = new Image();\n objPrev.src = settings.imageArray[settings.activeImage -1][0];\n }\n }", "title": "" }, { "docid": "8fb5404c303450db3f63a23d3e9e7a81", "score": "0.5820449", "text": "function preload() {\n images[0] = loadImage('assets/one.png');\n images[1] = loadImage('assets/two.png');\n images[2] = loadImage('assets/three.png');\n images[3] = loadImage('assets/four.png');\n images[4] = loadImage('assets/five.png');\n images[5] = loadImage('assets/splash.png');\n}", "title": "" }, { "docid": "a3cd81d52f15ac9ac737cac690b5a50c", "score": "0.5813298", "text": "loadImages () {\n if (this.images.length) {\n this.images.forEach((image) => {\n this.loadImage(image);\n });\n }\n }", "title": "" }, { "docid": "d37d51915648e18de06739be5a012305", "score": "0.58102477", "text": "loadStudyImages(imageIdList) {\n this.element = this.viewPort.element;\n this.imageIdList = imageIdList;\n this.viewPort.resetViewer();\n this.viewPort.resetImageCache(); // clean up image cache\n this.seriesList = []; // start a new series list\n this.currentSeriesIndex = 0; // always display first series\n this.loadedImages = []; // reset list of images already loaded\n //\n // loop thru all imageIds, load and cache them for exhibition (up the the maximum limit defined)\n //\n const maxImages = (this.maxImagesToLoad <= 0) ? imageIdList.length : Math.min(this.maxImagesToLoad, imageIdList.length);\n this.loadingImages = true; // activate progress indicator\n this.targetImageCount = maxImages;\n for (let index = 0; index < maxImages; index++) {\n const imageId = imageIdList[index];\n cornerstone.loadAndCacheImage(imageId).then(imageData => { this.imageLoaded(imageData); });\n }\n }", "title": "" }, { "docid": "d50d906840cef431ade78def658aa22a", "score": "0.58093596", "text": "function newImage() {\n\ncurrentIndx=Math.round(Math.random()*3);\n\ndocument.photo.src=images1Preloaded[currentIndx].src;\n\ndocument.nature.src=images2Preloaded[currentIndx].src;\n\ndocument.contart.src=images3Preloaded[currentIndx].src;\n\ndocument.portrait.src=images4Preloaded[currentIndx].src;\n\n}", "title": "" }, { "docid": "409724bf8c1e990aae6b319152fb4705", "score": "0.5806571", "text": "function displayImageForCurrentIndex() {\n const img = images[index];\n\n // Set the left and right image values\n const skyleftEl = document.querySelector('#sky-left');\n skyleftEl.setAttribute('src', img.leftImageId);\n\n const skyrightEl = document.querySelector('#sky-right');\n skyrightEl.setAttribute('src', img.rightImageId);\n\n // Update the placard text\n const placard = document.querySelector('#placard-text');\n placard.setAttribute('value', img.caption);\n\n // Only show the welcome elements on index zero\n if (index === 0) {\n showWelcomeElements(true);\n } else {\n showWelcomeElements(false);\n }\n }", "title": "" }, { "docid": "1c5c4d6381da98f8d17f5ec65fc7a717", "score": "0.5800567", "text": "function nextImage() {\n var url, lastIndex;\n\n lastIndex = $scope.currentImageIndex;\n $scope.currentImageIndex++;\n if ($scope.currentImageIndex >= numImages) {\n $scope.currentImageIndex = numImages - 1;\n }\n\n if ($scope.currentImageIndex !== lastIndex) {\n url = imageUrl($scope.imagesData[$scope.currentImageIndex]);\n updateMainImage(url);\n }\n }", "title": "" }, { "docid": "761eac17716b8e25d2781a0a1aa4117b", "score": "0.5798976", "text": "function render_images() {\n $(\".image-container\").empty();\n if (state.images.length == 0) {\n render_no_image();\n return;\n }\n for (var i=0,len=state.images.length; i<len; i++) {\n render_image(state.images[i]);\n }\n update_pagination();\n }", "title": "" }, { "docid": "edff257cf2ea96e66931cdb1e338b4b7", "score": "0.5796542", "text": "storeImages(data) {\n const assets = data.edges;\n const newImages = assets.map( asset => {\n var image = asset.node.image;\n image.color = this.randomColor();\n image.opacity = new Animated.Value(1);\n return image;\n });\n Animated.timing(newImages[0].opacity, {toValue: 0, delay: 500, duration: 2000 }).start();\n this.setState({\n images: newImages,\n });\n }", "title": "" }, { "docid": "f37780487d0f35a5e4aa5ea4c817780b", "score": "0.57910436", "text": "function loadImages() {\n head = new Image();\n head.src = '/assets/images/head2.png';\n\n ball = new Image();\n ball.src = '/assets/images/blue.png'\n\n apple = new Image();\n apple.src = '/assets/images/food2.png';\n\n food = new Image();\n food.src = '/assets/images/food.png';\n}", "title": "" }, { "docid": "b0e2acec1ac1f6993da897f0596f9bb9", "score": "0.57904446", "text": "handleImages(lstImgs, time) {\n $.each($(\"img\"), function(i, item) {\n //Skip if image is already replaced\n if ($.inArray($(item).attr(\"src\"), lstImgs) === -1) {\n var h = $(item).height();\n var w = $(item).width();\n\n //If image loaded\n if (h > 0 && w > 0) {\n\n self.handleImg(item, lstImgs);\n } else {\n //Replace when loaded\n $(item).load(function() {\n //Prevent infinite loop\n if ($.inArray($(item).attr(\"src\"), lstImgs) == -1) {\n self.handleImg(item, lstImgs);\n }\n });\n }\n }\n });\n\n //Keep replacing\n if (time > 0) {\n setTimeout(function() {\n self.handleImages(lstImgs, time);\n }, time);\n }\n }", "title": "" }, { "docid": "da5f81418e830fc3b5ea93d6dad7d26e", "score": "0.57892895", "text": "function loadingAnimation() {\n\t\t// set the image property of the imageview by constructing the path with the loaderIndex variable\n\t\timageView.image = '/images/loader/' + loaderIndex + '.png';\n\t\t//increment the index so that next time it loads the next image in the sequence\n\t\tloaderIndex++;\n\t\t// if you have reached the end of the sequence, reset it to 1\n\t\tif (loaderIndex === 8)\n\t\t\tloaderIndex = 1;\n\t}", "title": "" }, { "docid": "e4e181fca47172c2defb5112ebfa131b", "score": "0.5787624", "text": "function prefetch_images(imageArray) {\n $(imageArray).each(function () {\n (new Image()).src = this;\n console.log('Preloading image' + this);\n });\n}", "title": "" }, { "docid": "d2ffa7b31d722567a27945fdef5b05d9", "score": "0.57860565", "text": "loadCurrent(callback = null) {\n\t\tthis.allCurrentImages = this.allImages[this.pag]\n\t\tthis.restartContainer()\n\t\tthis.insertInDOM(this.allCurrentImages)\n\t\tthis.runMasonry()\n\t\tif (typeof callback == \"function\")\n\t\t\tcallback()\n\t}", "title": "" }, { "docid": "6dc1daaf9a95121f6614c0877c17d742", "score": "0.57837105", "text": "function preload() {\n images[0] = loadImage('assets/one.png');\n images[1] = loadImage('assets/two.png');\n images[2] = loadImage('assets/three.png');\n images[3] = loadImage('assets/four.png');\n images[4] = loadImage('assets/five.png');\n images[5] = loadImage('assets/default.png');\n images[6] = loadImage('assets/fit1.png')\n images[7] = loadImage('assets/fit2.png')\n images[8] = loadImage('assets/fit3.png')\n images[9] = loadImage('assets/fit4.png')\n images[10] = loadImage('assets/fit5.png')\n images[11] = loadImage('assets/background1.gif')\n}", "title": "" }, { "docid": "ced75413c0a5db1f7c7bd4a3ed101182", "score": "0.5783249", "text": "function preLoadImg() {\n var arrImg = new Array();\n var count = 0;\n for (var key in projects) {\n for (let i = 0; i < 5; i++) {\n arrImg.push(document.createElement(\"div\"));\n getSrcImage(`${projects[key]}${i}`, arrImg[i*count]);\n count += 1;\n }\n }\n}", "title": "" }, { "docid": "af20e8f8ab104d8aedfa13a59861a5af", "score": "0.577412", "text": "function _preload_neighbor_images() {\r\n\t\t\tif ( (settings.imageArray.length -1) > settings.activeImage ) {\r\n\t\t\t\tobjNext = new Image();\r\n\t\t\t\tobjNext.src = settings.imageArray[settings.activeImage + 1][0];\r\n\t\t\t}\r\n\t\t\tif ( settings.activeImage > 0 ) {\r\n\t\t\t\tobjPrev = new Image();\r\n\t\t\t\tobjPrev.src = settings.imageArray[settings.activeImage -1][0];\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "05ca4ff6fdb9f3bae2d09f3f3758d519", "score": "0.5768327", "text": "function imageLoaded() {\n imagesLoaded++;\n if(imagesLoaded === totalImages) {\n loader.hidden=true\n ready = true\n imagesLoaded=0\n }\n\n}", "title": "" }, { "docid": "fdc5e43e5462f4b5f9b739971298f9c5", "score": "0.5766814", "text": "function imageLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n ready = true;\n loader.hidden = true;\n initialLoad = false;\n count = 30;\n apiUrl = `https://api.unsplash.com/photos/random/?client_id=${apiKey}&count=${count}`;\n }\n}", "title": "" }, { "docid": "988b2af7770ff7f1cd9bcbeb247dd9b1", "score": "0.5766379", "text": "async function _cacheResourceAsync() {\n\n const images = [\n require(\"./assets/icons/back.png\"),\n require(\"./assets/icons/plants.png\"),\n require(\"./assets/icons/seeds.png\"),\n require(\"./assets/icons/flowers.png\"),\n require(\"./assets/icons/sprayers.png\"),\n require(\"./assets/icons/pots.png\"),\n require(\"./assets/icons/fertilizers.png\"),\n require(\"./assets/images/plants_1.png\"),\n require(\"./assets/images/plants_2.png\"),\n require(\"./assets/images/plants_3.png\"),\n require(\"./assets/images/explore_1.png\"),\n require(\"./assets/images/explore_2.png\"),\n require(\"./assets/images/explore_3.png\"),\n require(\"./assets/images/explore_4.png\"),\n require(\"./assets/images/explore_5.png\"),\n require(\"./assets/images/explore_6.png\"),\n require(\"./assets/images/illustration_1.png\"),\n require(\"./assets/images/illustration_2.png\"),\n require(\"./assets/images/illustration_3.png\"),\n require(\"./assets/images/avatar.png\")\n ]; \n\n const cacheImages = images.map(image=> {\n return Asset.fromModule(image).downloadAsync();\n });\n\n return Promise.all(cacheImages);\n }", "title": "" } ]
ddea323f5ae6cbd4b7f0e50b46fd2cae
Shallow copy object (will move to utils/properties in v4)
[ { "docid": "516d4a92f1c43f706313e3aabdd48db2", "score": "0.0", "text": "function shallowCopy(object) {\n var result = {};\n for (var key in object) { result[key] = object[key]; }\n return result;\n}", "title": "" } ]
[ { "docid": "af2701450d394f8af8e342cb7bd5538e", "score": "0.7314185", "text": "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "title": "" }, { "docid": "6d3c67fddefab6795d760d83394384e4", "score": "0.7311464", "text": "function copyProps(src,dst){for(var key in src){dst[key]=src[key]}}", "title": "" }, { "docid": "3aabc6738b62f3febdaa12d8702a4912", "score": "0.71905565", "text": "getProperties(){\n\t\treturn {...this.properties}; // copy property object\n\t}", "title": "" }, { "docid": "4b3992943b703de6f81095e1d2c552df", "score": "0.71728206", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "45d12187760ff51c97af762706ed1650", "score": "0.7062938", "text": "copy(){\n\n //return Object.assign(Object.create(Object.getPrototypeOf(this)), this)\n //return Object.assign(Object.create(Object.getPrototypeOf(this)), {})\n var o = Object.assign({}, this);\n o.copy = this.copy;\n \n return o\n\n }", "title": "" }, { "docid": "90ee317b8ed17c7bcd9fc35eca7cce74", "score": "0.69909257", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "901795c72a28760e6e73920a12ef86b5", "score": "0.69725", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n }", "title": "" }, { "docid": "1354378a03a55f8b7fa0340e85855cea", "score": "0.6965442", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "1354378a03a55f8b7fa0340e85855cea", "score": "0.6965442", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "1354378a03a55f8b7fa0340e85855cea", "score": "0.6965442", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "1354378a03a55f8b7fa0340e85855cea", "score": "0.6965442", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "1354378a03a55f8b7fa0340e85855cea", "score": "0.6965442", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "3c985f8cf4b6eb3331eae4a9ea9e3d26", "score": "0.69410604", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "23951dc54b6239ff55866875a3e727c2", "score": "0.6936306", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n }", "title": "" }, { "docid": "23951dc54b6239ff55866875a3e727c2", "score": "0.6936306", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n }", "title": "" }, { "docid": "9bbe095ffd5ac78ca554fc57199b3c98", "score": "0.6931762", "text": "function deepCopyProperties(target, source, propertyObj) {\n for(var prop in propertyObj)if (Array.isArray(source[prop])) target[prop] = source[prop].slice();\n else target[prop] = source[prop];\n}", "title": "" }, { "docid": "302af8770c73280b2cb00ddbfe451bdd", "score": "0.6896578", "text": "function copyProps(src, dst) {\n for(var key in src)dst[key] = src[key];\n}", "title": "" }, { "docid": "0f29cb0371f3446c9c4ad31bf620d759", "score": "0.6879264", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "27ecc3f2b8f64ac08a93d947156b1ced", "score": "0.6876181", "text": "function copyProps (src, dst) {\n\t\t for (var key in src) {\n\t\t dst[key] = src[key];\n\t\t }\n\t\t}", "title": "" }, { "docid": "b674b98a5af995736c8c22ec8ad51f1c", "score": "0.6856963", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "b674b98a5af995736c8c22ec8ad51f1c", "score": "0.6856963", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "9bb03750ec13aaba2fb55b35956878a1", "score": "0.684602", "text": "function copyProps(src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key];\n\t }\n\t}", "title": "" }, { "docid": "d6ec11bc20032c5129489e8e91d734a3", "score": "0.684123", "text": "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key];\n\t }\n\t}", "title": "" }, { "docid": "d6ec11bc20032c5129489e8e91d734a3", "score": "0.684123", "text": "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key];\n\t }\n\t}", "title": "" }, { "docid": "e05839835b45a11c70540a3bd9f5723e", "score": "0.68397784", "text": "function copyProps (src, dst) {\r\n for (var key in src) {\r\n dst[key] = src[key]\r\n }\r\n}", "title": "" }, { "docid": "81ce5605afdd14ed76f1a8f5a6ea15d0", "score": "0.6836847", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n }", "title": "" }, { "docid": "81ce5605afdd14ed76f1a8f5a6ea15d0", "score": "0.6836847", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n }", "title": "" }, { "docid": "81ce5605afdd14ed76f1a8f5a6ea15d0", "score": "0.6836847", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n }", "title": "" }, { "docid": "81ce5605afdd14ed76f1a8f5a6ea15d0", "score": "0.6836847", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n }", "title": "" }, { "docid": "c86175cc35ed1d2cb6eea50e5f67acd5", "score": "0.6823585", "text": "function _copyProps(props) {\n var propsCopy = {};\n // eslint-disable-next-line no-restricted-syntax\n for (var prop in props) {\n // Because of the way we create and copy the props prototype we\n // can't use getOwnPropertyNames to retrieve the prop getters\n if (prop !== 'getProperty' && prop !== 'setProperty' && prop !== '_ELEMENT' && prop !== '_BRIDGE') {\n propsCopy[prop] = props[prop];\n }\n }\n return propsCopy;\n}", "title": "" }, { "docid": "3426bbaf6bf074d1c04f3234f20cd06f", "score": "0.68044055", "text": "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "title": "" }, { "docid": "3426bbaf6bf074d1c04f3234f20cd06f", "score": "0.68044055", "text": "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "title": "" }, { "docid": "3426bbaf6bf074d1c04f3234f20cd06f", "score": "0.68044055", "text": "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "title": "" }, { "docid": "d3bd3f5c2b2837e051dc4af17872b3a2", "score": "0.6789628", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "d3bd3f5c2b2837e051dc4af17872b3a2", "score": "0.6789628", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "d3bd3f5c2b2837e051dc4af17872b3a2", "score": "0.6789628", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6758968", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "19bb418b05c3b38379e66c22b3ec1cee", "score": "0.6750042", "text": "function copyProperties(obj, a, b, c, d, e, f) {\n obj = obj || {};\n var args = [a, b, c, d, e];\n var ii = 0, v;\n while (args[ii]) {\n v = args[ii++];\n for (var k in v) {\n obj[k] = v[k];\n }\n if (v.hasOwnProperty && v.hasOwnProperty('toString') &&\n (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {\n obj.toString = v.toString;\n }\n }\n return obj;\n }", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" }, { "docid": "a6496c10c3ae6f25bd369aae5687b8f3", "score": "0.6745788", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "title": "" } ]
de989a1c952c504411a12635cc16431b
11.10 Binary Bitwise Operators
[ { "docid": "1a4a744bb84e31751641e46247a84865", "score": "0.0", "text": "function parseBitwiseANDExpression() {\n var expr = parseEqualityExpression();\n \n while (match('&')) {\n lex();\n expr = {\n type: Syntax.BinaryExpression,\n operator: '&',\n left: expr,\n right: parseEqualityExpression()\n };\n }\n \n return expr;\n }", "title": "" } ]
[ { "docid": "970abaebffccb287b6eaa311de68f17c", "score": "0.73411226", "text": "function op_and(x,y){return x&y}", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "6c6521c3ab3d708787861d339c32415b", "score": "0.71620965", "text": "function op_and(x,y) { return x&y; }", "title": "" }, { "docid": "610d038ccea7ad7c14842de68650d688", "score": "0.7155176", "text": "function op_and(x, y) {\r\n return x & y;\r\n}", "title": "" }, { "docid": "93010d269562052aa4742f36effd6603", "score": "0.7137625", "text": "_parseBitwiseXorExpression() {\n let leftExpr = this._parseBitwiseAndExpression();\n if (leftExpr.nodeType === 0) {\n return leftExpr;\n }\n while (true) {\n const peekToken = this._peekToken();\n if (!this._consumeTokenIfOperator(\n 8\n /* BitwiseXor */\n )) {\n break;\n }\n const rightExpr = this._parseBitwiseAndExpression();\n leftExpr = this._createBinaryOperationNode(\n leftExpr,\n rightExpr,\n peekToken,\n 8\n /* BitwiseXor */\n );\n }\n return leftExpr;\n }", "title": "" }, { "docid": "64bb63275f5ed6375b8500a1eaace337", "score": "0.7064968", "text": "function op_and(x, y) {\n return x & y;\n}", "title": "" }, { "docid": "64bb63275f5ed6375b8500a1eaace337", "score": "0.7064968", "text": "function op_and(x, y) {\n return x & y;\n}", "title": "" }, { "docid": "0a64f5ce81a2a06b86256b8e53dcbe1b", "score": "0.7033042", "text": "function op_andnot(x,y){return x&~y}", "title": "" }, { "docid": "27a61efc1314751d70b7c27d3cad13a5", "score": "0.70319825", "text": "function op_and(x, y) {\n return x & y;\n}", "title": "" }, { "docid": "d06c3f3097c1481636a728648835a4a5", "score": "0.70215434", "text": "function nand_operation(a, b){\n\tvar c = 1-(a&b);\n\treturn c;\n}", "title": "" }, { "docid": "e1612c1179d35a939ab6ff4187adecc7", "score": "0.70173323", "text": "function minimalAndOrXorTest() {\n print(255 & 64);\n print(128 | 64);\n print(255 ^ 64);\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "3608ecbd1593b6637a54719334272d55", "score": "0.6988626", "text": "function op_and(x, y) {\n return x & y\n}", "title": "" }, { "docid": "b7dfbc2952c3c04658f49ea6f659e763", "score": "0.69265515", "text": "function op_and(x, y) {\n return x & y;\n }", "title": "" }, { "docid": "3c4150b1845e9d30807344658331ebc4", "score": "0.6912311", "text": "_parseBitwiseAndExpression() {\n let leftExpr = this._parseShiftExpression();\n if (leftExpr.nodeType === 0) {\n return leftExpr;\n }\n while (true) {\n const peekToken = this._peekToken();\n if (!this._consumeTokenIfOperator(\n 3\n /* BitwiseAnd */\n )) {\n break;\n }\n const rightExpr = this._parseShiftExpression();\n leftExpr = this._createBinaryOperationNode(\n leftExpr,\n rightExpr,\n peekToken,\n 3\n /* BitwiseAnd */\n );\n }\n return leftExpr;\n }", "title": "" }, { "docid": "25f6616096ec3b9b75eba9cc75768474", "score": "0.6896492", "text": "function op_and(x, y)\n {\n return x & y;\n }", "title": "" }, { "docid": "25f6616096ec3b9b75eba9cc75768474", "score": "0.6896492", "text": "function op_and(x, y)\n {\n return x & y;\n }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.68899715", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "ac78626ad28db1dee7784596978fd9ce", "score": "0.6885237", "text": "function op_and(x, y) {\n return x & y;\n }", "title": "" }, { "docid": "ac78626ad28db1dee7784596978fd9ce", "score": "0.6885237", "text": "function op_and(x, y) {\n return x & y;\n }", "title": "" } ]
36eefa2179c28f3c3c01eef8ff6f2bd1
Opera 11 puts HTML elements in the null namespace, it seems, and IE 7 has undefined namespaceURI
[ { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.6209723", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" } ]
[ { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.6777294", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.6777294", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.6777294", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.6777294", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.6777294", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "f3308d8895be52a3093bcac48dc799f2", "score": "0.6730925", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "645c7535bab395a5c5b99c6d1538cf0f", "score": "0.643828", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n }", "title": "" }, { "docid": "645c7535bab395a5c5b99c6d1538cf0f", "score": "0.643828", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.62526405", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.62526405", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.62526405", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.62526405", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.62526405", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.62526405", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "03c38185b85d8bc6192cdaa949e1fde4", "score": "0.62108505", "text": "function stripCustomNsAttrs(node){if(node.nodeType===window.Node.ELEMENT_NODE){var attrs=node.attributes;for(var i=0,l=attrs.length;i<l;i++){var attrNode=attrs[i];var attrName=attrNode.name.toLowerCase();if(attrName==='xmlns:ns1'||attrName.lastIndexOf('ns1:',0)===0){node.removeAttributeNode(attrNode);i--;l--;}}}var nextNode=node.firstChild;if(nextNode){stripCustomNsAttrs(nextNode);}nextNode=node.nextSibling;if(nextNode){stripCustomNsAttrs(nextNode);}}", "title": "" }, { "docid": "cf8d089240e251d04c095ce0957df849", "score": "0.6167342", "text": "function interiorNamespace(element) {\n if (element && element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace && !_domHelperBuildHtmlDom.svgHTMLIntegrationPoints[element.tagName]) {\n return _domHelperBuildHtmlDom.svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "cf8d089240e251d04c095ce0957df849", "score": "0.6167342", "text": "function interiorNamespace(element) {\n if (element && element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace && !_domHelperBuildHtmlDom.svgHTMLIntegrationPoints[element.tagName]) {\n return _domHelperBuildHtmlDom.svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "c315f3b4f6ef8196eeac6c3305c6e419", "score": "0.61240715", "text": "function interiorNamespace(element){\n if (\n element &&\n element.namespaceURI === svgNamespace &&\n !svgHTMLIntegrationPoints[element.tagName]\n ) {\n return svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "c315f3b4f6ef8196eeac6c3305c6e419", "score": "0.61240715", "text": "function interiorNamespace(element){\n if (\n element &&\n element.namespaceURI === svgNamespace &&\n !svgHTMLIntegrationPoints[element.tagName]\n ) {\n return svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "c315f3b4f6ef8196eeac6c3305c6e419", "score": "0.61240715", "text": "function interiorNamespace(element){\n if (\n element &&\n element.namespaceURI === svgNamespace &&\n !svgHTMLIntegrationPoints[element.tagName]\n ) {\n return svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "c315f3b4f6ef8196eeac6c3305c6e419", "score": "0.61240715", "text": "function interiorNamespace(element){\n if (\n element &&\n element.namespaceURI === svgNamespace &&\n !svgHTMLIntegrationPoints[element.tagName]\n ) {\n return svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "c315f3b4f6ef8196eeac6c3305c6e419", "score": "0.61240715", "text": "function interiorNamespace(element){\n if (\n element &&\n element.namespaceURI === svgNamespace &&\n !svgHTMLIntegrationPoints[element.tagName]\n ) {\n return svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "06fa5f4dd30dc0435108c6e22349f8cc", "score": "0.58471304", "text": "function n(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!(\"function\"==typeof n.Node?e instanceof n.Node:\"object\"==typeof e&&\"number\"==typeof e.nodeType&&\"string\"==typeof e.nodeName))}", "title": "" }, { "docid": "b1a746d4afb2a3a9fa95b31b60748506", "score": "0.58444023", "text": "function c(a) { var b; return typeof a.namespaceURI == F || null === (b = a.namespaceURI) || \"http://www.w3.org/1999/xhtml\" == b }", "title": "" }, { "docid": "bcef2a0fa2e57f4cded030978a78de1d", "score": "0.58192325", "text": "function n(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!(\"function\"==typeof t.Node?e instanceof t.Node:\"object\"==typeof e&&\"number\"==typeof e.nodeType&&\"string\"==typeof e.nodeName))}", "title": "" }, { "docid": "cad020f303aa12d9423f55a510fff15a", "score": "0.5751002", "text": "function NSResolver(prefix) {\r\n var ns = {\r\n 'xhtml' : 'http://www.w3.org/1999/xhtml'\r\n };\r\n return ns[prefix] || null;\r\n}", "title": "" }, { "docid": "21cf29d2f61ca7feb72bd325f5cab66b", "score": "0.5739608", "text": "function c(a){var b;return typeof a.namespaceURI==F||null===(b=a.namespaceURI)||\"http://www.w3.org/1999/xhtml\"==b}", "title": "" }, { "docid": "21cf29d2f61ca7feb72bd325f5cab66b", "score": "0.5739608", "text": "function c(a){var b;return typeof a.namespaceURI==F||null===(b=a.namespaceURI)||\"http://www.w3.org/1999/xhtml\"==b}", "title": "" }, { "docid": "21cf29d2f61ca7feb72bd325f5cab66b", "score": "0.5739608", "text": "function c(a){var b;return typeof a.namespaceURI==F||null===(b=a.namespaceURI)||\"http://www.w3.org/1999/xhtml\"==b}", "title": "" }, { "docid": "21cf29d2f61ca7feb72bd325f5cab66b", "score": "0.5739608", "text": "function c(a){var b;return typeof a.namespaceURI==F||null===(b=a.namespaceURI)||\"http://www.w3.org/1999/xhtml\"==b}", "title": "" }, { "docid": "edf2f58de4c023fd6206790db27290d7", "score": "0.57232606", "text": "function stripCustomNsAttrs(el) {\n\t DOM.attributeMap(el).forEach(function (_, attrName) {\n\t if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n\t DOM.removeAttribute(el, attrName);\n\t }\n\t });\n\t for (var _i = 0, _a = DOM.childNodesAsList(el); _i < _a.length; _i++) {\n\t var n = _a[_i];\n\t if (DOM.isElementNode(n))\n\t stripCustomNsAttrs(n);\n\t }\n\t}", "title": "" }, { "docid": "9d146a5d5160cdd956b926182ce6f383", "score": "0.56589246", "text": "stripCustomNsAttrs(el) {\n const elAttrs = el.attributes;\n // loop backwards so that we can support removals.\n for (let i = elAttrs.length - 1; 0 < i; i--) {\n const attrib = elAttrs.item(i);\n const attrName = attrib.name;\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n el.removeAttribute(attrName);\n }\n }\n let childNode = el.firstChild;\n while (childNode) {\n if (childNode.nodeType === Node.ELEMENT_NODE)\n this.stripCustomNsAttrs(childNode);\n childNode = childNode.nextSibling;\n }\n }", "title": "" }, { "docid": "9d146a5d5160cdd956b926182ce6f383", "score": "0.56589246", "text": "stripCustomNsAttrs(el) {\n const elAttrs = el.attributes;\n // loop backwards so that we can support removals.\n for (let i = elAttrs.length - 1; 0 < i; i--) {\n const attrib = elAttrs.item(i);\n const attrName = attrib.name;\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n el.removeAttribute(attrName);\n }\n }\n let childNode = el.firstChild;\n while (childNode) {\n if (childNode.nodeType === Node.ELEMENT_NODE)\n this.stripCustomNsAttrs(childNode);\n childNode = childNode.nextSibling;\n }\n }", "title": "" }, { "docid": "9d146a5d5160cdd956b926182ce6f383", "score": "0.56589246", "text": "stripCustomNsAttrs(el) {\n const elAttrs = el.attributes;\n // loop backwards so that we can support removals.\n for (let i = elAttrs.length - 1; 0 < i; i--) {\n const attrib = elAttrs.item(i);\n const attrName = attrib.name;\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n el.removeAttribute(attrName);\n }\n }\n let childNode = el.firstChild;\n while (childNode) {\n if (childNode.nodeType === Node.ELEMENT_NODE)\n this.stripCustomNsAttrs(childNode);\n childNode = childNode.nextSibling;\n }\n }", "title": "" }, { "docid": "9d146a5d5160cdd956b926182ce6f383", "score": "0.56589246", "text": "stripCustomNsAttrs(el) {\n const elAttrs = el.attributes;\n // loop backwards so that we can support removals.\n for (let i = elAttrs.length - 1; 0 < i; i--) {\n const attrib = elAttrs.item(i);\n const attrName = attrib.name;\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n el.removeAttribute(attrName);\n }\n }\n let childNode = el.firstChild;\n while (childNode) {\n if (childNode.nodeType === Node.ELEMENT_NODE)\n this.stripCustomNsAttrs(childNode);\n childNode = childNode.nextSibling;\n }\n }", "title": "" }, { "docid": "0202bd283f8997fe5b802b5499ef0ca8", "score": "0.5627839", "text": "function stripCustomNsAttrs(el) {\n DOM.attributeMap(el).forEach(function (_, attrName) {\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n DOM.removeAttribute(el, attrName);\n }\n });\n for (var _i = 0, _a = DOM.childNodesAsList(el); _i < _a.length; _i++) {\n var n = _a[_i];\n if (DOM.isElementNode(n))\n stripCustomNsAttrs(n);\n }\n }", "title": "" }, { "docid": "8d8b00dbcaeffff6629aff5f639ce246", "score": "0.56246454", "text": "function isHtmlNamespace(ns) {\n return ns === null\n || ns === htmlNamespace;\n}", "title": "" }, { "docid": "42cd963bd763fec0c442ddbaca0bcb7e", "score": "0.5614233", "text": "function getXMLNS(document) {\n var html = document.head.parentNode;\n for (var i = 0, m = html.attributes.length; i < m; i++) {\n var attr = html.attributes[i];\n if (attr.nodeName.substr(0,6) === \"xmlns:\" &&\n attr.nodeValue === \"http://www.w3.org/1998/Math/MathML\")\n {return attr.nodeName.substr(6)}\n }\n return \"mml\";\n}", "title": "" }, { "docid": "52693ea4f97de975682ea175f890f5b2", "score": "0.5501902", "text": "function create_htmlUnknownElement(document, localName, namespace, prefix) {\n // TODO: Implement in HTML DOM\n return ElementImpl_1.ElementImpl._create(document, localName, namespace, prefix);\n}", "title": "" }, { "docid": "acf36c20d547388e5dd4e70b1e58539d", "score": "0.5490258", "text": "function NamedNodeMap() {\n }", "title": "" }, { "docid": "f82c9d52d614fd8d55677f75281091d1", "score": "0.5463767", "text": "function createElementNS(elem = 'svg') {\n return document.createElementNS('http://www.w3.org/2000/svg', elem);\n }", "title": "" }, { "docid": "dcab9b8f7850e2ac14c2364cd3925942", "score": "0.545388", "text": "function NamedNodeMap(){}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "dfb97a7b3e70d569e1b50e356336653b", "score": "0.54454035", "text": "function NamedNodeMap() {\n}", "title": "" }, { "docid": "31a4dea1c0faa5b57543883a60fcf20a", "score": "0.5444803", "text": "function NamedNodeMap() {}", "title": "" }, { "docid": "31a4dea1c0faa5b57543883a60fcf20a", "score": "0.5444803", "text": "function NamedNodeMap() {}", "title": "" }, { "docid": "31a4dea1c0faa5b57543883a60fcf20a", "score": "0.5444803", "text": "function NamedNodeMap() {}", "title": "" }, { "docid": "2f41d6cea3c39d35eadf86fd33f9952c", "score": "0.5441497", "text": "function n(e){return o||i(!1,\"Markup wrapping node not initialized\"),u.hasOwnProperty(e)||(e=\"*\"),a.hasOwnProperty(e)||(o.innerHTML=\"*\"===e?\"<link />\":\"<\"+e+\"></\"+e+\">\",a[e]=!o.firstChild),a[e]?u[e]:null}", "title": "" }, { "docid": "8994cac384b0fe5cabe804f36d9a29b9", "score": "0.54095507", "text": "function appendElement(hander,node){if(!hander.currentElement){hander.document.appendChild(node);}else{hander.currentElement.appendChild(node);}}//appendChild and setAttributeNS are preformance key", "title": "" }, { "docid": "4052a8e634839d672a150071b62f4edd", "score": "0.5409381", "text": "function owlNamespace(element) {\n\t\tif (!element.owlP) {\n\t\t\telement.owlP = {};\n\t\t\telement.owlP.length = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "9e80226fe989decd20c8306d085fac41", "score": "0.5352381", "text": "function SVGElement () {}", "title": "" }, { "docid": "6684b883df8ce50d1709c5d827ede08b", "score": "0.53358585", "text": "function stripCustomNsAttrs(node) {\n\t if (node.nodeType === window.Node.ELEMENT_NODE) {\n\t var attrs = node.attributes;\n\t for (var i = 0, l = attrs.length; i < l; i++) {\n\t var attrNode = attrs[i];\n\t var attrName = attrNode.name.toLowerCase();\n\t if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) {\n\t node.removeAttributeNode(attrNode);\n\t i--;\n\t l--;\n\t }\n\t }\n\t }\n\n\t var nextNode = node.firstChild;\n\t if (nextNode) {\n\t stripCustomNsAttrs(nextNode);\n\t }\n\n\t nextNode = node.nextSibling;\n\t if (nextNode) {\n\t stripCustomNsAttrs(nextNode);\n\t }\n\t }", "title": "" }, { "docid": "6684b883df8ce50d1709c5d827ede08b", "score": "0.53358585", "text": "function stripCustomNsAttrs(node) {\n\t if (node.nodeType === window.Node.ELEMENT_NODE) {\n\t var attrs = node.attributes;\n\t for (var i = 0, l = attrs.length; i < l; i++) {\n\t var attrNode = attrs[i];\n\t var attrName = attrNode.name.toLowerCase();\n\t if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) {\n\t node.removeAttributeNode(attrNode);\n\t i--;\n\t l--;\n\t }\n\t }\n\t }\n\n\t var nextNode = node.firstChild;\n\t if (nextNode) {\n\t stripCustomNsAttrs(nextNode);\n\t }\n\n\t nextNode = node.nextSibling;\n\t if (nextNode) {\n\t stripCustomNsAttrs(nextNode);\n\t }\n\t }", "title": "" }, { "docid": "af44941bb444d8ab30091679c201973d", "score": "0.5331945", "text": "function zA(e,t){return e?JP(e)?A.createElement(e,t):e:null}", "title": "" }, { "docid": "a2210e064b58909b740bb87b41830d4b", "score": "0.53312546", "text": "function pe(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:// Element\nreturn e.uniqueID;case 9:// Document\nreturn e.documentElement&&e.documentElement.uniqueID}}", "title": "" }, { "docid": "a2210e064b58909b740bb87b41830d4b", "score": "0.53312546", "text": "function pe(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:// Element\nreturn e.uniqueID;case 9:// Document\nreturn e.documentElement&&e.documentElement.uniqueID}}", "title": "" }, { "docid": "bd0b9078e5f551d97fdbaec7450151ee", "score": "0.53010136", "text": "function n(e){var n,r=null;\n// Provides a safe context\nreturn!i&&document.implementation&&document.implementation.createHTMLDocument&&(n=document.implementation.createHTMLDocument(\"foo\"),n.documentElement||(\"production\"!==t.env.NODE_ENV?o(!1,\"Missing doc.documentElement\"):o(!1)),n.documentElement.innerHTML=e,r=n.getElementsByTagName(\"body\")[0]),r}", "title": "" }, { "docid": "45bf5a9cc28ee7b0ff0a190210c670b1", "score": "0.52940476", "text": "function xmlnode (namespace, element) {\treturn namespace != null ? namespace + ':' + element : element }", "title": "" }, { "docid": "e4b998abca594754d77d642c04fc80a2", "score": "0.5292554", "text": "function stripCustomNsAttrs(node) {\n if (node.nodeType === window.Node.ELEMENT_NODE) {\n var attrs = node.attributes;\n for (var i = 0, l = attrs.length; i < l; i++) {\n var attrNode = attrs[i];\n var attrName = attrNode.name.toLowerCase();\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n node.removeAttributeNode(attrNode);\n i--;\n l--;\n }\n }\n }\n\n var nextNode = node.firstChild;\n if (nextNode) {\n stripCustomNsAttrs(nextNode);\n }\n\n nextNode = node.nextSibling;\n if (nextNode) {\n stripCustomNsAttrs(nextNode);\n }\n}", "title": "" }, { "docid": "d18eb13cbc883faefdfb423b709d208b", "score": "0.5273773", "text": "function SVGElement() {}", "title": "" }, { "docid": "d18eb13cbc883faefdfb423b709d208b", "score": "0.5273773", "text": "function SVGElement() {}", "title": "" }, { "docid": "d18eb13cbc883faefdfb423b709d208b", "score": "0.5273773", "text": "function SVGElement() {}", "title": "" }, { "docid": "d18eb13cbc883faefdfb423b709d208b", "score": "0.5273773", "text": "function SVGElement() {}", "title": "" }, { "docid": "f8e2a3abfffe610d7e8f90782ca97935", "score": "0.527017", "text": "function stripCustomNsAttrs(node) {\n while (node) {\n if (node.nodeType === window.Node.ELEMENT_NODE) {\n var attrs = node.attributes;\n for (var i = 0, l = attrs.length; i < l; i++) {\n var attrNode = attrs[i];\n var attrName = attrNode.name.toLowerCase();\n if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) {\n node.removeAttributeNode(attrNode);\n i--;\n l--;\n }\n }\n }\n\n var nextNode = node.firstChild;\n if (nextNode) {\n stripCustomNsAttrs(nextNode);\n }\n\n node = node.nextSibling;\n }\n }", "title": "" }, { "docid": "d6e31f1c18376b5ab83dc97a3171a9ae", "score": "0.5270105", "text": "function m(e){var t=e.type;p(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}", "title": "" }, { "docid": "c4791ce1608391064001144e89daa359", "score": "0.5269956", "text": "function stripCustomNsAttrs(node) {\n if (node.nodeType === window.Node.ELEMENT_NODE) {\n var attrs = node.attributes;\n for (var i = 0, l = attrs.length; i < l; i++) {\n var attrNode = attrs[i];\n var attrName = attrNode.name.toLowerCase();\n if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) {\n node.removeAttributeNode(attrNode);\n i--;\n l--;\n }\n }\n }\n\n var nextNode = node.firstChild;\n if (nextNode) {\n stripCustomNsAttrs(nextNode);\n }\n\n nextNode = node.nextSibling;\n if (nextNode) {\n stripCustomNsAttrs(nextNode);\n }\n }", "title": "" }, { "docid": "2b3e4c0fe372273e94ab9265b6c1eb66", "score": "0.5252522", "text": "function __(node, name, ns, arr){\n\t\t\tdojo.forEach(node.childNodes, function(c){\n\t\t\t\tif(c.nodeType==nodeTypes.ELEMENT){\n\t\t\t\t\tif(name==\"*\"&&c.ownerDocument._nsPaths[ns]==c.namespace){ arr.push(c); }\n\t\t\t\t\telse if(c.localName==name&&c.ownerDocument._nsPaths[ns]==c.namespace){ arr.push(c); }\n\t\t\t\t\t__(c, name, ns, arr);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "092142767f23bed95d89c131afb37184", "score": "0.5252114", "text": "function Epa(a){return a?a.__owner?a.__owner:a.parentNode&&11===a.parentNode.nodeType?a.parentNode.host:av(a):null}", "title": "" }, { "docid": "0bb2f96c3460bbf3a953db5321edeed6", "score": "0.52488655", "text": "function null2xml_(doc, input) {\n return helperXmlRpc.createNode(doc, 'nil');\n }", "title": "" }, { "docid": "9065866f5bdabfe07b940a6a07282b0e", "score": "0.5245722", "text": "get docElementNS() {\n return this._docElementNS;\n }", "title": "" }, { "docid": "d15026d6ab8a4bcb1130af829e868511", "score": "0.5218766", "text": "function hasSvgNamespace(obj){\n return obj && obj.namespaceURI && obj.namespaceURI === svgns;\n }", "title": "" }, { "docid": "58bc14176436457639a123ff4cfb65e3", "score": "0.5211127", "text": "function m(e){var t=e.type;f(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}", "title": "" }, { "docid": "8f0df771ca8705422f819baf862e98ab", "score": "0.5208621", "text": "function appendElement (hander,node) {\r\n if (!hander.currentElement) {\r\n hander.document.appendChild(node);\r\n } else {\r\n hander.currentElement.appendChild(node);\r\n }\r\n}//appendChild and setAttributeNS are preformance key", "title": "" }, { "docid": "8f0df771ca8705422f819baf862e98ab", "score": "0.5208621", "text": "function appendElement (hander,node) {\r\n if (!hander.currentElement) {\r\n hander.document.appendChild(node);\r\n } else {\r\n hander.currentElement.appendChild(node);\r\n }\r\n}//appendChild and setAttributeNS are preformance key", "title": "" }, { "docid": "75765163a058d6d2ffd2b61661c3f629", "score": "0.51965696", "text": "function bxe_bug248172_check() {\n\tparser = new DOMParser();\n\tserializer = new XMLSerializer();\n\n\tparsedTree = parser.parseFromString('<xhtml:html xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"/>','text/xml');\n\tresultStr = serializer.serializeToString(parsedTree);\n\tif (resultStr.match(/xmlns:xhtml/)) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n\t\n}", "title": "" }, { "docid": "665deb3c5fa397aca8c4a24130d92fe2", "score": "0.51845354", "text": "function setPlotHTMLNameSpace( nameSpaceURI ) {\n\tPLOT_HTML_NAME_SPACE = nameSpaceURI;\n}", "title": "" }, { "docid": "9d17ac3069b2a01af361d7700279b91c", "score": "0.51771563", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE$1;}}", "title": "" }, { "docid": "9d17ac3069b2a01af361d7700279b91c", "score": "0.51771563", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE$1;}}", "title": "" }, { "docid": "9d17ac3069b2a01af361d7700279b91c", "score": "0.51771563", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE$1;}}", "title": "" } ]
6b2a42918ac1bc3d591ae615b60adb31
Fetch reviews for restaurant id
[ { "docid": "052199d38290a0a8df70f0d9a7bf5047", "score": "0.6929963", "text": "static fetchAllReviewsById (id, callback) {\n const currTime = Date.now()\n DBHelper.fetchReviewsFromIdb(id).then(idbResp => {\n if (idbResp.length > 0) {\n // console.log('reviews from idb', idbResp)\n idbResp.sort(\n (a, b) => currTime - a.updatedAt - (currTime - b.updatedAt)\n )\n callback(idbResp, null)\n } else {\n const URL = DBHelper.REVIEWS_URL + '?restaurant_id=' + id\n // console.log('URL', URL)\n return fetch(URL, {\n method: 'get'\n })\n .then(resp => resp.json())\n .then(data => {\n data.sort(\n (a, b) => currTime - a.updatedAt - (currTime - b.updatedAt)\n )\n data.map(review => DBHelper.addReviewToIdb(review))\n callback(data, null)\n })\n .catch(err => callback(null, err))\n }\n })\n }", "title": "" } ]
[ { "docid": "a3c1b4657d85a2028d067782f620b424", "score": "0.8230664", "text": "static async fetchRestaurantReviewsById(id) {\r\n const db = await DBHelper.openIndexedDB();\r\n if (!db) {\r\n return DBHelper.fetchRestaurantReviewsByIdFromNetwork(id);\r\n }\r\n const reviews = await db\r\n .transaction(DBHelper.REVIEWS_STORE_NAME)\r\n .objectStore(DBHelper.REVIEWS_STORE_NAME)\r\n .index(DBHelper.REVIEWS_STORE_INDEX)\r\n .getAll(IDBKeyRange.only(id));\r\n if (!reviews || reviews.length === 0) {\r\n return DBHelper.fetchRestaurantReviewsByIdFromNetwork(id);\r\n }\r\n return reviews;\r\n }", "title": "" }, { "docid": "b532dff24e85c4d822c0ab1611f01922", "score": "0.81718314", "text": "static fetchReviewsByRestaurantId(id) {\n return fetch(`${DBHelper.DATABASE_URL}/reviews?restaurant_id=${id}`)\n .then(fetchResponse => fetchResponse.json())\n .then(reviews => {\n this.dbPromise()\n .then(db => {\n if (!db) {\n return;\n }\n\n const tx = db.transaction('mws-reviews', 'readwrite');\n const reviewStore = tx.objectStore('mws-reviews');\n\n for (let r of reviews) {\n r.restaurant_id === id && reviewStore.put(r);\n }\n });\n return Promise.resolve(reviews);\n }).catch(() => {\n this.dbPromise()\n .then(db => {\n if (!db) {\n return null;\n }\n\n const store = db.transaction('restaurant').objectStore('restaurant');\n const indexId = store.index('mws-reviews');\n return indexId.getAll(id);\n })\n .then((storedReviews) => {\n return Promise.resolve(storedReviews);\n });\n });\n }", "title": "" }, { "docid": "2e86a395de3193c44b1e00d5e2973a95", "score": "0.8046042", "text": "getReviewsForRestaurant(id) {\r\n return this.db.then(db => {\r\n const storeIndex = db.transaction('reviews').objectStore('reviews').index('restaurant_id');\r\n return storeIndex.getAll(Number(id));\r\n });\r\n }", "title": "" }, { "docid": "5c920c4f3d6900ce2cfe8259a8cba4c7", "score": "0.80371904", "text": "static fetchRestaurantReviewsById(id) {\n return fetch(`${DBHelper.DATABASE_URL}/${DBHelper.REVIEWS_URL}/?restaurant_id=${id}`)\n .then(response => response.json())\n .then((reviews) => {\n // save reviews on IDB\n for (let i = 0; i < reviews.length; i += 1) {\n appDb.saveRestaurantReview(reviews[i]);\n }\n\n console.log(`Reviews data from API for restaurant: ${id}`);\n console.log(reviews);\n\n return reviews;\n }).catch(() =>\n // if any error ocours resolve restaurants reviews from database\n appDb.getRestaurantReviewsById(id)\n .catch(error => console.error(error)));\n }", "title": "" }, { "docid": "f015a3464348f9852f0faea91a405eb8", "score": "0.8013705", "text": "static fetchRestaurantReviewsFromAPI(id) {\n\t\treturn fetch(`${this.REVIEWS_URL}/?restaurant_id=${id}`, {cache: 'reload'})\n\t\t\t.then(result => result.json())\n\t\t\t.then(reviews => {\n\t\t\t\tconsole.log('fetchRestaurantReviews -> ', reviews);\n\t\t\t\tthis.addAll('reviews', reviews);\n\t\t\t\treturn reviews;\n\t\t\t})\n\t\t\t.catch(err => err);\n\t}", "title": "" }, { "docid": "a37b64d3cae4a2e5fab809e775cfdbf1", "score": "0.7973772", "text": "static async fetchRestaurantReviewsByIdFromNetwork(id) {\r\n const response = await fetch(`${DBHelper.DATABASE_URL}/reviews/?restaurant_id=${id}`);\r\n if (response.ok) {\r\n const [reviews, db] = await Promise.all([response.json(), DBHelper.openIndexedDB()]);\r\n if (db) {\r\n const store = db.transaction(DBHelper.REVIEWS_STORE_NAME, 'readwrite').objectStore(DBHelper.REVIEWS_STORE_NAME);\r\n for (const review of reviews) {\r\n store.put(review);\r\n }\r\n }\r\n return reviews;\r\n } else {\r\n throw new Error(\r\n `Failed fecthing restaurant reviews by restaurant id ${id}: ${response.status} ${response.statusText}`\r\n );\r\n }\r\n }", "title": "" }, { "docid": "2bf9d779c6e91d356b41b04393d35cf4", "score": "0.7972962", "text": "static fetchRestaurantReviews(id, callback) {\r\n // fetch all restaurants with proper error handling.\r\n fetch(`${DBHelper.DATABASE_URL}/reviews/?restaurant_id=${id}`)\r\n .then(response => {\r\n if (!response.ok) throw Error(response.statusText);\r\n return response.json();\r\n }).then(reviews => {\r\n callback(null, reviews);\r\n DBHelper.getLocalDatabase().then((db) => {\r\n const tx = db.transaction('reviews', 'readwrite');\r\n const reviewsStore = tx.objectStore('reviews');\r\n\r\n for(let review of reviews) {\r\n reviewsStore.put(review);\r\n }\r\n })\r\n }).catch(error => {\r\n // Use restaurant JSON from indexDB if fetch fails\r\n DBHelper.getLocalDatabase().then((db) => {\r\n const tx = db.transaction('reviews');\r\n const reviewsStore = tx.objectStore('reviews');\r\n\r\n return reviewsStore.getAll();\r\n }).then(reviews => {\r\n reviews = reviews.filter(review => review.restaurant_id === id);\r\n callback(null, reviews);\r\n })\r\n });\r\n }", "title": "" }, { "docid": "caf006210a6c20175aa745abc1b93672", "score": "0.78940105", "text": "static fetchReviewsByRestaurantId(id, callback) {\r\n // fetch all restaurant reviews with proper error handling.\r\n DBHelper.fetchReviews((error, reviews) => {\r\n if (error) {\r\n callback(error, null);\r\n } else {\r\n // const restaurantReviews = reviews.find(r => r.id == id);\r\n const restaurantReviews = reviews.filter(r => r.restaurant_id == id);\r\n if (restaurantReviews) {\r\n // Got the restaurantReviews\r\n callback(null, restaurantReviews);\r\n } else {\r\n // Restaurant reviews do not exist in the database\r\n callback(\"Restaurant reviews do not exist\", null);\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "d9739b66c3997bb4e6e9aa0b5278aae7", "score": "0.7860042", "text": "static fetchReviewsByRestaurantId(id, callback) {\n // fetch all reviews with proper error handling.\n DBHelper.fetchReviewsFromDb((error, reviewss) => {\n if (error) {\n callback(error, null);\n } else {\n const reviews = reviewss.filter(r => r.restaurant_id == id);\n if (reviews) { // Got the reviews\n callback(null, reviews);\n } else { // Restaurant does not have reviews yet\n callback('Restaurant does not have reviews yet', null);\n }\n }\n });\n }", "title": "" }, { "docid": "371a382b8d45cfb88d24da99e9f42d04", "score": "0.7770902", "text": "static fetchReviewsById(id) {\r\n let requestURL = DBHelper.DATABASE_URL_REVIEWS + \"/?restaurant_id=\" + id;\r\n console.log(`In DBHelper.fetchReviewsById - request: ${requestURL}, id: ${id}`);\r\n return fetch(requestURL, {method: \"GET\"})\r\n .then(function(response) {\r\n console.log(\"response: \", response);\r\n if (response.ok) return response.json();\r\n })\r\n .then(function(reviewData) {\r\n // If fetch successful\r\n console.log(\"reviewData: \", reviewData);\r\n return reviewData;\r\n })\r\n .catch(function(error) {\r\n console.log(\"In fetchReviewsBy...ID catch, error:\", error.message);\r\n });\r\n }", "title": "" }, { "docid": "3b72a52b44b128535fe76065b7bac11e", "score": "0.7751951", "text": "static fetchReviewsByRestaurantId(id, callback) {\r\n // fetch all reviews with proper error handling.\r\n DBHelper.fetchReviews(id, (error, reviews) => {\r\n if (error) {\r\n callback(error, null);\r\n } else {\r\n const review = reviews.filter(r => r.restaurant_id == id);\r\n if (review) { // Got the review\r\n callback(null, review);\r\n } else { // Review does not exist in the database\r\n callback('Review does not exist', null);\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "ab34d349d8beeebcf7f28fd72b8bf3b5", "score": "0.77453893", "text": "static fetchReviewsOnline(opt_id) {\r\n // https://fetch.spec.whatwg.org/#fetch-api\r\n let url = new URL(DBHelper.DATABASE_URL_REVIEWS);\r\n let params = { restaurant_id: opt_id };\r\n Object.keys(params).forEach(key =>\r\n url.searchParams.append(key, params[key])\r\n );\r\n return fetch(url)\r\n .then(response => response.json())\r\n .then(function(data) {\r\n let _dbPromise = DBHelper.openDatabase();\r\n\r\n _dbPromise.then(db => {\r\n if (!db) return;\r\n const database = myApp.getClientDatabase();\r\n let tx = db.transaction(database.objectStoreNameReviews, \"readwrite\");\r\n let store = tx.objectStore(database.objectStoreNameReviews);\r\n data.forEach(restaurantReviews => {\r\n store.put(restaurantReviews);\r\n });\r\n });\r\n console.log(\"Restaurant Reviews Fetched: \", data);\r\n return data;\r\n })\r\n .catch(e => {\r\n console.log(\"Fetch Restaurant Reviews from Network Error\", e);\r\n });\r\n }", "title": "" }, { "docid": "1f9de0099b38c7a3140f9c2ffb35fe06", "score": "0.7721219", "text": "static fetchReviewsForRestaurant(id, callback) {\n\n // We are offline, get restaurants from IndexedDb\n if (navigator.onLine === false) {\n IndexedDB.getReviews(id)\n .then((stashedReviews) => {\n if (stashedReviews) {\n return callback(null, stashedReviews);\n }\n })\n }\n\n // We are online, fetch reviews from network and update in database\n if (navigator.onLine === true) {\n fetch(ServerHelper.DATABASE_URL + 'reviews/?restaurant_id=' + id, { headers: { 'Accept': 'application/json' } })\n .then(response => response.json())\n .then(reviews => {\n IndexedDB.saveReviews(reviews);\n return callback(null, reviews);\n }).catch((e) => {\n console.log(\"Error fetching reviews from server 😢\", e);\n });\n }\n }", "title": "" }, { "docid": "91622ab3962d4a70fda663779f5c6fd3", "score": "0.76999134", "text": "static fetchRestaurantReview(id, callback) {\n const loc_rev = JSON.parse(localStorage.getItem(\"loc_rev\") || \"[]\");\n fetch(`${db_url}/reviews/?restaurant_id=${id}`)\n .then(fetch_json_err_check)\n .then(rev => {\n callback(null, rev);\n store.addAll(\"reviews\", rev).then(() => {\n if (!loc_rev.includes(id)) {\n loc_rev.push(id);\n localStorage.setItem(\"loc_rev\", JSON.stringify(loc_rev));\n }\n });\n })\n .catch(err => {\n if (loc_rev.includes(id)) {\n store.getAllByIndex(\"reviews\", \"restaurant_id\", id).then(rev => {\n callback(null, rev);\n });\n } else {\n callback(err, null);\n }\n });\n }", "title": "" }, { "docid": "8563c2f950467f42483be8c32b89896c", "score": "0.7697278", "text": "getReviews(id) {\n return service\n .get(`dishes/${id}/reviews`)\n .then(res => res.data)\n .catch(errHandler);\n }", "title": "" }, { "docid": "122e0c18bbf5b37edfeb275d8b72055f", "score": "0.7692811", "text": "static fetchReviewsByRestaurantId(id, callback) {\r\n DBHelper.readRestaurentReviewsIDB(id, (reviews) => {\r\n if (typeof reviews !== 'undefined' && reviews.length > 0) {\r\n console.log('reviews for restaurant-', id,' from IDB: ', reviews);\r\n callback(null, reviews);\r\n } else {\r\n console.log('reviews for restaurant-', id,' from API');\r\n fetch(DBHelper.REVIEWS_GET_URL + id, {method: \"GET\"})\r\n .then((resp) => resp.json())\r\n .then(function(data) {\r\n data.map(function(reviews) {\r\n reviews['fromAPI'] = true;\r\n DBHelper.writeReviewsIDB(reviews);\r\n });\r\n console.log('fetched reviews for restaurant-', id, ': ', data);\r\n callback(null, data);\r\n })\r\n .catch(function(error) {\r\n callback(error, null);\r\n });\r\n }\r\n });\r\n }", "title": "" }, { "docid": "3527aca051f38036bbfb9d8e13ede34e", "score": "0.7650415", "text": "static getPendingRestaurantReviewsById(id) {\n return appDb.getPendingRestaurantReviewsById(id)\n .catch(error => console.error(error));\n }", "title": "" }, { "docid": "26202c43201300dcd8558c162e309bd7", "score": "0.7638107", "text": "static async fetchRestaurantReviews(id, callback) {\r\n let reviews = [];\r\n let storedReviews = [];\r\n let offlineReviews = [];\r\n\r\n if (navigator.serviceWorker) {\r\n storedReviews = await DBHelper.getStoredRestaurantReviews(Number(id));\r\n // get offline reviews that havent been synced\r\n offlineReviews = await DBHelper.getOfflineReviews(Number(id));\r\n }\r\n\r\n reviews = [...(storedReviews && storedReviews), ...(offlineReviews && offlineReviews)];\r\n // if we have data to show then we pass it immediately.\r\n if (reviews && reviews.length > 0) {\r\n callback(null, reviews);\r\n }\r\n try {\r\n const response = await fetch(`${DBHelper.DATABASE_URL}/reviews/?restaurant_id=${id}`);\r\n if (response.status === 200) {\r\n // Got a success response from server!\r\n const reviews = await response.json();\r\n if (navigator.serviceWorker) DBHelper.addReviewsToIDB(reviews);\r\n // update webpage with new data\r\n callback(null, [...reviews, ...(offlineReviews && offlineReviews)]);\r\n } else {\r\n callback('Could not fetch reviews', null);\r\n }\r\n } catch (error) {\r\n callback(error, null);\r\n }\r\n }", "title": "" }, { "docid": "f89f954aa964a9865443f66544d7aa85", "score": "0.7603007", "text": "getReviewsResto(id) {\n return service\n .get(`dishes/${id}/reviewsResto`)\n .then(res => res.data.ratings)\n .catch(errHandler);\n }", "title": "" }, { "docid": "f7f7a034fd342bd66d369411b4f27285", "score": "0.76005393", "text": "static fetchAllRestaurantReviews(restaurant_id, callback) {\n fetch(`${DBHelper.DATABASE_URL}/reviews/?restaurant_id=${restaurant_id}`)\n .then(response => response.json())\n .then(reviews => {\n let dbPromise = DBHelper.setIndexedDB();\n dbPromise.then(db => {\n if (!db) return callback(null, reviews);\n let transaction = db.transaction('reviews', 'readwrite');\n let store = transaction.objectStore('reviews');\n reviews.forEach(review => store.put(review));\n });\n callback(null, reviews);\n })\n .catch(error => {\n console.log(error);\n DBHelper.getCachedRestaurantReviews(restaurant_id)\n .then(cachedReviews => {\n console.log(cachedReviews);\n callback(null, cachedReviews);\n })\n .catch(error => callback(error, null));\n })\n }", "title": "" }, { "docid": "8d0560b8cee450c40e44c60aa4a90b75", "score": "0.7561885", "text": "static fetchReviewsByRestaurantId(id, callback) {\r\n // fetch all reviews with proper error handling.\r\n DBHelper.fetchReviews((error, all_reviews) => {\r\n if (error) {\r\n callback(error, null);\r\n } else {\r\n const reviews = all_reviews.filter(r => r.restaurant_id == id);\r\n if (reviews) { // Got the review\r\n callback(null, reviews); //here\r\n } else { // Reviews do not exist in the database\r\n callback('Reviews do not exist', null);\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "846b0e8daf45da2125cd71f78e5673f1", "score": "0.754099", "text": "static fetchRestaurantReviews(id) {\r\n return fetch(`${DBHelper.DATABASE_URL}reviews/?restaurant_id=${id}`)\r\n .then(response => response.json())\r\n .then(reviews => {\r\n this.dbPromise()\r\n .then(db => {\r\n if (!db) return;\r\n\r\n let tx = db.transaction('reviews', 'readwrite');\r\n const store = tx.objectStore('reviews');\r\n if (Array.isArray(reviews)) {\r\n reviews.forEach(function(review) {\r\n store.put(review);\r\n });\r\n } else {\r\n store.put(reviews);\r\n }\r\n });\r\n console.log('reviews: ', reviews);\r\n return Promise.resolve(reviews);\r\n })\r\n .catch(error => {\r\n return DBHelper.getStoredObjectById('reviews', 'restaurant', id)\r\n .then((storedReviews) => {\r\n return Promise.resolve(storedReviews);\r\n })\r\n });\r\n }", "title": "" }, { "docid": "06dc962463ccdbcde8b2793def4c9a04", "score": "0.7476693", "text": "static fetchReviewsByIdFromNetwork(id) {\r\n console.log('fetch reviews from network');\r\n return (\r\n fetch(DBHelper.DATABASE_URL + `/reviews/?restaurant_id=${id}`)\r\n .then(DBHelper.validateJSON)\r\n // TODO: might not need it\r\n .then(response => {\r\n return response;\r\n })\r\n // TODO: this error handling\r\n .catch(DBHelper.logError)\r\n );\r\n }", "title": "" }, { "docid": "349561afcfb96f1946e73b92eb12f0db", "score": "0.7435304", "text": "function fetchRestaurantReviewsFromURL(callback) {\n if (self.reviews) { // restaurant already fetched!\n callback(null, self.reviews)\n return;\n }\n const id = getParameterByName('id');\n if (!id) { // no id found in URL\n error = 'No restaurant id in URL'\n callback(error, null);\n } else {\n DBHelper.fetchRestaurantReviews(id, (error, reviews) => {\n self.reviews = reviews;\n if (!reviews) {\n console.error(error);\n return;\n }\n callback(null, reviews)\n });\n }\n}", "title": "" }, { "docid": "8fde9a8ef5f2676cf4499fb8b19efb46", "score": "0.73940825", "text": "static fetchReviewsById(id, callback) {\n DBHelper.loadFromIDB(`reviews-restaurant-${id}`, `reviews-restaurant-${id}`)\n .then(data => {\n if (data.length == 0) {\n return DBHelper.loadReviewsFromAPI(`reviews/?restaurant_id=${id}`);\n }\n return Promise.resolve(data);\n })\n .then(reviews => {\n callback(null, reviews);\n })\n .catch(err => {\n console.log(`ERROR DB: ${err.status}`);\n callback(err, null);\n });\n }", "title": "" }, { "docid": "3f8d9b5fb3c356efa33c58a538eb3ef9", "score": "0.7391422", "text": "static fetchRestaurantById(id) {\r\n // fetch all restaurants with proper error handling.\r\n return DBHelper.fetchRestaurants()\r\n .then(restaurants => {\r\n const restaurant = restaurants.find(r => r.id == id);\r\n if (restaurant) { // Got the restaurant\r\n // Get and merge reviews too\r\n return fetch(DBHelper.REVIEWS_URL +`?restaurant_id=${restaurant.id}`)\r\n .then(results => {\r\n return results.json(); \r\n })\r\n .then(reviews => {\r\n restaurant['reviews'] = reviews; \r\n return restaurant; \r\n }); \r\n //console.log(restaurant); \r\n \r\n \r\n } else { // Restaurant does not exist inthe database\r\n console.log('Restaurant does not exist');\r\n }\r\n });\r\n }", "title": "" }, { "docid": "37e24cb72f3dcfe2c11aaab21358db0f", "score": "0.73717695", "text": "static getByRestaurantId(restId) {\n return db.any(`\n select * from reviews\n WHERE restaurant_id = ${restId};\n `)\n // now create a new instance of Review\n .then(reviewData => {\n\n let reviewInstances = [];\n reviewData.forEach(review => {\n\n const reviewInstance = new Review(review.id, review.score, review.restaurant_id, review.user_id);\n\n reviewInstances.push(reviewInstance);\n })\n return reviewInstances;\n })\n }", "title": "" }, { "docid": "fc9ae7fa4cf3a663a6ec29771beae18d", "score": "0.73507077", "text": "static fetchReviewsByRestaurantId(id, callback) {\r\n fetch(`${DBHelper.DATABASE_URL}/reviews/?restaurant_id=${id}`)\r\n .then(response => response.json())\r\n .then(reviews => {\r\n DBHelper.cacheRestaurantReviewsInIDB(reviews);\r\n console.log('No reviews in cached idb, reviews fetched from Internet');\r\n callback(null, reviews);\r\n })\r\n .catch(error => {\r\n DBHelper.fetchReviewsByRestaurantIdFromIDB(id, (error, cachedReviews) => {\r\n if (error) { // Got an error\r\n callback('No reviews for this restaurant in db and idb', null)\r\n } else {\r\n console.log('Reviews for this restaurant fetched from cached idb (with offline reviews if there are exists)', cachedReviews);\r\n callback(null, cachedReviews);\r\n }\r\n });\r\n });\r\n }", "title": "" }, { "docid": "e6a423243b5c2cec4fe920a3a2ab2e47", "score": "0.7270729", "text": "fetchRestaurant (callback) {\n if (this.restaurant) { // restaurant already fetched!\n callback(null, this.restaurant)\n return;\n }\n const id = parseInt(this.getParameterByName('id'));\n\n if (!id) {\n error = 'No restaurant id in url'\n callback(error, null);\n } else {\n this.db.fetchRestaurantById(id, (error, restaurant) => {\n this.restaurant = restaurant;\n if (!restaurant) {\n console.error(error);\n return;\n }\n\n this.db.fetchRestaurantReviews(id, (error, reviews) => {\n\n restaurant.reviews = reviews;\n\n this.fillRestaurantHTML(restaurant);\n callback(null, restaurant)\n\n });\n\n });\n }\n }", "title": "" }, { "docid": "a0bc62cbca0d59d020979664e035e709", "score": "0.7190781", "text": "static getCachedRestaurantReviews(restaurant_id) {\n let dbPromise = DBHelper.setIndexedDB();\n return dbPromise.then(db => {\n if (!db) return;\n let transaction = db.transaction('reviews');\n let store = transaction.objectStore('reviews');\n let index = store.index('byRestaurant');\n return index.get(restaurant_id);\n })\n }", "title": "" }, { "docid": "11255b4794071953e0883d9ddb4f1fa0", "score": "0.7189495", "text": "static fetchReviewsFromIdb (id) {\n const dbPromise = DBHelper.openIdb()\n return dbPromise\n .then(db => {\n var tx = db.transaction('reviews', 'readonly')\n var store = tx.objectStore('reviews')\n return store.getAll()\n })\n .then(reviews => {\n return reviews.filter(review => review.restaurant_id === id)\n })\n }", "title": "" }, { "docid": "960d3ac8312b2cabde036e4d0c8e0f36", "score": "0.7189224", "text": "static fetchReviewsById(id) {\r\n return DBHelper.fetchReviewsByIdFromDB(id).then(function(response) {\r\n if (response.length === 0) {\r\n return DBHelper.fetchReviewsByIdFromNetwork(id)\r\n .then(response => {\r\n DBHelper.addReviewsToIndexDB(response);\r\n return response;\r\n })\r\n .catch(DBHelper.logError);\r\n }\r\n return response;\r\n });\r\n }", "title": "" }, { "docid": "c385772aad6f69255b43e5e523e7f65e", "score": "0.7137104", "text": "static fetchReviewByIdFromAPI(id) {\n\t\treturn fetch(`${this.REVIEWS_URL}/${id}`)\n\t\t\t.then(result => result.json())\n\t\t\t.then(review => {\n\t\t\t\tconsole.log('fetchReviewById -> ', review);\n\t\t\t\t// this.addRestaurantByIDToDB(review);\n\t\t\t\treturn review;\n\t\t\t})\n\t\t\t.catch(err => err);\n\t}", "title": "" }, { "docid": "e7267290f19f56439c4460c08a6f7c63", "score": "0.7031963", "text": "static postRestaurantReview(review) {\n return fetch(`${DBHelper.DATABASE_URL}/reviews/`, { method: 'POST', body: JSON.stringify(review) }).then((response) => {\n return response.json(); \n });\n }", "title": "" }, { "docid": "5e48cefbc7016261fbce887901c02149", "score": "0.7026594", "text": "static async getRestaurantByID(id) {\n try {\n\n // create a mongodb pipeline to match different collections together - match the ID of a certain restaurant\n const pipeline = [\n {\n $match: { _id: new ObjectId(id), },\n },\n {\n $lookup: {\n from: \"reviews\", // from the reviews collection in the db, find all reviews that match a restaurant id\n let: {\n id: \"$_id\",\n },\n pipeline: [\n {\n $match: {\n $expr: {\n $eq: [\"$restaurant_id\", \"$$id\"],\n },\n },\n },\n {\n $sort: {\n date: -1,\n },\n },\n ],\n as: \"reviews\", // set all such reviews in the collection as \"reviews\" as the result\n },\n },\n {\n $addFields: {\n reviews: \"$reviews\",\n },\n },\n ]\n return await restaurants.aggregate(pipeline).next()\n } catch (e) {\n console.error(`Something went wrong in getRestaurantByID: ${e}`)\n throw e\n }\n }", "title": "" }, { "docid": "436569fe374d2defbde08913ea9e5bea", "score": "0.6994586", "text": "static getReviewsById(database$, id) {\n //open the database to make transactions\n let reviews$ = database$.then(function (db) {\n if (!db) return;\n //open an transaction\n let tx = db.transaction('reviews', 'readonly'),\n store = tx.objectStore('reviews');\n\n let index = store.index('by-id');\n return store.getAll()\n .then(reviews =>\n reviews.filter(r => r.restaurant_id == id));\n });\n\n let reviews_to_post$ = database$.then(function (db) {\n if (!db) return;\n //open an transaction\n let tx = db.transaction('reviews_to_post', 'readonly'),\n store = tx.objectStore('reviews_to_post');\n\n return store.getAll()\n .then(reviews =>\n reviews.filter(r => r.restaurant_id == id));\n });\n\n return Promise.all([reviews$, reviews_to_post$])\n .then(results => {\n return results[0].concat(results[1]);\n });\n }", "title": "" }, { "docid": "3eed68e26b2c0dd9d3867d640bb5c803", "score": "0.697458", "text": "async populateReviews() {\n try {\n const recipeId = this.props.match.params.id;\n\n const { data: reviews } = await getReviews(recipeId);\n this.setState({ reviews });\n } catch (ex) {\n if (ex.response && ex.response.status === 404)\n return this.props.history.replace(\"/not-found\");\n }\n }", "title": "" }, { "docid": "0d39ea01099516fd5c957270ab090510", "score": "0.6963792", "text": "getReviews(req, res) {\n const showId = req.params.show_id\n\n // Good practice is to validate the id\n if (!ObjectID.isValid(showId)) { return res.status(404).send([]) }\n\n Rating.find({show_id: req.params.show_id}).populate(\"user_id\", \"username\").then((results) => {\n results.filter(result => result.review != undefined && result.review.length >= 1 )\n res.send( results )\n }, (error) => {\n res.status(400).send(error)\n })\n\n }", "title": "" }, { "docid": "4a3e275348d47b020c21239f172f2e39", "score": "0.69609797", "text": "async getReviews () {\n\t\tconst reviewIds = this.models.map(marker => marker.get('reviewId'));\n\t\tif (reviewIds.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis.reviews = await this.data.reviews.getByIds(reviewIds, { excludeFields: ['reviewDiffs', 'checkpointReviewDiffs'] });\n\t\tthis.responseData.reviews = this.reviews.map(review => review.getSanitizedObject({ request: this }));\n\t}", "title": "" }, { "docid": "ec8fb70b02825d8059b1fb76f61398a5", "score": "0.68896246", "text": "static async getReviewsFromOutboxByRestaurantId(id) {\r\n const db = await DBHelper.openIndexedDB();\r\n return db\r\n .transaction(DBHelper.REVIEWS_OUTBOX_STORE_NAME, 'readonly')\r\n .objectStore(DBHelper.REVIEWS_OUTBOX_STORE_NAME)\r\n .getAll(IDBKeyRange.only(id));\r\n }", "title": "" }, { "docid": "d86e9585cb4dc20630b2f0122a4c725d", "score": "0.687124", "text": "function getRestaurant() {\n\n var restaurantId = $scope.restaurantId;\n restaurantSvr.getRestaurant(restaurantId).then(function (restaurant) {\n $scope.restaurant = restaurant;\n });\n\n $scope.getPhotos();\n\n restaurantSvr.getOverviews(restaurantId, $scope).then(function (stats) {\n $scope.stats = stats;\n });\n\n }", "title": "" }, { "docid": "ceccfb3c628448a291b920a64c75e290", "score": "0.6854355", "text": "static fetchReviewsRestaurantId(id) {\n // let xhr = new XMLHttpRequest();\n // xhr.open('GET', DBHelper.API_URL_BASE+'reviews/?restaurant_id='+id);\n // xhr.onload = () => {\n // if (xhr.status === 200) { // Got a success response from server!\n // const reviews = JSON.parse(xhr.responseText);\n // return DBHelper.dbPromise.then(db => {\n // const tx = db.transaction(reviewsStoreName, 'readwrite');\n // const store = tx.objectStore(reviewsStoreName);\n // if(Array.isArray(reviews)) {\n // reviews.forEach((review) => {\n // store.put(review);\n // });\n // } else {\n // store.put(reviews);\n // }\n // });\n // return Promise.resolve(reviews);\n // } else { // Oops!. Got an error from server.\n // const error = (`Request failed. Returned status of ${xhr.status}`);\n // return DBHelper.dbPromise.then(db => { \n // const tx = db.transaction(reviewsStoreName, 'readwrite');\n // const store = tx.objectStore(reviewsStoreName);\n // const indexId = store.index(dbName);\n // return indexId.getAll(id);\n // }).then((storedREviews) => {\n // return Promise.resolve(storedREviews);\n // })\n // } \n // };\n // xhr.send();\n if(navigator.onLine) {\n return fetch(DBHelper.API_URL_BASE+'reviews/?restaurant_id='+id)\n .then((response) => {\n return response.json().then((data) => {\n return DBHelper.dbPromise.then(db => {\n const tx = db.transaction(reviewsStoreName, 'readwrite');\n const store = tx.objectStore(reviewsStoreName);\n if(Array.isArray(data)) {\n data.forEach((review) => {\n store.put(review);\n });\n } else {\n store.put(data);\n }\n return Promise.resolve(data);\n });\n }); \n }).catch((error) => {\n return DBHelper.dbPromise.then(db => { \n const tx = db.transaction(reviewsStoreName, 'readwrite');\n const store = tx.objectStore(reviewsStoreName);\n const indexId = store.index('restaurant_id');\n return indexId.getAll(id);\n }).then((storedREviews) => {\n return Promise.resolve(storedREviews);\n })\n });\n } else {\n return DBHelper.dbPromise.then(db => { \n const tx = db.transaction(reviewsStoreName, 'readwrite');\n const store = tx.objectStore(reviewsStoreName);\n const indexId = store.index('restaurant_id');\n return indexId.getAll(id);\n }).then((storedREviews) => {\n return Promise.resolve(storedREviews);\n })\n } \n }", "title": "" }, { "docid": "92e32641a2fd45c6ac2a3bb393f5a3fa", "score": "0.6828051", "text": "static addRestaurantReview(review, callback) {\n fetch(`${DBHelper.DATABASE_URL}/reviews/`, {\n method: 'post',\n body: JSON.stringify(review)\n })\n .then(response => response.json())\n .then(response => callback(null, response))\n .catch(error => callback(error, null))\n }", "title": "" }, { "docid": "2fee63d7a141b69e826112b62095c6df", "score": "0.67960346", "text": "get(id) {\n return http.get(`/reviews/${id}`);\n }", "title": "" }, { "docid": "6f3bf2fb979f05399d392b34a4d1a21f", "score": "0.67358047", "text": "static fetchReviewsCached(opt_id) {\r\n return DBHelper.openDatabase().then(db => {\r\n if (!db) return; //@todo or already showing restaurant reviews\r\n\r\n const database = myApp.getClientDatabase();\r\n let tx = db.transaction(database.objectStoreNameReviews);\r\n let store = tx.objectStore(database.objectStoreNameReviews);\r\n var myIndex = store.index(\"by-restaurant_id\");\r\n\r\n let keyRangeValue = IDBKeyRange.only(opt_id);\r\n var getRequest = myIndex.getAll(keyRangeValue);\r\n\r\n return getRequest;\r\n });\r\n }", "title": "" }, { "docid": "260a5d02aae21e8e22547b851911064e", "score": "0.67291003", "text": "static fetchReviewsById(id, callback) {\n\tlet dbPromise=idb.open('restaurant_db', 1);\n\tlet reviews = [];\n // fetch all restaurants with proper error handling.\n dbPromise.then(db => {\n\t\tvar tx_read_offline=db.transaction('pending_store');\n\t\tvar pendingStore=tx_read_offline.objectStore('pending_store');\n\t\treturn pendingStore.openCursor();\n\t}).then(function getPenging(cursor){\n\t\tif(!cursor) return reviews;\n\t\tvar body = cursor.value.body;\n\t\tvar method = cursor.value.method;\n\t\tvar url = cursor.value.url;\n\t\t//console.log(\"url: \"+url);\n\t\tif(body && method != \"DELETE\" && url.indexOf(\"reviews\") > -1){\n\t\t\t//console.log(\"push review\");\n\t\t\treviews.push(JSON.parse(body));\t\t\t\t\t\t\t\n\t\t}\t\t\n\t\treturn cursor.continue().then(getPenging);\t\t\t\t\t\t\t\n\t}).then(\n\t\t(offline_reviews) => {\n\t\t\t//console.log(\"!reviews: \"+(!reviews));\n\t\t\t//console.log(\"offline_reviews: \"+offline_reviews);\n\t\t\tget_reviews(id, offline_reviews);\n\t\t\tasync function get_reviews(id, offline_reviews){\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tvar response = await fetch(DBHelper.DATABASE_URL + `/reviews/?restaurant_id=${id}`, {method: 'GET'});\n\t\t\t\t\tvar online_reviews = await response.json();\n\t\t\t\t\t\n\t\t\t\t\t//console.log(\"online_reviews: \"+online_reviews);\n\t\t\t\t\t\n\t\t\t\t\tcallback(null, online_reviews);\t\t\t\t\t\n\t\t\t\t}catch(e){\n\t\t\t\t\tcallback(null, offline_reviews);\n\t\t\t\t\tconsole.log(e);\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t).catch(e => {\n\t console.log(e);\n\t})\t\n\n }", "title": "" }, { "docid": "9834b5fc55a57b7d646f95732fabc838", "score": "0.6718182", "text": "function getReviewsFor(userId){\n return new Promise(resolve => {\n jQuery.get(reviewURL + \"/userId/\" + userId, function(data){\n reviews = data;\n resolve();\n });\n });\n}", "title": "" }, { "docid": "dc8f17dd4b7b7082025adb8696c5f2e0", "score": "0.669061", "text": "function getRatings (name, id, path, callback){\n getResult(path + \"/reviews\", function(reviews){\n callback(name, id, reviews);\n });\n }", "title": "" }, { "docid": "314b91e676b15cf5baaca93d78bf7606", "score": "0.6671636", "text": "static saveRestaurantReview(review) {\n return fetch(`${DBHelper.DATABASE_URL}/${DBHelper.REVIEWS_URL}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(review),\n }).then(response => response.json())\n .then(data => appDb.saveRestaurantReview(data))\n .catch(() => appDb.savePendingRestaurantReview(review));\n }", "title": "" }, { "docid": "0bb172265bb69be4949a3b4c151551e7", "score": "0.6659687", "text": "function getReviewFromGoogle(marker, restaurants, map) {\n\n let serviceNew = new google.maps.places.PlacesService(map);\n\n serviceNew.getDetails({\n placeId: marker.placeId\n }, function(restaurants, status) {\n\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n\n let displayReview = restaurants.reviews;\n\n displayReviewList(displayReview);\n };\n });\n}", "title": "" }, { "docid": "665675291af3b886e43bd5c2fdb0f18d", "score": "0.665787", "text": "function query() {\n $http\n .get('/api/reviews')\n .then(function onSuccess(response) {\n vm.reviews = response.data;\n });\n }", "title": "" }, { "docid": "e51d103a563d598eb894848e13ddfbf4", "score": "0.664347", "text": "static fetchRestaurantById(id) {\r\n return DBHelper.fetchRestaurants().then(restaurants => restaurants.find (r => r.id === id));\r\n }", "title": "" }, { "docid": "e2a9e0a319eccf2fdab642ccff5a0e15", "score": "0.6611048", "text": "static reviewsGetCached(id) {\n dbpromise = DBHelper.openReviewDatabase();\n return dbpromise.then(db => {\n if (!db) return;\n let tx = db.transaction('reviewsDb');\n let store = tx.objectStore('reviewsDb');\n return store.getAll();\n }).then(res => {\n num = res.filter(r => r.restaurant_id == parseInt(id)).length;\n //console.log(num)\n return res.filter(r => r.restaurant_id == parseInt(id));\n }).catch(error => console.log(error));\n }", "title": "" }, { "docid": "cb4955299b3383582905fda691a7b4a7", "score": "0.6609113", "text": "getAllReviews () {\n\t\t// TODO: setup later with pagination, goes through the ReviewModel, add to tests after\n\t}", "title": "" }, { "docid": "97c214983f4b88663a3f53211c8ae4a6", "score": "0.6606106", "text": "function fetch_reviews() {\n return wkof.Apiv2.fetch_endpoint('summary').then(reviews=>reviews.data.reviews[0].subject_ids);\n }", "title": "" }, { "docid": "d0271a42387ef8b58e8d9ad5342f0820", "score": "0.6572924", "text": "function findReview(review_id) {\r\n return knex(\"reviews\")\r\n .select(\"*\")\r\n .where({ review_id })\r\n .first();\r\n}", "title": "" }, { "docid": "f8d08673d0db883ed051515816eddaa4", "score": "0.6567363", "text": "fetchRestaurantById(id) {\n return this.fetchRestaurants()\n .then(restaurants => restaurants.find(r => r.id === id));\n }", "title": "" }, { "docid": "24611475cb89bb9611e9f3631060c919", "score": "0.6527185", "text": "static loadReviewsFromAPI(slug) {\n return fetch(`${DBHelper.DATABASE_URL}/${slug}`)\n .then(response => response.json())\n .then(data => {\n // Write items to IDB for time site is visited\n DBHelper.saveToIDB(\n data,\n `reviews-restaurant-${self.restaurant.id}`,\n `reviews-restaurant-${self.restaurant.id}`\n );\n console.log(\n `Reviews data from API for restaurant: ${self.restaurant.id}`\n );\n console.log(data);\n return data;\n });\n }", "title": "" }, { "docid": "1eb3914c2ef83a2c324ac4ade30337fb", "score": "0.65050745", "text": "static loadDeferredReviewsByRestaurantId(restaurant_id, callback){\r\n\r\n let IDBOpenRequest = window.indexedDB.open(\"AppDB\", 1);\r\n let reviews = [];\r\n\r\n IDBOpenRequest.onsuccess = function(event) {\r\n const db = event.target.result;\r\n\r\n\r\n const deferredReviewsObjectStore = db.transaction(\"DeferredReviews\", \"readwrite\").objectStore(\"DeferredReviews\");\r\n const getAllRequest = deferredReviewsObjectStore.getAll();\r\n\r\n getAllRequest.onsuccess = function(event) {\r\n\r\n reviews = event.target.result;\r\n const deferredReviews = reviews.filter(r => r.restaurant_id == restaurant_id);\r\n\r\n //success\r\n callback(null,deferredReviews);\r\n };\r\n\r\n getAllRequest.onerror = function(event) {\r\n const error = 'error loading restaurants from indexedDb';\r\n callback(error,null);\r\n };\r\n\r\n\r\n }\r\n\r\n\r\n IDBOpenRequest.onerror = function(event) {\r\n const error = 'error opening AppDB indexedDb';\r\n callback(error,null);\r\n };\r\n\r\n }", "title": "" }, { "docid": "0c045afc4413624cb9fe15ece1f2ec73", "score": "0.64808625", "text": "addReview(id, review) {\n return service\n .post(`dishes/${id}/recipeReview`, review)\n .then(res => res.data)\n .catch(errHandler);\n }", "title": "" }, { "docid": "befb8833bdceba46954e4f79ec872c8f", "score": "0.6422415", "text": "static postRestaurantReview(data, callback) {\n return fetch(`${DBHelper.DATABASE_URL}/reviews`, {\n method: 'POST',\n body: JSON.stringify(data)\n })\n .then(res => res.json())\n .then(review => {\n\n return callback(null, review);\n })\n .catch(error => {\n if (!navigator.onLine) {\n this.cacheRestaurantReview(data, callback);\n }\n const errorMsg = (`Request failed. Returned status of ${error}`);\n return callback(errorMsg, null);\n });\n }", "title": "" }, { "docid": "deba4399a3b2340c40b30e28acd30542", "score": "0.64165574", "text": "async showReviews(req, res, next) {\n\t\ttry {\n\t\t\tconst reviews = await Review.find({ movie: req.params.id });\n\t\t\treturn res.send({ reviews });\n\t\t} catch (e) {\n\t\t\tnext(e);\n\t\t}\n\t}", "title": "" }, { "docid": "96adb5c6744b8143e1278b0baec4b1d9", "score": "0.64089537", "text": "static addRestaurantReview(restaurant, name, rating, comments) {\r\n fetch(`${DBHelper.DATABASE_URL}/reviews/`, {\r\n method: 'post',\r\n body: JSON.stringify({\r\n \"restaurant_id\": restaurant.id,\r\n \"name\": name,\r\n \"rating\": rating,\r\n \"comments\": comments\r\n })\r\n }).then(response => {\r\n if (!response.ok) throw Error(response.statusText);\r\n else if (response.status === 201) location.reload();\r\n console.log('review created: ', data)\r\n }).catch(error => {\r\n DBHelper.getLocalDatabase().then((db) => {\r\n let tx = db.transaction('reviews', 'readwrite');\r\n const reviewsStore = tx.objectStore('reviews');\r\n let timestamp = new Date().getTime() / 1000;\r\n\r\n reviewsStore.put({\r\n restaurant_id: restaurant.id,\r\n createdAt: timestamp,\r\n name: name,\r\n rating: rating,\r\n comments: comments\r\n });\r\n\r\n tx = db.transaction('offline-temp', 'readwrite');\r\n const offlineTemp = tx.objectStore('offline-temp');\r\n\r\n if(!navigator.onLine) {\r\n offlineTemp.put({\r\n restaurant_id: restaurant.id,\r\n createdAt: timestamp,\r\n name: name,\r\n rating: rating,\r\n comments: comments\r\n });\r\n }\r\n\r\n location.reload();\r\n });\r\n });\r\n }", "title": "" }, { "docid": "fd439d71b4d1678669737e49cb2bc7c5", "score": "0.6408894", "text": "getPlaceReviews(user, id, limit) {\n return new Promise((resolve, reject) => {\n Server.fn.dbMethods.review\n .getReviews(\n {\n placeID: id,\n },\n limit,\n )\n .then(async dbReviews => {\n let reviews = await this.formatedReviews(dbReviews);\n //let googleReviews = await this.formatedGoogleReviews(id);\n\n if (reviews == null)\n return reject(Server.fn.api.jsonError(500, `getUserByID() Database error`));\n //if (googleReviews == null) googleReviews = []; //return reject(Server.fn.api.jsonError(500, `Can't find a place associated to this id google`));\n\n let userReviews = [];\n\n // Remove and get owned reviews\n reviews = reviews.filter(e =>\n e.author && e.author.id == user._id ? (userReviews.push(e), false) : true,\n );\n\n return resolve(\n Server.fn.api.jsonSuccess(200, {\n results: userReviews.concat(reviews), // userReviews.concat(reviews.concat(googleReviews))\n }),\n );\n })\n .catch(err => reject(Server.fn.api.jsonError(500, `'getReviews()' Database error`, err)));\n });\n }", "title": "" }, { "docid": "651cd6b4bc7621724d3bbd9dcf4fa574", "score": "0.63873523", "text": "async function getReviewsHandler(req, reply) {\n try {\n const { product_id, count = 5, page = 1 } = req.params;\n const reviewsData = await this.reviews.getReviewsById(product_id, count, page);\n reply.code(200).send(reviewsData);\n } catch (err) {\n reply.code(400).send(err);\n console.log('Error trying to get reviews:', err);\n }\n}", "title": "" }, { "docid": "2de54f9c2fa987bcd9ce02d39fc07e9f", "score": "0.6375345", "text": "function loadReviews(recipeId) {\n $.get(`/recipes/${recipeId}/recipe_reviews.json`, function(data) {\n if (data.data.length == 0) {\n recipe.addReview('No reviews yet.', '', '');\n } else {\n data.data.forEach(function(recipeReview) {\n formatReview(recipeReview);\n });\n }\n recipe.reviewsLoaded = true;\n displayReviews();\n })\n .fail(function(jqXHR, textStatus, error) {\n console.log('ERROR: ' + error);\n });\n}", "title": "" }, { "docid": "6044aef5d6a04e02569701686b37586d", "score": "0.63646835", "text": "async function readReviews(req, res, next) {\n const reviews = await service.readReviews(res.locals.movieId);\n res.json({ data: reviews });\n}", "title": "" }, { "docid": "0e6949e52aaaf17cf634b1cc389bdbd6", "score": "0.63597006", "text": "static async getUserReview (req, res, next){\n const userId = req.userData.id\n try {\n const found = await reviews.findAll({\n where: \n {\n userId : userId\n },\n include : [\n movies\n ]\n })\n if (found) {\n res.status(200).json({\n review: found,\n })\n } \n else {\n res.status(404).json({\n msg : 'Not found'\n })\n }\n }\n catch (err) {\n next(err)\n }\n }", "title": "" }, { "docid": "4a846ae06b5732921d67957aa1084b35", "score": "0.63535106", "text": "getAllReviews() {\n return app.get(\"/api/reviews\").then(res => console.log(res.data));\n }", "title": "" }, { "docid": "dde5726d73ec114e59c7bf46ed2a628b", "score": "0.6351484", "text": "fetchRestaurantById(id) {\r\n return this.restaurants.then(restaurants =>\r\n restaurants.filter(r => r.id == id)[0]);\r\n }", "title": "" }, { "docid": "a30c12797001cac04a110d67f9b5b3e5", "score": "0.6351198", "text": "static fetchRestaurantReviewsById(id, callback) {\n // fetch network for new stuff and put into idb\n fetch(`${DBHelper.DATABASE_URL}reviews/?restaurant_id=${id}`, {\n method: \"GET\",\n })\n .then(function (response) {\n return response.status === 200 ? response.json() : response;\n })\n .then(function (json) {\n // save to store\n dbPromise.then((db) => {\n const tx = db.transaction(\"reviews\", \"readwrite\");\n // Should return array, so step through and put them in individually.\n if (Array.isArray(json)) {\n json.map((review) => {\n return tx.objectStore(\"reviews\").put(review);\n });\n }\n return tx.complete;\n });\n return json;\n })\n .then(function (json) {\n // get data from idb\n return dbPromise.then(async (db) => {\n const tx = db.transaction(\n [\"reviews\", \"offline-reviews\"],\n \"readwrite\"\n );\n const store1 = tx.objectStore(\"reviews\").index(\"restaurant_id\");\n const store2 = tx\n .objectStore(\"offline-reviews\")\n .index(\"restaurant_id\");\n const obj1 = await store1.getAll(Number(id));\n const obj2 = await store2.getAll(Number(id));\n // If no reviews in indexedDB, try fetching.\n const mergedObj = obj1.concat(obj2);\n return callback(null, mergedObj);\n });\n })\n .catch(function (error) {\n console.log(error);\n return dbPromise.then(async (db) => {\n const tx = db.transaction(\n [\"reviews\", \"offline-reviews\"],\n \"readwrite\"\n );\n const store1 = tx.objectStore(\"reviews\").index(\"restaurant_id\");\n const store2 = tx\n .objectStore(\"offline-reviews\")\n .index(\"restaurant_id\");\n const obj1 = await store1.getAll(Number(id));\n const obj2 = await store2.getAll(Number(id));\n // If no reviews in indexedDB, try fetching.\n const mergedObj = obj1.concat(obj2);\n return callback(null, mergedObj);\n });\n });\n }", "title": "" }, { "docid": "c0ddfb5d22b5987a0e3ca951f691e6b8", "score": "0.63434255", "text": "function resolvers_getReviews(query) {\n var url, response, totalCount;\n return regenerator_default.a.wrap(function getReviews$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n url = Object(external_this_wp_url_[\"addQueryArgs\"])(\"\".concat(NAMESPACE, \"/products/reviews\"), query);\n _context.next = 4;\n return fetchWithHeaders({\n path: url,\n method: 'GET'\n });\n\n case 4:\n response = _context.sent;\n totalCount = parseInt(response.headers.get('x-wp-total'), 10);\n _context.next = 8;\n return updateReviews(query, response.data, totalCount);\n\n case 8:\n _context.next = 14;\n break;\n\n case 10:\n _context.prev = 10;\n _context.t0 = _context[\"catch\"](0);\n _context.next = 14;\n return reviews_actions_setError(query, _context.t0);\n\n case 14:\n case \"end\":\n return _context.stop();\n }\n }\n }, reviews_resolvers_marked, null, [[0, 10]]);\n}", "title": "" }, { "docid": "d9dd96872b540733939bf30c4093f9d8", "score": "0.6341473", "text": "function getReviews(){\n $.get('http://localhost:3012/reviews', (data) => {\n\n for (let index = 0; index < data.length; index++) {\n addReview( data[index] );\n }\n });\n}", "title": "" }, { "docid": "37539ec9390a31c2920ee2a328ac4c0a", "score": "0.6327282", "text": "async function listReviews(req, res){\n let reviews = await service.reviewInfo(req.params.movieId);\n res.json({data:reviews})\n}", "title": "" }, { "docid": "bef14c13baa1318fe72cf37b22f58eef", "score": "0.6326662", "text": "function getReviewByUserId(req,res) {\n var userId=req.params.userId;\n reviewModel.findReviewByUserId(userId)\n .then(function (reviews) {\n //console.log(reviews);\n res.json(reviews);\n });\n}", "title": "" }, { "docid": "7ab37eafd7bffc20a8f11cb0cfebe38f", "score": "0.6324205", "text": "addReviewResto(id, review) {\n return service\n .post(`/oneRest/${id}/restoReview`, review)\n .then(res => res.data)\n .catch(errHandler);\n }", "title": "" }, { "docid": "7adf44511d674531c44a9f2403db0712", "score": "0.63212943", "text": "getReviews() {\n // uses the user ID of the User instance that is calling this\n return db.any(`\n select * from reviews\n WHERE user_id=${this.id} \n `).then(function(arrayOfReviews) {\n const arrayOfReviewInstances = [];\n arrayOfReviews.forEach(reviewData => {\n const newInstance = new ReviewsInClass(reviewData.id, reviewData.score, reviewData.content, reviewData.restaurant_id, reviewData.user_id);\n\n arrayOfReviewInstances.push(newInstance);\n })\n\n return arrayOfReviewInstances;\n\n })\n }", "title": "" }, { "docid": "7f9521dfee27c3b38d6215adea1901c3", "score": "0.6315202", "text": "static fetchPendingReviews(id, callback) {\r\n DBHelper.openIndexDatabase().then(db => {\r\n const tx = db.transaction('reviews', 'readwrite');\r\n const store = tx.objectStore('reviews');\r\n store.get(id).then(data => {\r\n if (data) {\r\n console.log(data[0]);\r\n callback(data[0]);\r\n } \r\n })\r\n });\r\n }", "title": "" }, { "docid": "0f53d445eb6601293473a1d3f9571acb", "score": "0.6314166", "text": "static fetchReviewsByRestaurantIdFromIDB(id, callback) {\r\n let offReviews = [];\r\n // getting offline reviews if any\r\n DBHelper.getOfflineReviews(id, (error, offlineReviews) => {\r\n if(error) {\r\n console.log(error);\r\n } else {\r\n offReviews = offlineReviews;\r\n console.log('Offline reviews:', offReviews);\r\n }\r\n });\r\n\r\n const dbPromise = DBHelper.idbPromise();\r\n dbPromise.then(db => {\r\n const reviewsStore = db.transaction('reviews').objectStore('reviews');\r\n console.log('id:', id);\r\n let myIndex = reviewsStore.index('restaurant');\r\n // double query to idb because of inconsistency of the API (existent reviews with restaurant_id in number just added review returns with restaurant_id in string)\r\n myIndex.getAll(Number(id)).then(dbReviews => {\r\n console.log({dbReviews});\r\n myIndex.getAll(id.toString()).then(newReviews => {\r\n console.log({newReviews});\r\n if(offReviews.length != 0 | dbReviews.length != 0 || newReviews.length != 0) {\r\n let mergeReviews = [];\r\n if(dbReviews.length != 0) {\r\n dbReviews.forEach(dbReview => {\r\n mergeReviews.push(dbReview);\r\n })\r\n }\r\n if(newReviews.length != 0) {\r\n newReviews.forEach(newReview => {\r\n mergeReviews.push(newReview);\r\n })\r\n }\r\n if(offReviews.length != 0) {\r\n offReviews.forEach(offReview => {\r\n mergeReviews.push(offReview);\r\n })\r\n }\r\n console.log('Reviews from IDB (new, old, offline) for this restaurant:', mergeReviews);\r\n callback(null, mergeReviews);\r\n } else {\r\n callback('No reviews in idb for this restaurant', null);\r\n }\r\n })\r\n })\r\n });\r\n }", "title": "" }, { "docid": "90ad30120b38c475d51ee24c27bb3ef8", "score": "0.62772495", "text": "function getReviews(productId) {\n return $http.get('/api/rest/reviews/product/' + productId)\n .then(getReviewsComplete)\n .catch(getReviewsFailed);\n\n function getReviewsComplete(response) {\n return response.data;\n }\n\n function getReviewsFailed(error) {\n $log.debug('XHR Failed for getReviews.' + error.data);\n }\n }", "title": "" }, { "docid": "4e51aacde04aa01bd41526212e223fdd", "score": "0.6253743", "text": "static savePendingRestaurantReviews() {\n return appDb.getPendingRestaurantReviews()\n .then((pendingReviews) => {\n for (let i = 0; i < pendingReviews.length; i += 1) {\n delete pendingReviews[i].id; // eslint-disable-line\n this.saveRestaurantReview(pendingReviews[i]);\n }\n });\n }", "title": "" }, { "docid": "58baa036822d4085da9807e77ab5b3e4", "score": "0.6228044", "text": "static fetchRestaurantById(id, callback) {\n fetch(`${DBHelper.DATABASE_URL}/restaurants/${id}`).then(function (response) {\n return response.json();\n }).then(function (data) {\n callback(null, data);\n })\n }", "title": "" }, { "docid": "800cb5e916a405bacfd47da327d7976a", "score": "0.6207743", "text": "function getReviewer(review){\n return new Promise(resolve => {\n jQuery.get(userURL + \"/id/\" + review.leftById, function(user) {\n resolve(review.reviewer = user);\n });\n });\n}", "title": "" }, { "docid": "80c0317459315ffa306b08e955e62bc8", "score": "0.61787695", "text": "function getReviewData(movie) {\n reviewArr = [];\n ratingArr = [];\n id = movie._id;\n let allReviews = movie.reviews;\n\n // If there are records in the reviews key\n if (allReviews != undefined || allReviews.length != 0) {\n allReviews.forEach(function(thisReview){\n reviewArr.push({\n 'id': thisReview._id,\n 'content': thisReview.reviewText,\n 'rating': thisReview.rating,\n 'date': thisReview.createdAt,\n 'movie': thisReview.movie\n });\n ratingArr.push(thisReview.rating);\n })\n }\n\n // Handle empty reviews conditions\n if (allReviews === undefined || allReviews.length === 0) {\n ratingArr = \"No ratings currently\";\n reviewArr = \"No reviews currently\";\n }\n\n //Add reviewArr and ratingArr to the reviewsRatings object\n reviewsRatings = {\n reviews: reviewArr,\n ratings: ratingArr\n }\n\n return reviewsRatings;\n\n}", "title": "" }, { "docid": "3017bfe9561610a14a043a176d14c67b", "score": "0.6168319", "text": "static findById(id) {\n return this.all.find(review => review.id === id);\n }", "title": "" }, { "docid": "923659b41855f576e8c2c123341a65e5", "score": "0.6167396", "text": "static postPendingReview(review) {\n\n\t\tconst reviewToPost = {\n\t\t\tcomments: review.comments,\n\t\t\tcreatedAt: review.createdAt,\n\t\t\tupdatedAt: review.updatedAt,\n\t\t\tname: review.name,\n\t\t\trating: review.rating,\n\t\t\trestaurant_id: review.restaurant_id\n\t\t};\n\n\t\treturn fetch(`${DBHelper.REVIEWS_URL}`, {\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify(reviewToPost),\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t}\n\t\t})\n\t\t\t.then(resp => resp.json())\n\t\t\t.then(data => {\n\t\t\t\tconsole.log('data from api: ', data);\n\t\t\t\t// store it in the reviews store\n\t\t\t\treturn DBHelper.add('reviews', data);\n\t\t\t})\n\t\t\t.then(() => DBHelper.deleteFromDB('pending-reviews', review.id))\n\t\t\t.catch(err => {\n\t\t\t\tconsole.log(`Error: ${err}`);\n\t\t\t\treturn err;\n\t\t\t});\n\t}", "title": "" }, { "docid": "ee8cb276e36745018e933b9059607217", "score": "0.6162137", "text": "function callRestaurant()\n {\n return fetch(`https://developers.zomato.com/api/v2.1/search?entity_id=1138&entity_type=city&start=first&count=10&cuisines=${cuisineId}&sort=rating`, {\n headers: {\n \"Accept\": \"application/json\",\n \"user-key\": `${zomatoKeys.appKey}`\n }\n })\n .then(restaurants => restaurants.json())\n .then(parsedRest => parsedRest)\n }", "title": "" }, { "docid": "f80e9eb2d7fdd8cd6a6b2469794e2b89", "score": "0.61557376", "text": "function renderReviews()\n{\n //get a full list of restaurants\nconst db = firebase.firestore()\ndb.collection(\"restaurants\").get().then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n\n let linebreak = document.createElement('br');\n\n let divcontainer= document.createElement('div');\n divcontainer.className = \"card-container sub-container\"\n let img = document.createElement('img');\n img.src = \"images/restaurant1.jpg\" ;\n img.alt= \"restaurant\" ;\n let crdtext = document.createElement('div');\n crdtext.className=\"card-txt\";\n let rname = document.createElement('H1');\n rname.className=\"restName\";\n rname.innerHTML = '<a href=\"restaurantPage.html?restaurantid='+doc.id+'\"> ' + doc.data().name + ' </a>';\n let link = document.createElement('a');\n link.href = \"restaurantPage.html?restid=\" + doc.id;\n let rlocation = document.createElement('h2');\n rlocation.className=\"slant\";\n rlocation.innerText = doc.data().location;\n let reviewdate = document.createElement('h4'); \n let overall = document.createElement('p');\n overall.className = \"star-rating\"\n overall.innerHTML = \"Overall Rating \"\n addStars(overall,doc.data().overal);\n let rattingscontainer = document.createElement('div');\n rattingscontainer.className = \"ratings\";\n let review = document.createElement(\"p\");\n review.className = \"restReview\";\n let author = document.createElement(\"p\");\n author.className = \"reviewedBy\";\n let datereviewed = document.createElement(\"p\");\n\n\n //get the latest review for the selected restaurant - This is inefficient and would need to be fixed for a full release\n let query = db.collection(\"restaurants\").doc(doc.id).collection(\"review\").orderBy(\"date\", \"desc\").limit(1);\n query.get().then(querySnapshot => {\n querySnapshot.forEach(documentSnapshot => {\n \n reviewdate.innerHTML = \"Last reviewed on \" + documentSnapshot.data().date.toDate().toDateString();\n review.innerHTML = documentSnapshot.data().review;\n author.innerHTML = \"Reviewed by: \" + documentSnapshot.data().author;\n datereviewed.innerHTML = \"Visited on: \" + documentSnapshot.data().dayvisited;\n });\n });\n \n\n let food = document.createElement('p');\n food.innerHTML = \"<i class='fas fa-hotdog'></i> &nbsp; Food \";\n addStars(food,doc.data().food);\n let service = document.createElement('p');\n service.innerHTML = \"<i class='fas fa-concierge-bell'></i> &nbsp; Service \";\n addStars(service,doc.data().service);\n let value = document.createElement('p');\n value.innerHTML = \"<i class='fas fa-pound-sign'></i> &nbsp; Value \";\n addStars(value,doc.data().value);\n let atmosphere = document.createElement('p');\n atmosphere.innerHTML = \"<i class='fas fa-cloud-sun'></i> &nbsp; Atmosphere \";\n addStars(atmosphere,doc.data().atmosphere);\n\n\n rname.appendChild(link);\n divcontainer.appendChild(img);\n crdtext.appendChild(rname);\n crdtext.appendChild(rlocation);\n crdtext.appendChild(linebreak);\n crdtext.appendChild(reviewdate);\n crdtext.appendChild(overall);\n crdtext.appendChild(author);\n crdtext.appendChild(datereviewed);\n rattingscontainer.appendChild(food);\n rattingscontainer.appendChild(service);\n rattingscontainer.appendChild(value);\n rattingscontainer.appendChild(atmosphere);\n crdtext.appendChild(rattingscontainer);\n crdtext.appendChild(review);\n divcontainer.appendChild(crdtext)\n\n \n document.getElementById(\"startofreviews\").append(divcontainer);\n\n\n\n\n\n });\n});\n}", "title": "" }, { "docid": "672254a53b29b81b3d183ea41f6cb371", "score": "0.61536855", "text": "function getReviewed(customerId) {\n return $http.get('/api/rest/reviews')\n .then(getReviewedComplete)\n .catch(getReviewedFailed);\n\n function getReviewedComplete(response) {\n return response.data;\n }\n\n function getReviewedFailed(error) {\n $log.debug('XHR Failed for getReviewed.' + error.data);\n }\n }", "title": "" }, { "docid": "7a07fbeb65538f8ab98a095dc9dc141d", "score": "0.61489755", "text": "read({ review }, res) {\n\t\tres.json(review);\n\t}", "title": "" }, { "docid": "e42de61871e805b3bc908fee19de9bcc", "score": "0.61430645", "text": "function fetchReviews() {\n console.log(\"here fetch reviews\")\n const url = '/user-reviews?user=' + parameterUserID;\n fetch(url)\n .then((response) => {\n return response.json();\n })\n .then((reviews) => {\n const reviewsContainer = document.getElementById('reviews-container');\n if (reviews.length == 0) {\n reviewsContainer.innerHTML = '<p>This user has no reviews yet.</p>';\n } else {\n reviewsContainer.innerHTML = '';\n }\n reviews.forEach((review) => {\n const reviewDiv = buildReviewDiv(review);\n reviewsContainer.appendChild(reviewDiv);\n });\n });\n}", "title": "" }, { "docid": "282bf16e51ca7d89c69639f53a04c1fc", "score": "0.61309534", "text": "static addReviewsToServer() {\r\n return DBHelper.getAllFromOutbox('reviewsOutbox').then(reviews => {\r\n return Promise.all(\r\n reviews.map(review => {\r\n return fetch(\r\n `${DBHelper.DATABASE_URL}/reviews/?restaurant_id=${\r\n review.restaurant_id\r\n }&name=${review.name}&rating=${review.rating}&comments=${\r\n review.comments\r\n }`,\r\n {\r\n method: 'POST'\r\n }\r\n ).then(response => {\r\n if (response.status === 201) {\r\n return DBHelper.deleteFromOutbox('reviewsOutbox', review.id);\r\n }\r\n });\r\n })\r\n ).catch(error => {\r\n console.log('There was an error: ', error);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "6303eccb9c874f9bf16c121203821939", "score": "0.61127466", "text": "function reviewResults(yelpID, breweryID) {\n if (yelpID !== \"blank\") {\n var queryURL3 = \"https://cors-anywhere.herokuapp.com/https://api.yelp.com/v3/businesses/\" + yelpID + \"/reviews\";\n $.ajax({\n url: queryURL3,\n method: \"GET\",\n headers: {\n \"Authorization\": authHeader,\n },\n }).then(function (response3) {\n var newCol = $(\"<div>\").addClass(\"col-md-5 border border-secondary rounded py-2 ml-1\");\n newCol.html(\"<h5>Yelp Reviews</h5>\");\n $(\"#\" + breweryID).append(newCol);\n\n var newList = $(\"<ol>\");\n for (let index = 0; index < response3.reviews.length; index++) {\n var newListItem = $(\"<li>\").text(response3.reviews[index].text);\n newList.append(newListItem);\n };\n newCol.append(newList);\n });\n } else {\n var newCol = $(\"<div>\").addClass(\"col-md-5 border border-secondary rounded py-2 ml-1\");\n newCol.html(\"<h5>Yelp Reviews</h5>\");\n $(\"#\" + breweryID).append(newCol);\n var textNoReview = $(\"<div>\").html(\"<br><br><p>No yelp review was available for this brewery.</p>\");\n newCol.append(textNoReview);\n }\n}", "title": "" }, { "docid": "6206b5f1635f5fd5e3ed2a4a1a2f777f", "score": "0.61106807", "text": "static processAllPendingReviews() {\n if (navigator.onLine) {\n return DBHelper.openOutboxDatabase().then(db => {\n let tx = db.transaction('outbox');\n let store = tx.objectStore('outbox');\n return store.getAll();\n }).then(response => {\n // pendingForSubmitReviews(response);\n response.forEach(function (review) {\n //const rev = {\n // 'restaurant_id': review.restaurant_id,\n // 'name': review.name,\n // 'rating': review.rating,\n // 'comments': review.comments,\n // 'createdAt': review.createdAt\n // };\n\n fetch('http://localhost:1337/reviews/', {\n method: 'POST', body: JSON.stringify(review)\n }).then(result => {\n self.reviews.push(result);\n // DBHelper.updateReviewsDb(result);\n let data = {\n 'restaurant_id': review.restaurant_id,\n 'name': review.name,\n 'rating': review.rating,\n 'comments': review.comments,\n 'createdAt': review.createdAt,\n 'id': num + 100\n };\n DBHelper.updateReviewsDb(data);\n }).catch(er => {\n callback(er, null);\n });\n });\n });\n }\n }", "title": "" }, { "docid": "7fba57128fc8e6a451f12c8c5a9d0b81", "score": "0.610891", "text": "function getRestaurantReviews(restaurantMatched) {\n if (restaurantMatched.reviews.length === 0 || restaurantMatched.reviews.author === 'N/A') {\n return 'Aucun commentaire disponible.';\n } else {\n return restaurantMatched.reviews.map(function(review) {\n return `<h6><i><u>${review.getAuthor()}</u></i></h6>\n <u>Note :</u> ${review.getRate()} \n <i class='fas fa-star'></i>\n <br>\n <u>Avis :</u> ${review.getComment()}`;\n }).join('<br><br>');\n }\n}", "title": "" }, { "docid": "d9b003ce124beb7bd4b2b576e495e118", "score": "0.61025405", "text": "function fetchProductReviews(pProductId) {\n var lProductReviews_inputparam = {};\n lProductReviews_inputparam[\"serviceID\"] = \"FetchProductReviews\";\n lProductReviews_inputparam[\"productId\"] = pProductId;\n lProductReviews_inputparam[\"key\"] = gAppData.apiKey;\n lProductReviews_inputparam[\"pageNo\"] = \"1\";\n lProductReviews_inputparam[\"httpheaders\"] = {};\n lProductReviews_inputparam[\"httpconfigs\"] = {};\n var lProductReviews = appmiddlewaresecureinvokerasync(lProductReviews_inputparam, fetchProductReviews_callback);\n}", "title": "" }, { "docid": "d21721b6455c712dbc0b49f6bdcfca72", "score": "0.6102223", "text": "static async getMovieReviews (req, res, next){\n const movieId = req.params.id\n\n try {\n const movieExist = await movies.findOne({\n where: {\n id: movieId\n }\n })\n if (movieExist) {\n const comments = await reviews.findAll({\n where: {\n movieId: movieId\n }, \n include: [\n users,movies\n ]\n \n })\n res.status(200).json(comments)\n } else {\n res.status(200).json({\n msg :\"this movie was not reviewed yet\",\n movie : movieExist\n })\n }\n } catch (error) {\n next(error) \n }\n }", "title": "" }, { "docid": "68216ae76f8dec63e2a03452f89b4925", "score": "0.60993093", "text": "static postReview(review) {\n\n\t\treturn fetch(`${DBHelper.REVIEWS_URL}`, {\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify(review),\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t}\n\t\t})\n\t\t\t.then(resp => resp.json())\n\t\t\t.then(data => {\n\t\t\t\t// store it in the reviews store\n\t\t\t\tDBHelper.add('reviews', data);\n\t\t\t\treturn data;\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\t// when connection is down, store the review in db to send it later\n\t\t\t\tDBHelper.add('pending-reviews', review);\n\t\t\t\tconsole.log(`Error: ${err}`);\n\t\t\t\treturn null;\n\t\t\t});\n\t}", "title": "" }, { "docid": "5f16065e18b36a5b837540f7ac689a77", "score": "0.6091817", "text": "function getProductReviews(id, sort_input, count) {\n console.log(`Querying collection through index:\\n${config.collection.id}`);\n \n if (count) {\n \t// select top count\n }\n \n // good_score, unixReviewTime, 'helpfulRatio, helpful[1]'\n var primarySort = 'good_score',\n \tsecondarySort,\n \tsecondarySortIndex;\n if (sort_input) {\n \tprimarySort = sort_input.split(',')[0];\n \tif (sort_input.split(',').length > 1) {\n \t\tsecondarySort = sort_input.split(',')[1];\n \t\tvar secondarySortSplit = secondarySort.split('[');\n \t\tif (secondarySortSplit[0] != secondarySort) {\n \t\t\tsecondarySort = secondarySortSplit[0];\n \t\t\tsecondarySortIndex = secondarySortSplit[1].substr(0,1);\n \t\t}\n \t}\n }\n \n return new Promise((resolve, reject) => {\n client.queryDocuments(\n collectionUrl,\n 'SELECT * FROM root r WHERE r.asin = \"' + id + '\" order by r.' + primarySort + ' desc',\n options\n ).toArray((err, results) => {\n if (err) reject(err)\n else {\n \tif (secondarySort) {\n \t\tresults.sort(function(a,b) {\n \t\t\tif (a[primarySort] == b[primarySort]) {\n \t\t\t\tif (secondarySortIndex) {\n \t\t\t\t\treturn b[secondarySort][secondarySortIndex]-a[secondarySort][secondarySortIndex];\n \t\t\t\t} else {\n \t\t\t\t\treturn b[secondarySort]-a[secondarySort];\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\treturn b[primarySort]-a[primarySort];\n \t\t\t}\n \t\t});\n \t}\n// for (var queryResult of results) {\n// let resultString = JSON.stringify(queryResult);\n// console.log(`\\tQuery returned ${resultString}`);\n// }\n \tconsole.log(`\\tQuery returned ` + results.length + ` reviews`);\n console.log();\n resolve(results);\n }\n });\n });\n }", "title": "" }, { "docid": "61ddf07de09bdf6a9856b1738cdcfaf5", "score": "0.6076628", "text": "static postToAPI(review) {\n if (!review) return;\n\n return fetch(`${DBHelper.DATABASE_URL}/reviews`, {\n method: 'POST',\n body: JSON.stringify(review),\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n .then(resp => resp.json())\n .then(data => {\n // save to IDB\n DBHelper.saveReviewToIDB(\n data,\n `reviews-restaurant-${self.restaurant.id}`,\n `reviews-restaurant-${self.restaurant.id}`\n );\n return data;\n })\n .catch(err => {\n // Save a pending review in IDB\n DBHelper.saveReviewToIDB(review, `pending-reviews`, `pending-reviews`);\n // Add it as a global too\n if (!self.pendingReviews) {\n self.pendingReviews = [];\n }\n self.pendingReviews.push(review);\n\n console.log(`Error: ${err}`);\n return review;\n });\n }", "title": "" } ]
ce9a236e307cdd0a1578476b39030760
Event handler for 'orientationchange' events. If using the keyboard plugin and the keyboard is open on Android, sets wasOrientationChange to true so nativeShow can update the viewport height with an accurate keyboard height. If the keyboard isn't open or keyboard plugin isn't being used, waits for the window to resize before updating the viewport height. On iOS, where orientationchange fires after the keyboard has already shown, updates the viewport immediately, regardless of if the keyboard is already open.
[ { "docid": "06d33459646543ecec076fd27fffd0a2", "score": "0.79234064", "text": "function keyboardOrientationChange() {\n //console.log(\"orientationchange fired at: \" + Date.now());\n //console.log(\"orientation was: \" + (ionic.keyboard.isLandscape ? \"landscape\" : \"portrait\"));\n\n // toggle orientation\n ionic.keyboard.isLandscape = !ionic.keyboard.isLandscape;\n // //console.log(\"now orientation is: \" + (ionic.keyboard.isLandscape ? \"landscape\" : \"portrait\"));\n\n // no need to wait for resizing on iOS, and orientationchange always fires\n // after the keyboard has opened, so it doesn't matter if it's open or not\n if (ionic.Platform.isIOS()) {\n keyboardUpdateViewportHeight();\n }\n\n // On Android, if the keyboard isn't open or we aren't using the keyboard\n // plugin, update the viewport height once everything has resized. If the\n // keyboard is open and we are using the keyboard plugin do nothing and let\n // nativeShow handle it using an accurate keyboard height.\n if ( ionic.Platform.isAndroid()) {\n if (!ionic.keyboard.isOpen || !keyboardHasPlugin()) {\n keyboardWaitForResize(keyboardUpdateViewportHeight, false);\n } else {\n wasOrientationChange = true;\n }\n }\n}", "title": "" } ]
[ { "docid": "ebef3825e7956cf8f25611082686ce40", "score": "0.6303915", "text": "function handler() {\n // Get the current orientation.\n var orientation = get_orientation();\n\n if (orientation !== last_orientation) {\n // The orientation has changed, so trigger the orientationchange event.\n last_orientation = orientation;\n win.trigger(\"orientationchange\");\n }\n}", "title": "" }, { "docid": "892067e4576f2a5b1d62781b1aec84a2", "score": "0.62600446", "text": "function keyboardNativeShow(e) {\n clearTimeout(keyboardFocusOutTimer);\n //console.log(\"keyboardNativeShow fired at: \" + Date.now());\n //console.log(\"keyboardNativeshow window.innerHeight: \" + window.innerHeight);\n\n if (!ionic.keyboard.isOpen || ionic.keyboard.isClosing) {\n ionic.keyboard.isOpening = true;\n ionic.keyboard.isClosing = false;\n }\n\n ionic.keyboard.height = e.keyboardHeight;\n //console.log('nativeshow keyboard height:' + e.keyboardHeight);\n\n if (wasOrientationChange) {\n keyboardWaitForResize(keyboardUpdateViewportHeight, true);\n } else {\n keyboardWaitForResize(keyboardShow, true);\n }\n}", "title": "" }, { "docid": "892067e4576f2a5b1d62781b1aec84a2", "score": "0.62600446", "text": "function keyboardNativeShow(e) {\n clearTimeout(keyboardFocusOutTimer);\n //console.log(\"keyboardNativeShow fired at: \" + Date.now());\n //console.log(\"keyboardNativeshow window.innerHeight: \" + window.innerHeight);\n\n if (!ionic.keyboard.isOpen || ionic.keyboard.isClosing) {\n ionic.keyboard.isOpening = true;\n ionic.keyboard.isClosing = false;\n }\n\n ionic.keyboard.height = e.keyboardHeight;\n //console.log('nativeshow keyboard height:' + e.keyboardHeight);\n\n if (wasOrientationChange) {\n keyboardWaitForResize(keyboardUpdateViewportHeight, true);\n } else {\n keyboardWaitForResize(keyboardShow, true);\n }\n}", "title": "" }, { "docid": "4685dedcea02f6e85ef10434d4d1659c", "score": "0.6106982", "text": "function onOrientationChange(e){\n\n\t\tif(window.innerHeight>= window.innerWidth){\n\t\t\tuserAgent.portrait = true;\n\t\t\torientationMessageHolder.setAttribute('style', 'display: block;');\n\t\t\tcanvasHolder.setAttribute('style', 'display:none;');\n interfaceWrapper.setAttribute('style', 'display: none;');\n\t\t}else if(window.innerHeight<=window.innerWidth){\n\t\t\torientationMessageHolder.setAttribute('style', '');\n\t\t\tcanvasHolder.setAttribute('style', '');\n interfaceWrapper.setAttribute('style', '');\n\t\t\tuserAgent.portrait = false;\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "5d5739f2d11e82c11f8e69c6d193f423", "score": "0.60349834", "text": "function doOnOrientationChange(){\n\t\tswitch(window.orientation){ \n\t\t\tcase -90:\n\t\t\tcase 90:\n\t\t\t\t$('body').addClass('landscape').removeClass('portrait');\n\t\t\t\torientation = 'landscape';\n\t\t\t\tbreak; \n\t\t\tcase 0:\n\t\t\t\t$('body').addClass('portrait').removeClass('landscape');\n\t\t\t\torientation = 'portrait';\n\t\t\t\tbreak; \n\t\t}\n\t\twin_w = $(window).width();\n\t\twin_h = $(window).height();\n\t}", "title": "" }, { "docid": "49768870c00843f5784ffb76ac07c7c5", "score": "0.5886105", "text": "function callbackOrientationChange(orientation, page_id){\n \n}", "title": "" }, { "docid": "21f86489adfe586c81211b523686acde", "score": "0.58706707", "text": "function handleDeviceOrientation() {\n //disregard on FireTV\n if(navigator.userAgent.match(/AFT/i)) {return;}\n\n //wrap in a timer to make sure the height and width are updated\n setTimeout(function() {\n if(window.innerWidth < window.innerHeight) {\n $('#overlay-message').html('please rotate your device back to landscpe');\n $('#app-overlay').css('display', 'block'); \n } \n else {\n $('#overlay-message').html('');\n $('#app-overlay').css('display', 'none'); \n }\n }, 500);\n }", "title": "" }, { "docid": "f5337eb1108735fd1f771cbd2ee91513", "score": "0.5847701", "text": "function handler()\n\t{\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif(orientation !== last_orientation)\n\t\t{\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( \"orientationchange\" );\n\t\t}\n\t}", "title": "" }, { "docid": "7234cde6a4bb40f663f0027ca20931d1", "score": "0.5829636", "text": "function handleOrientationChange(event)\n\t{\n\t\torientation = top.orientation;\n\t\tlandscape = (Math.abs(orientation) == 90),\n\t\tportrait = !landscape;\n\t\t\n\t\tkrpano.call( onOrientationChange );\t\t\n\t}", "title": "" }, { "docid": "a6a8e4486192d1ee349304b9088dc4a1", "score": "0.5823938", "text": "updateOrientationChanged() {\r\n\r\n if(__DEV__){\r\n console.log(\"Orientation changed\");\r\n }\r\n\r\n this.state.orientationChanged = !this.state.orientationChanged;\r\n\r\n for(var i in this.state.callbacks.orientationChanged){\r\n this.state.callbacks.orientationChanged[i](this.state.orientationChanged);\r\n }\r\n }", "title": "" }, { "docid": "78f1350489d41ab257e0f1b271a8f8c1", "score": "0.5774822", "text": "ScreenSizeChanged() {\n let NewMode = tp.Viewport.Mode;\n let ModeFlag = NewMode !== tp.Viewport.OldMode;\n if (ModeFlag) {\n tp.Viewport.OldMode = NewMode;\n }\n\n // inform listeners\n let L;\n for (let i = 0, ln = tp.Viewport.Listeners.length; i < ln; i++) {\n L = tp.Viewport.Listeners[i];\n L.Func.call(L.Context, ModeFlag);\n }\n }", "title": "" }, { "docid": "233aac48e8d9fa4069e45096c6d0bc82", "score": "0.57159907", "text": "_initObserver() {\n this.__onNativeWrapper = qx.lang.Function.listener(this._onNative, this);\n\n // Handle orientation change event for Android devices by the resize event.\n // See http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript\n // for more information.\n this.__nativeEventType = qx.bom.Event.supportsEvent(\n this._window,\n \"orientationchange\"\n )\n ? \"orientationchange\"\n : \"resize\";\n\n qx.bom.Event.addNativeListener(\n this._window,\n this.__nativeEventType,\n this.__onNativeWrapper\n );\n }", "title": "" }, { "docid": "12f0e876143ca7b23e702bfadae07b51", "score": "0.5703358", "text": "function checkOrientation() {\n console.log({ innerHeight: window.innerHeight, scrollHeight: containerRef.scrollHeight });\n if (window.innerHeight < containerRef.scrollHeight) {\n containerRef.style.maxHeight = window.innerHeight + 'px';\n } else if (containerRef.style.maxHeight) {\n containerRef.style.maxHeight = \"\";\n }\n }", "title": "" }, { "docid": "b3ce67e1ca4043879044f7e035b61331", "score": "0.5643532", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( event_name );\n\t\t}\n\t}", "title": "" }, { "docid": "b3ce67e1ca4043879044f7e035b61331", "score": "0.5643532", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( event_name );\n\t\t}\n\t}", "title": "" }, { "docid": "b3ce67e1ca4043879044f7e035b61331", "score": "0.5643532", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( event_name );\n\t\t}\n\t}", "title": "" }, { "docid": "b3ce67e1ca4043879044f7e035b61331", "score": "0.5643532", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( event_name );\n\t\t}\n\t}", "title": "" }, { "docid": "b3ce67e1ca4043879044f7e035b61331", "score": "0.5643532", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( event_name );\n\t\t}\n\t}", "title": "" }, { "docid": "244583ce3c8d2393caa8c4b0a5ce4e90", "score": "0.5568089", "text": "bindEvent () {\n const self = this\n window.addEventListener('deviceorientation', self.orientHandle.bind(self), false)\n window.addEventListener('orientationchange', self.changeHandle.bind(self), false)\n }", "title": "" }, { "docid": "d04e4af4ea7f9f79ef7b84ae1e820979", "score": "0.55300593", "text": "function resizeHandler(){\n //checking if it needs to get responsive\n responsive();\n\n // rebuild immediately on touch devices\n if (isTouchDevice) {\n var activeElement = $(document.activeElement);\n\n //if the keyboard is NOT visible\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\n var currentHeight = $window.height();\n\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\n FP.reBuild(true);\n previousHeight = currentHeight;\n }\n }\n }else{\n //in order to call the functions only when the resize is finished\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\n clearTimeout(resizeId);\n\n resizeId = setTimeout(function(){\n FP.reBuild(true);\n }, 350);\n }\n }", "title": "" }, { "docid": "015ca5bfc96dae539bcf7ed58e163e60", "score": "0.5514603", "text": "function orientationChanges(oldPage, newPage) {\r\n return false//newPage.orientationLock != PageOrientation.Automatic\r\n //&& newPage.orientationLock != PageOrientation.LockPrevious\r\n //&& newPage.orientationLock != oldPage.orientationLock\r\n}", "title": "" }, { "docid": "8f6d1d4b36819cdb3da93bc8863498db", "score": "0.5511693", "text": "function add_tablet_orientation_listener(){\n jQuery(document).ready(function() {\n jQuery(window).bind('orientationchange', function() {\n switch (window.orientation) {\n case -90:\n case 90:\n if (JSON.parse(window.localStorage.getItem('hide_side_menu')) === true) {\n hide_side_menu(false);\n } else {\n show_side_menu(false);\n }\n break;\n default:\n hide_side_menu(false);\n break;\n }\n });\n });\n}", "title": "" }, { "docid": "851fbddf39d8787c6dd5fa3752c533da", "score": "0.54774666", "text": "function resizeHandler() {\n //checking if it needs to get responsive\n responsive();\n\n // rebuild immediately on touch devices\n if (isTouchDevice) {\n var activeElement = $(document.activeElement);\n\n //if the keyboard is NOT visible\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\n var currentHeight = $window.height();\n\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\n if (Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100)) {\n reBuild(true);\n previousHeight = currentHeight;\n }\n }\n } else {\n //in order to call the functions only when the resize is finished\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\n clearTimeout(resizeId);\n\n resizeId = setTimeout(function () {\n reBuild(true);\n }, 350);\n }\n }", "title": "" }, { "docid": "58cd4b3eef1fb7e8f3df37fd9c1456e2", "score": "0.5476683", "text": "function resizeHandler() {\n //checking if it needs to get responsive\n responsive();\n\n // rebuild immediately on touch devices\n if (isTouchDevice) {\n var activeElement = $(document.activeElement);\n\n //if the keyboard is NOT visible\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\n var currentHeight = $window.height();\n\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\n if (Math.abs(currentHeight - previousHeight) > 20 * Math.max(previousHeight, currentHeight) / 100) {\n reBuild(true);\n previousHeight = currentHeight;\n }\n }\n } else {\n //in order to call the functions only when the resize is finished\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\n clearTimeout(resizeId);\n\n resizeId = setTimeout(function () {\n reBuild(true);\n }, 350);\n }\n }", "title": "" }, { "docid": "0168e8840e7902909b023cc5b3531b81", "score": "0.54357845", "text": "function onScreenOrientationChange(event){\n\tcontrols.disconnect();\n\tif (window.innerWidth > window.innerHeight) camera = new THREE.PerspectiveCamera( 75, window.innerHeight / window.innerWidth, 1, 1100 );\n\telse camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 1100 );\n\trenderer.setSize( window.innerWidth, window.innerHeight );\n\tcontrols = new DeviceOrientationController( camera, renderer.domElement );\n\tcontrols.connect();\n\tinfo.innerHTML += \"<br>rotation\"; \n}", "title": "" }, { "docid": "e0bff78a979c2811498908cb29c3a0e8", "score": "0.5401256", "text": "function handleOrientationChangeEvent() {\n Interdimensional.kick();\n }", "title": "" }, { "docid": "2779a9263a98697ba4aa795d2552f4a8", "score": "0.53835446", "text": "function orientationChangeHandler(evt) {\n if(landscape != evt.matches) {\n landscape = ! landscape;\n toggleOrientation();\n }\n}", "title": "" }, { "docid": "5f518072f6b096b5e5de4d9d204c81b8", "score": "0.5362282", "text": "onOrientationChange(orientation){\n\t\t\t/**\n\t\t\t * Emit that the rendition has been rotated\n\t\t\t * @event orientationchange\n\t\t\t * @param {string} orientation\n\t\t\t * @memberof Rendition\n\t\t\t */\n\t\t\tthis.emit(EVENTS.RENDITION.ORIENTATION_CHANGE, orientation);\n\t\t}", "title": "" }, { "docid": "a2259e168293ef41d8a6de292fec47a3", "score": "0.53614914", "text": "handleCTAResize() {\r\n const windowWidth = window.innerWidth;\r\n if (windowWidth < 767) {\r\n this.orientation = 'vertical';\r\n }\r\n }", "title": "" }, { "docid": "9467f8858c1efe7274f09281636c4a05", "score": "0.5331707", "text": "function determineOrientation(event) {\n var key = event.keyCode;\n var w = window,\n d = document,\n e = d.documentElement,\n g = d.getElementsByTagName('body')[0],\n x = w.innerWidth || e.clientWidth || g.clientWidth,\n y = w.innerHeight || e.clientHeight || g.clientHeight;\n var vertical = x < breakpoints.md;\n var proceed = false;\n\n if (vertical) {\n if (key === keys.up || key === keys.down) {\n event.preventDefault();\n proceed = true;\n }\n } else {\n if (key === keys.left || key === keys.right) {\n proceed = true;\n }\n }\n\n if (proceed) {\n switchTabOnArrowPress(event);\n }\n} // Either focus the next, previous, first, or last tab", "title": "" }, { "docid": "0a5488207c932ac0a106433f8092f26b", "score": "0.53217685", "text": "function handleResize() {\n let isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth < 768\n // some code..\n // Set window width/height to state\n setIsMobileScreen(isMobile);\n }", "title": "" }, { "docid": "ed94ba10cbad85586e79f1e6260bc38d", "score": "0.53034914", "text": "function createOrientationManager() {\n Dimensions.addEventListener('change', () => {\n const dim = Dimensions.get('screen')\n store.dispatch({\n type: CHANGE_ORIENTATION,\n isPortrait: dim.height >= dim.width,\n deviceWidth: Dimensions.get('window').width\n })\n })\n}", "title": "" }, { "docid": "4558f903631fee0c12052ef7d2c91aae", "score": "0.52800614", "text": "function OrientationChange() {\n //wait for css media query to take effect\n window.setTimeout(SetScreenType,1);\n}", "title": "" }, { "docid": "8569d13e7df2a9e5dc73f0a600459580", "score": "0.5277016", "text": "function handleOrientation() {\n if (device.landscape()) {\n removeClass('portrait');\n addClass('landscape');\n walkOnChangeOrientationList('landscape');\n } else {\n removeClass('landscape');\n addClass('portrait');\n walkOnChangeOrientationList('portrait');\n }\n setOrientationCache();\n}", "title": "" }, { "docid": "df6183c6674768d04e4094c4f77a30fb", "score": "0.52724093", "text": "function orientationChange(rotation) {\n\twindow.compass.orChange(rotation);\n}", "title": "" }, { "docid": "db0ba9da76dd884a4ee3e2f10b45fc23", "score": "0.52678424", "text": "_resize() {\n this._onViewportChange({\n width: 450,\n height: 450\n });\n }", "title": "" }, { "docid": "b74e2b93fbc04ae5e9eb1297b09d208b", "score": "0.5248766", "text": "function onResize(win) {\n if (State.vrDisplay && State.vrDisplay.isPresenting) {\n var canvas = win.getContext().getGL().canvas;\n var leftEye = State.vrDisplay.getEyeParameters(\"left\");\n var rightEye = State.vrDisplay.getEyeParameters(\"right\");\n canvas.width = Math.max(leftEye.renderWidth, rightEye.renderWidth) * 2 * win.getPixelRatio();\n canvas.height = Math.max(leftEye.renderHeight, rightEye.renderHeight) * win.getPixelRatio();\n\n //prevent iOS Safari bars from showing after rotation\n canvas.style.position = 'relative';\n canvas.parentNode.style.position = 'relative';\n }\n}", "title": "" }, { "docid": "bc850f535cf2a0d96b514edb399b9a83", "score": "0.52443963", "text": "function calculateHeading() {\n if (window.DeviceOrientationEvent) {\n window.addEventListener(\"deviceorientation\", function (event) {\n if ('ondeviceorientationabsolute' in window) {\n window.ondeviceorientationabsolute = function(event) {\n currHeading = event.alpha;\n return true;\n };\n } else if(event.webkitCompassHeading) {\n var compass = event.webkitCompassHeading;\n handleOrientationEvent(compass);\n return true;\n } else if (event.absolute == true) {\n var compass = event.alpha;\n handleOrientationEvent(compass);\n return true;\n } else {\n demo.innerHTML = \"<br>Compass Heading Not Working\";\n return false;\n }\n }, true);\n } else {\n demo.innerHTML = \"<br>Compass Heading Not Working\";\n return false;\n }\n}", "title": "" }, { "docid": "724f2ed7e42ba4a76a0e0830266da6e9", "score": "0.5239096", "text": "function handleOrientation(e) {\n const mobileYRange = 2.5;\n let mobileY = e.gamma;\n if (mobileY < -mobileYRange) {\n leftPressed = true;\n } else if (mobileY > mobileYRange) {\n rightPressed = true;\n } else {\n leftPressed = false;\n rightPressed = false;\n }\n}", "title": "" }, { "docid": "d68743fb0c4c2d8be0261592c5753ddc", "score": "0.5237891", "text": "function resizeEvent() {\n $(window).on('resize', function () {\n\n initiateInterfaceValues();\n });\n}", "title": "" }, { "docid": "56f1e3b28d0ad388e0dc5892a9c757a0", "score": "0.52343047", "text": "function onHeadingChange(event) {\n var heading = event.alpha;\n\n if (typeof event.webkitCompassHeading !== \"undefined\") {\n heading = event.webkitCompassHeading; //iOS non-standard\n }\n\n var orientation = getBrowserOrientation();\n\n if (typeof heading !== \"undefined\" && heading !== null) { // && typeof orientation !== \"undefined\") {\n // we have a browser that reports device heading and orientation\n\n\n if (debug) {\n debugOrientation.textContent = orientation;\n }\n\n\n // what adjustment we have to add to rotation to allow for current device orientation\n var adjustment = 0;\n if (defaultOrientation === \"landscape\") {\n adjustment -= 90;\n }\n\n if (typeof orientation !== \"undefined\") {\n var currentOrientation = orientation.split(\"-\");\n\n if (defaultOrientation !== currentOrientation[0]) {\n if (defaultOrientation === \"landscape\") {\n adjustment -= 270;\n } else {\n adjustment -= 90;\n }\n }\n\n if (currentOrientation[1] === \"secondary\") {\n adjustment -= 180;\n }\n }\n\n positionCurrent.hng = heading + adjustment;\n\n var phase = positionCurrent.hng < 0 ? 360 + positionCurrent.hng : positionCurrent.hng;\n positionHng.textContent = (360 - phase | 0) + \"°\";\n\n\n // apply rotation to compass rose\n if (typeof rose.style.transform !== \"undefined\") {\n rose.style.transform = \"rotateZ(\" + positionCurrent.hng + \"deg)\";\n } else if (typeof rose.style.webkitTransform !== \"undefined\") {\n rose.style.webkitTransform = \"rotateZ(\" + positionCurrent.hng + \"deg)\";\n }\n } else {\n // device can't show heading\n\n positionHng.textContent = \"n/a\";\n showHeadingWarning();\n }\n }", "title": "" }, { "docid": "306900e2a00b581560c359f453a1b5dc", "score": "0.5206341", "text": "function watchOrientation() {\n\tvar orient = navigator.sensors.orientation;\n\t\n\torient.onsensordata = orientationChange;\n\torient.onerror = error;\n\torient.startWatch({interval:500});\n}", "title": "" }, { "docid": "656143da6299a595bde68c0bf7e5340d", "score": "0.51875025", "text": "function handleWindowSizeChange() {\n \n // activamos/desactivamos parallax\n guardarIsDisable( window.innerWidth <= 768 );\n }", "title": "" }, { "docid": "6ddf37f49257be879fc57140c4177be1", "score": "0.518341", "text": "function createDeviceOrientationHandler(inputTarget, objectOrientation, updated, events) {\r\n if (!updated)\r\n { updated = Function.prototype; }\r\n inputTarget.addEventListener('touchstart', pauseDeviceOrientation);\r\n inputTarget.addEventListener('touchend', resetScreenAdjustment);\r\n var deviceOrientationEventName = 'deviceorientationabsolute';\r\n window.addEventListener('orientationchange', updateScreenOrientation);\r\n var sceneAdjustmentNeedsUpdate = true;\r\n var sceneAdjustment = [0, 0, 0, 1];\r\n var deviceOrientation = [0, 0, 0, 1];\r\n var screenOrientation = [0, 0, 0, 1];\r\n updateScreenOrientation();\r\n var api = {\r\n isEnabled: false,\r\n isAbsolute: true,\r\n useCurrentOrientation: useCurrentOrientation,\r\n dispose: dispose,\r\n enable: enable,\r\n };\r\n return api;\r\n function enable(newEnabled) {\r\n api.isEnabled = newEnabled;\r\n if (api.isEnabled) {\r\n if (window.DeviceOrientationEvent !== undefined &&\r\n window.DeviceOrientationEvent.requestPermission !== undefined) {\r\n // We are in IOS? IOS doesn't have the deviceorientationabsolute for some reason.\r\n DeviceOrientationEvent.requestPermission().then(function (response) {\r\n if (response === 'granted') {\r\n deviceOrientationEventName = 'deviceorientation';\r\n window.addEventListener(deviceOrientationEventName, onDeviceOrientationChange);\r\n }\r\n else {\r\n api.isEnabled = false;\r\n }\r\n if (events)\r\n { events.fire('device-orientation', api.isEnabled); }\r\n }).catch(function (e) {\r\n api.isEnabled = false;\r\n if (events)\r\n { events.fire('device-orientation', api.isEnabled); }\r\n });\r\n }\r\n else {\r\n window.addEventListener(deviceOrientationEventName, onDeviceOrientationChange);\r\n }\r\n }\r\n else {\r\n pauseDeviceOrientation();\r\n if (events)\r\n { events.fire('device-orientation', api.isEnabled); }\r\n }\r\n }\r\n function useCurrentOrientation() {\r\n sceneAdjustmentNeedsUpdate = true;\r\n }\r\n function onDeviceOrientationChange(e) {\r\n var alpha = e.alpha;\n var beta = e.beta;\n var gamma = e.gamma;\r\n if (e.absolute && alpha === null && beta === null && gamma === null) {\r\n // This means the device can never provide absolute values. We need to fallback\r\n // to relative device orientation which is not very accurate and prone to errors.\r\n // Consumers of this API better should allow users to switch to non-device-orientation based\r\n // means of movement\r\n window.removeEventListener('deviceorientationabsolute', onDeviceOrientationChange);\r\n window.addEventListener('deviceorientation', onDeviceOrientationChange);\r\n deviceOrientationEventName = 'deviceorientation';\r\n api.isAbsolute = false;\r\n return;\r\n }\r\n updateDeviceOrientationFromEuler(alpha, beta, gamma);\r\n // align with current object's orientation:\r\n if (sceneAdjustmentNeedsUpdate) {\r\n sceneAdjustmentNeedsUpdate = false;\r\n // Here we find an angle between device orientation and the object's orientation in XY plane\r\n var deviceFront = cjs_2.transformQuat([], FRONT, deviceOrientation);\r\n var cameraFront = cjs_2.transformQuat([], FRONT, objectOrientation);\r\n // Since we care only about 2D projection:\r\n var xyDot = deviceFront[0] * cameraFront[0] + deviceFront[1] * cameraFront[1];\r\n var deviceLength = Math.sqrt(deviceFront[0] * deviceFront[0] + deviceFront[1] * deviceFront[1]);\r\n var cameraLength = Math.sqrt(cameraFront[0] * cameraFront[0] + cameraFront[1] * cameraFront[1]);\r\n var angle = Math.acos(xyDot / (deviceLength * cameraLength)) / 2;\r\n // We care about the sign of the Z component of a cross product, as it gives us\r\n // direction of correct rotation to align the scene and device.\r\n // let sign = Math.sign(vec3.cross([], deviceFront, cameraFront)[2]);\r\n var sign = Math.sign(deviceFront[0] * cameraFront[1] - deviceFront[1] * cameraFront[0]);\r\n // These two are zero:\r\n // sceneAdjustment[0] = 0;\r\n // sceneAdjustment[1] = 0;\r\n sceneAdjustment[2] = sign * Math.sin(angle);\r\n sceneAdjustment[3] = Math.cos(angle);\r\n }\r\n cjs_5.mul(deviceOrientation, deviceOrientation, screenOrientation);\r\n // account for difference between lookAt and device orientation:\r\n cjs_5.mul(objectOrientation, sceneAdjustment, deviceOrientation);\r\n updated();\r\n }\r\n function updateScreenOrientation() {\r\n // TODO: `window.orientation` is deprecated, might need to sue screen.orientation.angle,\r\n // but that is not supported by ios\r\n var orientation = (window.orientation || 0);\r\n var screenAngle = -orientation * halfToRad;\r\n // We assume these two are zero:\r\n // screenOrientation[0] = 0;\r\n // screenOrientation[1] = 0;\r\n screenOrientation[2] = Math.sin(screenAngle);\r\n screenOrientation[3] = Math.cos(screenAngle);\r\n }\r\n function updateDeviceOrientationFromEuler(alpha, beta, gamma) {\r\n // These values can be nulls if device cannot provide them for some reason.\r\n var _x = beta ? beta * halfToRad : 0;\r\n var _y = gamma ? gamma * halfToRad : 0;\r\n var _z = alpha ? alpha * halfToRad : 0;\r\n var cX = Math.cos(_x);\r\n var cY = Math.cos(_y);\r\n var cZ = Math.cos(_z);\r\n var sX = Math.sin(_x);\r\n var sY = Math.sin(_y);\r\n var sZ = Math.sin(_z);\r\n // ZXY quaternion construction from Euler\r\n deviceOrientation[0] = sX * cY * cZ - cX * sY * sZ;\r\n deviceOrientation[1] = cX * sY * cZ + sX * cY * sZ;\r\n deviceOrientation[2] = cX * cY * sZ + sX * sY * cZ;\r\n deviceOrientation[3] = cX * cY * cZ - sX * sY * sZ;\r\n }\r\n function dispose() {\r\n inputTarget.removeEventListener('touchstart', pauseDeviceOrientation);\r\n inputTarget.removeEventListener('touchend', resetScreenAdjustment);\r\n window.removeEventListener('deviceorientationabsolute', onDeviceOrientationChange);\r\n window.removeEventListener('deviceorientation', onDeviceOrientationChange);\r\n window.removeEventListener('orientationchange', updateScreenOrientation);\r\n }\r\n function pauseDeviceOrientation(e) {\r\n if (sceneAdjustmentNeedsUpdate)\r\n { return; }\r\n sceneAdjustmentNeedsUpdate = true;\r\n if (e)\r\n { e.preventDefault(); }\r\n window.removeEventListener(deviceOrientationEventName, onDeviceOrientationChange);\r\n }\r\n function resetScreenAdjustment(e) {\r\n if (e.touches.length)\r\n { return; } // still touching. Wait till all are gone\r\n sceneAdjustmentNeedsUpdate = true;\r\n // just in case... to prevent leaking.\r\n if (api.isEnabled) {\r\n window.removeEventListener(deviceOrientationEventName, onDeviceOrientationChange);\r\n window.addEventListener(deviceOrientationEventName, onDeviceOrientationChange);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b920b835b613bdd9336466a6bf620760", "score": "0.5162997", "text": "function setupKeyboardHideListener() {\n console.log(`App.js #setupKeyboardHideListener`);\n\n // Detect the event and apply the normal height in the event the keyboard will hide.\n window.addEventListener('keyboardWillHide', function () {\n console.log(`App.js key board hide detected, adjusting html elem height.`);\n\n document.getElementsByTagName('html')[0].style.height = '101vh';\n setTimeout(()=>{\n document.getElementsByTagName('html')[0].style.height = '100vh';\n }, 350);\n });\n}", "title": "" }, { "docid": "9ef53c70fc02af0d27bfe013a0466900", "score": "0.5158501", "text": "function onResize_() {\n reinitOnePageNav_();\n checkMobile_();\n}", "title": "" }, { "docid": "7cd2097d2e9d794d0bdf4f3f7f84ef9f", "score": "0.51568824", "text": "onViewPortChange() {\n window.addEventListener('resize', this.reset.bind(this));\n window.addEventListener('scroll', this.reset.bind(this));\n }", "title": "" }, { "docid": "53b1bce9711b34f18d88a36995c90ad1", "score": "0.5142125", "text": "function handleOrientation(event){\n\t\tQZMotion.hasOrn = true;\n\t\tQZMotion.orn\t= event;\n\t}", "title": "" }, { "docid": "16a65a532efc5e0a1c5d2ecebc457ec6", "score": "0.5138832", "text": "function _checkOrientation() {\n var _w = $(window).width();\n var _h = $(window).height();\n if (_h > _w) {\n //portrait\n return 0;\n } else {\n //landscape\n return 1;\n }\n}", "title": "" }, { "docid": "72918db8c946afadb64bd6e8024598dd", "score": "0.5129039", "text": "function DOMContentLoaded() {\n\t\t\torientationchange();\n\t\t\tdoc.removeEventListener( 'DOMContentLoaded', DOMContentLoaded, true );\n\t\t}", "title": "" }, { "docid": "ff9b8a0720d053d468c5f93404d901cf", "score": "0.51208174", "text": "function detectOrientation(){\n if(typeof window.onorientationchange != 'undefined'){\n jQuery('#quicktabs-container-navegacion_internas_baloto').css({'position':'absolute !important','left':'220px','top':'30px !important'})\n }\n }", "title": "" }, { "docid": "202946a0f29121dc1867311a5aaf45d9", "score": "0.51189643", "text": "onResize(width, height) {\n }", "title": "" }, { "docid": "05d2d3656007c190d8fa7087a9f2a4ff", "score": "0.51094735", "text": "function bindEvents(){\n if (window.DeviceOrientationEvent) {\n // Listen for the event and handle DeviceOrientationEvent object\n window.addEventListener('deviceorientation', deviceOrientationHandler, false);\n }\n \t//window.addEventListener('deviceorientation', deviceOrientationHandler , false);\n \tdocument.getElementById('VRcontainer').addEventListener('click', showOverlay , false);\n \tdocument.getElementById('pannellumVR-return-button').addEventListener('click',\n \tfunction(){\n \t\t$ionicHistory.goBack();\n \t\t}\n \t);\n }", "title": "" }, { "docid": "1ebc55930c1a6124f577d69e09f60644", "score": "0.5108553", "text": "function checkIfIsAndroid() {\n privateIsAndroid = uaLowerCase.match(/(android)/) !== null;\n if (privateIsAndroid && !privateDetectOrientationBound) {\n on(window, \"orientationchange\", detectOrientation);\n privateDetectOrientationBound = true;\n }\n }", "title": "" }, { "docid": "3ccc6c4eb1acd455dbf8aa978a83e476", "score": "0.51019603", "text": "function onDeviceReady()\n {\n // listen for orientation changes\n window.addEventListener(\"orientationchange\", window.plugins.iAd.orientationChanged, false);\n // listen for the \"iAdBannerViewDidLoadAdEvent\" that is sent by the iAd\n document.addEventListener(\"iAdBannerViewDidLoadAdEvent\", iAdBannerViewDidLoadAdEventHandler, false);\n // listen for the \"iAdBannerViewDidFailToReceiveAdWithErrorEvent\" that is sent by the iAd\n document.addEventListener(\"iAdBannerViewDidFailToReceiveAdWithErrorEvent\", iAdBannerViewDidFailToReceiveAdWithErrorEventHandler, false);\n \n var adAtBottom = false; \n setTimeout(function() {\n window.plugins.iAd.prepare(adAtBottom); // by default, ad is at Top\n }, 1000);\n window.plugins.iAd.orientationChanged(true);//trigger immediately so iAd knows its orientation on first load\n }", "title": "" }, { "docid": "1a3f45421476757ccd0d5db24296fb6c", "score": "0.5078938", "text": "function onOrientationChange(e) {\n //console.log(\"orientationChange\");\n MaximizeWrapper(function() {\n pizzabtn.css('left', '20px');\n pizzabtn.css('top', '20px');\n MinimizeWrapper(function(){\n }, 10); \n });\n\n if($.fancybox.isOpen) {\n closeAfterOrientationChange = true;\n $.fancybox.close();\n };\n }", "title": "" }, { "docid": "be13f8680972f95321f4802b4656712c", "score": "0.507278", "text": "function detectInitialOrientation() {\n if (iosCheck === true) {\n if ($(window).height() < $(window).width()) {\n $('body').not(\".device-pc\").addClass('isLandscape');\n } else if ($(window).height() < $(window).width()) {\n if ($('body').not(\".device-pc\").hasClass('isLandscape')) {\n $('body').not(\".device-pc\").removeClass('isLandscape');\n }\n }\n } else if (iosCheck === false) {\n if ($(window).height() < $(window).width()) {\n $('body').not(\".device-pc\").addClass('isLandscape');\n\n } else if ($(window).height() > $(window).width()) {\n if ($('body').not(\".device-pc\").hasClass('isLandscape')) {\n $('body').not(\".device-pc\").removeClass('isLandscape');\n }\n }\n }\n }", "title": "" }, { "docid": "e055d32e0d26d32be50fe8c95cb927ca", "score": "0.50710183", "text": "function handleResize() {\n\n// if (toolbarVisible) {\n// tabris.ui.set({\n// toolbarVisible: false,\n// })\n// toolbarVisible = false\n// }\n\n var newHeight = screen.height\n var newWidth = screen.width\n\n\n if (newWidth === windowWidth && newHeight === windowHeight)\n return false;\n\n windowWidth = newWidth;\n windowHeight = newHeight;\n\n if (!isResizing){\n Engine.size.emit('start');\n isResizing = true;\n resizeEnd();\n }\n else {\n postTickQueue.push(function(){\n Engine.size.emit('update');\n resizeEnd();\n });\n }\n}", "title": "" }, { "docid": "e6393338e2ef6e58f7fb1fb3d5a0c37f", "score": "0.50624645", "text": "function handleResize(isMobile) {\n controller.enabled(!isMobile.matches)\n}", "title": "" }, { "docid": "e94b53174fef52106c5b36f741736bde", "score": "0.5056762", "text": "_handlePageResize() {\r\n this.updateSize();\r\n\r\n // In iOS webview, if element size depends on document size,\r\n // it'll be measured incorrectly in resize event\r\n //\r\n // https://bugs.webkit.org/show_bug.cgi?id=170595\r\n // https://hackernoon.com/onresize-event-broken-in-mobile-safari-d8469027bf4d\r\n if (/iPhone|iPad|iPod/i.test(window.navigator.userAgent)) {\r\n setTimeout(() => {\r\n this.updateSize();\r\n }, 500);\r\n }\r\n }", "title": "" }, { "docid": "be2546302427e58fc72a70b996930980", "score": "0.5049795", "text": "function onorientationchange () {\r\n orientation = abs(window.orientation) == 90 ? \"landscape\" : \"portrait\";\r\n \r\n //effectively this shouldn't be necessary, but it appears to be\r\n $(\"#jqt\").removeClass(\"portrait landscape\").addClass(orientation);\r\n \r\n //make sure the slides line up appropriately, use delay to ensure repaint has passed\r\n setTimeout(function(){\r\n var playing = [],\r\n loop = function() {\r\n var $this = $(this), \r\n options = $this.data(\"jqt-photo-options\"),\r\n slides = $this.find(options.slideSelector),\r\n images = slides.find(options.imageSelector);\r\n \r\n //if ($this.is(\":visible\")) {\r\n alignSlides($this, slides, options);\r\n //}\r\n \r\n if ($this.hasClass(options.playingClass)) {\r\n playing.push(this);\r\n $this.triggerHandler(\"jqt-photo-pause\");\r\n }\r\n \r\n //if (!images.data(\"jqt-photo-info\")[orientation]) {\r\n // parseImageData($this, images, defaults);\r\n //}\r\n \r\n resetDimensions(images.filter(\"[src]\"));\r\n };\r\n \r\n $(galleries).filter(\":visible\").each(loop).end().filter(\":not(:visible)\").each(loop);\r\n \r\n $(playing).triggerHandler(\"jqt-photo-play\");\r\n \r\n }, 10);\r\n \r\n controlPoints = {x: window.innerWidth/2, y: window.innerHeight/2};\r\n \r\n return null;\r\n }", "title": "" }, { "docid": "93649018b1f92cf456bcee4f4ad05ca9", "score": "0.5045593", "text": "function doDeviceOrientation( evt ) \n{\n\tupdate( evt.gamma, evt.beta );\t\n}", "title": "" }, { "docid": "efed801ea3b858ad5232b5f682a3194f", "score": "0.50455403", "text": "installBindings() {\n window.addEventListener('resize', this.resizeView.bind(this), false);\n window.addEventListener('orientationchange', this.resizeView.bind(this), false);\n }", "title": "" }, { "docid": "f557582dd2d1d592e3c2661ea85de053", "score": "0.5042784", "text": "function heightResizeHandler() {\n\teventViewResizeText();\n\tvar colHeight = columnResize();\n\teventViewResizeHeight(colHeight);\n}", "title": "" }, { "docid": "3e975dae85755f10bae2865be0b50af1", "score": "0.5038632", "text": "androidKeyboard() {\n\n var ua = navigator.userAgent.toLowerCase();\n var isAndroid = ua.indexOf('android') > -1; //&& ua.indexOf('mobile');\n if (!isAndroid) {\n return;\n }\n\n var windowEl = angular.element(this.window);\n\n var lastHeight = windowEl.height(); // store the intial height.\n var lastWidth = windowEl.width(); // store the intial width.\n var keyboardIsOn = false;\n\n windowEl.resize(function() {\n var inputInFocus = $('input');\n if (inputInFocus.is(':focus')) {\n keyboardIsOn =\n ((lastWidth == windowEl.width()) && (lastHeight > windowEl.height()));\n }\n if (keyboardIsOn && inputInFocus.is(':focus')) {\n inputInFocus[0].scrollIntoViewIfNeeded();\n } else {\n $('div.section-container')[0].scrollIntoViewIfNeeded();\n }\n });\n\n }", "title": "" }, { "docid": "24879cc7158eb759a7fcdf9e81846024", "score": "0.5028247", "text": "function androidProfileCheck() {\n\t\t\t\t\treturn deviceProfile ? window.innerHeight === deviceProfile[orientation] : false;\n\t\t\t\t}", "title": "" }, { "docid": "e9b6dda4942aee81cf8d71629a2c7a79", "score": "0.5025758", "text": "function getWindowSize() {\nvar xsmall = '20em', // 320px\nsmall = '40em', // 640px\nmedium = '48em', // 768px\nlarge = '63.8em', // 1024px\nxlarge = '85.4em'; // 1366px\n// these will always trigger in the order in which they're defined\n// so mqlmedium will still trigger after mqllarge when maximizing to > large from size < medium\nvar mqlxlarge = window.matchMedia('screen and (min-width:' + xlarge + ')');\nvar mqllarge = window.matchMedia('screen and (min-width:' + large + ')');\nvar mqlmedium = window.matchMedia('screen and (min-width:' + medium + ')');\nmqlxlarge.addListener(function(mql) {\nif (mql.matches) {\nwindowSize = 'extended';\n$(window).trigger('windowsize.extended.enter');\n} else {\nwindowSize = 'desktop';\n$(window).trigger('windowsize.extended.exit').trigger('windowsize.desktop.enter');\n}\n//console.info('extended listener');\n});\nmqllarge.addListener(function(mql) {\nif(windowSize !== 'extended') {\nif (mql.matches) {\nwindowSize = 'desktop';\n$(window).trigger('windowsize.desktop.enter');\n} else {\nwindowSize = 'tablet';\n$(window).trigger('windowsize.tablet.enter');\n}\n//console.info('desktop listener');\n}\n});\nmqlmedium.addListener(function(mql) {\nif(windowSize !== 'extended' && windowSize !== 'desktop') {\nif (mql.matches) {\n// don't run if this gets called because we've skipped from desktop down to global\nwindowSize = 'tablet';\n$(window).trigger('windowsize.global.exit').trigger('windowsize.tablet.enter');\n} else {\nwindowSize = 'global';\n$(window).trigger('windowsize.global.enter');\n}\n//console.info('tablet listener');\n}\n});\n/*var mqlorientation = window.matchMedia('screen and (orientation:portrait)');\nmqlorientation.addListener(function(mql) {\nif (mql.matches) {\nwindowOrientation = 'portrait';\n$(window).trigger('windowsize.orientation.portrait');\n} else {\nwindowOrientation = 'landscape';\n$(window).trigger('windowsize.orientation.landscape');\n}\n});\nwindowOrientation = 'landscape';\nif (mqlorientation.matches) {\nwindowOrientation = 'portrait';\n}*/\nvar c = 'global';\nif (mqlxlarge.matches) {\nc = 'extended';\n} else if (mqllarge.matches) {\nc = 'desktop';\n} else if (mqlmedium.matches) {\nc = 'tablet';\n}\n// // global | tablet | desktop\n// // var c = window.getComputedStyle(document.body,':after').getPropertyValue('content');\n// // replace any extra quotes (FF)\nreturn c; //.replace(/\"/g,'');\n}", "title": "" }, { "docid": "bb9929461af74479a1c3942703745cfb", "score": "0.5015601", "text": "function onResize(event)\n {\n\n //This will give us the new height of the window\n var newPageHeight = $window.innerHeight();\n\n /*\n * If the new height is different from the old height ( the browser is resized vertically ), the slides are resized\n * */\n if(pageHeight !== newPageHeight)\n {\n pageHeight = newPageHeight;\n\n //This can be done via CSS only, but fails into some old browsers, so I prefer to set height via JS\n TweenLite.set([$slidesContainer, $allSlides], {height: pageHeight + \"px\"});\n\n //The current slide should be always on the top\n TweenLite.set($slidesContainer, {scrollTo: {y: pageHeight * $currentSlide.index() }});\n }\n\n }", "title": "" }, { "docid": "58ce5510a00794520376cd77a5006c7e", "score": "0.50029016", "text": "function onFullscreenChange() {\n if(!document.webkitFullscreenElement && !document.mozFullScreenElement) {\n vrMode = false;\n }\n resize();\n}", "title": "" }, { "docid": "a1dd1cfa1c88ff3c067800ceba29affc", "score": "0.5000788", "text": "contentHeightChanged() {}", "title": "" }, { "docid": "7c99e0d7a2f8762725ab61291836f670", "score": "0.49953583", "text": "function windowResized()\n{\n\tresizeCanvas(windowWidth, windowHeight, false);\n\twindow.somethingChanged = true;\n}", "title": "" }, { "docid": "5869b01948b3703ee896996047b5ab85", "score": "0.4993143", "text": "function doOnOrientationChange()\n{\n myUtils.loadFloatDivs();\n}", "title": "" }, { "docid": "8179633faeeb80870f6e85908f8fb4c8", "score": "0.49913993", "text": "onResize(){}", "title": "" }, { "docid": "cd4f357bcb7e813e001d1d778c8bd46f", "score": "0.49872318", "text": "resizeListener() {\n if (window.innerWidth <= this.mobileThreshold && !this.state.isMobile) {\n // Handles resizing to a smaller width window\n this.setState({isMobile: true});\n } else if (window.innerWidth > this.mobileThreshold && this.state.isMobile) {\n // Handles resizing to a larger width window\n this.setState({isMobile: false});\n }\n }", "title": "" }, { "docid": "ebf44cc579954f4a7157a4146e1b3b2d", "score": "0.49782443", "text": "_listenToMediaQueryChanges() {\n $(window).on('changed.zf.mediaquery', () => {\n this._respondToMediaQuerySize();\n });\n }", "title": "" }, { "docid": "db497428709fe3bd35d06b24eb1e623e", "score": "0.49770373", "text": "_dispatchHeightChange(height) {\n this.dispatchEvent(new CustomEvent('height-changed', {\n detail: {\n height\n }\n }));\n }", "title": "" }, { "docid": "55c0d994f817732950997255088dbed7", "score": "0.49637762", "text": "function handleOrientation(event) {\n // Assigning beta and gamma to global variables\n orientationBeta = Math.floor(event.quaternion[0]*100);\n orientationGamma = Math.floor(event.quaternion[1]*100);\n orientationZ = event.quaternion[2];\n updateTiltIndicator();\n if(!hasOriented){\n checkUserOrientation();\n }\n}", "title": "" }, { "docid": "343b34797dcfdc75edabdc69ede68bce", "score": "0.49574402", "text": "function readDeviceOrientation(wrapper) {\n\t// return;\n\tif (!isMobile()) {\n\t\treturn;\n\t\t// console.log('Blocking readDeviceOrientation() mobile only catch for testing');\n\t}\n\n\tvar rect = wrapper.getBoundingClientRect();\n\tif (window.innerWidth > window.innerHeight - rect.top - 2) {\n\t\t// if (gamePhase === PORTRAIT) {\n\t\t// \tgamePhase = orientationChangePhaseCache;\n\t\t// }\n\t} else {}\n\t\t// orientationChangePhaseCache = gamePhase === PORTRAIT ? orientationChangePhaseCache : gamePhase;\n\t\t// gamePhase = PORTRAIT;\n\t\t// eventManager.dispatch(EventManager.CHANGE_STATE, {'data': ORIENTATION_WARNING});\n\n\t\t// classUtils.setClass('container', gamePhase);\n}", "title": "" }, { "docid": "014b9da12f3caa149c411f8c2c4e0130", "score": "0.49498457", "text": "function handleWindowResize() {\n $(window).on('resize', function() {\n resizeDashboardHeight()\n });\n}", "title": "" }, { "docid": "4d1d9f94c0681d018ae9116169ca4d1f", "score": "0.49448147", "text": "function supported() {\n return !!(window.DeviceOrientationEvent);\n }", "title": "" }, { "docid": "52647fa6440a4b2c00cebe3b160e4e09", "score": "0.49212235", "text": "function checkOrientation() {\n\t$heightCon = ($(\"div#container\").height == screen.height) || ($(\"div#container\") == screen.width / 1.5);\n\t$widthCon = $(\"div#container\").width() == screen.width;\n\n\tif ($heightCon && $widthCon) {\n\t\tclearInterval(interval);\n\t} else {\n\t\tinitialize();\n\t}\n}", "title": "" }, { "docid": "9e35b63e27c6d741f7cdfcda70316715", "score": "0.49103975", "text": "async function onMenuChange(event) {\n // Get the current control method\n let controlType = viewer.getControlId();\n\n if (event.method !== 'enableControl' || !window.DeviceOrientationEvent || controlType !== 'device-orientation') {\n return;\n }\n \n // Request permission for using the orientation sensor in iOS.\n \n try {\n await window.DeviceOrientationEvent.requestPermission();\n } catch (error) {\n // TODO: Add error handling\n }\n}", "title": "" }, { "docid": "7bae81a4c0a1a6394d4cf9c273dcfc07", "score": "0.490925", "text": "function onResize() {\n var windowWidth = $window.width(),\n newMobileMode;\n\n if (windowWidth !== lastWindowWidth) {\n lastWindowWidth = windowWidth;\n\n roundGridPixels();\n\n newMobileMode = ($bodyTable.css('display') === 'block');\n\n if (newMobileMode !== inMobileMode) {\n if (newMobileMode) {\n enableMobileMode();\n } else {\n disableMobileMode();\n }\n\n inMobileMode = newMobileMode;\n }\n\n $editButton = $(editButtonSel);\n syncColumnSizes();\n\n if (menuOpen) {\n updateMenuPosition();\n }\n }\n }", "title": "" }, { "docid": "2fc1ab93883be3949ee25ee8afbda66d", "score": "0.49052593", "text": "handleDeviceOrientation(beta, gamma) {\n this.setState({\n beta,\n gamma,\n });\n }", "title": "" }, { "docid": "888fb35c1f5a833e26c8afeb77e9ea2a", "score": "0.48987123", "text": "function onResize() {\n screenSize = {\n 'width': window.innerWidth - WINDOW_PADDING,\n 'height': window.innerHeight - WINDOW_PADDING\n };\n \n // divide by totalHeight cause we want EVERYTHING to remain on screen (including inventory, duh)\n var ratioWidth = screenSize.width/gameSize.width,\n ratioHeight = screenSize.height/gameSize.totalHeight;\n \n screenSize.ratio = Math.min(ratioWidth, ratioHeight);\n screenSize.offsetY = screenSize.offsetX = 0;\n \n if (ratioWidth > ratioHeight) {\n screenSize.offsetX = (screenSize.width - gameSize.width*screenSize.ratio)/2;\n } else {\n screenSize.offsetY = (screenSize.height - gameSize.totalHeight*screenSize.ratio)/2;\n }\n \n setGameSize();\n \n var volumeControls = self.EventHandler.GameMenu.activeVolumeControls;\n for (var type in volumeControls) {\n volumeControls[type].updateOffsetAndRatio();\n }\n \n Game.EventHandler.trigger(NAME, 'resize', self, screenSize);\n }", "title": "" }, { "docid": "a6c8cfdcb9f14f1e6f65d5c0e2b6d23b", "score": "0.48893526", "text": "function AdaptiveAfterChange() {\n /// <summary>改变viewport后需要自适应</summary>\n\n //_setTimeoutCount++;\n\n //if (_setTimeoutCount > 10) {\n // Cmn.Func.MobileAdaptive(mainContentWidth, mainContentHeight, adviseVerticalImgUrl, adaptiveMode);\n // if (onOrientationchange != undefined) { onOrientationchange(); }\n // return;\n //}\n\n // setTimeout(function () {\n //if (_widthBeforChange != $(window).width()) {\n //Cmn.Func.MobileAdaptive(mainContentWidth, mainContentHeight, adviseVerticalImgUrl, adaptiveMode);\n //if (onOrientationchange != undefined) { onOrientationchange(); }\n //}\n //else { AdaptiveAfterChange(); }\n\n\n\n //判断是否转屏完成\n if ((Cmn.Func.IsHorizontalScreen() && $(window).width() >= $(window).height()) ||\n (Cmn.Func.IsHorizontalScreen() == false && $(window).width() <= $(window).height())) {\n //if (onOrientationchange != undefined) { onOrientationchange(); }\n\n //在宽高自适应的时候,宽高需要调换位置\n if (adaptiveMode == Cmn.Func.MobileAdaptiveMode.WidthHeight) {\n if (Cmn.Func.IsHorizontalScreen()) {\n Cmn.Func.MobileAdaptive(mainContentHeight, mainContentWidth, adviseVerticalImgUrl,\n adaptiveMode, onOrientationchange, mainViewIsHorizontal);\n }\n else {\n Cmn.Func.MobileAdaptive(mainContentWidth, mainContentHeight, adviseVerticalImgUrl,\n adaptiveMode, onOrientationchange, mainViewIsHorizontal);\n }\n }\n else {\n Cmn.Func.MobileAdaptive(mainContentWidth, mainContentHeight, adviseVerticalImgUrl,\n adaptiveMode, onOrientationchange, mainViewIsHorizontal);\n }\n\n //从上面搬到下面来了,也就是要等viewport设置后再执行,at 20150412\n if (onOrientationchange != undefined) { onOrientationchange(); }\n }\n else { setTimeout(AdaptiveAfterChange, 10); }\n\n\n\n\n //if (_widthBeforChange != $(window).width() || _setTimeoutCount > 10 ||\n // (Cmn.Func.IsHorizontalScreen() && _defaultHorizontalWidth != null \n // && _defaultHorizontalWidth == $(window).width()) || (\n // Cmn.Func.IsHorizontalScreen() == false && _defaultVerticalWidth != null &&\n // _defaultVerticalWidth == $(window).width())) {\n\n // Cmn.DebugLog(\"跳转前:window.width:\" + $(window).width() + \" viewPort:\" + $(\"[name='viewport']\").attr(\"content\"));\n\n // if (Cmn.Func.IsHorizontalScreen()) {\n // Cmn.Func.MobileAdaptive(mainContentHeight, mainContentWidth, adviseVerticalImgUrl, adaptiveMode);\n // }\n // else {\n // Cmn.Func.MobileAdaptive(mainContentWidth, mainContentHeight, adviseVerticalImgUrl, adaptiveMode);\n // }\n\n // if (onOrientationchange != undefined) { onOrientationchange(); }\n //}\n //else { AdaptiveAfterChange(); }\n // }, 50);\n }", "title": "" }, { "docid": "d81fdee188bfe11347def82ae6ac12a4", "score": "0.48785195", "text": "function handleOrientation(event){\n\t\talpha = Math.floor(event.alpha);\n\t\tbeta = Math.floor(event.beta);\n\t\tgamma = Math.floor(event.gamma);\n\n\t\t//send values to the DOM so that we can see them\n\t\tdocument.getElementById('alpha').innerHTML = alpha;\n\t\tdocument.getElementById('beta').innerHTML = beta;\n\t\tdocument.getElementById('gamma').innerHTML = gamma;\n\n\t\t// socket.emit('orientation', {\n\t\t// \t'alpha': alpha,\n\t\t// \t'beta': beta,\n\t\t// \t'gamma': gamma\n\t\t// });\n\t}", "title": "" }, { "docid": "1936ec07516aa452a0de5e3bbaef6fd2", "score": "0.48727056", "text": "didResize() {\n this.computedPropertyDidChange('pxLayout');\n const children = this.get('childViews');\n\n for (let i = children.length - 1; i >= 0; i -= 1) {\n children[i].parentViewDidResize();\n }\n }", "title": "" }, { "docid": "5f18a47cff37b8f85565f3f652ee8f94", "score": "0.4864748", "text": "handleWindowResize() {\n super.handleWindowResize();\n\n // Pass App Bar height to owner.\n if (this.props.handleAppBarResize)\n this.props.handleAppBarResize(this.toolbarDivRef.current.offsetHeight);\n\n // Close the mobile drawer (small screens) when screen is resized larger, so that it does not\n // reappear when the screen is resized smaller.\n if (isBreakpointDesktop() && this.props.isMobileDrawerOpen)\n this.props.handleMobileDrawerMenuClick();\n }", "title": "" }, { "docid": "554e326e4bf415c37fcfc7c7c8826f4e", "score": "0.48591053", "text": "function CheckHeightChange() {\n\n // Smooth resize height Ruby when move to near slide\n // + Add options 'isUpdateResize' to allways run 'SmoothHeight()'\n // + Avoid case: resize event, (va.hRuby == hSlideCur) -> not execute 'SmoothHeight()'\n if( !is.heightFixed && ((va.hRuby != hSlideCur && hSlideCur > 0) || isUpdateResize) ) {\n SmoothHeight(hSlideCur);\n\n\n /**\n * UPDATE VALUE OF PAGINATION VERTICAL WHEN CHANGES HEIGHT\n * + Smooth height for pagination vertical\n */\n if( is.pag && !is.pagList && va.pag.dirs == 'ver' && !is.pagOutside && o.pag.sizeAuto == 'full' ) {\n PAG.PropAndStyle();\n }\n }\n }", "title": "" }, { "docid": "554e326e4bf415c37fcfc7c7c8826f4e", "score": "0.48591053", "text": "function CheckHeightChange() {\n\n // Smooth resize height Ruby when move to near slide\n // + Add options 'isUpdateResize' to allways run 'SmoothHeight()'\n // + Avoid case: resize event, (va.hRuby == hSlideCur) -> not execute 'SmoothHeight()'\n if( !is.heightFixed && ((va.hRuby != hSlideCur && hSlideCur > 0) || isUpdateResize) ) {\n SmoothHeight(hSlideCur);\n\n\n /**\n * UPDATE VALUE OF PAGINATION VERTICAL WHEN CHANGES HEIGHT\n * + Smooth height for pagination vertical\n */\n if( is.pag && !is.pagList && va.pag.dirs == 'ver' && !is.pagOutside && o.pag.sizeAuto == 'full' ) {\n PAG.PropAndStyle();\n }\n }\n }", "title": "" }, { "docid": "7f72a112ee937f8bf1f74cd1a2e239d6", "score": "0.48554036", "text": "function onResize(callback) {\n window.addEventListener(\"resize\",callback);\n}", "title": "" }, { "docid": "999baf72b3510c2ce6035643045a9b93", "score": "0.48546308", "text": "function updateOrientation( _value ){\r\n\r\n props.currOrientation = _value;\r\n onResize();\r\n }", "title": "" }, { "docid": "6031970de787d7410b574a4c34b7a749", "score": "0.48536474", "text": "function handleOrientationChange(mediaquery) {\n\t\tvar team = $('.team-photo-img');\n\t\tvar teamUser = [\n\t\t\t'julian',\n\t\t\t'alejandro',\n\t\t\t'raymundo',\n\t\t\t'fernando',\n\t\t\t'antonio',\n\t\t\t'jose',\n\t\t\t'martin',\n\t\t\t'rebeca',\n\t\t\t'vicente',\n\t\t\t'ta-antonio',\n\t\t\t'ta-felicia',\n\t\t\t'ta-julio',\n\t\t\t'ta-raymond',\n\t\t\t'ta-isaac',\n\t\t\t'ta-erickPonce'\n\t\t];\n\t if (mediaquery.matches) {\n\t\t\tteam.each(function (index, value) {\n\t\t\t\tvalue.setAttribute('data-remodal-target', teamUser[index])\n\t\t\t})\n\t } else {\n\t\t\tteam.each(function (index, value) {\n\t\t\t\tvalue.removeAttribute('data-remodal-target')\n\t\t\t})\n\t\t}\n\t }", "title": "" }, { "docid": "7ffd7a392a81e92f41484dd8628ae752", "score": "0.4852286", "text": "listenForWindowResize() {\n $(window).resize(() => {\n this.setState({ onMobile: window.innerWidth < this.MOBILE_THRESH });\n });\n }", "title": "" }, { "docid": "a08c757f53baa8fc30d3e4a1ad2aa9bc", "score": "0.48355973", "text": "function _onWindowResize() {\n var newMenuCollapsed = baSidebarService.shouldMenuBeCollapsed();\n var newMenuHeight = _calculateMenuHeight();\n if (newMenuCollapsed != baSidebarService.isMenuCollapsed() || scope.menuHeight != newMenuHeight) {\n scope.$apply(function () {\n scope.menuHeight = newMenuHeight;\n baSidebarService.setMenuCollapsed(newMenuCollapsed)\n });\n }\n }", "title": "" }, { "docid": "d6169b3355246f84a0912c11b9e13a45", "score": "0.48327413", "text": "function edgtfOnWindowResize() {\n\t\tedgtfInitMobileNavigationScroll();\n\t}", "title": "" }, { "docid": "d6169b3355246f84a0912c11b9e13a45", "score": "0.48327413", "text": "function edgtfOnWindowResize() {\n\t\tedgtfInitMobileNavigationScroll();\n\t}", "title": "" }, { "docid": "121f237e9a1ce91d3d7d651ddd33b185", "score": "0.48285413", "text": "function resizeWindowHandler(event) {\n if (window.innerWidth < mobileViewWidth) {\n isMobileViewFlag = true;\n } else {\n isMobileViewFlag = false;\n }\n }", "title": "" } ]
ce5863a514119bb9b715f77a097440e2
This function disables buttons when needed
[ { "docid": "1ddff99ca0c85eb395ab396f8997f024", "score": "0.0", "text": "function disableButtons(counter_max, counter_current) {\n $('#show-previous-image, #show-next-image')\n .show();\n if (counter_max === counter_current) {\n $('#show-next-image')\n .hide();\n } else if (counter_current === 1) {\n $('#show-previous-image')\n .hide();\n }\n }", "title": "" } ]
[ { "docid": "00f7cea30596efc8967e206eec92d0f3", "score": "0.8511611", "text": "function disableAllButtons() {\n disableOrEnableButtons(false);\n }", "title": "" }, { "docid": "08e27868437853b7ebfff98a8476c069", "score": "0.81780607", "text": "function disableButtons() {\n \tbutton1.disabled = true;\n \tbutton2.disabled = true;\n \tbutton3.disabled = true;\n \tbutton4.disabled = true;\n \tbutton5.disabled = true;\n \tbutton6.disabled = true;\n \tbutton7.disabled = true;\n \tbutton8.disabled = true;\n \tbutton9.disabled = true;\n }", "title": "" }, { "docid": "977739b4ef8d30d9f6e60712fed0f93e", "score": "0.8056249", "text": "function buttonsOff (){\n buttonOne.disabled = true;\n buttonTwo.disabled = true;\n buttonThree.disabled = true;\n buttonFour.disabled = true;\n}", "title": "" }, { "docid": "a7a0a0494d855826f2c26c9f52c5202f", "score": "0.80056524", "text": "function setButtons() {\n hitButton.disabled = false;\n standButton.disabled = false;\n continueButton.disabled = true;\n }", "title": "" }, { "docid": "4e64d603b3a31e526f59d88dc317908e", "score": "0.7982473", "text": "function enable_buttons () {\n button_group.removeAttr(\"disabled\");\n }", "title": "" }, { "docid": "d5827e0c9fceeadd4de5c3eaba77b2c3", "score": "0.7952471", "text": "function enable_buttons () {\n button_group.removeAttr(\"disabled\");\n }", "title": "" }, { "docid": "59e10cfa48a5834ec65c0e9e3071cd20", "score": "0.7895458", "text": "function buttonsOn (){\n buttonOne.disabled = false;\n buttonTwo.disabled = false;\n buttonThree.disabled = false;\n buttonFour.disabled = false;\n}", "title": "" }, { "docid": "4d6e3172f497e9bc86543a7a0cb2714a", "score": "0.7888962", "text": "function enableButtons() {\n \tbutton1.disabled = false;\n \tbutton2.disabled = false;\n \tbutton3.disabled = false;\n \tbutton4.disabled = false;\n \tbutton5.disabled = false;\n \tbutton6.disabled = false;\n \tbutton7.disabled = false;\n \tbutton8.disabled = false;\n \tbutton9.disabled = false;\n }", "title": "" }, { "docid": "7ad8b8ca28c17c4fc705cf922a8e404b", "score": "0.7856812", "text": "function disableAllButtons() {\n\t gameStartCheck = 1;\n\t}", "title": "" }, { "docid": "94f746044137ed4ef8ad476f799079f0", "score": "0.78426224", "text": "function disableButtons(){\n button.forEach(elem => {\n elem.disabled = true;\n })\n}", "title": "" }, { "docid": "e7cfcf983948b0ec2c83f911da7cd889", "score": "0.783234", "text": "function disable_button() {\n allow_add = false;\n}", "title": "" }, { "docid": "eecdf5dfb61f3e5873c282590c21a40b", "score": "0.78161216", "text": "function buttondeact()\n{\n\tfor(i=0;i<document.all.btn.length;i++)\n\t{document.all.btn[i].disabled = true;}\n}", "title": "" }, { "docid": "f0bef73d66753996d03ea78c7af9e810", "score": "0.78125584", "text": "function disableMenuButton(){\r\n \r\n}", "title": "" }, { "docid": "cc3609e7a7c5767da5647f757b545027", "score": "0.7810075", "text": "function disableMainPageButtons() {\n\t\t\tevents.forEach( ev => { \n\t\t\t\tev.button.mouseEnabled = false;\n\t\t\t\tev.button.cursor = \"default\";\n\t\t\t});\n\t\t\n\t\t\tcultures.forEach( cu => { \n\t\t\t\tcu.button.mouseEnabled = false;\n\t\t\t\tcu.button.cursor = \"default\";\n\t\t\t});\n\t\t\n\t\t\tself.aboutUsBtn.mouseEnabled = false;\n\t\t\tself.aboutUsBtn.cursor = \"default\";\n\t\t\n\t\t\tself.returnBtn.mouseEnabled = false;\n\t\t\tself.returnBtn.cursor = \"default\";\n\t\t}", "title": "" }, { "docid": "9cbe883bb467ae045becdee8c4388882", "score": "0.77913743", "text": "function disable(){\n $('button#Hit').attr('disabled','disabled');\n $('button#Stand').attr('disabled','disabled');\n }", "title": "" }, { "docid": "4db6da78005dc452e07fccc13282b478", "score": "0.7781253", "text": "function activateButtons() {\n document.getElementById('rndBtn').disabled = false;\n document.getElementById('revBtn').disabled = false;\n document.getElementById('histBtn').disabled = false;\n}", "title": "" }, { "docid": "7cc00d9dd93dec23891c5d4ea9c52b2e", "score": "0.7770332", "text": "function disable() {\n Main.panel._rightBox.remove_child(button);\n}", "title": "" }, { "docid": "5c4ae49d87b77e12d46163f4fe9c480d", "score": "0.7769248", "text": "function disablingButtons() {\n for (let i = 0; i < buttons.length; i++) {\n for (let j = 0; j < buttons[i].length; j++) {\n buttons[i][j].disabled = true;\n }\n }\n}", "title": "" }, { "docid": "64f76571d44db03bf5ae0fd6e2bb934b", "score": "0.77467483", "text": "function disable() {\n\n Main.panel._rightBox.remove_child(button);\n}", "title": "" }, { "docid": "563415293ea7902da41fad4aaf7caf46", "score": "0.7744439", "text": "function disable()\n{\n // To disable the button \"Generate New Array\"\n document.getElementById(\"Button1\").disabled = true;\n document.getElementById(\"Button1\").style.backgroundColor = \"#d8b6ff\";\n \n // To disable the button \"Bucket Sort\"\n document.getElementById(\"Button2\").disabled = true;\n document.getElementById(\"Button2\").style.backgroundColor = \"#d8b6ff\"; \n}", "title": "" }, { "docid": "2854e18b279dfe5443ad81aa220b2300", "score": "0.7738224", "text": "function disableButtons() {\n d3.selectAll('.btn-group')\n .selectAll('.btn')\n .on('click', function () {});\n}", "title": "" }, { "docid": "7e139dded643321eec4f693452816af2", "score": "0.7719883", "text": "function disableButton() {\n letterButtons.forEach(button => {\n button.disabled = true;\n });\n}", "title": "" }, { "docid": "e61c49478a2c3f35d567079fbf37c8ae", "score": "0.7707078", "text": "function disableButtons() {\n let buttons = document.getElementsByTagName(\"button\");\n for (let i = 0; i < buttons.length; i++) {\n if (buttons[i].id !== \"power-button\") buttons[i].disabled = true;\n }\n}", "title": "" }, { "docid": "82d0ab95e76db17569784ae0b9cb36a2", "score": "0.7676903", "text": "function disableBtns() {\n for (i = 0; i < choices.length; i++) {\n choices[i].disabled = true;\n }\n}", "title": "" }, { "docid": "99796b28343c2ebdd5e159441c977a0e", "score": "0.76711965", "text": "function disableButtons() {\n\n\t\t// sets variable with message for disabled / not selected buttons\n\t\tvar message = \"Game over.\";\n\n\t\t// update all buttons that have not been clicked yet\n\t\tfor(var index in clicked) {\n\n\t\t\tif (clicked[index] == \"ready\") {\n\t\t\t\t$('#select-' + index).replaceWith('<button type=\"button\" class=\"btn btn-primary\" id=\"select-' + index + '\" disabled=\"disabled\">' + message + '</button>');\n\t\t\t}\n\t\t}\n\n\t\tupdateScore();\n\n\t} // end disable buttons function", "title": "" }, { "docid": "90c3a4f690baea9af74a0537ebe56a3b", "score": "0.7668773", "text": "function resetButtons() {\n hitButton.disabled = true;\n standButton.disabled = true;\n continueButton.disabled = false;\n }", "title": "" }, { "docid": "1d409d700cb379c22d68bd3937c403dc", "score": "0.7664", "text": "function disableButtons() {\n\n\t$(\"#guess\").off(\"click\");\n\t$(\"#letterHolder\").attr(\"disabled\", true);\n\t$(\"#hintButton\").off(\"click\");\n}", "title": "" }, { "docid": "297925042e6a560060ae38a920099f2f", "score": "0.7662875", "text": "disableButtons(buttons) {\n buttons.forEach(b => b.onclick = this.disableButton); \n buttons.forEach(b => b.classList.add(\"disabled\"));\n }", "title": "" }, { "docid": "3033a4084f87d53797948afebbf804b9", "score": "0.76592326", "text": "function disable()\n{\n // To disable the button \"Generate New Array\"\n document.getElementById(\"Button1\").disabled = true;\n document.getElementById(\"Button1\").style.backgroundColor = \"#d8b6ff\";\n \n // To disable the button \"Bubble Sort\"\n document.getElementById(\"Button2\").disabled = true;\n document.getElementById(\"Button2\").style.backgroundColor = \"#d8b6ff\"; \n}", "title": "" }, { "docid": "09e24e13f359095bfd8a27c0336cc156", "score": "0.7633279", "text": "function disableOptsButtons() {\n for(let i = 0; i < optsButtons.length; i++) {\n optsButtons[i].disabled = true\n }\n}", "title": "" }, { "docid": "b0d9a3a789fa98bf8d8c8cfd2d6299d6", "score": "0.7628079", "text": "function unDisableButton(){\n var btn = document.getElementById('buttonAdminSave');\n try {\n btn.classList.remove('disabled');\n document.getElementById('buttonAdminCancelCopy').innerText = 'cancel';\n } catch(e){\n //empty\n }\n adminButtonEnabled = true;\n }", "title": "" }, { "docid": "1925bb99cc85cceac93ce4fa2b50d1b1", "score": "0.76157635", "text": "function disableButtons(disable){\n\tdocument.getElementById(\"Confirm\").disabled = disable;\n\tdocument.getElementById(\"Delete\").disabled = disable;\n\tdocument.getElementById(\"nextQuarry\").disabled = disable;\n\tdocument.getElementById(\"prevQuarry\").disabled = disable;\n}", "title": "" }, { "docid": "e56f4bd484fba107907572484a6579ac", "score": "0.76082104", "text": "function disableBtn(){ //disables buttons to prevent adding more to the score after win.\n document.getElementById('roll-btn').disabled = true;\n document.getElementById('hold-btn').disabled = true;\n \n}", "title": "" }, { "docid": "61b3a6dafbc4e2503ced1e817473843d", "score": "0.7604899", "text": "function inicioApp() {\n btn.disabled = true;\n}", "title": "" }, { "docid": "2db239a9d583b061f60a91384552f412", "score": "0.7601357", "text": "function disableButton(){\n var btn = document.getElementById('buttonAdminSave');\n btn.classList.add('disabled');\n document.getElementById('buttonAdminCancelCopy').innerText = 'exit';\n adminButtonEnabled = false;\n }", "title": "" }, { "docid": "de4981885da0d2b475300749b6b9ade9", "score": "0.758356", "text": "function disableOptions() {\n rockBtn.disabled = true\n paperBtn.disabled = true\n scissorBtn.disabled = true\n}", "title": "" }, { "docid": "784d2bf1fb56adda72cb6ec10242c71a", "score": "0.75806576", "text": "function disableBtns() {\n\n // Disable save button\n $('#btn-save').attr('disabled', true);\n $('#btn-save').prop('disabled', true);\n\n // Disable clear button\n $('#btn-clear').attr('disabled', true);\n $('#btn-clear').prop('disabled', true);\n\n // Disable delete button\n $('#btn-cancel').attr('disabled', true);\n $('#btn-cancel').prop('disabled', true);\n}", "title": "" }, { "docid": "f108fad186f312430ca03398acb93272", "score": "0.75734246", "text": "function enableBtn(){\n document.getElementById('roll-btn').disabled = false;\n document.getElementById('hold-btn').disabled = false;\n}", "title": "" }, { "docid": "b3120c32ad8b0250d57f35a845ed10ef", "score": "0.7556792", "text": "function enableButtons(butts) {\n\tbutts.forEach(function(butt) {\n\t\t$(butt).removeAttr(\"disabled\"); \n\t});\n}", "title": "" }, { "docid": "58f757b7f612d991cecb4130069315fe", "score": "0.75548077", "text": "function disableBtns() {\n document.getElementById(\"btnStop\").setAttribute(\"disabled\", true);\n document.getElementById(\"btnDownload\").setAttribute(\"disabled\", true);\n document.getElementById(\"btnSubmit\").setAttribute(\"disabled\", true);\n document.getElementById(\"btnRecTime\").setAttribute(\"disabled\", true);\n}", "title": "" }, { "docid": "ef796b21eb971cd0b730f058b81a23d4", "score": "0.75450724", "text": "function disableRMButtons(){\n\t$('.datepickerdev').attr('disabled',true);\n\t$('.timepicker').attr('disabled',true);\n\t$('.DeviceType').attr('disabled',true);\n\t$('.interval').attr('disabled',true);\n\t$('.iteration').attr('disabled',true);\n\t$('#ReserveApplyButton').hide();\n\t$('#ReserveCancelButton').hide();\n\t$('#ReserveEditButton').show();\n\t$('#ReserveReleaseButton').show();\n\t$('#ReserveGenerateReportButton').show();\n\t$('.resres').removeAttr('checked');\n\t$('.resres').parent().parent().removeClass('highlight');\n\t$(\"#PortGenerateReport\").attr('disabled',true);\n\t$('#PortGenerateReport').addClass('ui-state-disabled');\n\t}", "title": "" }, { "docid": "f7d8a95ea10d15390266efb83e7b50b5", "score": "0.7529531", "text": "function blockTheMainButtons() {\n buttons.forEach((button) => {\n button.classList.add('disable');\n });\n}", "title": "" }, { "docid": "0430ba57089a59d5cc25eaa156d82a82", "score": "0.7524478", "text": "function disableAllButton()\n{\n\t//select \n\n\tdocument.getElementById('hintsButton').disabled=true;\n\tdocument.getElementById('newButton').disabled=true;\n\tdocument.getElementById('resetButton').disabled=true;\n\n\t\n\t//checkbox\n\tdocument.getElementById('checkButton').disabled=true;\n}", "title": "" }, { "docid": "256c941d9042f078c3d86f88633ecdca", "score": "0.75203675", "text": "function disableButton(b) {\n\tif (defined(b)) {\n\t\tb.disabled=false;\n\t\tb.className='disabled';\n\t\tb.id='disabled';\n\t}\n}", "title": "" }, { "docid": "d873b32f3f2211c20df094c9c0d9f7c3", "score": "0.7508925", "text": "function enableButton() {\n letterButtons.forEach(button => {\n button.disabled = false;\n })\n}", "title": "" }, { "docid": "e04e829b41cd1804115d3e55613ba73e", "score": "0.75058436", "text": "function disableSystem(){\r\n\t$(\"#vis\").addClass(\"disabledbutton\"); \r\n\t$(\".evaluateRecommendation\").addClass(\"disabledbutton\"); \r\n\t$(\"#zoomGraph\").addClass(\"disabledbutton\");\r\n\t$(\"#explanations_buttons\").addClass(\"disabledbutton\");\r\n\t//$(\"#undo\").addClass(\"disabledbutton\");\r\n\t$(\"#undo\").hide();\r\n}", "title": "" }, { "docid": "321143e86fcda913aeb6128aec426324", "score": "0.7497484", "text": "function disableBtns() {\n document.getElementById(\"btnDownload\").setAttribute(\"disabled\", true);\n document.getElementById(\"btnSubmit\").setAttribute(\"disabled\", true);\n}", "title": "" }, { "docid": "bf1c5bdeffad5d849db18a6c632d2729", "score": "0.74934554", "text": "function enableButtons() {\n document.getElementById(\"guardar\").disabled = false;\n document.getElementById(\"borrar\").disabled = false;\n //document.getElementById(\"cambiarTareas\").disabled = false;\n}", "title": "" }, { "docid": "d5f30f2fe6f9e4396e2012c2dea3a519", "score": "0.74858665", "text": "function disableBtn() {\n btngroup.removeChild(nobtn);\n}", "title": "" }, { "docid": "dc9ae0c450ae061b87aa3302e0dda578", "score": "0.748531", "text": "function disableButton(el) {\n el.disabled = true;\n el.classList.add(\"disableControl\");\n}", "title": "" }, { "docid": "0647083c98b6b674d78744d3c6b6d9f8", "score": "0.74811524", "text": "function disableBtn (element) {\n element.disabled = true;\n}", "title": "" }, { "docid": "c11b50a860e6bc7a730f17e7ad50fb79", "score": "0.74781835", "text": "function blocktombol(){\n $('.button').prop(\"disabled\", true);\n}", "title": "" }, { "docid": "bb076dd9d0b994791050cafb671a0f02", "score": "0.74757564", "text": "_handleDisablingSSTBtn() {\n let noAvailableState = true;\n SSTButtonStates.forEach(SSTBtnState => {\n if (this.state[SSTBtnState]) noAvailableState = false;\n });\n\n if (noAvailableState)\n this.panel.SSTBtn.disable();\n else\n this.panel.SSTBtn.enable();\n }", "title": "" }, { "docid": "15cd99f98b13ad13e792b9e2dd5b7f0e", "score": "0.74735016", "text": "function disableButton(button) {\n button.classList.add(\"ezy-btn--disabled\");\n button.disabled = true;\n }", "title": "" }, { "docid": "38cc3fca1a34b32eb1a3f9b77437aaaf", "score": "0.7471554", "text": "function setUIButtonGroupDisabled() {\n // setCompileButtonState(true, true);\n setLoadRAMButtonState(true, false);\n setLoadEEPROMButtonState(true, false);\n setTerminalButtonState(true, false);\n setGraphButtonState(true, false);\n}", "title": "" }, { "docid": "5902d17c31506297da47f777b43f9a85", "score": "0.74640864", "text": "function ResetButtons(){\r\n\t\tif (resourceCount < resourcesForExplosion){\r\n\t\t\t$btnExplode.off();\r\n\t\t\t$btnExplode.addClass('disabled');\r\n\t\t}\r\n\t\t\r\n\t\tif (resourceCount < resourcesForAging){\r\n\t\t\t$btnAge.off();\r\n\t\t\t$btnAge.addClass('disabled');\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "ab1bddc693d9bde3f30977a0de11cc6c", "score": "0.7461447", "text": "function disableVoteButtons() {\n\t$(\"#yes-btn\").prop('disabled', true);\n\t$(\"#no-btn\").prop('disabled', true);\n}", "title": "" }, { "docid": "ada2cfcecf1da7a51010560dceb8e4eb", "score": "0.7450302", "text": "_toggleDisableUI(){\n const buttonFight = document.querySelector(\"#generateFight\");\n const buttonRandomFight = document.querySelector(\"#randomFight\");\n //ako je toggle true onda je enabled sve, pa se mora disable-at i obrnuto\n if(this.toggle){\n buttonFight.disabled = true;\n buttonRandomFight.disabled = true;\n //.pointerEvents gasi/pali on click evente za elemente koje nisu tipke\n this.fighter_list_left.forEach(element => {\n element.style.pointerEvents = 'none';\n element.style.opacity = '0.75';\n });\n this.fighter_list_right.forEach(element => {\n element.style.pointerEvents = 'none';\n element.style.opacity = '0.75';\n });\n this.toggle = !(this.toggle);\n }\n else{\n buttonFight.disabled = false;\n buttonRandomFight.disabled = false;\n this.fighter_list_left.forEach(element => {\n element.style.pointerEvents = 'auto';\n element.style.opacity = '1';\n });\n this.fighter_list_right.forEach(element => {\n element.style.pointerEvents = 'auto';\n element.style.opacity = '1';\n });\n this.toggle = !(this.toggle);\n }\n }", "title": "" }, { "docid": "2afc13286c07dcf3fed216366f545f6f", "score": "0.74490947", "text": "function disableButtons() {\n buttons.forEach((button) => {\n button.disabled = true;\n });\n restartBtn.style.display = 'block';\n restartBtn.addEventListener('click', restartGame);\n\n}", "title": "" }, { "docid": "a61600c2d3672ebb9d73e06819515ba2", "score": "0.7441972", "text": "function disableOrderBtns(){\n $(end_btn).prop('disabled', true);\n $(save_btn).prop('disabled', true);\n $(cancel_btn).prop('disabled', true);\n}", "title": "" }, { "docid": "92de0d0fab3f2094fe18e4ecdbfe4603", "score": "0.74231786", "text": "function disable() {\n enabled = false;\n }", "title": "" }, { "docid": "ef442e15cda842adeb7f05941de4a4f6", "score": "0.74128276", "text": "function disableButton(e){\n\te.style.cursor = 'auto';\n\te.classList.remove('question');\n\te.classList.add('questionAnswered');\n e.onclick = '';\n e.innerHTML = '';\n}", "title": "" }, { "docid": "706937cecf2ba5ae56670871b4682b7f", "score": "0.741239", "text": "function button_disable() {\n document.getElementById(\"joinButton\").setAttribute(\"disabled\",\"disabled\");\n //document.getElementById(\"createButton\").setAttribute(\"disabled\",\"disabled\");\n}", "title": "" }, { "docid": "7b3a0e9e253b8a3a81b6455a63ad17d7", "score": "0.7399245", "text": "enableAll(){\n $('button').each(function(){\n if(this.innerHTML === \"Click\"){\n this.disabled = false;\n }\n });\n }", "title": "" }, { "docid": "18f5a5b38b81357fb2f28820e26d3574", "score": "0.73910433", "text": "function disableButtons() {\n select(\"#previousStep\").removeAttribute(\"disabled\");\n select(\"#nextStep\").removeAttribute(\"disabled\");\n // We first enable them so we can later enable them\n if (currentStep == 0) {\n select(\"#previousStep\").setAttribute(\"disabled\", \"disabled\");\n }\n\n if (currentStep == maxSteps) {\n select(\"#nextStep\").setAttribute(\"disabled\", \"disabled\");\n }\n}", "title": "" }, { "docid": "deda191d4d5d3b95a63c694d21cf135d", "score": "0.7387472", "text": "function disableControls() {\n $(\"button.play\").attr('disabled', true);\n $(\"select\").attr('disabled', true);\n $(\"button.stop\").attr('disabled', false);\n }", "title": "" }, { "docid": "be5382dcdbdc592cba89cf4818ba8139", "score": "0.7383748", "text": "function disable() {\n enabled = false;\n }", "title": "" }, { "docid": "7dd2d9ed3cf04d34abe5991c39653d03", "score": "0.73832214", "text": "function enableButtons() {\n for (let i = 0; i < buttons.length; i++) {\n for (let j = 0; j < buttons[i].length; j++) {\n buttons[i][j].disabled = false;\n }\n }\n}", "title": "" }, { "docid": "b3dbd1dc38717dae147f2b0f41773bc2", "score": "0.737426", "text": "function DisableCCButton(){\n\n\t EnCC.Disable = true;\n\t EnCCFull.Disable = true;\n\t DiCC.Disable = true;\n\t DiCCFull.Disable = true;\n}", "title": "" }, { "docid": "3e54284bfff15fef602f40bdf589b87a", "score": "0.73665464", "text": "function enableBtns() {\n\n // Disable save button\n $('#btn-save').attr('disabled', false);\n $('#btn-save').prop('disabled', false);\n\n // Disable clear button\n $('#btn-clear').attr('disabled', false);\n $('#btn-clear').prop('disabled', false);\n\n // Disable delete button\n $('#btn-cancel').attr('disabled', false);\n $('#btn-cancel').prop('disabled', false);\n}", "title": "" }, { "docid": "d57106ce4da0b43d862c3b595fce6f54", "score": "0.7338978", "text": "function disabledOrNo(state) {\n if (state)\n $(\".disableButton\").prop(\"disabled\", true).css(\"cursor\", \"not-allowed\");\n else $(\".disableButton\").removeAttr(\"style\").removeAttr(\"disabled\");\n }", "title": "" }, { "docid": "3dae8a4ffa5bf352aff25e8222726649", "score": "0.73130405", "text": "function enableAnotherCardAndHoldButton() {\n elButton.disabled = false\n elButtonHold.disabled = false \n}", "title": "" }, { "docid": "d186d46d4d64cc6a812d80f9fded3bb2", "score": "0.7297043", "text": "function disableAllButtons(){\n\t$(\"#azure-classifier-button\").addClass('disabled'); // Disabling button\n\t$(\"#azure-classifier-button\").prop('disabled', true); // Disabling button\n\n\t$(\"#custom-classifier-button\").addClass('disabled'); // Disabling button\n\t$(\"#custom-classifier-button\").prop('disabled', true); // Disabling button\n\n\t$(\"#delete-button\").addClass('disabled'); // Disabling button\n\t$(\"#delete-button\").prop('disabled', true); // Disabling button\n\n}", "title": "" }, { "docid": "adc65982ffca0547d69c3078cf01ebdb", "score": "0.72967416", "text": "function toggleButtons(){\n plus().disabled = true ? plus().disabled = false : plus().disabled = true\n minus().disabled = true ? minus().disabled = false : minus().disabled = true\n heart().disabled = true ? heart().disabled = false : heart().disabled = true\n submit().disabled = true ? submit().disabled = false : submit().disabled = minus\n}", "title": "" }, { "docid": "82af0f8586d5630385152b75f2b46796", "score": "0.72756", "text": "function enableButtons() {\n let buttons = document.getElementsByTagName(\"button\");\n for (let i = 0; i < buttons.length; i++) {\n if (buttons[i].id !== \"power-button\") buttons[i].disabled = false;\n }\n}", "title": "" }, { "docid": "e09005988e3037fdbbcbe17efbc5fb85", "score": "0.72701365", "text": "function disableButtons() {\n document.getElementById(\"searches\").className = \"off\";\n}", "title": "" }, { "docid": "99e17b188e380fa81f7401798c07008c", "score": "0.7270006", "text": "function enableButton(button) {\n button.classList.remove(\"ezy-btn--disabled\");\n button.disabled = false;\n }", "title": "" }, { "docid": "aab0184ea47d5427632434ba7baeffa1", "score": "0.72635376", "text": "function disable() {\r\n // To disable the button \"Generate New Array\"\r\n document.getElementById(\"Button1\")\r\n .disabled = true;\r\n document.getElementById(\"Button1\")\r\n .style.backgroundColor = \"#d8b6ff\";\r\n\r\n}", "title": "" }, { "docid": "4d1d22f10e66dbadcfff0f5d8665c8b0", "score": "0.7259938", "text": "function enableButtons() {\n $j(\"#open_item\").removeClass(\"disabled\");\n $j(\"#open_item\").addClass(\"enabled\");\n $j(\"#go_to_item_location\").removeClass(\"disabled\");\n $j(\"#go_to_item_location\").addClass(\"enabled\");\n }", "title": "" }, { "docid": "9973e71ff6a9ac5417db0bb4fdad3f81", "score": "0.72479206", "text": "onDisable() { }", "title": "" }, { "docid": "dda7393a53e31f42758281033b73afbc", "score": "0.72429013", "text": "function enableAllButtons() {\n disableOrEnableButtons(true);\n owner.notifyButtonStatesChanged();\n }", "title": "" }, { "docid": "b5c6566b16a90ee903ff2124753c2e37", "score": "0.72413313", "text": "function buttonDisable()\n{\n\tdocument.getElementById('block4').disabled = true; \n\tdocument.getElementById('block5').disabled = true; \n\tdocument.getElementById('block8').disabled = true; \n}", "title": "" }, { "docid": "7040f04b79b0fb99fe27b635e4f565de", "score": "0.7240323", "text": "function disableButton(button) {\n button.classList.add(\"js-disabled\");\n button.disabled = true;\n }", "title": "" }, { "docid": "117403700d0e0af8dd8e8db233cf4841", "score": "0.7222845", "text": "function onClickDisable() {\n\n if(document.forms[0] != null && document.forms[0] != undefined) {\n if ( document.forms[0].action == '' ||\n (window.event.srcElement.type == 'image' && window.event.srcElement.disabled)) {\n isErrFlg = true ;\n }\n }\n //document.getElementsByTagName(\"body\").style=\"cursor: move\";\n disableButtons('1');\n\n isErrFlg = false;\n}", "title": "" }, { "docid": "ab6cc368fc82fbe80a6bf1fe04b57e16", "score": "0.7219235", "text": "function blockall()\r\n{\r\n\t//this aims at freezing all the buttons\r\n\tdocument.getElementById(\"one\").disabled = true;\r\n document.getElementById(\"two\").disabled = true;\r\n document.getElementById(\"three\").disabled = true;\r\n document.getElementById(\"four\").disabled = true;\r\n document.getElementById(\"five\").disabled = true;\r\n document.getElementById(\"six\").disabled = true;\r\n document.getElementById(\"seven\").disabled = true;\r\n document.getElementById(\"eight\").disabled = true;\r\n document.getElementById(\"nine\").disabled = true;\r\n}", "title": "" }, { "docid": "082e96509fd92f27dffc2d3633dd04aa", "score": "0.7215458", "text": "function enableAllButton()\n{\n\n\tdocument.getElementById('hintsButton').disabled=false;\n\tdocument.getElementById('newButton').disabled=false;\n\tdocument.getElementById('resetButton').disabled=false;\n\n\t\n\t//checkbox\n\tdocument.getElementById('checkButton').disabled=false;\n}", "title": "" }, { "docid": "fdbe84ba04c5d456c8aff66fc97b7847", "score": "0.7214237", "text": "function aButtonDisableAll(bool){\n\tvar btnGroup = this.$myGroup\t\n\tif(bool){\n\t\tbtnGroup.each(function(){\n\t\t\tthis.disableThis(true)\n\t\t})\n\t}\n\telse{\n\t\tbtnGroup.each(function(){\t\t\t\n\t\t\tthis.disableThis(false)\t\t\n\t\t})\n\t}\n}", "title": "" }, { "docid": "7d375583c2896fd6fad784e3606afbb0", "score": "0.7211583", "text": "function enableBtn() {\n\tresetBtn.disabled=false;\n\tclearBtn.disabled=false;\n}", "title": "" }, { "docid": "2138fec2a148ecc8d5faa6ed0453991a", "score": "0.7207015", "text": "function enableDisableButton (){\n if (guessInput.disable = true){\n submitButton.removeAttribute('disabled', false);\n clearButton.removeAttribute('disabled', false);\n resetButton.removeAttribute('disabled', false);\n console.log ('function enable');\n }\n}", "title": "" }, { "docid": "2512e98ad907de19b90d486cca39f211", "score": "0.7190041", "text": "disable() {\n\n }", "title": "" }, { "docid": "e8e91fae8e842a8c018f8ccc6827c857", "score": "0.71882796", "text": "function enableOrderBtns(){\n $(end_btn).prop('disabled', false);\n $(save_btn).prop('disabled', false);\n $(cancel_btn).prop('disabled', false);\n}", "title": "" }, { "docid": "8e20e4a56f70039dbfabe8524de17e15", "score": "0.7182618", "text": "function edButtons(){\n if( !future.length ) redoButton.attr( \"disabled\", \"disabled\" );\n else redoButton.removeAttr( \"disabled\" );\n if( !past.length ) undoButton.attr( \"disabled\", \"disabled\" );\n else undoButton.removeAttr( \"disabled\" );\n }", "title": "" }, { "docid": "03d0d17ffb839da84fd91f85d8e9da83", "score": "0.71825016", "text": "function deactivateButtons(){\n $scope.clickMemoryButton = null;\n }", "title": "" }, { "docid": "7d0738ace5977c63a44cf3156c1ca059", "score": "0.718204", "text": "function byeGuardian() {\n document.getElementById(\"guardianButton\").disabled = true\n}", "title": "" }, { "docid": "1f51f3308a52df2b06a465dff27d95da", "score": "0.718081", "text": "disable() { }", "title": "" }, { "docid": "f880161da0c8c3d342ad0c053b42a14d", "score": "0.7178926", "text": "function disabledButton() {\n $btnNext.prop('disabled', true);\n }", "title": "" }, { "docid": "6072b06263df3006d5bd54e208c948f3", "score": "0.71781194", "text": "function restartButtonStatus() {\n elButton.disabled = true\n elButtonHold.disabled = true\n elButtonStart.disabled = true\n elButtonShuffle.disabled = false\n}", "title": "" }, { "docid": "00f5eb17c2243674156c74537e326b20", "score": "0.717313", "text": "function disableFakeBtn1(event) {\n\tfakeBtn1.classList.add('disabled');\n}", "title": "" }, { "docid": "de06ff94ec7b69793e48d88ffd59fd4a", "score": "0.7162639", "text": "function setS3UIButtonGroupDisabled() {\n setLoadRAMButtonState(false, false);\n setLoadEEPROMButtonState(true, false);\n setTerminalButtonState(true, false);\n setGraphButtonState(false, false);\n}", "title": "" }, { "docid": "294f7f691b9c5ee623a8d78e5df58301", "score": "0.716092", "text": "BlockButtonAnular() {\n const boton = document.getElementById('btnAnular');\n boton.innerHTML = \"Anulando por favor espere\";\n boton.disabled = true;\n }", "title": "" }, { "docid": "8964510ad0cb9b4d2f58c74e7447d35a", "score": "0.71497345", "text": "function toggleButton() {\n button.disabled = !button.disabled;\n }", "title": "" } ]
1d79c10e864f64f7f222ed3565028c69
============================================================================ UPDATE Catgory ============================================================================
[ { "docid": "6ac1c948072df8e1074eb3ab7e655a16", "score": "0.0", "text": "function categoryUpdateListener(){\n const updateCategoryButton = document.getElementsByClassName(\"category-edit\");\n let editButtonArray = makeArray(updateCategoryButton);\n editButtonArray.forEach((button) => {\n button.addEventListener(\"click\", ()=>{\n let id = button.dataset.categoryid;\n getEditCategory(id);\n });\n });\n\n}", "title": "" } ]
[ { "docid": "5bdcbd7f56b4ac64eb0b0a9967bfc312", "score": "0.6800411", "text": "function updateCategories() {\n chart.data.labels = obj.categorySet;\n chart.update();\n }", "title": "" }, { "docid": "9fcadc908419bbe17c3cd576cf8fc2dd", "score": "0.67486256", "text": "function updateCat(cat, csrf, type) {\n var data = cat;\n data._csrf = csrf;\n\n switch (type) {\n case \"adv\":\n data.adventurousness += 1;\n break;\n case \"agl\":\n data.agility += 1;\n break;\n case \"int\":\n data.intelligence += 1;\n break;\n case \"str\":\n data.stretch += 1;\n break;\n default:\n break;\n }\n\n console.dir(data);\n sendAjax('POST', '/updateCat', data, redirect);\n}", "title": "" }, { "docid": "1c0de9ea45cd40a5fb148422c8895212", "score": "0.6692215", "text": "updateCategorizedText() {\n\t\tfetch('/api/categorizedText/' + this.state.selected, {\n\t\tmethod: 'PUT',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\t})\n\t\t.then((response) => response.json())\n\t\t.then((invalue) => {\n this.formatCategories(invalue);\n\t\t});\n\t}", "title": "" }, { "docid": "a3f30d66e87086efda31f7999ea0b6c0", "score": "0.6586573", "text": "function updateData (catId, dDown) {\n\t\t\tcategoryId = catId;\n\n\t\t\tcurrentCategoryViewData = cooDataFactory.data.ticketCategoriesThisYear[categoryId];\n\t\t}", "title": "" }, { "docid": "17d5d371bc5c7b4d025b4346de496505", "score": "0.6561149", "text": "onUpdateBtnClick() {\n let name = this.state.name;\n let description = this.state.description;\n let updatedCategory = {_id: name, name: name, description: description};\n\n this.props.updateCategory(updatedCategory);\n }", "title": "" }, { "docid": "167116353b556bc5600825fa052101ac", "score": "0.6528221", "text": "function editCategory() {\n let catID = $('#category-id')[0].value.split(\"c\")[1];\n bookmarksData.bookmarks[catID].category = $('#category-name-edit').val();\n bookmarksData.bookmarks[catID].updated = new Date();\n bookmarksData.bookmarks[catID].categoryColor = $('#category-edit-bg-color').val();\n bookmarksData.bookmarks[catID].categoryTextColor = $('#category-edit-text-color').val();\n bookmarksData.bookmarks[catID].bookmarkColor = $('#bookmark-edit-bg-color').val();\n bookmarksData.bookmarks[catID].bookmarkTextColor = $('#bookmark-edit-text-color').val();\n processBookmarks();\n closeEditCategory();\n}", "title": "" }, { "docid": "4a4a9819a2d5a09b1771d95cc9b4848f", "score": "0.64984965", "text": "function updateCats(data) {\n once = undefined;\n setCats(data);\n}", "title": "" }, { "docid": "b3364c87c1c41cbd0f6d9ab3a982536b", "score": "0.6453162", "text": "changeCategory(category) {\r\n this.setState({\r\n currentCategory: category,\r\n page: 1,\r\n listings: [],\r\n loading: true\r\n }, () => {\r\n this.fetchCategories(category); // configure fetch for subcats\r\n this.fetchNextListings();\r\n })\r\n }", "title": "" }, { "docid": "e23c53c21eede7efca6605d01ce04486", "score": "0.6392157", "text": "setWithCategory(category){\n this.setState({\n catID:category._id,\n catName:category.name\n })\n }", "title": "" }, { "docid": "2b6b1dd06fca1c9f1b04b29f5f793cc9", "score": "0.63855296", "text": "onUpdateCategory() {\n this.render_();\n }", "title": "" }, { "docid": "947244c605c961b727694a75df7290fd", "score": "0.63805896", "text": "function editCategory(catId, catData) {\n return categoryModel.update({_id: catId}, {\n $set: {\n name: catData.name\n }\n });\n}", "title": "" }, { "docid": "d0dd3a241b52747e4518bf4d9e8401f4", "score": "0.63785064", "text": "function updateCategory(category) {\n\tselectedCategory = category;\n\t\n\t$(\"#typeFilter .dropdownSelected\").html(category);\n}", "title": "" }, { "docid": "e211081b630e446f8ba62d59a0841615", "score": "0.6361704", "text": "async editCategory(parent, args, ctx, info) {\n //Gets the category and updates it based on the new name\n var category = await ctx.db.mutation.updateCategory(\n {\n data: { serializedName: serializeName(args.name), name: args.name, emoji: args.emoji},\n where: { serializedName: args.categorySerial },\n },\n info\n );\n\n return category;\n }", "title": "" }, { "docid": "aecddcda5790e757f9c424b6bdadc6a3", "score": "0.63485867", "text": "[consts.CATEGORY_ADD](state, catObj) {\n let insCategoryObj = {\n id: catObj[\"id\"],\n pid: catObj[\"pid\"],\n dt: catObj[\"dt\"],\n idleaf: catObj[\"idleaf\"],\n kwrds: catObj[\"keyWords\"][\"keyWords\"],\n kwrdson: catObj[\"keyWords\"][\"keyWordsSelfOn\"],\n orderby: catObj[\"order\"][\"orderby\"],\n auto_numerate: catObj[\"order\"][\"autoNumerate\"],\n user_fields_on: catObj[\"userFields\"][\"userFieldsOn\"],\n uflds: catObj[\"uflds\"],\n num: parseInt(catObj[\"num\"]),\n chkd: false\n };\n for (let itm in catObj[\"names\"])\n insCategoryObj[\"name_\" + itm] = catObj[\"names\"][itm].name;\n\n //Categories items count +1\n state.itemsCount++;\n\n //Set leaf id if it is a root category\n if (catObj[\"pid\"] == -1) state.idLeaf = catObj[\"idleaf\"];\n\n Vue.set(state.list, state.list.length, insCategoryObj);\n }", "title": "" }, { "docid": "f79f880bcda83f5421ddda2c049af452", "score": "0.6319262", "text": "changeInfo(value){\r\n model.currentCat.name = value; \r\n this.catView.render(this); \r\n this.catListView.render(this, this.catView); \r\n }", "title": "" }, { "docid": "ff84dba737f70cbb586447bc1c57d5c8", "score": "0.63065195", "text": "changeIucnCategory(iucnCategory) {\n //update the state\n let _metadata = this.state.metadata;\n _metadata.IUCN_CATEGORY = iucnCategory;\n this.setState({ metadata: _metadata });\n //update the input.dat file\n this.updateProjectParameter(\"IUCN_CATEGORY\", iucnCategory);\n //filter the wdpa vector tiles - NO LONGER USED\n // this.filterWdpaByIucnCategory(iucnCategory);\n //render the wdpa intersections on the grid\n this.renderPAGridIntersections(iucnCategory);\n }", "title": "" }, { "docid": "fedf84b2011401246ac6cbb7e1439886", "score": "0.62981164", "text": "updateCat(newName){\n fetch(`http://localhost:3000/cats/${this.id}`, {\n method:\"PATCH\",\n headers:{\"Content-type\":\"application/json\"},\n body: JSON.stringify({\n name: newName\n })\n }).then(res => res.json())\n .then(cat => {\n console.log(cat)\n })\n }", "title": "" }, { "docid": "f16b3a9d0eb285262d4db555077db27f", "score": "0.62899244", "text": "function changeCat(){ // called by onclick on the menu or return\n\n\t\tvar cc=$('#catform');\n\t\tif (cc.is(\":hidden\")) return false;\n\t\tvar cat=$(\"#catchoice\")[0].options[$(\"#catchoice\")[0].selectedIndex].value;\n\t\tif (cat==null) cat=defaultcategory;\n\t\tvar id = cc.data(\"index\");\n\t\testablishCat(id,cat);\n\t\tcc.hide();\n\t\t\n\t\tcurrentnr = $(currentsvg).parent().attr(\"nr\");\n\t\tvar thisconll=wordsToConll(currentsvg.words);\n\t\tconlltrees[currentnr]=thisconll;\n\t// \tconsole.log(currentnr);\n\t\tvar conlltext = \"\";\n\t\t$.each(conlltrees, function(i, conlltree){ // just modifies the changed tree, keeps the other conll strings\n\t\t\t\tif (i==currentnr) conlltext+=thisconll+\"\\n\";\n\t\t\t\telse conlltext+=conlltrees[i]+\"\\n\"\n\t\t\t})\n\t\tconllarea.val(conlltext);\n\t\t\t\n\t}", "title": "" }, { "docid": "ccf4394fe2ebd7e8ff207617433e2a87", "score": "0.6273714", "text": "function refreshCategory(){\n\tshowList(PROXY.getList(curCat));\n}", "title": "" }, { "docid": "bb6d4d823e155f6921545b73a5a75dc6", "score": "0.6202954", "text": "category(state, data) {\n return state.category = data;\n }", "title": "" }, { "docid": "4506d52d20f2ca3539427db7f4a847f3", "score": "0.61745024", "text": "updateCategories() {\n fetch('api/categories')\n .then(response => response.json())\n .then(categories => {\n categories = categories.sort(function compare(a, b) {\n if (b.popularity < a.popularity) return -1;\n if (b.popularity > a.popularity) return 1;\n if (b.category > a.category) return -1;\n if (b.category < a.category) return 1; \n return 0;\n }) \n this.setState({ categories: categories, tempCategories: categories, currentCategory: categories[0].category})\n // this.forceUpdate();\n })\n }", "title": "" }, { "docid": "2acc4588034cc70a685a9116589a02b5", "score": "0.6112059", "text": "static update(id, updatedCodegory) {\n return fetch(`${url}/${id}`, {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(updatedCodegory),\n })\n .then((res) => res.json())\n .catch((err) => {\n console.log(\"Error fetching data in CodegoryModel.update\", err);\n return { codegory: {} };\n });\n }", "title": "" }, { "docid": "ec062b285bfa35789ef1d676acaf61e9", "score": "0.60851365", "text": "updateCategory(ctx, payload) {\n return new Promise((resolve, reject) => {\n axios\n .patch(`admin/category/${payload.id}?token=${payload.token}`, payload)\n .then(response => {\n resolve(response);\n })\n .catch(error => {\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "8d30fa0ddbac5367d55336bc34f63d8a", "score": "0.60718447", "text": "putSubategories(IdSubcat, SubcatName){\n let ret = {};\n // Open a database connection\n sqlite3.connect('./db/SWOdb.db', (err) => {\n if (err) {\n return console.error(err.message);\n }\n console.log('[subcategories.putSubcategories] Connected to the SQlite file database.');\n });\n \n let sql = \"UPDATE Subcategories SET SubcatName = '\" + SubcatName + \"' WHERE IdSubcat = '\" + IdSubcat + \"';\";\n ret = sqlite3.run(sql);\n\n sqlite3.close();\n return ret;\n }", "title": "" }, { "docid": "c6bd00705fde354c5833468a111f29c5", "score": "0.60277665", "text": "async function category_update_api(req, res) {\n let [id, query] = [null, req.query];\n if (query.id) {\n id = query.id;\n }\n try {\n if (id == null) throw \"id query not found\";\n // update\n await category_model.update_by_id(id, req.body);\n\n res.status(200).json({ message: \"Category Name Updated\" });\n } catch (error) {\n res.status(500).json({ error });\n }\n}", "title": "" }, { "docid": "0c6afe4170b61733dc5502704d70bb6e", "score": "0.59699434", "text": "async updateCategory(category) {\n let categories = await this._loadAllCategories();\n\n let updatedCategory = categories.find((c) => {\n return c.categoryId === category.categoryId;\n });\n\n if (updatedCategory) {\n let index = categories.indexOf(updatedCategory);\n categories[index] = category;\n\n try {\n await wf(\n this._getStorageLocation(),\n JSON.stringify(categories, null, 2)\n );\n return category;\n } catch (error) {\n const e = new Error(\n `Failed to update category with code ${category.Id} in local storage.`\n );\n e.code = \"FAILED_TO_UPDATE_CATEGORY\";\n throw e;\n }\n } else {\n new Error(`Category with id ${category.categoryId} does not exist.`);\n e.code = \"FAILED_TO_GET_CATEGORY\";\n throw e;\n }\n }", "title": "" }, { "docid": "b69b580c3fcf732946f8eb0e10ef600c", "score": "0.5964075", "text": "function onCategoryChanged(event)\n\t{\n\t\tvar newCategoryIndex = parseInt(event.currentTarget.value);\n\n\t\t// when index hasn't changed, no soup for you...\n\t\tif (this.showingCategoryIndex == newCategoryIndex) return;\n\n\t\tthis.showingCategoryIndex = newCategoryIndex;\n\t\tthis.sidebar.breadcrumbsView.back(0);\n\t\tthis.renderCategorySelectorView();\n\t}", "title": "" }, { "docid": "515b8824ca76d9ddf996ab263dc34a09", "score": "0.5936077", "text": "function updateCategory(productId, category) {\n\t return $http.post('/api/product/updateCategory', { productId: productId, category: category });\n\t }", "title": "" }, { "docid": "299e4b452f72107d06a9bb6d96afd3df", "score": "0.59305364", "text": "updateCategory (json: jsonCategory, callback: mixed){\n let val = [json.description, json.category_id];\n super.query(\n \"update Category set description = ? where category_id = ?\",\n val,\n callback\n );\n }", "title": "" }, { "docid": "d935dbb461a720dd385a2d1ae04a25a1", "score": "0.5912688", "text": "function updateSubcategory(lbrXML) {\n\t//alert('updateCategory() called... XML==>!!'+lbrXML);\n\tvar lbr = lbrXML.getElementsByTagName(\"lbr\")[0];\n\tif(alert==null)\n\t\talert('Seems like ajax getting served from cache... clear cache');\n\tvar generated = lbr.getAttribute(\"generated\");\n\t//alert('generated-> '+generated);\n\tif (generated > lastUpdate) {\n\t\tlastUpdate = generated;\n\t\tvar contents = document.getElementsByName('subcategory')[0];\n\t\tcontents.innerHTML = \"\";\n\t\t//alert('contents.innerHTML-> '+contents.innerHTML);\n\t\tvar subCatNames = lbr.getElementsByTagName(\"subcategory\")[0].getElementsByTagName(\"name\");\n\t\tvar subCatIDs = lbr.getElementsByTagName(\"subcategory\")[0].getElementsByTagName(\"catid\");\n\t\t// alert('numElems='+items.length);\n\t\tfor (var I = 0 ; I < subCatNames.length ; I++) {\n\t\t\tvar subCatName = subCatNames[I].firstChild.nodeValue;\n\t\t\tvar subCatID = subCatIDs[I].firstChild.nodeValue;\n\t\t\t// alert(subcat);\n\t\t\t//var name = item.getElementsByTagName(\"name\")[0].firstChild.nodeValue;\n\t\t\t//var quantity = item.getElementsByTagName(\"quantity\")[0].firstChild.nodeValue;\n\t\t\tvar attr = document.createAttribute('value');\n\t\t\tattr.nodeValue = subCatID;\n\t\t\tAddChild(document, contents, \"option\", subCatName, attr);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9ad9ce86d053ad38d45cc153376e6b45", "score": "0.5888361", "text": "function updateLobbyCategory(lobbyID, category){\n $(\"#category\" + lobbyID).val(category);\n}", "title": "" }, { "docid": "a329dd2d3917e9817f12592c8d9e1b6e", "score": "0.58804595", "text": "function Set_Category_Species(){\r\n\t db.transaction(function (txs) {\r\n\t\t \ttxs.executeSql('SELECT * FROM Species', [], function (txs, results) {\r\n\t\t\t\tvar len = results.rows.length, i;\r\n\t\t\t\t$(\"#CategoryField\").show();\r\n\t\t\t\tfor(i = 0; i < len; i++) {\r\n\t\t\t\t var Cdata = results.rows.item(i);\r\n\t\t\t\t var CL = $('#CategoryField').clone();\r\n\t\t\t\t CL.attr(\"id\",Cdata.species);\r\n\t\t\t\t CL.data(\"idKeeper\",Cdata.speciesId);\r\n\t\t\t\t CL.appendTo('#ListofCategory');\r\n\t\t\t\t CL.find('#Title').text(Cdata.species);\r\n\t\t\t\t Display_Category_Species(CL.data(\"idKeeper\"),CL);\r\n\t\t\t\t}\r\n\t\t\t\t$(\"#CategoryField\").hide();\r\n\t\t\t });\r\n\t \t\t});\r\n\t\t}", "title": "" }, { "docid": "2c8adf9baf305c1f17431a8f57dd1116", "score": "0.5857542", "text": "function category_set(argument) {\n var id = argument.id;\n var name = argument.name.toLowerCase();\n var url = category_encode({'name': name});\n\n category.update({'_id': id}, {'$set': {'name': name, 'url': url}},\n function(error, results) {\n });\n}", "title": "" }, { "docid": "334ae0f300030e556943d67332f90455", "score": "0.5857051", "text": "updateFilters(categoryName, duration, selectedYear) {\n let categoryMap = utils.getCategoryMap();\n let categoryNumber = categoryMap.get(categoryName);\n this.setState({ category: categoryNumber}); \n this.setState({ length: duration}); \n this.setState({ year: selectedYear}); \n console.log(\"Category:\", categoryName, \"ID:\", categoryNumber);\n console.log(\"Length:\", duration);\n console.log(\"Year:\", selectedYear);\n }", "title": "" }, { "docid": "b22417a7c1114b08ab296b2e386e3513", "score": "0.5837598", "text": "function updateCategoryTitle(catID, newTitle){\r\n\t\t\r\n\t\tvar data = {\r\n\t\t\tcat_id: catID,\r\n\t\t\ttitle: newTitle\r\n\t\t};\r\n\t\t\r\n\t\t//show update error\r\n\t\tg_ucAdmin.setErrorMessageID(function(message, operation){\r\n\t\t\t\r\n\t\t\tjQuery('.egn-save-inp:disabled').removeAttr('disabled').html('Save');\r\n\t\t\tshowMsgCats(message, true);\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tg_ucAdmin.ajaxRequest(\"update_category\", data, function(response){\r\n\t\t\t\r\n\t\t\tjQuery('a.uc-layouts-list-category[data-catid='+catID+']').html(newTitle);\r\n\t\t\tcloseEdit(catID, newTitle);\r\n\t\t\t\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "ed6197e4073106063846fea1f1e99ded", "score": "0.5836007", "text": "function update_categories(category, category_name, service) {\n return new Promise((resolve, reject) => {\n var cat = new Category({\n name: category_name,\n code: category,\n service: service\n });\n cat.save((err) => {\n // Don't care for errors, could be a unique index validation\n resolve();\n });\n })\n}", "title": "" }, { "docid": "ee26791700f42d2e4b3d9c9b04b410bb", "score": "0.5831294", "text": "updateCategorySelection(event) {\n\n\t\tlet updatedInputState = Object.assign([], this.state.formRows);\n\t\tupdatedInputState[0].selectElements[0].selectData.value = event.target.value;\n\n\t\tthis.setState({\n\t\t\tformShouldUpdate: false,\n\t\t\tformRows: updatedInputState\n\t\t});\n\t}", "title": "" }, { "docid": "7480cc8625fcfab5e496a4f792c20fe0", "score": "0.58225757", "text": "function setCtgDictionary(listCat){\n\t\tvar i = 0;\n\t\tvar ctgName;\n\t\tfor(i=0; i < listCat.length; i++){\n\t\t\tctgName = listCat[i].name;\n\t\t\tself.ctgDcitionary[ctgName] = listCat[i].id;\n\t\t}\n\t\t\t\n\t}", "title": "" }, { "docid": "8edfbc0762e4c7efc6f3f703f7c086c3", "score": "0.58205616", "text": "setCategory(category) {\n \n this.currentCategory = category;\n this.setRecipe(category.Recipes[0]);\n this.showRecipeInfo = false;\n }", "title": "" }, { "docid": "9b90ea32a28f479d9ee259b9523ac44b", "score": "0.58099955", "text": "async function update(req, res) {\n try {\n const updatedCategory = req.body;\n const category = await Category.findOne({\n where: { id: updatedCategory.id },\n });\n category.update({\n categoryName: updatedCategory.categoryName,\n description: updatedCategory.description,\n picture: updatedCategory.picture,\n });\n if (category) {\n res.json({ success: `Category id: ${category.id}, updated correctly` });\n } else {\n res.json({\n error: \"Category not found, please make sure the category you´re trying to update exist\",\n });\n }\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "d5c48295cfb9dd0a12acf67d07772435", "score": "0.5797507", "text": "function updateCategory(kapp,obj,stopSiblings, originalCategory, deselectCategory) {\n if(siblingsArray.length === 0){\n siblingsArray = $(obj).siblings('li');\n }\n var category, categoryName = $(obj).attr('data-id');\n // Check if originalCategory is defined. This will contain the \n // category name to update because we can update the category name.\n originalCategory != undefined ? category = originalCategory : category = categoryName;\n // If only the display name is updated, we have an empty categoryName so set\n // to the original name\n if(categoryName == undefined) { categoryName = category; }\n // If they are both empty - we need to quit\n if(categoryName == undefined && category == undefined){\n return false;\n }\n var sortOrder = $(obj).index();\n var displayName = $(obj).attr('data-display');\n var parent = $(obj).parent().closest('li').attr('data-id');\n var url = bundle.spaceLocation() + '/app/api/v1/kapps/' + kapp + '/categories/' + category + '?include=attributes';\n\n // Get category to add other attributes\n $.ajax({\n method: 'GET',\n url: url,\n dataType: \"json\",\n contentType: \"application/json\",\n success: function( data ){\n // Create the payload by what is defined\n var payload = '{\"slug\": \"' + categoryName + '\",\"name\": \"' + displayName + '\",';\n // These are attributes \n payload = payload + '\"attributes\": [ ';\n if( sortOrder != undefined){\n payload = payload + '{ \"name\":\"Sort Order\",\"values\":[\"' + sortOrder + '\"]},'; \n }\n\n // Add attributes besides sort and parent\n var checkParent = false;\n $.each(data.category.attributes, function(index,value){\n if(value.name === \"Parent\"){\n checkParent = true;\n value.values[0] = parent !== undefined ? parent : '';\n }\n var stringVal = JSON.stringify(value);\n if(stringVal.indexOf('Sort Order') > -1){\n }\n else {\n payload = payload + stringVal + \",\";\n }\n });\n\n if (parent !== undefined && !checkParent){\n payload = payload + '{ \"name\":\"Parent\",\"values\":[\"' + parent + '\"]},';\n }\n\n payload = payload.substring(0,payload.length-1) + '] '; \n // Close the payload\n payload = payload + '}';\n // Update via api\n $.ajax({\n method: 'PUT',\n url: url,\n dataType: \"json\",\n data: payload,\n contentType: \"application/json\"\n }).done(function(){\n // clear our the lastUpdated so we know we are done and can do the next\n lastUpdated = '';\n // Check if we should update siblings\n if(!stopSiblings){\n // If this is the last sibling set the stop\n if(siblingsArray.length === 1) {stopSiblings = true;}\n var item = siblingsArray[0];\n siblingsArray.splice(0,1);\n updateCategory(kapp,$(item),stopSiblings,undefined,false);\n }\n });\n $('ul.sortable').sortable();\n if(deselectCategory){\n clearSelectedCategory();\n }\n }\n });\n }", "title": "" }, { "docid": "957b173fbfd8f9d44df2ff2729a3eab9", "score": "0.57593817", "text": "function renameCat() {\n}", "title": "" }, { "docid": "28626f9a35b3a9f9f21b509a41be12c6", "score": "0.5754531", "text": "changeCategoriesValue(value) {\n let stateOb = {};\n\n // Map an array of category IDs\n stateOb.locationCategoriesValue = value.map(category => {\n return category.value;\n });\n\n // Update store for caching purposes\n if (!!this.props.editLocationFormCategories) {\n this.props.editLocationFormCategories(stateOb.locationCategoriesValue);\n }\n\n if (this.state.locationCategoriesInitialized === false) {\n stateOb.locationCategoriesInitialized = true;\n }\n this.setState(stateOb);\n }", "title": "" }, { "docid": "326beaccaaf38d7e273e2991c5c066ca", "score": "0.57218164", "text": "function getSubCatagories(form,index) {\r\n cntrySel = document.getElementById('categoryId');\r\n \r\n catagoryList = categories[cntrySel.value];\r\n if(catagoryList != null){\r\n setSubCatagories('subCategoryId', catagoryList, catagoryList);\r\n }\r\n}", "title": "" }, { "docid": "67e4e66b6ddd9c7d738ab69e4c2cf5a7", "score": "0.5721548", "text": "function updateFromSubCategory(props) {\n setSubCategoryId(props);\n setProductDropdownDisabled(false);\n console.log(props);\n }", "title": "" }, { "docid": "912d02189421c0e58864aeee93750d79", "score": "0.57162476", "text": "updateFilteredCategoryChanges() {\n this.filteredCategoryChanges = this.categoryChanges_.filter(\n FILTER_OPTIONS[this.filterBy]);\n }", "title": "" }, { "docid": "4603919adf0ece7975e9144dfc49a2e4", "score": "0.57028097", "text": "function grabIDCatergory(category){\n let id = subcategories.filter(item=>{\n return item.props.value === category;\n })\n setCategoryID(id[0].key)\n }", "title": "" }, { "docid": "72d596c57273c65c9aa5ef9073525dc8", "score": "0.5699069", "text": "addCategory(categoryName, categoryWeight) {\n // Create blank category (deep copy clone) and name\n let newCat = JSON.parse(JSON.stringify(Category));\n newCat.name = categoryName;\n newCat.CategoryWeight = categoryWeight;\n // Push category to array and capture index\n let catSize = this.project.categories.push(newCat);\n // Add single Risk with weight = 100 (as new category need single Risk)\n let cat = this.getCategory(catSize-1);\n this.addRiskTo(cat, \"\", 100);\n // Return added category\n return cat;\n }", "title": "" }, { "docid": "3831eec4eb340bd9659c0d6692334e6f", "score": "0.56873906", "text": "changeCategory(event) {\r\n this.setState({category: event.target.value});\r\n }", "title": "" }, { "docid": "03737a26a9937d6a4b98cc7b795080a2", "score": "0.56621385", "text": "function setCategoryForLayout(){\r\n\t\t\t\t\r\n\t\tvar catID = getSelectedCatIDFromHtmlTable();\r\n\t\tvar layoutID = g_openedLayout;\r\n\t\t\r\n\t\tdata = {\r\n\t\t\tlayoutid: layoutID,\r\n\t\t\tcatid: catID\r\n\t\t};\r\n\t\t\r\n\t\tg_ucAdmin.dialogAjaxRequest(\"uc_dialog_add_category\", \"update_layout_category\", data, function(){\r\n\t\t\t\r\n\t\t\tvar objTableItem = jQuery('a.uc-layouts-list-category[data-layoutid='+layoutID+']');\r\n\t\t\t\r\n\t\t\tobjTableItem.html(getCategoryNameFromHtmlTableById(catID));\r\n\t\t\tobjTableItem.attr(\"data-catid\", catID).data('catid', catID);\r\n\t\t});\r\n\t\t\r\n\t}", "title": "" }, { "docid": "a3f82c83b3f04ef4656c0454089c02d2", "score": "0.56621015", "text": "function setCategory(cat) {\n\t\n\t//dropdown menu\n\t\t\n\t//index of the dropdown menu item\n\tvar menuItem = 0;\n\t\n\tswitch (cat)\n\t{\n\t\tcase \"A\":\n\t\tcase \"CV\":\n\t\t\tmenuItem = 0;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"T\":\n\t\t\tmenuItem = 1;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"CC\":\n\t\t\tmenuItem = 2;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"SUV\":\n\t\t\tmenuItem = 3;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"R\":\n\t\t\tmenuItem = 4;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"M\":\n\t\t\tmenuItem = 5;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"W\":\n\t\t\tmenuItem = 6;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"S\":\n\t\t\tmenuItem = 7;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"F\":\n\t\t\tmenuItem = 8;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"TT\":\n\t\t\tmenuItem = 9;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"B\":\n\t\t\tmenuItem = 10;\n\t\t\tbreak;\n\t\t\n\t\tcase \"E\":\n\t\t\tmenuItem = 11;\n\t\t\tbreak;\n\t\t\n\t\tcase \"P\":\n\t\t\tmenuItem = 12;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"H\":\n\t\t\tmenuItem = 13;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"X\":\n\t\t\tmenuItem = 14;\n\t\t\tbreak;\n\t\t\t\n\t\t// Category is invalid value\n\t\tdefault:\n\t\t\tmenuItem = 0;\n\t\t\tdocument.getElementById(\"AdListing_Category\").style.border = redOutline;\n\t}\n\tdocument.getElementById(\"AdListing_Category\").options.selectedIndex = menuItem;\n\t// trigger event from category changing\n\tdocument.getElementById(\"AdListing_Category\").dispatchEvent(new Event('change'));\n}", "title": "" }, { "docid": "09b0837ddb060eefd006305d3eca9edc", "score": "0.5660831", "text": "_onCategoriesUpdated() {\n this.categoryListeners.fire(this.categories);\n }", "title": "" }, { "docid": "a58943c1dd24d2c40d9825802e2931a4", "score": "0.565861", "text": "function updateCollapseState(catId) {\n catId = \"c\" + catId;\n let updatedCollapseState = {};\n if (bookmarksData.collapseState[catId] != undefined) {\n delete bookmarksData.collapseState[catId];\n Object.keys(bookmarksData.collapseState).forEach((element, index) => {\n updatedCollapseState[\"c\" + index] = bookmarksData.collapseState[element];\n });\n }\n return updatedCollapseState;\n}", "title": "" }, { "docid": "4e5d02c0a01a8e275756acad492510d9", "score": "0.5653338", "text": "handleClick(newCategory) {\n this.setState({\n category: newCategory\n });\n }", "title": "" }, { "docid": "94b89a55726039b51b48fe11207d48b6", "score": "0.5630215", "text": "function changePrcategory() {\n exportorderService.changePrcategory(ctrl.exportorder.prId).then(function(result) {\n ctrl.prCList = result;\n ctrl.exportorder.prCategoryId = ctrl.prCList.prCategoryId;\n })\n }", "title": "" }, { "docid": "75e36a08c21f150076267a0d6a188b4f", "score": "0.56268597", "text": "function updateCategoryHTML(catName){\n var categoryInput = document.getElementById('input-category');\n categoryInput.innerHTML += '<option value=\"' + catName + '\">' + catName + '</option>';\n}", "title": "" }, { "docid": "247aefca54c76e4cc01ae6bd3622f990", "score": "0.5613486", "text": "submit() {\n const categoryChange =\n this.getCategoryChange_(this.categoryId_, this.selectedScions);\n const categoryChangeList = [categoryChange];\n\n const childCategories =\n this.taxonomyTree_.getChildrenIdList(this.categoryId_);\n childCategories.forEach((childCategory) => {\n const categoryChange =\n this.getCategoryChange_(childCategory, this.selectedScions);\n categoryChangeList.push(categoryChange);\n });\n\n this.toastService_.showInfo('Adding Scions ...');\n this.categoryService_.updateCategory(Provider.ROOTSTOCK, categoryChangeList)\n .then((response) => {\n this.toastService_.hideToast();\n this.close();\n this.state_.go(ViewState.PROVIDER_CATEGORY,\n {provider: Provider.ROOTSTOCK, categoryId: this.categoryId_});\n }, (error) => {\n let errorMessage = 'Adding Scions failed.';\n if (error.message) {\n errorMessage += ` Error: ${error.message}`;\n }\n this.toastService_.showError(errorMessage);\n });\n }", "title": "" }, { "docid": "6a3f6f1f2007f386e1d29abd9eede15b", "score": "0.56061065", "text": "onCategoryChange(event) {\n console.log(\"change category\", event.target.value);\n this.setState({\n ...this.state,\n category: event.target.value\n })\n }", "title": "" }, { "docid": "8352c906cdbe2cc7b820dc59a953fbf4", "score": "0.5595078", "text": "function restUpdateCategory( event )\n{\n\tvar accountId = getParameterByName( \"accountId\" );\n\t\n\t// Get category given in parameter\n\tvar categoryId = event.data.categoryId;\n\n\t// Manage cariage return\n\tif( event.which == 13 )\n\t{\n\t\t// Prevent default browser behavior\n\t\tevent.preventDefault();\n\n\t\t\n\t\t// Get category version\n\t\tvar categoryVersion = $(\"#\" + categoryId ).attr( 'version' );\n\n\t\t// Get new category input name\n\t\tvar categoryNameNewInput = $(\"#\" + categoryId + \"_categoryNameNew input\"); \n\t\t// Disable new category input name in waiting server response\n\t\tcategoryNameNewInput.prop( \"disabled\" , true );\n\n\t\t// Get new category name\n\t\tvar categoryNameNew = categoryNameNewInput.val();\n\n\t\t$.post('../res/accounts/' + accountId + '/categories/' + categoryId +'/upd', {\n\t\t\tname : categoryNameNew,\n\t\t\tversion: categoryVersion,\n\t\t\ttoken : mpaToken\n\t\t}).done(function(data)\n\t\t{\n\t\t\tvar response = jQuery.parseJSON(data);\n\t\t\tvar categoryId = response.id;\n\n\t\t\t// Error in addind account\n\t\t\tif( isNaN(parseInt(categoryId, 16)) )\n\t\t\t{\n\t\t\t\t// Display error message\n\t\t\t\talert(categoryId);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Hide and reset editable category name\n\t\t\t\t$(\"#\" + categoryId + \"_categoryNameNew\").hide();\n\t\t\t\t$(\"#\" + categoryId + \"_categoryNameNew\").val( '' );\n\n\t\t\t\t// Update category version\n\t\t\t\t$(\"#\" + categoryId ).attr( 'version' , response.version );\n\n\t\t\t\t// Update category name and show it\n\t\t\t\t$(\"#\" + categoryId + \"_categoryName\").text( categoryNameNew );\n\t\t\t\t$(\"#\" + categoryId + \"_categoryName\").show();\n\t\t\t}\n\t\t}).fail(function() {\n\t\t\talert(\"Error, asks administrator for details\");\n\t\t}).always(function() {\n\t\t\t// Enable new account input name after server response\n\t\t\tcategoryNameNewInput.prop( \"disabled\" , false );\t\t\t\n\t\t})\n\t}\n\t// ECHAP\n\telse if( event.which == 0 )\n\t{\n\t\t// Hide and reset editable account name\n\t\t$(\"#\" + accountId + \"_accountNameNew\").hide();\n\t\t$(\"#\" + accountId + \"_accountNameNew\").val( '' );\n\n\t\t// Display account name\n\t\t$(\"#\" + accountId + \"_accountName\").show();\n\t}\n}", "title": "" }, { "docid": "36b6c44266321402ad7556e0764db29f", "score": "0.5592562", "text": "function updateFormWithNewCategoryImageId(categoryId, imageId) {\n jQuery('#eo_theme_options\\\\[catimage-' + categoryId + '\\\\]').val(imageId);\n}", "title": "" }, { "docid": "06a2788726915290492299d147e76ca4", "score": "0.55733985", "text": "function updatCard(obj){\n db.collection(`${obj.category}`).doc(`${obj.id}`)\n.update({isAvailable: false});\n}", "title": "" }, { "docid": "3033bdbce325e0ec6c05d4748ca550e6", "score": "0.5564883", "text": "setCategories (state, categories) {\n state.categories = categories\n }", "title": "" }, { "docid": "741b68c682a645d3e35c98402be6767d", "score": "0.5557831", "text": "newGeneralCat()\n {\n if(this.selectedCat == 1)\n {this.newFileCat()}\n if(this.selectedCat == 2)\n {this.newBoxCat()}\n if(this.selectedCat == 3)\n {this.newPhysicalCharacteristCat()}\n if(this.selectedCat == 4)\n {this.newDocumentaryGroupCat()}\n if(this.selectedCat == 5)\n {this.newDocumentaryTraditionCat()}\n if(this.selectedCat == 6)\n {this.newProducerCat()}\n if(this.selectedCat == 7)\n {this.newSupportCat()}\n if(this.selectedCat == 8)\n {this.newTransactionTypeCat()}\n if(this.selectedCat == 9)\n {this.newIdiomsCat()}\n }", "title": "" }, { "docid": "439bd5dfd94ce237a7939a36fc336ada", "score": "0.55550355", "text": "componentDidUpdate(prevProps){\n if(prevProps.categoryId !== this.props.categoryId){\n this.props.fetchCategory(this.props.categoryId);\n }\n }", "title": "" }, { "docid": "c88617022cf68c80684558615b69e0f7", "score": "0.5545841", "text": "function resetCategory() {\n setChuckNorrisClickedCat(\"\");\n }", "title": "" }, { "docid": "7efb58ba9fca584b494780fe073f74bf", "score": "0.55446136", "text": "function addCategory() {\n if (categoryName && categoryValue) {\n const category = {}\n category[categoryName] = categoryValue\n setCategories([...categories, category])\n setCategoryName(\"\")\n setCategoryValue(\"\")\n }\n }", "title": "" }, { "docid": "55158bc34e595f199f3da8f0cc36a202", "score": "0.553991", "text": "function updateVisualisation() {\n\n visualisedCategories = [];\n\n // Get all selected grouping elements (categories)\n var selectedCategories = $('.well:visible'),\n //selectedLength = selectedCategories.length,\n aggregationData = {\n groupByFields: [],\n virtualFields: [],\n additionalFields: {},\n filterData: {}\n };\n\n if (optLimit) {\n aggregationData.childrenLimit = optLimit;\n }\n\n if (optOrder === 1 || optOrder === -1) {\n aggregationData.childrenOrder = optOrder;\n }\n\n $.each(selectedCategories, function(index, value) {\n var catID = $(value).attr('catID'),\n fieldDef = categories[catID];\n\n if (fieldDef) {\n\n visualisedCategories.push(categories[catID]);\n //visualisedCategories.push(fieldDef.categoryValue);\n\n aggregationData.groupByFields.push(fieldDef.categoryValue);\n\n if (fieldDef.filter) {\n updateFilterData(aggregationData.filterData, fieldDef.filter);\n }\n\n if (fieldDef.virtualField) {\n aggregationData.virtualFields.push(catID);\n }\n\n if (fieldDef.additionalFields && fieldDef.additionalFields) {\n aggregationData.additionalFields[fieldDef.categoryValue] = fieldDef.additionalFields;\n }\n\n //if (index === selectedLength - 1) {\n // if (fieldDef.showPrice) {\n // manageEuroBtn('show');\n // } else {\n // console.log('hide', catID);\n // manageEuroBtn('hide');\n // }\n //}\n }\n });\n\n drawVisualisation( aggregationData );\n }", "title": "" }, { "docid": "2911652ba02396295c5f66176c1085ee", "score": "0.55395585", "text": "function CategoryAdderTwo() {\n\tvar cat2html = '<p style=\"text-align:center;\" class=\"CategoryAdderTwo\"><input type=\"text\" id=\"Category\" value=\"\" /><a class=\"wikia-button\" style=\"margin:0 1em; cursor:pointer;\" id=\"categorySubmitTwo\">Add Category</a>';\n\t$('#filetoc').append(cat2html);\n\t$('#categorySubmitTwo').click(function(event) {\n\t\tnewCat = $(\"#Category\").val();\n\t\tthis.innerHTML = '<img src=\"https://images.wikia.nocookie.net/dev/images/8/82/Facebook_throbber.gif\" style=\"vertical-align: baseline;\" border=\"0\" />';\n\t\t$.getJSON(\"/api.php\", {action: \"query\", prop: \"info\", titles: wgPageName, intoken: \"edit\", format: \"json\", indexpageids: 1}, function(json) {\n\t\t\tvar pageid = json.query.pageids[0];\n\t\t\tvar tk = json.query.pages[pageid].edittoken;\n\t\t\t$.post(\"/api.php\", {action: \"edit\", title: wgPageName, token: tk, bot: true, appendtext: \"[[Category:\" + newCat + \"]]\" + \"\\n\"}, function (result) {$(\".CategoryAdderTwo\").remove();});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "2e877cdd55e2838befe1acfcfaafe3da", "score": "0.5534892", "text": "setCategory(newCategory) {\r\n this.setState({ category: newCategory })\r\n setTimeout(() => {\r\n this.getItems()\r\n }, 250)\r\n }", "title": "" }, { "docid": "eae6debf477522d251b424c29a2219d3", "score": "0.5533207", "text": "function handleCategoryChange() {\n var newPostCategory = $(this).val();\n getCatPosts(newPostCategory);\n }", "title": "" }, { "docid": "c26a63e20f943e5651de40f450bf5d6f", "score": "0.5533006", "text": "function category(value, types, key) \n{\n // Check if an object has been selected\n if (canvas.getActiveObject() !== null) \n {\n active = canvas.getActiveObject();\n // check if it is a rectangle or group (polygon)\n if (active.hasOwnProperty(\"translations\")) \n {\n // If rectangle, change it's values\n active.set({ translations: value, key: key, types: types });\n rectTranslations = value;\n window.rectKey = key;\n window.rectTypes = types;\n active.dirty = true;\n canvas.renderAll();\n }\n else \n {\n // If polygon, change it's values\n active._objects[1].setText(value);\n active._objects[0].set(\"key\", key);\n active._objects[0].set(\"types\", types);\n active.dirty = true;\n polyTranslations = value;\n window.polyKey = key;\n window.polyTypes = types;\n canvas.renderAll();\n }\n }\n}", "title": "" }, { "docid": "d9d455f8f8a5e88897db0ce5935c204e", "score": "0.55269146", "text": "setCategory(index = 0, is = true) {\n var newCategories = this.state.categories;\n\n newCategories[index][1] = is;\n newCategories = this.checkZeroCategories(newCategories);\n this.setState({categories: newCategories});\n this.sortImageList();\n }", "title": "" }, { "docid": "c81b1006931cb2e231616298123e264c", "score": "0.55149406", "text": "function add_cat() {\n\n\t}", "title": "" }, { "docid": "6382f3f6d3f940f70d4e3277c41ba2c9", "score": "0.55110735", "text": "updateControversy(slug, shortSlug, cardName, cardSummary, cardCategory, text, cardAuthor, gplusUrl, publishDate, updateDate, images) {\n\t\tconst body = {\n\t\t\tshortSlug,\n\t\t\tcardName,\n\t\t\tcardSummary,\n\t\t\tcardCategory,\n\t\t\ttext,\n\t\t\tcardAuthor,\n\t\t\tgplusUrl,\n\t\t\tpublishDate,\n\t\t\tupdateDate,\n\t\t\timages\n\t\t};\n\n\t\treturn invokeApig({\n\t\t\tbase: api.cards,\n\t\t\tpath: slug,\n\t\t\tmethod: 'PUT',\n\t\t\tbody\n\t\t});\n\t}", "title": "" }, { "docid": "8a40bebbe1655a9189dd65a9d21dae8d", "score": "0.54996765", "text": "function addCategories() {\n for (var i = 0; i < habits.length; i++) {\n categories.push({\n \"name\": habits[i].value,\n \"count\": 0,\n \"color\": colours[i % colours.length],\n \"pic\": habits[i].pic,\n //Using getter to be able to use the object's own keys to compute other props\n get percentage() {\n return ins.round((this.count / column.length) * (boxes_down * boxes_across));\n },\n });\n }\n for (var i = 0; i < column.length; i++) {\n var catLocation = categoryLocation(column[i]);\n if (catLocation != -1) {\n categories[catLocation].count++;\n }\n }\n //iterate over the categories and add proportions\n for (var i = 0; i < categories.length; i++) {\n categories[i].boxes = ins.round((categories[i].count / column.length) * (boxes_down * boxes_across));\n }\n }", "title": "" }, { "docid": "210dd5f73b268ba1097ce9c0d8ee7b33", "score": "0.54958814", "text": "handlerChangeCategory(ev){\n\t\tvar sel = ev.target.value\n\t\tif(sel != \"\" && sel != \"otro\"){\n\t\t\tthis.ajaxGetSubcategories(sel)\n\t\t\tthis.setState({currentCategory:sel})\n\t\t}\n\t\telse{\n\t\t\tthis.setState({subcategories:[]})\n\t\t}\n\t\tthis.setState({'otherCategory': sel == \"otro\" ? true : false,\n\t 'valCategory' : ev.target.value,\n\t 'otherSubCategory': sel == \"otro\" ? true : false});\n\t}", "title": "" }, { "docid": "4a243803dd88ed4c31b9eeb744b8ee3c", "score": "0.54937047", "text": "function assignCategory(category, categoryId) {\r\n\t$(\"#categoriesDropdownMenu\").html('<span class=\"glyphicon glyphicon-tasks\"></span> '+ category +' <span class=\"caret\"></span>' + '<div id=\"categoryIdDiv\" hidden>' + categoryId+ '</div>');\r\n\t\r\n\t//Check the term lists\r\n\tcheckTerm();\r\n}", "title": "" }, { "docid": "103bd3e9eb66c8f59b34075be33b8ed8", "score": "0.54925305", "text": "function updateClicks(cat) {\n cat.clicks++;\n updateClickText(cat);\n}", "title": "" }, { "docid": "888bf883cf4f8f35107b6a0fe26d69b1", "score": "0.5485161", "text": "function updateSubCategory(category_id) {\n //e.preventDefault();\n showLoader();\n $.ajax({\n url: base_url + 'category',\n type: 'post',\n data: {id: category_id},\n success: function (response) {\n if (response.status == \"success\") {\n var data = response.data;\n $('#categories').val(data.parent_id);\n $('#subcategory_id').val(data.id);\n $('#sub_category_title').val(data.name);\n $('#sub_category_description').val(data.description);\n /*$('#cgst').val(data.cgst);\n $('#sgst').val(data.sgst);\n $('#igst').val(data.igst);\n document.getElementById('bv_type').selectedIndex = -1*/\n $('#bv_type').val(response.bv_type);\n if (data.image) {\n var photo_src = media_url + 'category_images/' + data.image;\n $('#photo_id').attr('src', photo_src);\n $('#photo_id').css('display', 'block');\n }\n }\n hideLoader();\n }\n });\n}//end function for update subcategory", "title": "" }, { "docid": "529cae4e326bf2bb67d4b05e9b9db1ea", "score": "0.54837495", "text": "function update() {\n // If label type was changed: clear tags, update cards, and rerender sidebar. Otherwise, just update the cards.\n let currLabelType = labelTypeMenu.getCurrentLabelType();\n if (status.currentLabelType !== currLabelType) {\n clearCurrentTags();\n setStatus('currentLabelType', currLabelType);\n currentTags = tagsByType[currLabelType];\n render();\n }\n sg.cardContainer.updateCardsByFilter();\n updateURL();\n }", "title": "" }, { "docid": "98c23929d66335829d06f345a5f9a335", "score": "0.54834515", "text": "setFeaturedCat(randomCat) {\n this.setState({\n randomCat: randomCat\n })\n }", "title": "" }, { "docid": "3a2c89746dc0461a7ceb937d7f4a239f", "score": "0.548343", "text": "function changeCount(i){\n cats[i].count++;\n $(\"#count\").text(\"Count: \" + cats[i].count);\n}", "title": "" }, { "docid": "76f74413282c15f5bfafb3d25bc89ec8", "score": "0.5477689", "text": "function addCategory( catID, controlID ) {\n\n var categoryString = api.instance(controlID).get();\n var categoryArray = categoryString.split(',');\n\n if ( '' == categoryString ) {\n var delimiter = '';\n } else {\n var delimiter = ',';\n }\n\n // Updates hidden field value.\n if( jQuery.inArray( catID, categoryArray ) < 0 ) {\n api.instance(controlID).set( categoryString + delimiter + catID );\n }\n }", "title": "" }, { "docid": "3201a388595c3328d509e9eda0f9d104", "score": "0.547428", "text": "function selectCat(){\n angular.forEach($scope.categories, function(category){\n if (selectSubcat(category.categories)) {\n $scope.selectedCat = category;\n }\n });\n }", "title": "" }, { "docid": "573524fd99cbcdae2065a4ec78f622f2", "score": "0.54708767", "text": "categoryEditInfo(ctx, params, payload) {\n return new Promise((resolve, reject) => {\n axios\n .get(`admin/category/${params.id}?token=${params.token}`, payload)\n .then(response => {\n ctx.commit(\"SET_CATEGORYINFO\", response.data.data);\n resolve(response);\n })\n .catch(error => {\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "971b831c4b53f9e935e0b7ec01393f8b", "score": "0.5461204", "text": "async update(category, updateSpecs) {\n const obj = this.validator.validate(category, 'update', updateSpecs);\n const errors = [];\n\n const copySpecs = Object.assign({}, updateSpecs);\n const updateId = copySpecs.id;\n delete copySpecs.id;\n\n //Get the object to update\n const updateObj = await this.db.collection(category).find({id: updateId})\n .toArray();\n const toUpdate = Object.assign({}, updateObj[0]);\n\n //Update the found object with the updated fields\n for (const [key, value] of Object.entries(copySpecs)) {\n toUpdate[key] = copySpecs[key];\n }\n\n //Replace the original object in the database with the updated object\n await this.db.collection(category).replaceOne({_id: updateObj[0]._id}, toUpdate);\n\n if (errors.length > 0) throw errors;\n }", "title": "" }, { "docid": "931e131b006567ef486a31e1e434cddc", "score": "0.5450973", "text": "function submitCategory(formObj) {\n let categoryEdit = formObj.getRootNode().host;\n //Check if the new category is duplicate\n let newCategory = categoryEdit.category;\n let duplicate = false;\n storage.categoryArr.forEach((category) => {\n if (\n newCategory.title == category.title &&\n newCategory.color == category.color\n ) {\n duplicate = true;\n }\n });\n\n //Check if new category name is too long\n let tooLong = false;\n let length = newCategory.title.length;\n if (length > 10) {\n tooLong = true;\n }\n let cateEditor = document.querySelector(\"cate-editor-page\");\n\n //Proceed if not duplicate\n //Stop and show error if one constraint is violated\n if (!duplicate && !tooLong) {\n setState(\"backMain\");\n\n // If not called from editBullet, create new bullet\n if (!categoryEdit.old) {\n let newEntry = document.createElement(\"category-entry\");\n let mainPane = document.querySelector(\".category-box\");\n newEntry.category = categoryEdit.category;\n mainPane.appendChild(newEntry);\n storage.addCategory(newEntry);\n }\n // Else if called from editCategory, edit\n else {\n console.log(1);\n storage.editCategory(\n categoryEdit.category,\n lastReferencedElement.category\n );\n lastReferencedElement.category = categoryEdit.category;\n }\n } else if (duplicate && tooLong) {\n cateEditor.duplicate = true;\n cateEditor.lengthViolate = true;\n } else if (duplicate) {\n cateEditor.duplicate = true;\n } else {\n cateEditor.lengthViolate = true;\n }\n}", "title": "" }, { "docid": "2177da94beccfda123cc6c5d4cf1c90c", "score": "0.54411036", "text": "function update_categories_counts(facet_fields, atLeastOneSelected) {\n let category_ids = ['source', 'subject', 'level1', 'level2', 'level3', 'level4', 'year']\n let inputs = []\n for (let index = 0; index < category_ids.length; index++) {\n if (categories_counter[category_ids[index]] > 0 && atLeastOneSelected) {\n continue;\n }\n inputs = $('#' + category_ids[index] + '_div input')\n // convert the array to directory to improve searching on every facet\n let size = facet_fields[category_ids[index]].length\n for (let j = 0; j < size; j++) {\n facet_fields[category_ids[index]][facet_fields[category_ids[index]][j][0]] = facet_fields[category_ids[index]][j][1]\n delete facet_fields[category_ids[index]][j]\n }\n for (let j = 0; j < inputs.length; j++) {\n let text = $(inputs[j]).val()\n $($(inputs[j]).parent().children()[1]).text(facet_fields[category_ids[index]][text])\n }\n }\n}", "title": "" }, { "docid": "be46929065a76bd827fea2b65d86d6b3", "score": "0.54366815", "text": "function manageCategories(){\n var typeSelected = $('.perc-widget-type').val();\n //Get the predefined categories\n var predefinedCategories = [];\n $('.perc-widget-category-predefined').text(function(i, text){\n predefinedCategories[i] = text.toLowerCase();\n });\n\n //Get the custom categories\n var customCategories = [];\n $.each($('.perc-widget-list .perc-widget-tool'), function(i, widget){\n if (typeof($(widget).data('widget').type) != \"undefined\") {\n var type = $(widget).data('widget').type;\n if (type.toLowerCase() === \"custom\"){\n var category = $(widget).data('widget').category;\n if (typeof(category) != \"undefined\"){\n $.each(category.split(\",\"), function(index,value){\n if (value !== \"\" && $.inArray(value, customCategories) === -1) { customCategories.push(value); }\n });\n }\n }\n }\n });\n\n //When change the type selected set all category as default\n var categoryFilter = $('.perc-widget-category');\n categoryFilter.val('all');\n\n //Determine the options for the category filter\n $('.perc-widget-category-custom').remove();\n if (typeSelected === \"all\"){\n $('.perc-widget-category-predefined').show();\n if (customCategories.length>0){\n categoryFilter.append($('<option />').addClass('perc-widget-category-custom').val('other').text('Other'));\n }\n }\n if (typeSelected === \"percussion\" || typeSelected === \"community\"){\n $('.perc-widget-category-predefined').show();\n }\n if (typeSelected === \"custom\"){\n $('.perc-widget-category-predefined').hide();\n $.each(customCategories, function(index, value){\n categoryFilter.append($('<option />').addClass('perc-widget-category-custom').val(value).text(value.charAt(0).toUpperCase() + value.slice(1)));\n });\n }\n }", "title": "" }, { "docid": "906e369391a113f6defcb33ee45bb5a6", "score": "0.5434287", "text": "function updateWhatIfDprogCatYear(data)\n{\n\t// The data structure is as follows:\n\t// {{institutionsData:\n\t// \t\t{instcd,\t\n\t//\t\tcurrentDisplay,\t\n\t//\t\tcurrentValue,\t\t\n\t//\t\t{institutions:\n\t//\t\t\t[{instcd:\n\t//\t\t\t\t{name, code}\n\t//\t\t\t}]\n\t//\t\t},\n\t//\t\tshowInstcd}\n\t// },\n\t// {dprogData:{stratigy:MANUAL}\n\t// }, OR\n\t// {dprogData:\n\t// \t\t{strategy:DROPDOWN,\t\n\t//\t\tauditRequestDegreeLabel,\n\t//\t\tcurrentDisplay,\t\n\t//\t\tcurrentValue,\t\t\n\t//\t\twhatIfDegreeProgram,\n\t//\t\t{dprogOptions:\n\t//\t\t\t[{option:\n\t//\t\t\t\t{name, label}\n\t//\t\t\t}]\n\t//\t\t}}\n\t// }, OR\n\t// {dprogData:\n\t// \t\tstrategy:CASCADE,\t\n\t//\t\tcollege:\n\t//\t\t\t{show,degreeProgram,currentDisplay,currentValue,list[]},\n\t//\t\tmajor:\n\t//\t\t\t{show,degreeProgram,currentDisplay,currentValue,list[]},\n\t//\t\tdegree:\n\t//\t\t\t{show,degreeProgram,currentDisplay,currentValue,list[]},\n\t//\t\tcurrentDisplay,\t\n\t//\t\tcurrentValue,\t\t\n\t//\t\twhatIfDegreeProgram,\n\t//\t\t{dprogOptions:\n\t//\t\t\t[{option:\n\t//\t\t\t\t{name, label}\n\t//\t\t\t}]\n\t//\t\t}}\n\t// },\n\t// {catalogYearTermValues:\n\t// \t\t{catalogYearTerm,\n\t//\t\tcurrentDisplay,\n\t//\t\tcurrentValue,\n\t//\t\tmultiCatalogYearTermsConfigured,\n\t//\t\t{catalogYearTerms:\n\t//\t\t\t[{catalogYearTerm:\n\t//\t\t\t\t{label, name}\n\t//\t\t\t}]\n\t//\t\t},\n\t//\t\tclearAll}\n\t// },\n\t// {markerTree:\n\t// \t\t{{markers:\n\t//\t\t\t[{marker:\n\t//\t\t\t\t{label, element, isFirstDprogType, isRequired, intSeqNo, actualChildren[...], possibleChildren[...]}\n\t//\t\t\t}]\n\t// \t\t},\n\t// \t\twetaValue,\n\t// \t\twetaIntSeqNo,\n\t// \t\twetaElement,\n\t// \t\tcatalogYear,\n\t// \t\twetaLabel,\n\t// \t\twetaDisplayLabel,\n\t// \t\twetaDisplayCatalogYear,\n\t// \t\tcatalogYearTerm,\n\t// \t\twhatIfDegreeProgram, \n\t// \t\tauditDelimiter,\n\t// \t\t{udirectMarkers: \n\t// \t\t\t[{udirectMarker: \n\t//\t\t\t\t{markerValue, replacementValue, type, catalogYear} \n\t//\t\t\t}] \n\t// \t\t}}\n\t// }}\n\t\n\tvar htmlBuffer = [];\n\tvar showBreadCrumb = false;\n\tvar disableAudit = needsRequiredMarkers(data.markerTree);\n\thtmlBuffer.push('<table class=\"verticalListing\">');\n\tif (data.catalogYearTermValues.catalogYearTerm.length > 0 && data.dprogData.whatIfDegreeProgram.length > 0) {\n\t\tshowBreadCrumb = true;\n\t}\n\tif (data.dprogData.strategy == \"MANUAL\") {\n\t\tshowBreadCrumb = false;\n\t}\n\thtmlBuffer.push(updateWhatIfTop(data.institutionsData, showBreadCrumb));\n\thtmlBuffer.push('<tr style=\"border-bottom:0px\"><th><label for=\"whatIfDegreeProgram\">');\n\thtmlBuffer.push(data.dprogData.auditRequestDegreeLabel);\n\thtmlBuffer.push('</label></th><td>');\n\tif (data.dprogData.strategy == \"MANUAL\") {\n\t\thtmlBuffer.push('<input type=\"text\" class=\"form-control\" name=\"whatIfDegreeProgram\" id=\"whatIfDegreeProgram\" ');\n\t\tif (data.dprogData.length > 0) {\n\t\t\thtmlBuffer.push('value=\"' + data.dprogData.whatIfDegreeProgram + '\"');\n\t\t}\n\t\thtmlBuffer.push(' />');\n\t\thtmlBuffer.push('<input type=\"hidden\" name=\"disableAudit\" id=\"disableAudit\" value=\"false\">');\n\t} else if (data.dprogData.strategy == \"DROPDOWN\") {\n\t\tif (showBreadCrumb) {\t\t\t\t\t\t\t\t\t\t\n\t\t\thtmlBuffer.push('<input type=\"hidden\" name=\"disableAudit\" id=\"disableAudit\" value=\"' + disableAudit + '\">');\n\t\t}\n\t\thtmlBuffer.push(updateDropdown(data.dprogData, showBreadCrumb));\t\n\t} else {\n\t\thtmlBuffer.push(updateCascade(data.dprogData, showBreadCrumb));\t\t\t\t\n\t}\n\thtmlBuffer.push('</td></tr>' + updateWhatIfBottom(data.catalogYearTermValues, showBreadCrumb, disableAudit) +\t'</table>');\n\thtmlBuffer.push('<ul class=\"markerButtonUL\"></ul>');\n\t$j( 'td.left' ).html(htmlBuffer.join(''));\n}", "title": "" }, { "docid": "f2646c19964364034c740975e608ca1e", "score": "0.5432219", "text": "updateData() {\n let targetUrl = window.location.origin + \"/\";\n let ball = this.state.ball;\n\n targetUrl += this.parseCategory();\n\n fetch(targetUrl,\n {\n method: 'PUT',\n mode: 'cors',\n body: JSON.stringify({\n \"amount\": ball.amount,\n \"color\": ball.color,\n \"name\": ball.name,\n \"weigth\": ball.weigth,\n \"details\": ball.details,\n \"material\": ball.material,\n \"manufacturer\": ball.manufacturer,\n \"shortDetails\": ball.shortDetails,\n \"type\": ball.type,\n \"price\": ball.price\n })\n })\n .then(function (response) {\n return response;\n })\n .catch(function (error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "a11532e1435b09180bb79aefe0eb0dc9", "score": "0.54270947", "text": "set category(newCategory) {\n this.shadowRoot.getElementById(\"category-title\").innerText =\n newCategory.title;\n this.shadowRoot.getElementById(\"color\").value =\n newCategory.color;\n if (newCategory.color == \"Red\") {\n this.shadowRoot.querySelector(\n \".category-inner-entry\"\n ).style.backgroundColor = \"rgba(224, 90, 70,0.5)\";\n this.shadowRoot.getElementById(\n \"cate-edit\"\n ).style.backgroundColor = \"#ebd8d5\";\n } else if (newCategory.color == \"Yellow\") {\n this.shadowRoot.querySelector(\n \".category-inner-entry\"\n ).style.backgroundColor = \"rgba(229, 191, 106,0.5)\";\n this.shadowRoot.getElementById(\n \"cate-edit\"\n ).style.backgroundColor = \"#ebe5d5\";\n } else if (newCategory.color == \"Blue\") {\n this.shadowRoot.querySelector(\n \".category-inner-entry\"\n ).style.backgroundColor = \"rgba(167, 200, 220,0.925)\";\n } else if (newCategory.color == \"Orange\") {\n this.shadowRoot.querySelector(\n \".category-inner-entry\"\n ).style.backgroundColor = \"rgba(224, 138, 87,0.5)\";\n this.shadowRoot.getElementById(\n \"cate-edit\"\n ).style.backgroundColor = \"#ebdfd5\";\n }else if (newCategory.color == \"Green\") {\n this.shadowRoot.querySelector(\n \".category-inner-entry\"\n ).style.backgroundColor = \"rgba(42, 157, 143,0.5)\";\n this.shadowRoot.getElementById(\n \"cate-edit\"\n ).style.backgroundColor = \"#d5ebd7\";\n }\n\n this.shadowRoot.getElementById(\"category-check\").checked =\n newCategory.checked;\n }", "title": "" }, { "docid": "76135e3aa3219fe7271efd8751e5fa77", "score": "0.54209614", "text": "function updatePercentages(value, categoryID) {\n setPercentages({\n ...percentages,\n [categoryID]: value,\n });\n }", "title": "" }, { "docid": "a14c95a7eda87a5f1f1d858800b9f87e", "score": "0.5417848", "text": "setCategory() {\r\n phraseCategory.textContent = this.category;\r\n }", "title": "" }, { "docid": "5746f799d8309b4dccfbe6d1862b8e41", "score": "0.54157495", "text": "function updateSubCategorySelect()\r\n{\r\n\tconsole.log('updateSubCategorySelect called');\r\n\t\r\n\tvar $page = $('#pageWhat');\r\n\tvar $selectCategory = $('#selectCategory');\r\n\tvar $selectSubCategory = $('#selectSubCategory');\r\n\tvar $selectSubCategoryContainer = \r\n\t\t$('#selectSubCategoryContainer');\r\n\tvar selectedCategoryID = \r\n\t\t$('option:selected', $selectCategory ).attr('value');\r\n\t\r\n\tvar $warningContainers = $('div.warningContainer', $page );\r\n\t\t\r\n\t$warningContainers.hide();\r\n\t\r\n\t// Empty the content of the subcategory select element\r\n\t$selectSubCategory.empty();\t\r\n\t\r\n\t// If no macro category is selected then\r\n\t// hide the subcategory select element\r\n\tif( selectedCategoryID == -1 )\r\n\t{\r\n\t\t$selectSubCategoryContainer.hide();\r\n\t\treturn ;\r\n\t}\r\n\t\r\n\tvar dataProvider = DataProvider.getInstance();\r\n\t// Query the dataProvider in order to get info related to subcategories\r\n\tdataProvider.getSubCategories({\r\n\t\tcategoryID: selectedCategoryID,\r\n\t\tsuccess: \r\n\t\t\tfunction( category )\r\n\t\t\t{\r\n\t\t\t\tvar defaultSelectSubCategoryChoise =\r\n\t\t\t\t\t'<option value=\"-1\" data-placeholder=\"true\">' +\r\n\t\t\t\t\t'Tutte le categorie...</option>';\r\n\t\t\t\t$selectSubCategory.append( defaultSelectSubCategoryChoise );\r\n\t\t\t\t\r\n\t\t\t\t// For each subcategory create a new option element and\r\n\t\t\t\t// append it to the select element\r\n\t\t\t\t$.each( category.getSubcategories(), \r\n\t\t\t\t\tfunction( index, subcategory )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar newOptionElement = \r\n\t\t\t\t\t\t\t'<option value=\"' + subcategory.getID() + '\">' \r\n\t\t\t\t\t\t\t\t+ subcategory.getName() + '</option>';\r\n\t\t\t\t\t\t$selectSubCategory.append( newOptionElement );\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t// Update the subcategory select element\r\n\t\t\t\t$selectSubCategory.selectmenu('refresh');\r\n\t\t\t\t\r\n\t\t\t\t// Every time the user chooses a different subcategory\r\n\t\t\t\t// empty the warning div\r\n\t\t\t\t$selectSubCategory.bind(\"change\", function()\r\n\t\t\t\t{\r\n\t\t\t\t\tvar $page = $('#pageWhat');\r\n\t\t\t\t\tvar $warningContainer =\r\n\t\t\t\t\t\t$('div.warningContainer', $page );\r\n\t\t\t\r\n\t\t\t\t\t$warningContainer.hide();\r\n\t\t\t\t});\t\r\n\r\n\t\t\t\t// Show the div containing the subcategory select element\r\n\t\t\t\t$selectSubCategoryContainer.show();\r\n\t\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "fb15da63fe67c362e51920c9c5e8a327", "score": "0.541533", "text": "async editCategory(type, name, pk) {\n const token = window.sessionStorage.getItem('token');\n\n let data = {\n name: name,\n }\n\n let result = {\n success: true,\n errors: {}\n }\n\n let path = this.typeToPath(type);\n if (path === '') {\n console.error(`Can't get ${type} category, check the getCategories method in categoryServices`);\n let result = {\n success: false,\n data: [],\n errors: []\n }\n return result;\n }\n\n return fetch(`${API_URL}/api/${path}/${pk}/`, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `JWT ${token}`\n },\n body: JSON.stringify(data)\n })\n .then(res => {\n if (res.ok) {\n return result;\n } else {\n return res.json().then(async (json) => {\n return await checkBadResponse(json, result);\n });\n }\n })\n }", "title": "" }, { "docid": "1e1d2c67df2bf44d5ae237c2d3738fae", "score": "0.5414651", "text": "handleCategoryChange(event){\n\t\tthis.setState({category: event.target.value});\n\t}", "title": "" }, { "docid": "2ff52b01ee543906a4f9e02b9c51cf09", "score": "0.541123", "text": "function updateChart(subcategoryChart, labels, data) {\n subcategoryChart.data.labels = labels;\n subcategoryChart.data.datasets[0].data = data;\n\n subcategoryChart.update();\n // debugger\n}", "title": "" }, { "docid": "0c733bd479cd1f786df1967ee2ac3d62", "score": "0.5406004", "text": "toggleCategoryVisibility(category){\n var isExpanded = this.state.expandedCategories[category];\n this.state = State.changeState(\n this.state,\n State.updateCategoryVisibility(category, !isExpanded)\n );\n }", "title": "" }, { "docid": "d2595ff2f809d826f4f67f8b2f48fa5f", "score": "0.53953165", "text": "function onChangeCategoryClick(){\r\n\t\t\r\n\t\tvar objButton = jQuery(this);\r\n\r\n\t\tvar action = objButton.data(\"action\");\r\n\t\tvar layoutID = objButton.data(\"layoutid\");\r\n\t\t\r\n\t\tvar catID = objButton.data(\"catid\"); \r\n\t\tcatID = parseInt(catID);\r\n\t\t\r\n\t\topenManageCategoryDialog(layoutID, catID);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "62f12a241af59f6175781955b3e30e7e", "score": "0.5390376", "text": "function editCategory(data_id, data_catname, data_catmemo) {\n $.ajax({\n url: \"/intsys/kb/main/editCategory\",\n method: \"POST\",\n data: {\n data_id: data_id,\n data_catname: data_catname,\n data_catmemo: data_catmemo\n },\n beforeSend: function () {\n\n },\n success: function (res) {\n\n $('#spinner').fadeIn(500);\n $('#spinner').html('<div class=\"alert alert-success\" role=\"alert\">แก้ไขข้อมูลเรียบร้อยแล้ว</div>');\n $('#spinner').fadeOut(3000);\n $('#cat_name').val('');\n $('#cat_memo').val('');\n $('#cat_autoid').val('');\n $('#btn_addCategory').text('เพิ่มหมวดหมู่');\n $('#btn_addCategory').removeClass(\"button-amber\").addClass(\"button-dirtygreen\");\n loadCategory();\n $('#tb_category').dataTable();\n }\n });\n}", "title": "" } ]
e2d43865d4d0bc40c212745d2f43218b
Given the .Net ticks of a date, convert it to a Date
[ { "docid": "1f4c41cc151b9a1d89712d50bb70d627", "score": "0.7073096", "text": "function getDateFromDotNetTicks(dotNetTicks) {\n 'use strict';\n if (!dotNetTicks) {\n return null;\n }\n var ticksInMilliseconds = (dotNetTicks / 10000) - TICKS_CONVERSION_CONSTANT;\n return new Date(ticksInMilliseconds);\n}", "title": "" } ]
[ { "docid": "ea34b2e9f0739e5596932c37b5f39716", "score": "0.7231147", "text": "function getDateFromDotNetTicks(dotNetTicks) {\n\t\t 'use strict';\n\t\t if (!dotNetTicks) {\n\t\t return null;\n\t\t }\n\t\t var ticksInMilliseconds = (dotNetTicks / 10000) - TICKS_CONVERSION_CONSTANT;\n\t\t return new Date(ticksInMilliseconds);\n\t\t}", "title": "" }, { "docid": "8d60e8e214468fb3a7df87bb4abbe7c3", "score": "0.6326704", "text": "function convertDate(date)\n\t{\n\t\treturn new Date(parseInt(date.replace('/Date(', '')));\n \t}", "title": "" }, { "docid": "1ea99fd68b703f0df5bc29c27483f915", "score": "0.6194675", "text": "function date2Date(date1){\n\tvar dateParts = date1.split(\".\");\n\treturn new Date(parseInt(dateParts[2]), (parseInt(dateParts[1]) - 1), dateParts[0]);\n}", "title": "" }, { "docid": "1591c8563647acddc4a09823de0ebc49", "score": "0.6174294", "text": "function convertDate(date) {\n let match = date.split('.')[0].match(/^(\\d+)-(\\d+)-(\\d+) (\\d+)\\:(\\d+)\\:(\\d+)$/)\n return new Date(match[1], match[2] - 1, match[3], match[4], match[5], match[6]).getTime()/1000\n}", "title": "" }, { "docid": "8c85b0a728e187c59b97c629e33b8ab8", "score": "0.59955335", "text": "function toDate (date) {\n if (date instanceof Date) {\n return date\n }\n return new Date(date)\n}", "title": "" }, { "docid": "7a1b901a34bce17f81a8f8ef25a2398c", "score": "0.59202904", "text": "function normalDate(unixDate) {\n return new Date(Number(unixDate) * 1000);\n }", "title": "" }, { "docid": "d7bbfc9aaa7017f28e1535eaae7cca90", "score": "0.58057207", "text": "function convertToDate(date) {\r\n return new Date(date.replace(/(\\d{2})-(\\d{2})-(\\d{4})/, \"$2/$1/$3\"));\r\n}", "title": "" }, { "docid": "001a4395f379f5a48382ee865192cc99", "score": "0.5789625", "text": "function convertDate(date) {\n var day = ('0' + date.getDate()).slice(-2);\n var month = ('0' + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear();\n return year + '/' + month + '/' + day;\n}", "title": "" }, { "docid": "05ef410a6a11c5101c240a60de463a67", "score": "0.56817967", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.56756574", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.56756574", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.56756574", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "c73ec3508c9d76fa7f7ce9c1df889199", "score": "0.56715125", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[/* __read */ \"c\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "0375ec5a1e72f4f491ab762fd2522ce2", "score": "0.5657253", "text": "function convertDate(unixTime) {\n\n var date = new Date(unixTime*1000),\n yyyy = date.getFullYear(),\n mm = ('0' + (date.getMonth() + 1)).slice(-2),\n dd = ('0' + date.getDate()).slice(-2),\n\n convertedDate = mm + \"/\" + dd + \"/\" + yyyy\n return convertedDate\n }", "title": "" }, { "docid": "98093f7eae6cad9dfdfc0974bde6bca6", "score": "0.560807", "text": "function fromJSDate(date){\n // Remove the millisecond time component\n return new Simple('+' + date.toISOString().replace(/\\.\\d{3}/,''));\n}", "title": "" }, { "docid": "98093f7eae6cad9dfdfc0974bde6bca6", "score": "0.560807", "text": "function fromJSDate(date){\n // Remove the millisecond time component\n return new Simple('+' + date.toISOString().replace(/\\.\\d{3}/,''));\n}", "title": "" }, { "docid": "f162d5b9ad857b0f26b4a75dfbb8d3e9", "score": "0.56077385", "text": "function convertDate(date) {\n\n var _date = new Date(date);\n var day = _date.getDate();\n\n if (day < 10) {\n day = \"0\" + day;\n }\n\n var month = _date.getMonth() + 1;\n\n if (month < 10) {\n month = '0' + month;\n }\n\n var year = _date.getFullYear();\n return day + \"/\" + month + \"/\" + year;\n}", "title": "" }, { "docid": "ed6659f26d56c93f85c848fd0baa5c6d", "score": "0.55924094", "text": "function convertDate(epochdate) {\n let myDate = new Date(epochdate * 1000);\n return myDate.toLocaleString();\n}", "title": "" }, { "docid": "5c29ed6f63a74d5378c5b3fba7770a20", "score": "0.5585792", "text": "function newDate(x) {\n return new Date(x);\n }", "title": "" }, { "docid": "329ea3702ed381259f4052a43911677d", "score": "0.55755323", "text": "function epochToJsDate(ts){\n // ts = epoch timestamp\n // returns date obj\n return new Date(ts*1000);\n}", "title": "" }, { "docid": "0869c1eb110ba7bdb85bd3c5852e0b4c", "score": "0.55669814", "text": "function dateToEpoch(date){\n return parseInt(date.getTime(),10) / 1000;\n }", "title": "" }, { "docid": "b55a860a25e8dd7699b2a7aed5be5180", "score": "0.55510026", "text": "function transformarAObjetoFecha(fecha){\n datosFecha = fecha.split(\"-\");\n return new Date(datosFecha[0], datosFecha[1], datosFecha[2]);\n}", "title": "" }, { "docid": "b55a860a25e8dd7699b2a7aed5be5180", "score": "0.55510026", "text": "function transformarAObjetoFecha(fecha){\n datosFecha = fecha.split(\"-\");\n return new Date(datosFecha[0], datosFecha[1], datosFecha[2]);\n}", "title": "" }, { "docid": "e7dc0b89f328a8269cd05cd1757c5377", "score": "0.55258137", "text": "function msdos2date(time, date) {\n // MS-DOS Date\n // |0 0 0 0 0|0 0 0 0|0 0 0 0 0 0 0\n // D (1-31) M (1-23) Y (from 1980)\n const day = date & 0x1F;\n // JS date is 0-indexed, DOS is 1-indexed.\n const month = ((date >> 5) & 0xF) - 1;\n const year = (date >> 9) + 1980;\n // MS DOS Time\n // |0 0 0 0 0|0 0 0 0 0 0|0 0 0 0 0\n // Second Minute Hour\n const second = time & 0x1F;\n const minute = (time >> 5) & 0x3F;\n const hour = time >> 11;\n return new Date(year, month, day, hour, minute, second);\n }", "title": "" }, { "docid": "d7efd9b65d2738b875298e1a3e8f64a9", "score": "0.54876345", "text": "convertToDate(inputParams) {\n\t\ttry {\n\t\t\tif (!inputParams) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst timeStamp = parseInt(inputParams, 10);\n\t\t\tif (_.isNumber(timeStamp)) {\n\t\t\t\treturn new Date(timeStamp);\n\t\t\t}\n\t\t\treturn new Date(inputParams);\n\t\t} catch (e) {\n\t\t\treturn null;\n\t\t}\n\t}", "title": "" }, { "docid": "28f83c4f0f731263958887fa25805a2e", "score": "0.5485", "text": "function dateDataToMsSince1970(dateData) {\n var ticksSince1970 = $jsilcore.System.UInt64.op_Subtraction(dateData, ymdToTicks(1970, 1, 1));\n var msSince1970_uint64 = $jsilcore.System.UInt64.op_Division(ticksSince1970, $jsilcore.System.UInt64.FromInt32(10000)); //10000 ticks in 1 millisecond\n return msSince1970_uint64.valueOf();\n }", "title": "" }, { "docid": "a3df34c7d1620cae23e2913accb57ad4", "score": "0.54833806", "text": "function toDate$1(value) {\n if (isDate$2(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = __read(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX$1)) {\n return isoStringToDate$1(match);\n }\n }\n var date = new Date(value);\n if (!isDate$2(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n }", "title": "" }, { "docid": "2232b64dc3dcbcaa80ef05b51cf1ad76", "score": "0.546443", "text": "convertFromUTC(date = new StemDate()) {\n const parts = this.defaultFormatter.formatToParts(date);\n\n let dateValues = {};\n for (const part of parts) {\n if (parts.type !== \"literal\") {\n dateValues[part.type] = parseInt(part.value);\n }\n }\n\n let newDate = new StemDate(dateValues.year, dateValues.month - 1, dateValues.day, dateValues.hour, dateValues.minute, date.getSeconds(), date.getMilliseconds());\n newDate.timezone = this;\n return newDate;\n }", "title": "" }, { "docid": "be966fee9fd0fe501dbc6f6f40031c44", "score": "0.5460413", "text": "function convertFromCustom(date) {\n return new Date(Date.parse(date.replace(/-/g,' ')));\n}", "title": "" }, { "docid": "a7300b3edaba782e457a3f497bce8d87", "score": "0.54385644", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "a7300b3edaba782e457a3f497bce8d87", "score": "0.54385644", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "a7300b3edaba782e457a3f497bce8d87", "score": "0.54385644", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "a7300b3edaba782e457a3f497bce8d87", "score": "0.54385644", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "a7300b3edaba782e457a3f497bce8d87", "score": "0.54385644", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "5a09a3f11ad2a6c1a25a2388ed3cdb7b", "score": "0.54256696", "text": "function convertDate(time_) {\r\n const time = new Date(time_);\r\n const day = time.getDate();\r\n const month = time.getMonth();\r\n const year = time.getFullYear();\r\n const hour = time.getHours() - 1;\r\n const minutes = time.getMinutes();\r\n const seconds = time.getSeconds();\r\n const milliseconds = time.getMilliseconds();\r\n return Date.UTC(year, month, day, hour+1, minutes, seconds, milliseconds)\r\n}", "title": "" }, { "docid": "193ab390e87bfa082e588db788e3879e", "score": "0.54248786", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return new Date(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "bbaf920d6997da4c266130679efa52b9", "score": "0.54232466", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m, d] = value.split('-').map((val) => +val);\n return new Date(y, m - 1, d);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "bbaf920d6997da4c266130679efa52b9", "score": "0.54232466", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m, d] = value.split('-').map((val) => +val);\n return new Date(y, m - 1, d);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "bbaf920d6997da4c266130679efa52b9", "score": "0.54232466", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m, d] = value.split('-').map((val) => +val);\n return new Date(y, m - 1, d);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "bbaf920d6997da4c266130679efa52b9", "score": "0.54232466", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m, d] = value.split('-').map((val) => +val);\n return new Date(y, m - 1, d);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "0a762190a6998532cf88a6ec5c89f1de", "score": "0.53940713", "text": "function toDate(time) {\n\treturn new Date(time * 1000);\n}", "title": "" }, { "docid": "44fefcea51c7083a2116f8947092ce88", "score": "0.5360715", "text": "function epochToDate(epochTime) {\n // new Date() takes milliseconds, but our epochTime in seconds, so multiply by 1000\n return new Date(epochTime*1000);\n }", "title": "" }, { "docid": "5e05be82371fb0bf750087548e05e076", "score": "0.53409535", "text": "function JSON_Date_reviver2(value) {\n return new Date(value);\n}", "title": "" }, { "docid": "060bcfbbeb81f7aae9be834bb5ffb923", "score": "0.5340805", "text": "toNativeDate(date) {\n return new Date(date.year, date.month - 1, date.day);\n }", "title": "" }, { "docid": "572b45574c337c4ddd96db7e0421631f", "score": "0.5336227", "text": "function _osdate_from_epoch(intEpoch, intTime)\r\n{\r\n\tif(intTime==undefined)intTime=0;\r\n\r\n\tvar dDate = new Date();\r\n\tif(intEpoch!=undefined)\r\n\t{\r\n\t\tvar mEpoch = parseInt(intEpoch); \r\n\t\tif(mEpoch<10000000000) mEpoch *= 1000; // convert to milliseconds (Epoch is usually expressed in seconds, but Javascript uses Milliseconds)\r\n\t\tdDate.setTime(mEpoch)\r\n\t}\r\n\r\n\t//-- check if we need to set time of day\r\n\tif(intTime==1)\r\n\t{\r\n\t\tdDate = _set_date_sod(dDate);\r\n\t}\r\n\telse if(intTime==2)\r\n\t{\r\n\t\tdDate = _set_date_eod(dDate);\r\n\t}\r\n \r\n\treturn dDate;\r\n}", "title": "" }, { "docid": "572b45574c337c4ddd96db7e0421631f", "score": "0.5336227", "text": "function _osdate_from_epoch(intEpoch, intTime)\r\n{\r\n\tif(intTime==undefined)intTime=0;\r\n\r\n\tvar dDate = new Date();\r\n\tif(intEpoch!=undefined)\r\n\t{\r\n\t\tvar mEpoch = parseInt(intEpoch); \r\n\t\tif(mEpoch<10000000000) mEpoch *= 1000; // convert to milliseconds (Epoch is usually expressed in seconds, but Javascript uses Milliseconds)\r\n\t\tdDate.setTime(mEpoch)\r\n\t}\r\n\r\n\t//-- check if we need to set time of day\r\n\tif(intTime==1)\r\n\t{\r\n\t\tdDate = _set_date_sod(dDate);\r\n\t}\r\n\telse if(intTime==2)\r\n\t{\r\n\t\tdDate = _set_date_eod(dDate);\r\n\t}\r\n \r\n\treturn dDate;\r\n}", "title": "" }, { "docid": "e92ddf3d2ccd2ab3ec15c216d8c7d07c", "score": "0.53301084", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = __read(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n }", "title": "" }, { "docid": "9537dd1a41d83f81162af96afeb7332b", "score": "0.53113574", "text": "toDate(date) {\n if (date === undefined || date === null) {\n return null;\n }\n const dateParts = date.split(/\\D+/);\n if (dateParts.length === 7) {\n return new Date(dateParts[0], dateParts[1] - 1, dateParts[2], dateParts[3], dateParts[4], dateParts[5], dateParts[6]);\n }\n if (dateParts.length === 6) {\n return new Date(dateParts[0], dateParts[1] - 1, dateParts[2], dateParts[3], dateParts[4], dateParts[5]);\n }\n return new Date(dateParts[0], dateParts[1] - 1, dateParts[2], dateParts[3], dateParts[4]);\n }", "title": "" }, { "docid": "eb93ae25e878974d08a9cb25de561593", "score": "0.53110737", "text": "function convertEpoch(postDate)\n{\n result = new Date(postDate);\n return result.toLocaleString();\n}", "title": "" }, { "docid": "56d49789b17dd06e0537425dcf563765", "score": "0.5304492", "text": "function toDate1(date)\n {\n var day = date.getUTCDate();\n var month = date.getUTCMonth();\n var year = date.getUTCFullYear();\n\n var rv = (day < 10) ? '0' + day : day;\n rv += ' ' + monthStrings[month];\n rv += ' ' + year;\n\n return rv;\n }", "title": "" }, { "docid": "18871dad7d7c8f136214e478ec58c876", "score": "0.5283956", "text": "function dateToTimestamp(date) {\n return Math.round(date.getTime() / 1000) \n}", "title": "" }, { "docid": "774a1ce6ca8ebbdcd962fc271a034c98", "score": "0.52806365", "text": "function date(data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n}", "title": "" }, { "docid": "1d2a595700c63e4f9e021a8a29111201", "score": "0.52786165", "text": "function toDate(s) {\n if (s instanceof Date) {\n return s;\n }\n if (typeof s === \"number\") {\n return new Date(s);\n }\n var parts = s.split(\"-\");\n return new Date(parseInt(parts[0], 10), parseInt(parts[1], 10) - 1, parseInt(parts[2], 10));\n}", "title": "" }, { "docid": "9fe2feaa22c7e16b4f4a517173eb171a", "score": "0.52664715", "text": "function anyToDate(value) {\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isDate\"](value)) {\n // TODO maybe don't create a new Date ?\n return new Date(value);\n } else if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](value)) {\n return new Date(value);\n } else {\n // Try converting to number (assuming timestamp)\n var num = Number(value);\n\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](num)) {\n return new Date(value);\n } else {\n return new Date(num);\n }\n }\n }", "title": "" }, { "docid": "09a538716f5c808babcd2169d551cf11", "score": "0.5259915", "text": "function anyToDate(value) {\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isDate\"](value)) {\n // TODO maybe don't create a new Date ?\n return new Date(value);\n }\n else if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](value)) {\n return new Date(value);\n }\n else {\n // Try converting to number (assuming timestamp)\n var num = Number(value);\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](num)) {\n return new Date(value);\n }\n else {\n return new Date(num);\n }\n }\n}", "title": "" }, { "docid": "037221bfe1773910fa697cbb228500be", "score": "0.5257841", "text": "function valueToDate(value) {\n // FIXME: Work-around for <https://bugtrack.marklogic.com/31445>\n var out = value;\n try { \n out = value.toObject(); \n } catch(err) { /* Swallow */ }\n return out;\n //if(value instanceof Value) {\n // return new Date(value.toObject());\n //}\n //return value;\n}", "title": "" }, { "docid": "f945fcc8f8de921b5dad18dbf95ccbae", "score": "0.5244677", "text": "function convertMilliSecsToDate(){\n\tvar today = new Date();\n\tvar milli = today.getTime();\n\tvar myDate = new Date(milli);\n\tconsole.log(myDate.toString());\n}", "title": "" }, { "docid": "fee540f3db5633298f632fd2da51497d", "score": "0.5242483", "text": "function ticksSinceYearZero(ticks){\n return ticks * 10000 + 621355968000000000;\n }", "title": "" }, { "docid": "c6a596d95ecb8657448be67f33de6665", "score": "0.52292234", "text": "function toDate(a){\n\n if( a instanceof Date) return a;\n if( typeof a === 'string') a = a.split(':');\n if( a.length < 3 ) a[2] = 0;\n\n return setHMS(new Date(), +a[0], +a[1], +a[2]);\n }", "title": "" }, { "docid": "839d2a6e7018a47d65d092fd082e32b2", "score": "0.52204984", "text": "function date (data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n }", "title": "" }, { "docid": "2abc88be65f350e2a8a36598c5088798", "score": "0.5207259", "text": "function test27() {\n const date1 = new Date(Date.UTC(96, 1, 2, 3, 4, 5));\n\n console.log(date1.valueOf());\n // expected output: 823230245000\n\n const date2 = new Date('02 Feb 1996 03:04:05 GMT');\n\n console.log(date2.valueOf());\n // expected output: 823230245000\n\n}", "title": "" }, { "docid": "d012852ffded22917abae3397aba002d", "score": "0.51966536", "text": "function date_From_Unix_Time_Number(unix_TimeStamp) {\n const unix_Day = 86400;\n const unix_Hour = 3600;//unix_Day / 24 = 86400 / 24;\n const unix_Minute = 60;//unix_Hour / 60;\n const unix_Second = 1;//unix_Minute / 60\n var days_Before_Epoch = 0;// if unix_TimeStamp < 0\n var days_After_Epoch = 0;// if unix_TimeStamp >= 0\n // The Unix `epoch` is \n // the time 00:00:00 UTC on 1 January 1970.\n const unix_Epoch = new Date(0);\n //Thu Jan 01 1970 05:00:00 GMT+0500 (SVET)\n //var n = d.toDateString();\n // The result of n will be:\n //Wed Feb 10 2016\n // millisecond -> one thousandth of a second\n \n return new Date(unix_TimeStamp * 1000);\n}", "title": "" }, { "docid": "86361d2e882e058d3c1e0761526c3001", "score": "0.5185738", "text": "function toDate (input) {\n if (input instanceof Date) {\n return input\n };\n if (!isNaN(input)) {\n return new Date(toInt(input))\n }\n if (/^\\d+$/.test(input)) {\n return new Date(toInt(input))\n }\n input = (input || '').trim().replace(/\\.\\d+/, '') // remove milliseconds\n .replace(/-/, '/').replace(/-/, '/')\n .replace(/(\\d)T(\\d)/, '$1 $2').replace(/Z/, ' UTC') // 2017-2-5T3:57:52Z -> 2017-2-5 3:57:52UTC\n .replace(/([+-]\\d\\d):?(\\d\\d)/, ' $1$2') // -04:00 -> -0400\n return new Date(input)\n}", "title": "" }, { "docid": "a0ae332542763d45447ac7b7ddd3f825", "score": "0.51810735", "text": "function date(data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n }", "title": "" }, { "docid": "db7b2648ace98166dd8f803de3222c5e", "score": "0.51727045", "text": "function convertDates(data){\n data.forEach(function(d,i){\n d['parsedDate'] = new Date(d['Event Start Time UTC']);\n });\n return data;\n}", "title": "" }, { "docid": "52f3e6cb1ee06b606d0375f95cc3178f", "score": "0.51615906", "text": "function convertDate(date){\n var split = date.split(\";\");\n var endTime = split[split.length-1];\n var startDate = date.split(\"&\")[0];\n split = startDate.split(\",\");\n var startTime = split[split.length-1]; \n var day = split[0] + \",\"+ split[1] + \",\" + split[2]; //Thursday, March 16, 2015\n startDate = day + \" \" + convertTime(startTime); \n var endDate = day + \" \" + convertTime(endTime); \n return [new Date(startDate),new Date(endDate)];\n}", "title": "" }, { "docid": "2f9d07660ce4b570e8e70b4823386f12", "score": "0.5161443", "text": "function dateToInt (s) { return new Date(s).getTime()}", "title": "" }, { "docid": "c89c234a73a8a27cde1e96b89fb05321", "score": "0.5158456", "text": "function _convertDates(input) {\n if (!angular.isObject(input)) {\n return input;\n }\n angular.forEach(input, function (value, key) {\n if (_isDate(value)) {\n input[key] = new Date(value);\n } else if (angular.isObject(value)) {\n _convertDates(value);\n }\n });\n }", "title": "" }, { "docid": "27985e5f0bc68f2a3ad6afdf30d78626", "score": "0.51478094", "text": "function createDateFromSerial(serialNum) {\n return serialNum * 86400000 - 2209132800000;\n }", "title": "" }, { "docid": "f871553e2bbfc20b1f5143a4ad546752", "score": "0.5143322", "text": "function DateValue(year, month, date, hours, minutes, seconds, ms){\n return new Date(year, month, date, hours, minutes, seconds, ms).valueOf();\n}", "title": "" }, { "docid": "1ce0b4e32a52b9d7000e02b263bb2550", "score": "0.51039577", "text": "function convertDate(time){\n const date = new Date(time).toLocaleDateString('en-US');\n return date;\n}", "title": "" }, { "docid": "e189cba54de248e630031f4e1c62e54b", "score": "0.50922257", "text": "function milliToDate(value){\n var oval = value;\n var ms = value % 1000;\n value = (value-ms)/1000;\n var sec = value % 60;\n value = (value-sec)/60;\n var min = value % 60;\n return new Date(0,0,0,0,min,sec);\n}", "title": "" }, { "docid": "5cf57685d618c5e6ca041491db4d437d", "score": "0.50857013", "text": "function convertDate(tt){\n\t\t\ttt = tt.trim().split('');\n\t\t\tvar pi = [];\n\t\t\tvar no = 0;\n\t\t\tvar cc = '';\n\t\t\tfor ( var t in tt){\n\t\t\t\tcc = tt[t].charCodeAt(0);\n\t\t\t\tif(cc >= 48 && cc <= 57 || cc >= 65 && cc <= 90 || cc >= 97 && cc <= 122){\n\t\t\t\t\tif(pi[no] === undefined){\n\t\t\t\t\t\tpi[no] = tt[t];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpi[no] += tt[t];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tno++;\n\t\t\t\t\tpi[no] = tt[t];\n\t\t\t\t\tno++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar tg = {\n\t\t\t\tda : 1,\n\t\t\t\tmo : 0,\n\t\t\t\tye : 2000,\n\t\t\t\tse : 1,\n\t\t\t\tmi : 1,\n\t\t\t\tho : 1,\n\t\t\t};\n\t\t\tfor ( var a in format){\n\t\t\t\tif(dateFormat[format[a]] !== undefined){\n\t\t\t\t\ttg = dateFormat[format[a]](tg,pi[a]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new Date(tg.ye, tg.mo, tg.da, tg.ho, tg.mi, tg.se);\n\t\t}", "title": "" }, { "docid": "1dffc8e32b4246cc477076278927b1e6", "score": "0.5085445", "text": "function makeCleanDate(rawData)\n{\n var date = rawData.results.bindings[rawData.results.bindings.length - 1]['date'].value;\n dateSplit = date.split(\"-\");\n myXdate = new XDate(dateSplit[0], dateSplit[1] - 1, dateSplit[2].split(\" \")[0]);\n \n return myXdate.toString(\"dd MMM yyyy\"); \n}", "title": "" }, { "docid": "c6e7a9a82c776eca857ac4bc54bc20b0", "score": "0.5083601", "text": "function ts_convert_date(a)\n{\n var aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);\n var re = 'RegExp.$1+RegExp.'+DATE_ORDER_ARRAY['M']+'+\\'/\\'+RegExp.'+DATE_ORDER_ARRAY['D']+'+\\'/\\'+ts_process_year(RegExp.'+DATE_ORDER_ARRAY['Y']+')+RegExp.$5';\n var code = 'if(aa.match(/'+REPLACE_PATTERN+'/)) (' + re + ')';\n return Date.parse(eval(code));\n}", "title": "" }, { "docid": "3b836dc8c771b3e323631efefe337321", "score": "0.5080495", "text": "function DateRound (d, scale) {\n if (!d) {\n d = new Date()\n }\n if (!scale) {\n scale = 10\n }\n const rms = Math.ceil(d.getUTCMilliseconds() / scale) * scale\n return new Date(Date.UTC(\n d.getUTCFullYear(),\n d.getUTCMonth(),\n d.getUTCDate(),\n d.getUTCHours(),\n d.getUTCMinutes(),\n d.getUTCSeconds(),\n rms\n ))\n }", "title": "" }, { "docid": "45c46007b403326fac933ec2b8fd4ba2", "score": "0.50737196", "text": "function convertDate(time) {\n var t = new Date(time * 1000);\n var day = t.getDate();\n var month = t.getMonth();\n var year = t.getFullYear();\n var h = t.getHours();\n var m = t.getMinutes();\n var s = t.getSeconds();\n date = year + '-' + month + '-' + day + ' ' + h + ':' + m + ':' + s;\n return date;\n}", "title": "" }, { "docid": "80f256a4cd15030019423f0ba1d3b461", "score": "0.50698096", "text": "function dateObject(dateValue)\n{\n\tvar dateArr = dateValue.split('-');\n\treturn new Date(dateArr[2] , (dateArr[1] - 1) , dateArr[0]);\n}", "title": "" }, { "docid": "fc44869a8c4527a524a90833da9fd862", "score": "0.50555634", "text": "dateConvert(unixTimeStamp){\n if(unixTimeStamp !== null) {\n let date = new Date(unixTimeStamp * 1000);\n return date.toUTCString() //TODO - override ToString\n } else {\n return null\n }\n }", "title": "" }, { "docid": "0aaafaa1f10c0bbcd225ad648789e864", "score": "0.5045863", "text": "function buildDate(d) {\n return new Date(d[0], d[1], d[2], d[3], d[4], d[5]);\n }", "title": "" }, { "docid": "0aaafaa1f10c0bbcd225ad648789e864", "score": "0.5045863", "text": "function buildDate(d) {\n return new Date(d[0], d[1], d[2], d[3], d[4], d[5]);\n }", "title": "" }, { "docid": "2d86ad66d0b512fd39394d9ebcabfcf3", "score": "0.5011356", "text": "function convert(unit, date) {\n const isUTC = isUTCTimeUnit(unit);\n const result = isUTC ? // start with uniform date\n new Date(Date.UTC(1972, 0, 1, 0, 0, 0, 0)) // 1972 is the first leap year after 1970, the start of unix time\n : new Date(1972, 0, 1, 0, 0, 0, 0);\n\n for (const timeUnitPart of TIMEUNIT_PARTS) {\n if (containsTimeUnit(unit, timeUnitPart)) {\n switch (timeUnitPart) {\n case TimeUnit.DAY:\n throw new Error(\"Cannot convert to TimeUnits containing 'day'\");\n\n case TimeUnit.QUARTER:\n {\n const {\n getDateMethod,\n setDateMethod\n } = dateMethods('month', isUTC); // indicate quarter by setting month to be the first of the quarter i.e. may (4) -> april (3)\n\n result[setDateMethod](Math.floor(date[getDateMethod]() / 3) * 3);\n break;\n }\n\n default:\n {\n const {\n getDateMethod,\n setDateMethod\n } = dateMethods(timeUnitPart, isUTC);\n result[setDateMethod](date[getDateMethod]());\n }\n }\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "fbeafe43ff4088f01d82248a7a942940", "score": "0.5005817", "text": "function dateToDMY(date)\r\n{\r\n var d = date.getDate();\r\n var m = date.getMonth() + 1;\r\n var y = date.getFullYear();\r\n return '' + (d <= 9 ? '0' + d : d) + '.' + (m<=9 ? '0' + m : m) + '.' + y;\r\n}", "title": "" }, { "docid": "d1c3d608b0c3b72d49ad36ac4ae178e3", "score": "0.5004379", "text": "function parseDate(date){\n return moment([1970, 0, 1]).add(date, 'days').toDate();\n}", "title": "" }, { "docid": "f00b5823839d6fe32ca657df4f6493d7", "score": "0.50022054", "text": "async function fixDate(date) {\n let y = date.getFullYear(),\n m = date.getMonth() + 1, // january is month 0 in javascript\n d = date.getDate();\n m = (m % 10 == m) ? `0${m}` : m\n d = (d % 10 == d) ? `0${d}` : d\n let date_string = String(d) + '/' + String(m) + '/' + String(y)\n return date_string;\n}", "title": "" }, { "docid": "b4de225e4e3f78de32a62f3d212f22ee", "score": "0.4985514", "text": "function excelDateToJSDate(serial) {\n var utc_days = Math.floor(serial - 25568);\n var utc_value = utc_days * 86400;\n var date_info = new Date(utc_value * 1000);\n\n var fractional_day = serial - Math.floor(serial) + 0.0000001;\n\n var total_seconds = Math.floor(86400 * fractional_day);\n\n var seconds = total_seconds % 60;\n\n total_seconds -= seconds;\n\n var hours = Math.floor(total_seconds / (60 * 60) - 6);\n\n var minutes = Math.floor(total_seconds / 60) % 60;\n\n\n return new Date(date_info.getFullYear(), date_info.getMonth(), date_info.getDate(), hours, minutes, seconds);\n}", "title": "" }, { "docid": "cd2b38a2c4ef973093bc40d0df70d0f6", "score": "0.4981703", "text": "function convertDate() {\n function addZero(timeString) {\n if (timeString.toString().length < 2) {\n return \"0\" + timeString;\n } else {\n return timeString;\n }\n }\n var date = new Date();\n var day = date.getDate(); // yields date\n day = addZero(day);\n var month = date.getMonth() + 1; // yields month (add one as '.getMonth()' is zero indexed)\n month = addZero(month);\n var year = date.getFullYear(); // yields year\n var hour = date.getHours(); // yields hours \n hour = addZero(hour);\n var minute = date.getMinutes(); // yields minutes\n minute = addZero(minute);\n var second = date.getSeconds(); // yields seconds\n second = addZero(second);\n // After this construct a string with the above results as below\n var time = `${year}-${month}-${day}T${hour}:${minute}:${second}`;\n return time;\n}", "title": "" }, { "docid": "02733941abd32a2c7ec1173fbd35b39e", "score": "0.49779794", "text": "function getDateObj(date) {\n if (date instanceof Date) {\n return date;\n } else {\n return new Date(date);\n } \n }", "title": "" }, { "docid": "3008cc498e2843652f39e415dcb1624d", "score": "0.49675015", "text": "function date(ts) {\n return new Date(ts.toNumber() * 1000).toLocaleString();\n}", "title": "" }, { "docid": "f94a2ebe5e195930f5a73d7898540181", "score": "0.4964832", "text": "convertDateTimeFromServer(date) {\n if (date) {\n return new Date(date);\n }\n else {\n return null;\n }\n }", "title": "" }, { "docid": "435a82488284e8ec8ba403f0d7a1c36f", "score": "0.49601737", "text": "function convertPostingPstFutureDate(startPostingDatePstInMili) {\n\treturn new Date(startPostingDatePstInMili + (24*60*60*1000));\n}", "title": "" }, { "docid": "c6ba2813eb798633b71ce3472a4b0dc7", "score": "0.495354", "text": "function to_epoch(date){\n\t\tvar date = Date.parse(date);\n\t\treturn date / 1000;\n\t}", "title": "" }, { "docid": "c9948fc02339f30e5bb4cb06ec41cbc5", "score": "0.49438694", "text": "convertTime(ts){\n // the part of the timestamp we want is before the period\n ts = ts.split(\".\")[0];\n ts = Number(ts);\n return convertEpoch(ts);\n }", "title": "" }, { "docid": "60a42d76ef5396fcbde17a4a882214da", "score": "0.4942821", "text": "function convertDate(date){\n\tvar d = new Date(date); \n\tvar curr_date = d.getDate(); \n var curr_month = d.getMonth(); \n var curr_year = d.getFullYear();\n \n if(curr_date < 10){\n \tvar date = \"0\" + curr_date;\n }else {\n \tvar date = curr_date;\n }\n \n if(curr_month < 9 ){\n \tvar month = \"0\" + (curr_month + 1);\n } else {\n \tvar month = (curr_month + 1);\n }\n \n var formatDate = date + \"-\" + month + \"-\" + curr_year;\n \n return formatDate;\n}", "title": "" }, { "docid": "49869db637710551c50202d9c459e62d", "score": "0.49410993", "text": "function makeDate(digits) {\t\t\t\n\t\t\tvar datex = dateArray_to_date(digits), newdate = makeDate_(\n\t\t\t\t\tdatex.day, datex.month, datex.yearTwoDigits);\n\t\t\tconsole.log(datex.day+\" \"+datex.month+\" \"+datex.yearTwoDigits);\n\t\t\tconsole.log(newdate.day+\" \"+newdate.month+\" \"+newdate.yearTwoDigits);\t\t\t\n\t\t\treturn date_to_dateArray(newdate.day,newdate.month,newdate.yearTwoDigits);\n\t\t\t\n\t\t\t \n\n\t\t}", "title": "" }, { "docid": "a4cd07d07ab39d1020ae6ce7ae849da2", "score": "0.49323782", "text": "function numberToDate(d) {\n var y = Math.floor((10000*d + 14780)/3652425);\n var ddd = d - (y*365 + y/4 - y/100 + y/400);\n if (ddd < 0)\n {\n y = y-1;\n ddd = d-(y*365 + y/4 - y/100 +y/400);\n }\n var mi = Math.floor((52 + 100*ddd)/3060);\n\n var date = {\n date: Math.floor(ddd - (mi*306 +5)/10+1),\n month: Math.floor((mi+2)%12+1),\n year: Math.floor(y + (mi +2)/12)\n }\n\n if (date.date < 10)\n {\n date.date = \"0\" + date.date;\n }\n\n if (date.month < 10)\n {\n date.month = \"0\" + date.month;\n }\n\n var fullDate = date.month + \"/\" + date.date + \"/\" + date.year;\n\n return fullDate;\n}", "title": "" }, { "docid": "b9d8a05efac347b24d9b576e40bc536b", "score": "0.49221274", "text": "function convertDate(date) {\r\n let d = new Date(date);\r\n let months = [\r\n \"Jan\",\r\n \"Feb\",\r\n \"Mar\",\r\n \"Apr\",\r\n \"May\",\r\n \"Jun\",\r\n \"Jul\",\r\n \"Aug\",\r\n \"Sep\",\r\n \"Oct\",\r\n \"Nov\",\r\n \"Dec\",\r\n ];\r\n return d.getDate() + \" \" + months[d.getMonth()] + \" \" + d.getFullYear();\r\n}", "title": "" }, { "docid": "2d0c44420ad4a22d4f76857a371b7c01", "score": "0.4920886", "text": "function parseDate(ds) {\n var ret = new Date(ds);\n return ret;\n}", "title": "" }, { "docid": "0f3410ff94af4ad3ebc8ed45273c7be6", "score": "0.49139348", "text": "function makeInputDate(input){\n return input === undefined ? _d.now() :\n _.isDate(input) ? input : \n _.isArray(input) && input.length > 2 ? dateFromArray(input) :\n new Date(input);\n}", "title": "" }, { "docid": "602bdc117a0abf7648f6713d60481da6", "score": "0.49136624", "text": "function convertDate(timeInMillis) {\r\n const date = new Date(parseInt(timeInMillis));\r\n return (\r\n (\"0\" + date.getDate()).slice(-2) +\r\n \"/\" +\r\n (\"0\" + (date.getMonth() + 1)).slice(-2) +\r\n \"/\" +\r\n date.getFullYear() +\r\n \" @ \" +\r\n (\"0\" + date.getHours()).slice(-2) +\r\n \":\" +\r\n (\"0\" + date.getMinutes()).slice(-2) +\r\n \":\" +\r\n (\"0\" + date.getSeconds()).slice(-2)\r\n );\r\n}", "title": "" } ]
7304a57b8fcaba03e3f0f408a66533b9
console.log( reverseOnDiagonals([ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]), "assert", [ [9, 2, 7], [4, 5, 6], [3, 8, 1], ] );
[ { "docid": "fb7a85aed7f3afd1d5253f6f268f563b", "score": "0.6876516", "text": "function swapDiagonals(matrix) {\n\tlet l = matrix.length - 1;\n\tlet result = matrix.map((line) => [...line]);\n\tfor (let i = 0; i <= l; i++) {\n\t\tresult[i][i] = matrix[i][l - i];\n\t\tresult[i][l - i] = matrix[i][i];\n\t}\n\treturn result;\n}", "title": "" } ]
[ { "docid": "d1be9f3440a8c9c51607fecb8ca7ac43", "score": "0.73438287", "text": "function reverseOnDiagonals(matrix) {\n\tlet l = matrix.length - 1;\n\tlet result = matrix.map((line) => [...line]);\n\tfor (let i = 0; i <= l; i++) {\n\t\tresult[i][i] = matrix[l - i][l - i];\n\t\tresult[i][l - i] = matrix[l - i][i];\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "e85a7784f935eb7480f7c7936cdb4bfb", "score": "0.60579413", "text": "printReverseInOrder() {\n console.log(Array.from(this.reverseInOrder(), ({ value }) => value).join(' '));\n }", "title": "" }, { "docid": "01f5dbae99748e94539d21bdbacffc22", "score": "0.603194", "text": "function solve(n, arr) {\n let revArr = [];\n for (let i = 0; i < n; i++) {\n revArr.push(arr[i]);\n }\n let output = \"\";\n for (let i = revArr.length -1; i >= 0; i--) {\n output += revArr[i];\n output += \" \";\n }\n console.log(output);\n}", "title": "" }, { "docid": "fe83430550a328961808a89ac83bc674", "score": "0.60202867", "text": "function sumUpDiagonals(arr){\n let sum = 0;\n for(let i=0; i<arr.length; i++){\n for(let j=i; j<i+1; j++){\n sum += arr[i][j];\n }\n for(let j=arr.length-1-i; j>arr.length-2-i; j--){\n sum += arr[i][j];\n }\n }\n return sum;\n}", "title": "" }, { "docid": "f0d5d042ee0f6981c04a8f49aba541d0", "score": "0.6016842", "text": "function diagonalDifference(arr) {\n let backSlash = 0;\n let forwardSlash = 0;\n let length = arr.length - 1;\n console.log(length);\n\n for (let i = 0; i < arr.length; i++) {\n backSlash += arr[i][i];\n forwardSlash += arr[i][length];\n length--;\n }\n return Math.abs(backSlash - forwardSlash);\n}", "title": "" }, { "docid": "b8a74ffce47b59ff4aa3bd3e54aa4c31", "score": "0.5992727", "text": "function sumUpDiagonals(arr) {\n var total = 0;\n\n for (var i = 0; i < arr.length; i++) {\n total += arr[i][i];\n total += arr[i][arr.length-i-1];\n }\n return total\n}", "title": "" }, { "docid": "d85f958680640c502ad324a4727d2dd1", "score": "0.5955344", "text": "function reverse(arr) {\n return console.log(arr.reverse());\n}", "title": "" }, { "docid": "b5a5db3248057cd9a24e7d5869927a09", "score": "0.59115815", "text": "function reverserLevel2(input) {\n console.log(input.reverse().join(\" \"));\n}", "title": "" }, { "docid": "c97b8f75afe0178c4bee63acf64c09c3", "score": "0.5890693", "text": "function diagRL(i,j){\r\n let diagArray = [];\r\n for (j;j>0&&i<6;j--){\r\n i++;\r\n }\r\n for (i;i>=0;i--){\r\n diagArray.push(a[i][j]);\r\n j++;\r\n }\r\n checkDiagArray(diagArray);\r\n}", "title": "" }, { "docid": "eed38c6b8ba6b469caffbb4fac1a989c", "score": "0.58845365", "text": "function spiralTraversal (matrix) {\n var len = matrix.length\n chgLen = matrix[0].length\n answer = []\n while (matrix.length){\n var first = []\n for(let i = 0; i < matrix.length; i++) {\n if(matrix[i].length===1){\n answer = answer.concat(matrix[i].pop())\n }\n else if (i === 0) {\n answer = answer.concat(matrix[0])\n }else if(i === matrix.length - 1) {\n answer = answer.concat(matrix[matrix.length - 1].reverse())\n answer = answer.concat(first)\n } else {\n var last = matrix[i].pop()\n answer.push(last)\n first.unshift(matrix[i].shift())\n }\n }\n matrix.shift()\n matrix.pop()\n }\n var count = 0\n for (let i = 0; i < answer.length; i++) {\n console.log(answer[i])\n if(answer[i] === undefined){\n count++\n }\n }\n for(let i = 0; i < count; i++){\n answer.pop()\n }\n return answer\n}", "title": "" }, { "docid": "2ed3e9312d2df912c0e326d31019ccce", "score": "0.58387226", "text": "function printReverse(rev) {\n console.log(rev.reverse());\n}", "title": "" }, { "docid": "281b1413c409823bda5bdc4ca3ffe7f1", "score": "0.5827487", "text": "static Diagonal(elements) {\n var n = elements.length,\n k = n,\n i;\n var M = Matrix.I(n);\n do {\n i = k - n;\n M.elements[i][i] = elements[i];\n } while (--n);\n return M;\n }", "title": "" }, { "docid": "d51779553f0730345d64a006fecbd462", "score": "0.5811833", "text": "function printReverse(array) {\n for (var i = 1; i < array.length; i++) {\n console.log(array[array.length - i]);\n }\n console.log(array[0]);\n}", "title": "" }, { "docid": "15803bdf7c5d48bf4afcfb530799d49b", "score": "0.5739116", "text": "function reverseAll(arr) {\n var result = [];\n\n for (var i = arr.length - 1; i >= 0; i--) {\n var kata = '';\n //console.log(arr[i]);\n for (var j = 0; j < arr[i].length; j++) {\n kata = arr[i][j] + kata;\n }\n result.push(kata);\n }\n return result;\n}", "title": "" }, { "docid": "666f25d44cf34a26d0a3544b8a742b42", "score": "0.57367855", "text": "function vertMirror(strng) {\n return strng.map(s => [...s].reverse().join(''));\n}", "title": "" }, { "docid": "7d695fcc106352a519f67e149724a4e1", "score": "0.57320005", "text": "function setMainDiagonals() {\n\n for (let row = rows - 4; row > 0; row--) {\n let r = row;\n let diagonal = [];\n for (let col = 0; r < rows; col++, r++) {\n coordinates = {\n row: r,\n col: col\n };\n diagonal.push(coordinates);\n }\n mainDiagonals.push(diagonal);\n }\n\n //main diagonal\n let md = [];\n for (let row = 0; row < cols; row++) {\n for (let col = 0; col < cols; col++) {\n\n if (row == col) {\n coordinates = {\n row: row,\n col: col\n };\n md.push(coordinates);\n }\n\n }\n }\n mainDiagonals.push(md);\n\n for (let row = 3; row < cols - 1; row++) {\n let r = row;\n let diagonal = [];\n for (let col = cols - 1; r >= 0; col--, r--) {\n coordinates = {\n row: r,\n col: col\n };\n diagonal.push(coordinates);\n }\n mainDiagonals.push(diagonal);\n }\n // console.log(mainDiagonals)\n}", "title": "" }, { "docid": "1952d33f0f54e623c4198d89d6f3729c", "score": "0.5729883", "text": "function printReverse(array) {\n for (var i = array.length - 1; i >= 0; i--) {\n console.log(array[i] + \", \");\n }\n }", "title": "" }, { "docid": "a38ab512aeb0efd52892db3c4eea8f5d", "score": "0.5709311", "text": "function matrixDiagonalTraversal(matrix) {\n var maxLen = 0;\n for(var i = 0; i < matrix.length; i++) {\n maxLen = Math.max(matrix[i].length, maxLen);\n }\n\n for(i = 0; i < matrix.length; i++) {\n var row = matrix[i];\n var cnt = maxLen - row.length;\n \n while(cnt > 0) {\n matrix[i] += ' ';\n cnt--;\n }\n\n var leftStr = matrix[i].substring(i);\n\n var reversedRightStr = '';\n cnt = i;\n\n while(cnt > 0) {\n reversedRightStr += matrix[i][--cnt];\n }\n\n matrix[i] = leftStr + reversedRightStr;\n }\n\n var result = '';\n\n for(i = 0; i < maxLen; i++) {\n for(var j = 0; j < matrix.length; j++) {\n if(matrix[j][i] !== ' ') {\n result += matrix[j][i]; \n }\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "03bb815d137d59c9a854cccde923e853", "score": "0.5706862", "text": "function reverseArr(arr) {\n}", "title": "" }, { "docid": "5bade494dbd6938810d43eae696064c4", "score": "0.5690696", "text": "function diagLR(i,j){\r\n let diagArray = [];\r\n for (j;j>0&&i>0;j--){\r\n i--;\r\n }\r\n if (i>j){\r\n for (i;i<7;i++){\r\n diagArray.push(a[i][j]);\r\n j++;\r\n }\r\n } else {\r\n for (j;j<6;j++){\r\n diagArray.push(a[i][j]);\r\n i++;\r\n }\r\n }\r\n checkDiagArray(diagArray);\r\n}", "title": "" }, { "docid": "6d976efd14b38a17c719293aa47c2b8a", "score": "0.56858486", "text": "function setSecondaryDiagonals() {\n\n for (let row = 3; row < cols - 1; row++) {\n let r = row;\n let diagonal = [];\n for (let col = 0; r >= 0; col++, r--) {\n coordinates = {\n row: r,\n col: col\n };\n diagonal.push(coordinates);\n }\n secondaryDiagonals.push(diagonal);\n }\n\n // secondary diagonal\n let sd = [];\n for (let row = 0; row < cols; row++) {\n for (let col = 0; col < cols; col++) {\n if (row + col == cols - 1) {\n coordinates = {\n row: row,\n col: col\n };\n sd.push(coordinates);\n }\n }\n }\n secondaryDiagonals.push(sd);\n\n\n for (let row = 1; row < cols - 3; row++) {\n let r = row;\n let diagonal = [];\n for (let col = cols - 1; r < cols; col--, r++) {\n coordinates = {\n row: r,\n col: col\n };\n diagonal.push(coordinates);\n }\n secondaryDiagonals.push(diagonal);\n }\n // return secondaryDiagonals;\n}", "title": "" }, { "docid": "032b9c858d8afc0bc7f4a7ff3c98a10a", "score": "0.56840867", "text": "function reverseA(array = test_array) {\n\tconsole.log(array.reverse());\n\tarray.forEach(function(element) {\n\t\tconsole.log(element);\n\t});\n}", "title": "" }, { "docid": "11c4b25c73cdc1c345cd37a7795570bc", "score": "0.5680524", "text": "function\tprntReverse(input){\n\tfor(var i = input.length -1; i >= 0; i--){\n\t\tconsole.log(input[i]);\n\t}\n}", "title": "" }, { "docid": "ba9f2a74d6de8fefb0005d7b872b3dae", "score": "0.56744176", "text": "function diagDiff() {\n let a = [[11, 2, 4], [4, 5, 6], [10, 8, -12]];\n\n //-- algorithm starts:\n var primaryDiagonelSum = 0;\n var primaryDiagonel = a.map(function (row, idx, matrix) {\n let pos = row[idx];\n primaryDiagonelSum += pos;\n return pos;\n });\n var secondaryDiagonelSum = 0;\n var secondaryDiagonel = a.map(function (row, idx, matrix) {\n let i = row.length - 1 - idx;\n let pos = row[i];\n secondaryDiagonelSum += pos;\n return pos;\n });\n let ans = primaryDiagonelSum - secondaryDiagonelSum;\n console.log(\"diagonal diff = \");\n console.log(ans < 0 ? ans * -1 : ans);\n}", "title": "" }, { "docid": "a1494cd8eb1901ba14c539cd2f936e52", "score": "0.56543314", "text": "function printReverse(inputArray){\n\tinputArray.reverse.forEach(function(item){\n\t\tconsole.log(item);\n\t});\n}", "title": "" }, { "docid": "030f3768aea5ba9ddc42b610ae2086f2", "score": "0.5644338", "text": "function printReverse(array){\n\tfor(var i=array.length-1;i>=0;i--){\n\t\tconsole.log(array[i]);\n\t}\n}", "title": "" }, { "docid": "270315d589f508421eb2e9420ead7e1d", "score": "0.5635847", "text": "function printArrayValuesInReverse(array) {\n //create an array that will parse the length of the array backwards and print each element to console\n for(let i = array.length - 1; i >= 0; i--){\n console.log(array[i]);\n }\n}", "title": "" }, { "docid": "c6a0e55f6c8f57ef6dc98d5866b6c0ef", "score": "0.5630442", "text": "function getRightDiagonalPattern() {\n let initial = rowCount - 1;\n let increaseBy = 0;\n let diagonalMatchPattern = [];\n for (let i = 0; i < rowCount; i++) {\n diagonalMatchPattern.push(initial + increaseBy);\n increaseBy += rowCount;\n initial -= 1;\n }\n\n // console.log(diagonalMatchPattern);\n return diagonalMatchPattern;\n }", "title": "" }, { "docid": "aaf46f83f900cbe11cf8fa6af511c212", "score": "0.5626918", "text": "function descending(numbers) {\n var reversed = [];\n for (var i = numbers.length - 1; i >= 0; i--) {\n console.log(numbers[i]);\n reversed.push(numbers[i]);\n // console.log(numbers[i]);\n }\n // return reversed;\n}", "title": "" }, { "docid": "79db4f639e06faea41d0f20b962d72fa", "score": "0.5619121", "text": "function printReverse(arr) {\r\n for(var i = arr.length - 1; i >= 0; i--)\r\n console.log(arr[i])\r\n}", "title": "" }, { "docid": "ad44e933c748a7e0d3c751b4f3a6dc14", "score": "0.56109595", "text": "function printReverse(arr) {\n for(let i = arr.length - 1; i >= 0; i--) {\n console.log(arr[i]);\n }\n}", "title": "" }, { "docid": "c15b3f1279dcc76ee1f62f923794ac88", "score": "0.5601631", "text": "function printReverse(arr) {\n for (var x = arr.length - 1; x >= 0; x--) {\n console.log(arr[x]);\n }\n}", "title": "" }, { "docid": "50ad28b45f8b0baf132b29dccb87cf29", "score": "0.55881757", "text": "function printReverse(arr){\nfor (var i = arr.length - 1; i >= 0; i--) {\n console.log(arr[i]);\n}\n}", "title": "" }, { "docid": "b142c236d22e4f011a68c6735d4e7fca", "score": "0.55871594", "text": "function diagonalAttack(arr){\n let matrix = []\n arr.forEach(el => {\n let row = el.split(' ').map(elem => Number(elem))\n matrix.push(row)\n })\n\n let normalDiagonal = 0\n let backDiagonal = 0\n for (let row = 0; row < matrix.length; row++) {\n normalDiagonal += matrix[row][row];\n backDiagonal += matrix[row][matrix.length-1-row]\n }\n if(normalDiagonal === backDiagonal){\n matrix = replace(matrix)\n }\n matrix.forEach(arr => console.log(arr.join(' ')))\n\n function replace(mat){\n for (let row = 0; row < mat.length; row++) {\n for (let col = 0; col < mat[row].length; col++) {\n if(row!==col && col !== mat.length-1-row){\n mat[row][col] = normalDiagonal\n }\n }\n }\n return mat\n }\n}", "title": "" }, { "docid": "ed3612c71fbbaf15b2ca6022b9cb1263", "score": "0.5573755", "text": "function printReverse () {\n console.log(myArray.reverse());\n}", "title": "" }, { "docid": "f6360fd82dd957604a488d1823ff12f7", "score": "0.556996", "text": "function reverse(arr){\n let toReturn = new Array(arr.length-1);\n for(let i = 0; i < arr.length/2; ++i){\n toReturn[arr.length-i] = arr[i];\n toReturn[i] = arr[arr.length-i];\n }\n return toReturn.join(\"\");\n}", "title": "" }, { "docid": "c07a00244df15024e52b32437a05861e", "score": "0.5562089", "text": "function mostrarRev(array2){\r\n for(i=array2.length-1;i>=0;i--){\r\n console.log(array2[i])\r\n }\r\n}", "title": "" }, { "docid": "11e27931fcc739f46a7c9f680e42c0a8", "score": "0.5558794", "text": "function printArrayValuesInReverse(array) {\n // YOUR CODE BELOW HERE //\n var reverseArray = array;\n for (let i = reverseArray.length - 1; i >= 0; i--) {\n console.log(reverseArray[i]);\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "a6d5bce9d564a6fb472095921f508ddd", "score": "0.5558356", "text": "function getDiagonalsFromElement(element){\n // more variables but easier to code IMO.\n var p1 = [element.posx, element.posy];\n var p2 = [(element.posx + element.width), element.posy];\n var p3 = [element.posx, (element.posy + element.height)];\n var p4 = [(element.posx + element.width), (element.posy + element.height)];\n var diag1 = [p1, p4];\n var diag2 = [p2, p3];\n return [diag1, diag2];\n}", "title": "" }, { "docid": "e1dedd4408372592b11775cb6f1488c2", "score": "0.5557141", "text": "function arrayReverse(arr1) {\n\n }", "title": "" }, { "docid": "3ce4a773c42c34dfa7c19df34211ee49", "score": "0.5540835", "text": "reverse() {}", "title": "" }, { "docid": "24a5e87550e88c07a75b02300a34306a", "score": "0.5524841", "text": "function recursiveReverse(arr){\n\tlet result = [];\n\tfunction helper(index){\n\t\tif(index < 0){\n\t\t\treturn;\n\t\t} else {\n\t\t\tresult.push(arr[index])\n\t\t\thelper(index - 1);\n\t\t}\n\t}\n\thelper(arr.length - 1);\n\treturn result;\n}", "title": "" }, { "docid": "410bc9a54dd6e31b8812ddd8d071e4bf", "score": "0.5517833", "text": "function vertMirror(strng) {\n // Your code\n const arrStr = strng.split('\\n');\n const result = arrStr.map(str => {\n return str.split('').reverse().join('');\n })\n return result.join('\\n');\n}", "title": "" }, { "docid": "1f238c88a7a21e15713dd91ce65c57ce", "score": "0.5514367", "text": "function reverse(list) {\n let leftSide = 0;\n let rightSide = list.length - 1;\n\n while (leftSide < list.length / 2) {\n [list[leftSide], list[rightSide]] = [list[rightSide], list[leftSide]];\n leftSide += 1;\n rightSide -= 1;\n }\n return list\n}", "title": "" }, { "docid": "e858dc4b2a94b78a2ec583a28cb5f75b", "score": "0.5499113", "text": "function invertedTriangleRecursive(n, base = n) {\r\n if (n == 0) return;\r\n invertedTriangleRecursive(n - 1, base);\r\n let line = \"\"\r\n for (let i = n; i <= base; i++)\r\n line += \"#\";\r\n console.log(line);\r\n}", "title": "" }, { "docid": "e32c98a31f9397515b28ac10f9158e36", "score": "0.5481887", "text": "function printReverse(arr) {\n // Loop through array starting from highest index value to index 0\n for (var i = arr.length - 1; i >= 0; i--) {\n console.log(arr[i]);\n }\n}", "title": "" }, { "docid": "b9600952420c58e9771064865d8ff7f0", "score": "0.54796284", "text": "function reverse(stack) {\n\n}", "title": "" }, { "docid": "26a76a8494d8ff77208cb3e86c7983aa", "score": "0.546978", "text": "function diagonalDifference(arr) {\n let sum1 = 0;\n let sum2 = 0;\n for (let i=0; i<arr.length; i++){\n sum1 += arr[i][i];\n }\n for (let i=0; i<arr.length; i++) {\n sum2 += arr[i][arr[i].length-1-i];\n }\n return Math.abs(sum1-sum2);\n}", "title": "" }, { "docid": "e941091278b955328f55c40741dde7df", "score": "0.5446816", "text": "function diagonalDifference(arr) {\n var diagonal1 = 0;\n var diagonal2 = 0;\n for(let i = 0; i < arr.length; i++) {\n diagonal1 += arr[i][i];\n diagonal2 += arr[i][arr.length - i - 1];\n console.log(arr[i][i], arr[i][arr.length - i - 1]);\n }\n //console.log(diagonal1, diagonal2);\n return Math.abs(diagonal1 - diagonal2);\n}", "title": "" }, { "docid": "a68f7e1a1cd81c83b7762117cc666264", "score": "0.54450613", "text": "function diagonalDifference(arr) {\n let diag1 = 0;\n let diag2 = 0;\n let n = arr.length\n for (let i = 0; i < n; i++) {\n diag1 = diag1 + arr[i][i];\n diag2 = diag2 + arr[i][(n - 1) - i]\n console.log(diag2)\n }\n const result = parseInt(diag2) - parseInt(diag1);\n return result\n}", "title": "" }, { "docid": "2e683f49ac34c30ba675b621d27363a4", "score": "0.5430499", "text": "printReverse( ) {\n }", "title": "" }, { "docid": "2763501d5b6d1e4fb1eabcd066605c6b", "score": "0.54188496", "text": "function reverser( arr ){\n return arr.map( function(i){\n return i.reverse();\n });\n}", "title": "" }, { "docid": "6a0470dcb67ff39de5845c9eee879d84", "score": "0.54166", "text": "function reverse4(str) {\n let revStr = []\n if (!str || str.length < 2 || typeof str !== 'string') \n return 'That is not good..'\n for (let i = str.length - 1; i >= 0; i--) {\n revStr.push(str[i])\n }\n console.log(revStr)\n return revStr.join('')\n}", "title": "" }, { "docid": "5e946a08347b0a7aee6c58a86bafaf77", "score": "0.5415189", "text": "function reverseAlternateLevels(tree) {\n const arr = tree.verticalOrderTraversalUtil(); // O(n)\n reverse(arr); // O(n)\n tree.reverseUtil(tree.root, arr); // O(n)\n return tree.root;\n}", "title": "" }, { "docid": "62a690cc7382a7d7c7a1191e70252de5", "score": "0.5409411", "text": "function printReverse(array) {\n\tfor (var i = numarray.length; i => 0; i--) {\n\t\tconsole.log(numarray[i]);\n\t}\n}", "title": "" }, { "docid": "a3f62af801d86576f066bf1358e06ff2", "score": "0.53875184", "text": "function d() {eval_equal('Opal.Sass.$$scope.Util.$flatten_vertically([[1, 2, 3], [4, 5], 6]).$to_s()', '\"[1, 4, 6, 2, 5, 3]\"', {}, done)}", "title": "" }, { "docid": "d44f2b6df8da02f0770cbc9de1553937", "score": "0.5385197", "text": "function matrixDiagonalsSum(input) {\n let matrix = input.map(row => row.split(/\\s+/).map(Number));\n let firstDiagonalSum = 0;\n let secondDiagonalSum = 0;\n for (let row = 0; row < matrix.length; row++) {\n firstDiagonalSum += matrix[row][row];\n secondDiagonalSum += matrix[row][matrix[row].length - 1 - row];\n }\n return firstDiagonalSum + ' ' + secondDiagonalSum;\n}", "title": "" }, { "docid": "5c3508a9ebba4f381b66b5abe7453c1b", "score": "0.53826064", "text": "function diagonalDifference(arr) {\n let sum1 = 0;\n let sum2 = 0;\n for (let i = 0; i<arr.length; i++){\n sum1 += arr[i][i]; //when working with 2d arrays the first [] is the list and the second is the index of that list.\n sum2 += arr[i][arr.length-1-i];\n \n}\nreturn Math.abs(sum1 - sum2);\n}", "title": "" }, { "docid": "9b668a8a1fd618bbcc16a9867d409d7b", "score": "0.5381096", "text": "function reverseFunction(d) {\n\n let reverseStr = \"\";\n\n for (let i = d.length - 1; i >= 0; i--) {\n\n reverseStr += d[i];\n }\n\n return reverseStr\n}", "title": "" }, { "docid": "ba087ddfcfd8914a21416b802763eef9", "score": "0.5381081", "text": "function printReverse(nums){\r\n for (i=nums.length-1; i>=0; i--){\r\n console.log(nums[i]);\r\n }\r\n}", "title": "" }, { "docid": "e368e832a44270aaaff5398b1243d373", "score": "0.53768444", "text": "function triangle9(n) {\n let a = \"\";\n for(let i = 1; i <= n; i++){\n for(let j = 1; j<=n-i+1; j++){\n a += n-i+1 + \" \";\n }\n console.log(a);\n a = \"\";\n }\n}", "title": "" }, { "docid": "fc4f2daef683f588265fcefde571c292", "score": "0.5372625", "text": "function converse(A, l, pivot, r) {\n reverse(A, l, pivot)\n reverse(A, pivot + 1, r)\n reverse(A, l, r)\n return A\n}", "title": "" }, { "docid": "bf2e0441c156fdf4e04fa51054498d7c", "score": "0.5371979", "text": "function printArrayValuesInReverse(array) {\n // YOUR CODE BELOW HERE //\n //begin at array.length -1 index (so the last one), stop when i >= 0, update by -1\n for (var i = array.length - 1; i >= 0; i--) {\n //print array index values in reverse\n console.log(array[i]);\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "d6b3b8601ac365356554b3796e48c390", "score": "0.5357317", "text": "function reverse(input){\n var result = [];\n for(count = 0; count < input.length; count++){\n result.push(input[count])\n }\n result.reverse();\n return result.join(\"\");\n}", "title": "" }, { "docid": "5e2357a80975365e2a07f902666eec48", "score": "0.53571707", "text": "function revealTriangles(arr) {\n\tlet res = [];\n\tfor (let e of arr) {\n\t\tres.push(e.split('')); }\n\tfor (let r = 1; r < arr.length; r++) {\n\t\tlet maxCol = Math.min(arr[r].length - 3, arr[r - 1].length - 2);\n\t\tfor (let col = 0; col <= maxCol; col++) {\n\t\t\tlet a = arr[r][col];\n\t\t\tlet b = arr[r][col + 1];\n\t\t\tlet c = arr[r][col + 2];\n\t\t\tlet d = arr[r - 1][col + 1];\n\t\t\tif (a == b && b == c && c == d) {\n\t\t\t\tres[r][col] = '*';\n\t\t\t\tres[r][col + 1] = '*';\n\t\t\t\tres[r][col + 2] = '*';\n\t\t\t\tres[r - 1][col + 1] = '*';\n\t\t\t}\n\t\t}\n\t}\n\tfor (let i = 0; i < res.length; i++) {\n\t\tconsole.log(res[i].join(''));\n\t}\n}", "title": "" }, { "docid": "fe6dcf6ae4d650cc3cf18a40fc48e50f", "score": "0.5347949", "text": "function triangle6(n) {\n let a = \"\";\n for(let i = 1; i <= n; i++){\n for(let j = 1; j<=n-i+1; j++){\n a += j + \" \";\n }\n console.log(a);\n a = \"\";\n }\n}", "title": "" }, { "docid": "575bb676c9a4101e4cf66a50807c930c", "score": "0.53364813", "text": "function printArrayValuesInReverse(array) {\n // YOUR CODE BELOW HERE //\n for(var i = array.length - 1; i >= 0; i--){\n console.log(array[i]); \n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "800e4d800c0f63ec1dc11491d0bac49f", "score": "0.53320736", "text": "function printArrayValuesInReverse(array) {\n // YOUR CODE BELOW HERE //\n for(let i = array.length - 1; i >= 0; i--){\n console.log(array[i])\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "3b73c7e9dd0567145320f68944eddf2d", "score": "0.53225076", "text": "function revArray2 (arr){\n\tvar newArr = [];\n\tfor (var i = arr.length -1; i >= 0; i--){\n\t\tnewArr.push(arr[i]);\n\t}\n\tconsole.log(newArr);\n}", "title": "" }, { "docid": "761af97e5103fd8d1e5a3a72b50cec87", "score": "0.5320981", "text": "function printPascalsTriangle(n) {\n var values = [];\n if (n >= 0) {\n values[0] = [1];\n console.log(1);\n }\n // building the rows\n for (var ir = 1; ir < n; ir++) {\n // create first column\n values[ir] = []; // create the array\n values[ir][0] = 1;\n for (var ic = 1; ic < ir + 1; ic++) {\n var leftParent = values[ir - 1][ic - 1];\n var rightParent = values[ir - 1][ic];\n var currentValue = (leftParent || 0) + (rightParent || 0);\n values[ir][ic] = currentValue;\n }\n }\n // printing\n for (var i = 0; i < values.length; i++) {\n console.log(values[i]);\n }\n}", "title": "" }, { "docid": "eae32bfac58bcf93478ac3e474eca7b8", "score": "0.5317099", "text": "function printReverse(myarray){\nfor (var i = myarray.length - 1; i >= 0; i-- ) {\nconsole.log(myarray[i]);\n }\n}", "title": "" }, { "docid": "4eb20c3317c73abe53720f0896b9c939", "score": "0.5312464", "text": "function reverse(x) {\n var z = '';\n var y = x.length - 1\n \n for (var i = y; i >=0; i--)\n\tz += x[i];\n\t\n\tif (x !== z) {\n \t console.log(z);\n \t}\n \telse {\n \t console.log(\"You can't reverse a palindrome!!\")\n \t}\n}", "title": "" }, { "docid": "159681a6a7c51a00109ffb682f209f29", "score": "0.53097796", "text": "function diagonalDifference(arrays) {\n let diff = (rightDiagonal(arrays) - leftDiagonal(arrays));\n return Math.abs(diff);\n}", "title": "" }, { "docid": "180fb0b4aeb63315836c06c5b23d2228", "score": "0.53000796", "text": "function isArraySymmetric(arr) {\n var result = 0;\n duzina = arr.length;\n for (var i = 0; i < duzina; i++) {\n console.log(arr[i]);\n for (var j = duzina; 0 < duzina; j--) {\n console.log(arr[j]);\n }\n\n }\n\n return true;\n}", "title": "" }, { "docid": "0f9a3e02e78c2bcee7f6c8abd56eee90", "score": "0.5298094", "text": "function printArrayValuesInReverse(array) {\n // YOUR CODE BELOW HERE //\n \n //Create a for loop with a variable initialized to the length of the array descending\n for (var i = array.length - 1; i >= 0; i--){\n console.log(array[i])\n }\n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "f220e4ad2fd15a05f6cf483191c7e228", "score": "0.52825665", "text": "function snowflakeDiagonals(length) {\n moveForward(length);\n turnAround();\n moveForward(length);\n moveForward(length);\n \n}", "title": "" }, { "docid": "b27f3c64decef9f39866e1a89d492a56", "score": "0.5280638", "text": "function triangle10(n) {\n let a = \"\";\n for (let i = 1; i <= n; i++){\n for (let j = 1; j <= n-i+1; j++){\n a += n-j+1 + \" \";\n }\n console.log(a);\n a = \"\"\n }\n}", "title": "" }, { "docid": "89070ef6b0ff6ef12faa55a053ecc40a", "score": "0.5277735", "text": "reverse() {\n this.reverseHelper(this.head, this.tail);\n }", "title": "" }, { "docid": "7b085d29e07b68e2c28fec71a5eaff47", "score": "0.52765924", "text": "function reverseList(list) {\n var reversedList = [];\n for (var i = list.length - 1; i >= 0; i--) {\n // console.log(\">> \" + list[i]);\n reversedList.push(list[i]);\n }\n return reversedList;\n}", "title": "" }, { "docid": "5b2f9d19749a6e64bdf2f9180ef6f356", "score": "0.52647537", "text": "function reverseString2(arr) {\r\n\r\n // error checking, not an array, < 2, not a string\r\n // if(!arr || arr.length < 2 || typeof arr !== 'string') {\r\n // return \"Error: Not a valid input\"\r\n // }\r\n\r\n var revStr = \"\";\r\n for(let i = arr.length-1; i = 0; i--) {\r\n revStr += arr[i];\r\n }\r\n console.log(revStr);\r\n}", "title": "" }, { "docid": "ff6f16be72cfae10784a727682446c1e", "score": "0.52594614", "text": "function triangle16(n) {\n let a = \"\";\n const string = \"ABCDEFGHIJKLMNOPQRST\";\n let alpha = [];\n alpha = string.split('');\n for (let i = 1; i <= n; i++) {\n for (let j = 1; j <= n; j++) {\n if (j <= n - i) {\n a += \" \";\n } else {\n a += alpha[n-j] + \" \";\n }\n }\n console.log(a);\n a = \"\";\n }\n}", "title": "" }, { "docid": "4b97371272c5bed14e3337ae73351978", "score": "0.5258509", "text": "function solution(str){\n let rev = [];\n for (let i = str.length -1; i >= 0; i--) {\n rev.push(str[i]);\n }\n return rev.join('');\n\n}", "title": "" }, { "docid": "8fe65f8d7b96e37bf62c2e059bc35ae7", "score": "0.5240942", "text": "function triangle2(n) {\n let a = \"\";\n for (let i = 1; i <= n; i++) {\n for (let j = 1; j <= i; j++) {\n a += i + \" \";\n }\n console.log(a);\n a = \"\";\n }\n}", "title": "" }, { "docid": "a7a42b6208183a22804f1ac89318c62b", "score": "0.5236301", "text": "function reverse(list) {\n return foldl(function (accumulator, value) {\n return cons(value, accumulator);\n }, undefined, list);\n}", "title": "" }, { "docid": "50b0f0d8abf5dc57fb4262227e31c7d1", "score": "0.52322334", "text": "function reverse(reverseString){\n let stringrevers = reverseString.split(\"\").reverse().join(\"\"); \n return console.log(stringrevers)\n }", "title": "" }, { "docid": "354baac9a54c27e7cb746db536262440", "score": "0.5227505", "text": "function triangle15(n) {\n let a = \"\";\n for (let i = 1; i <= n; i++) {\n for (let j = 1; j <= n; j++) {\n if (j <= n - i) {\n a += \" \";\n } else {\n a += n-j+1 + \" \";\n }\n }\n console.log(a);\n a = \"\";\n }\n}", "title": "" }, { "docid": "f5e69681d45a8d35f21b8bc180d1dab7", "score": "0.5219135", "text": "function getDiag(boar, r, c) {\n let temp = []\n\n for (let i = 0; i < 4; i++) {\n temp[i] = boar[r + i][c + i]\n }\n return temp;\n}", "title": "" }, { "docid": "af2ae7532e2bf3aeb0cad71388bfc3a3", "score": "0.5214608", "text": "function diagonalDifference(arr) {\n let first = 0;\n let second = 0;\n\n for (let i = 0; i < arr.length; i++) {\n first += arr[i][i];\n second += arr[i][arr.length - i - 1];\n }\n\n return Math.abs(first - second);\n}", "title": "" }, { "docid": "487a3e3edaaddae5034b607019a11890", "score": "0.5206213", "text": "function rotate(matrix) {\n // create loop from i = 0 to i < matrix .length\n for (let i = 0; i < matrix.length; i++) {\n for (let j = i; j < matrix[0].length; j++) {\n const temp = matrix[i][j];\n matrix[i][j] = matrix[j][i];\n matrix[j][i] = temp;\n }\n }\n // create a loop to reverse each arr\n for (let i = 0; i < matrix.length; i++) {\n for (let j = 0; j < matrix[0].length / 2; j++) {\n let temp = matrix[i][j];\n matrix[i][j] = matrix[i][matrix[0].length - j - 1];\n matrix[i][matrix[0].length - j - 1] = temp;\n }\n }\n}", "title": "" }, { "docid": "4f5e156809229c7adb580c00c70aab4d", "score": "0.5203352", "text": "function reverseParty(arr){\n return arr.reverse()\n}", "title": "" }, { "docid": "5a7d17ca287fc54a040b76a9f9a2d4d0", "score": "0.51963484", "text": "function printArrayValuesInReverse(array) {\n // YOUR CODE BELOW HERE //\n \n for (var i = array.length - 1; i > -1; i--) { //iterates through array backwards\n console.log(array[i]); //prints each value\n }\n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "c350426dc0aa61c2f09ec99b3e4353ec", "score": "0.5187127", "text": "function recursiveReverse(seq) {\n return seq.length > 1 ?\n recursiveReverse(seq.slice(1)).concat(seq.slice(0, 1)) : seq;\n}", "title": "" }, { "docid": "59aa51176a17a6ad27186adeef08a734", "score": "0.5185633", "text": "function mirror (x)\n{ \n var l=x.length;\n var rev=\"\";\n\nwhile (l>0)\n{\nrev = rev +x[l-1];\nl--;\n}\n\nreturn rev\n}", "title": "" }, { "docid": "c2cba8931f8f37dd5fcc9a410e9e7bac", "score": "0.5185334", "text": "function reverse(arr) {\n return arr.reverse();\n}", "title": "" }, { "docid": "6c42191d3145108c06819a2695d38fcd", "score": "0.51844394", "text": "test_array(){\n\t\t// skip()\n\t\t// assert_result_emitted('xs=[1,4,7];xs.reverse()', [7, 4, 1])\n\t\tassert_emit('xs=[1,4,7];reverse xs', [7, 4, 1]);\n\t}", "title": "" }, { "docid": "3ed4ea8da0489302b38c31e163caf82e", "score": "0.5182477", "text": "function spiralMatrix(arr) {\n let rows = Number(arr[0]);\n let cols = Number(arr[1]);\n\n let matrix = [];\n\n function fillMatrix(matrix) {\n let counter=1;\n for (var i = 0; i < rows; i++) {\n matrix[i] = [];\n for (var j = 0; j < cols; j++) {\n matrix[i][j] = counter;\n counter++;\n }\n }\n }\n function printMatrix(matrix) {\n\n for (let i = 0; i < matrix.length; i++) {\n console.log(matrix[i].join(' '));\n }\n }\n\n\n\n fillMatrix(matrix);\n printMatrix(matrix);\n\n}", "title": "" }, { "docid": "c86b28429a84e87ba03f3abd2b7a7d16", "score": "0.51789594", "text": "function reverse(arr)\n{\n var x = arr.length;\n for(i = 0; i < x; i++)\n {\n var temp = arr[i];\n arr[i] = arr[x-1];\n arr[x-1] = temp;\n x--;\n }\n console.log(arr);\n}", "title": "" }, { "docid": "b1f917051eb9c2489b341ecce39fb735", "score": "0.51777637", "text": "reverse(){}", "title": "" }, { "docid": "355a942fafd262b52d0492865b624724", "score": "0.51701707", "text": "function diagonalDifference(arr) {\n // arr is an array of arrays\n\n let leftToRightTotal = 0;\n let rightToLeftTotal = 0;\n\n // Get the left to right diagonal total\n for (let i=0; i < arr.length; i++) {\n leftToRightTotal += arr[i][i];\n rightToLeftTotal += arr[i].reverse()[i];\n }\n\n return Math.abs(leftToRightTotal - rightToLeftTotal);\n}", "title": "" }, { "docid": "b24d990c907319bce8ff36f6525797b2", "score": "0.5164614", "text": "function reverseArray(arr){\n for(var i = 0; i < arr.length/2; i++){\n [arr[i], arr[arr.length - 1 - i]] = [arr[arr.length - 1 - i], arr[i]]\n }\n return arr;\n}", "title": "" } ]
6c80effda66afea2f428729c6d06d126
Name: Node.js, Ogre, Textures Demo / File: terrain.js / Date: 20130104 / Author: Christian Westman / Web:
[ { "docid": "c80afab0a96041eb6e2554716a50ae98", "score": "0.62205464", "text": "function createTerrainMesh(name, meshName) {\n\n\tvar object = sceneManager.createManualObject(name);\n\tobject.setDynamic(false);\n\n\tvar d = 128;\n\tvar t = [];\n\n\tfor(var x=0;x<d;x++) {\n\t\tt[x] = [];\n\t\tfor(var y=0;y<d;y++) {\n\t\t\tt[x][y] = [];\n\t\t\tfor(var z=0;z<d;z++) {\n\t\t\t\tt[x][y][z] = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor(var y=0;y<d;y++) {\n\tfor(var x=0;x<d;x++) {\n\tfor(var z=0;z<d;z++) {\n\t\tif(y==0) {\n\t\t\tt[x][y][z] = true;\n\t\t\tcontinue;\n\t\t}\n\t\tt[x][y][z] = Math.random() < 0.5 && t[x][y-1][z] == true;\n\t}\n\t}\n\t}\n\n\tfunction count(x,z) {\n\t\tfor(var y=0;y<d;y++) {\n\t\t\tif(t[x][y][z] == false)\n\t\t\t\treturn y-1;\n\t\t}\n\t\treturn d-1;\n\t}\n\n\tfunction set(a,x,z,h) {\n\t\tfor(var y=0;y<d;y++) {\n\t\t\tif(y <= h) {\n\t\t\t\ta[x][y][z] = true;\n\t\t\t} else {\n\t\t\t\ta[x][y][z] = false;\n\t\t\t}\n\t\t}\n\t}\n\n\n\tfor(var i=0;i<1;i++) {\n\t\tvar a = [];\n\t\tfor(var x=0;x<d;x++) {\n\t\t\ta[x] = [];\n\t\t\tfor(var y=0;y<d;y++) {\n\t\t\t\ta[x][y] = [];\n\t\t\t\tfor(var z=0;z<d;z++) {\n\t\t\t\t\ta[x][y][z] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(var x=0;x<d;x++) {\n\t\tfor(var z=0;z<d;z++) {\n\t\t\tvar n = 1;\n\t\t\tvar val = count(x,z);\n\t\t\tif(x > 0) {\n\t\t\t\tn++;\n\t\t\t\tval += count(x-1,z);\n\t\t\t}\n\t\t\tif(x < d-1) {\n\t\t\t\tn++;\n\t\t\t\tval += count(x+1,z);\n\t\t\t}\n\t\t\tif(z > 0) {\n\t\t\t\tn++;\n\t\t\t\tval += count(x,z-1);\n\t\t\t}\n\t\t\tif(z < d-1) {\n\t\t\t\tn++;\n\t\t\t\tval += count(x,z+1);\n\t\t\t}\n\t\t\tval = Math.ceil(val / n);\n\n\t\t\tif(val == Number.NaN)\n\t\t\t\tconsole.log('number is NAN');\n\t\t\tset(a,x,z,val);\n\t\t}\n\t\t}\n\t\tt = a;\n\t}\n\n\tconsole.log(t.length, t[0].length, t[0][0].length);\n\n\tconsole.log(\"generating terrain..\");\n\n\n\tobject.begin({material:\"textures\",renderOperation:4});\n\t\n\n\tfor(var y=0;y<d;y++) {\n\tfor(var x=0;x<d;x++) {\n\tfor(var z=0;z<d;z++) {\n\n\t\tif(typeof(t[x][y][z]) == 'undefined')\n\t\t{\n\t\t\tconsole.log(\"undefined\");\n\t\t}\n\t\tif(t[x][y][z] == false)\n\t\t\tcontinue;\n\t\t//console.log(x,y,z);\n\t\tcreateCubeMesh2(object, x*2-(d), y*2 ,z*2-(d), y < d-1 && t[x][y+1][z] == true);\n\t}\n\t}\n\t}\n\n\n\n\n\tconsole.log(\"generating terrain triangles..\");\n\n\tvar i=0;\n\tfor(var y=0;y<d;y++) {\n\tfor(var x=0;x<d;x++) {\n\tfor(var z=0;z<d;z++) {\n\n\t\tif(t[x][y][z] == false)\n\t\t\tcontinue;\n\n\t\t//bottom\n\t\tif((y>0 && t[x][y-1][z] == false) || y == 0) {\n\t\t\tobject.triangle(i+0,i+1,i+2);\n\t\t\tobject.triangle(i+2,i+3,i+0);\n\t\t}\n\t\ti+=4;\n\t\t//top\n\t\tif(y<d-1 && t[x][y+1][z] == false) {\n\t\t\tobject.triangle(i+2,i+1,i+0);\n\t\t\tobject.triangle(i+0,i+3,i+2);\n\t\t}\n\t\ti+=4;\n\t\t//front\n\t\tif(z < d-1 && t[x][y][z+1] == false) {\n\t\t\tobject.triangle(i+0,i+1,i+2);\n\t\t\tobject.triangle(i+2,i+3,i+0);\n\t\t}\n\t\ti+=4;\n\t\t//back\n\t\tif(z > 0 && t[x][y][z-1] == false) {\n\t\t\tobject.triangle(i+2,i+1,i+0);\n\t\t\tobject.triangle(i+0,i+3,i+2);\n\t\t}\n\t\ti+=4;\n\t\t//left\n\t\tif(x > 0 && t[x-1][y][z] == false) {\n\t\t\tobject.triangle(i+0,i+1,i+2);\n\t\t\tobject.triangle(i+2,i+3,i+0);\n\t\t}\n\t\ti+=4;\n\t\t//right\n\t\tif(x < d-1 && t[x+1][y][z] == false) {\n\t\t\tobject.triangle(i+2,i+1,i+0);\n\t\t\tobject.triangle(i+0,i+3,i+2);\n\t\t}\n\t\ti+=4;\n\t}\n\t}\n\t}\n\n\n\tobject.end();\n\n\tconsole.log(\"generating terrain.. done!\");\n\n\tobject.convertToMesh(meshName);\n}", "title": "" } ]
[ { "docid": "414a53e1cc5fcab2917590aca74be7b4", "score": "0.71846825", "text": "function prepareTerrain() {\n var seedText = document.getElementById(\"seedText\");\n var sizeSlider = document.getElementById(\"worldSize\");\n var scaleSlider = document.getElementById(\"scale\");\n var octavesSlider = document.getElementById(\"octaves\");\n\n var size = parseInt(sizeSlider.value);\n var scale = parseInt(scaleSlider.value) / 1000;\n var octaves = parseInt(octavesSlider.value);\n var simplex = new NoiseCalculator(seedText.value, octaves, scale);\n\n terrain.mesh = new Mesh(gl, simplex, size);\n terrain.plane = new Plane(gl, simplex, size);\n terrain.lowPoly = new LowPoly(gl, simplex, size);\n}", "title": "" }, { "docid": "e07cd0cd0049cdf057d0aad8e4a33531", "score": "0.7084111", "text": "function makeTerrain(){\n //Parameters affecting terrain generation\n var paddingSize=5;\n var scaleUp=4;\n var smoothingRadius=3;\n //Get terrain data\n var terrainData=generateTerrainData(worldData.emoScores,paddingSize,scaleUp,smoothingRadius);\n //Unpack terrain data\n var flattenedArr=terrainData.flattenedArr;\n var helperArrFlat=terrainData.helperArrFlat;\n var wS=terrainData.wS;\n var hS=terrainData.hS;\n var numChunks=terrainData.numChunks;\n //Set variables in exported object\n globalTerrainData.terrainWidth=terrainData.terrainWidth;\n globalTerrainData.terrainHeight=terrainData.terrainHeight;\n globalTerrainData.playerStartX=terrainData.xBound-terrainData.paddingX/4;\n globalTerrainData.xBound=terrainData.xBound;\n globalTerrainData.zBound=terrainData.zBound;\n //Generate and return mesh\n return generateMesh(globalTerrainData.terrainWidth,globalTerrainData.terrainHeight,wS,hS,numChunks,flattenedArr,helperArrFlat)\n}", "title": "" }, { "docid": "7a552f36af99ebc738f5aafed2d60d7c", "score": "0.6626929", "text": "async createTerrain() {}", "title": "" }, { "docid": "6526aa9854efcc03152af3378b51edf8", "score": "0.64382887", "text": "function setupBuffers() \n{\n setupTerrainBuffers();\n}", "title": "" }, { "docid": "64f5c1ef76111e04333c83c6f2900074", "score": "0.63315856", "text": "function generateTerrainData(emoScores,paddingSize,scaleUp,smoothingRadius){\n //Make sure emoScores contains only numbers\n emoScores=numifyData(emoScores);\n //Create a helper array that will undergo the same transformations as the main array,\n //but preserve its path number (anger=0/joy=1/fear=2) and chunk number\n var helperArr=generateHelperArr(emoScores);\n //Pad both arrays\n padArray(emoScores,paddingSize);\n padArray(helperArr,paddingSize,[-1,-1]);\n //get terrainWidth and terrainHeight\n var terrainWidth=emoScores.length*250;\n var terrainHeight=emoScores[0].length*200;\n //get wS and hS\n var wS=(emoScores[0].length*scaleUp)-1;\n var hS=(emoScores.length*scaleUp)-1;\n //Establish padding and bounds\n var paddingX=(paddingSize/(emoScores[0].length+paddingSize))*terrainWidth;\n var paddingZ=(paddingSize/(emoScores.length+paddingSize))*terrainHeight;\n var xBound=terrainWidth/2-(paddingX/2);\n var zBound=terrainHeight/2-(paddingZ/2);\n //Magnify both arrays\n var scaledArr=magnifyArray(emoScores,scaleUp);\n var helperArr=magnifyArray(helperArr,scaleUp);\n //Smooth both arrays to prevent blocky terrain\n var smoothedArr=smoothArray(scaledArr,smoothingRadius);\n //Flatten both arrays\n var flattenedArr=flattenArray(smoothedArr);\n var helperArrFlat=flattenArray(helperArr);\n //Determine total number of chunks\n var numChunks=scaledArr[0].length;\n return {flattenedArr: flattenedArr, numChunks:numChunks, helperArrFlat:helperArrFlat,wS:wS,hS:hS,terrainWidth:terrainWidth, terrainHeight:terrainHeight, paddingX:paddingX, paddingZ:paddingZ,xBound:xBound,zBound:zBound};\n\n}", "title": "" }, { "docid": "a8c5c308105c9839f5e3748c8aedaefe", "score": "0.6137704", "text": "function generateCityTerrain() {\n \n\tvar streetHeight = 2 * curbHeight;\n \n\t// Initialize the base mesh parameters and create the base mesh\n \n\tvar baseColor = colors.DARK_BROWN;\n \n\tvar baseGeometryParams = {\n\t width: getCityWidth(),\n\t height: groundHeight,\n\t depth: getCityLength()\n\t};\n \n\tvar basePosition = {\n\t x: 0,\n\t y: -(groundHeight / 2) - streetHeight,\n\t z: 0\n\t};\n \n\tvar baseMesh = getBoxMesh(baseGeometryParams, basePosition, baseColor);\n \n\t// Initialize the water mesh parameters and create the water mesh\n \n\tvar waterGeometryParams = {\n\t width: getCityWidth() - 2,\n\t height: 0,\n\t depth: getCityLength() - 2\n\t};\n \n\tvar waterPosition = {\n\t x: 0,\n\t y: -streetHeight,\n\t z: 0\n\t};\n \n\tvar water = getWaterMesh(waterGeometryParams, waterPosition);\n \n\t// Create the ground level / street level meshes and add them to a list\n \n\tvar groundMeshList = [];\n\tvar streetMeshList = [];\n \n\tfor (i = 0; i < groundMap.length; i++) {\n\t for (j = 0; j < groundMap[0].length; j++) {\n\t\t \n\t\t if (isGroundBlock(i, j)) {\n\t\t\t\n\t\t\t var x = getSceneXCoordinate(i);\n\t\t\t var z = getSceneZCoordinate(j);\n \n\t\t\t groundMeshList.push(\n\t\t\t\tgetBoxMesh(\n\t\t\t\t // Geometry parameters\n\t\t\t\t {\n\t\t\t\t\t width: blockSize,\n\t\t\t\t\t height: 0,\n\t\t\t\t\t depth: blockSize\n\t\t\t\t },\n\t\t\t\t // Positional parameters\n\t\t\t\t {\n\t\t\t\t\t x: x,\n\t\t\t\t\t y: -streetHeight,\n\t\t\t\t\t z: z\n\t\t\t\t }, // Mesh color\n\t\t\t\t colors.DARK_BROWN\n\t\t\t\t)\n\t\t\t );\n \n\t\t\t streetMeshList.push(\n\t\t\t\tgetBoxMesh(\n\t\t\t\t // Geometry parameters\n\t\t\t\t {\n\t\t\t\t\t width: blockSize,\n\t\t\t\t\t height: streetHeight,\n\t\t\t\t\t depth: blockSize\n\t\t\t\t },\n\t\t\t\t // Positional parameters\n\t\t\t\t {\n\t\t\t\t\t x: x,\n\t\t\t\t\t y: -streetHeight / 2,\n\t\t\t\t\t z: z\n\t\t\t\t }, // Mesh color\n\t\t\t\t colors.STREET\n\t\t\t\t)\n\t\t\t );\n\t\t }\n\t\t \n\t }\n\t}\n \n\t// Merge the street / ground level meshes and add them to the scene\n \n\tif (streetMeshList.length) scene.add(getMergedMesh(streetMeshList));\n\tif (groundMeshList.length) scene.add(getMergedMesh(groundMeshList));\n \n\t// Finally, add in the base and water meshes to finish off the terrain\n\tscene.add(baseMesh, water);\n \n }", "title": "" }, { "docid": "ca27712a06c8c8b3664ac4237868f55c", "score": "0.61269474", "text": "function TerrainGenerator(cP, loadFromFile) {\n this._vertexColors = [];\n Terrain.light = new Core.Light();\n\n Terrain.camera = new Core.PerspectiveCamera(cP);\n\n /* Create the scene */\n Terrain.scene = new Core.Scene();\n\n /* Add camera and light to the scene */\n Terrain.scene._addCamera(Terrain.camera);\n Terrain.scene._addLight(Terrain.light);\n\n if (!loadFromFile) {\n Terrain.renderer = new Core.Renderer();\n this._textureUrl = '../assets/textures/1.png';\n this._textureUrl2 = '../assets/textures/3.png';\n this._textureUrl3 = '../assets/textures/2.png';\n this._updateTerrain();\n }\n\n this._setFog();\n this._setEnvironment();\n this._addWater();\n\n Terrain.controls = new THREE.OrbitControls(Terrain.camera.threeCamera, Terrain.renderer.threeRenderer.domElement);\n }", "title": "" }, { "docid": "310a1c0d9809848955c884475c97868f", "score": "0.5999516", "text": "function init() {\n terrainPattern = ctx.createPattern(resources.get('img/field1.jpeg'), 'repeat');\n\n document.getElementById('play-again').addEventListener('click', function () {\n reset();\n });\n\n reset();\n lastTime = Date.now();\n\n main();\n}", "title": "" }, { "docid": "2e55863c54b98040ca03d49e3a8dc28d", "score": "0.5997865", "text": "renderScene() {\n\n this.initSeed();\n\n this.seed = this.randRange(0, 1) * 1000.0; //Sets the seed -> manual control\n this.waterLevel = 1-(this.menuItem.getTotalH2oPerGram() / 5);//0.7;//this.randRange(0.1, 0.5); //Sets water level random -> manual control\n\n //this.updateNormalScaleForRes(this.resolution); //Updates normal for scale -> manual control\n this.renderBiomeTexture(); //Updates biome texture (updates biome.texture) -> manual control in that method\n\n this.clouds.resolution = this.resolution;\n\n window.renderQueue.start();\n\n let resMin = 0.01;\n let resMax = 5.0;\n\n this.heightMap.render({ //HEIGHT MAP DETERMINES WHAT IS DRAWN TO WHAT BIOME!!!\n seed: this.seed,\n resolution: this.resolution,\n res1: this.randRange(resMin, resMax),\n res2: this.randRange(resMin, resMax),\n resMix: this.randRange(resMin, resMax),\n mixScale: this.randRange(0.5, 1.0),\n doesRidged: Math.floor(this.randRange(0, 4))\n });\n\n let resMod = this.randRange(3, 10);\n resMax *= resMod;\n resMin *= resMod;\n\n this.moistureMap.render({\n seed: this.seed + 392.253,\n resolution: this.resolution,\n res1: this.randRange(resMin, resMax),\n res2: this.randRange(resMin, resMax),\n resMix: this.randRange(resMin, resMax),\n mixScale: this.randRange(0.5, 1.0),\n doesRidged: Math.floor(this.randRange(0, 4))\n });\n\n this.textureMap.render({\n resolution: this.resolution,\n heightMaps: this.heightMaps,\n moistureMaps: this.moistureMaps,\n biomeMap: this.biome.texture //BIOME TEXTURE IS PASSED HERE TO TEXTURE MAP!!!\n });\n\n this.normalMap.render({\n resolution: this.resolution,\n waterLevel: this.waterLevel,\n heightMaps: this.heightMaps,\n textureMaps: this.textureMaps\n });\n\n this.roughnessMap.render({\n resolution: this.resolution,\n heightMaps: this.heightMaps,\n waterLevel: this.waterLevel\n });\n\n this.clouds.render({\n waterLevel: this.waterLevel\n });\n\n window.renderQueue.addCallback(() => {\n this.updateMaterial();\n });\n }", "title": "" }, { "docid": "f5217b423b3c0dae9391a051e910f508", "score": "0.5995671", "text": "function createTerrain(params) {\n // data for landscape width/height\n const maxHeight = params.data.dem_max;\n const width = params.data.dem_width;\n const height = params.data.dem_height;\n // make sure the textures repeat wrap\n params.heightmap.wrapS = params.heightmap.wrapT = THREE.RepeatWrapping;\n params.rock.wrapS = params.rock.wrapT = THREE.RepeatWrapping;\n params.grass.wrapS = params.grass.wrapT = THREE.RepeatWrapping;\n params.snow.wrapS = params.snow.wrapT = THREE.RepeatWrapping;\n params.sand.wrapS = params.sand.wrapT = THREE.RepeatWrapping;\n params.water.wrapS = params.water.wrapT = THREE.RepeatWrapping;\n const geo = new THREE.PlaneBufferGeometry(width, height, width - 1, height - 1);\n geo.rotateX(-Math.PI / 2);\n let vertices = geo.getAttribute('position');\n for (var i = 0; i < vertices.count; i++) {\n vertices.setY(i, params.heights[i] * params.disp);\n }\n geo.computeVertexNormals();\n const mat = new THREE.ShaderMaterial({\n uniforms: {\n // textures for color blending\n heightmap: { type: \"t\", value: params.heightmap },\n rock: { type: \"t\", value: params.rock },\n snow: { type: \"t\", value: params.snow },\n grass: { type: \"t\", value: params.grass },\n sand: { type: \"t\", value: params.sand },\n // lighting\n lightPosition: { type: \"3f\", value: SUN },\n ambientProduct: { type: \"c\", value: AMBIENT },\n diffuseProduct: { type: \"c\", value: DIFFUSE },\n specularProduct: { type: \"c\", value: SPEC },\n shininess: { type: \"f\", value: SHINY }\n },\n vertexShader: params.vertShader,\n fragmentShader: params.fragShader\n });\n const mesh = new THREE.Mesh(geo, mat);\n mesh.name = 'terrain';\n // never reuse\n geo.dispose();\n mat.dispose();\n return mesh;\n }", "title": "" }, { "docid": "d42a9275d61d6ba01d228db621ef5b47", "score": "0.5993719", "text": "function setup() {\n createCanvas(600, 600, WEBGL);\n\n // grid proportion\n cols = w / scl;\n rows = h / scl;\n\n // Store the x and y grid values in an array\n for (var x = 0; x < cols; x++) {\n terrain[x] = [];\n for (var y = 0; y < rows; y++) {\n terrain[x][y] = 0;\n }\n }\n\n\n // CUSTOMIZE\n createP('Change Altitude');\n terrainHeight_slider = createSlider(20, 300, 160, 20);\n\n}", "title": "" }, { "docid": "be2f3b271b107e9b7c7a76fe27c80263", "score": "0.59519005", "text": "function main() {\n setupWebGL(); // set up the webGL environment\n setupShaders(); // setup the webGL shaders\n\n gl.viewport(0,0,gl.viewportWidth,gl.viewportHeight);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // clear frame/depth buffers\n\n //loadTriangles(); // load in the triangles from tri file\n //loadSpheres(); // load in the triangles from spheres file\n\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n} // end main", "title": "" }, { "docid": "b9cf8acf7c230329727882663e75e250", "score": "0.59447724", "text": "function generateMesh(terrainWidth,terrainHeight,wS,hS,numChunks,flattenedArr,helperArrFlat){\n //Generate geometry and material\n var geometry = new THREE.PlaneGeometry(terrainWidth,terrainHeight,wS,hS);\n var material = new THREE.MeshLambertMaterial({ color: 0xBA8BA9, shading: THREE.FlatShading});\n //Determine distance Z (the width of each path) - and distance X (the length of the terrain representing a single chunk). \"Z,\" not \"Y\", because this will be the Z direction once the plane is rotated. \n globalTerrainData.distanceZ=Math.abs(Math.round(geometry.vertices[1].x-geometry.vertices[0].x));\n globalTerrainData.distanceX=Math.abs(Math.round(geometry.vertices[numChunks].y-geometry.vertices[0].y));\n //Manipulate the vertices of the plane\n for(var i=0; i<geometry.vertices.length; i++){\n geometry.vertices[i].z = flattenedArr[i]*200;\n }\n //Track information about the different parts of the terrain\n buildZonesDict(helperArrFlat,geometry,i);\n //compute normals\n geometry.computeFaceNormals();\n geometry.computeVertexNormals();\n //Create and rotate mesh\n var plane = new THREE.Mesh(geometry, material);\n plane.rotation.x = -Math.PI / 2;\n plane.castShadow=true;\n plane.receiveShadow=true;\n makeBase(terrainWidth,terrainHeight,material);\n return plane\n}", "title": "" }, { "docid": "a4e96ed7f9fa0f23fac7de3a9d253b54", "score": "0.5934008", "text": "function buildMap(json) {\n //TODO: get rid of loader\n //$(\"#loader\").hide();\n\n stage.removeAllChildren();\n\n // Generate random background, portals, and critters\n var backgrounds = [loader.getResult(\"grass\"), loader.getResult(\"sand\")];\n var background = new Background(backgrounds[Math.floor(Math.random() * backgrounds.length)]);\n \n var dirs = json['dirs'];\n var files = json['files'];\n var wd = json['pwd'];\n\n stage.addChild(background);\n\n var wdText = new createjs.Text(wd, \"14px Cambria\", \"#000000\");\n //rect.graphics.beginFill(\"white\").drawRect(x-5, y-5, msg.lineWidth+10, msg.lineHeight+10);\n wdText.x = 0;\n wdText.y = canvas.height-20;\n stage.addChild(wdText);\n\n upPortal = new Portal(canvas.width / 3, 0, [\"..\"], loader.getResult(\"portal\"));\n stage.addChild(upPortal.sprite, upPortal.name);\n\n if (dirs.length !== 0) {\n downPortal = new Portal(canvas.width / 3, canvas.height / 1.8, dirs, loader.getResult(\"portal\"));\n stage.addChild(downPortal.sprite, downPortal.name);\n }\n\t\t\n if (!player)\n player = new Player(loader.getResult(\"player\"));\n player.sprite.x = canvas.width / 3;\n player.sprite.y = canvas.height / 3.2;\n\n stage.addChild(player.sprite);\n\n critters = [];\n\t\t$.each(files, function(index, file) {\n var randomX = Math.random() * canvas.width / 2;\n var randomY = Math.random() * canvas.height / 2;\n var critter = new Critter(randomX, randomY, file, loader.getResult(\"critter\"));\n critters.push(critter);\n stage.addChild(critter.sprite, critter.name);\n\t\t});\n\n disk = new Inventory(\"disk\", loader.getResult(\"disk\"));\n\t\tlightsaber = new Inventory(\"lightsaber\", loader.getResult(\"lightsaber\"));\n\t\tcat = new Inventory(\"cat\", loader.getResult(\"cat\"));\n\t\t\n\t\tstage.addChild(disk, lightsaber, cat);\n\t\t\n stage.update();\n\n $(\"#dirDiv\").fadeOut(); \n $(\"#canvas\").fadeIn();\n loadingMap = false;\n\n // Start game timer\n if (!createjs.Ticker.hasEventListener(\"tick\")) {\n createjs.Ticker.timingMode = createjs.Ticker.RAF;\n createjs.Ticker.addEventListener(\"tick\", update);\n }\n\t}", "title": "" }, { "docid": "69cba1a1d7ec7900c0e07f79bcbdd171", "score": "0.59307456", "text": "function generatePreceduralMaps() {\n \n\tnoise.seed(Math.random());\n \n\t// Noise frequency values we're using to generate our block distribution. The higher the value, the smoother the\n\t// distribution:\n \n\t// This is the general noise distribution used for the ground / water block assignments\n\tvar generalNoiseFrequency = 15;\n \n\t// This is the ground noise distribution used for the building / park / parking block assignments\n\tvar groundNoiseFrequency = 8;\n \n\t// Arrays to use in order to hold our generated noise values\n\tvar generalNoiseDistribution = [];\n\tvar groundNoiseDistribution = [];\n \n\t// Generate the ground / general noise arrays holding the perlin noise distribution\n\tfor (i = 0; i < gridSize; i++) {\n\t for (j = 0; j < gridSize; j++) {\n\t\t generalNoiseDistribution.push(getNoiseValue(i, j, generalNoiseFrequency));\n\t\t groundNoiseDistribution.push(getNoiseValue(i, j, groundNoiseFrequency));\n\t }\n\t}\n \n\t// Generate a normalized noise array which holds a range of values between [0, 1]\n\tvar normalizedDistribution = normalizeArray(generalNoiseDistribution);\n \n\t// Map our noises to an binary array which serves as an indicator showing whether the array element is a\n\t// ground block or a water block\n\tvar groundDistributionMap = normalizedDistribution.map(function (arrayValue) {\n\t return arrayValue <= groundThreshold ? true : false;\n\t});\n \n\t// Transform the 1-D ground mapping into a 2-D array with (x, z) coordinates\n\tgroundMap = generate2DArray(groundDistributionMap, gridSize);\n \n\t// Generate a normalized array for our ground distribution\n\tvar normalizedGroundDistribution = normalizeArray(groundNoiseDistribution);\n \n\t// Map our noises to an array holding binary values which indicate whether it's a building or a park block\n\tvar buildingDistributionMap = normalizedGroundDistribution.map(function (\n\t arrayValue,\n\t index\n\t) {\n\t return groundDistributionMap[index] && arrayValue > parkThreshold ?\n\t\t true :\n\t\t false;\n\t});\n \n\t// Transform the 1-D building mapping into a 2-D array with (x, z) coordinates\n\tbuildingMap = generate2DArray(buildingDistributionMap, gridSize);\n }", "title": "" }, { "docid": "44ef65113da9b72f19b3694a2f730618", "score": "0.59246707", "text": "function createScene01(){\n thePlayer.mapLoc = [150,500,50,50];\n // ----------------------------Map\n let sceneArray = [[0, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 7.5, 8, 8.5],[0, .5, 1, 1.5, 5, 5.5, 7.5, 8, 8.5], [0, .5, 1, 1.5, 5.5, 7.5, 8.5], [0, .5, 8.5], [0, .5, 3.5, 4, 4.5, 8.5], [0, .5, 3.5, 4, 4.5, 8.5], [0, .5, 1, 3.5, 4, 4.5, 8.5], [0, 3.5, 4, 4.5, 8.5], [], [0, 3, 8.5], [0, 3, 8.5], [0, 3, 8, 8.5], [0, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5]];\n var imgSrc = document.getElementById('rocks');\n let y = 0;\n sceneArray.forEach((value) => {\n value.forEach((x) => {\n makeBlock(x, y, imgSrc);\n });\n y += 50;\n });\n\n var imgSrc = document.getElementById('bridge');\n new PassThruMaker(200, 400, 50, 50, imgSrc);\n new PassThruMaker(750, 400, 50, 50, imgSrc);\n\n var imgSrc = document.getElementById('river');\n for (var i = 0; i < 150; i += 50){\n new BlockMaker(i, 400, 50, 50, imgSrc);\n }\n for (i = 200; i < 750; i += 50){\n new BlockMaker(i, 400, 50, 50, imgSrc);\n }\n for (i = 800; i < boardWidth; i += 50){\n new BlockMaker(i, 400, 50, 50, imgSrc);\n }\n //-------------------------------------------------Zone Events\n new EventTrigger(600, -25, 150, 25, function(){\n theHero.clearRect(thePlayer.mapLoc[0], thePlayer.mapLoc[1], thePlayer.mapLoc[2], thePlayer.mapLoc[3]);\n thePlayer.mapLoc[1] = 600;\n loadZone('scene02');\n });\n //----------------------------------------------containers\n var imgSrc1 = document.getElementById('chest');\n var imgSrc2 = document.getElementById('chest-open');\n new ContainerMaker(800, 100, 50, 50, imgSrc1, imgSrc2, 'chest', ['gold', 25]);\n //-----------------------------------------create zone object\n new ZoneMaker('scene01', mapArray, passThruArray, npcArray, containerArray, eventArray, itemArray);\n}", "title": "" }, { "docid": "dffd27d944b81472de582bad97eba80f", "score": "0.592414", "text": "function getTerrain(){\n var terrain = ee.Algorithms.Terrain(srtm.resample('bicubic'));\n return terrain;\n}", "title": "" }, { "docid": "a56b9312452ece835c2dfdcfa979e73a", "score": "0.59208786", "text": "function Terrain(heightData, worldWidth, levels, resolution)\n{\n THREE.Object3D.call(this);\n\n this.worldWidth = (worldWidth !== undefined) ? worldWidth : 1024;\n this.levels = (levels !== undefined) ? levels : 6;\n this.resolution = (resolution !== undefined) ? resolution : 128;\n this.heightData = heightData;\n\n // Offset is used to re-center the terrain, this way we get the greates detail\n // nearest to the camera. In the future, should calculate required detail level per tile\n this.offset = new THREE.Vector3(0, 0, 0);\n\n // Create geometry that we'll use for each tile, just a standard plane\n this.tileGeometry = new THREE.PlaneGeometry(1, 1, this.resolution, this.resolution);\n // Place origin at bottom left corner, rather than center\n var m = new THREE.Matrix4();\n m.makeTranslation(0.5, 0.5, 0);\n this.tileGeometry.applyMatrix(m);\n\n // Create collection of tiles to fill required space\n /*jslint bitwise: true */\n var initialScale = this.worldWidth / Math.pow(2, levels);\n\n // Create center layer first\n // +---+---+\n // | O | O |\n // +---+---+\n // | O | O |\n // +---+---+\n this.createTile(-initialScale, -initialScale, initialScale, Edge.NONE);\n this.createTile(-initialScale, 0, initialScale, Edge.NONE);\n this.createTile(0, 0, initialScale, Edge.NONE);\n this.createTile(0, -initialScale, initialScale, Edge.NONE);\n\n // Create \"quadtree\" of tiles, with smallest in center\n // Each added layer consists of the following tiles (marked 'A'), with the tiles\n // in the middle being created in previous layers\n // +---+---+---+---+\n // | A | A | A | A |\n // +---+---+---+---+\n // | A | | | A |\n // +---+---+---+---+\n // | A | | | A |\n // +---+---+---+---+\n // | A | A | A | A |\n // +---+---+---+---+\n for (var scale = initialScale; scale < worldWidth; scale *= 2)\n {\n this.createTile(-2 * scale, -2 * scale, scale, Edge.BOTTOM | Edge.LEFT);\n this.createTile(-2 * scale, -scale, scale, Edge.LEFT);\n this.createTile(-2 * scale, 0, scale, Edge.LEFT);\n this.createTile(-2 * scale, scale, scale, Edge.TOP | Edge.LEFT);\n\n this.createTile(-scale, -2 * scale, scale, Edge.BOTTOM);\n // 2 tiles 'missing' here are in previous layer\n this.createTile(-scale, scale, scale, Edge.TOP);\n\n this.createTile(0, -2 * scale, scale, Edge.BOTTOM);\n // 2 tiles 'missing' here are in previous layer\n this.createTile(0, scale, scale, Edge.TOP);\n\n this.createTile(scale, -2 * scale, scale, Edge.BOTTOM | Edge.RIGHT);\n this.createTile(scale, -scale, scale, Edge.RIGHT);\n this.createTile(scale, 0, scale, Edge.RIGHT);\n this.createTile(scale, scale, scale, Edge.TOP | Edge.RIGHT);\n }\n /*jslint bitwise: false */\n}", "title": "" }, { "docid": "9bb641b545aca6a371012231477338b4", "score": "0.5915258", "text": "function main() {\n \n setupWebGL(); // set up the webGL environment\n loadTriangles(); // load in the triangles from tri file\n loadEllipsoids(); // load in the ellipsoids from ellipsoids file\n setupShaders(); // setup the webGL shaders\n document.onkeypress = keyboard;\n document.onkeydown = keyboard2;\n renderStuff();\n \n} // end main", "title": "" }, { "docid": "9349ce45499bd35bc4d13aea886a916c", "score": "0.5910602", "text": "function init() {\n\n lastTime = Date.now();\n\n backgroundPattern = ctx.createPattern(resources.get(stage1Url), 'no-repeat');\n\n //Cuando se termina de cargar la escena, da inicio al bucle principal\n scene.load(\"level1-map\").done(function () {\n\n //Matriz de 20 x 15 que representa el mapa del nivel y la ubicación de los tiles colisionables\n level = listToMatrix(scene.tilesetInfo.layers[1].data, 20);\n\n main();\n });\n}", "title": "" }, { "docid": "ccc248c61f7919ff880d2257622dbc94", "score": "0.5910151", "text": "function setupBuffers() {\n setupTerrainBuffers();\n}", "title": "" }, { "docid": "4da3f51cf8a37e8d983743fac53c87d9", "score": "0.5894171", "text": "function main() {\n gl = GLInstance(\"mycanvas\")\n .fFitScreen(0.95,0.9)\n .fClear();\n\n camera = new Camera(gl);\n camera.transform.position.set(0,1,3);\n cameraCtrl = new CameraController(gl, camera);\n\n gridFloor = new GridFloor(gl);\n \n rendLoop = new RenderLoop(onRender);\n\n Resources.setup(gl, onReady)\n .loadTexture(\n \"atlas\", \"./images/atlas_mindcraft.png\")\n .start();\n}", "title": "" }, { "docid": "b7ffe3aba22f908881ba322732a5709f", "score": "0.5891059", "text": "function showTerrain() {\n var terrainLoader = new THREE.TerrainLoader();\n $(\"#loading_text\").append('<br><span id=\"height_info\">Ladataan kartan korkeustietoja...</span>');\n terrainLoader.load('/data/tampere_height.bin', function(data) {\n\t//console.log(data);\n\n\tmodifyPlaneGeometryHeight(data);\n \n\t$(\"#loading_text\").append('<br><span id=\"landmark_info\">Ladataan maamerkkejä...</span>');\n\tshowLandmarks();\n\n\t$(\"#height_info\").text('Ladataan kartan korkeustietoja... valmis.');\n\n }, function(event) {\n\t//console.log(event);\n\tif (event.total != null && event.loaded != null) {\n\t var percentProgress = Math.round(event.loaded / event.total * 100);\n\t //console.log(percentProgress);\n\t $(\"#height_info\").text('Ladataan kartan korkeustietoja... ' + percentProgress + '% ladattu');\n\t}\n }, function (event) {\n\tconsole.log(event);\n });\n}", "title": "" }, { "docid": "cc3f8e7e6b8957ff01359a164de351db", "score": "0.5875385", "text": "function setupTerrainBuffers() \n{\n \n var vTerrain=[];\n var fTerrain=[];\n var nTerrain=[];\n var eTerrain=[];\n var gridN=128;\n \n var numT = terrainFromIteration(gridN, -50,50,-50,50, vTerrain, fTerrain, nTerrain);\n console.log(\"Generated \", numT, \" triangles\"); \n tVertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, tVertexPositionBuffer); \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vTerrain), gl.STATIC_DRAW);\n tVertexPositionBuffer.itemSize = 3;\n tVertexPositionBuffer.numItems = (gridN+1)*(gridN+1);\n \n // Specify normals to be able to do lighting calculations\n tVertexNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, tVertexNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(nTerrain), gl.STATIC_DRAW);\n tVertexNormalBuffer.itemSize = 3;\n tVertexNormalBuffer.numItems = (gridN+1)*(gridN+1);\n \n // Specify faces of the terrain \n tIndexTriBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexTriBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(fTerrain), gl.STATIC_DRAW);\n tIndexTriBuffer.itemSize = 1;\n tIndexTriBuffer.numItems = numT*3;\n \n //Setup Edges\n generateLinesFromIndexedTriangles(fTerrain,eTerrain); \n tIndexEdgeBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexEdgeBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(eTerrain), gl.STATIC_DRAW);\n tIndexEdgeBuffer.itemSize = 1;\n tIndexEdgeBuffer.numItems = eTerrain.length;\n \n}", "title": "" }, { "docid": "4d8810f114979c62a38a328c3a5550fe", "score": "0.58745015", "text": "initMaterials(){\n \n this.terrainTexture = new CGFtexture(this.scene, 'images/terrain2.jpg');\n this.terrainMap = new CGFtexture(this.scene, 'images/heightmap2.jpg');\n \tthis.terrainGradient = new CGFtexture(this.scene, 'images/altimetry.png');\n\n }", "title": "" }, { "docid": "2bc1e7cf4baf88d30d00e707d6005ef8", "score": "0.58724976", "text": "function WebGLTurbulenzEngine() {}", "title": "" }, { "docid": "e38bb5ea3567a298477c38197e120f93", "score": "0.58636516", "text": "function generate_terrain(detail, roughness) {\n // The actual size of the data must be a power of two in each direction\n let size = Math.pow(2, detail) + 1;\n let max = size - 1;\n let map = new Array(size);\n for (let i = 0; i < size; i++) { map[i] = new Float32Array(size); }\n\n // Start with all random values in the map\n let scale = roughness*size;\n map[0][0] = Math.random()*scale*2 - scale;\n map[max][0] = Math.random()*scale*2 - scale;\n map[max][max] = Math.random()*scale*2 - scale;\n map[0][max] = Math.random()*scale*2 - scale;\n\n // Recursively run square-diamond algorithm\n divide(map, max);\n \n // Apply median 3x3 filter to the map to smooth it a bit\n map = median3Filter(map);\n \n // Done!\n return map;\n\n function divide(map, sz) {\n // Recursively divides the map, applying the square-diamond algorithm\n let half = sz / 2, scl = roughness * sz;\n if (half < 1) { return; }\n\n for (let y = half; y < max; y += sz) {\n for (let x = half; x < max; x += sz) {\n let offset = Math.random() * scl * 2 - scl;\n map[x][y] = offset + square(x, y, half);\n }\n }\n\n for (let y = 0; y <= max; y += half) {\n for (let x = (y + half) % sz; x <= max; x += sz) {\n let offset = Math.random() * scl * 2 - scl;\n map[x][y] = offset + diamond(x, y, half);\n }\n }\n\n divide(map, half);\n }\n\n function average() {\n // Calculates average of all arguments given (except undefined values)\n // This ignores any x/y coordinate outside the map\n let args = Array.prototype.slice.call(arguments).filter(function (n) { return n === 0 || n; });\n let sum = 0;\n for (let i = 0; i < args.length; i++) { sum += args[i]; }\n return sum / args.length;\n }\n \n function median() {\n // Calculates the median of all arguments given (except undefined values)\n let args = Array.prototype.slice.call(arguments).filter(function (n) { return n === 0 || n; });\n args.sort()\n if ((args.length % 2) === 1) { return args[(args.length-1)/2]; }\n return (args[args.length/2-1] + args[args.length/2]) / 2;\n }\n\n function square(x, y, sz) {\n // Performs a single square computation of the algorithm\n if (x < sz) { return average(map[x+sz][y-sz], map[x+sz][y+sz]); }\n if (x > max - sz) { return average(map[x+sz][y-sz], map[x+sz][y+sz]); }\n return average(map[x-sz][y-sz], map[x+sz][y-sz], map[x+sz][y+sz], map[x-sz][y+sz]);\n }\n\n function diamond(x, y, sz) {\n // Performs a single computation step of the algorithm\n if (x < sz) { return average(map[x][y-sz], map[x+sz][y], map[x][y+sz]); }\n if (x > max-sz) { return average(map[x][y-sz], map[x][y+sz], map[x-sz][y]); }\n return average(map[x][y-sz], map[x+sz][y], map[x][y+sz], map[x-sz][y]);\n }\n\n function median3Filter(src) {\n // Applies a 3x3 median filter to the given array-of-arrays.\n let N = src.length, n = N - 1;\n let block = new Float32Array(3*3);\n let dst = new Array(N);\n for (let y = 0; y < N; y++) { dst[y] = new Float32Array(N); }\n // Core of the 'image'\n for (let y = 0; y < N-2; y++) {\n for (let x = 0; x < N-2; x++) {\n for (let cy = 0; cy < 3; cy++) {\n for (let cx = 0; cx < 3; cx++) {\n block[cy*3+cx] = src[y+cy][x+cx];\n }\n }\n block.sort();\n dst[y+1][x+1] = block[4];\n }\n }\n // Corners\n dst[0][0] = median(src[0][0], src[1][0], src[0][1], src[1][1]);\n dst[n][0] = median(src[n][0], src[n][1], src[n-1][0], src[n-1][1]);\n dst[0][n] = median(src[0][n], src[1][n], src[0][n-1], src[1][n-1]);\n dst[n][n] = median(src[n][n], src[n][n-1], src[n-1][n], src[n-1][n-1]);\n // Edges\n for (let y = 1; y < n; y++) {\n dst[y][0] = median(src[y-1][0], src[y][0], src[y+1][0], src[y-1][1], src[y][1], src[y+1][1]);\n dst[y][n] = median(src[y-1][n], src[y][n], src[y+1][n], src[y-1][n-1], src[y][n-1], src[y+1][n-1]);\n }\n for (let x = 1; x < n; x++) {\n dst[0][x] = median(src[0][x-1], src[0][x], src[0][x+1], src[1][x-1], src[1][x], src[1][x+1]);\n dst[n][x] = median(src[n][x-1], src[n][x], src[n][x+1], src[n-1][x-1], src[n-1][x], src[n-1][x+1]);\n }\n // Done\n return dst;\n }\n}", "title": "" }, { "docid": "c2d8db74dca416d8a824dcf18865cfce", "score": "0.58420616", "text": "function generateTerrain(){\n\n //Variables\n let xOff = start;\n let highestX = 0;\n let highest = height;\n let total = 0;\n\n //Loop\n for(let x = 0; x < width; x += tWidth){\n\n let currentHeight = noise(xOff)*height;\n\n total += currentHeight; //Gather info for average\n \n if (currentHeight < highest){\n highest = currentHeight; //Create new highest\n highestX = x;\n }\n\n //Create the rectangle\n stroke(0);\n strokeWeight(1);\n rect(x, currentHeight, x + tWidth, height);\n xOff += 0.004;\n }\n //Finally, implement the pan, flag, and average\n drawFlag(highestX, highest);\n findAverage(total);\n start += 0.02;\n\n}", "title": "" }, { "docid": "6eebe9cfa3f048481b020fd80e5c159e", "score": "0.583166", "text": "shapeTerrain() {\n // MP2: Implement this function!\n var iterations = 100;\n var deltaHeight = 0.015;\n var H = 0.01;\n\n for (var iteration = 0; iteration < iterations; iteration++) {\n // random position p\n var p_x = this.minX + Math.random() * (this.maxX - this.minX);\n var p_y = this.minY + Math.random() * (this.maxY - this.minY);\n var p = glMatrix.vec2.fromValues(p_x, p_y);\n // random normal vector n\n var n = glMatrix.vec2.create(); glMatrix.vec2.random(n);\n for (var i=0; i<this.numVertices; i++) {\n var b = glMatrix.vec3.create();\n this.getVertex(b, i);\n\n // diff = p - b\n var diff = b.slice(0, 2);\n glMatrix.vec2.sub(diff, p, b);\n var dot_product = glMatrix.vec2.dot(diff, n);\n\n // if dot product is positive -> increase, else -> decrease\n if (dot_product > 0) {\n b[2] += deltaHeight;\n } else {\n b[2] -= deltaHeight;\n }\n\n this.setVertex(b, i);\n }\n // decay delta value for future iterations\n deltaHeight = deltaHeight / Math.pow(2, H);\n }\n }", "title": "" }, { "docid": "85885667aa7e2e55798a1fda87edcad6", "score": "0.58147615", "text": "initBuffers(gl) {\n // Create a buffer for the terrain's vertex positions.\n const terrainPositionBuffer = gl.createBuffer();\n\n // Select the terrainPositionBuffer as the one to apply buffer\n // operations to from here out.\n gl.bindBuffer(gl.ARRAY_BUFFER, terrainPositionBuffer);\n\n // Now create an array of positions for the terrain.\n const unit = this.terrainSize / this.terrainLOD;\n let i = 0, j = 0, offset = 0, offsetX = 0, offsetY = 0, offsetZ = 0, one = 0, k = 0;\n one = - this.terrainSize/2;\n for (i = 0; i < this.terrainLOD; i++) {\n for (j = 0; j < this.terrainLOD; j++) {\n offsetX = one + i * unit;\n offsetZ = one + j * unit;\n\n this.terrainPositions[offset++] = offsetX;\n this.terrainPositions[offset++] = offsetY;\n this.terrainPositions[offset++] = offsetZ;\n\n this.terrainPositions[offset++] = offsetX + unit;\n this.terrainPositions[offset++] = offsetY;\n this.terrainPositions[offset++] = offsetZ;\n\n this.terrainPositions[offset++] = offsetX + unit;\n this.terrainPositions[offset++] = offsetY;\n this.terrainPositions[offset++] = offsetZ + unit;\n\n this.terrainPositions[offset++] = offsetX;\n this.terrainPositions[offset++] = offsetY;\n this.terrainPositions[offset++] = offsetZ + unit;\n }\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(this.terrainPositions), gl.STATIC_DRAW);\n\n\n const terrainTextureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, terrainTextureCoordBuffer);\n\n let terrainTextureCoordinates = [];\n offset = 0;\n\n one = 1 / this.terrainLOD;\n one *= this.textureRepeat;\n\n for (i = 0; i < this.terrainLOD; i++) {\n for (j = 0; j < this.terrainLOD; j++) {\n let left = i * one;\n let roof = j * one;\n\n terrainTextureCoordinates[offset++] = left + one; // X\n terrainTextureCoordinates[offset++] = roof + one; // Y\n\n terrainTextureCoordinates[offset++] = left; // X\n terrainTextureCoordinates[offset++] = roof + one; // Y\n\n terrainTextureCoordinates[offset++] = left; // X\n terrainTextureCoordinates[offset++] = roof; // Y\n\n terrainTextureCoordinates[offset++] = left + one; // X\n terrainTextureCoordinates[offset++] = roof; // Y\n }\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(terrainTextureCoordinates),\n 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 terrainIndexBuffer = gl.createBuffer();\n let start = 0, terrainIndices = [];\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, terrainIndexBuffer);\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 offset = 0;\n start = 0;\n for (i = 0; i < this.terrainLOD; i++) {\n for (j = 0; j < this.terrainLOD; j++) {\n terrainIndices[offset++] = start;\n terrainIndices[offset++] = start + 2;\n terrainIndices[offset++] = start + 1;\n\n terrainIndices[offset++] = start;\n terrainIndices[offset++] = start + 3;\n terrainIndices[offset++] = start + 2;\n start += 4;\n }\n }\n\n // Now send the element array to GL\n\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,\n new Uint16Array(terrainIndices), gl.STATIC_DRAW);\n\n this.buffers = {\n position: terrainPositionBuffer,\n textureCoord: terrainTextureCoordBuffer,\n indices: terrainIndexBuffer,\n };\n\n \n // Load the texture.\n this.loadTexture(gl, 'texture/sand.jpg');\n\n // Load the heightmap.\n this.loadHeightmap(gl, 'texture/island-height.png');\n\n return this.buffers;\n }", "title": "" }, { "docid": "d5dfbc2b188d42e8adc63cde4ddaf839", "score": "0.5812899", "text": "function drawWaves() {\n background(40);\n noStroke();\n\n // ------ set view ------\n push();\n\n if (keyIsDown(RIGHT_ARROW)) {\n noiseXRange += 1;\n }\n // ------ mesh noise ------\n else if (keyIsDown(LEFT_ARROW)) {\n noiseXRange -= 1;\n }\n else if (keyIsDown(UP_ARROW)){\n noiseYRange += 1;\n }\n else if (keyIsDown(DOWN_ARROW)){\n noiseYRange -= 1;\n }\n\n var noiseYMax = 0;\n var tileSizeY = height / tileCount;\n\n push();\n translate(offsetX, offsetY);\n\n for (var meshY = 0; meshY <= tileCount; meshY++) {\n beginShape(TRIANGLE_STRIP);\n for (var meshX = 0; meshX <= tileCount; meshX++) {\n\n var x = map(meshX, 0, tileCount, -width/2, width/2);\n var y = map(meshY, 0, tileCount, -height/2, height/2);\n\n var noiseX = map(meshX, 0, tileCount, 0, noiseXRange);\n var noiseY = map(meshY, 0, tileCount, 0, noiseYRange);\n var z = noise(noiseX, noiseY);\n\n noiseYMax = max(noiseYMax, z);\n var interColor;\n var amount;\n if (z <= threshold) {\n amount = map(z, 0, threshold, 0.15, 1);\n interColor = lerpColor(bottomColor, midColor, amount);\n }\n else {\n amount = map(z, threshold, noiseYMax, 0, 1);\n interColor = lerpColor(midColor, topColor, amount);\n }\n fill(random(400), random(300), 190);\n vertex(x, y, z*zScale);\n\n }\n endShape();\n }\n pop();\n pop();\n\n}", "title": "" }, { "docid": "3d9ff889047b40c52c83161d61d0b643", "score": "0.5792152", "text": "async function main() {\n\t/* const in JS means the variable will not be bound to a new value, but the value can be modified (if its an object or array)\n\t\thttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const\n\t*/\n\n\t// We are using the REGL library to work with webGL\n\t// http://regl.party/api\n\t// https://github.com/regl-project/regl/blob/master/API.md\n\tconst regl = createREGL({\n\t\tprofile: true, // if we want to measure the size of buffers/textures in memory\n\t});\n\tregl_global_handle = regl;\n\t// The <canvas> (HTML element for drawing graphics) was created by REGL, lets take a handle to it.\n\tconst canvas_elem = document.getElementsByTagName('canvas')[0];\n\n\tconst debug_text = document.getElementById('debug-text');\n\n\n\t/*---------------------------------------------------------------\n\t\tResource loading\n\t---------------------------------------------------------------*/\n\n\t/*\n\tThe textures fail to load when the site is opened from local file (file://) due to \"cross-origin\".\n\tSolutions:\n\t* run a local webserver\n\t\tpython -m http.server 8000\n\t\t# open localhost:8000\n\tOR\n\t* edit config in firefox\n\t\tsecurity.fileuri.strict_origin_policy = false\n\t*/\n\n\t// Start downloads in parallel\n\tconst textures = {\n\t\t'sun': load_texture(regl, './textures/sun.jpg'),\n\t\t'earth': load_texture(regl, './textures/earth_day_s.jpg'),\n\t\t'moon': load_texture(regl, './textures/moon.jpg'),\n\t\t'mars': load_texture(regl, './textures/mars.jpg'),\n\t}\n\n\t// Wait for all downloads to complete\n\tfor (const key in textures) {\n\t\tif (textures.hasOwnProperty(key)) {\n\t\t\ttextures[key] = await textures[key]\n\t\t}\n\t}\n\n\n\t/*---------------------------------------------------------------\n\t\tGPU pipeline\n\t---------------------------------------------------------------*/\n\t// Define the GPU pipeline used to draw a sphere\n\tconst draw_sphere = regl({\n\t\t// Vertex attributes\n\t\tattributes: {\n\t\t\t// 3 vertices with 2 coordinates each\n\t\t\tposition: mesh_uvsphere.vertex_positions,\n\t\t\ttex_coord: mesh_uvsphere.vertex_tex_coords,\n\t\t},\n\t\t// Faces, as triplets of vertex indices\n\t\telements: mesh_uvsphere.faces,\n\n\t\t// Uniforms: global data available to the shader\n\t\tuniforms: {\n\t\t\tmat_mvp: regl.prop('mat_mvp'),\n\t\t\ttexture_base_color: regl.prop('tex_base_color'),\n\t\t},\n\n\t\t// Vertex shader program\n\t\t// Given vertex attributes, it calculates the position of the vertex on screen\n\t\t// and intermediate data (\"varying\") passed on to the fragment shader\n\t\tvert: `\n\t\t// Vertex attributes, specified in the \"attributes\" entry of the pipeline\n\t\tattribute vec3 position;\n\t\tattribute vec2 tex_coord;\n\n\t\t// Per-vertex outputs passed on to the fragment shader\n\t\tvarying vec2 v2f_tex_coord;\n\n\t\t// Global variables specified in \"uniforms\" entry of the pipeline\n\t\tuniform mat4 mat_mvp;\n\n\t\tvoid main() {\n\t\t\tv2f_tex_coord = tex_coord;\n\t\t\t// TODO 2.1.1 Edit the vertex shader to apply mat_mvp to the vertex position.\n\t\t\tgl_Position = mat_mvp * vec4(position, 1);\n\t\t}`,\n\n\t\t// Fragment shader\n\t\t// Calculates the color of each pixel covered by the mesh.\n\t\t// The \"varying\" values are interpolated between the values given by the vertex shader on the vertices of the current triangle.\n\t\tfrag: `\n\t\tprecision mediump float;\n\n\t\tvarying vec2 v2f_tex_coord;\n\n\t\tuniform sampler2D texture_base_color;\n\n\t\tvoid main() {\n\t\t\tvec3 color_from_texture = texture2D(texture_base_color, v2f_tex_coord).rgb;\n\n\t\t\tgl_FragColor = vec4(color_from_texture, 1.); // output: RGBA in 0..1 range\n\t\t}`,\n\t});\n\n\tconst mat_mvp = mat4.create();\n\tconst mat_projection = mat4.create();\n\n\t/*---------------------------------------------------------------\n\t\tCamera\n\t---------------------------------------------------------------*/\n\tconst mat_world_to_cam = mat4.create();\n\tconst cam_distance_base = 20;\n\n\tlet cam_angle_z = Math.PI * 0.2; // in radians!\n\tlet cam_angle_y = -Math.PI / 6; // in radians!\n\tlet cam_distance_factor = 1.;\n\n\tfunction update_cam_transform() {\n\t\t/* TODO 2.2\n\t\tCalculate the world-to-camera transformation matrix.\n\t\tThe camera orbits the scene\n\t\t* cam_distance_base * cam_distance_factor = distance of the camera from the (0, 0, 0) point\n\t\t* cam_angle_z - camera ray's angle around the Z axis\n\t\t* cam_angle_y - camera ray's angle around the Y axis\n\t\t*/\n\n\t\t// distance to [0, 0, 0]\n\t\tlet r = cam_distance_base * cam_distance_factor\n\n\t\tlet mat_rotY = mat4.fromYRotation(mat4.create(), cam_angle_y)\n\t\tlet mat_rotZ = mat4.fromZRotation(mat4.create(), cam_angle_z)\n\t\tlet mat_trans = mat4.fromTranslation(mat4.create(), [r, 0, 0] )\n\n\t\t// Example camera matrix, looking along forward-X, edit this\n\t\tconst look_at = mat4.lookAt(mat4.create(),\n\t\t\t[-1, 0, 0], // camera position in world coord\n\t\t\t[0, 0, 0], // view target point\n\t\t\t[0, 0, 1], // up vector\n\t\t);\n\n\t\t// Store the combined transform in mat_world_to_cam\n\t\t// mat_world_to_cam = A * B * ...\n\t\tmat4_matmul_many(mat_world_to_cam, look_at, mat_trans, mat_rotY, mat_rotZ); // edit this\n\t}\n\n\tupdate_cam_transform();\n\n\t// Rotate camera position by dragging with the mouse\n\tcanvas_elem.addEventListener('mousemove', (event) => {\n\t\t// if left or middle button is pressed\n\t\tif (event.buttons & 1 || event.buttons & 4) {\n\t\t\tcam_angle_z += event.movementX*0.005;\n\t\t\tcam_angle_y += -event.movementY*0.005;\n\n\t\t\tupdate_cam_transform();\n\t\t}\n\t});\n\n\tcanvas_elem.addEventListener('wheel', (event) => {\n\t\t// scroll wheel to zoom in or out\n\t\tconst factor_mul_base = 1.08;\n\t\tconst factor_mul = (event.deltaY > 0) ? factor_mul_base : 1./factor_mul_base;\n\t\tcam_distance_factor *= factor_mul;\n\t\tcam_distance_factor = Math.max(0.1, Math.min(cam_distance_factor, 4));\n\t\t// console.log('wheel', event.deltaY, event.deltaMode);\n\t\tupdate_cam_transform();\n\t})\n\n\t/*---------------------------------------------------------------\n\t\tActors\n\t---------------------------------------------------------------*/\n\n\tconst actors_by_name = {\n\t\tsun: {\n\t\t\torbits: null,\n\t\t\ttexture: textures.sun,\n\t\t\tsize: 2.5,\n\t\t\trotation_speed: 0.1,\n\t\t},\n\t\tearth: {\n\t\t\torbits: 'sun',\n\t\t\ttexture: textures.earth,\n\t\t\tsize: 1,\n\t\t\trotation_speed: 1.0,\n\t\t\torbit_radius: 6,\n\t\t\torbit_speed: 0.2,\n\t\t\torbit_phase: 1.7,\n\t\t},\n\t\tmoon: {\n\t\t\torbits: 'earth',\n\t\t\ttexture: textures.moon,\n\t\t\tsize: 0.25,\n\t\t\trotation_speed: 0.6,\n\t\t\torbit_radius: 1.6,\n\t\t\torbit_speed: 0.6,\n\t\t\torbit_phase: 0.5,\n\t\t},\n\t\tmars: {\n\t\t\torbits: 'sun',\n\t\t\ttexture: textures.mars,\n\t\t\tsize: 0.75,\n\t\t\trotation_speed: 1.4,\n\t\t\torbit_radius: 8.0,\n\t\t\torbit_speed: 0.1,\n\t\t\torbit_phase: 0.1,\n\t\t},\n\t};\n\t// actors in the order they should be drawn\n\tconst actors_list = [actors_by_name.sun, actors_by_name.earth, actors_by_name.moon, actors_by_name.mars];\n\n\n\tfor (const actor of actors_list) {\n\t\t// initialize transform matrix\n\t\tactor.mat_model_to_world = mat4.create();\n\n\t\t// resolve orbits by name\n\t\tif(actor.orbits !== null) {\n\t\t\tactor.orbits = actors_by_name[actor.orbits];\n\t\t}\n\t}\n\n\tfunction calculate_actor_to_world_transform(actor, sim_time) {\n\n\t\t/*\n\t\tTODO 2.3\n\t\tConstruct the model matrix for the current planet and store it in actor.mat_model_to_world.\n\n\t\tOrbit (if the parent actor.orbits is not null)\n\t\t\tradius = actor.orbit_radius\n\t\t\tangle = sim_time * actor.orbit_speed + actor.orbit_phase\n\t\t\taround parent's position (actor.orbits.mat_model_to_world)\n\n\t\tSpin around the planet's Z axis\n\t\t\tangle = sim_time * actor.rotation_speed (radians)\n\n\t\tScale the unit sphere to match the desired size\n\t\t\tscale = actor.size\n\t\t\tmat4.fromScaling takes a 3D vector!\n\t\t*/\n\n\t\tconst M_orbit = mat4.create();\n\n\t\tconst angle_spin = sim_time * actor.rotation_speed\n\n\t\tconst mat_rotZ = mat4.fromZRotation(mat4.create(), angle_spin)\n\n\t\tconst mat_scale = mat4.fromScaling(mat4.create(), [actor.size, actor.size, actor.size])\n\n\t\tif(actor.orbits !== null) {\n\t\t\t// Parent's translation\n\t\t\tconst parent_translation_v = mat4.getTranslation([0, 0, 0], actor.orbits.mat_model_to_world);\n const mat_trans_parent = mat4.fromTranslation(mat4.create(), parent_translation_v)\n\n\t\t\tconst angle_orbit = sim_time * actor.orbit_speed + actor.orbit_phase\n\n\t\t\tconst mat_rotOrbit = mat4.fromZRotation(mat4.create(), angle_orbit)\n\n\t\t\tconst radius = actor.orbit_radius\n\n\t\t\tconst mat_trans_around_parent = mat4.fromTranslation(mat4.create(), [radius, 0, 0] )\n\n\t\t\tmat4_matmul_many(M_orbit, mat_trans_parent, mat_rotOrbit, mat_trans_around_parent);\n\n\t\t\t// Orbit around the parent\n\t\t}\n\n\t\t// Store the combined transform in actor.mat_model_to_world\n\t\tmat4_matmul_many(actor.mat_model_to_world, M_orbit, mat_rotZ, mat_scale);\n\t}\n\n\n\t/*---------------------------------------------------------------\n\t\tFrame render\n\t---------------------------------------------------------------*/\n\n\t// Grid, to demonstrate keyboard shortcuts\n\tconst draw_grid = make_grid_pipeline(regl);\n\tlet grid_on = true;\n\tregister_keyboard_action('g', () => grid_on = !grid_on);\n\n\n\tregl.frame((frame) => {\n\t\tconst sim_time = frame.time;\n\n\t\t// Set the whole image to black\n\t\tregl.clear({color: [0, 0, 0, 1]});\n\n\t\tmat4.perspective(mat_projection,\n\t\t\tdeg_to_rad * 60, // fov y\n\t\t\tframe.framebufferWidth / frame.framebufferHeight, // aspect ratio\n\t\t\t0.01, // near\n\t\t\t100, // far\n\t\t)\n\n\t\tfor (const actor of actors_list) {\n\t\t\tcalculate_actor_to_world_transform(actor, sim_time);\n\n\t\t\t// TODO 2.1.2 Calculate the MVP matrix in mat_mvp variable.\n\t\t\t// model matrix: actor.mat_model_to_world\n\t\t\t// view matrix: mat_world_to_cam\n\t\t\t// projection matrix: mat_projection\n\t\t\tmat4_matmul_many(mat_mvp, mat_projection, mat_world_to_cam, actor.mat_model_to_world)\n\n\t\t\tdraw_sphere({\n\t\t\t\tmat_mvp: mat_mvp,\n\t\t\t\ttex_base_color: actor.texture,\n\t\t\t});\n\t\t\t// for better performance we should collect these props and then draw them all together\n\t\t\t// http://regl.party/api#batch-rendering\n\t\t}\n\n\t\tif (grid_on) {\n\t\t\tdraw_grid(mat_projection, mat_world_to_cam);\n\t\t}\n\n\t\tdebug_text.textContent = `\nHello! Sim time is ${sim_time.toFixed(2)} s\nCamera: angle_z ${(cam_angle_z / deg_to_rad).toFixed(1)}, angle_y ${(cam_angle_y / deg_to_rad).toFixed(1)}, distance ${(cam_distance_factor*cam_distance_base).toFixed(1)}\nmat_world_to_cam:\n${mat_world_to_cam}\n`;\n\t})\n}", "title": "" }, { "docid": "483319686336a791e901d2611a28a5f9", "score": "0.57800007", "text": "function terrainFromIteration(n, minX,maxX,minY,maxY, vertexArray, faceArray,normalArray, heightArray)\n{\n var deltaX=(maxX-minX)/n;\n var deltaY=(maxY-minY)/n;\n for(var i=0;i<=n;i++)\n for(var j=0;j<=n;j++)\n {\n vertexArray.push(minX+deltaX*j);\n vertexArray.push(minY+deltaY*i);\n vertexArray.push(heightArray.map[heightArray.getpos(j, i)]);\n \n normalArray.push(0);\n normalArray.push(0);\n normalArray.push(0);\n }\n\n var numT=0;\n for(var i=0;i<n;i++)\n for(var j=0;j<n;j++)\n {\n var vid = i*(n+1) + j;\n faceArray.push(vid);\n faceArray.push(vid+1);\n faceArray.push(vid+n+1);\n \n faceArray.push(vid+1);\n faceArray.push(vid+1+n+1);\n faceArray.push(vid+n+1);\n numT+=2;\n }\n return numT;\n}", "title": "" }, { "docid": "c9c1291d011131f10e929352372aaead", "score": "0.57753736", "text": "function generator(roughness, middle) {\r\n var tempLayers = { layer0: newFilledArray(65536, 0), layer1: newFilledArray(65536, 0) };\r\n // get the points\r\n surface = terrain(ww, wh, wh / 4, roughness, middle);\r\n // draw the points\r\n for (var t = 1; t < surface.length; t++) {\r\n var topsoil;\r\n if (Math.round(surface[t]) >= 134) { topsoil = 23; } else { topsoil = 3 };\r\n tempLayers.layer0.splice(index(t, Math.round(surface[t])), 1, topsoil);\r\n tempLayers.layer1.splice(index(t, Math.round(surface[t])), 1, topsoil);\r\n if (topsoil == 3) { topsoil = 2; };\r\n for (var dirt = 1; dirt < 5; dirt++) {\r\n tempLayers.layer0.splice(index(t, Math.round(surface[t]) + dirt), 1, topsoil);\r\n tempLayers.layer1.splice(index(t, Math.round(surface[t]) + dirt), 1, topsoil);\r\n };\r\n var stone = 1;\r\n y = Math.round(surface[t]) + 4 + stone;\r\n while (y <= wh) {\r\n tempLayers.layer0.splice(index(t, y), 1, 1);\r\n tempLayers.layer1.splice(index(t, y), 1, 1);\r\n if (y == wh) {\r\n tempLayers.layer0[index(t, y)] = 52;\r\n tempLayers.layer1[index(t, y)] = 52;\r\n };\r\n stone++;\r\n y = Math.round(surface[t]) + 4 + stone;\r\n };\r\n };\r\n // veins\r\n veins.forEach(function (element) {\r\n for (var i = (Math.random() * (element.maxVeins - element.minVeins)) + element.minVeins; i > 0; i--) {\r\n var xOffset = Math.round(Math.random() * 256);\r\n var yOffset = Math.round((Math.random() * (element.maxY - element.minY)) + element.minY);\r\n var aSqrd = element.a * element.a;\r\n var bSqrd = element.b * element.b;\r\n for (y = yOffset - element.b; y < (yOffset + element.b) ; y++) {\r\n for (x = xOffset - element.a; x < (xOffset + element.a) ; x++) {\r\n if (((((x - xOffset) * (x - xOffset)) / aSqrd) + (((y - yOffset) * (y - yOffset)) / bSqrd)) <= 1) {\r\n switch (element.data) {\r\n case 4:\r\n if ((tempLayers.layer0[index(x, y)] == 23) || (tempLayers.layer0[index(x, y)] == 2)||(tempLayers.layer0[index(x, y)] == 3)) {\r\n tempLayers.layer0.splice(index(x, y), 1, element.data);\r\n tempLayers.layer1.splice(index(x, y), 1, element.data);\r\n };\r\n break;\r\n case 12:\r\n if ((tempLayers.layer0[index(x, y)] == 23) || (tempLayers.layer0[index(x, y)] == 2)||(tempLayers.layer0[index(x, y)] == 3)) {\r\n tempLayers.layer0.splice(index(x, y), 1, element.data);\r\n tempLayers.layer1.splice(index(x, y), 1, element.data);\r\n };\r\n break;\r\n case 23:\r\n if ((tempLayers.layer0[index(x, y)] == 23) || (tempLayers.layer0[index(x, y)] == 2) || (tempLayers.layer0[index(x, y)] == 3)) {\r\n tempLayers.layer0.splice(index(x, y), 1, element.data);\r\n tempLayers.layer1.splice(index(x, y), 1, element.data);\r\n };\r\n break;\r\n default:\r\n if ((tempLayers.layer0[index(x, y)] != 0) && (tempLayers.layer0[index(x, y)] == 1)) {\r\n tempLayers.layer0.splice(index(x, y), 1, element.data);\r\n };\r\n break;\r\n };\r\n };\r\n };\r\n };\r\n };\r\n });\r\n // water\r\n for (var a = 1; a <= ww; a++) {\r\n var water = 136;\r\n while (tempLayers.layer0[index(a, water)] == 0) {\r\n tempLayers.layer0.splice(index(a, water), 1, 22);\r\n tempLayers.layer1.splice(index(a, water), 1, 23);\r\n water++;\r\n };\r\n };\r\n // caves\r\n tempLayers.layer0 = caves(tempLayers.layer0, Math.PI / 2, 5, 2, 7, 10, 20, 1.5, 2.5);\r\n // trees\r\n x = 0;\r\n while (x <= ww) {\r\n x += Math.round((Math.random() * (12 - 4)) + 4);\r\n y = Math.round(surface[x]);\r\n tempLayers = tree(tempLayers, 'Elm', x, y, 6, 20, 0.9, 0.6);\r\n };\r\n return tempLayers;\r\n}", "title": "" }, { "docid": "dd02bbfc50d24f01be51f450f96c62db", "score": "0.5768978", "text": "function init() {\n \n\tgenerateScene();\n\tgenerateLighting();\n\tgeneratePreceduralMaps();\n\tgenerateCityTerrain();\n\tgenerateGroundBlocks();\n \n }", "title": "" }, { "docid": "8bfd01a7c49bc088a78b1f057e8da354", "score": "0.5768127", "text": "function preload() {\n sunTexture = loadImage('data/sun.jpg');\n textures[0] = loadImage('data/mars.jpg');\n textures[1] = loadImage('data/jupiter.jpg');\n textures[2] = loadImage('data/saturn.jpg');\n textures[3] = loadImage('data/vesta.png');\n\n\n}", "title": "" }, { "docid": "6aebb7c33b20e021f89f41645ae7eaa7", "score": "0.57636774", "text": "function Scene(game, tilesize, window)\r\n{\r\n var map = copyArray([\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n \r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n \r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],\r\n \r\n ]);\r\n \r\n this.game = game;\r\n this.tilesize = tilesize;\r\n this.window = window;\r\n this.tilemap = new TileMap(tilesize, map);\r\n this.mapWidth = this.tilemap.width * tilesize;\r\n this.mapHeight = this.tilemap.height * tilesize;\r\n this.actors = [];\r\n this.particles = [];\r\n this.ticks = 0;\r\n}", "title": "" }, { "docid": "da4de47df4ba63e462e781aba485a820", "score": "0.5735792", "text": "function createScene02(){\n // ----------------------------Map\n var imgSrc = document.getElementById('rocks');\n var sceneArray = [[0, .5, 1, 1.5, 2, 4 ,4.5, 5, 5.5, 6, 6.5, 7 ,7.5, 8, 8.5], [0, .5, 1, 1.5, 7.5, 8.5], [0, .5, 1, 8.5], [0, .5, 8, 8.5], [0, 3.5, 4, 5.5, 6], [0, 3.5, 4, 5.5, 6], [0], [0, 8.5], [0, .5, 1 ,3 , 3.5 ,4 ,4.5, 8.5], [0, .5, 4, 4.5, 8.5], [0, .5, 4, 4.5, 5, 7.5, 8, 8.5], [0, .5 , 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 7.5, 8, 8.5], [0, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5 , 7.5, 8, 8.5]];\n var imgSrc = document.getElementById('rocks');\n let y = 0;\n sceneArray.forEach((value) => {\n value.forEach((x) => {\n makeBlock(x, y, imgSrc);\n });\n y += 50;\n });\n //-------------------------------------------------Zone Events\n new EventTrigger(600, 650, 150, 25, function(){\n theHero.clearRect(thePlayer.mapLoc[0], thePlayer.mapLoc[1], thePlayer.mapLoc[2], thePlayer.mapLoc[3]);\n thePlayer.mapLoc[1] = 0;\n loadZone('scene01');\n });\n new EventTrigger(250, -25, 150, 25, function(){\n theHero.clearRect(thePlayer.mapLoc[0], thePlayer.mapLoc[1], thePlayer.mapLoc[2], thePlayer.mapLoc[3]);\n thePlayer.mapLoc[1] = 600;\n loadZone('scene03');\n });\n new EventTrigger(900, 200, 25, 150, function(){\n theHero.clearRect(thePlayer.mapLoc[0], thePlayer.mapLoc[1], thePlayer.mapLoc[2], thePlayer.mapLoc[3]);\n thePlayer.mapLoc[0] = 0;\n loadZone('scene04');\n });\n //-----------------------------------------create zone object\n new ZoneMaker('scene02', mapArray, passThruArray, npcArray, containerArray, eventArray, itemArray);\n}", "title": "" }, { "docid": "ce54a44d35050e82230c3cca840ab9e8", "score": "0.5723173", "text": "function preload() {\n //load in our level data\n levelData = loadJSON(\"data/levels.json\");\n\n //create the world\n theWorld = new SideViewWorld(worldParameters);\n\n //create the sheep\n //paras - name,x,y,w,h,ear,wool,speed,jumpPower,weight,strength,worldparas\n Shirley = new Sheep(shirleyParas, theWorld);\n Shaun = new Sheep(shaunParas, theWorld);\n Timmy = new Sheep(timmyParas, theWorld);\n\n startMusic = loadSound(\"aud/startMusic.mp3\");\n passMusic = loadSound(\"aud/passMusic.mp3\");\n\n fontA = loadFont(\"assets/sketch-coursive.ttf\");\n fontB = loadFont(\"assets/the-skinny.otf\");\n fontC = loadFont(\"assets/the-skinny-bold.otf\");\n\n bg = loadImage(\"img/bg.png\");\n arrowImg = loadImage(\"img/arrow.png\");\n cursorImg = loadImage(\"img/cursor.svg\");\n\n}", "title": "" }, { "docid": "aadf78fd4dae47d7979cdff269eb4fde", "score": "0.5714348", "text": "function generateTerrain(icosphere, fixedRepellerCount, initialContinentLocation, continentBufferDistance, stringiness, repellerCountMultiplier, repellerCountMin, repellerCountMax, repellerSizeMin, repellerSizeMax, repellerHeightMin, repellerHeightMax, continentCountMin, continentCountMax, continentSizeMin, continentSizeMax, mountainCountMin, mountainCountMax, mountainHeightMin, mountainHeightMax) {\n\tvar contCount = Math.floor(seed.step(8191, continentCountMin, continentCountMax + 0.999));\n\tvar mountainCount = Math.floor(seed.step(8191, mountainCountMin, mountainCountMax + 0.999));\n\t\n debug.log(DEBUG.WORLDGEN, \"cc: \" + contCount);\n\t\n\t//Create first continent at the equator facing the camera: 607, 698, 908, 923, 1151, 1166\n\tvar contSize = seed.step(8191, continentSizeMin, continentSizeMax);\n if (fixedRepellerCount) contSize = 9999999;\n\tvar mountains = mountainCount / contCount;\n\tif (contCount > 0) mountains *= seed.step(8191, 0.6, 1.4); //Randomize remaining mountain distribution slightly if not on the last continent\n\tmountains = Math.floor(mountains);\n\tif (!fixedRepellerCount) cluster(icosphere, initialContinentLocation, contSize, stringiness, Math.floor(contSize * contSize * repellerCountMultiplier) + 1, repellerSizeMin, repellerSizeMax, repellerHeightMin, repellerHeightMax, mountains, mountainHeightMin, mountainHeightMax); //Actually create the continent\n else cluster(icosphere, initialContinentLocation, contSize, stringiness, repellerCountMin, repellerSizeMin, repellerSizeMax, repellerHeightMin, repellerHeightMax, mountains, mountainHeightMin, mountainHeightMax);\n\tmountainCount -= mountains;\n\tcontCount--;\n\t\n\t//Create remaining continents\n\tfor (; contCount > 0; contCount--) {\n\t\tcontSize = seed.step(8191, continentSizeMin, continentSizeMax);\n\t\tif (fixedRepellerCount) contSize = 9999999;\n \n\t\t//Search for an open area of ocean randomly\n\t\tvar randomTiles = [];\n\t\tfor (var size = icosphere.tiles.length-1; size >= 0; size--) randomTiles[size] = size;\n\t\tshuffleArray(randomTiles);\n\t\tfor (var i = 0, done = false; i < icosphere.tiles.length && !done; i++) {\n\t\t\tvar center = randomTiles[i]; //Iterates through every tile in random order\n\t\t\tif (checkSurroundingArea(icosphere, center, contSize * continentBufferDistance) === -1) {\n\t\t\t\t//Create a new continent\n\t\t\t\tmountains = mountainCount / contCount;\n\t\t\t\tif (contCount > 0) mountains *= seed.step(8191, 0.6, 1.4); //Randomize remaining mountain distribution slightly if not on the last continent\n\t\t\t\tmountains = Math.floor(mountains);\n\t\t\t\tif (!fixedRepellerCount) cluster(icosphere, center, contSize, stringiness, Math.floor(contSize * contSize * repellerCountMultiplier) + 1, repellerSizeMin, repellerSizeMax, repellerHeightMin, repellerHeightMax, mountains, mountainHeightMin, mountainHeightMax); //Actually create the continent\n else cluster(icosphere, center, contSize, stringiness, repellerCountMin, repellerSizeMin, repellerSizeMax, repellerHeightMin, repellerHeightMax, mountains, mountainHeightMin, mountainHeightMax);\n\t\t\t\tmountainCount -= mountains;\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "17ad413ca6fd1af2dd19c1027d15fe6c", "score": "0.5713041", "text": "function terrainFromIteration(n, minX,maxX,minY,maxY, vertexArray, faceArray,normalArray, colorArray)\n{\n var size = Math.pow(2,n) + 1;\n var grid = size*size;\n var heightMap = new Float32Array(grid);\n \n var scale = 0.6;\n \n //Applies diamond square algo to create Height map\n diamondSquare(scale, size, heightMap);\n //console.log(\"heightMap\", heightMap);\n\n\n var deltaX=(maxX-minX)/n;\n var deltaY=(maxY-minY)/n;\n \n //Pushes vertices and initializes normal array to 0\n for(var i=0;i<=size;i++)\n for(var j=0;j<=size;j++)\n {\n vertexArray.push(minX+deltaX*j);\n vertexArray.push(minY+deltaY*i);\n // Push height calculated from DiamondSquare Algorithm\n vertexArray.push(heightMap[i+size*j]/6);\n \n\n //Apply color based on height \n if(heightMap[i+size*j]/6 <= -2)\n {\n colorArray.push(0);\n colorArray.push(0);\n colorArray.push(0.6);\n colorArray.push(1);\n }\n // else if(-2<(heightMap[i+size*j]/6)<=-1)\n // {\n // colorArray.push(0);\n // colorArray.push(0);\n // colorArray.push(0);\n // colorArray.push(1);\n\n // }\n \n else if(-1<(heightMap[i+size*j]/6)<=-0.8)\n {\n colorArray.push(0);\n colorArray.push(0.4);\n colorArray.push(0);\n colorArray.push(1);\n\n }\n else if(-0.8<(heightMap[i+size*j]/6)<=-0.6)\n {\n colorArray.push(0.34);\n colorArray.push(0.4);\n colorArray.push(0);\n colorArray.push(1);\n\n }\n else if(-0.6<(heightMap[i+size*j]/6)<=-0.4)\n {\n colorArray.push(0.5);\n colorArray.push(0.2);\n colorArray.push(0.8);\n colorArray.push(1);\n\n }\n else if(-0.4<(heightMap[i+size*j]/6)<=-0.2)\n {\n colorArray.push(0.0);\n colorArray.push(0.4);\n colorArray.push(0.3);\n colorArray.push(1);\n\n }\n else if(-0.2<(heightMap[i+size*j]/6)<=0.6)\n {\n colorArray.push(0.0);\n colorArray.push(0.7);\n colorArray.push(0);\n colorArray.push(1);\n\n }\n \n else if(0.6<(heightMap[i+size*j]/6)<=0.8)\n {\n colorArray.push(0.7);\n colorArray.push(0.4);\n colorArray.push(0.3);\n colorArray.push(1);\n\n }\n\n else\n {\n colorArray.push(1.0);\n colorArray.push(1.0);\n colorArray.push(1.0);\n colorArray.push(1);\n\n }\n \n //Initialize normals to 0\n normalArray.push(0);\n normalArray.push(0);\n normalArray.push(0);\n \n }\n\n //Create a faceArray by pushing correct vertex indices\n var numT=0;\n for(var i=0;i<size;i++)\n for(var j=0;j<size;j++)\n {\n var vid = i*(size+1) + j;\n faceArray.push(vid);\n faceArray.push(vid+1);\n faceArray.push(vid+size+1);\n \n faceArray.push(vid+1);\n faceArray.push(vid+1+size+1);\n faceArray.push(vid+size+1);\n numT+=2;\n }\n\n /*\n * Calculation of normals for shading. \n * For each face from faceArray, obtain vertices and calculate normal for face. Normalize it and store it in\n * normalArray.\n */\n \n var numFaces = faceArray.length/3;\n for(var f = 0; f<numFaces; f++)\n {\n var fid = f*3;\n //get vertex ids from faceArray\n var vid = faceArray[fid];\n var vertex1 = vec3.fromValues(vertexArray[3*vid], vertexArray[3*vid+1], vertexArray[3*vid+2]);\n\n vid = faceArray[fid +1];\n var vertex2 = vec3.fromValues(vertexArray[3*vid], vertexArray[3*vid+1], vertexArray[3*vid+2]);\n \n vid = faceArray[fid + 2];\n var vertex3 = vec3.fromValues(vertexArray[3*vid], vertexArray[3*vid+1], vertexArray[3*vid+2]); \n \n var n1 = vec3.fromValues(0,0,0);\n var n2 = vec3.fromValues(0,0,0);\n var n = vec3.fromValues(0,0,0);\n\n //Compute normal vector for face\n vec3.sub(n1, vertex2, vertex1);\n vec3.sub(n2, vertex3, vertex1);\n vec3.cross(n, n1, n2); \n vec3.normalize(n,n);\n \n //Add normals for each vertex that is part of the face\n vid = faceArray[fid];\n normalArray[3*vid] += n[0];\n normalArray[3*vid+1] +=n[1];\n normalArray[3*vid+2] +=n[2];\n\n vid = faceArray[fid+1];\n normalArray[3*vid] += n[0];\n normalArray[3*vid+1] +=n[1];\n normalArray[3*vid+2] +=n[2];\n\n vid = faceArray[fid+2];\n normalArray[3*vid] += n[0];\n normalArray[3*vid+1] +=n[1];\n normalArray[3*vid+2] +=n[2];\n \n \n }\n \n\n /*\n * Normalize the vertex normals and the overwrite with normalized normals\n */\n for(var k = 0; k<numFaces; k++)\n {\n var fid = k*3;\n //get vertex ids from faceArray\n var vid = faceArray[fid];\n\n //Extract vertex normal and normalize it \n var tmp = vec3.fromValues( normalArray[3*vid],normalArray[3*vid +1],normalArray[3*vid +2]);\n vec3.normalize(tmp,tmp);\n normalArray[3*vid] = tmp[0];\n normalArray[3*vid +1] = tmp[1];\n normalArray[3*vid +2] = tmp[2];\n\n vid = faceArray[fid +1];\n tmp = vec3.fromValues( normalArray[3*vid],normalArray[3*vid +1],normalArray[3*vid +2]);\n vec3.normalize(tmp,tmp);\n normalArray[3*vid] = tmp[0];\n normalArray[3*vid +1] = tmp[1];\n normalArray[3*vid +2] = tmp[2];\n\n vid = faceArray[fid +2];\n tmp = vec3.fromValues( normalArray[3*vid],normalArray[3*vid +1],normalArray[3*vid +2]);\n vec3.normalize(tmp,tmp);\n normalArray[3*vid] = tmp[0];\n normalArray[3*vid +1] = tmp[1];\n normalArray[3*vid +2] = tmp[2];\n }\n\n return numT;\n}", "title": "" }, { "docid": "573764ce2facbc93ebd2ba1dbdc2759f", "score": "0.56966376", "text": "function main() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"viewport\"); \n var context = canvas.getContext(\"2d\");\n \n // Create the image\n raycastEllipsoids( context );\n}", "title": "" }, { "docid": "d1ba3c68068e25bfa7d8de30fc0b7166", "score": "0.5685129", "text": "function makeMap() {\n\t//set up camera\n\t//Tile.SetColliderBlockSize (20);\n\tTile.SetCamera();\n\t//load the premade level\n\tTile.LoadLevel(level);\n\t//load the groups of tiles that get used in partial procedural\n\tTile.LoadGroups(proceduralGroups); \n\ttempGenerate();\n}", "title": "" }, { "docid": "c20678dd28988f9e36a08215a001b6ab", "score": "0.56689316", "text": "function initTextures() { \n grassTexture = gl.createTexture();\n grassTexture.image = new Image();\n grassTexture.image.onload = function () {\n handleLoadedTexture(grassTexture, gl.CLAMP_TO_EDGE);\n }\n grassTexture.image.src = \"assets/grass.png\";\n\n var flowerTexturesDirs = [\"assets/flowerRed.png\", \"assets/flowerBlue.png\"];\n for (var i = 0; i < flowerTypes; i++) {\n flowerTextures[i] = gl.createTexture();\n flowerTextures[i].image = new Image();\n flowerTextures[i].image.onload = function(i) {\n return function() {\n handleLoadedTexture(flowerTextures[i], gl.CLAMP_TO_EDGE);\n }\n }(i);\n flowerTextures[i].image.src = flowerTexturesDirs[i];\n }\n\n var groundTexturesDirs = [\"assets/groundGrass.jpg\", \"assets/groundEarth.jpg\"];\n for (var i = 0; i < groundTexturesDirs.length; i++) {\n groundTextures[i] = gl.createTexture();\n groundTextures[i].image = new Image();\n groundTextures[i].image.onload = function(i) {\n return function() {\n handleLoadedTexture(groundTextures[i], gl.REPEAT);\n }\n }(i);\n groundTextures[i].image.src = groundTexturesDirs[i];\n }\n\n var treeTexturesDirs = [\"assets/tree4.png\", \"assets/tree1.png\", \"assets/tree2.png\", \"assets/tree3.png\", \"assets/tree5.png\", \"assets/tree6.png\"];\n for (var i = 0; i < 6; i++) {\n treeTextures[i] = gl.createTexture();\n treeTextures[i].image = new Image();\n treeTextures[i].image.onload = function(i) {\n return function() {\n handleLoadedTexture(treeTextures[i], gl.CLAMP_TO_EDGE);\n }\n }(i);\n treeTextures[i].image.src = treeTexturesDirs[i];\n }\n\n bumpMapTexture = gl.createTexture();\n bumpMapTexture.image = new Image();\n bumpMapTexture.image.onload = function () {\n handleLoadedTexture(bumpMapTexture, gl.CLAMP_TO_EDGE);\n }\n bumpMapTexture.image.src = \"assets/map.png\";\n\n var windTexturesDirs = [\"assets/windX.jpg\", \"assets/windZ.jpg\"];\n for (var i = 0; i < windTexturesDirs.length; i++) {\n windTextures[i] = gl.createTexture();\n windTextures[i].image = new Image();\n windTextures[i].image.onload = function(i) {\n return function() {\n handleLoadedTexture(windTextures[i], gl.REPEAT);\n }\n }(i);\n windTextures[i].image.src = windTexturesDirs[i];\n }\n\n var skyboxFaces = [\"assets/posx.png\", \"assets/negx.png\", \"assets/posy.png\", \"assets/negy.png\", \"assets/posz.png\", \"assets/negz.png\"];\n skyboxTexture = gl.createTexture();\n loadCubeMap(skyboxTexture, skyboxFaces);\n\n for (var i = 0; i < 5; i++) {\n copiedTextures[i] = gl.createTexture();\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, copiedTextures[i]);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); \n }\n}", "title": "" }, { "docid": "443801feeab537f9236825f8fc07f054", "score": "0.56664383", "text": "function createScene()\r\n{\r\n // Light stuff \r\n\t// const light = new THREE.PointLight(0xaaaaaa);\r\n // light.position.set(30,30,20);\r\n // light.castShadow = true;\r\n // light.distance = 0;\r\n // light.shadow.mapSize.width = 1024;\r\n // light.shadow.mapSize.height = 1024;\t\r\n // scene.add(light);\r\n\r\n // var ambientLight = new THREE.AmbientLight(0x121212);\r\n // scene.add(ambientLight);\r\n\r\n // Load all textures \r\n // var textureLoader = new THREE.TextureLoader();\r\n // var floor \t= textureLoader.load('../assets/textures/sand.jpg');\t\t\r\n\r\n // // Create Ground Plane\r\n // var groundPlane = createGroundPlane(80.0, 80.0, 100, 100, \"rgb(200,200,150)\");\r\n // groundPlane.rotateX(degreesToRadians(-90));\r\n // groundPlane.material.map = floor;\t\t\r\n // groundPlane.material.map.wrapS = THREE.RepeatWrapping;\r\n // groundPlane.material.map.wrapT = THREE.RepeatWrapping;\r\n // groundPlane.material.map.repeat.set(8,8);\t\t\r\n // scene.add(groundPlane);\r\n\r\n\r\n // initDefaultOcean();\r\n initCustomOcean();\r\n\tinitSky();\r\n\tinitGround();\r\n}", "title": "" }, { "docid": "68c30dc352f1fa4da26a4034451235cf", "score": "0.5665725", "text": "function Prepare(){\n PrepareCubeMapLoader(\"img/cubemap/dark-s_\",\".jpg\");\n PrepareObjectLoader(\"model/StarSparrow01.fbx\",function (res) {\n res.traverse(function (child) {\n if (child.isMesh) {\n var basePath = \"stars/Textures/StarSparrow_\";\n var emissiveTexture = new THREE.TextureLoader(loadManager).load(basePath + \"Emissive.png\");\n var metallicTexture = new THREE.TextureLoader(loadManager).load(basePath + \"Metallic.png\");\n var roughnessTexture = new THREE.TextureLoader(loadManager).load(basePath + \"Roughness.png\");\n var normalTexture = new THREE.TextureLoader(loadManager).load(basePath + \"Normal.png\");\n var baseColorTexture = new THREE.TextureLoader(loadManager).load(basePath + \"Red.png\");\n var specularTexture = new THREE.TextureLoader(loadManager).load(basePath + \"Specular.png\");\n var glossinessTexture = new THREE.TextureLoader(loadManager).load(basePath + \"Glossiness.png\");\n child.material = new THREE.MeshPhysicalMaterial({\n // color: 0xffffff,\n map: baseColorTexture,\n emissive: 0xffffff,\n emissiveMap: emissiveTexture,\n envMap: assetManager.cubeMap,\n metalness: 1.0,\n metalnessMap: metallicTexture,\n normalMap: normalTexture,\n roughness: 1.0,\n roughnessMap: roughnessTexture,\n specular:1.0,\n specularMap:specularTexture,\n glossiniess:1.0,\n glossiniessMap:glossinessTexture,\n reflectivity: 1.0,\n clearCoat: 1.0,\n });\n child.castShadow = true;\n child.receiveShadow = true;\n }\n });\n var hitBoxPosition = [\n new THREE.Vector3(0,-1.5,0), 4,\n new THREE.Vector3(1.5,-1.75,0.5), 2,\n new THREE.Vector3(-1.5,-1.75,0.5), 2,\n new THREE.Vector3(1.5,-1.75,-0.5), 2,\n new THREE.Vector3(-1.5,-1.75,-0.5), 2,\n new THREE.Vector3(3.75,-0.5,0), 2,\n new THREE.Vector3(-3.75,-0.5,0), 2,\n new THREE.Vector3(5,0.5,0), 2,\n new THREE.Vector3(-5,0.5,0), 2,\n ];\n res.hitBoxes = new Array();\n for(var i=0;i<9;i++){\n //var hitBox = new THREE.Mesh(boxGeometry, new THREE.MeshStandardMaterial({color: 0xffff,}));\n var hitBox = new THREE.Object3D();\n hitBox.scale.set(0.5,0.5,0.5);\n hitBox.name = \"hit_box_\"+i.toString();\n var hitboxIndex = i * 2;\n hitBox.position.set(hitBoxPosition[hitboxIndex].x,hitBoxPosition[hitboxIndex].y,hitBoxPosition[hitboxIndex].z);\n res.add(hitBox);\n let tolerance = hitBoxPosition[hitboxIndex + 1];\n hitBox.isColliding = function (other) {\n var resOther = new THREE.Vector3();\n other.getWorldPosition(resOther);\n var resCurrent = new THREE.Vector3();\n this.getWorldPosition(resCurrent);\n var distance = resCurrent.distanceTo(resOther);\n var isCollide = distance < tolerance;\n //this.material.color = new THREE.Color((isCollide) ? 0xff0000 : 0x00ff00);\n return isCollide;\n };\n res.hitBoxes.push(hitBox);\n }\n\n res.isColliding = function (other) {\n for(var i = 0;i<this.hitBoxes.length;i++){\n if(this.hitBoxes[i].isColliding(other)){\n return true;\n }\n }\n return false;\n };\n\n res.name = \"spaceship\";\n res.mixer = new THREE.AnimationMixer(res);\n // res.spaceshipAction = res.mixer.clipAction(res.animations[0]);\n assetManager.addObject(res);\n });\n\n assetManager.loader.forEach(element => {\n element();\n });\n\n for(var i=0;i<4;i++){\n loadObj(i);\n }\n\n for(var j=0;j<4;j++){\n loadRocketObj(j);\n }\n\n loadAim();\n\n loadRocket();\n\n loadEnemy();\n\n requestAnimationFrame(Update);\n}", "title": "" }, { "docid": "1207af529e8e334439460bdf8084133f", "score": "0.5660664", "text": "function setup() {\n\tcreateCanvas(1200, 800);\n\n\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\tground1 = new Ground(600,770,1200,10);\n\tground2 = new Ground(500,500,230,10);\n\tground3 = new Ground(800,200,230,10)\n\tground4 = new Ground(1000,500,230,10)\n\n\t//extreme left row 1\n\tblock1 = new Block(575,475,50,45);\n\tblock2 = new Block(530,475,50,45);\n\tblock3 = new Block(480,475,50,45);\n\tblock4 = new Block(430,475,50,45)\n\t// row 2\n\tblock5 = new Block(450,430,50,45);\n\tblock6 = new Block(500,430,50,45);\n\tblock7 = new Block(550,430,50,45);\n\t//row3\n\tblock8 = new Block(475,385,50,45);\n\tblock9 = new Block(520,385,50,45);\n\t//row4\n\tblock10 = new Block(495,340,50,45)\n\n\t//extreme right row 1\n\tblock11 = new Block(925,475,50,45);\n\tblock12 = new Block(975,475,50,45);\n\tblock13 = new Block(1025, 475,50,45)\n\tblock14 = new Block(1075,475,50,45);\n\t//row2\n\tblock15 = new Block(950,430,50,45);\n\tblock16 = new Block(1000,430,50,45);\n\tblock17 = new Block(1050,430,50,45);\n\t//row3\n\tblock18 = new Block(975,385,50,45);\n\tblock19 = new Block(1020,385,50,45);\n\t//row4\n\tblock20 = new Block(995,340,50,45)\n\n\t//extreme top row 1\n\tblock21 = new Block(720,170,50,45)\n\tblock22 = new Block(770,170,50,45)\n\tblock23 = new Block(820,170,50,45);\n\tblock24 = new Block(870,170,50,45);\n\t//row 2\n\tblock25 = new Block(745,125,50,45);\n\tblock26 = new Block(795,125,50,45);\n\tblock27 = new Block(840,125,50,45);\n\t//row3\n\tblock28 = new Block(765,80,50,45);\n\tblock29 = new Block(815,80,50,45);\n\t//row4\n\tblock30 = new Block(790,35,50,45);\n\n\tball = new Polygon(200,500,20,20);\n\n\t\n\tslingshot = new SlingShot(100,400,ball.body)\n\n\t\n\t\n\n\t\n\t/*var render = Render.create({\n\t\telement:document.body,\n\t\tengine: engine,\n\t\toptions:{\n\t\t\twidth:1200,\n\t\t\theight:700,\n\t\t\twireframes:false\n\t\t}\n\t});*/\n\n\n\t//Create the Bodies Here.\n\n\n\tEngine.run(engine);\n \n}", "title": "" }, { "docid": "4cb8b666541cd5c5b13afa7f509bf6d7", "score": "0.5659204", "text": "function Terrain() {\n var _this = this;\n this.obstacles = [];\n this.misc = [];\n this.nullTile = {x: null, y: null, type: null};\n\n //Checks for collision by an entity at a supplied x,y. Returns true if collision occurs, else false.\n this.collision = function(x, y, entity) {\n var col = false;\n for (var i = 0; i < this.obstacles.length; i++) {\n if (this.obstacles[i].x === x && this.obstacles[i].y === y) {\n if (this.obstacles[i].type === 'obstacle') col = true;\n col = !(this.obstacles[i].type === 'door' && entity.type === 'player');\n }\n }\n return col;\n }\n\n //Create a new tile at the supplied x,y and of the supplied type.\n this.new = function (x, y, type) {\n var exists = false;\n if (type === 'obstacle' || type === 'door') {\n for (var i in _this.obstacles) {\n if (_this.obstacles[i].x === x && _this.obstacles[i].y === y) {\n exists = true;\n }\n }\n if (!exists) _this.obstacles.push({x: x, y: y, type: type});\n } else if (type === 'floor') {\n for (var i in this.misc) {\n if (this.misc[i].x === x && this.misc[i].y === y) {\n exists = true;\n }\n }\n if (!exists) this.misc.push({x: x, y: y, type: 'floor', image: 4});\n }\n return !exists;\n }\n\n //Removes a tile at the supplied x,y.\n this.remove = function(x, y) {\n for (var i in _this.obstacles) {\n if (_this.obstacles[i].x === x && _this.obstacles[i].y === y) {\n _this.obstacles.splice(i,1);\n }\n }\n };\n\n //Return the tile at the supplied x,y. Returns null tile if none.\n this.getTile = function (x, y) {\n for (i = 0; i < _this.obstacles.length; i++) {\n var _tile = _this.obstacles[i];\n if (_tile.x === x && _tile.y === y) {\n return _tile;\n }\n }\n return null;\n };\n\n this.exportObstacles = function () {\n return _this.obstacles;\n };\n\n //Seed some random obstacles. To be replaced by a generator in the future.\n for (var i = 0; i < 20; i++) {\n var ox = Math.floor(Math.random() * CANVAS_WIDTH / 10) * 10;\n var oy = Math.floor(Math.random() * CANVAS_HEIGHT / 10) * 10;\n if (ox !== 10 && oy !== 10) _this.new(ox, oy, 'obstacle'); //OB CHANGE\n }\n\n //create some random terrain detail\n for (var i = 0; i < 50; i++) {\n var ox = Math.floor(Math.random() * CANVAS_WIDTH / 10) * 10;\n var oy = Math.floor(Math.random() * CANVAS_HEIGHT / 10) * 10;\n this.misc.push({x: ox, y: oy, image: Math.floor(Math.random() * 4)});\n }\n\n window.exportObstacles = this.exportObstacles;\n}", "title": "" }, { "docid": "8109e4f004547c8270d2cb86e4b91399", "score": "0.5649496", "text": "function World11(map) {\n map.locs = [\n new Location(0, true),\n new Location(0, exitPipeVert),\n new Location(1)\n ];\n map.areas = [\n new Area(\"Overworld\", function() {\n setLocationGeneration(0);\n\n pushPrePattern(\"backreg\", 0, 0, 5);\n pushPreFloor(0, 0, 69);\n\n\n pushPreThing(Brick, 120, jumplev1);\n pushPreThing(Brick, 128, jumplev1);\n pushPreThing(Goomba, 176, 8, null, null, '/problems/1');\n pushPreThing(Brick, 136, jumplev1);\n pushPreThing(Brick, 144, jumplev1);\n pushPreThing(Brick, 152, jumplev1);\n\n\n pushPreThing(Brick, 128, jumplev2);\n pushPreThing(Brick, 136, jumplev2);\n pushPreThing(Brick, 144, jumplev2);\n pushPreThing(Koopa, 136, jumplev2+16, true, false, '/problems/4');\n\n pushPreThing(Goomba, 224, 24, null, null, '/problems/3');\n pushPrePipe(224, 0, 16, false);\n// pushPreThing(Goomba, 248, 8, null, null, '/problems/4');\n pushPrePipe(304, 0, 24);\n pushPrePipe(368, 0, 32);\n pushPreThing(Goomba, 340, 8, null, null, '/problems/5');\n\n pushPreThing(Block, 424, jumplev1, null, null, '/learned/1');\n pushPreThing(Block, 432, jumplev1, null, null, '/learned/2');\n pushPreThing(Block, 440, jumplev1, null, null, '/learned/3');\n pushPreThing(Block, 432, jumplev2, null, null, '/learned/4');\n\n pushPrePipe(524, 0, 16, false);\n pushPreThing(Stone, 572, 8, 1, 1);\n pushPreThing(Stone, 672, 8, 1, 1);\n\n pushPreFloor(568, 0, 15);\n pushPreThing(Brick, 618, jumplev1);\n pushPreThing(Brick, 626, jumplev1);\n pushPreThing(Brick, 634, jumplev1);\n pushPreThing(Brick, 640, jumplev2);\n pushPreThing(Goomba, 640, jumplev2 + 8, null, null, '/problems/6');\n pushPreThing(Brick, 648, jumplev2);\n pushPreThing(Brick, 656, jumplev2);\n pushPreThing(Goomba, 672, jumplev2 + 8, null, null, '/problems/7');\n pushPreThing(Brick, 664, jumplev2);\n pushPreThing(Brick, 672, jumplev2);\n pushPreThing(Brick, 680, jumplev2);\n pushPreThing(Brick, 688, jumplev2);\n pushPreThing(Brick, 696, jumplev2);\n pushPreFloor(712, 0, 64);\n pushPreThing(Brick, 728, jumplev2);\n pushPreThing(Brick, 736, jumplev2);\n pushPreThing(Brick, 744, jumplev2);\n\n pushPreThing(Blooper, 800, 16, null, null, '/problems/8');\n pushPreThing(Blooper, 880, 16, null, null, '/problems/9');\n\n pushPreThing(Brick, 850, jumplev1);\n pushPreThing(Brick, 858, jumplev1);\n pushPreThing(Brick, 866, jumplev1);\n pushPreThing(Brick, 874, jumplev1);\n pushPreThing(Brick, 882, jumplev1);\n pushPreThing(Brick, 890, jumplev1);\n pushPreThing(Brick, 898, jumplev1);\n\n pushPreThing(Block, 866, jumplev2, null, null, '/learned/5');\n pushPreThing(Block, 874, jumplev2, null, null, '/learned/6');\n pushPreThing(Block, 882, jumplev2, null, null, '/learned/7');\n\n pushPreFloor(1240, 0, 69);\n pushPreThing(Stone, 1008, 8);\n pushPreThing(Stone, 1016, 16, 1, 2);\n pushPreThing(Stone, 1024, 24, 1, 3);\n pushPreThing(Stone, 1032, 32, 1, 4);\n pushPreThing(Stone, 1040, 40, 1, 5);\n pushPreThing(Stone, 1048, 48, 1, 6);\n pushPreThing(Stone, 1056, 56, 1, 7);\n endCastleOutside(1080, 0, 1);\n\n })\n ];\n}", "title": "" }, { "docid": "4581865d20c9712d336cea70834f724e", "score": "0.5647369", "text": "function load()\n{\n fetch('a5.vert.glsl', {cache: \"no-store\"})\n .then(function(response) {\n return response.text();\n })\n .then(function(txt) {\n vertexSource = txt;\n init();\n });\n\n fetch('a5.frag.glsl', {cache: \"no-store\"})\n .then(function(response) {\n return response.text();\n })\n .then(function(txt) {\n fragmentSource = txt;\n init();\n });\n\n fetch('mini_geometry.json', {cache: \"no-store\"})\n .then(function(response) {\n return response.json();\n })\n .then(function(obj) {\n geometry = obj;\n init();\n });\n\n fetch('mini_material.json', {cache: \"no-store\"})\n .then(function(response) {\n return response.json();\n })\n .then(function(obj) {\n materials = obj;\n init();\n });\n\n mini_diffuse_texture_image.src = \"mini_body_diffuse.png\";\n mini_diffuse_texture_image.onload = function() {\n mini_diffuse_texture_image_loaded = true;\n init();\n }\n\n // Add key listener for keyboard events\n document.addEventListener('keydown', (event) => {\n const keycode = event.key;\n if(keycode == 'ArrowRight')\n {\n mini_model.turnRight();\n }\n else if(keycode == 'ArrowLeft')\n {\n mini_model.turnLeft();\n }\n else if(keycode == 'ArrowUp')\n {\n mini_model.moveForward();\n }\n else if(keycode == 'ArrowDown')\n {\n mini_model.moveBackward();\n }\n else if(keycode == 'p')\n {\n parameters.projection = \"perspective\";\n }\n else if(keycode == 'o')\n {\n parameters.projection = \"orthographic\";\n }\n else if(keycode == 'a')\n {\n parameters.light_attenuation = !parameters.light_attenuation;\n }\n else if(keycode == 'n')\n {\n parameters.normal_map = !parameters.normal_map;\n parameters.local_lighting = !parameters.local_lighting;\n }\n else if(keycode == 't')\n {\n parameters.diffuse_texture = !parameters.diffuse_texture;\n }\n });\n\n // Initialize sliders and labels\n document.getElementById(\"light-x-label\").innerHTML = light_source.position[0];\n document.getElementById(\"light-y-label\").innerHTML = light_source.position[1];\n document.getElementById(\"light-z-label\").innerHTML = light_source.position[2];\n document.getElementById(\"light-x-slider\").value = light_source.position[0];\n document.getElementById(\"light-y-slider\").value = light_source.position[1];\n document.getElementById(\"light-z-slider\").value = light_source.position[2];\n\n // Light Type Eventhandler\n $(\"input[name=lighting-mode]\").click(function() {\n // Show light position controls if appropriate\n if (movable_lights.includes($(this).val()))\n {\n document.getElementById(\"light-position-controls\").classList.remove(\"d-none\");\n }\n else\n {\n document.getElementById(\"light-position-controls\").classList.add(\"d-none\");\n }\n\n // Show spotlight controls if appropriate\n if ($(this).val() == \"spot\") {\n document.getElementById(\"spotlight-controls\").classList.remove(\"d-none\");\n }\n else\n {\n document.getElementById(\"spotlight-controls\").classList.add(\"d-none\");\n }\n });\n\n // Light Controls Eventhandlers\n document.getElementById(\"light-x-slider\").addEventListener('input', (e) => {\n document.getElementById(\"light-x-label\").innerHTML = e.target.value;\n let temp = light_source.position;\n temp[0] = e.target.value;\n light_source.position = temp;\n });\n document.getElementById(\"light-y-slider\").addEventListener('input', (e) => {\n document.getElementById(\"light-y-label\").innerHTML = e.target.value;\n let temp = light_source.position;\n temp[1] = e.target.value;\n light_source.position = temp;\n });\n document.getElementById(\"light-z-slider\").addEventListener('input', (e) => {\n document.getElementById(\"light-z-label\").innerHTML = e.target.value;\n let temp = light_source.position;\n temp[2] = e.target.value;\n light_source.position = temp;\n });\n document.getElementById(\"light-attenuation-check\").addEventListener('change', (e) => {\n light_source.attenuate = e.target.checked;\n });\n\n // Spotlight Controls Eventhandlers\n document.getElementById(\"spotlight-angle-slider\").addEventListener('input', (e) => {\n document.getElementById(\"spotlight-angle-value\").innerHTML = e.target.value;\n light_source.spotlight_falloff_angle = e.target.value;\n });\n document.getElementById(\"spotlight-target-x-slider\").addEventListener('input', (e) => {\n let temp = light_source.spotlight_target;\n temp[0] = e.target.value;\n light_source.spotlight_target = temp;\n document.getElementById(\"spotlight-target-x-label\").innerHTML = e.target.value;\n });\n document.getElementById(\"spotlight-target-y-slider\").addEventListener('input', (e) => {\n let temp = light_source.spotlight_target;\n temp[1] = e.target.value;\n light_source.spotlight_target = temp;\n document.getElementById(\"spotlight-target-y-label\").innerHTML = e.target.value;\n });\n document.getElementById(\"spotlight-target-z-slider\").addEventListener('input', (e) => {\n let temp = light_source.spotlight_target;\n temp[2] = e.target.value;\n light_source.spotlight_target = temp;\n document.getElementById(\"spotlight-target-z-label\").innerHTML = e.target.value;\n });\n}", "title": "" }, { "docid": "8dc24ad5e3978f06b7e6922f060b8b6e", "score": "0.5646157", "text": "createMap () {\n\t\t// Takes key from json map file\n\t\tthis.bgMap = this.make.tilemap({key: 'wmap'});\n\n\t\t// Add title sets (Takes key of tile set)\n\t\tthis.tiles = this.bgMap.addTilesetImage('wterrain');\n\n\t\t// Create background layer (name of tile map, tile set, x pos, y pos)\n\t\tthis.backgroundLayer = this.bgMap.createStaticLayer('Background', this.tiles, 0, 0);\n\t\t//this.backgroundLayer = this.bgMap.createStaticLayer('Foreground', this.tiles, 0, 0);\n\n\t\t// Create Castle (At end) (And adjust scale)\n\t\tlet castleImg = this.add.image(62, 550, 'wcastle');\n\n\t\t// Background for score\n\t\tlet scoreBox = this.add.graphics();\n\t\tscoreBox.fillStyle(0x666666, 0.8);\n\t\tscoreBox.fillRect(1140, 5, 135, 30);\n\n\t\t// build menu\n\t\tthis.buildMenu();\n\n\t\t// Background for castle health bar\n\t\tlet healthBox = this.add.graphics();\n\t\thealthBox.fillStyle(0x666666, 1);\n\t\thealthBox.fillRect(390, 5, 500, 30);\n\n\t\t// Background for health value\n\t\tlet healthBoxUI = this.add.graphics();\n\t\thealthBoxUI.fillStyle(0x666666, 0.8);\n\t\thealthBoxUI.fillRect(390, 45, 140, 25);\n\n\t\t// Background for gold value\n\t\tlet goldBoxUI = this.add.graphics();\n\t\tgoldBoxUI.fillStyle(0x666666, 0.8);\n\t\tgoldBoxUI.fillRect(390, 75, 140, 25);\n\n\t\t// Background for current wave indicator\n\t\tlet curWave = this.add.graphics();\n\t\tcurWave.fillStyle(0x666666, 0.8);\n\t\tcurWave.fillRect(750, 75, 140, 25);\n\n\t\t// Background for wave status\n\t\tlet waveStatus = this.add.graphics();\n\t\twaveStatus.fillStyle(0x666666, 0.8);\n\t\twaveStatus.fillRect(750, 45, 140, 25);\n\n\t\t// Background for boss hp bar\n\t\tthis.bossHp = this.add.graphics();\n\t\tthis.bossHp.fillStyle(0x666666, 0.5);\n\t\tthis.bossHp.fillRect(0, 0, 100, 10);\n\t\tthis.bossHp.alpha = 0;\n\t}", "title": "" }, { "docid": "35ae6d01398f1cbde3c25d63f9c8bdf0", "score": "0.564228", "text": "function init () {\n\n // Rhino models are z-up, so set this as the default\n // THREE.Object3D.DefaultUp = new THREE.Vector3( 0, 0, 1 )\n\n // create a scene and a camera\n scene = new THREE.Scene()\n scene.background = new THREE.Color(1,1,1)\n camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 )\n camera.position.z = 30\n\n // create the renderer and add it to the html\n renderer = new THREE.WebGLRenderer( { antialias: true } )\n renderer.setSize( window.innerWidth, window.innerHeight )\n document.body.appendChild( renderer.domElement )\n\n // add some controls to orbit the camera\n const controls = new OrbitControls( camera, renderer.domElement )\n\n // add a directional light\n const directionalLight = new THREE.DirectionalLight( 0xffffff )\n directionalLight.intensity = 2\n scene.add( directionalLight )\n\n //////////////////////////////////////////////\n // load materials and cube maps\n\n let material, cubeMap\n\n // load a pbr material\n const tl = new THREE.TextureLoader()\n tl.setPath('materials/PBR/streaked-metal1/')\n material = new THREE.MeshPhysicalMaterial()\n material.map = tl.load('streaked-metal1_base.png')\n material.aoMmap = tl.load('streaked-metal1_ao.png')\n material.normalMap = tl.load('streaked-metal1_normal.png')\n material.metalnessMap = tl.load('streaked-metal1_metallic.png')\n material.metalness = 0.2\n material.roughness = 0.0\n\n // or create a material\n // material = new THREE.MeshStandardMaterial( {\n // color: 0xffffff,\n // metalness: 0.0,\n // roughness: 0.0\n // } )\n\n // load hdr cube map\n // cubeMap = new HDRCubeTextureLoader()\n // .setPath( './textures/cube/pisaHDR/' )\n // .setDataType( THREE.UnsignedByteType )\n // .load( [ 'px.hdr', 'nx.hdr', 'py.hdr', 'ny.hdr', 'pz.hdr', 'nz.hdr' ] )\n \n // or, load cube map\n cubeMap = new THREE.CubeTextureLoader()\n .setPath('textures/cube/Bridge2/')\n .load( [ 'px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg' ] )\n \n scene.background = cubeMap\n material.envMap = scene.background\n\n //////////////////////////////////////////////\n\n // load the model\n const loader = new Rhino3dmLoader()\n loader.setLibraryPath( 'https://cdn.jsdelivr.net/npm/[email protected]/' )\n\n loader.load( model, function ( object ) {\n\n //////////////////////////////////////////////\n // apply material to meshes\n\n object.traverse( function (child) { \n if (child.isMesh) {\n child.material = material\n // couldn't get cube map to work with DefaultUp so rotate objects instead\n child.rotateX(-0.5 * Math.PI)\n }\n }, false)\n\n //////////////////////////////////////////////\n\n scene.add( object )\n\n // hide spinner when model loads\n // document.getElementById('loader').remove()\n\n } )\n\n}", "title": "" }, { "docid": "f747a189531b304c2aeaeba17d970ec7", "score": "0.56405777", "text": "function setup() {\r\n createCanvas(800, 800);\r\n engine = Engine.create();\r\n world = engine.world;\r\n ground = new Ground(40,height,90,20);\r\n ground1 = new Ground(110,height,90,20);\r\n ground2 = new Ground(200,height,70,20);\r\n ground3 = new Ground(280,height,70,20);\r\n ground4 = new Ground(360,height,70,20);\r\n ground5 = new Ground(440,height,70,20);\r\n ground6 = new Ground(520,height,70,20);\r\n ground7 = new Ground(600,height,70,20);\r\n ground8 = new Ground(680,height,70,20);\r\n ground9 = new Ground(760,height,70,20);\r\n\r\n for (var k = 0; k <=width; k = k + 80) {\r\n divisions.push(new Divisions(k, height-divisionHeight/2, 10, divisionHeight));\r\n }\r\n\r\n\r\n for (var j = 75; j <=width; j=j+50) \r\n {\r\n \r\n plinkos.push(new Plinko(j,75));\r\n }\r\n\r\n for (var j = 50; j <=width-10; j=j+50) \r\n {\r\n \r\n plinkos.push(new Plinko(j,175));\r\n }\r\n\r\n for (var j = 75; j <=width; j=j+50) \r\n {\r\n \r\n plinkos.push(new Plinko(j,275));\r\n }\r\n\r\n for (var j = 50; j <=width-10; j=j+50) \r\n {\r\n \r\n plinkos.push(new Plinko(j,375));\r\n }\r\n\r\n \r\n\r\n \r\n}", "title": "" }, { "docid": "47b63aefff4e2b2e99fc8200a2b1da23", "score": "0.5639974", "text": "function preload() {\n img = loadImage('/vc/docs/sketches/hardware/test.jpeg');\n\n // for (let i = 0; i < 15; i++) {\n // alpha[i] = loadImage('/vc/docs/sketches/hardware/ASCIIImages/'+ String(i) +'.png');\n // }\n\n alpha0 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/0.png')\n alpha1 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/1.png')\n alpha2 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/2.png')\n alpha3 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/3.png')\n alpha4 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/4.png')\n alpha5 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/5.png')\n alpha6 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/6.png')\n alpha7 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/7.png')\n alpha8 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/8.png')\n alpha9 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/9.png')\n alpha10 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/10.png')\n alpha11 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/11.png')\n alpha12 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/12.png')\n alpha13 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/13.png')\n alpha14 = loadImage('/vc/docs/sketches/hardware/ASCIIImages/14.png')\n\n myShader = loadShader(\"/vc/docs/sketches/hardware/shader.vert\", \"/vc/docs/sketches/hardware/ASCIIShader.frag\")\n}", "title": "" }, { "docid": "9968a62e2c459fa7595333f0170e5b48", "score": "0.5635635", "text": "function getGeneratedTile(x, y) {\r\nvar gain = 0.5;\r\nvar hgrid = 130;\r\nvar lacunarity = 2;\r\nvar octaves = 5;\r\n\r\n\tvar result = 0;\r\n\tvar frequency = 1/hgrid;\r\n\tvar amplitude = gain;\r\n\r\n\tfor (i = 0; i < octaves; ++i)\r\n\t{\r\n\t\tresult += PerlinSimplex.noise(x * frequency, y * frequency) * amplitude;\r\n\t\tfrequency *= lacunarity;\r\n\t\tamplitude *= gain;\r\n\t}\r\n\r\n\tvar tile = new Tile(x, y);\r\n\tif(result <= 0.25) {\r\n\t\ttile.type = TILE_TYPES.DEEP_WATER;\r\n\t} else if(result <= 0.35) {\r\n\t\ttile.type = TILE_TYPES.WATER;\r\n\t} else if(result < 0.375) {\r\n\t\ttile.type = TILE_TYPES.WET_SAND;\r\n\t} else if(result <= 0.4) {\r\n\t\ttile.type = TILE_TYPES.SAND;\r\n\t} else if(result <= 0.5) {\r\n\t\ttile.type = TILE_TYPES.DIRT;\r\n\t} else if(result <= 0.6) {\r\n\t\ttile.type = TILE_TYPES.GRASS;\r\n\t} else if(result <= 0.68) {\r\n\t\ttile.type = TILE_TYPES.TALL_GRASS;\r\n\t}else if(result <= 0.72) {\r\n\t\ttile.type = TILE_TYPES.FOREST;\r\n\t} else if(result <= 0.8) {\r\n\t\ttile.type = TILE_TYPES.DARK_FOREST;\r\n\t} else if(result <= 0.85) {\r\n\t\ttile.type = TILE_TYPES.ROCK;\r\n\t} else if(result <= 0.88) {\r\n\t\ttile.type = TILE_TYPES.LAVA;\r\n\t} else {\r\n\t\ttile.type = TILE_TYPES.SNOW;\r\n\t}\r\n\treturn tile;\r\n}", "title": "" }, { "docid": "e807c2c19b7f0d5a23feaacd58c7dd27", "score": "0.5630516", "text": "function createRandomTerrain(){\n\t\t//first check world sizes not to small\n\t\tif(worldWidth < worldMinWidth){ worldWidth = worldMinWidth; }\n\t\tif(worldHeight < worldMinHeight){ worldHeight = worldMinHeight; }\n\t\t\n\t\t//world map grid\n\t\t//first we just create the whole array\n\t\tworldGrid = new Array(worldWidth);\n\t\tfor(var iX = 0; iX < worldWidth; iX++){\n\t\t\tworldGrid[iX] = new Array(worldHeight);\n\t\t\tfor(var iY = 0; iY < worldHeight; iY++){\n\t\t\t\tworldGrid[iX][iY] = new Object();\n\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPENONE;\n\t\t\t\tworldGrid[iX][iY].frameName = \"blank.png\";\n\t\t\t\tworldGrid[iX][iY].position = new PIXI.Point(iX * worldBlockSize, iY * worldBlockSize);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//random generation\n\t\tvar lastHeight = Math.round(worldHeight -(worldMinHeight / 3));\n\n\t\tfor(var iX = 0; iX < (worldWidth / 2); iX++){\n\t\t\t\n\t\t\t//randomize when not in start flat area\n\t\t\tif(iX < lowRangeStartArea || iX > highRangeStartArea){\n\t\t\t\tvar rndNum = Math.random();\n\t\t\t\tif(rndNum < 0.5){ lastHeight--; lastHeight--; }\n\t\t\t\tif(rndNum >= 0.5){ lastHeight++;}\n\t\t\t}\n\t\t\t\n\t\t\tif(lastHeight < 5){ lastHeight = 5; }\n\t\t\t\n\t\t\t// 1/4 of last height\n\t\t\tvar\tqLastHeight = Math.round((worldHeight - lastHeight) / 4);\n\t\t\t\n\t\t\tfor(var iY = (worldHeight - 1); iY > 0; iY--){ //y in reverse\n\t\t\t\tif(iY > lastHeight){\n\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEDIRT;\n\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomDirtTexture(0);\n\t\t\t\t}\n\t\t\t\tif(iY > lastHeight + qLastHeight){\n\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEDIRT;\n\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomDirtTexture(1);\n\t\t\t\t}\n\t\t\t\tif(iY > lastHeight + qLastHeight*2){\n\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEDIRT;\n\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomDirtTexture(2);\n\t\t\t\t}\n\t\t\t\tif(iY > lastHeight + qLastHeight*3){\n\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEDIRT;\n\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomDirtTexture(3);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//smooth out rough parts\n\t\tfor(var iX = 1; iX < (worldWidth / 2); iX++){\n\t\t\tfor(var iY = 1; iY < worldHeight - 1; iY++){\n\t\t\t\t//check not right at edge of world for array saftey net\n\t\t\t\tif(worldGrid[iX][iY].blockType != BLOCKTYPENONE ){\n\t\t\t\t\t//\n\t\t\t\t\tif(worldGrid[iX - 1][iY].blockType === BLOCKTYPENONE &&\n\t\t\t\t\t\t\tworldGrid[iX][iY - 1].blockType === BLOCKTYPENONE &&\n\t\t\t\t\t\t\tworldGrid[iX + 1][iY].blockType === BLOCKTYPENONE){\n\t\t\t\t\t\t\n\t\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPENONE;\n\t\t\t\t\t\tworldGrid[iX][iY].frameName = \"blank.png\";\n\t\t\t\t\t\tworldGrid[iX+1][iY].blockType = BLOCKTYPENONE;\n\t\t\t\t\t\tworldGrid[iX+1][iY].frameName = \"blank.png\";\n\t\t\t\t\t\tworldGrid[iX-1][iY].blockType = BLOCKTYPENONE;\n\t\t\t\t\t\tworldGrid[iX-1][iY].frameName = \"blank.png\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//grass topping\n\t\tvar grassLevels;\n\t\tfor(var iX = 1; iX < (worldWidth / 2); iX++){\n\t\t\tgrassLevels = 0;\n\t\t\tfor(var iY = 1; iY < worldHeight - 1; iY++){\n\t\t\t\t//check not right at edge of world for array saftey net\n\t\t\t\tif(worldGrid[iX][iY].blockType != BLOCKTYPENONE ){\n\t\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEGRASS;\n\t\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomGrassTexture();\n\t\t\t\t\t\tgrassLevels++;\n\t\t\t\t\t\tif(grassLevels > 1){ break; }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//flip copy to second half of world\n\t\tfor(var iX = 0; iX < (worldWidth / 2); iX++){\n\t\t\tfor(var iY = 0; iY < worldHeight; iY++){\n\t\t\t\tif(worldGrid[iX][iY].blockType != BLOCKTYPENONE){\n\t\t\t\t\tworldGrid[worldWidth - iX - 1][iY].blockType = worldGrid[iX][iY].blockType;\n\t\t\t\t\tswitch(worldGrid[iX][iY].blockType){\n\t\t\t\t\tcase BLOCKTYPEDIRT:\n\t\t\t\t\t\tworldGrid[worldWidth - iX - 1][iY].frameName = worldGrid[iX][iY].frameName;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BLOCKTYPEGRASS:\n\t\t\t\t\t\tworldGrid[worldWidth - iX - 1][iY].frameName = getRandomGrassTexture(60);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t\t\n\t}", "title": "" }, { "docid": "d424a2c7510f2a2bea33f746eaf1fa99", "score": "0.5628861", "text": "constructor() {\n this.textures = {\n rgb: new Texture(\"assets/rgb.jpg\"),\n earth: new Texture(\"assets/earth.gif\"),\n // grid: new Texture(\"assets/grid.png\"),\n stars: new Texture(\"assets/stars.png\"),\n text: new Texture(\"assets/text.png\"),\n }\n this.shapes = {\n donut: new defs.Torus(15, 15, [[0, 2], [0, 1]]),\n cone: new defs.Closed_Cone(4, 10, [[0, 2], [0, 1]]),\n capped: new defs.Capped_Cylinder(4, 12, [[0, 2], [0, 1]]),\n ball: new defs.Subdivision_Sphere(3, [[0, 1], [0, 1]]),\n cube: new defs.Cube(),\n prism: new (defs.Capped_Cylinder.prototype.make_flat_shaded_version())(10, 10, [[0, 2], [0, 1]]),\n gem: new (defs.Subdivision_Sphere.prototype.make_flat_shaded_version())(2),\n donut2: new (defs.Torus.prototype.make_flat_shaded_version())(20, 20, [[0, 2], [0, 1]]),\n square: new defs.Square(),\n teapot: new Shape_From_File(\"assets/teapot.obj\"),\n amogus: new Shape_From_File( \"assets/amogus.obj\"),\n igloo: new Shape_From_File('assets/igloo.obj'),\n skull: new Shape_From_File('assets/skull.obj')\n\n };\n }", "title": "" }, { "docid": "369e694e5226e2133b6c98f45d7e6070", "score": "0.56279045", "text": "function setup() {\n\n //Make the title and play button invisible.\n title.visible = false;\n playButton.visible = false;\n playButton.enabled = false;\n\n // Init floor level\n floorLevel = g.canvas.height;\n\n // Setting course width\n numberOfPillars = 50;\n var numberOfSnowflakes = 150;\n courseWidth = numberOfPillars * 64;\n\n // Create snowflakes\n snowflakes = g.group();\n\n for (var i = 0; i < numberOfSnowflakes; i++) {\n var snowflake = g.sprite(\"snowflake-small.png\");\n snowflakes.addChild(snowflake);\n\n snowflake.x = randomInt(1, courseWidth);\n snowflake.y = randomInt(-1 * courseWidth, g.canvas.height);\n }\n snowflakes.vx = 0;\n snowflakes.vy = 0.5;\n\n\n // Make ice block levels\n var numLevels = 1; // num of blocks per column\n var direction = 0;\n\n // Render trees for the end of the snowman course\n var treeFrames = [\"frozenTree.png\", \"frozenTreeTheEnd.png\"];\n finish = g.sprite(treeFrames);\n finish.x = (numberOfPillars) * 64 - 45;\n finish.y = 90;\n finish.scale.x = 0.5;\n finish.scale.y = 0.5;\n finish.vx = 0;\n\n iceBlocks = g.group();\n\n for (var i = 0; i < numberOfPillars; i++) {\n\n if (i < numberOfPillars - 10) {\n if (numLevels < 1) {\n direction = 1;\n } else if (numLevels === 3) {\n direction = -1\n } else {\n direction = randomDirection();\n }\n numLevels += direction;\n //numLevels = 1;\n for (var j = 1; j <= numLevels; j++) {\n var block = g.sprite(\"iceBlock.png\");\n iceBlocks.addChild(block);\n block.type = \"block\";\n block.x = i * 64;\n block.y = g.canvas.height - j * 64;\n }\n }\n\n if (i >= numberOfPillars - 10) {\n var block = g.sprite(\"iceBlock.png\");\n iceBlocks.addChild(block);\n block.type = \"block\";\n block.x = i * 64;\n block.y = g.canvas.height - 64;\n }\n\n // Ice block level with trees\n if (i === numberOfPillars - 1) {\n for (var j = 5; j > 0; j--) {\n var treeBlock = g.sprite(\"iceBlock.png\");\n iceBlocks.addChild(treeBlock);\n treeBlock.type = \"finish\";\n treeBlock.x = i * 64 + 30 * j;\n treeBlock.y = 264;\n treeBlock.scale.x = 0.5;\n treeBlock.scale.y = 0.5;\n\n }\n }\n }\n iceBlocks.vx = 0;\n\n\n\n // The snowman\n let snowmanFrames = [\n \"snowman-small.png\",\n \"snowman-small-jump.png\",\n \"snowman-small-hurt.png\"\n ];\n snowman = g.sprite(snowmanFrames);\n snowman.y = 325;\n snowman.vx = 0;\n snowman.vy = 0;\n snowman.ay = 0;\n\n // Set gravity\n gravity = 0.2;\n // Set friction\n friction = 0.9;\n // Set snowball spring factor\n spring = 0.01;\n\n // Set upper bound for velocity in (neg) Y direction\n minVelocityY = -1;\n // Set upper bound for velocity in X direction\n maxVelocityX = 3;\n\n\n // Create the frames array for when snowman collides w/ a snowflake\n dustFrames = [\"pink.png\", \"yellow.png\", \"green.png\", \"violet.png\"];\n\n\n // Snowballs\n var maxSnowballs = 5;\n snowballs = g.group();\n\n for (var i = 0; i < maxSnowballs; i++) {\n var snowball = g.sprite(\"snowball.png\");\n snowballs.addChild(snowball);\n snowball.num = i;\n }\n\n // Bouncing penguins\n var bouncingPenguinFrames = [\n \"penguin-1-bouncing-R.png\",\n \"penguin-2-bouncing-R.png\",\n \"penguin-1-bouncing-L.png\",\n \"penguin-2-bouncing-L.png\"\n ];\n bouncingRight = [0, 1];\n bouncingLeft = [2, 3];\n maxBouncePenguins = 3;\n bouncingPenguins = g.group();\n for (var i = 0; i < maxBouncePenguins; i++) {\n var bouncingPenguin = g.sprite(bouncingPenguinFrames);\n bouncingPenguins.addChild(bouncingPenguin);\n // bouncingPenguin.num = i;\n bouncingPenguin.oX = 160;\n bouncingPenguin.x = 160;\n bouncingPenguin.y = 80;\n bouncingPenguin.vx = randomNum(0.2, 0.7);\n bouncingPenguin.oVx = bouncingPenguin.vx;\n bouncingPenguin.vy = 0;\n // bouncingPenguin.dirX = 1;\n bouncingPenguin.floorL = g.canvas.height;\n bouncingPenguin.playAnimation(bouncingRight);\n }\n\n // The igloo\n igloo = g.sprite(\"igloo-R.png\");\n igloo.x = 10;\n igloo.y = 20;\n igloo.vx = 0;\n\n // Skating penguin\n var skatingPenguinFrames = [\n \"penguin-1-skating-R.png\",\n \"penguin-2-skating-R.png\",\n \"penguin-1-skating-L.png\",\n \"penguin-2-skating-L.png\"\n ];\n skatingRight = [0, 1];\n skatingLeft = [2, 3];\n skatingPenguin = g.sprite(skatingPenguinFrames);\n skatingPenguin.x = (numberOfPillars - 10) * 64;\n skatingPenguin.oX = skatingPenguin.x;\n skatingPenguin.y = g.canvas.height - 64 - skatingPenguin.height;\n skatingPenguin.vx = 0.5;\n skatingPenguin.vy = 0;\n skatingPenguin.fps = 1;\n skatingPenguin.playAnimation(skatingRight);\n\n totalPenguins = maxBouncePenguins + 1;\n\n // Snowball used for attack\n attackSnowball = g.sprite(\"snowball.png\");\n attackSnowball.x = snowman.centerX;\n attackSnowball.y = snowman.centerY - snowman.halfHeight;\n attackSnowball.vx = 0;\n attackSnowball.vy = 0;\n attackSnowball.w = 0.05; // angular velocity\n attackSnowball.angle = 0;\n attackSnowball.radius = 40;\n attackSnowball.attack = false; // set to true when ball is thrown\n attackSnowball.visible = false;\n\n\n // Orange snowflake game points\n points = g.group();\n var numMaxPoints = totalPenguins;\n for (var i = 0; i < numMaxPoints; i++) {\n var point = g.sprite(\"snowflake-orange.png\");\n point.num = i;\n point.x = g.canvas.width - 100 - 30 * i;\n point.y = 25;\n point.scale.x = 0.5;\n point.scale.y = 0.5;\n point.visible = false;\n points.addChild(point);\n }\n\n // gameScene = g.group(\n // finish,\n // iceBlocks,\n // snowman,\n // bouncingPenguins,\n // skatingPenguin,\n // attackSnowball,\n // points,\n // snowballs,\n // snowflakes,\n // sky\n // );\n\n // Game over scene\n gameOverTitle = g.sprite(\"gameOver.png\");\n gameOverTitle.scale.x = 0.5;\n gameOverTitle.scale.y = 0.5;\n g.stage.putCenter(gameOverTitle, 0, -55);\n\n\n // Reset button\n resetButton = g.button([\"up-reset.png\", \"over-reset.png\", \"down-reset.png\"]);\n g.stage.putCenter(resetButton, 0, 100);\n resetButton.enabled = false;\n\n gameOverScene = g.group(resetButton, gameOverTitle);\n gameOverScene.visible = false;\n\n //Capture the keyboard arrow keys\n let left = keyboard(65), //A\n up = keyboard(38), // Up Arrow\n right = keyboard(68), //D\n down = keyboard(83),\n spacebar = keyboard(32); // Spacebar\n\n //Left arrow key `press` method\n left.press = () => {\n snowmanDirection = \"left\";\n iceBlocks.vx = 2;\n if ((snowman.vx < maxVelocityX) && (snowman.vx > -1 * maxVelocityX)) {\n snowman.vx = -2;\n }\n };\n //Left arrow key `release` method\n left.release = () => {\n snowmanDirection = \"\";\n snowman.vx = 0;\n iceBlocks.vx = 0;\n };\n\n //Right\n right.press = () => {\n snowmanDirection = \"right\";\n iceBlocks.vx = -2;\n if ((snowman.vx < maxVelocityX) && (snowman.vx > -1 * maxVelocityX)) {\n snowman.vx = 2;\n }\n };\n right.release = () => {\n snowmanDirection = \"\";\n snowman.vx = 0;\n iceBlocks.vx = 0;\n };\n\n //Up\n up.press = () => {\n snowman.gotoAndStop(1);\n //snowman.playAnimation([0,1]);\n snowman.ay = -0.6;\n };\n up.release = () => {\n snowman.gotoAndStop(0);\n g.wait(300, function() {\n snowman.ay = 0;\n });\n };\n\n spacebar.press = () => {\n if ((snowballCount > 0) && (attackSnowball.attack === false)) {\n snowballCount--;\n attackSnowball.visible = true;\n }\n };\n spacebar.release = () => {\n if (attackSnowball.visible === true) {\n attackSnowball.vx = 6 * Math.cos(attackSnowball.angle);\n attackSnowball.vy = 6 * Math.sin(attackSnowball.angle);\n attackSnowball.attack = true;\n\n g.wait(1000, function() {\n attackSnowball.attack = false;\n attackSnowball.visible = false;\n });\n }\n };\n\n // Set game state\n g.state = play;\n}", "title": "" }, { "docid": "99d73930420fcdfcc83b41d3eec4c0e4", "score": "0.56225413", "text": "function digging() {\r\nvar loader = new THREE.JSONLoader();\r\n loader.load(\"Shed/exterior/shovel.json\", handle_load_shovel) \r\n}", "title": "" }, { "docid": "ab6fd14ca574333639662fc794563161", "score": "0.560753", "text": "initBuffers(gl) {\n // Create a buffer for the vertex positions.\n const positionBuffer = gl.createBuffer();\n\n // Select the positionBuffer as the one to apply buffer\n // operations to from here out.\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n // Now create an array of positions for the terrain.\n const unit = this.size / this.getLOD();\n let i = 0, j = 0, offset = 0, offsetX = 0, offsetY = 0, offsetZ = 0, one = 0, k = 0;\n\n one = - this.size/2;\n for (k = 0; k < 2; k++) {\n for (i = 0; i < this.getLOD(); i++) {\n for (j = 0; j < this.getLOD(); j++) {\n offsetX = one + i * unit;\n offsetZ = one + j * unit;\n\n this.positions[offset++] = offsetX;\n this.positions[offset++] = offsetY;\n this.positions[offset++] = offsetZ;\n\n this.positions[offset++] = offsetX + unit;\n this.positions[offset++] = offsetY;\n this.positions[offset++] = offsetZ;\n\n this.positions[offset++] = offsetX + unit;\n this.positions[offset++] = offsetY + unit;\n this.positions[offset++] = offsetZ;\n\n this.positions[offset++] = offsetX;\n this.positions[offset++] = offsetY + unit;\n this.positions[offset++] = offsetZ;\n }\n }\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(this.positions), gl.STATIC_DRAW);\n\n const textureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, textureCoordBuffer);\n\n let textureCoordinates = [];\n offset = 0;\n\n one = 1 / this.getLOD();\n \n for (k = 0; k < 2; k++) {\n for (i = 0; i < this.getLOD(); i++) {\n for (j = 0; j < this.getLOD(); j++) {\n \n let left = i * one;\n let roof = j * one;\n\n textureCoordinates[offset++] = left + one; // X\n textureCoordinates[offset++] = roof + one; // Y\n\n textureCoordinates[offset++] = left; // X\n textureCoordinates[offset++] = roof + one; // Y\n\n textureCoordinates[offset++] = left; // X\n textureCoordinates[offset++] = roof; // Y\n\n textureCoordinates[offset++] = left + one; // X\n textureCoordinates[offset++] = roof; // Y\n }\n }\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoordinates),\n 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 let start = 0, indices = [];\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 offset = 0;\n start = 0;\n for (k = 0; k < 2; k++) {\n for (i = 0; i < this.getLOD(); i++) {\n for (j = 0; j < this.getLOD(); j++) {\n indices[offset++] = start;\n indices[offset++] = start + 2;\n indices[offset++] = start + 1;\n \n indices[offset++] = start;\n indices[offset++] = start + 3;\n indices[offset++] = start + 2;\n start += 4;\n }\n }\n }\n\n // Now send the element array to GL\n\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);\n\n this.buffers = {\n position: positionBuffer,\n textureCoord: textureCoordBuffer,\n indices: indexBuffer,\n };\n \n return this.buffers;\n }", "title": "" }, { "docid": "a286c99162493a530771d17ae69162cc", "score": "0.5607146", "text": "function loadSpheres() {\n var inputSpheres = getJSONFile(INPUT_SPHERES_URL,\"spheres\");\n\n if (inputSpheres != String.null) {\n var latitudeBands = 30;\n var longitudeBands = 30;\n\n for (var whichSet=0; whichSet<inputSpheres.length; whichSet++) {\n var radius = inputSpheres[whichSet].r;\n var cx = inputSpheres[whichSet].x;\n var cy = inputSpheres[whichSet].y;\n var cz = inputSpheres[whichSet].z;\n var center = new vec3.fromValues(cx,cy,cz);\n\n ambient = inputSpheres[whichSet].ambient;\n diffuse = inputSpheres[whichSet].diffuse;\n specular = inputSpheres[whichSet].specular;\n\n var coordArray = [];\n var normalArray = [];\n var indexArray = [];\n\n for (var latNumber = 0; latNumber <= latitudeBands; latNumber++) {\n var theta = latNumber * Math.PI / latitudeBands;\n var sinTheta = Math.sin(theta);\n var cosTheta = Math.cos(theta);\n\n for (var longNumber = 0; longNumber <= longitudeBands; longNumber++) {\n var phi = longNumber * 2 * Math.PI / longitudeBands;\n var sinPhi = Math.sin(phi);\n var cosPhi = Math.cos(phi);\n\n var x = cosPhi * sinTheta;\n var y = cosTheta;\n var z = sinPhi * sinTheta;\n\n normalArray.push(x);\n normalArray.push(y);\n normalArray.push(z);\n coordArray.push(radius * x);\n coordArray.push(radius * y);\n coordArray.push(radius * z);\n }\n }\nconsole.log(coordArray);\n for (var latNumber = 0; latNumber < latitudeBands; latNumber++) {\n for (var longNumber = 0; longNumber < longitudeBands; longNumber++) {\n var first = (latNumber * (longitudeBands + 1)) + longNumber;\n var second = first + longitudeBands + 1;\n indexArray.push(first);\n indexArray.push(second);\n indexArray.push(first + 1);\n\n indexArray.push(second);\n indexArray.push(second + 1);\n indexArray.push(first + 1);\n }\n }\n\n triBufferSize = indexArray.length;\n\n // send the vertices to webGL\n vertexBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(coordArray),gl.STATIC_DRAW); // coords to that buffer\n\n // send the triangle indices to webGL\n triangleBuffer = gl.createBuffer(); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffer); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(indexArray),gl.STATIC_DRAW); // indices to that buffer\n\n // send normals to webGL\n normalBuffer = gl.createBuffer(); //init empty normal coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normalArray),gl.STATIC_DRAW); //normals to that buffer\n\n // translate and rotate current object\n if (whichSet == sprSet) {\n ambient = [0.5,0.5,0];\n diffuse = [0.5,0.5,0];\n specular = [0,0,0];\n\n // matrix transforms\n mat4.perspective(pMatrix, Math.PI/2, gl.viewportWidth / gl.viewportHeight, 0.1, 100.0);\n mat4.identity(mvMatrix);\n mat4.translate(mvMatrix, mvMatrix, center);\n mat4.lookAt(lMatrix, [0.5 + sp_x[sprSet] + tx, 0.5 + sp_y[sprSet] + ty, -0.5 + sp_z[sprSet] + tz], [0.5 + sp_x[sprSet] + tx, 0.5 + sp_y[sprSet] + ty, 0 + tz], [0, 1, 0]);\n\n mat4.rotate(mvMatrix, mvMatrix, degToRad(sp_xRot[sprSet] + xRot), [1, 0, 0]);\n mat4.rotate(mvMatrix, mvMatrix, degToRad(sp_yRot[sprSet] + yRot), [0, 1, 0]);\n mat4.rotate(mvMatrix, mvMatrix, degToRad(sp_zRot[sprSet] + zRot), [0, 0, 1]);\n\n mat4.rotate(lMatrix, lMatrix, degToRad(sp_xRot[sprSet] + xRot), [1, 0, 0]);\n mat4.rotate(lMatrix, lMatrix, degToRad(sp_yRot[sprSet] + yRot), [0, 1, 0]);\n mat4.rotate(lMatrix, lMatrix, degToRad(sp_zRot[sprSet] + zRot), [0, 0, 1]);\n\n var mMatrix = mat4.create();\n mat4.mul(mMatrix, lMatrix, mvMatrix);\n mat3.normalFromMat4(nMatrix, mMatrix);\n\n setMatrixUniforms();\n setColorUniforms();\n renderTriangles();\n continue;\n }\n\n // matrix transforms\n mat4.perspective(pMatrix, Math.PI/2, gl.viewportWidth / gl.viewportHeight, 0.1, 100.0);\n mat4.identity(mvMatrix);\n mat4.translate(mvMatrix, mvMatrix, center);\n mat4.lookAt(lMatrix, [0.5 + sp_x[whichSet] + tx, 0.5 + sp_y[whichSet] + ty, -0.5 + sp_z[whichSet] + tz], [0.5 + sp_x[whichSet] + tx, 0.5 + sp_y[whichSet] + ty, 0 + tz], [0, 1, 0]);\n\n mat4.rotate(mvMatrix, mvMatrix, degToRad(sp_xRot[whichSet] + xRot), [1, 0, 0]);\n mat4.rotate(mvMatrix, mvMatrix, degToRad(sp_yRot[whichSet] + yRot), [0, 1, 0]);\n mat4.rotate(mvMatrix, mvMatrix, degToRad(sp_zRot[whichSet] + zRot), [0, 0, 1]);\n\n mat4.rotate(lMatrix, lMatrix, degToRad(sp_xRot[whichSet] + xRot), [1, 0, 0]);\n mat4.rotate(lMatrix, lMatrix, degToRad(sp_yRot[whichSet] + yRot), [0, 1, 0]);\n mat4.rotate(lMatrix, lMatrix, degToRad(sp_zRot[whichSet] + zRot), [0, 0, 1]);\n\n var mMatrix = mat4.create();\n mat4.mul(mMatrix, lMatrix, mvMatrix);\n mat3.normalFromMat4(nMatrix, mMatrix);\n\n setMatrixUniforms();\n setColorUniforms();\n renderTriangles();\n }\n }\n}", "title": "" }, { "docid": "fca21fc8a4eb8457ae2edb716a475e8d", "score": "0.56007475", "text": "createTextures() {\n\n const { textures } = this.parsedXML;\n\n this.displayTextures = {};\n\n for (let texID in textures) {\n\n if (!textures.hasOwnProperty(texID)) continue;\n\n let currTex = textures[texID];\n let path = currTex.file;\n let important = path.split('/');\n important = important.pop();\n important = \"../scenes/images/\" + important;\n let tex = new CGFtexture(this.scene, important);\n\n this.displayTextures[texID] = tex;\n }\n\n console.log('Loaded textures.');\n }", "title": "" }, { "docid": "d28ce108ea833f44b6ba3209ba70da2e", "score": "0.5599993", "text": "function addGrassToScene(scene) {\n var textureUrl = 'images/grasslight-small.jpg'\n var texture = THREE.ImageUtils.loadTexture(textureUrl);\n texture.wrapS = THREE.RepeatWrapping;\n texture.wrapT = THREE.RepeatWrapping;\n texture.repeat.x= 22\n texture.repeat.y= 22\n //texture.anisotropy = renderer.getMaxAnisotropy()\n // build object3d\n var ddddd = 3000;\n var geometry = new THREE.PlaneBufferGeometry(ddddd * 6, ddddd * 6, 33, 33); //new THREE.PlaneGeometry(ddddd * 2, ddddd * 2);\n var material = new THREE.MeshLambertMaterial({\n map : texture,\n emissive: 'green',\n });\n //material = new THREE.MeshLambertMaterial({ color: 0xff0000, wireframe: true, wireframeLinewidth: 4 });\n var object3d = new THREE.Mesh(geometry, material)\n object3d.receiveShadow = true;\n\n object3d.rotateX(-Math.PI/2)\n //object3d.translateY(-45.0);\n object3d.position.y -= 45.0;\n object3d.position.x += ddddd*6/3;\n object3d.position.z += ddddd*6/3;\n scene.add(object3d)\n \n //////////////////////////////////////////////////////////////////////////////////\n // comment //\n //////////////////////////////////////////////////////////////////////////////////\n var nTufts = 300;\n var positions = new Array(nTufts)\n for(var i = 0; i < nTufts; i++){\n var position = new THREE.Vector3()\n position.x = (Math.random()-0.5)*ddddd\n position.z = (Math.random()-0.5)*ddddd\n positions[i] = position\n }\n var mesh = THREEx.createGrassTufts(positions)\n mesh.position.y -= 45.0;\n mesh.position.x += ddddd/3;\n mesh.position.z += ddddd/3;\n scene.add(mesh)\n\n // load the texture\n var textureUrl = THREEx.createGrassTufts.baseUrl+'images/grass01.png'\n var material = mesh.material\n material.map = THREE.ImageUtils.loadTexture(textureUrl)\n material.alphaTest = 0.7\n //////////////////////////////////////////////////////////////////////////////////\n // comment //\n //////////////////////////////////////////////////////////////////////////////////\n \n \n //var nTufts = 5000\n var positions = new Array(nTufts)\n for(var i = 0; i < nTufts; i++){\n var position = new THREE.Vector3()\n position.x = (Math.random()-0.5)*ddddd\n position.z = (Math.random()-0.5)*ddddd\n positions[i] = position\n }\n var mesh = THREEx.createGrassTufts(positions)\n mesh.position.y -= 45.0;\n mesh.position.x += ddddd/3;\n mesh.position.z += ddddd/3;\n scene.add(mesh)\n // load the texture\n var textureUrl = THREEx.createGrassTufts.baseUrl+'images/grass02.png'\n var material = mesh.material\n material.map = THREE.ImageUtils.loadTexture(textureUrl)\n material.alphaTest = 0.7\n \n //////////////////////////////////////////////////////////////////////////////////\n // comment //\n //////////////////////////////////////////////////////////////////////////////////\n //var nTufts = 100\n var positions = new Array(nTufts)\n for(var i = 0; i < nTufts; i++){\n var position = new THREE.Vector3()\n position.x = (Math.random()-0.5)*ddddd\n position.z = (Math.random()-0.5)*ddddd\n positions[i] = position\n }\n var mesh = THREEx.createGrassTufts(positions)\n mesh.position.y -= 45.0;\n mesh.position.x += ddddd/3;\n mesh.position.z += ddddd/3;\n scene.add(mesh)\n // load the texture\n var material = mesh.material\n var textureUrl = THREEx.createGrassTufts.baseUrl+'images/flowers01.png'\n material.map = THREE.ImageUtils.loadTexture(textureUrl)\n material.emissive.set(0x888888)\n material.alphaTest = 0.7\n \n //////////////////////////////////////////////////////////////////////////////////\n // comment //\n //////////////////////////////////////////////////////////////////////////////////\n //var nTufts = 100\n var positions = new Array(nTufts)\n for(var i = 0; i < nTufts; i++){\n var position = new THREE.Vector3()\n position.x = (Math.random()-0.5)*ddddd\n position.z = (Math.random()-0.5)*ddddd\n positions[i] = position\n }\n var mesh = THREEx.createGrassTufts(positions)\n mesh.position.y -= 45.0;\n mesh.position.x += ddddd/3;\n mesh.position.z += ddddd/3;\n scene.add(mesh)\n // load the texture\n var material = mesh.material\n var textureUrl = THREEx.createGrassTufts.baseUrl+'images/flowers02.png'\n material.map = THREE.ImageUtils.loadTexture(textureUrl)\n material.emissive.set(0x888888)\n material.alphaTest = 0.7\n}", "title": "" }, { "docid": "0c5a2fb1cf542bdaddaa8127ae23e936", "score": "0.5597268", "text": "function setupTerrainBuffers() {\n \n var vTerrain=[];\n var fTerrain=[];\n var nTerrain=[];\n var eTerrain=[];\n \n var cTerrain=[]; \n var gridN=129;\n var max = 128;\n var heightArray = new Array(gridN);\n for(var i =0 ; i< gridN; i++){\n heightArray[i]= new Array(gridN);\n }\n heightArray[0][0] = 0;\n heightArray[max][0] = 0;\n heightArray[0][max] = 0;\n heightArray[max][max]=0;\n \n generateDiamondHeight(heightArray, 0,0,128,128, 128);\n \n var newSize=3;\n var numT = terrainFromIteration(gridN-1, -newSize,newSize,-newSize,newSize, vTerrain, fTerrain, nTerrain,heightArray);\n console.log(\"Generated \", numT, \" triangles\");\n tVertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, tVertexPositionBuffer); \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vTerrain), gl.STATIC_DRAW);\n tVertexPositionBuffer.itemSize = 3;\n tVertexPositionBuffer.numItems = (gridN+1)*(gridN+1);\n \n // Specify normals to be able to do lighting calculations\n tVertexNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, tVertexNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(nTerrain),\n gl.STATIC_DRAW);\n tVertexNormalBuffer.itemSize = 3;\n tVertexNormalBuffer.numItems = (gridN+1)*(gridN+1);\n \n // Specify faces of the terrain\n tIndexTriBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexTriBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(fTerrain),\n gl.STATIC_DRAW);\n tIndexTriBuffer.itemSize = 1;\n tIndexTriBuffer.numItems = numT*3;\n \n // Specify color of the terrain \n terrainFromIterationcolor(gridN-1,cTerrain,heightArray); \n colorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, colorBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(cTerrain),\n gl.STATIC_DRAW);\n colorBuffer.itemSize = 3;\n colorBuffer.numItems = (gridN+1)*(gridN+1);\n \n \n \n //Setup Edges\n generateLinesFromIndexedTriangles(fTerrain,eTerrain); \n tIndexEdgeBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexEdgeBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(eTerrain),\n gl.STATIC_DRAW);\n tIndexEdgeBuffer.itemSize = 1;\n tIndexEdgeBuffer.numItems = eTerrain.length;\n \n \n}", "title": "" }, { "docid": "5066428372840a3bf8d5a27891c914f4", "score": "0.55899954", "text": "function updateTerrain(extent, updateVeg) {\n // confirm params are different\n if (extent.length === 4 // extent is exactly 4 long\n && (terrain == undefined || extent[0] != spatialExtent[0] ||\n extent[1] != spatialExtent[1] ||\n extent[2] != spatialExtent[2] ||\n extent[3] != spatialExtent[3])) {\n spatialExtent = extent;\n if (terrain != undefined) {\n scene.remove(terrain);\n terrain.geometry.dispose();\n for (var key in vegParams) {\n scene.remove(scene.getObjectByName(key));\n }\n }\n let srcPath = 'heightmap/' + extent.join('/') + '/';\n let statsPath = srcPath + 'stats/';\n const tempLoader = assetloader_1.Loader();\n tempLoader.load({\n textures: [\n { name: 'heightmap', url: srcPath },\n ],\n statistics: [\n { name: 'heightmap_stats', url: statsPath },\n ]\n }, function (loadedAssets) {\n // compute the heights from this heightmap\n // Only do this once per terrain. We base our clusters off of this\n const heightmapTexture = loadedAssets.textures['heightmap'];\n const heightmapStats = loadedAssets.statistics['heightmap_stats'];\n const heights = computeHeights(heightmapTexture, heightmapStats);\n terrain = terrain_1.createTerrain({\n rock: masterAssets.textures['terrain_rock'],\n snow: masterAssets.textures['terrain_snow'],\n grass: masterAssets.textures['terrain_grass'],\n sand: masterAssets.textures['terrain_sand'],\n water: masterAssets.textures['terrain_water'],\n vertShader: masterAssets.text['terrain_vert'],\n fragShader: masterAssets.text['terrain_frag'],\n data: loadedAssets.statistics['heightmap_stats'],\n heightmap: heightmapTexture,\n heights: heights,\n disp: globals.TERRAIN_DISP\n });\n scene.add(terrain);\n let baseColor = new THREE.Color(55, 80, 100); // TODO - better colors\n let i = 0;\n const maxColors = 7;\n // Add our vegcovers\n for (var key in vegParams) {\n // calculate the veg colors we want to display\n const r = Math.floor(i / maxColors * 200);\n const g = Math.floor(i / maxColors * 130);\n const vegColor = new THREE.Color(baseColor.r + r, baseColor.g + g, baseColor.b);\n const vegAssetName = globals.getVegetationAssetsName(key);\n const vegStats = getVegetationStats(key);\n scene.add(veg_1.createVegetation({\n heightmap: loadedAssets.textures['heightmap'],\n name: key,\n tex: masterAssets.textures[vegAssetName + '_material'],\n geo: masterAssets.geometries[vegAssetName],\n color: vegColor,\n vertShader: masterAssets.text['veg_vert'],\n fragShader: masterAssets.text['veg_frag'],\n disp: globals.TERRAIN_DISP,\n clusters: createClusters(heights, heightmapStats, vegStats),\n heightData: loadedAssets.statistics['heightmap_stats'],\n vegData: vegStats\n }));\n ++i;\n }\n render();\n if (updateVeg)\n updateVegetation(vegParams);\n }, function (progress) {\n console.log(\"Loading heightmap assets... \" + progress * 100 + \"%\");\n }, function (error) {\n console.log(error);\n return;\n });\n }\n }", "title": "" }, { "docid": "c4b16f1617790f7735dcb19d961df228", "score": "0.5583468", "text": "function preproc()\n{\n // nodal coordinates as passed to opengl\n let coords = []\n // 3 corner nodes of a face to compute the face normal in the shader\n let As = []\n let Bs = []\n let Cs = []\n // triangles as passed to open gl\n let trias = []\n // displacement vector per vertex to displace said vertex\n let disps = []\n // global min/max to normalize result amplitudes\n let min = 0.0\n let max = 0.0\n // texture coordinates to properly map results per face\n let texcoords = []\n // all four corner nodes to compute the texture mapping\n let corners = []\n\n // for each quad\n for(let i = 0; i < quads.length; ++i) {\n let quad = quads[i]\n // triangulate\n trias.push(4 * i + 0, 4 * i + 1, 4 * i + 2, 4 * i + 0, 4 * i + 2, 4 * i + 3)\n // set texture coordinates\n texcoords.push(\n 0.0, 0.0,\n 0.0, 1.0,\n 1.0, 1.0,\n 1.0, 0.0\n )\n // push coordinates\n coords.push(\n nodes[3 * quad[0] + 0],\n nodes[3 * quad[0] + 1],\n nodes[3 * quad[0] + 2],\n nodes[3 * quad[1] + 0],\n nodes[3 * quad[1] + 1],\n nodes[3 * quad[1] + 2],\n nodes[3 * quad[2] + 0],\n nodes[3 * quad[2] + 1],\n nodes[3 * quad[2] + 2],\n nodes[3 * quad[3] + 0],\n nodes[3 * quad[3] + 1],\n nodes[3 * quad[3] + 2])\n // push A,B and C corner nodes to compute the face normal\n As.push(\n nodes[3 * quad[0] + 0] + results[3 * quad[0] + 0],\n nodes[3 * quad[0] + 1] + results[3 * quad[0] + 1],\n nodes[3 * quad[0] + 2] + results[3 * quad[0] + 2],\n nodes[3 * quad[0] + 0] + results[3 * quad[0] + 0],\n nodes[3 * quad[0] + 1] + results[3 * quad[0] + 1],\n nodes[3 * quad[0] + 2] + results[3 * quad[0] + 2],\n nodes[3 * quad[0] + 0] + results[3 * quad[0] + 0],\n nodes[3 * quad[0] + 1] + results[3 * quad[0] + 1],\n nodes[3 * quad[0] + 2] + results[3 * quad[0] + 2],\n nodes[3 * quad[0] + 0] + results[3 * quad[0] + 0],\n nodes[3 * quad[0] + 1] + results[3 * quad[0] + 1],\n nodes[3 * quad[0] + 2] + results[3 * quad[0] + 2])\n Bs.push(\n nodes[3 * quad[1] + 0] + results[3 * quad[1] + 0],\n nodes[3 * quad[1] + 1] + results[3 * quad[1] + 1],\n nodes[3 * quad[1] + 2] + results[3 * quad[1] + 2],\n nodes[3 * quad[1] + 0] + results[3 * quad[1] + 0],\n nodes[3 * quad[1] + 1] + results[3 * quad[1] + 1],\n nodes[3 * quad[1] + 2] + results[3 * quad[1] + 2],\n nodes[3 * quad[1] + 0] + results[3 * quad[1] + 0],\n nodes[3 * quad[1] + 1] + results[3 * quad[1] + 1],\n nodes[3 * quad[1] + 2] + results[3 * quad[1] + 2],\n nodes[3 * quad[1] + 0] + results[3 * quad[1] + 0],\n nodes[3 * quad[1] + 1] + results[3 * quad[1] + 1],\n nodes[3 * quad[1] + 2] + results[3 * quad[1] + 2])\n Cs.push(\n nodes[3 * quad[2] + 0] + results[3 * quad[2] + 0],\n nodes[3 * quad[2] + 1] + results[3 * quad[2] + 1],\n nodes[3 * quad[2] + 2] + results[3 * quad[2] + 2],\n nodes[3 * quad[2] + 0] + results[3 * quad[2] + 0],\n nodes[3 * quad[2] + 1] + results[3 * quad[2] + 1],\n nodes[3 * quad[2] + 2] + results[3 * quad[2] + 2],\n nodes[3 * quad[2] + 0] + results[3 * quad[2] + 0],\n nodes[3 * quad[2] + 1] + results[3 * quad[2] + 1],\n nodes[3 * quad[2] + 2] + results[3 * quad[2] + 2],\n nodes[3 * quad[2] + 0] + results[3 * quad[2] + 0],\n nodes[3 * quad[2] + 1] + results[3 * quad[2] + 1],\n nodes[3 * quad[2] + 2] + results[3 * quad[2] + 2])\n // push displacements\n disps.push(\n results[3 * quad[0] + 0],\n results[3 * quad[0] + 1],\n results[3 * quad[0] + 2],\n results[3 * quad[1] + 0],\n results[3 * quad[1] + 1],\n results[3 * quad[1] + 2],\n results[3 * quad[2] + 0],\n results[3 * quad[2] + 1],\n results[3 * quad[2] + 2],\n results[3 * quad[3] + 0],\n results[3 * quad[3] + 1],\n results[3 * quad[3] + 2])\n let sqr = x => x*x;\n min = globalMin\n max = globalMax\n let result = state.component\n if(result == 3) {\n let sqr = (x) => x*x;\n corners.push(\n Math.sqrt(sqr(results[3 * quad[0] + 0]) + sqr(results[3 * quad[0] + 1]) + sqr(results[3 * quad[0] + 2])),\n Math.sqrt(sqr(results[3 * quad[1] + 0]) + sqr(results[3 * quad[1] + 1]) + sqr(results[3 * quad[1] + 2])),\n Math.sqrt(sqr(results[3 * quad[2] + 0]) + sqr(results[3 * quad[2] + 1]) + sqr(results[3 * quad[2] + 2])),\n Math.sqrt(sqr(results[3 * quad[3] + 0]) + sqr(results[3 * quad[3] + 1]) + sqr(results[3 * quad[3] + 2])),\n Math.sqrt(sqr(results[3 * quad[0] + 0]) + sqr(results[3 * quad[0] + 1]) + sqr(results[3 * quad[0] + 2])),\n Math.sqrt(sqr(results[3 * quad[1] + 0]) + sqr(results[3 * quad[1] + 1]) + sqr(results[3 * quad[1] + 2])),\n Math.sqrt(sqr(results[3 * quad[2] + 0]) + sqr(results[3 * quad[2] + 1]) + sqr(results[3 * quad[2] + 2])),\n Math.sqrt(sqr(results[3 * quad[3] + 0]) + sqr(results[3 * quad[3] + 1]) + sqr(results[3 * quad[3] + 2])),\n Math.sqrt(sqr(results[3 * quad[0] + 0]) + sqr(results[3 * quad[0] + 1]) + sqr(results[3 * quad[0] + 2])),\n Math.sqrt(sqr(results[3 * quad[1] + 0]) + sqr(results[3 * quad[1] + 1]) + sqr(results[3 * quad[1] + 2])),\n Math.sqrt(sqr(results[3 * quad[2] + 0]) + sqr(results[3 * quad[2] + 1]) + sqr(results[3 * quad[2] + 2])),\n Math.sqrt(sqr(results[3 * quad[3] + 0]) + sqr(results[3 * quad[3] + 1]) + sqr(results[3 * quad[3] + 2])),\n Math.sqrt(sqr(results[3 * quad[0] + 0]) + sqr(results[3 * quad[0] + 1]) + sqr(results[3 * quad[0] + 2])),\n Math.sqrt(sqr(results[3 * quad[1] + 0]) + sqr(results[3 * quad[1] + 1]) + sqr(results[3 * quad[1] + 2])),\n Math.sqrt(sqr(results[3 * quad[2] + 0]) + sqr(results[3 * quad[2] + 1]) + sqr(results[3 * quad[2] + 2])),\n Math.sqrt(sqr(results[3 * quad[3] + 0]) + sqr(results[3 * quad[3] + 1]) + sqr(results[3 * quad[3] + 2])))\n } else {\n corners.push(\n results[3 * quad[0] + result],\n results[3 * quad[1] + result],\n results[3 * quad[2] + result],\n results[3 * quad[3] + result],\n results[3 * quad[0] + result],\n results[3 * quad[1] + result],\n results[3 * quad[2] + result],\n results[3 * quad[3] + result],\n results[3 * quad[0] + result],\n results[3 * quad[1] + result],\n results[3 * quad[2] + result],\n results[3 * quad[3] + result],\n results[3 * quad[0] + result],\n results[3 * quad[1] + result],\n results[3 * quad[2] + result],\n results[3 * quad[3] + result])\n }\n // pick the appropriate min/max per the selected component\n max = max[result]\n min = min[result]\n }\n\n document.getElementById('progress').innerHTML = ''\n return {\n coords: coords,\n trias: trias,\n disps: disps,\n As: As,\n Bs: Bs,\n Cs, Cs,\n min: min,\n max: max,\n texcoords: texcoords,\n corners: corners\n }\n}", "title": "" }, { "docid": "4bb4d532726260db6d95167978cd3928", "score": "0.558059", "text": "generate(seed) {\n // Set & Create a Seed\n this.seed = seed || Date.now();\n seedrandom(this.seed, { global: true });\n\n // Generate Background\n const bgdirt = new createjs.Shape();\n bgdirt.graphics.beginBitmapFill(this.game.loadingHandler.sprites.bgdirt).drawRect(0, this.horizonLine, this.grid.widthGU * this.grid.tileSize, (this.grid.heightGU * this.grid.tileSize) - this.horizonLine);\n this.bg_tiles.push(bgdirt);\n this.game.addChild(bgdirt);\n\n // Generate Background Grass Layer\n const bggrass = new createjs.Container();\n for (let i = 0; i < this.grid.widthGU; i++) {\n const t = new Tile(i, this.horizonLineGU);\n // Background Grass Tile\n const bggt = new MapTile(this, t, { type: MapTile.Type.BG_GRASS });\n bggt.make();\n bggrass.addChild(bggt);\n }\n this.bg_tiles.push(bggrass);\n this.game.addChild(bggrass);\n\n // Generate First Grass Layer\n for (let i = 0; i < this.grid.widthGU; i++) {\n const t = new Tile(i, this.horizonLineGU);\n const mt = new Grass(this, t);\n mt.make();\n this.tiles.addChild(mt);\n this.fg_tiles[t.toString()] = mt;\n }\n\n // Generate Dirt\n for (let gY = this.horizonLineGU + 1; gY < this.grid.heightGU; gY++) {\n for (let gX = 0; gX < this.grid.widthGU; gX++) {\n const t = new Tile(gX, gY);\n const mt = new Dirt(this, t);\n mt.make();\n this.tiles.addChild(mt);\n this.fg_tiles[t.toString()] = mt;\n }\n }\n this.game.addChild(this.tiles);\n\n // Temporary variable to determine which layer we're on.\n let layer = 0;\n\n // Generate Coal Layer (Layer Only Contains Coal)\n layer = 1;\n for (let gX = 0; gX < this.grid.widthGU; gX++) {\n for (let gY = this.horizonLineGU + 1; gY < this.horizonLineGU + 21; gY++) {\n const t = new Tile(gX, gY);\n if (this.shouldGenType(\"coal\", layer, t)) this.genType(Coal, t);\n }\n }\n\n // Relayer and update\n this.game.displayHandler.relayer();\n this.game.update();\n\n // Cache the map\n this.tiles.cache(0, 0, this.grid.width, this.grid.height);\n }", "title": "" }, { "docid": "335f4e0cd0069fdb12d7e23d17cf1e44", "score": "0.5572976", "text": "function generateByTiledFile(newTile, leftSeedTile, rightSeedTile, fileName) {\n // console.log('generateByTiledFile' + [newTile, leftSeedTile, rightSeedTile, fileName].join(', '));\n var goRight;\n if (leftSeedTile) {\n goRight = true;\n\n newTile.leftEdge = leftSeedTile.rightEdge;\n newTile.leftHeight = leftSeedTile.rightHeight;\n\n //1st aproximation\n newTile.rightEdge = leftSeedTile.leftEdge + 10 * width;\n newTile.rightHeight = leftSeedTile.rightHeight;\n } else {\n goRight = false;\n\n newTile.rightEdge = rightSeedTile.rightEdge;\n newTile.rightHeight = rightSeedTile.rightHeight;\n\n //1st aproximation\n newTile.leftEdge = rightSeedTile.leftEdge - 10 * width;\n newTile.leftHeight = rightSeedTile.rightHeight;\n }\n\n\n loadMap(fileName)\n .then(function (data) {\n var map = parseMap(data);\n\n var entities = map.entities;\n\n var dx = newTile.leftEdge - map.leftEdge.x;\n var dy = newTile.leftHeight - map.leftEdge.y;\n\n for (var i = 0, count = entities.length; i < count; i++) {\n var entity = entities[i];\n entity.ng2D.x += dx;\n entity.ng2D.y += dy;\n world.$add(entity);\n }\n\n newTile.entities = entities;\n newTile.rightEdge = dx + map.rightEdge.x;\n newTile.rightHeight = dy + map.rightEdge.y;\n });\n }", "title": "" }, { "docid": "e75a55e150f17435a8fe76f6b18b6d9f", "score": "0.55697626", "text": "function main() {\r\n \r\n setupWebGL(); // set up the webGL environment\r\n setupShaders(); // setup the webGL shaders\r\n loadTriangles(); // load in the triangles from tri file\r\n loadEllipsoids();\r\n getSelectedIndex();\r\n document.onkeydown = keyDownControl;\r\n document.onkeypress = keyPressControl;\r\n renderStuff();\r\n \r\n} // end main", "title": "" }, { "docid": "eb3c97c96d01897f653e77f6ea8484c7", "score": "0.5558352", "text": "function displayTerrain(grid) {\n for (let i = 0; i < cols; i++) {\n for (let j = 0; j < rows; j++) {\n if (grid[i][j] < 0.3) {\n fill(10, 40, 115);\n rect(i * mapUnitWidth, j * mapUnitHeight, mapUnitWidth + 1, mapUnitHeight + 1);\n }\n\n else if (grid[i][j] < 0.5) {\n fill(22, 55, 138);\n rect(i * mapUnitWidth, j * mapUnitHeight, mapUnitWidth + 1, mapUnitHeight + 1);\n }\n\n else if (grid[i][j] < 0.7) {\n fill(56, 83, 150);\n rect(i * mapUnitWidth, j * mapUnitHeight, mapUnitWidth + 1, mapUnitHeight + 1);\n }\n\n else if (grid[i][j] !== \"x\") {\n fill(4, 21, 64);\n rect(i * mapUnitWidth, j * mapUnitHeight, mapUnitWidth + 1, mapUnitHeight + 1);\n }\n }\n }\n}", "title": "" }, { "docid": "65837f3daa676a1e8d20b5cd04615d98", "score": "0.5553343", "text": "function setupScene() {\n //var units = mapW;\n if(mazes.maze === undefined){\n mazes.n = 8;\n mazes.maze = [\n [9, 1, 1, 1, 3, 1, 1, 3],\n [8, 4, 4, 4, 12, 3, 0, 2],\n [8, 0, 0, 0, 0, 2, 0, 2],\n [8, 0, 0, 9, 1, 2, 0, 2],\n [9, 0, 0, 8, 0, 2, 0, 2],\n [10, 0, 15, 0, 0, 0, 0, 2],\n [10, 0, 2, 0, 0, 0, 0, 2],\n [12, 4, 6, 4, 4, 4, 4, 6]\n ];\n /*empty cell = 0;\n top = 0001 = 1\n right = 0010 = 2\n bottom = 0100 = 4\n left = 1000 = 8*/\n }\n \n // Geometry: floor\n var floor = new t.Mesh(\n new t.BoxGeometry(mazes.n * 2 * UNITSIZE + UNITSIZE, 10, mazes.n * 2 * UNITSIZE + UNITSIZE),new t.MeshLambertMaterial({color: 0xEDCBA0})\n );\n floor.position.x = UNITSIZE * 0.5 * mazes.n;\n floor.position.z = UNITSIZE * 0.5 * mazes.n;\n scene.add(floor);\n\n \n \n // Geometry: walls\n for (var row = 0; row < mazes.n; row++) {\n for (var col = 0; col < mazes.n; col++) {\n var topWall = new t.BoxGeometry(UNITSIZE, WALLHEIGHT, WALLTHICKNESS);\n var bottomWall = new t.BoxGeometry(UNITSIZE, WALLHEIGHT, WALLTHICKNESS);\n var rightWall = new t.BoxGeometry(WALLTHICKNESS, WALLHEIGHT, UNITSIZE);\n var leftWall = new t.BoxGeometry(WALLTHICKNESS, WALLHEIGHT, UNITSIZE);\n var materials = new t.MeshLambertMaterial({color: 0xff0000});\n var tWall = new t.Mesh(topWall, materials);\n var bWall = new t.Mesh(bottomWall, materials);\n var rWall = new t.Mesh(rightWall, materials);\n var lWall = new t.Mesh(leftWall, materials);\n var cell = mazes.maze[row][col];\n var wall;\n \n //top\n wall = cell & 1;\n console.log('top: ', wall);\n \n\n if(wall === 1){\n //has top wall\n tWall.position.x = (col) * UNITSIZE;\n tWall.position.y = WALLHEIGHT/2;\n tWall.position.z = (row) * UNITSIZE - WALLOFFSET;\n walls.push(tWall);\n scene.add(tWall);\n console.log('cell ', row, col, 'has a top wall');\n }\n\n //right \n wall = cell & 2;\n console.log('right: ', wall);\n\n if(wall === 2){\n //has right wall\n rWall.position.x = (col) * UNITSIZE - WALLOFFSET + UNITSIZE;\n rWall.position.y = WALLHEIGHT/2;\n rWall.position.z = (row) * UNITSIZE;\n walls.push(rWall);\n scene.add(rWall);\n console.log('cell ', row, col, 'has a right wall');\n }\n\n //bottom\n wall = cell & 4;\n console.log('bottom: ', wall);\n \n\n if(wall === 4){\n //has bottom wall\n bWall.position.x = (col) * UNITSIZE;\n bWall.position.y = WALLHEIGHT/2;\n bWall.position.z = (row) * UNITSIZE - WALLOFFSET + UNITSIZE;\n walls.push(bWall);\n scene.add(bWall);\n console.log('cell ', row, col, 'has a bottom wall');\n }\n\n //left\n wall = cell & 8;\n console.log('left: ', wall);\n\n if(wall === 8){\n\n //has left wall\n lWall.position.x = (col) * UNITSIZE - WALLOFFSET;\n lWall.position.y = WALLHEIGHT/2;\n lWall.position.z = (row) * UNITSIZE;\n walls.push(lWall);\n scene.add(lWall);\n console.log('cell ', row, col, 'has a right wall');\n }\n \n }\n }\n\n var radius = 30;\n var sphereGeometry = new THREE.SphereGeometry( radius, 16, 8 );\n var sphereMaterial = new THREE.MeshLambertMaterial( { color: 0xffd700 } );\n var sphere = new THREE.Mesh( sphereGeometry, sphereMaterial );\n sphere.position.x = Math.floor(Math.random() * mazes.n * UNITSIZE);\n sphere.position.z = Math.floor(Math.random() * mazes.n * UNITSIZE);\n sphere.position.y = 50\n scene.add(sphere);\n // Lighting\n var directionalLight1 = new t.DirectionalLight( 0xF7EFBE, 0.7 );\n directionalLight1.position.set( 0.5, 1, 0.5 );\n scene.add( directionalLight1 );\n var directionalLight2 = new t.DirectionalLight( 0xF7EFBE, 0.7 );\n directionalLight2.position.set( -0.5, -1, -0.5 );\n scene.add( directionalLight2 );\n }", "title": "" }, { "docid": "707be34da7dc257ecf26e22357e56776", "score": "0.5552453", "text": "function Terrain(inWidth, inHeight) {\n\tthis.width = inWidth || 80;\n\tthis.height = inHeight || this.width/2;\n\n\tthis.border = 2;\n\tthis.totalLand = 0;\n\tthis.landRatio = 0.5;\n\n\tthis.tile = [];\n\tfor (var i=0; i<this.width; i++) {\n\t\tthis.tile[i] = [];\n\t\tfor (var j=0; j<this.height; j++) {\n\t\t\tthis.tile[i][j] = new Tile(terrainID.water);\n\t\t}\n\t}\n\tthis.generateLandmass();\n\n\tthis.regionDetails = [];\n\tthis.identifyIslands();\n\tthis.identifyCoast();\n\tthis.setGlobalDesirability();\n}", "title": "" }, { "docid": "d6aeb773c44b2af0ff4fe250cd5a5ba7", "score": "0.5549195", "text": "createScene() {\n\n this.heightMap = new NoiseMap();\n this.heightMaps = this.heightMap.maps;\n\n this.moistureMap = new NoiseMap();\n this.moistureMaps = this.moistureMap.maps;\n\n this.textureMap = new TextureMap();\n this.textureMaps = this.textureMap.maps;\n\n this.normalMap = new NormalMap();\n this.normalMaps = this.normalMap.maps;\n\n this.roughnessMap = new RoughnessMap();\n this.roughnessMaps = this.roughnessMap.maps;\n\n for (let i=0; i<6; i++) { //Create 6 materials, each with white color\n let material = new THREE.MeshStandardMaterial({\n color: new THREE.Color(0xFFFFFF)\n });\n this.materials[i] = material;\n }\n\n let geo = new THREE.BoxGeometry(1, 1, 1, 64, 64, 64); //Creating a box\n let radius = this.size;\n for (var i in geo.vertices) {\n \t\tvar vertex = geo.vertices[i];\n \t\tvertex.normalize().multiplyScalar(radius);\n \t}\n this.computeGeometry(geo); //Squeezing a box into a sphere\n\n this.ground = new THREE.Mesh(geo, this.materials); //Create ground mesh with squeezed box sphere and 6 materials\n this.view.add(this.ground);\n }", "title": "" }, { "docid": "f8e133acc096139f45f798b069b05153", "score": "0.5547326", "text": "function terrainHeightLoaded(heightData) {\n\tlet textureLoader = new THREE.TextureLoader();\n\ttextureLoader.load( \"./textures/tile2.png\", function( texture ) {\n\t\ttexture.wrapS = THREE.RepeatWrapping;\n\t\ttexture.wrapT = THREE.RepeatWrapping;\n\t\ttexture.repeat.set( terrainWidth - 1, terrainDepth - 1 );\n\n\t\t// Ammo: Lager og returnerer en btHeightfieldTerrainShape:\n\t\tgroundShape = createTerrainAmmoShape(heightData, terrainWidth, terrainDepth);\n\t\tlet groundTransform = new Ammo.btTransform();\n\t\tgroundTransform.setIdentity();\n\t\tgroundTransform.setOrigin( new Ammo.btVector3( 0, 0, 0 ) );\n\t\tlet groundMass = 0;\n\t\tlet groundLocalInertia = new Ammo.btVector3( 0, 0, 0 );\n\t\tgroundShape.calculateLocalInertia( groundMass, groundLocalInertia );\n\t\tlet groundMotionState = new Ammo.btDefaultMotionState( groundTransform );\n\n\t\tlet rbInfo = new Ammo.btRigidBodyConstructionInfo( groundMass, groundMotionState, groundShape, groundLocalInertia );\n\t\tlet groundBody = new Ammo.btRigidBody(rbInfo);\n\t\tgroundBody.setRestitution(0.5); //Sprett!\n\t\tgroundBody.setFriction(0.3);\n\t\tphysicsWorld.addRigidBody( groundBody );\n\n\t\t// Three:\n\t\t// scaleX / scaleY henger sammen med heightFieldShape.setLocalScaling( new Ammo.btVector3( scaleX, 1, scaleZ ) );\n\t\t// i createTerrainAmmoShape()\n\t\tlet scaleX = terrainWidthExtents / ( terrainWidth - 1 ); //2 * 400 / (128-1) = 6\n\t\tlet scaleZ = terrainDepthExtents / ( terrainDepth - 1 ); //2 * 400 / (128-1) = 6\n\t\t// Størrelse på PlaneBufferGeometry: with = height = 128 * 6 = 768\n\t\t// Denne inndeles så i 127 * 127 småruter.\n\t\tlet terrainGeometry = new THREE.PlaneBufferGeometry( terrainWidth*scaleX, terrainDepth*scaleZ, terrainWidth - 1, terrainDepth - 1 );\n\t\tterrainGeometry.rotateX( - Math.PI / 2 );\n\t\tlet vertices = terrainGeometry.attributes.position.array;\n\t\t// Ammo-shapen blir (automatisk) sentrert om origo basert på terrainMinHeight og terrainMaxHeight.\n\t\t// Må derfor korrigere THREE-planets y-verdier i forhold til dette.\n\t\t// Flytter dermed three-planet NED, tilsvarende minHeigt + (maxHeight - minHeight)/2.\n\t\tlet delta = (terrainMinHeight + ((terrainMaxHeight-terrainMinHeight)/2));\n\t\tfor ( let i = 0, j = 0, l = vertices.length; i < l; i ++, j += 3 ) {\n\t\t\t// j + 1 because it is the y component that we modify\n\t\t\tvertices[ j + 1 ] = heightData[ i ] - delta;\n\t\t}\n\t\t// Oppdater normaler:\n\t\tterrainGeometry.computeVertexNormals();\n\n\t\tlet groundMaterial = new THREE.MeshPhongMaterial( { color: 0xC7C7C7, side: THREE.DoubleSide } );\n\t\tgroundMaterial.map = texture;\n\t\tgroundMaterial.needsUpdate = true;\n\n\t\tterrainMesh = new THREE.Mesh( terrainGeometry, groundMaterial );\n\t\tterrainMesh.userData.physicsBody = groundBody;\n\t\trigidBodies.push(terrainMesh);\n\n\t\tterrainMesh.receiveShadow = true;\n\t\tscene.add( terrainMesh );\n\n\t\tisTerrainHeightLoaded = true;\n\n\t\tanimate();\n\t} );\n}", "title": "" }, { "docid": "d7f70d5b6c87f74edd89e177e35b4f72", "score": "0.5537066", "text": "function Start () {\n // Create a new texture and assign it to the renderer's material\n var texture : Cubemap = new Cubemap (128, TextureFormat.ARGB32, false);\n renderer.material.mainTexture = texture;\n}", "title": "" }, { "docid": "9784ae34a2418b8299cb19da6535bb68", "score": "0.5535068", "text": "function SpriteSource(myTexture, width, height)\n{\n var texInfo = gEngine.ResourceMap.retrieveAsset(myTexture);\n var imageW = texInfo.mWidth;\n var imageH = texInfo.mHeight;\n \n this.imageWCWidth;\n this.imageWCHeight;\n \n if (imageW/imageH <= width/height)\n {\n this.imageWCHeight = height;\n this.imageWCWidth = width * imageW/imageH;\n }\n else\n {\n this.imageWCWidth = width;\n this.imageWCHeight = height * imageH/imageW;\n \n }\n \n this.imageWCWidth = this.imageWCWidth * .95;\n this.imageWCHeight = this.imageWCHeight * .95;\n \n this.centerX = this.imageWCWidth/2;\n this.centerY = this.imageWCHeight/2;\n \n this.texture = new SpriteRenderable(myTexture);\n this.texture.getXform().setPosition(this.centerX, this.centerY);\n this.texture.getXform().setSize(this.imageWCWidth, this.imageWCHeight);\n \n this.edges = [];\n var ulSquare = new Renderable();\n var urSquare = new Renderable();\n var llSquare = new Renderable();\n var lrSquare = new Renderable();\n var leftLine = new Renderable();\n var topLine = new Renderable();\n var bottomLine = new Renderable();\n var rightLine = new Renderable();\n \n leftLine.setColor([0,0,0,1]);\n leftLine.getXform().setSize(.2,this.imageWCHeight);\n leftLine.getXform().setPosition(this.centerX - 1/2 * this.imageWCWidth, this.centerY);\n this.edges.push(leftLine);\n topLine.setColor([0,0,0,1]);\n topLine.getXform().setSize(this.imageWCWidth,.2);\n topLine.getXform().setPosition(this.centerX , this.centerY + this.imageWCHeight * 1/2);\n this.edges.push(topLine);\n bottomLine.setColor([0,0,0,1]);\n bottomLine.getXform().setSize(this.imageWCWidth,.2);\n bottomLine.getXform().setPosition(this.centerX , this.centerY - this.imageWCHeight * 1/2);\n this.edges.push(bottomLine);\n rightLine.setColor([0,0,0,1]);\n rightLine.getXform().setSize(.2,this.imageWCHeight);\n rightLine.getXform().setPosition(this.centerX + 1/2 * this.imageWCWidth, this.centerY);\n this.edges.push(rightLine);\n \n ulSquare.setColor([1,0,0,1]);\n ulSquare.getXform().setSize(3,3);\n ulSquare.getXform().setPosition(this.centerX - 1/2 * this.imageWCWidth, this.centerY + 1/2 * this.imageWCHeight);\n this.edges.push(ulSquare);\n urSquare.setColor([0,1,0,1]);\n urSquare.getXform().setSize(3,3);\n urSquare.getXform().setPosition(this.centerX + 1/2 * this.imageWCWidth, this.centerY + 1/2 * this.imageWCHeight);\n this.edges.push(urSquare);\n llSquare.setColor([0,0,1,1]);\n llSquare.getXform().setSize(3,3);\n llSquare.getXform().setPosition(this.centerX - 1/2 * this.imageWCWidth, this.centerY - 1/2 * this.imageWCHeight);\n this.edges.push(llSquare);\n lrSquare.setColor([1,1,1,1]);\n lrSquare.getXform().setSize(3,3);\n lrSquare.getXform().setPosition(this.centerX + 1/2 * this.imageWCWidth, this.centerY - 1/2 * this.imageWCHeight);\n this.edges.push(lrSquare);\n \n \n \n// SpriteRenderable.call(this, myTexture);\n// this.borders = [];\n}", "title": "" }, { "docid": "af661a5dbf86fa8a85fd62755e48a827", "score": "0.5527255", "text": "function generateTerrain(icosphere, continentBufferDistance, repellerCountMultiplier, repellerSizeMin, repellerSizeMax, repellerHeightMin, repellerHeightMax, continentCountMin, continentCountMax, continentSizeMin, continentSizeMax, mountainCountMin, mountainCountMax, mountainHeightMin, mountainHeightMax) {\n\tvar contCount = Math.floor(pc.math.random(continentCountMin, continentCountMax + 0.999));\n\tvar mountainCount = Math.floor(pc.math.random(mountainCountMin, mountainCountMax + 0.999));\n\t\n\tconsole.log(\"cc: \" + contCount);\n\t\n\t//Create first continent at the equator facing the camera: 607, 698, 908, 923, 1151, 1166\n\tvar contSize = pc.math.random(continentSizeMin, continentSizeMax);\n\tvar mountains = mountainCount / contCount;\n\tif (contCount > 0) mountains *= pc.math.random(0.6, 1.4); //Randomize remaining mountain distribution slightly if not on the last continent\n\tmountains = Math.floor(mountains);\n\tcluster(icosphere, 1034, contSize, Math.floor(contSize * contSize * repellerCountMultiplier) + 1, repellerSizeMin, repellerSizeMax, repellerHeightMin, repellerHeightMax, mountains, mountainHeightMin, mountainHeightMax); //Actually create the continent\n\tmountainCount -= mountains;\n\tcontCount--;\n\t\n\t//Create remaining continents\n\tfor (; contCount > 0; contCount--) {\n\t\tcontSize = pc.math.random(continentSizeMin, continentSizeMax);\n\t\t\n\t\t//Search for an open area of ocean randomly\n\t\tvar randomTiles = [];\n\t\tfor (var size = icosphere.tiles.length-1; size >= 0; size--) randomTiles[size] = size;\n\t\tshuffleArray(randomTiles);\n\t\tfor (var i = 0, done = false; i < icosphere.tiles.length && !done; i++) {\n\t\t\tvar center = randomTiles[i]; //Iterates through every tile in random order\n\t\t\tif (checkSurroundingArea(icosphere, center, contSize * continentBufferDistance) === -1) {\n\t\t\t\t//Create a new continent\n\t\t\t\tmountains = mountainCount / contCount;\n\t\t\t\tif (contCount > 0) mountains *= pc.math.random(0.6, 1.4); //Randomize remaining mountain distribution slightly if not on the last continent\n\t\t\t\tmountains = Math.floor(mountains);\n\t\t\t\tcluster(icosphere, center, contSize, Math.floor(contSize * contSize * repellerCountMultiplier) + 1, repellerSizeMin, repellerSizeMax, repellerHeightMin, repellerHeightMax, mountains, mountainHeightMin, mountainHeightMax); //Actually create the continent\n\t\t\t\tmountainCount -= mountains;\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8bd5c50d8df1fdb2ab6ed863e6d3dff1", "score": "0.55217266", "text": "function main() {\r\n\tupdate_state_output(); // update the status box with current status\r\n\tprocess_keypress(' '); // show the possible inputs\r\n\twindow.onkeypress = function (event) { //when a key is pressed, process the input\r\n\t\tprocess_keypress(event.key)\r\n\t}\r\n\r\n\t// Add the event listener to parse input file\r\n\tdocument.getElementById('ply-file').addEventListener('change', function () {\r\n\t\tvar fileReader = new FileReader();\r\n\t\tfileReader.onload = function (e) {\r\n\t\t\t// reset model to base frame.\r\n\t\t\tprocess_keypress('Q');\r\n\t\t\tprocess_keypress('W');\r\n\t\t\tanimation = false;\t//turn off animation while getting a new file\r\n\t\t\textents = [];\t\t//clear extents\r\n\t\t\tpolygons = [];\t\t//clear polygons\r\n\t\t\tpoints = [];\t\t//clear points\r\n\t\t\tcolors = [];\t\t//clear colors\r\n\t\t\tvar vertexCoordsList = []; // list of vertex cordinates \r\n\t\t\tvar polygonIndexList = []; // list of polygon indexs within the vertexCoordsList.\r\n\t\t\t//parse the file\r\n\t\t\t[vertexCoordsList, polygonIndexList, extents] = parse_ply_file(vertexCoordsList, polygonIndexList, fileReader.result);\r\n\t\t\tinit();\t\t\t\t//init webgl\r\n\t\t\tpolygons = construct_polygon_points(vertexCoordsList, polygonIndexList); //get polygons\r\n\t\t\tanimationDelay *= 1/(polygons.length);\t//set animation delay by the number of polygons in list\r\n\t\t\tanimation = true;\t//turn animation back on\r\n\t\t\trender();\t\t\t//render the file\r\n\t\t}\r\n\t\tfileReader.readAsText(this.files[0]);\r\n\t})\r\n}", "title": "" }, { "docid": "f8acf5cf8eec1941d4eef558bb58d712", "score": "0.5520818", "text": "function main() {\n setupWebGL(); // set up the webGL environment\n setupShaders(); // setup the webGL shaders (attribs)\n loadTriangles(); // load in the triangles from tri file (buffers)\n loadLights();\n drawScene(); // draw the triangles using webGL\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n} // end main", "title": "" }, { "docid": "9ca479744d4e3f70c81055e9e85b1e38", "score": "0.5519498", "text": "function setupTextures() {\n frontImage = new Image();\n backImage = new Image();\n topImage = new Image();\n bottomImage = new Image();\n rightImage = new Image();\n leftImage = new Image();\n\n frontTexture = gl.createTexture();\n backTexture = gl.createTexture();\n topTexture = gl.createTexture();\n bottomTexture = gl.createTexture();\n rightTexture = gl.createTexture();\n leftTexture = gl.createTexture();\n\n fillTexture(frontImage, frontTexture, \"images/pos-z.png\");\n fillTexture(backImage, backTexture, \"images/neg-z.png\");\n fillTexture(topImage, topTexture, \"images/pos-y.png\");\n fillTexture(bottomImage, bottomTexture, \"images/neg-y.png\");\n fillTexture(rightImage, rightTexture, \"images/pos-x.png\");\n fillTexture(leftImage, leftTexture, \"images/neg-x.png\");\n}", "title": "" }, { "docid": "3dd3973d7c15ff10e058cbf08eaef588", "score": "0.5517576", "text": "function createWorld(scAfrica, scAsia, scEurope, scOceanien, scSouthamerica, scNorthamerica) {\n var loader = new THREE.OBJLoader(manager);\n loader.load('thisistheultimatemap.obj', function (object) {\n\n //ta istället bort objectet i arrayen med alla object i? dvs continentsObjects[x]\n for(var i=0; i < continentsObjects.length; i++){\n scene.remove(continentsObjects[i]);\n }\n\n console.log('object');\n\n /****************************************\n CREATE CONTINENTS\n ***************************************/\n var scaleFactorsArray = [scAsia, scEurope, scAfrica, scSouthamerica, scNorthamerica, scOceanien];\n\n console.log(continentsObjects.length);\n var continentsName = [\"Asien\", \"Europa\", \"Afrika\", \"Sydamerika\", \"Nordamerika\", \"Oceanien\"];\n for(var k = 0; k<continentsObjects.length; k++){\n continentsObjects[k] = object.getObjectByName(continentsName[k]);\n var position = continentsObjects[k].geometry.attributes.position.array;\n var UVposition = continentsObjects[k].geometry.attributes.uv.array;\n\n for (var i = 0, j = 0; i <= position.length; i += 3, j += 2) {\n theta = (UVposition[j + 1]) * -Math.PI; //U\n phi = (UVposition[j] - 0.5) * 2 * -Math.PI; //V\n r = (position[i + 2] * scaleFactorsArray[k] + 10);\n\n x = r * Math.sin(theta) * Math.cos(phi);\n y = r * Math.sin(theta) * Math.sin(phi);\n z = r * Math.cos(theta);\n\n position[i] = x;\n position[i + 1] = y;\n position[i + 2] = z;\n\n }\n\n console.log(continentsObjects[k]);\n continentsObjects[k].geometry.computeFaceNormals();\n continentsObjects[k].geometry.computeVertexNormals();\n continentsObjects[k].geometry.normalsNeedUpdate = true;\n\n continentsObjects[k].rotation.x = Math.PI / 2 - Math.PI / 8;\n continentsObjects[k].rotation.z = Math.PI / 2 + Math.PI / 8;\n scene.add(continentsObjects[k]);\n }\n\n\n /*****************************************************\n CHANGE COLOR\n *****************************************************/\n\n var color = [0xd5832, 0x4e8342, 0x6fa13f, 0x9ab438, 0xcedf43, //gröna\n 0xecee47, 0xeebb1f, //gula\n 0xffa330, 0xff8e30, 0xff7930, 0xdd5b2f, //orangea\n 0xcc4d3f, 0xcc3f3f];\n\n\n function scaleColor(scale) {\n if (scale >= 1 && scale < 2.5) {\n var material = new THREE.MeshPhongMaterial({color: color[0]});\n }\n\n else if (scale >= 2.5 && scale < 3) {\n var material = new THREE.MeshPhongMaterial({color: color[1]});\n }\n\n else if (scale >= 3 && scale < 4) {\n var material = new THREE.MeshPhongMaterial({color: color[2]});\n }\n\n else if (scale >= 4 && scale < 5) {\n var material = new THREE.MeshPhongMaterial({color: color[3]});\n }\n\n else if (scale >= 5 && scale < 6) {\n var material = new THREE.MeshPhongMaterial({color: color[4]});\n }\n\n else if (scale >= 6 && scale < 7) {\n var material = new THREE.MeshPhongMaterial({color: color[5]});\n }\n\n else if (scale >= 7 && scale < 8) {\n var material = new THREE.MeshPhongMaterial({color: color[6]});\n }\n\n else if (scale >= 8 && scale < 9) {\n var material = new THREE.MeshPhongMaterial({color: color[7]});\n }\n\n else if (scale >= 9 && scale < 10) {\n var material = new THREE.MeshPhongMaterial({color: color[8]});\n }\n\n else if (scale >= 10 && scale < 11) {\n var material = new THREE.MeshPhongMaterial({color: color[9]});\n }\n\n else if (scale >= 11 && scale < 12) {\n var material = new THREE.MeshPhongMaterial({color: color[10]});\n }\n\n else if (scale >= 12 && scale < 13) {\n var material = new THREE.MeshPhongMaterial({color: color[11]});\n }\n\n else {\n var material = new THREE.MeshPhongMaterial({color: color[12]});\n }\n return material;\n }\n\n // [scAsia, scEurope, scAfrica, scSouthamerica, scNorthamerica, scOceanien];\n for(i=0; i<continentsObjects.length; i++) {\n continentsObjects[i].material = scaleColor(scaleFactorsArray[i]);\n }\n\n });\n\n}", "title": "" }, { "docid": "069e6cc9f33f2a7dd75fc6e2fbca1a27", "score": "0.55016935", "text": "function createEarth() {\n // 1. Geometria\n var geoEarth = new THREE.SphereGeometry(1, 32, 32);\n // 2. Texture\n var textEarth = new THREE.TextureLoader().load('img/no_clouds_4k.jpg');\n var bumpEarth = new THREE.TextureLoader().load('img/elev_bump_4k.jpg');\n // 3. Material\n var matEarth = new THREE.MeshPhongMaterial({\n map: textEarth,\n bumpMap: bumpEarth\n });\n // 4. Mesh\n meshEarth = new THREE.Mesh(geoEarth, matEarth);\n // 5. Adicionar mesh a cena\n papi.add(meshEarth);\n // 6. Mudar atributos\n matEarth.bumpScale = 0.01;\n //meshEarth.position.y = 20;\n meshEarth.position.set(44, 8, -45);\n}", "title": "" }, { "docid": "7a1e01618fba673b1116702d4f133ba9", "score": "0.5494", "text": "constructor(menuItem) {\n\n this.menuItem = menuItem;\n\n /**\n * Seed\n */\n this.seedString = \"Scarlett\";\n this.initSeed();\n\n this.view = new THREE.Object3D(); //Overall planet object with all layers (planet + atmosphere + clouds + ...)\n\n /**\n * Global planet parameters\n */\n this.size = 100; //Global size of the planet, radius of surface / ground sphere\n this.roughness = 0.8; //Global roughness -> can set specifically\n this.metalness = 0.5; //Global metalness -> can set specifically\n this.resolution = 512; //Global resolution of planetary details -> can set specifically\n this.normalScale = 2.0; //Global normal scale, later gets adapted depending on resolution -> can set height specifically, instead of resolution\n this.waterLevel = 0.0; //Global water level, later gets randomized -> can set specifically\n\n /**\n * Create materials\n */\n this.materials = []; //Array of 6 materials, initialized with 6 white standard materials -> later each gets applied it's specific height map, normal map, ...?\n this.heightMaps = [];\n this.moistureMaps = [];\n this.textureMaps = [];\n this.normalMaps = [];\n this.roughnessMaps = [];\n this.displayMap = \"textureMap\";\n\n /**\n * Biome created, later renders the texture of the biome by calling .texture \n */\n this.biome = new Biome(this.menuItem); //THIS IS WHAT WE HAVE TO CONTROL -> later, biome.texture is applied and assigned to biome.generateTexture()\n\n /**\n * Creation of all the meshes (planet, stars, nebula, sun, clouds, atmosphere ring, atmosphere)\n */\n this.createScene(); //Creates planet ground mesh (cube-into-sphere squeeze + 6 materials) + 5 separate maps (texture map, height map, ...)\n this.createClouds(); //Creates cloud background (separate class)\n this.createAtmosphereRing(); //Creates atmosphere ring (separate class)\n this.createAtmosphere(); //Creates atmosphere fog (separate class)\n\n /**\n * Generating 1 planet specifically from URL seed (can remove later)\n */\n this.loadSeedFromURL();\n\n /**\n * Global planet parameters 2\n */\n this.rotate = true;\n this.autoGenerate = false;\n this.autoGenCountCurrent = 0;\n this.autoGenTime = 3*60;\n this.autoGenCountMax = this.autoGenTime * 60;\n\n /**\n * Generate new planet on 'space' hit (can remove later)\n */\n document.addEventListener('keydown', (event) => {\n if (event.keyCode == 32) {\n this.randomize();\n }\n });\n\n /**\n * Generating 2 planet specifically from URL seed (can remove later)\n */\n window.onpopstate = (event) => {\n this.loadSeedFromURL();\n };\n\n }", "title": "" }, { "docid": "9d7b75c52373f2aee798d9c6665774e9", "score": "0.54783493", "text": "function SystemsManager(){\n\t\tthis.addSystem('rainbowroad', 'EMITTER',\n\t\t {\n\t\t \"pos\": {\n\t\t \"x\": 263,\n\t\t \"y\": 253\n\t\t },\n\t\t \"posVar\": {\n\t\t \"x\": 0,\n\t\t \"y\": 0\n\t\t },\n\t\t \"life\": 1.3,\n\t\t \"lifeVar\": 0,\n\t\t \"totalParticles\": 207,\n\t\t \"emissionRate\": 83,\n\t\t \"startColor\": [\n\t\t 51,\n\t\t 96,\n\t\t 130,\n\t\t 0\n\t\t ],\n\t\t \"startColorVar\": [\n\t\t 109,\n\t\t 66,\n\t\t 111,\n\t\t 0.3\n\t\t ],\n\t\t \"endColor\": [\n\t\t 177,\n\t\t 102,\n\t\t 57,\n\t\t 1\n\t\t ],\n\t\t \"endColorVar\": [\n\t\t 119,\n\t\t 40,\n\t\t 162,\n\t\t 0\n\t\t ],\n\t\t \"radius\": 99,\n\t\t \"radiusVar\": 2,\n\t\t \"textureSource\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA9dpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NDkxMSwgMjAxMy8xMC8yOS0xMTo0NzoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgKE1hY2ludG9zaCkiIHhtcDpDcmVhdGVEYXRlPSIyMDE0LTEyLTEyVDE0OjM3OjU5WiIgeG1wOk1vZGlmeURhdGU9IjIwMTQtMTItMTJUMTQ6NTg6NDgiIHhtcDpNZXRhZGF0YURhdGU9IjIwMTQtMTItMTJUMTQ6NTg6NDgiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkU4MDM4MzEwN0EzMjExRTRCMTlEODVFMUIyNUI0QkUzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkU4MDM4MzExN0EzMjExRTRCMTlEODVFMUIyNUI0QkUzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RTgwMzgzMEU3QTMyMTFFNEIxOUQ4NUUxQjI1QjRCRTMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RTgwMzgzMEY3QTMyMTFFNEIxOUQ4NUUxQjI1QjRCRTMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5FEin+AAAB0UlEQVR42tyXu0oDQRSGJ6urJBY2WkliBBEEI8Rba6OmMqCF6CMEHyBgl8ZHyAtYCqZXCNgokah4AS8IgmiljSkUE2L8B/7AGsyszt7AA19md2bnnD9nmLOzoUajIYK0TvlTq9V058+BENjTmWyapgjJDGgKkIHLbKfAp44Aw0H21sAESIJVXSe6GegGV2CI9/dgFHz4lYGMJbjgdcavDPSCO9DX0v8ChsGr1xnI/hBcsC/rdQYGwC2ItBl/AyPgyasM5BTBBcdybmXABGPcZpNsZ0CHjc86OAKn4Jjtpax3qkIUxv24ZV/LNgG6XKq4VXABTihItucQ8N4UkNfdRg4sDwHrTQEyrdtgyafgO2AFAuqGZd1kOS36ELzIMi5jftsFVWag5GHwEmNUmx2t27ACFsGNB8Gv6bti7fypDjzzPf/oYnDpa56+hZ0A5QQNU/4hwyZlaRcEpFVLaleKH1wQoPRhJ2DQBQGxoAXEnQiI/wcBjpYgZjN+RnzPwCGrWpLI6wMdAXZHMnnEClvud8Em2G/z/CzYAAstPnp0jmT9DC6/eApgGqQUwQXHUny2wLkR+vrzEkTBFk9Gy/wM+62VOSdBH1HlEgRphgjYvgQYAIkakBJEhtEhAAAAAElFTkSuQmCC\",\n\t\t \"textureEnabled\": true,\n\t\t \"renderMode\": \"add\",\n\t\t \"speed\": 82,\n\t\t \"speedVar\": 41,\n\t\t \"angle\": 5,\n\t\t \"angleVar\": 24,\n\t\t \"gravity\": {\n\t\t \"x\": -30,\n\t\t \"y\": 62\n\t\t },\n\t\t \"radialAccel\": 195,\n\t\t \"radialAccelVar\": 0,\n\t\t \"tangentialAccel\": -276,\n\t\t \"tangentialAccelVar\": 0,\n\t\t \"startScale\": 0.4,\n\t\t \"startScaleVar\": 0,\n\t\t \"endScale\": 4.5,\n\t\t \"endScaleVar\": 6,\n\t\t \"splineAnchorPts\": [\n\t\t {\n\t\t \"x\": 149,\n\t\t \"y\": 28\n\t\t },\n\t\t {\n\t\t \"x\": 262,\n\t\t \"y\": 250\n\t\t },\n\t\t {\n\t\t \"x\": 196,\n\t\t \"y\": 153\n\t\t },\n\t\t {\n\t\t \"x\": 143,\n\t\t \"y\": 124\n\t\t },\n\t\t {\n\t\t \"x\": 94,\n\t\t \"y\": 155\n\t\t },\n\t\t {\n\t\t \"x\": 23,\n\t\t \"y\": 248\n\t\t }\n\t\t ],\n\t\t \"splineIsPath\": true,\n\t\t \"splineClockwise\": true,\n\t\t \"splineSpeed\": 50,\n\t\t \"splineRelForceOn\": true,\n\t\t \"startDelay\": 0,\n\t\t \"posName\": 'center',\n\t\t \"rotationSpeed\": 20,\n\t\t \"rotationSpeedVar\": 5\n\t\t }\n\t\t );\n\n\t\tthis.addSystem('meteor', 'EMITTER', {\n\t\t\ttotalParticles: 180,\n\t\t\temissionRate: 45,\n\t\t\tposName: 'center',\n\t\t\tgravity: {\n\t\t\t\tx: -20,\n\t\t\t\ty: 200\n\t\t\t},\n\t\t\tangle: 90,\n\t\t\tangleVar: 20,\n\t\t\tspeed: 60,\n\t\t\tspeedVar: 20,\n\t\t\tlife: 2,\n\t\t\tlifeVar: 0,\n\t\t\tradialAccel: 45,\n\t\t\tradialAccelVar: 0,\n\t\t\ttangentialAccel: 45,\n\t\t\ttangentialAccelVar: 0,\n\t\t\ttextureEnabled: true,\n\t\t\trenderMode: 'add',\n\t\t\tradius: 12,\n\t\t\tradiusVar: 2,\n\t\t\tstartScale: 1,\n\t\t\tendScale: 1,\n\t\t\tstartColor: [51, 102, 178.5, 1.0],\n\t\t\tstartColorVar: [0, 0, 51, 0.1],\n\t\t\tendColor: [0, 0, 0, 0],\n\t\t\tendColorVar: [0, 0, 0, 0.0],\n\n\t\t\tactive: true,\n\t\t\tduration: Infinity,\n\t\t\tsplineAnchorPts: [\n\t\t\t\t{\n\t\t\t\t \"x\": 149,\n\t\t\t\t \"y\": 28\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"x\": 262,\n\t\t\t\t \"y\": 250\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"x\": 196,\n\t\t\t\t \"y\": 153\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"x\": 143,\n\t\t\t\t \"y\": 124\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"x\": 94,\n\t\t\t\t \"y\": 155\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"x\": 23,\n\t\t\t\t \"y\": 248\n\t\t\t\t }\n\t\t\t],\n\t\t\tsplineIsPath: true,\n\t\t\tsplineClockwise: true,\n\t\t\tsplineSpeed: 50.0,\n\t\t\tsplineRelForceOn: true,\n\t\t\ttextureSource: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA9dpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NDkxMSwgMjAxMy8xMC8yOS0xMTo0NzoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgKE1hY2ludG9zaCkiIHhtcDpDcmVhdGVEYXRlPSIyMDE0LTEyLTEyVDE0OjM3OjU5WiIgeG1wOk1vZGlmeURhdGU9IjIwMTQtMTItMTJUMTQ6NTg6NDgiIHhtcDpNZXRhZGF0YURhdGU9IjIwMTQtMTItMTJUMTQ6NTg6NDgiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkU4MDM4MzEwN0EzMjExRTRCMTlEODVFMUIyNUI0QkUzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkU4MDM4MzExN0EzMjExRTRCMTlEODVFMUIyNUI0QkUzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RTgwMzgzMEU3QTMyMTFFNEIxOUQ4NUUxQjI1QjRCRTMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RTgwMzgzMEY3QTMyMTFFNEIxOUQ4NUUxQjI1QjRCRTMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5FEin+AAAB0UlEQVR42tyXu0oDQRSGJ6urJBY2WkliBBEEI8Rba6OmMqCF6CMEHyBgl8ZHyAtYCqZXCNgokah4AS8IgmiljSkUE2L8B/7AGsyszt7AA19md2bnnD9nmLOzoUajIYK0TvlTq9V058+BENjTmWyapgjJDGgKkIHLbKfAp44Aw0H21sAESIJVXSe6GegGV2CI9/dgFHz4lYGMJbjgdcavDPSCO9DX0v8ChsGr1xnI/hBcsC/rdQYGwC2ItBl/AyPgyasM5BTBBcdybmXABGPcZpNsZ0CHjc86OAKn4Jjtpax3qkIUxv24ZV/LNgG6XKq4VXABTihItucQ8N4UkNfdRg4sDwHrTQEyrdtgyafgO2AFAuqGZd1kOS36ELzIMi5jftsFVWag5GHwEmNUmx2t27ACFsGNB8Gv6bti7fypDjzzPf/oYnDpa56+hZ0A5QQNU/4hwyZlaRcEpFVLaleKH1wQoPRhJ2DQBQGxoAXEnQiI/wcBjpYgZjN+RnzPwCGrWpLI6wMdAXZHMnnEClvud8Em2G/z/CzYAAstPnp0jmT9DC6/eApgGqQUwQXHUny2wLkR+vrzEkTBFk9Gy/wM+62VOSdBH1HlEgRphgjYvgQYAIkakBJEhtEhAAAAAElFTkSuQmCC'\n\t\t});\n\n\t\tthis.addSystem('fireworks', 'EMITTER', {\n\t\t\ttotalParticles: 1500,\n\t\t\temissionRate: 1500 / 3.5,\n\t\t\tposName: 'centerBottom',\n\t\t\tangle: 90,\n\t\t\tangleVar: 20,\n\t\t\tgravity: {\n\t\t\t\tx: 0,\n\t\t\t\ty: - 90\n\t\t\t},\n\t\t\tspeed: 180,\n\t\t\tspeedVar: 50,\n\t\t\tlife: 3.5,\n\t\t\tlifeVar: 1,\n\t\t\tradialAccel: 0,\n\t\t\tradialAccelVar: 0,\n\t\t\ttangentialAccel: 0,\n\t\t\ttangentialAccelVar: 0,\n\t\t\tradius: 8,\n\t\t\tradiusVar: 2,\n\t\t\tstartScale: 1,\n\t\t\tendScale: 1,\n\t\t\tstartColor: [127.5, 127.5, 127.5, 1],\n\t\t\tstartColorVar: [127.5, 127.5, 127.5, 0],\n\t\t\tendColor: [25.5, 25.5, 25.5, 0.2],\n\t\t\tendColorVar: [25.5, 25.5, 25.5, 0.2],\n\t\t\tactive: true,\n\t\t\tduration: Infinity,\n\t\t\tsplineAnchorPts: [\n\t\t\t\t{x: 100, y: 40},\n\t\t\t\t{x: 100, y: 80},\n\t\t\t\t{x: 100, y: 100},\n\t\t\t\t{x: 100, y: 120}\n\t\t\t]\n\t\t});\n\n\t\tthis.addSystem('fire', 'EMITTER', {\n\t\t\ttotalParticles: 250,\n\t\t\temissionRate: 250 / 7,\n\t\t\tposName: 'centerBottom',\n\t\t\tposVar: {\n\t\t\t\tx: 40,\n\t\t\t\ty: 20\n\t\t\t},\n\t\t\tangle: 90,\n\t\t\tangleVar: 10,\n\t\t\tspeed: 60,\n\t\t\tspeedVar: 20,\n\t\t\tlife: 7,\n\t\t\tlifeVar: 4,\n\t\t\tradialAccel: 0,\n\t\t\tradialAccelVar: 0,\n\t\t\ttangentialAccel: 0,\n\t\t\ttangentialAccelVar: 0,\n\t\t\ttextureEnabled: true,\n\t\t\trenderMode: 'add',\n\t\t\tradius: 10,\n\t\t\tradiusVar: 1,\n\t\t\tstartScale: 1,\n\t\t\tendScale: 1,\n\t\t\tstartColor: [193.8, 63.75, 30.6, 1],\n\t\t\tendColor: [0, 0, 0, 0],\n\t\t\tactive: true,\n\t\t\tduration: Infinity\n\t\t});\n\n\t\tthis.addSystem('galaxy', 'EMITTER', {\n\t\t\ttotalParticles: 200,\n\t\t\temissionRate: 200 / 4,\n\t\t\tposName: 'center',\n\t\t\tangle: 90,\n\t\t\tangleVar: 360,\n\t\t\tspeed: 60,\n\t\t\tspeedVar: 10,\n\t\t\tlife: 4,\n\t\t\tlifeVar: 1,\n\t\t\tradialAccel: - 80,\n\t\t\tradialAccelVar: 0,\n\t\t\ttangentialAccel: 80,\n\t\t\ttangentialAccelVar: 0,\n\t\t\ttextureEnabled: true,\n\t\t\trenderMode: 'add',\n\t\t\tradius: 10,\n\t\t\tradiusVar: 2,\n\t\t\tstartScale: 1,\n\t\t\tendScale: 1,\n\t\t\tstartColor: [30.6, 63.75, 193.8, 1],\n\t\t\tendColor: [0, 0, 0, 1],\n\t\t\tactive: true,\n\t\t\tduration: Infinity\n\t\t});\n\n\t\tthis.addSystem('snow', 'EMITTER', {\n\t\t\ttotalParticles: 700,\n\t\t\temissionRate: 10,\n\t\t\tposName: 'centerAboveTop',\n\t\t\tposVar: {\n\t\t\t\tx: 175,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\tgravity: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 8\n\t\t\t},\n\t\t\tangle: - 90,\n\t\t\tangleVar: 10,\n\t\t\tspeed: 9,\n\t\t\tspeedVar: 1,\n\t\t\tlife: 45,\n\t\t\tlifeVar: 15,\n\t\t\tradialAccel: 0,\n\t\t\tradialAccelVar: 0,\n\t\t\ttangentialAccel: 0,\n\t\t\ttangentialAccelVar: 0,\n\t\t\ttextureEnabled: false,\n\t\t\trenderMode: 'normal',\n\t\t\tradius: 3,\n\t\t\tradiusVar: 2,\n\t\t\tstartScale: 1,\n\t\t\tendScale: 0.3,\n\t\t\tstartColor: [255, 255, 255, 1],\n\t\t\tendColor: [255, 255, 255, 0],\n\t\t\tactive: true,\n\t\t\tduration: Infinity\n\t\t});\n\n\t\tthis.addSystem('bubbles', 'EMITTER', {\n\t\t\ttotalParticles: 500,\n\t\t\temissionRate: 200,\n\t\t\tactive: true,\n\t\t\tduration: Infinity,\n\t\t\tposName: 'centerOffBottom',\n\t\t\tposVar: {\n\t\t\t\tx: 150,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\tangle: 90,\n\t\t\tangleVar: 20,\n\t\t\tlife: 3.5,\n\t\t\tlifeVar: 1,\n\t\t\tradius: 8,\n\t\t\tradiusVar: 2,\n\t\t\ttextureEnabled: false,\n\t\t\trenderMode: 'add',\n\t\t\tstartScale: 1,\n\t\t\tstartScaleVar: 0,\n\t\t\tendScale: 1,\n\t\t\tendScaleVar: 0,\n\t\t\tstartColor: [198.9, 198.9, 255, 1],\n\t\t\tstartColorVar: [0, 0, 38, 0.1],\n\t\t\tendColor: [25.5, 25.5, 25.5, 0.2],\n\t\t\tendColorVar: [25.5, 25.5, 25.5, 0.2],\n\t\t\tgravity: {\n\t\t\t\tx: 0,\n\t\t\t\ty: - 90\n\t\t\t},\n\t\t\tradialAccel: 0,\n\t\t\tradialAccelVar: 0,\n\t\t\ttangentialAccel: 0,\n\t\t\ttangentialAccelVar: 0,\n\t\t\tspeed: 180,\n\t\t\tspeedVar: 50\n\t\t});\n\n\t\tthis.addSystem('watergeyser', 'EMITTER', {\n\t\t\ttotalParticles: 400,\n\t\t\temissionRate: 100,\n\t\t\tactive: true,\n\t\t\tduration: Infinity,\n\t\t\tposName: 'centerBottom',\n\t\t\tposVar: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\tangle: 90,\n\t\t\tangleVar: 10,\n\t\t\tlife: 2.5,\n\t\t\tlifeVar: 1,\n\t\t\tradius: 5,\n\t\t\tradiusVar: 3,\n\t\t\ttextureEnabled: false,\n\t\t\trenderMode: 'normal',\n\t\t\tstartScale: 1,\n\t\t\tstartScaleVar: 0,\n\t\t\tendScale: 1,\n\t\t\tendScaleVar: 0,\n\t\t\tstartColor: [19.89, 59.93, 255, 1],\n\t\t\tstartColorVar: [0, 0, 48, 0.3],\n\t\t\tendColor: [198.9, 198.9, 255, 0],\n\t\t\tendColorVar: [0, 0, 0, 0],\n\t\t\tgravity: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 150\n\t\t\t},\n\t\t\tradialAccel: 0,\n\t\t\tradialAccelVar: 0,\n\t\t\ttangentialAccel: 0,\n\t\t\ttangentialAccelVar: 0,\n\t\t\tspeed: 180,\n\t\t\tspeedVar: 50\n\t\t});\n\n\t\tthis.addSystem('ribbon', 'EMITTER', {\n\t\t\ttotalParticles: 200,\n\t\t\temissionRate: 40,\n\t\t\tactive: true,\n\t\t\tduration: Infinity,\n\t\t\tposName: 'bottomLeft',\n\t\t\tposVar: {\n\t\t\t\tx: 30,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\tangle: 55,\n\t\t\tangleVar: 0,\n\t\t\tlife: 2.5,\n\t\t\tlifeVar: 0,\n\t\t\tradius: 10,\n\t\t\tradiusVar: 5,\n\t\t\ttextureEnabled: false,\n\t\t\trenderMode: 'normal',\n\t\t\tstartScale: 1,\n\t\t\tstartScaleVar: 0,\n\t\t\tendScale: 1,\n\t\t\tendScaleVar: 0,\n\t\t\tstartColor: [255, 0, 0, 1],\n\t\t\tstartColorVar: [0, 0, 0, 0],\n\t\t\tendColor: [0, 0, 255, 1],\n\t\t\tendColorVar: [0, 0, 0, 0],\n\t\t\tgravity: {\n\t\t\t\tx: 0,\n\t\t\t\ty: -45\n\t\t\t},\n\t\t\tradialAccel: 0,\n\t\t\tradialAccelVar: 0,\n\t\t\ttangentialAccel: 60,\n\t\t\ttangentialAccelVar: 0,\n\t\t\tspeed: 180,\n\t\t\tspeedVar: 50\n\t\t});\n\t}", "title": "" }, { "docid": "3a9415e63e33a3ab509e8b0f9faf651c", "score": "0.54738456", "text": "function preload() {\n txtAraw = loadStrings('data/baudelaire.txt'); //excerpt from The Confiteor Of the Artist - Charles Baudelaire\n txtBraw = loadStrings('data/gravitational.txt'); //excerpt from the news about gravitational waves - Washington Post, https://www.washingtonpost.com/news/speaking-of-science/wp/2016/02/11/cosmic-breakthrough-physicists-detect-gravitational-waves-from-violent-black-hole-merger/\n}", "title": "" }, { "docid": "8d08524d7c38ba06c6e2633184e9f786", "score": "0.5451129", "text": "function allFilesLoaded() {\n //TODO #2\n //At this point in the code, all billboards (PPM Images) and the scene file should be\n //loaded, so you can safely do any processing of the scene, parsing of PPM, compute for\n // rays and intersections, etc.\n canvas.width=scene.width;\n canvas.height=scene.height;\n //console.log(files);\n var shapes =[];\n var cam = new Camera(scene.width, scene.height,scene.eye, scene.lookat, scene.up, scene.fov_angle);\n var maxDepth = scene.MaxDepth;\n var circles = scene.spheres;\n var bil = scene.billboards;\n if(scene.DefaulColor != null){\n defaultColor = { x: scene.DefaulColor[0], y: scene.DefaulColor[1], z: scene.DefaulColor[2]};\n }\n if(circles != null)\n circles.forEach(element => shapes.push(new Sphere(element.center,element.radius,element.ambient,element.IsMirror)));\n if(bil != null){\n for(var i=0; i < bil.length;i++){\n if(bil[i].filename != null){\n var index=0;\n for(var j = 0; j <ppmstorage.length;j++){\n if(ppmstorage[j].name == bil[i].filename){\n index=j;\n break;\n }\n }\n var b = new Billboard(bil[i].UpperLeft, bil[i].LowerLeft, bil[i].UpperRight,ppmstorage[index].pixelmap, bil[i].IsMirror);\n b.width(ppmstorage[index].width);\n b.height(ppmstorage[index].height);\n shapes.push(b);\n }\n else\n shapes.push(new Billboard(bil[i].UpperLeft, bil[i].LowerLeft, bil[i].UpperRight,bil[i].ambient, bil[i].IsMirror));\n }\n }\n v = new Vector(scene.SunLocation[0],scene.SunLocation[1],scene.SunLocation[2]);\n scene = {\n camera: cam,\n shapes: shapes,\n light: v,\n defaultC: defaultColor\n };\n console.log(scene);\n var img = renderScene(scene);\n ctx.putImageData(img, 0, 0);\n console.log(\"Done loading Scene, Sphere, and Billboard objects\");\n}", "title": "" }, { "docid": "3fe3acaee0e70e82242353db755c73b5", "score": "0.54499334", "text": "loadPlayerHeadModel() {\n\n // [x, y, z, tX, tY, lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n\n // Player head\n let vertices = [\n // Top\n -0.25, -0.25, 0.25, 8/64, 0, 1, 1, 1, 1, NORMALS.UP.x, NORMALS.UP.y, NORMALS.UP.z,\n 0.25, -0.25, 0.25, 16/64, 0, 1, 1, 1, 1, NORMALS.UP.x, NORMALS.UP.y, NORMALS.UP.z,\n 0.25, 0.25, 0.25, 16/64, 8/64, 1, 1, 1, 1, NORMALS.UP.x, NORMALS.UP.y, NORMALS.UP.z,\n 0.25, 0.25, 0.25, 16/64, 8/64, 1, 1, 1, 1, NORMALS.UP.x, NORMALS.UP.y, NORMALS.UP.z,\n -0.25, 0.25, 0.25, 8/64, 8/64, 1, 1, 1, 1, NORMALS.UP.x, NORMALS.UP.y, NORMALS.UP.z,\n -0.25, -0.25, 0.25, 8/64, 0, 1, 1, 1, 1, NORMALS.UP.x, NORMALS.UP.y, NORMALS.UP.z,\n\n // Bottom\n -0.25, -0.25, -0.25, 16/64, 0, 1, 1, 1, 1, NORMALS.DOWN.x, NORMALS.DOWN.y, NORMALS.DOWN.z,\n -0.25, 0.25, -0.25, 16/64, 8/64, 1, 1, 1, 1, NORMALS.DOWN.x, NORMALS.DOWN.y, NORMALS.DOWN.z,\n 0.25, 0.25, -0.25, 24/64, 8/64, 1, 1, 1, 1, NORMALS.DOWN.x, NORMALS.DOWN.y, NORMALS.DOWN.z,\n 0.25, 0.25, -0.25, 24/64, 8/64, 1, 1, 1, 1, NORMALS.DOWN.x, NORMALS.DOWN.y, NORMALS.DOWN.z,\n 0.25, -0.25, -0.25, 24/64, 0, 1, 1, 1, 1, NORMALS.DOWN.x, NORMALS.DOWN.y, NORMALS.DOWN.z,\n -0.25, -0.25, -0.25, 16/64, 0, 1, 1, 1, 1, NORMALS.DOWN.x, NORMALS.DOWN.y, NORMALS.DOWN.z,\n\n // Front\n -0.25, -0.25, 0.25, 8/64, 8/64, 1, 1, 1, 1, NORMALS.FORWARD.x, NORMALS.FORWARD.y, NORMALS.FORWARD.z,\n -0.25, -0.25, -0.25, 8/64, 16/64, 1, 1, 1, 1, NORMALS.FORWARD.x, NORMALS.FORWARD.y, NORMALS.FORWARD.z,\n 0.25, -0.25, -0.25, 16/64, 16/64, 1, 1, 1, 1, NORMALS.FORWARD.x, NORMALS.FORWARD.y, NORMALS.FORWARD.z,\n 0.25, -0.25, -0.25, 16/64, 16/64, 1, 1, 1, 1, NORMALS.FORWARD.x, NORMALS.FORWARD.y, NORMALS.FORWARD.z,\n 0.25, -0.25, 0.25, 16/64, 8/64, 1, 1, 1, 1, NORMALS.FORWARD.x, NORMALS.FORWARD.y, NORMALS.FORWARD.z,\n -0.25, -0.25, 0.25, 8/64, 8/64, 1, 1, 1, 1, NORMALS.FORWARD.x, NORMALS.FORWARD.y, NORMALS.FORWARD.z,\n\n // Rear\n -0.25, 0.25, 0.25, 24/64, 8/64, 1, 1, 1, 1, NORMALS.BACK.x, NORMALS.BACK.y, NORMALS.BACK.z,\n 0.25, 0.25, 0.25, 32/64, 8/64, 1, 1, 1, 1, NORMALS.BACK.x, NORMALS.BACK.y, NORMALS.BACK.z,\n 0.25, 0.25, -0.25, 32/64, 16/64, 1, 1, 1, 1, NORMALS.BACK.x, NORMALS.BACK.y, NORMALS.BACK.z,\n 0.25, 0.25, -0.25, 32/64, 16/64, 1, 1, 1, 1, NORMALS.BACK.x, NORMALS.BACK.y, NORMALS.BACK.z,\n -0.25, 0.25, -0.25, 24/64, 16/64, 1, 1, 1, 1, NORMALS.BACK.x, NORMALS.BACK.y, NORMALS.BACK.z,\n -0.25, 0.25, 0.25, 24/64, 8/64, 1, 1, 1, 1, NORMALS.BACK.x, NORMALS.BACK.y, NORMALS.BACK.z,\n\n // Right\n -0.25, -0.25, 0.25, 16/64, 8/64, 1, 1, 1, 1, NORMALS.RIGHT.x, NORMALS.RIGHT.y, NORMALS.RIGHT.z,\n -0.25, 0.25, 0.25, 24/64, 8/64, 1, 1, 1, 1, NORMALS.RIGHT.x, NORMALS.RIGHT.y, NORMALS.RIGHT.z,\n -0.25, 0.25, -0.25, 24/64, 16/64, 1, 1, 1, 1, NORMALS.RIGHT.x, NORMALS.RIGHT.y, NORMALS.RIGHT.z,\n -0.25, 0.25, -0.25, 24/64, 16/64, 1, 1, 1, 1, NORMALS.RIGHT.x, NORMALS.RIGHT.y, NORMALS.RIGHT.z,\n -0.25, -0.25, -0.25, 16/64, 16/64, 1, 1, 1, 1, NORMALS.RIGHT.x, NORMALS.RIGHT.y, NORMALS.RIGHT.z,\n -0.25, -0.25, 0.25, 16/64, 8/64, 1, 1, 1, 1, NORMALS.RIGHT.x, NORMALS.RIGHT.y, NORMALS.RIGHT.z,\n\n // Left\n 0.25, -0.25, 0.25, 8/64, 8/64, 1, 1, 1, 1, NORMALS.LEFT.x, NORMALS.LEFT.y, NORMALS.LEFT.z,\n 0.25, -0.25, -0.25, 8/64, 16/64, 1, 1, 1, 1, NORMALS.LEFT.x, NORMALS.LEFT.y, NORMALS.LEFT.z,\n 0.25, 0.25, -0.25, 0/64, 16/64, 1, 1, 1, 1, NORMALS.LEFT.x, NORMALS.LEFT.y, NORMALS.LEFT.z,\n 0.25, 0.25, -0.25, 0/64, 16/64, 1, 1, 1, 1, NORMALS.LEFT.x, NORMALS.LEFT.y, NORMALS.LEFT.z,\n 0.25, 0.25, 0.25, 0/64, 8/64, 1, 1, 1, 1, NORMALS.LEFT.x, NORMALS.LEFT.y, NORMALS.LEFT.z,\n 0.25, -0.25, 0.25, 8/64, 8/64, 1, 1, 1, 1, NORMALS.LEFT.x, NORMALS.LEFT.y, NORMALS.LEFT.z,\n\n ];\n\n return this.playerHead = new GeometryTerrain(GeometryTerrain.convertFrom12(vertices));\n\n }", "title": "" }, { "docid": "47fdd3a3220a68af759e8b111f953d1f", "score": "0.544219", "text": "function load_level_layout()\n{\n\n var output = \n {\n bg_color:rgba32(92, 148, 252, 255),\n scene:\n [\n [[0],[0],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//0\n [[0],[0],[6],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[5],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[7],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//4\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//5\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//10\n [[0],[0],[8],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//15\n [[0],[0],[2],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],//20\n [[0],[0],[-1],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1]],\n [[0],[0],[8],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//25\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1],[-1]],\n [[0],[0],[27],[25],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[28],[26],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],//30\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//35\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],\n [[0],[0],[27],[27],[25],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],\n [[0],[0],[28],[28],[26],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//40\n [[0],[0],[8],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//45\n [[0],[0],[27],[27],[27],[25],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[28],[28],[28],[26],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[6],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[5],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//50\n [[0],[0],[7],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//55\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1],[-1]],\n [[0],[0],[27],[27],[27],[25],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[28],[28],[28],[25],[-1],[-1],[-1],[-1],[15],[-1],[-1],[-1]],\n [[0],[0],[8],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//60\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//65\n [[0],[0],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],\n [[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1]],\n [[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//70\n [[0],[0],[8],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1],[-1]],//75\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[15],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],//80\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[13],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[14],[12],[-1]],//85\n [[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[14],[12],[-1]],\n [[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[15],[-1],[-1]],\n [[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[8],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//90\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//95\n [[0],[0],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[6],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[5],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[7],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[4],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//100\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1],[15],[-1],[-1],[-1]],//105\n [[0],[0],[8],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//110\n [[0],[0],[2],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],//115\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[8],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],//120\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[13],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],//125\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1]],//130\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],\n [[0],[0],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],\n [[0],[0],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1]],\n [[0],[0],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//135\n [[0],[0],[1],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//140\n [[0],[0],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[6],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[5],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//145\n [[0],[0],[7],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//150\n [[0],[0],[1],[1],[1],[1],[-1],[-1],[-1],[-1],[13],[-1],[-1],[-1]],\n [[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//155\n [[0],[0],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//160\n [[0],[0],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[27],[25],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1]],\n [[0],[0],[28],[26],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//165\n [[0],[0],[8],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[9],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[29,-1,0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[11,-1,-1],[-1],[-1],[-1],[-1],[13],[-1],[-1],[-1]],//170\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//175\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[27],[25],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[28],[26],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1]],\n [[0],[0],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],//180\n [[0],[0],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1]],\n [[0],[0],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1]],\n [[0],[0],[1],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[1],[1],[1],[-1],[-1],[-1],[-1],[-1],[-1]],//185\n [[0],[0],[1],[1],[1],[1],[1],[1],[1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[1],[1],[1],[1],[1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[1],[1],[1],[1],[1],[1],[1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//190\n [[0],[0],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[6],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[5],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[7],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//195\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[1],[17],[17],[17],[17],[17],[17],[17],[17],[17],[16],[-1]], //197\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[13],[-1],[-1],[-1]],//200\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[14],[12],[-1],[-1]],\n [[0],[0],[18],[18],[19],[-1],[-1],[-1],[-1],[-1],[15],[-1],[-1],[-1]],\n [[0],[0],[18],[18],[20],[21],[19],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[24],[22],[20],[18],[19],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[18],[18],[20],[23],[19],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//205\n [[0],[0],[18],[18],[19],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[10],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[2],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[6],[3],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n [[0],[0],[4],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],//210\n [[0],[0],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1],[-1]],\n ]\n }\n\n return output;\n}", "title": "" }, { "docid": "bb1bb1810852bec4a6c4cddd56d45747", "score": "0.5434205", "text": "serialize() {\n let str = '';\n for (let y = 0; y < 50; y += 1) {\n for (let x = 0; x < 50; x += 1) {\n const terrain = this.get(x, y);\n const mask = TYPES.indexOf(terrain);\n if (mask !== -1) {\n str += mask;\n } else {\n throw new Error(`invalid terrain type: ${terrain}`);\n }\n }\n }\n return str;\n }", "title": "" }, { "docid": "85d520d7b80c0972a662caeabb0d6015", "score": "0.54335", "text": "function main() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"viewport\"); \n var context = canvas.getContext(\"2d\");\n raycast(context);\n //loop(context);\n \n // Create the image\n //drawRandPixels(context);\n // shows how to draw pixels\n \n //drawRandPixelsInInputEllipsoids(context);\n // shows how to draw pixels and read input file\n \n //drawInputEllipsoidsUsingArcs(context);\n // shows how to read input file, but not how to draw pixels\n \n //drawRandPixelsInInputTriangles(context);\n // shows how to draw pixels and read input file\n \n //drawInputTrainglesUsingPaths(context);\n // shows how to read input file, but not how to draw pixels\n \n //drawRandPixelsInInputBoxes(context);\n\t// shows how to draw pixels and read input file\n \n //drawInputBoxesUsingPaths(context);\n \n // shows how to read input file, but not how to draw pixels\n}", "title": "" }, { "docid": "cd772f78600b542e2e4fd7c2de2c7992", "score": "0.5430229", "text": "function world() {\n // IMAGE element on your HTML page.\n // For example, document.images.MYIMG\n this.image;\n\n // Current text string to display.\n this.text;\n \n // ID of a DIV element on your HTML page that will contain the text.\n // For example, \"img2text\"\n // Note: after you set this variable, you should call\n // the update() method to update the display.\n this.textid;\n \n\n // These are private variables\n this.scenes = new Array();\n this.current = 0;\n \n //--------------------------------------------------\n // Public methods\n //--------------------------------------------------\n this.add_scene = function(scene) {\n // Add a scene to the world.\n // For example:\n // SCENES1.add_scene(new scene(\"start\", \"s1.jpg\", \"T'was a dark and stormy night\", exits))\n \n var i = this.scenes.length;\n \n // Prefetch the image if necessary\n if (this.prefetch == -1) {\n scene.load();\n }\n\n this.scenes[i] = scene;\n }\n \n this.sceneNameToIndex = function(name) {\n \tvar i;\n \tfor (i=0; i < this.scenes.length; ++i) {\n \t\tif (this.scenes[i].name == name) {\n \t\t\treturn i;\n \t\t}\n \t}\n \treturn -1;\n }\n\n //--------------------------------------------------\n this.update = function() {\n // This method updates the current image on the page\n\n // Make sure the world has been initialized correctly\n if (! this.valid_image()) { return; }\n \n // Call the pre-update hook function if one was specified\n if (typeof this.pre_update_hook == 'function') {\n this.pre_update_hook();\n }\n\n // Convenience variable for the current slide\n var scene = this.scenes[ this.current ];\n\n // Determine if the browser supports filters\n var dofilter = false;\n if (this.image &&\n typeof this.image.filters != 'undefined' &&\n typeof this.image.filters[0] != 'undefined') {\n\n dofilter = true;\n\n }\n\n // Load the slide image if necessary\n scene.load();\n \n // Apply the filters for the image transition\n if (dofilter) {\n\n // If the user has specified a custom filter for this slide,\n // then set it now\n if (scene.filter &&\n this.image.style &&\n this.image.style.filter) {\n\n this.image.style.filter = scene.filter;\n\n }\n this.image.filters[0].Apply();\n }\n\n // Update the image, its map\n this.image.src = scene.image.src;\n this.image.useMap = '#' + scene.name;\n \n\n // Play the image transition filters\n if (dofilter) {\n this.image.filters[0].Play();\n }\n\n // Update the text\n this.display_text();\n\n // Call the post-update hook function if one was specified\n if (typeof this.post_update_hook == 'function') {\n this.post_update_hook();\n }\n\n // Do we need to pre-fetch images?\n if (this.prefetch > 0) {\n\n // Pre-fetch the next scene image(s)\n var i, next;\n for ( i=0; i < scene.exits.length; ++i) {\n\t\t\tnext = this.sceneNameToIndex(scene.exits[i]);\n\t\t\tif (next != -1) {\n\t\t\t\tthis.scenes[next].load();\n\t\t\t}\n }\n }\n }\n \n this.get_scene = function(name) {\n \treturn this.scenes[this.sceneNameToIndex(name)];\t\n }\n\n \n//--------------------------------------------------\n this.goto_scene = function(name) {\n \tvar i;\n // This method jumpts to the scene you specify.\n\n\ti = this.sceneNameToIndex(name);\n if (i == -1) {\n console.log(\"bad scene name\");\n }\n \n if (i < this.scenes.length && i >= 0) {\n this.current = i;\n this.text = this.scenes[i].text;\n } \n this.update();\n }\n \n\n//--------------------------------------------------\n this.display_text = function() {\n // Display the text\n\n // If a text id has been specified,\n // then change the contents of the HTML element\n if (this.textid) {\n\n r = this.getElementById(this.textid);\n if (!r) { return false; }\n if (typeof r.innerHTML == 'undefined') { return false; }\n\n // Update the text\n r.innerHTML = this.text;\n }\n }\n \n//--------------------------------------------------\n this.save_position = function(cookiename) {\n // Saves our position in a cookie, so when you return to this page,\n // the position won't be lost.\n \n if (!cookiename) {\n cookiename = this.name + '_gworld';\n }\n \n document.cookie = cookiename + '=' + this.current;\n }\n //--------------------------------------------------\n this.restore_position = function(cookiename) {\n // If you previously called save_position(),\n // returns the world to the previous state.\n \n //Get cookie code by Shelley Powers\n \n if (!cookiename) {\n cookiename = this.name + '_gworld';\n }\n \n var search = cookiename + \"=\";\n \n if (document.cookie.length > 0) {\n offset = document.cookie.indexOf(search);\n // if cookie exists\n if (offset != -1) { \n offset += search.length;\n // set index of beginning of value\n end = document.cookie.indexOf(\";\", offset);\n // set index of end of cookie value\n if (end == -1) end = document.cookie.length;\n this.current = parseInt(unescape(document.cookie.substring(offset, end)));\n }\n }\n }\n\n //--------------------------------------------------\n this.valid_image = function() {\n // Returns 1 if a valid image has been set for the scene\n \n if (!this.image)\n {\n return false;\n }\n else {\n return true;\n }\n }\n\n //--------------------------------------------------\n this.getElementById = function(element_id) {\n // This method returns the element corresponding to the id\n\n if (document.getElementById) {\n return document.getElementById(element_id);\n }\n else if (document.all) {\n return document.all[element_id];\n }\n else if (document.layers) {\n return document.layers[element_id];\n } else {\n return undefined;\n }\n }\n\n}", "title": "" }, { "docid": "683b7fec1bb93caf5b7d747636844155", "score": "0.5429044", "text": "function Map() //GEOGRAPHY //need to replace w/ single quad w/ texture\n{\n\tthis.mat = new coGL.Material(coGL.shaders.default, {\"uColor\":[0.97,0.97,0.97,0.5]});\n\tthis.models = [];\n\n\tfor(var i=0; i<161; i++)\n\t{\n\t\tvar _mesh = coGL.loadMeshFromJSON(\"models/geo\" + i + \".json\");\n\t\tvar mesh = new coGL.Model(_mesh, 0.0, 0.0, 0.0);\n\t\tmesh.material=this.mat;\n\t\tmapmodels.push(mesh);\n\t}\n\n\treturn this;\n}", "title": "" }, { "docid": "bc40ca9b0fca8fe6d255630ffa06f2d2", "score": "0.54276484", "text": "function maze44() {\nmap = maze4;\ninitialLoad();\n}", "title": "" }, { "docid": "4719be579409010ed5ff5dfbd43e0eb2", "score": "0.5422988", "text": "function webGLStart() {\n initGL(canvas);\n // TODO: change counter\n for (j = 0; j < charobjs.length; j++) {\n texfiles = texfiles.concat(charmtls[j].textureFiles)\n }\n\n initialCharacterTransforms();\n\n // sc = 1 / (Math.min(qbertobj.minX , qbertobj.minY,qbertobj.minZ)); // Default scaling\n //loadTextureImage(\"assets/font.bmp\", \"\");\n texfiles.push(\"font.bmp\");\n loadTextureImages(texfiles, handleLoadedTexture);\n}", "title": "" }, { "docid": "73b65e41fd0f73bb9c46b6d4b6bb4f21", "score": "0.5420031", "text": "constructor(scene, roof_slices, pillar_slices, wall_img, roof_img, pillar_img, door_img, window_img) {\n super(scene);\n this.normals = [];\n\n this.scene = scene;\n this.roof_slices = roof_slices;\n this.pillar_slices = pillar_slices;\n\n this.wall_img = wall_img;\n this.roof_img = roof_img;\n this.pillar_img = pillar_img;\n this.door_img = door_img;\n this.window_img = window_img\n\n this.walls = new MyUnitCubeQuad(scene, wall_img, wall_img, wall_img); //constructor(scene, side_img, top_img, bottom_img)\n this.roof = new MyPyramid(scene, roof_slices, 1); //constructor(scene, slices, height, radius) \n this.pillar = new MyPrism(scene, pillar_slices, 1, 1); //constructor(scene, slices, height, radius) \n this.door = new MyQuad(scene, [0,0, 1,0, 0,1, 1,1], 0); //constructor(scene, coords, cubemap) [cubemap = 0 if object is not cubemap]\n this.window = new MyQuad(scene, [0,0, 1,0, 0,1, 1,1], 0); //constructor(scene, coords, cubemap) [cubemap = 0 if object is not cubemap]\n\n //Walls text defined in MyUnitCubeQuad\n\n //door texture\n this.door_text = new CGFappearance(scene);\n this.door_text.setAmbient(0.8, 0.8, 0.8, 1);\n this.door_text.setDiffuse(1, 1, 1, 1);\n this.door_text.setSpecular(0.1, 0.1, 0.1, 1);\n this.door_text.setShininess(10.0);\n this.door_text.loadTexture('images/' + door_img);\n this.door_text.setTextureWrap('REPEAT', 'REPEAT');\n\n //window texture\n this.window_text = new CGFappearance(scene);\n this.window_text.setAmbient(0.9, 0.9, 0.9, 1);\n this.window_text.setDiffuse(0.2, 0.2, 0.2, 1);\n this.window_text.setSpecular(1, 1, 1, 1);\n this.window_text.setShininess(10.0);\n this.window_text.loadTexture('images/' + window_img);\n this.window_text.setTextureWrap('REPEAT', 'REPEAT');\n\n //Roof texture\n this.roof_text = new CGFappearance(scene);\n this.roof_text.setAmbient(1.0, 1.0, 1.0, 1);\n this.roof_text.setDiffuse(1, 1, 1, 1);\n this.roof_text.setSpecular(0.1, 0.1, 0.1, 1);\n this.roof_text.setShininess(10.0);\n this.roof_text.loadTexture('images/' + this.roof_img);\n this.roof_text.setTextureWrap('REPEAT', 'REPEAT');\n\n //Pillar texture\n this.pillar_text = new CGFappearance(scene);\n this.pillar_text.setAmbient(0.4, 0.4, 0.4, 1);\n this.pillar_text.setDiffuse(1, 1, 1, 1);\n this.pillar_text.setSpecular(0.1, 0.1, 0.1, 1);\n this.pillar_text.setShininess(10.0);\n this.pillar_text.loadTexture('images/' + this.pillar_img);\n this.pillar_text.setTextureWrap('REPEAT', 'REPEAT');\n\n }", "title": "" }, { "docid": "7f2f8abaab8255d0b78b0aead51e12bd", "score": "0.54181516", "text": "function drawTerrain()\n{\n gl.polygonOffset(0,0);\n gl.bindBuffer(gl.ARRAY_BUFFER, tVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, tVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n // Bind normal buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, tVertexNormalBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, tVertexNormalBuffer.itemSize, gl.FLOAT, false, 0, 0); \n \n //Draw \n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexTriBuffer);\n gl.drawElements(gl.TRIANGLES, tIndexTriBuffer.numItems, gl.UNSIGNED_SHORT,0); \n}", "title": "" }, { "docid": "8842abb4a3d02b5e2820bd11976d7694", "score": "0.5411885", "text": "loadTiledData() {\n PIXI.Loader.shared.add('tiled', `${config.ASSET_ROOT}/images/trees/trees.tsx`);\n }", "title": "" }, { "docid": "f3f223c5d5e2841e364582d6d2d7cfed", "score": "0.54053473", "text": "function maze33() {\nmap = maze3;\ninitialLoad();\n}", "title": "" }, { "docid": "37bc9f1a03a96318b43010fe8ac274fd", "score": "0.5404913", "text": "function setup () {\n\t// Create Canvas //\n\tvar myCanvas = createCanvas(800, 600);\n\tmyCanvas.parent('game-container');\n\t// Init //\n\tparams = getURLParams();\n\tcamera = new Camera();\n\tterrain = new Terrain();\n\n\tvar map = params.m || 'test';\n\tterrain.loadmap('../maps/'+map+'.json');\n\tinfo_htm = createP();\n\tinfo_htm.parent('#game-nav');\n\tdebug_htm = createP();\n\tdebug_htm.parent('#game-debug');\n\tvar make_button = function (t,p,f){\n\t\tvar b = createButton(t);\n\t\tif(p)b.parent(p);\n\t\tif(f)b.mousePressed(f);\n\t\treturn b;\n\t};\n\teditor_nav.push(make_button('Save Map','#game-nav',terrain.savemap));\n\tmap_input = createInput(map);\n\tmap_input.parent('#game-nav');\n\teditor_nav.push(make_button('Load Map','#game-nav',function(){\n\t\tvar base = getURL().split('?')[0];\n\t\tlocation.href = base+'?m='+map_input.value();\n\t\t// console.log(map_input.value());\n\t}));\n\teditor_nav.push(make_button('New Event','#game-nav',terrain.new_event));\n\teditor_nav.push(make_button('New Poly','#game-nav',terrain.new_poly));\n\teditor_nav.push(make_button('New Object','#game-nav',terrain.new_obj));\n\teditor_nav.push(make_button('Edit Object','#game-nav',terrain.edit_obj));\n\teditor_nav.push(make_button('Edit Map Data','#game-nav',terrain.edit_mapData));\n\t// Test //\n}", "title": "" }, { "docid": "69f6e8022073ab4ebc77aa4ca25a540f", "score": "0.54032737", "text": "function setupMap()\r\n{\r\n map = [\r\n [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1],\r\n [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1],\r\n [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1],\r\n [1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\r\n ]\r\n}", "title": "" } ]
7d802aed40a2b51359e7656b81ed924a
STARTUP function to run on load; assigns button eventhandler
[ { "docid": "021c00a5dabc80de2f8c8c4ffd1e9c15", "score": "0.64672214", "text": "function startup() {\n console.log(\"starting up...\");\n // set event-handlers:\n let button = document.getElementById(\"search\");\n button.onclick = search;\n console.log(\"start-up complete\");\n }", "title": "" } ]
[ { "docid": "26d64b1911c438babee18746c82edfa7", "score": "0.7121293", "text": "function init()\n{\n var unh = document.getElementById('btn_unhappy');\n var neu = document.getElementById('btn_neutral');\n var hap = document.getElementById('btn_happy');\n var sub = document.getElementById('btn_submitRange');\n\n unh.addEventListener('click', btnClickHandler);\n neu.addEventListener('click', btnClickHandler);\n hap.addEventListener('click', btnClickHandler);\n sub.addEventListener('click', btnClickHandler);\n}", "title": "" }, { "docid": "4619f98658a4d15935d541f9cd1897d7", "score": "0.709092", "text": "function loadCallback () {\n\t// Enable the button actions\n\tenableButtons ();\n}", "title": "" }, { "docid": "32de28cab7bbd9d662545879e55dcf2e", "score": "0.70579284", "text": "function edgtfOnDocumentReady() {\n\t\tedgtfButton().init();\n\t}", "title": "" }, { "docid": "e73b0fbc76b7f0b1a6ca1113ea4aeca0", "score": "0.7048166", "text": "function init() {\n\t\tsetOnclicks();\n\t}", "title": "" }, { "docid": "062a7abaa4cb512c63a66bb0c32233be", "score": "0.6979732", "text": "function init() {\n var button = document.getElementById(\"addButton\");\n button.onclick = handleButtonClick;\n loadPlaylist();\n}", "title": "" }, { "docid": "fd0e416b2c462ed942aac87da1432540", "score": "0.68735677", "text": "function init() {\n // Button event listeners\n $(\"#tally-button\").on(\"click\", tallyScore);\n $(\".team-label\").on(\"click\", toggleTeam);\n $(\"#new-question-button\").on(\"click\", getQuestion);\n $(\"#reveal-button\").on(\"click\", revealAnswer);\n $(\"#settings-cancel\").on(\"click\", closeModal);\n $(\"#settings-save\").on(\"click\", saveModal);\n $(\"#settings-show\").on(\"click\", showModal);\n $(\"#reset-trivia\").on(\"click\", resetGame);\n\n loadState();\n getQuestion();\n }", "title": "" }, { "docid": "6162978b40f0c94f20a4b4fffecf75e6", "score": "0.6833812", "text": "function initializePage() {\n\t//$(\"#redoButton\").click(redoClick);\n\t//$(\"#undoButton\").click(undoClick);\n\t$(\"#saveButton\").click(saveClick);\n\t$(\"#saveButton2\").click(saveClick);\n}", "title": "" }, { "docid": "2aac50e45333ade72151c67dbbe2eb09", "score": "0.679598", "text": "function onReady(){\n getCalcs();\n $('#addButton').on(\"click\", setOperator);\n $('#subtractButton').on(\"click\", setOperator);\n $('#multiplyButton').on(\"click\", setOperator);\n $('#divideButton').on(\"click\", setOperator);\n $('#equalsButton').on(\"click\", sendCalc);\n $('#clearButton').on(\"click\", clearInputs);\n $('#clearHistoryButton').on(\"click\", deleteHistory)\n}", "title": "" }, { "docid": "63f744e84dbc7ed8405738181801cbcc", "score": "0.673515", "text": "function buttonsInit(){\n\t// Initialize header buttons\n\t$('#logo').on('click', function(){displayView(View.Home)});\n\t$('#header_user_div').on('click', function(){displayView(View.SongBook, currentUser.ID)});\n\n\t// Initialize control buttons\n\t$('#mailboxNav').on('click', function(){displayView(View.Mailbox)});\n\t$('#songBookNav').on('click', function(){displayView(View.SongBook, currentUser.ID)});\n\t$('#searchNav').on('click', function(){displayView(View.Search)});\n\t$('#settingsNav').on('click', function(){displayView(View.Settings)});\n\t$('#featuredImage').on('click', function(){displayView(View.Venue, $('#featuredImage').attr('value'))});\n\t$('#customImage').on('click', function(){displayView(View.Venue, $('#customImage').attr('value'))});\n\n\t$('#pullDown').on('click', function(){displayPullDown()});\n\n\t$('#buttonCheckIn').on('click', function(){checkIn()});\n\n\t$('#interiorNavSongBook').on('click', function(){displayView(View.KaraokeSongBook)});\n\n\tslideImages();\n}", "title": "" }, { "docid": "5c7c89afeac172ce81546bfad46d2080", "score": "0.6727778", "text": "function initialize() {\n $(\"aboutbtn\").addEventListener(\"click\", aboutPg);\n $(\"photobtn\").addEventListener(\"click\", photoPg);\n $(\"ripbtn\").addEventListener(\"click\", ripPg);\n $(\"caddy\").addEventListener(\"click\", caddy);\n $(\"cats\").addEventListener(\"click\", cats);\n $(\"remaker\").addEventListener(\"click\", backHome);\n }", "title": "" }, { "docid": "e67133fd3192ef66f43fd4da3a9b2f4b", "score": "0.67166156", "text": "function init() {\n\t\tconvertButton.on('click', convertData);\n\t\tresetButton.on('click', resetData);\n\t}", "title": "" }, { "docid": "5e01c355b08a0b54668d93e0c1788d28", "score": "0.6715422", "text": "function init() {\n /**\n * Init Function to add event handlers\n */\n $('#confirmPayment').click(handleConfirmPayment);\n $('.payment-type').change(handlePaymentTypeSelection);\n $('#id_wizard_goto_step').click(handlePrevStepButton);\n}", "title": "" }, { "docid": "9cc9eb5fe4676991f231e514c0a26c92", "score": "0.6673339", "text": "function init() {\r\n // page load init function - call startup events here\r\n}", "title": "" }, { "docid": "59f2dae0ad71406a9aa59b6108752064", "score": "0.66540414", "text": "function my_oninit() {\n\tmy_paz.stat();\n\tmy_paz.bytarget();\n\tpz2Initialised = true;\n\ttriggerSearchForForm(null);\n}", "title": "" }, { "docid": "ab45e89a98d54b6d1bed04c2c2c7c260", "score": "0.6624498", "text": "function init() {\r\n document.getElementById(\"next\").addEventListener(\"click\", next);\r\n document.getElementById(\"previous\").addEventListener(\"click\", previous);\r\n document.getElementById(\"secret\").addEventListener(\"click\", secret);\r\n document.getElementById(\"color\").addEventListener(\"click\", changeColor);\r\n\r\n }", "title": "" }, { "docid": "d33e6db232337d050ed9698751e04d67", "score": "0.66008186", "text": "function initializePage() {\n \t$(\"#newAlarmBtn\").click(newAlarmBtn);\n }", "title": "" }, { "docid": "bdb18446012bece607c1e50d3ae6e493", "score": "0.6582455", "text": "function onReady() {\n initTopPage();\n $(\"#SaveBtn\").click(onSaveBtn);\n $(\"#TopListView\").on(\"click\", \"a.show\", onShowLink);\n $(\"#TopListView\").on(\"click\", \"a.delete\", onDeleteLink);\n}", "title": "" }, { "docid": "ff27c21923c2a69b1a3f7815d73935c4", "score": "0.6575503", "text": "function qodeOnWindowLoad() {\n qodeInitElementorGlobal();\n }", "title": "" }, { "docid": "2eb1bcdfc2d18c52799172a2562d05e2", "score": "0.6569289", "text": "function init() {\n var submitButton = document.getElementById(\"generateButton\");\t// js for generate boxes button\n submitButton.onclick = addBoxes;\n var clearButton = document.getElementById(\"clearButton\");\t\t// js for clear boxes button\n clearButton.onclick = dropBoxes; \n }", "title": "" }, { "docid": "c44c97e2c3a7639e7ee520aebf4f4aa2", "score": "0.6542839", "text": "function qodeOnWindowLoad() {\n qodeInitElementorCallToActionSection();\n }", "title": "" }, { "docid": "d639d66e314f284f71529df2394676be", "score": "0.6539231", "text": "function pageLoad () {\n console.log('page load')\n $('#huffman-button')[0].onclick = okayClick\n $('#reset')[0].onclick = reset\n}", "title": "" }, { "docid": "3a06de53841fd69744ba86925f499e0a", "score": "0.65255594", "text": "function initialize () {\n\t\t\t_$target.on( 'click', clickHandler );\n\t\t}", "title": "" }, { "docid": "96dffe5efc5fe15369b5eca8c90e3535", "score": "0.65243524", "text": "function init() {\n createTrainButton();\n // createVisButton();\n loadData();\n}", "title": "" }, { "docid": "77f196b64e1a0b50e391487a688ce703", "score": "0.6516704", "text": "function qodeOnWindowLoad() {\n\t\tqodeInitElementorAlbumPlayer();\n\t\tqodeInitElementorAlbum();\n\t\tqodeInitElementorAlbumsList();\n\t}", "title": "" }, { "docid": "51a847cdebf460786a84df26ce469ade", "score": "0.6512619", "text": "function handleInit() {\n\n}", "title": "" }, { "docid": "b533e4d84646f2b4579ee28207f2bcdc", "score": "0.6502804", "text": "function init(){\n bindEvents();\n }", "title": "" }, { "docid": "1e2545aab5d352286c8c54ecdd47ed27", "score": "0.6488238", "text": "function initializePage() {\n updateDate(day);\n\n $('#left-nav').click(decreaseDay);\n $('#right-nav').click(increaseDay);\n $('#todayBtn').click(setToday);\n $('#submitBtnEvents').click(addEvent);\n $('#add-btn').click(resetModal);\n $('.removebtn').click(deleteEvent);\n $('.editbtn').click(editEvent);\n}", "title": "" }, { "docid": "848e53a1a3e088c9beabbda241c39c6c", "score": "0.6475706", "text": "function init() {\n \n // Sets the button for drawing mode to green/success\n drawButton.setAttribute('class', 'btn btn-success');\n \n // Sets the button for selectiion mode to gray/default\n selectionButton.setAttribute('class', 'btn btn-default');\n \n drawGrid();\n \n loadFloorButtons();\n \n loadCanvas();\n}", "title": "" }, { "docid": "dd39360845da12af25468a900295b623", "score": "0.6472342", "text": "function init() {\n retrieveStored();\n\n startButtonEl.addEventListener('click', function () {\n clearStart();\n inputQuestion();\n inputOption();\n timer();\n document.getElementById('leaderboard-button').disabled = true\n });\n}", "title": "" }, { "docid": "4ed49e759732f2b9cf38706004b0cafa", "score": "0.64720666", "text": "function initialize(){\n\t \t//bindEvents();\n\t}", "title": "" }, { "docid": "86391bdb20e3d258230021240819e26c", "score": "0.6464788", "text": "function initializePage() {\n\t$(\"#testjs\").click(function(e) {\n\t\t$('.jumbotron h1').text(\"Jacob Terrado is cool\");\n\t\t$(\".jumbotron p\").toggleClass(\"active\");\n\t\t$(\".jumbotron button\").text(\"it worked\");\n\t});\n\n\t// Add any additional listeners here\n\t// example: $(\"#div-id\").click(functionToCall);\n\t$(\"a.thumbnail\").click(testJavaScript);\n\n\t$(\"#submitBtn\").click(submitClick)\n}", "title": "" }, { "docid": "a1eb533b9520f0a3f24002e0c3d72446", "score": "0.64637446", "text": "function init_loc(){\n var buttonElement = document.getElementById(\"loc_button\");\n buttonElement.id = \"loc_button\";\n var tButton = buttonElement;\n tButton.addEventListener(\"click\", update_page, false);\n}", "title": "" }, { "docid": "674fc8a3f625f85451d2857cc0a0d612", "score": "0.64419204", "text": "function initializePage() {\n\t$(\"#testjs\").click(function(e) {\n\t\t$('.jumbotron h1').text(\"Javascript is connected\");\n\t\t$(\"#testjs\").text(\"Please wait...\");\n\t\t$(\".jumbotron p\").toggleClass(\"active\");\n\t});\n\n\t// Add any additional listeners here\n\t// example: $(\"#div-id\").click(functionToCall);\n\t$(\"a.thumbnail\").click(projectClick);\n\t$(\"#submitBtn\").click(submitClick);\n}", "title": "" }, { "docid": "931b56f8a9a39b6d940a5b5298368280", "score": "0.6424895", "text": "function loadPage() {\n // Disable install button until a file upload succeeds.\n // enable(installBtton, false);\n\n // $.getJSON(\"/dispatch/log_filter\", function(data) {\n // var workerIds = data.worker_ids;\n // mLogWorkersText.val(workerIds);\n // });\n\n initFileUpload();\n }", "title": "" }, { "docid": "a0a9e17e4fc52f9af7dded735a4a39e8", "score": "0.64169997", "text": "function init() {\n // Makes it so that the button load memes when it is clicked\n id(\"refresh\").addEventListener(\"click\", loadMemes);\n }", "title": "" }, { "docid": "6a1e1a2bacadb611512c4de5cc1c8063", "score": "0.6415371", "text": "function init() {\n buttonLoad = document.getElementById(\"btn_load\");\n selectLimit = document.getElementById(\"select_limit\");\n selectCategory = document.getElementById(\"select_category\");\n inputSubreddit = document.getElementById(\"input_subreddit\");\n sorter = document.getElementById(\"sorter\");\n modalDialog.container = document.getElementById(\"modal_container\");\n modalDialog.close = document.getElementById(\"modal_close\");\n modalDialog.title = document.getElementById(\"modal_title\");\n modalDialog.content = document.getElementById(\"modal_content\");\n mainForm = document.getElementById(\"main_form\");\n\n\n fillOptions();\n attachEvents();\n\n setButtonState();\n load();\n }", "title": "" }, { "docid": "cdce84faabea0855d166550611cbd62a", "score": "0.64138025", "text": "function init() {\n setupAuxMarkup();\n setupBasicEventHandles();\n }", "title": "" }, { "docid": "18de34d53112ce0cd32e58929ee7a054", "score": "0.6412101", "text": "function qodeOnWindowLoad() {\n qodeInitElementorPreviewSlider();\n }", "title": "" }, { "docid": "ef29438f6b374b8e780997c3e7d333ea", "score": "0.64119565", "text": "function edgtfOnWindowLoad() {\n edgtfAnimationsHolder();\n edgtfInitGiveSlider();\n }", "title": "" }, { "docid": "fb72d7cf35b947a5cbb19a8d5dac1d3e", "score": "0.6397601", "text": "function qodeOnWindowLoad() {\n qodeInitElementorToursCarousel();\n }", "title": "" }, { "docid": "c9d1646f81a114e3ffe7bd35add4fc16", "score": "0.63973033", "text": "function init() {\n crear.addEventListener('click', crearTabla);\n actuali.addEventListener('click', actualizarValor);\n}", "title": "" }, { "docid": "e2dafff1a4e87c655ba7c647c9d2d07b", "score": "0.6395993", "text": "function init() {\n main.registerEvent(main.events.onSideKickPageOpened, onWindowOpen, false);\n main.registerEvent(main.events.onMapClosed, function () {\n $(data.clickedElem).trigger('click');\n });\n main.registerEvent(main.events.onMapOpened, initMap, true);\n }", "title": "" }, { "docid": "54d7148befa968eead53ced2ca136c42", "score": "0.6395411", "text": "function loaded(){\n //this is to check in the console if the song has loaded\n console.log(\"loaded\");\n\n //creating the button object\n button = createButton(\"play\");\n button.mousePressed(toggle);\n}", "title": "" }, { "docid": "60496aaa18ff077676e9731c54adcdbc", "score": "0.6388271", "text": "function initialize()\n{\n // do this only if the browser can handle DOM methods\n if (document.getElementById)\n {\n // apply event handler to the button\n oInput = document.getElementById('converter');\n if (oInput)\n {\n addEvent(oOnput, 'change', upperMe);\n }\n // apply event handler to the form\n var oForm = document.getElementsById('UCForm');\n if (oForm) {\n addEvent(oForm, 'submit', upperMe);\n }\n }\n}", "title": "" }, { "docid": "9b0f621188807bf269d8288e182f4f2f", "score": "0.6387051", "text": "function tb_init(domChunk){\n\tjQuery( 'body' )\n\t\t.on( 'click', domChunk, tb_click )\n\t\t.on( 'thickbox:iframe:loaded', function() {\n\t\t\tjQuery( '#TB_window' ).removeClass( 'thickbox-loading' );\n\t\t});\n}", "title": "" }, { "docid": "d07a87b5b5ce0f5a92219170bdfdc55e", "score": "0.63840663", "text": "async function initEventListeners() {\n \n\t\t// Event Handler for the clear data button \n\t\tvar btnClearData = dom.byId(\"btnClear\");\n\t\tif (btnClearData) {\n\t\t\ton(btnClearData, \"click\", defineMain.removeAllLayers);\n\t\t}\n\n\t\t// Event Handler for the apply button for the main query input\n\t\tvar btnAddData = dom.byId(\"btnAdd\");\n\t\tif (btnAddData) {\n\t\t\ton(btnAddData, \"click\", defineMain.initiateLoad);\n\t\t}\n\n\t\t// Event Handler for the main search / query box using the enter key\n\t\tvar txtInput = dom.byId(\"inputQuery\");\n\t\tif (txtInput) {\n\t\t\ton(txtInput, \"keydown\", function (event) {\n\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\tdefineMain.initiateLoad();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// Event Handler for the Language drop-down selector\n\t\tvar selectLanguage = dom.byId(\"langDropdown\");\n\t\tif (selectLanguage) {\n\t\t\ton(selectLanguage, \"change\", function () {\n\t\t\t\tdefineMain.initiateLoad();\n\t\t\t});\n\t\t}\n }", "title": "" }, { "docid": "f63b2f2190dd9ceeee9d94d447b2455e", "score": "0.6383244", "text": "function InitialiseDocumentControls(){\n $(document).on('click', '.interactive-text', function(event){\n buttonClick = new ButtonControls(event);\n buttonClick.onClick();\n });\n}", "title": "" }, { "docid": "ba7581e449d7727953a6a9b810b04fa7", "score": "0.6382868", "text": "function onLoad() {\n createTable();\n getTableData();\n setOnClick();\n}", "title": "" }, { "docid": "73ae8a50d82a1844e96fb3a68ca21419", "score": "0.63784", "text": "function readyButton() {\r\n $('.js-html-weather').on('click', '#start', function (event) {\r\n QUIZ.quizStarted = true;\r\n render();\r\n });\r\n}", "title": "" }, { "docid": "bcc51149ceceda2561571275fb148894", "score": "0.63753873", "text": "initBtn() {\n _.event({\n \"onElement\": cfg.dom.btn,\n \"event\": \"click\",\n \"callback\": (e) => {\n cfg.dom.modal.classList.add('visible');\n }\n });\n }", "title": "" }, { "docid": "33eb6a63d13ac6a3d5b41c172262aab0", "score": "0.63717204", "text": "function setupControlButtons() {\n\n var startButton = document.getElementById('start');\n startButton.onclick = startButtonHandler;\n \n var clearButton = document.getElementById('clear');\n clearButton.onclick = clearButtonHandler;\n \n var randomButton = document.getElementById(\"random\");\n randomButton.onclick = randomButtonHandler;\n\n var saveButton = document.getElementById(\"save\");\n saveButton.onclick = saveData;\n}", "title": "" }, { "docid": "479a1e986685c72463f377b215831976", "score": "0.63702697", "text": "function init() {\n containerEl.on('click', saveEventData);\n main(); //call to start creating objects\n}", "title": "" }, { "docid": "cac760e846d40328d6a5820c8af222c8", "score": "0.6354309", "text": "function onSlideLoad(){\n\n\t// Init slide links\n\tinitLinks();\n\n\t// Side Popup\n\tinitSidePopups();\n\n\t// Video Popup\n\tinitVideo();\n\n\t// Init Popups\n\tinitPopups();\n\n\t// init Buttons\n\tinitButtons();\n}", "title": "" }, { "docid": "8660313423c89f21798155a8b644c134", "score": "0.6350589", "text": "function setup() {\n dom.bind(\"#main-menu ul.menu\", \"click\", function(e) {\n if (e.target.nodeName.toLowerCase() === \"button\") {\n // Determine button name and call the\n // corresponding screen (Event Delegation) \n var action = e.target.getAttribute(\"name\");\n game.showScreen(action);\n }\n });\n }", "title": "" }, { "docid": "ebeec2408e8ae5bd7cfb151f58e21e12", "score": "0.6339285", "text": "function init() {\n // Add event listeners here to notice when the user clicks size and play buttons\n return true;\n}", "title": "" }, { "docid": "eb74d126e03d8f9c28c16f93c3b73a80", "score": "0.6330166", "text": "function init() {\n\twindow.onload = function() {\n\t\tconsole.log(document.getElementById('title'));\n \tfilesUpload = document.getElementById('input-files');\n \tfilesUpload.addEventListener('change', fileHandler, false);\n\t}\n}", "title": "" }, { "docid": "059b6accb652490797ad53c02cc99ac6", "score": "0.63168323", "text": "function initEventHandlers() {\n }", "title": "" }, { "docid": "b37cb836373ead440cca66cdc0e9805e", "score": "0.6314679", "text": "function FSMInterpreterReadyCallBack() \n {\n BuildServerInterface();\n if (SettingsParameter.Mode == \"d\" || SettingsParameter.Mode == \"a\") LoadSimulation();\n \n // adjust and align the appearance of all modules\n if (SettingsParameter.DeviceType == \"ManualControl\")\n {\n AddManualControlEventHandlers();\n }\n SetWebCam();\n SetColumnsToEqualHeight();\n }", "title": "" }, { "docid": "5c1bd69fc6c469d06bbe21f8f16f7977", "score": "0.630247", "text": "function OnLoadEventHandler() {\n}", "title": "" }, { "docid": "dca1b46d2ff9640d10f52b02b2f41557", "score": "0.63021916", "text": "function initializePage() {\n\t// add any functionality and listeners you want here\n}", "title": "" }, { "docid": "4b48677f03a5cd490491638df5f81e47", "score": "0.6284844", "text": "function init(){\n\tloadList();\n\tbutton = document.getElementById('add');\n\tbutton.onclick = addItem;\n}", "title": "" }, { "docid": "3ff895b8376679c84bc9a784221c694b", "score": "0.6283903", "text": "function qodeOnWindowLoad() {\n qodeInitElementorImageHover();\n }", "title": "" }, { "docid": "ea2c0f82b69ab2992e1715cd384db405", "score": "0.62813", "text": "function window_onload() {\n\n // assign click events to images and buttons.\n document.getElementById(\"bomInfoButton\").onclick = bomInfoButton_click;\n document.getElementById(\"bomImage\").onclick = bomImageChange_click;\n document.getElementById(\"domImage\").onclick = domImageChange_click;\n\n}", "title": "" }, { "docid": "b292aee8b4bb86159604892716ebc275", "score": "0.62746084", "text": "function qodeOnWindowLoad() {\n }", "title": "" }, { "docid": "524f13a1f7d0d7891aded693f12b0ec5", "score": "0.6269529", "text": "function init() {\n\n buttonEvents();\n buttonEvents2();\n player1Turn();\n\n}", "title": "" }, { "docid": "ee2eb2b64db3c55f3430c6d56219352f", "score": "0.6266515", "text": "function CLC_SR_PageInit(){\r\n CLC_SR_SpeakHTMLFocusEvents_Init();\r\n CLC_SR_SpeakARIAWidgetEvents_Init();\r\n }", "title": "" }, { "docid": "79168445b3da06719c2e7c74a1dc4bb6", "score": "0.6265345", "text": "function initButtons() {\r\n // Show and hide creator\r\n // Show and hide answer\r\n // Forward and back Questions\r\n // Remove question\r\n // Add question\r\n bForward.addEventListener(\"click\",forward);\r\n bBack.addEventListener(\"click\",back);\r\n bShow.addEventListener(\"click\",showAnswer);\r\n bHideQC.addEventListener(\"click\",hideQuestionCreator);\r\n bHideA.addEventListener(\"click\",hideAnswer);\r\n bAddQ.addEventListener(\"click\",addQuestion);\r\n bShowQC.addEventListener(\"click\",showQuestionCreator);\r\n bRemove.addEventListener(\"click\",removeQuestion);\r\n}", "title": "" }, { "docid": "9d0b555bc3edfd5c18c84e42a169e657", "score": "0.62651074", "text": "function initializePage() \n{\n\tconsole.log(\"Javascript connected!\");\n\t$('#submit').click(searchClick);\n}", "title": "" }, { "docid": "b82917b0ebb73f205da5c7b1015b408c", "score": "0.6262657", "text": "function startOnLoad() {\n }", "title": "" }, { "docid": "74ccc0e282d8eb61206561c8964e9e32", "score": "0.6257262", "text": "function initialize()\n{\n\t// do this only if the browser can handle DOM methods\n\tif(document.getElementById)\n\t{\n\t\t// apply event handler to the button\n\t\toInput = document.getElementById('converter');\n\n\t\tif(oInput){\n\t\t\toInput.addEventListener('change',upperMe)\n\t\t}\n\n\t\t// apply event handler to the form\n\t\tvar oForm = document.getElementById('UCform');\n\t\tif(oForm){\n\t\t\toForm.addEventListener('submit',upperMe);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c602fd7540ded189f13ede973c4e80e6", "score": "0.62518686", "text": "function onLoad() {\r\n\r\n var helper = new Helper();\r\n var exchangeDataLoader = new ExchangeDataLoader();\r\n var chartCreator = new ChartCreator(helper);\r\n var clickHandler = new ClickHandler(helper, exchangeDataLoader, chartCreator);\r\n var app = new App(clickHandler);\r\n\r\n // helper.flushLocalStorage(); //only for DEBUG!\r\n app.init();\r\n }", "title": "" }, { "docid": "e2a29829010b1aa6df4ab57588dee042", "score": "0.62440217", "text": "onLoad(){\n this.initEventHandlers();\n this.initView();\n }", "title": "" }, { "docid": "2e405938e0bc7fc0bd45fb8c81d82a5c", "score": "0.6242379", "text": "function init(){\n console.log(\"Ready!\");\n huffleButton.addEventListener(\"click\", setFilter);\n gryffButton.addEventListener(\"click\", setFilter);\n ravenclawButton.addEventListener(\"click\", setFilter);\n slytherinButton.addEventListener(\"click\", setFilter); \n allButton.addEventListener(\"click\", setFilter);\n getBloodType(); \n}", "title": "" }, { "docid": "baf0011bbbad7cbef1ac74523b3d50f5", "score": "0.62389046", "text": "function onReady() {\n\t\trefreshController();\n\t\thideDemobo();\n\t\tsyncState();\n\t}", "title": "" }, { "docid": "3a315fb373a84f3fd85bf73d951b2345", "score": "0.6238158", "text": "function init()\n{\n\tdocument.querySelector(\"#button\").addEventListener('click', function(){addItem(document.querySelector(\"#textfield\").value, \t\t \t\t\t\t\t\t\tdocument.querySelector(\"#textfield2\").value, document.querySelector(\"#textfield3\").value)});\n\t\n\tdocument.querySelector(\"#button2\").addEventListener('click', resetForm);\n\t\n\tdocument.querySelector(\"#button3\").addEventListener('click', clearOrders);\n}", "title": "" }, { "docid": "1152acfcd7535053ddf08aed9d2599a4", "score": "0.62360984", "text": "function qodeOnWindowLoad() {\n qodeInitElementorOldTab();\n }", "title": "" }, { "docid": "4d103535605cbd9055dfced0a3e34d0d", "score": "0.6234676", "text": "function init() {\n document.getElementById('button').addEventListener(\"click\", makeRequest);\n document.getElementById('clear').addEventListener(\"click\", clear);\n }", "title": "" }, { "docid": "d22ead7243d407e3d2147879866d1639", "score": "0.6234179", "text": "function init() {\n var generateButton = document.getElementById(\"generateButton\");\n generateButton.onclick = generate;\n var clearButton = document.getElementById(\"clearButton\");\n clearButton.onclick = clear;\n}", "title": "" }, { "docid": "b8861c09de7eb57257fdaa2f9639e195", "score": "0.6231999", "text": "function handleInitDone(eventObject)\r\n{\r\n\tif (DEBUG_USERS.indexOf(system.getUser().name) > -1)\r\n\t{\r\n\t\t//debugger;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tbtnTestSave.hide();\r\n\t}\r\n\t\r\n //Create the libPassword object\r\n libPassword = window.document.createElement(\"SPAN\");\r\n libPassword.id = \"libPassword\";\r\n \r\n libXMLUtil = window.document.createElement(\"SPAN\");\r\n libXMLUtil.id = \"libXMLUtil\";\r\n \r\n //Attach the base64 library.\r\n application.addLibrary(\"/cordys/wcp/admin/library/base64encoder.htm\", libPassword);\r\n \r\n //Attach the XML util lib.\r\n application.addLibrary(\"/cordys/wcp/library/util/xmlutil.htm\", libXMLUtil);\r\n\r\n\t//Mandatory initialization of the applicationconnector.js\r\n if (parent.initialize)\r\n {\r\n parent.initialize();\r\n \r\n //In case of a new connector the XML is not filled. In that case we'll\r\n //fill it with a dummy XML. If no data has been put in the model getData\r\n //returns a document.\r\n if (mdlConfiguration.getData().documentElement)\r\n {\r\n \tfillInPropertyScreen(xmlBaseObject.documentElement);\r\n }\r\n }\r\n else\r\n {\r\n \t//Standalone (thus preview) mode\r\n \tfillInPropertyScreen(xmlBaseObject.documentElement);\r\n }\r\n \r\n g_bInitialized = true;\r\n}", "title": "" }, { "docid": "a9dc8159ccc6bf588e58d214ae822b8b", "score": "0.62281686", "text": "function pageLoad () {\r\n //attaching event handler for the button click\r\n document.getElementById(\"deco\").onclick = decoClicked;\r\n\r\n //attaching event handler for the checkbox check\r\n document.getElementById(\"chk\").onchange = chkboxChanged;\r\n\r\n //attaching event to the Igpay Atinlay button\r\n document.getElementById(\"pigLatin\").onclick = pigLatinClicked;\r\n\r\n //attaching event to the malkovitch button\r\n document.getElementById(\"malkovitch\").onclick = malkovitchClicked;\r\n}", "title": "" }, { "docid": "4978688ac7627ec0cf177e46d6e02756", "score": "0.62268144", "text": "function tb_init(domChunk){\n\tjQuery(domChunk).live('click', tb_click);\n}", "title": "" }, { "docid": "0b8cf159a22468b4f3ac84ab5c7728e2", "score": "0.6224564", "text": "function init() {\n initButtons();\n reset();\n }", "title": "" }, { "docid": "c7b76ef12285c24471fb7962bca30d5c", "score": "0.6222517", "text": "function qodeOnWindowLoad() {\r\n qodeInitElementorListingSearch();\r\n }", "title": "" }, { "docid": "ec18f0d83014d3c6ee49bd8d51b811a1", "score": "0.6222107", "text": "function init() {\n qs(\"#menu-view #start-btn\").addEventListener('click', startGame);\n }", "title": "" }, { "docid": "b8cf58a78c8832046e7f1208ede54e75", "score": "0.62215173", "text": "function onOnLoadEventsComplete(){\n\n\tapp.main.init();\n\n\t// we need the bind here because requestAnimationFrame destroys the scope of update\n\t// when it uses it as a callback\n\twindow.requestAnimationFrame(app.main.update.bind(app.main));\n\n}", "title": "" }, { "docid": "9790ed3ce2e7888306fd17a2bfae37fe", "score": "0.6219222", "text": "function init() {\r\n id(\"add-duckie\").addEventListener(\"click\", addDuckie);\r\n id(\"party-mode\").addEventListener(\"click\", partyMode);\r\n }", "title": "" }, { "docid": "f6fc63d851aaa77ac26263643223d878", "score": "0.6217942", "text": "function pageload() {\n document\n .getElementById(\"calculate-btn\")\n .addEventListener(\"click\", calculateCI);\n\n document.querySelector(\".comp-int-btn\").onclick = displayCompInt;\n\n document.querySelector(\".show-table\").onclick = showTable;\n\n document.querySelector(\".collapse-table\").onclick = collapseTable;\n}", "title": "" }, { "docid": "0291476a671591bf3d2079a64e24025b", "score": "0.6216054", "text": "function DOMReady() {\n loaded = true;\n local.init();\n }", "title": "" }, { "docid": "a5f5cedfb125e32e123648b841341e5d", "score": "0.6215419", "text": "function callOnLoad(){\n // Load date and clock at top of page\n loadCurrentDate()\n\n // Load list of entries \n loadEntries()\n \n // Load list of emotions into form and form modal, add action to entry form\n loadEmotionsForm()\n addEmotionButton().addEventListener(\"click\",e=>e.preventDefault())\n entryForm().addEventListener(\"submit\",Entry.createFromForm)\n\n // Add scroll actions to scroll buttons\n leftScrollButton().addEventListener(\"click\",scrollEntriesList.bind(null,-750))\n rightScrollButton().addEventListener(\"click\",scrollEntriesList.bind(null,750))\n}", "title": "" }, { "docid": "d4122f2ecd04868e9a6f1c40966ff17c", "score": "0.6203084", "text": "function addLoadEvent() {}", "title": "" }, { "docid": "de2e29d03edb611bdb31018861429c59", "score": "0.6196415", "text": "function preload() {\r\n\t// start button should be hidden, but make sure\r\n\t// TODO: dynamically create start button here?\r\n\t\r\n\tif ($(\"#start_button\").length) {\r\n\t\tconsole.log(\"Start button\")\r\n\t\tinitializations.init = function() {\r\n\t\t\tinitcanvas()\r\n\t\t}\r\n\t} else {\r\n\t\tconsole.log(\"No Start button\")\r\n\t\tinitializations.init = function() {\r\n\t\t\tinitcanvas()\r\n\t\t\tinitaudio()\r\n\t\t}\r\n\t}\r\n\tinitialize()\r\n}", "title": "" }, { "docid": "7e61090b2a6f2ce18834bdd6c3f986f0", "score": "0.6192368", "text": "function initializePage() {\n\t$(\"#testjs\").click(function(e) {\n\t\t$('.jumbotron h1').text(\"Aww Yis! Javascript is connected\");\n\n\t\t//Change text of this button\n\t\t$(this).text(\"I am the new text of this button and I like it.\");\n\n\t\t//Add class to .jumbotron p\n\t\t$(\".jumbotron p\").toggleClass(\"active\");\n\t});\n\n\t// Add any additional listeners here\n\t// example: $(\"#div-id\").click(functionToCall);\n\t$(\"div.thumbnail\").click(projectClick)\n\n\t//Add listener to form submitBtn\n\t$(\"#submitBtn\").click(function(e) {\n\t\te.preventDefault();\n\n\t\tvar selectedProject = $(\"select#project\").val();\n\t\t$(selectedProject).animate({\n\t\t\twidth: $('#width').val()\n\t\t});\n\n\t\tvar description = $(selectedProject).find(\".image-description p\");\n\t if (description.length > 0) {\n\t //only update if description exists\n\t description.text($('#description').val());\n\t }\n\t})\n}", "title": "" }, { "docid": "6595a70721e8feb9efd4d635f9bb8cc6", "score": "0.61918634", "text": "function init() {\n document.querySelector('#getMemeButton').onclick = generateMeme;\n }", "title": "" }, { "docid": "d542cdf422a3cd0f8ef52edad24d5308", "score": "0.61871207", "text": "function init() {\n handleClicks();\n handleEscKey();\n handleFocusChanges();\n}", "title": "" }, { "docid": "686af1a79805dff0af6e4e94fac44c2a", "score": "0.61864334", "text": "function pageReady() {\n legacySupport();\n // updateHeaderActiveClass();\n // initHeaderScroll();\n\n initPopups();\n initSliders();\n initScrollMonitor();\n initMasks();\n initSelectric();\n initValidations();\n\n // custom\n // videoEvents(); \n // scrollTop();\n inputFile();\n customTabs();\n progressBar();\n if(_window.width() > 768){\n initFullPage();\n aboutAnim();\n absAnim();\n }\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n\n // AVAILABLE in _components folder\n // copy paste in main.js and initialize here\n // initPerfectScrollbar();\n // initLazyLoad();\n // initTeleport();\n // parseSvg();\n // revealFooter();\n // _window.on('resize', throttle(revealFooter, 100));\n }", "title": "" }, { "docid": "1b5432e66da8d8aa5e810494836d2b1d", "score": "0.61823446", "text": "function initializePage() {\n\t// console.log(\"Javascript connected!\");\n\tclubCounter = 0;\n recId = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];\n\n\tgetClubs();\n\n\t// add listeners to the buttons\n\t$(\"#no-btn\").click(noClick);\n\t$(\"#yes-btn\").click(yesClick);\n\t$(\"#yes-modal-back-to-matching-btn\").click(noClick);\n\t$(\"#show-events-btn\").click(showEventList);\n\t$(\"#yes-modal-go-to-favorites-btn\").click(goToFavorites);\n\t$(\"#no-more-modal-go-to-profile-btn\").click(goToProfile);\n\t$(\"#start-again-btn\").click(goToMatchMe);\n}", "title": "" }, { "docid": "e3acb3c3d9306914aa5c02bd45cdc246", "score": "0.61811393", "text": "function pageReady(){\n legacySupport();\n\n setPageNavClass();\n headerScrollListener();\n _window.on('scroll', throttle(headerScrollListener, 10));\n revealFooter();\n _window.on('resize', throttle(revealFooter, 100));\n\n // initPopups();\n // initSliders();\n initScrollMonitor();\n // initRellax();\n initValidation();\n // initMasks();\n setScheduleProgress();\n\n // temp - developer\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "title": "" }, { "docid": "d1e5cc5138944cdc4390eb2c46167129", "score": "0.6179695", "text": "function edgtfOnDocumentReady() {\n \tedgtfTitleFullWidthResize();\n edgtfEventImagesSlider();\n edgtfEventsRelatedProducts();\n edgtfInitEventsLoadMore();\n edgtfInitEventListCarousel();\n }", "title": "" }, { "docid": "35f3da8ed2b09ec93f916b3cfad20aea", "score": "0.61789423", "text": "function init() {\n initEventHandlers();\n loadBatch();\n }", "title": "" }, { "docid": "1b5b762719ff0850731e5a2098f8393d", "score": "0.61787087", "text": "function init() {\n loadSearch();\n id('popup-form').addEventListener('submit', function(form) {\n form.preventDefault();\n submitServer();\n });\n id('add-button').addEventListener('click', showPopup);\n id('close-button').addEventListener('click', hidePopup);\n }", "title": "" } ]